:root {
  color-scheme: dark;
  --page: #0c1118;
  --panel: #141c26;
  --line: #354352;
  --text: #f5fafc;
  --muted: #adbcc8;
  --teal: #8be2d4;
  --action: #a9efe3;
  --error: #ffc6c6;
  font-family: "Aptos", "Segoe UI Variable", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background: radial-gradient(ellipse 900px 470px at 36% 0%, #223344, transparent), var(--page);
}

button, input, select, textarea { font: inherit; }
a { color: var(--teal); }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; }

.site-header, main, footer {
  width: min(100% - 32px, 1040px);
  margin-inline: auto;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-block: 20px 16px;
  border-bottom: 1px solid var(--line);
}

.wordmark, .back-link { text-decoration: none; }
.wordmark { color: var(--text); font-size: 1rem; font-weight: 850; letter-spacing: 0.17em; }
.header-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.site-header .header-actions { justify-content: flex-end; }

.back-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
  background: transparent;
  cursor: pointer;
}

.back-link:hover { border-color: var(--teal); }
.page-heading { max-width: 680px; margin-block: clamp(26px, 6vw, 64px) 28px; }

.eyebrow {
  margin: 0 0 8px;
  color: var(--teal);
  font-size: 0.76rem;
  font-weight: 750;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1, h2, h3, p { margin-block: 0; }

h1 {
  font-size: clamp(2rem, 5vw, 4rem);
  font-weight: 760;
  line-height: 1.04;
  letter-spacing: -0.047em;
  text-wrap: balance;
}

.page-heading > #upgradeIntro {
  margin-top: 14px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.5;
}

.billing-notice {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: var(--panel);
  font-size: 0.9rem;
  line-height: 1.5;
}

.pricing-examples { margin-bottom: 28px; }
.pricing-examples h2 { margin-bottom: 12px; font-size: 1.2rem; }
.example-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.example-card {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 8px;
  padding: clamp(14px, 3vw, 20px);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}

.example-scope { color: var(--muted); font-size: 0.9rem; line-height: 1.45; }
.example-card button { justify-self: start; margin-top: 5px; }
.example-card button:disabled { opacity: 0.5; cursor: default; }

.upgrade-guide {
  display: grid;
  gap: 14px;
  margin-bottom: 26px;
  padding: clamp(14px, 3vw, 24px);
  border: 1px solid #4f746f;
  border-radius: 12px;
  background: radial-gradient(ellipse at top left, #1b3740, transparent 70%), var(--panel);
}

.upgrade-guide h2 {
  font-size: clamp(1.18rem, 3vw, 1.55rem);
  line-height: 1.2;
}

.upgrade-guide form {
  display: grid;
  justify-items: start;
  gap: 8px;
}

.upgrade-guide textarea { width: 100%; min-width: 0; }
.upgrade-guide form button { margin-top: 4px; }
.upgrade-guide .form-status:empty { display: none; }

.upgrade-guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  gap: 12px;
  min-width: 0;
  scroll-margin-block-start: 16px;
}

.upgrade-guide-card {
  grid-template-rows: auto auto 1fr auto;
  min-width: 0;
  overflow-wrap: anywhere;
}

.upgrade-guide-card h3 { font-size: 1.06rem; }
.upgrade-guide-card dl { display: grid; align-content: start; gap: 7px; margin: 0; }
.upgrade-guide-card button { border-color: #5e958e; background: #9ce8dd11; }

.upgrade-guide-card dt {
  color: var(--teal);
  font-size: .76rem;
  font-weight: 750;
}

.upgrade-guide-card dd {
  margin: 2px 0 0;
  font-size: .9rem;
  line-height: 1.4;
}

.builder { display: grid; gap: 20px; }

fieldset {
  min-inline-size: 0;
  margin: 0;
  padding: 12px clamp(12px, 3vw, 22px) clamp(12px, 3vw, 20px);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}

legend { padding-inline: 6px; font-weight: 760; font-size: 1.08rem; }

.field-intro, .quote-panel > p:not(.eyebrow), .consulting-quote p, .request > p {
  color: var(--muted);
  line-height: 1.5;
}

.choices {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.choice {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 9px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--page);
  cursor: pointer;
}

.choice:hover, .choice:has(input:checked) { border-color: var(--teal); }
.choice:has(input:checked) { background: #152829; }

.choice input {
  width: 17px;
  height: 17px;
  margin: 2px 0 0;
  accent-color: var(--teal);
}

.choice strong, .choice small { display: block; }
.choice strong { font-size: 0.93rem; line-height: 1.24; }
.choice small { margin-top: 4px; color: var(--muted); line-height: 1.35; }
.consulting-choice { max-width: 490px; }

.consulting-inputs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  max-width: 390px;
  margin-top: 12px;
}

.consulting-inputs p {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.87rem;
}

.consulting-inputs label, .persona-details label, .request label {
  display: block;
  font-size: 0.92rem;
  font-weight: 650;
}

input:not([type="checkbox"]), select, textarea {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  margin-top: 5px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: var(--page);
}

textarea { resize: vertical; }

select {
  appearance: none;
  padding-inline-end: 32px;
  background:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%) right 16px center / 5px 5px no-repeat,
    linear-gradient(135deg, var(--muted) 50%, transparent 50%) right 11px center / 5px 5px no-repeat,
    var(--page);
}

@media (forced-colors: active) {
  select { appearance: auto; }
}

.calculate {
  display: grid;
  grid-template-columns: minmax(0, 256px) max-content minmax(0, 1fr);
  align-items: end;
  gap: 10px 16px;
  margin-top: 20px;
}

.primary-button {
  width: fit-content;
  max-width: 100%;
  min-height: 44px;
  padding: 11px 15px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #132323;
  background: var(--action);
  font-weight: 760;
  cursor: pointer;
}

.primary-button:hover:not(:disabled) { background: #d0fff7; }
.primary-button:disabled { opacity: 0.5; cursor: default; }
.form-status { font-size: 0.9rem; line-height: 1.5; }
.form-status:empty { display: none; }
.form-status[data-error="true"] { color: var(--error); }

.calculate-hint {
  align-self: center;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.quote-panel {
  margin-top: 22px;
  padding: clamp(16px, 3vw, 26px);
  border: 1px solid #568b83;
  border-radius: 12px;
  background: #152427;
  scroll-margin-top: 18px;
}

.quote-panel h2 { margin-bottom: 8px; font-size: clamp(1.35rem, 4vw, 1.75rem); }

.prices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-block: 16px;
}

.prices div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #0f181d;
}

.prices dt { color: var(--muted); font-size: 0.86rem; line-height: 1.35; }
.prices dd {
  margin: 4px 0 0;
  font-size: clamp(1.22rem, 4vw, 2rem);
  font-weight: 740;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
  overflow-wrap: anywhere;
}
.consulting-quote, .request { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.consulting-quote p + p { margin-top: 6px; }
.request { display: grid; gap: 12px; }
.persona-details small, .request small { color: var(--muted); font-weight: 500; }
.consulting-quote h3, .request h3 { font-size: 1rem; }

.persona-details {
  display: grid;
  gap: 12px;
  margin-top: 20px;
  padding: clamp(12px, 3vw, 20px);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}

.persona-details h2 { font-size: 1.08rem; }
.consulting-quote h3 { margin-bottom: 5px; }

footer { padding-block: 32px 24px; color: var(--muted); font-size: 0.8rem; }

.top-up, .credit-estimate { grid-column: 1 / -1; }
.prices small { display: block; margin-top: 5px; color: var(--muted); font-size: 0.86rem; line-height: 1.4; }
.prices dd small { font-weight: 500; }

.view-inputs label, .spread-term, .refresh-cadence {
  display: block;
  font-size: 0.92rem;
  font-weight: 650;
}

.view-inputs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  max-width: 415px;
  margin-top: 12px;
}
.spread-term { width: min(100%, 256px); }
#checkoutRefreshSlot select { max-width: 260px; }
#refreshCadenceDefinition { margin-top: 5px; }

.calculate .form-status { grid-column: 1 / -1; }

.quote-panel > p.headline-total {
  color: var(--teal);
  font-size: clamp(1.6rem, 6vw, 3rem);
  font-weight: 760;
  margin: 4px 0 10px;
  line-height: 1.12;
  overflow-wrap: anywhere;
}

.monthly-breakdown { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.breakdown-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.breakdown-heading > span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 680;
  align-self: center;
}

.monthly-breakdown dl { margin-block: 8px; }

.monthly-breakdown dl > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-block: 10px;
  border-bottom: 1px solid var(--line);
}

.monthly-breakdown dt { min-width: 0; font-weight: 650; overflow-wrap: anywhere; }
.monthly-breakdown dt small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 450;
  line-height: 1.4;
}

.monthly-breakdown dd {
  flex: none;
  max-width: 42%;
  margin: 0;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
  text-align: end;
}
.monthly-breakdown p { color: var(--muted); line-height: 1.4; }
.ongoing-price:empty { display: none; }

.coverage-options {
  padding: 0 clamp(12px, 3vw, 18px);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.coverage-options summary {
  color: var(--text);
  font-weight: 750;
  cursor: pointer;
}

.coverage-options[open] { padding-bottom: 12px; }
.coverage-options[open] .integration-inputs { margin-top: 10px; }

.coverage-options summary, .sales-impact summary, .integration-costs summary, .field-definitions summary {
  min-height: 44px;
  padding-block: 11px;
  line-height: 1.4;
}
.custom-location-count { margin-top: 10px; }

.integration-inputs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.integration-inputs label, .sales-impact label {
  display: block;
  font-size: 0.92rem;
  font-weight: 650;
}

.integration-costs {
  margin-block: 8px;
  border-bottom: 1px solid var(--line);
}

.integration-costs summary {
  color: var(--teal);
  font-size: 0.89rem;
  font-weight: 650;
  cursor: pointer;
}

.sales-impact {
  margin-top: 18px;
  padding: 0 clamp(12px, 2vw, 18px);
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--page);
}

.sales-impact summary {
  color: var(--teal);
  font-weight: 740;
  cursor: pointer;
}

.sales-impact[open] { padding-bottom: 14px; }

.sales-impact p {
  margin-block: 6px 9px;
  color: var(--muted);
  line-height: 1.45;
}

.sales-impact input { max-width: 350px; }
.sales-impact .sales-impact-hint { font-size: 0.86rem; }
.sales-impact .sales-impact-result { margin-bottom: 0; color: var(--text); font-weight: 620; }
.sales-impact p:empty { display: none; }

.upgrade-tour {
  width: min(100% - 32px, 480px);
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);
  padding: clamp(18px, 5vw, 28px);
  overflow: hidden;
  border: 1px solid #66a69f;
  border-top: 3px solid var(--teal);
  border-radius: 12px;
  color: var(--text);
  background: var(--panel);
  box-shadow: 0 20px 56px rgba(5, 10, 15, 0.38);
}

.upgrade-tour[open], .upgrade-tour form { display: flex; flex-direction: column; }
.upgrade-tour form, .tour-copy { min-height: 0; }
.tour-copy { overflow-y: auto; overscroll-behavior: contain; }
.tour-copy:focus-visible { outline-offset: -2px; }
.tour-heading { display: flex; align-items: center; gap: clamp(10px, 3vw, 16px); }
.tour-heading > div { min-width: 0; }
.tour-guide-replay {
  --tour-guide-size: clamp(52px, 14vw, 68px);
  position: relative;
  flex: none;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: var(--teal);
  background: transparent;
  cursor: pointer;
}
.tour-guide-replay:focus-visible { outline-offset: -2px; }
.tour-guide-replay:disabled { cursor: default; }
.tour-guide-replay-icon {
  position: absolute;
  inset: auto 0 0 auto;
  display: grid;
  place-items: center;
  width: 21px;
  height: 21px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--page);
  font-size: 0.9rem;
  line-height: 1;
}
.tour-guide-replay:disabled .tour-guide-replay-icon { display: none; }

.upgrade-tour::backdrop { background: rgba(8, 13, 17, .56); }
.upgrade-tour h2 { font-size: clamp(1.35rem, 5vw, 1.75rem); }
#upgradeTourProgress {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  margin-bottom: 6px;
  padding: 3px 8px;
  border: 1px solid rgba(139, 226, 212, 0.42);
  border-radius: 999px;
  background: rgba(139, 226, 212, 0.09);
  color: var(--teal);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}
#upgradeTourCopy { margin-top: 12px; color: var(--muted); line-height: 1.5; }
#upgradeTourTryGuide { border-color: #5e958e; }
.tour-actions {
  display: flex;
  flex-shrink: 0;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 22px;
}

.tour-actions .header-actions { justify-content: flex-end; margin-inline-start: auto; }

@media (max-height: 360px) {
  .upgrade-tour { padding: 12px; }
  .tour-guide-replay { --tour-guide-size: 48px; }
  .tour-actions { margin-top: 10px; }
}

.request .contract-term { color: var(--text); font-size: 0.9rem; }

.commitment-prices div {
  border-color: #568b83;
}

.scope-fields {
  padding: 0;
  border: 0;
  background: transparent;
}

.scope-fields :disabled {
  cursor: default;
}

.scope-fields:disabled .choice:not(:has(input:checked)):hover {
  border-color: var(--line);
}

.order-summary {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 16px 20px;
  margin-bottom: 24px;
  padding: clamp(14px, 3vw, 22px);
  border: 1px solid #568b83;
  border-radius: 12px;
  background: #152427;
  scroll-margin-top: 18px;
}

.order-summary > div:first-child { flex: 1 1 360px; min-width: 0; }
.order-summary h2 { margin-bottom: 6px; font-size: 1.3rem; }
.order-summary p { color: var(--muted); line-height: 1.5; }
.order-summary .order-payment, .request .checkout-amount {
  color: var(--teal);
  font-weight: 750;
  overflow-wrap: anywhere;
}
.order-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.final-sale-terms {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--page);
}

.resume-sale-terms { flex: 1 0 100%; }
.final-sale-terms p, .order-summary .payment-sale-policy { color: var(--muted); font-size: 0.9rem; }
.final-sale-terms strong, .payment-sale-policy strong { color: var(--text); }

label.final-sale-acknowledgment {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  margin-top: 4px;
  padding-block: 6px;
  line-height: 1.4;
  font-size: 0.92rem;
  font-weight: 650;
}

.final-sale-acknowledgment input {
  flex: 0 0 1rem;
  width: 1rem;
  height: 1rem;
  margin: 0;
  accent-color: var(--teal);
}

.ach-payment {
  display: grid;
  flex: 1 0 100%;
  gap: 14px;
  min-width: 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
#achPaymentElement { min-width: 0; }
.ach-payment-status { flex: 1 0 100%; }
.ach-payment-status:empty { display: none; }

.account-settings {
  margin-bottom: 24px;
  padding: clamp(14px, 3vw, 22px);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  scroll-margin-top: 18px;
}

.account-settings h2 { font-size: 1.3rem; }
.account-settings h3 { font-size: 1rem; }
.account-settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 14px; }
.account-settings-grid section { display: grid; align-content: start; gap: 12px; min-width: 0; padding: clamp(12px, 2vw, 16px); border: 1px solid var(--line); border-radius: 8px; }
.account-settings-grid p, #apiDefinition { color: var(--muted); font-size: 0.88rem; line-height: 1.45; }
.account-settings-grid form { display: grid; gap: 10px; }
.account-settings-grid label { font-size: 0.92rem; font-weight: 650; }
.account-settings-grid button { justify-self: start; }
#apiDefinition { display: block; margin-top: 5px; }

.field-definitions { margin-top: 4px; color: var(--muted); font-size: 0.88rem; line-height: 1.45; }
.field-definitions summary { cursor: pointer; }
.field-definitions summary:hover, .field-definitions summary:focus-visible { color: var(--teal); }
.field-definitions p, .field-definitions dl { margin: 0; }
.field-definitions dl div + div { margin-top: 8px; }
.field-definitions dt { font-weight: 700; color: var(--text); }
.field-definitions dd { margin: 0; }

.upgrade-sign-in {
  max-width: 640px;
  margin-bottom: 24px;
  padding: clamp(14px, 4vw, 22px);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}

.upgrade-sign-in h2 { font-size: clamp(1.2rem, 4vw, 1.5rem); }
.upgrade-sign-in h2 + p, #upgradeRoomNotice { margin-top: 8px; color: var(--muted); line-height: 1.5; }
.upgrade-sign-in > .eyebrow { margin-bottom: 8px; }
.upgrade-sign-in form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.upgrade-sign-in label { font-size: 0.92rem; font-weight: 650; }
#upgradeInstanceSetup { grid-template-columns: minmax(0, 1fr) auto; align-items: end; }

#upgradeInstanceSetup[data-buyer] { grid-template-columns: minmax(0, 1fr); align-items: stretch; }
#upgradeInstanceSetup[data-buyer] > button { justify-self: start; }
.upgrade-buyer-details { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.upgrade-buyer-details small { display: block; margin-top: 6px; color: var(--muted); line-height: 1.4; }
.buyer-draft {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 16px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  overflow-wrap: anywhere;
}
.buyer-draft h2 { font-size: 1.12rem; }
.buyer-draft p, #upgradeEngagementLoginHelp { margin-top: 6px; color: var(--muted); }

@media (max-width: 520px) {
  .upgrade-buyer-details { grid-template-columns: minmax(0, 1fr); }
  #upgradeInstanceSetup[data-buyer] > button { justify-self: stretch; }
}
.upgrade-sign-in-actions, .upgrade-sign-in .form-status { grid-column: 1 / -1; }
.upgrade-sign-in-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

@media (max-width: 760px) {
  .choices { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .account-settings-grid, .upgrade-sign-in form { grid-template-columns: minmax(0, 1fr); }
  .calculate { grid-template-columns: minmax(0, 1fr) auto; }
  .calculate-hint { grid-column: 1 / -1; }
  input:not([type="checkbox"]), select, textarea { font-size: 1rem; }
}

@media (max-width: 480px) {
  .site-header { gap: 12px; padding-block: 12px; }
  .page-heading { margin-block: 24px 22px; }
  .example-grid, .choices, .integration-inputs, .view-inputs,
  #upgradeInstanceSetup, .calculate, .order-actions {
    grid-template-columns: minmax(0, 1fr);
  }
  .order-actions { display: grid; width: 100%; }
  #checkoutRefreshSlot select, .sales-impact input { max-width: none; }
  .spread-term { width: 100%; }
  .calculate > button, .upgrade-sign-in-actions > .primary-button,
  #upgradeInstanceSetup > button, .order-actions > button, .ach-payment > button,
  .account-settings-grid button, .request > button { width: 100%; }
  .upgrade-sign-in-actions { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
  .choice { padding: 11px 12px; }
}

@media (max-width: 380px) {
  .site-header, main, footer { width: calc(100% - 24px); }
  #upgradeTourTryGuide { flex-basis: 100%; }
  .prices { grid-template-columns: minmax(0, 1fr); }
  .quote-panel > p.headline-total { font-size: 1.4rem; }
}
