:root {
  --page-bg: #f5f7fb;
  --surface: #ffffff;
  --surface-soft: #edf4f1;
  --ink: #172126;
  --muted: #62717a;
  --line: #dce4e8;
  --primary: #176b63;
  --primary-dark: #0f4e49;
  --blue: #2f6f9f;
  --amber: #b7791f;
  --green: #2f855a;
  --sidebar: #102326;
}

html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--page-bg);
  color: var(--ink);
}

.btn-primary {
  --bs-btn-bg: var(--primary);
  --bs-btn-border-color: var(--primary);
  --bs-btn-hover-bg: var(--primary-dark);
  --bs-btn-hover-border-color: var(--primary-dark);
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-select:focus,
.form-check-input:focus {
  box-shadow: 0 0 0 0.12rem #ffffff, 0 0 0 0.28rem rgba(23, 107, 99, 0.28);
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.app-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 1.25rem;
  background: var(--sidebar);
  color: #e8f2ef;
}

.brand {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 0.75rem;
  color: #ffffff;
  text-decoration: none;
}

.brand:hover {
  color: #ffffff;
}

.brand-mark {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 12px;
  background:
    radial-gradient(circle at 50% 48%, rgba(45, 212, 191, 0.16), transparent 58%),
    linear-gradient(145deg, #071719 0%, #0d2428 100%);
  border: 1px solid rgba(103, 247, 255, 0.18);
  box-shadow:
    inset 0 0 18px rgba(20, 184, 166, 0.12),
    0 0 18px rgba(34, 197, 94, 0.12),
    0 8px 20px rgba(0, 0, 0, 0.22);
}

.brand-mark img {
  display: block;
  width: 43px;
  height: 43px;
}

.brand small {
  display: block;
  color: #a8c4be;
  font-size: 0.78rem;
}

.sidebar-nav {
  display: grid;
  flex: 1 1 auto;
  min-height: 0;
  align-content: start;
  gap: 0.35rem;
  padding-right: 0.35rem;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(168, 196, 190, 0.45) transparent;
}

.sidebar-nav::-webkit-scrollbar {
  width: 6px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  border-radius: 6px;
  background: rgba(168, 196, 190, 0.45);
}

.sidebar-nav a {
  padding: 0.72rem 0.8rem;
  color: #dbe9e6;
  text-decoration: none;
  border-radius: 8px;
}

.sidebar-nav a:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.sidebar-group {
  border-radius: 8px;
}

.sidebar-group summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.72rem 0.8rem;
  color: #dbe9e6;
  border-radius: 8px;
  cursor: pointer;
  list-style: none;
}

.sidebar-group summary::-webkit-details-marker {
  display: none;
}

.sidebar-group summary::after {
  content: "+";
  color: #a8c4be;
  font-weight: 800;
}

.sidebar-group[open] summary,
.sidebar-group summary:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.sidebar-group[open] summary::after {
  content: "-";
}

.sidebar-subnav {
  display: grid;
  gap: 0.2rem;
  padding: 0.25rem 0 0.35rem 0.65rem;
}

.sidebar-subnav a {
  padding: 0.55rem 0.7rem;
  color: #c7dbd6;
  font-size: 0.94rem;
}

.sidebar-account {
  flex-shrink: 0;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.account-card {
  padding: 0.9rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
}

.account-card a {
  color: #ffffff;
  overflow-wrap: anywhere;
}

.app-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.content-wrap {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 3rem;
  flex: 1;
}

.app-footer {
  padding: 1rem;
  color: var(--muted);
  border-top: 1px solid var(--line);
  background: #ffffff;
}

.hero-section {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 1.5rem;
  align-items: stretch;
  min-height: 540px;
  padding: 3rem;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(239, 247, 244, 0.92)),
    url("data:image/svg+xml,%3Csvg width='900' height='600' viewBox='0 0 900 600' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%23176b63' stroke-opacity='.16' stroke-width='2'%3E%3Cpath d='M110 450h680M170 390h560M230 330h440M290 270h320M350 210h200'/%3E%3Cpath d='M150 450l260-300 110 130 90-95 150 265'/%3E%3Ccircle cx='410' cy='150' r='42' fill='%23176b63' fill-opacity='.08'/%3E%3C/g%3E%3C/svg%3E");
  background-size: cover;
  border: 1px solid var(--line);
}

.hero-copy {
  align-self: center;
  max-width: 760px;
}

.hero-kicker {
  display: flex;
  align-items: center;
  gap: 0.95rem;
  margin-bottom: 0.85rem;
}

.hero-kicker img {
  width: clamp(86px, 10vw, 124px);
  aspect-ratio: 1;
  object-fit: contain;
  border-radius: 22px;
  box-shadow: 0 18px 38px rgba(9, 35, 40, 0.28);
}

.eyebrow {
  display: inline-block;
  margin-bottom: 0.65rem;
  color: var(--primary);
  font-weight: 800;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0;
}

.hero-kicker .eyebrow {
  margin-bottom: 0;
}

.hero-copy h1 {
  max-width: 820px;
  margin: 0 0 1rem;
  font-size: clamp(2.2rem, 4vw, 4.4rem);
  line-height: 1.02;
  letter-spacing: 0;
}

.hero-copy p {
  max-width: 680px;
  color: var(--muted);
  font-size: 1.12rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.hero-panel {
  display: grid;
  gap: 1rem;
  align-content: center;
}

.metric-card,
.feature-card,
.setup-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 16px 44px rgba(25, 42, 50, 0.08);
}

.metric-card {
  padding: 1.1rem;
  border-left: 5px solid var(--primary);
}

.metric-card span,
.metric-card small {
  display: block;
  color: var(--muted);
}

.metric-card strong {
  display: block;
  margin: 0.3rem 0;
  font-size: 1.45rem;
}

.accent-green { border-left-color: var(--green); }
.accent-blue { border-left-color: var(--blue); }
.accent-amber { border-left-color: var(--amber); }

.section-band,
.workflow-section {
  margin-top: 1.5rem;
  padding: 2rem;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.section-heading {
  max-width: 720px;
  margin-bottom: 1.25rem;
}

.section-heading h2,
.workflow-section h2 {
  margin: 0;
  font-size: 1.7rem;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.feature-card {
  padding: 1.25rem;
}

.feature-card h3 {
  font-size: 1.05rem;
  margin-bottom: 0.65rem;
}

.feature-card p {
  margin: 0;
  color: var(--muted);
}

.workflow-section {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 1.5rem;
  align-items: start;
}

.workflow-steps {
  display: grid;
  gap: 0.85rem;
}

.workflow-steps div {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 0.85rem;
  align-items: center;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.workflow-steps strong {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-soft);
  color: var(--primary-dark);
}

.setup-card {
  padding: 2rem;
}

.card {
  border-radius: 8px;
}

.help-header {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(300px, 0.7fr);
  gap: 2rem;
  align-items: end;
  padding: 2.5rem;
  color: #f5fbfa;
  background: #143237;
  border: 1px solid #24494e;
  border-radius: 8px;
}

.help-header h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(2.2rem, 4vw, 3.8rem);
  line-height: 1;
  letter-spacing: 0;
}

.help-header p {
  max-width: 700px;
  margin: 0;
  color: #c4d9d5;
  font-size: 1.08rem;
}

.help-kicker {
  display: block;
  margin-bottom: 0.55rem;
  color: #45d3c4;
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

.help-search-wrap .form-label {
  color: #e8f2ef;
  font-weight: 700;
}

.help-search-wrap .form-control {
  border-color: #6a8c8d;
  background: #ffffff;
}

.help-search-summary {
  display: block;
  min-height: 1.4rem;
  margin-top: 0.45rem;
  color: #a8c4be;
  font-size: 0.86rem;
}

.help-quick-path {
  display: grid;
  grid-template-columns: minmax(210px, 0.55fr) minmax(0, 1.45fr);
  gap: 2rem;
  align-items: center;
  margin: 1.25rem 0;
  padding: 1.4rem 0;
  border-bottom: 1px solid var(--line);
}

.help-quick-path h2 {
  margin: 0;
  font-size: 1.35rem;
}

.help-quick-path ol {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.6rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.help-quick-path li {
  display: grid;
  gap: 0.4rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.help-quick-path li span {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  color: #ffffff;
  background: var(--primary);
}

.help-layout {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 2.5rem;
  align-items: start;
}

.help-contents {
  position: sticky;
  top: 1.5rem;
  max-height: calc(100vh - 3rem);
  padding-right: 0.75rem;
  overflow-y: auto;
}

.help-contents > strong {
  display: block;
  margin-bottom: 0.6rem;
  color: var(--ink);
  font-size: 0.84rem;
  text-transform: uppercase;
}

.help-contents nav {
  display: grid;
  gap: 0.15rem;
  border-left: 1px solid var(--line);
}

.help-contents a {
  padding: 0.48rem 0.75rem;
  color: var(--muted);
  text-decoration: none;
  border-left: 3px solid transparent;
}

.help-contents a:hover,
.help-contents a:focus {
  color: var(--primary-dark);
  border-left-color: var(--primary);
  background: var(--surface-soft);
}

.help-content {
  min-width: 0;
}

.help-topic {
  padding: 0.5rem 0 2.5rem;
  margin-bottom: 2.25rem;
  scroll-margin-top: 1.5rem;
  border-bottom: 1px solid var(--line);
}

.help-topic[hidden],
.help-contents a[hidden] {
  display: none;
}

.help-topic-heading {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1.2rem;
}

.help-topic-heading > span {
  display: grid;
  flex: 0 0 46px;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid #9fc9c2;
  border-radius: 50%;
  color: var(--primary-dark);
  background: var(--surface-soft);
  font-weight: 800;
}

.help-topic-heading p {
  margin: 0 0 0.12rem;
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
}

.help-topic-heading h2 {
  margin: 0;
  font-size: 1.75rem;
}

.help-topic h3 {
  margin: 1.3rem 0 0.4rem;
  font-size: 1.05rem;
}

.help-topic > p {
  max-width: 850px;
  color: #46575f;
  line-height: 1.7;
}

.help-steps {
  display: grid;
  gap: 0;
  margin: 1.25rem 0;
  padding: 0;
  list-style: none;
  counter-reset: help-step;
  border-top: 1px solid var(--line);
}

.help-steps li {
  display: grid;
  grid-template-columns: minmax(190px, 0.55fr) minmax(0, 1.45fr);
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
}

.help-steps span,
.help-checklist span {
  color: var(--muted);
  line-height: 1.55;
}

.help-note,
.help-decision {
  margin-top: 1.25rem;
  padding: 1rem 1.15rem;
  border-left: 4px solid var(--amber);
  background: #fff9ed;
  color: #584a2d;
}

.help-decision {
  display: grid;
  grid-template-columns: minmax(180px, 0.45fr) minmax(0, 1.55fr);
  gap: 1rem;
  border-left-color: var(--blue);
  background: #f0f6fa;
  color: #334e61;
}

.help-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
  margin: 1.25rem 0;
}

.help-split > div {
  padding: 0 0 0 1rem;
  border-left: 3px solid #90bdb5;
}

.help-split h3 {
  margin-top: 0;
}

.help-split p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.6;
}

.help-checklist {
  display: grid;
  gap: 0;
  margin: 1.25rem 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.help-checklist li {
  display: grid;
  grid-template-columns: minmax(170px, 0.4fr) minmax(0, 1.6fr);
  gap: 1rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--line);
}

.help-role-table {
  margin: 1.25rem 0;
}

.help-role-table th:first-child,
.help-role-table td:first-child {
  width: 220px;
  font-weight: 700;
}

.help-faq {
  border-bottom: 1px solid var(--line);
}

.help-faq summary {
  padding: 1rem 2rem 1rem 0;
  color: var(--ink);
  font-weight: 750;
  cursor: pointer;
}

.help-faq p {
  max-width: 850px;
  padding: 0 0 1rem;
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.help-no-results {
  padding: 3rem 0;
  text-align: center;
}

.help-no-results h2 {
  font-size: 1.5rem;
}

@media (max-width: 991px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .app-sidebar {
    position: static;
    height: auto;
  }

  .sidebar-nav {
    flex: initial;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-height: auto;
    padding-right: 0;
    overflow-y: visible;
  }

  .hero-section,
  .workflow-section {
    grid-template-columns: 1fr;
  }

  .feature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .help-header,
  .help-quick-path,
  .help-layout {
    grid-template-columns: 1fr;
  }

  .help-quick-path ol {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .help-contents {
    position: static;
    max-height: none;
  }

  .help-contents nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-left: 0;
  }

  .help-contents a {
    border-left: 0;
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 575px) {
  .content-wrap {
    width: min(100% - 1rem, 1180px);
    padding-top: 1rem;
  }

  .hero-section,
  .section-band,
  .workflow-section,
  .setup-card {
    padding: 1.2rem;
  }

  .sidebar-nav,
  .feature-grid {
    grid-template-columns: 1fr;
  }

  .hero-copy h1 {
    font-size: 2rem;
  }

  .hero-kicker {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero-kicker img {
    width: min(118px, 42vw);
  }

  .help-header {
    padding: 1.35rem;
  }

  .help-header h1 {
    font-size: 2.25rem;
  }

  .help-quick-path ol,
  .help-contents nav,
  .help-split {
    grid-template-columns: 1fr;
  }

  .help-steps li,
  .help-checklist li,
  .help-decision {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }

  .help-topic-heading {
    align-items: flex-start;
  }

  .help-topic-heading h2 {
    font-size: 1.4rem;
  }

  .help-role-table th:first-child,
  .help-role-table td:first-child {
    width: auto;
  }
}

.simulation-mode-wrap {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.simulation-mode-label {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.simulation-mode-tabs {
  display: inline-flex;
  gap: 0.25rem;
  padding: 0.28rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #eef3f4;
}

.simulation-mode-link {
  min-width: 76px;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  color: #7a8a91;
  text-align: center;
  text-decoration: none;
  font-weight: 700;
  transition: background-color 0.16s ease, box-shadow 0.16s ease, color 0.16s ease;
}

.simulation-mode-link:hover {
  color: var(--primary-dark);
}

.simulation-mode-link.active {
  background: #ffffff;
  color: var(--primary-dark);
  box-shadow: 0 0 0 2px rgba(23, 107, 99, 0.18), 0 8px 24px rgba(23, 107, 99, 0.22);
}

.subscription-heading,
.subscription-section-heading,
.subscription-plan,
.subscription-plan-action {
  display: flex;
  align-items: center;
}

.subscription-heading {
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.subscription-state {
  padding: 0.4rem 0.7rem;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 800;
}

.subscription-state.is-active {
  color: #135c43;
  background: #dff3e9;
}

.subscription-state.is-readonly {
  color: #80500c;
  background: #fff1cf;
}

.subscription-summary,
.subscription-purchase {
  padding: 1.5rem 0;
  border-top: 1px solid var(--line);
}

.subscription-summary h2,
.subscription-purchase h2 {
  margin: 0 0 1rem;
  font-size: 1.1rem;
}

.subscription-summary dl {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin: 0;
}

.subscription-summary dl div {
  min-width: 0;
}

.subscription-summary dt {
  margin-bottom: 0.25rem;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.subscription-summary dd {
  margin: 0;
  color: var(--ink);
  font-weight: 750;
}

.subscription-section-heading {
  justify-content: space-between;
  margin-bottom: 1rem;
}

.subscription-section-heading h2 {
  margin-bottom: 0.2rem;
}

.subscription-section-heading p,
.subscription-plan p,
.subscription-note {
  margin: 0;
  color: var(--muted);
}

.subscription-plan-grid {
  border-top: 1px solid var(--line);
}

.subscription-plan {
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
}

.subscription-plan-name {
  display: block;
  margin-bottom: 0.2rem;
  color: var(--ink);
  font-weight: 800;
}

.subscription-plan-action {
  flex: 0 0 auto;
  gap: 1rem;
}

.subscription-plan-action strong {
  min-width: 100px;
  text-align: right;
}

.subscription-plan-action .btn {
  min-width: 126px;
}

.subscription-note,
.subscription-payment-status {
  margin-top: 1rem;
  font-size: 0.92rem;
}

.subscription-payment-status:empty {
  display: none;
}

.subscription-payment-status.is-pending,
.subscription-payment-status.is-neutral {
  color: var(--muted);
}

.subscription-payment-status.is-success {
  color: #135c43;
}

.subscription-payment-status.is-error {
  color: #a22c2c;
}

@media (max-width: 767px) {
  .subscription-summary dl {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .subscription-plan {
    align-items: flex-start;
    flex-direction: column;
  }

  .subscription-plan-action {
    justify-content: space-between;
    width: 100%;
  }
}
