:root {
  --bg: #f5f7fb;
  --card: #ffffff;
  --text: #1f2430;
  --muted: #667085;
  --primary: #1250e6;
  --primary-dark: #0d46d0;
  --border: #e8eaf2;
  --shadow-soft: 0 6px 18px rgba(41, 47, 76, 0.06);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  padding-bottom: 92px;
}

a,
button {
  color: inherit;
  font: inherit;
}

a {
  text-decoration: none;
}

.plans-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 999;
  padding: 18px 16px 18px;
  background:
    radial-gradient(circle at top right, rgba(18, 80, 230, 0.16), transparent 32%),
    linear-gradient(180deg, #ffffff 0%, #f7f8fd 100%);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(232, 234, 242, 0.92);
  box-shadow: 0 14px 28px rgba(41, 47, 76, 0.08);
  display: grid;
  gap: 14px;
}

.topbar-spacer {
  display: none;
}

.topbar__nav,
.title-strip {
  width: min(100%, 1240px);
  margin-left: auto;
  margin-right: auto;
}

.topbar__nav {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.topbar__nav .back-link {
  justify-self: start;
}

.topbar__nav .support-link {
  justify-self: end;
}

.back-link {
  appearance: none;
  border: none;
  background: transparent;
  padding: 0;
  color: var(--primary-dark);
  font-weight: 700;
  cursor: pointer;
}

.brand--centered {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 0;
}

.brand__logo {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  box-shadow: 0 10px 24px rgba(18, 80, 230, 0.18);
  flex-shrink: 0;
}

.brand__name {
  font-size: 18px;
  font-weight: 800;
  white-space: nowrap;
}

.title-strip {
  padding: 14px 16px;
  border-radius: 18px;
  background: #eceff3;
  border: 1px solid #dde3eb;
}

.title-strip h1 {
  margin: 0;
  font-size: 22px;
  line-height: 1.1;
}

.plans-main {
  padding: 10px 16px 32px;
  display: grid;
  gap: 18px;
}

.intro-panel,
.plans-summary-panel,
.plans-table-panel {
  border: 1px solid var(--border);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: var(--shadow-soft);
  padding: 20px;
}

.plans-table-panel {
  overflow: hidden;
  display: grid;
  gap: 16px;
}

.plans-table-panel h2 {
  margin: 0;
  color: var(--primary-dark);
  font-size: 24px;
  line-height: 1.15;
}

.plans-summary-panel {
  display: grid;
  gap: 16px;
}

.plans-summary-panel h2 {
  margin: 0;
  color: var(--primary-dark);
  font-size: 24px;
  line-height: 1.15;
}

.plans-summary-grid {
  display: grid;
  gap: 12px;
}

.plan-summary-card {
  min-width: 0;
  border: 1px solid rgba(37, 211, 102, 0.22);
  border-radius: 20px;
  background: rgba(37, 211, 102, 0.08);
  color: #166534;
  padding: 16px;
  display: grid;
  gap: 8px;
  align-content: start;
}

.plan-summary-card--pro {
  border-color: rgba(245, 158, 11, 0.26);
  background: rgba(255, 244, 229, 0.7);
  color: #92400e;
}

.plan-summary-card h3 {
  margin: 0;
  font-size: 20px;
  line-height: 1.15;
}

.plan-summary-card strong {
  font-size: 30px;
  line-height: 1;
}

.plan-summary-card p {
  margin: 0;
  color: inherit;
  line-height: 1.45;
}

.plan-cta {
  appearance: none;
  border: none;
  border-radius: 14px;
  min-height: 44px;
  padding: 10px 16px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  font-weight: 800;
  text-transform: uppercase;
  cursor: pointer;
}

.plan-cta--table {
  min-height: 38px;
  min-width: 116px;
  font-size: 13px;
}

.paid-plans-modal[hidden] {
  display: none;
}

.paid-plans-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 18px;
}

.paid-plans-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.58);
  backdrop-filter: blur(4px);
}

.paid-plans-modal__card {
  position: relative;
  width: min(100%, 520px);
  border: 1px solid rgba(232, 234, 242, 0.96);
  border-radius: 22px;
  background: #ffffff;
  box-shadow: 0 24px 56px rgba(15, 23, 42, 0.22);
  padding: 22px;
  display: grid;
  gap: 16px;
}

.paid-plans-modal__card h2 {
  margin: 0;
  color: var(--primary-dark);
  font-size: 24px;
  line-height: 1.15;
}

.paid-plans-modal__message {
  display: grid;
  gap: 10px;
}

.paid-plans-modal__message p {
  margin: 0;
  color: #344054;
  font-size: 17px;
  line-height: 1.5;
}

.paid-plans-modal__actions {
  display: flex;
  justify-content: flex-end;
}

.paid-plans-modal__ok {
  appearance: none;
  border: none;
  border-radius: 14px;
  min-width: 120px;
  min-height: 44px;
  padding: 10px 20px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

.intro-panel {
  background: linear-gradient(135deg, rgba(18, 80, 230, 0.1), rgba(18, 80, 230, 0.04));
  display: grid;
  gap: 18px;
}

.intro-panel__eyebrow {
  margin: 0 0 10px;
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.intro-panel h2 {
  margin: 0;
  font-size: 30px;
  line-height: 1.08;
  text-wrap: balance;
}

.intro-panel p:last-child {
  margin: 12px 0 0;
  color: #475467;
  line-height: 1.65;
}

.intro-panel__patient-note {
  border-radius: 20px;
  padding: 16px 18px;
  background: rgba(37, 211, 102, 0.1);
  border: 1px solid rgba(37, 211, 102, 0.2);
  color: #166534;
}

.intro-panel__patient-label {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.intro-panel__patient-note p:last-child {
  margin: 0;
  color: #166534;
}

.plans-table-wrap {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 18px;
}

.plans-table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
}

.plans-table thead th {
  padding: 0 0 18px;
  text-align: left;
  border-bottom: 1px solid #e5e7eb;
  vertical-align: bottom;
  background: rgba(255, 255, 255, 0.98);
}

.plans-table thead th:not(:first-child) {
  text-align: center;
}

.plans-table tbody td {
  padding: 18px 0;
  border-bottom: 1px solid #eef1f5;
  font-size: 17px;
  vertical-align: middle;
  background: rgba(255, 255, 255, 0.98);
}

.plans-table tbody tr:last-child td {
  border-bottom: none;
}

.plans-table tbody td:first-child {
  width: 34%;
  padding-right: 18px;
  font-weight: 700;
}

.plans-table tbody td:not(:first-child) {
  width: 22%;
  text-align: center;
}

.plan-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 6px 12px;
  border-radius: 999px;
  margin-bottom: 10px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.plan-scroll-hint {
  display: none;
  margin-left: 6px;
  font-size: 14px;
  line-height: 1;
  animation: plan-scroll-hint 1.2s ease-in-out infinite;
}

.plan-badge--initial {
  background: #eef2ff;
  color: #4338ca;
}

.plan-badge--standard {
  background: #ecfdf3;
  color: #027a48;
}

.plan-badge--pro {
  background: #fff4e5;
  color: #b54708;
}

.plans-table strong {
  display: block;
  font-size: 28px;
}

.status-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 6px 12px;
  border-radius: 999px;
  font-weight: 700;
}

.status-mark--yes {
  background: #ecfdf3;
  color: #027a48;
}

.status-mark--no {
  background: #fef2f2;
  color: #b42318;
}

@media (min-width: 900px) {
  .plans-main {
    width: min(100%, 1240px);
    margin-left: auto;
    margin-right: auto;
  }
}

.support-bottom-bar {
  position: fixed !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  z-index: 999 !important;
  display: flex;
  justify-content: center;
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
  background: rgba(35, 48, 70, 0.86);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -10px 24px rgba(15, 23, 42, 0.12);
  backdrop-filter: blur(14px);
}

.support-bottom-bar__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 180px;
  padding: 12px 18px;
  border-radius: 16px;
  background: rgba(37, 211, 102, 0.14);
  border: 1px solid rgba(37, 211, 102, 0.24);
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.support-bottom-bar__button:hover {
  background: rgba(37, 211, 102, 0.22);
  border-color: rgba(37, 211, 102, 0.36);
  transform: translateY(-1px);
}

@media (max-width: 767px) {
  .plans-main {
    padding-inline: 12px;
  }

  .intro-panel,
  .plans-summary-panel,
  .plans-table-panel {
    padding: 16px;
  }

  .intro-panel h2 {
    font-size: 22px;
    line-height: 1.14;
  }

  .support-bottom-bar__button {
    width: 100%;
    max-width: 320px;
    min-width: 0;
    font-size: 13px;
  }

  .intro-panel p:last-child,
  .intro-panel__patient-note p:last-child {
    font-size: 14px;
    line-height: 1.55;
  }

  .plans-table {
    min-width: 620px;
  }

  .plans-table thead th:first-child,
  .plans-table tbody td:first-child {
    position: sticky;
    left: 0;
    z-index: 2;
    box-shadow: 10px 0 18px rgba(31, 36, 48, 0.06);
  }

  .plans-table thead th:first-child {
    z-index: 3;
  }

  .plans-table thead th:first-child::after,
  .plans-table tbody td:first-child::after {
    content: "";
    position: absolute;
    top: 0;
    right: -1px;
    width: 1px;
    height: 100%;
    background: #e5e7eb;
  }

  .plans-table thead th:first-child,
  .plans-table tbody td:first-child {
    min-width: 188px;
    width: 188px;
    max-width: 188px;
    padding-right: 14px;
  }

  .plans-table thead th:not(:first-child),
  .plans-table tbody td:not(:first-child) {
    min-width: 144px;
    width: 144px;
  }

  .plans-table thead th {
    padding-bottom: 14px;
  }

  .plans-table tbody td {
    padding-block: 14px;
    font-size: 15px;
  }

  .plans-table strong {
    font-size: 20px;
  }

  .plan-badge {
    min-height: 28px;
    padding: 5px 10px;
    margin-bottom: 8px;
    font-size: 11px;
  }

  .plan-scroll-hint {
    display: inline-block;
  }

  .status-mark {
    min-height: 30px;
    padding: 5px 10px;
    font-size: 13px;
    white-space: normal;
    line-height: 1.3;
  }

  .plans-summary-panel h2 {
    font-size: 22px;
  }

  .plan-summary-card h3 {
    font-size: 19px;
  }

  .plan-summary-card strong {
    font-size: 26px;
  }

  .paid-plans-modal {
    align-items: end;
    padding: 12px 12px calc(88px + env(safe-area-inset-bottom));
  }

  .paid-plans-modal__card {
    border-radius: 20px;
    padding: 18px;
  }

  .paid-plans-modal__card h2 {
    font-size: 22px;
  }

  .paid-plans-modal__message p {
    font-size: 15px;
    line-height: 1.45;
  }

  .paid-plans-modal__actions,
  .paid-plans-modal__ok {
    width: 100%;
  }
}

@media (min-width: 768px) {
  .plans-summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@keyframes plan-scroll-hint {
  0%,
  100% {
    transform: translateX(0);
    opacity: 0.6;
  }

  50% {
    transform: translateX(4px);
    opacity: 1;
  }
}

@media (max-width: 720px) {
  .brand__name {
    font-size: 16px;
  }

  .title-strip h1 {
    font-size: 20px;
  }

  .intro-panel h2 {
    font-size: 22px;
  }
}
