/* patient-support.css - The patient dashboard's Support tab (wiki/support-tab.md).
 *
 * Two voices on one page, on purpose:
 *  - daily's parts (the handoff panel, the consent dialog, "check your phone")
 *    carry the daily wordmark. Since the Evergreen colours (experience review
 *    2026-11-15) their --sp-* names point at the shared set: the panel is the
 *    soft panel colour, words are the ink and muted ink, buttons are forest,
 *    and Ember is the apricot decoration (the leaf dot and the tick only).
 *  - The services NeuroClarity delivers (follow-up, documentation) are plain
 *    platform cards and terracotta CTAs (acp-card, acp-cta), styled by
 *    aci-patient.css. This file only adds what those flows need beyond it.
 *
 * Ember (apricot) never colours text; daily's buttons are forest pills with
 * white words (11:1).
 */

.sp-root {
  --sp-slate: var(--color-text);          /* daily's words */
  --sp-slate-hover: var(--color-text);    /* button hover: the ink, as every main button */
  --sp-slate-soft: var(--color-muted);
  --sp-slate-dim: var(--color-muted);
  --sp-ember: var(--color-decor);         /* decoration only: leaf dot, tick */
  --sp-parchment: var(--color-card);      /* dialog and thread fill; words on forest */
  --sp-vellum: var(--color-panel);        /* the daily panel (was cream Vellum #F4F1DE) */
  display: flex;
  flex-direction: column;
  gap: 14px;
  color: var(--ps-text);
}

.sp-stub-notice {
  margin: 0;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--ps-amber-bg);
  color: #8a5a00;
  font-size: var(--fs-13, 13px);
}

/* ---------- Stage rail: the Support tab ---------- */

/* A hairline before the tab separates it from the evaluation's steps. */
.ps-stage-tab--support::before {
  content: '';
  position: absolute;
  left: -1px;
  top: 22%;
  bottom: 22%;
  border-left: 1px solid var(--ps-border);
}

.ps-stage-tab--support .ps-stage-tab-index {
  background: color-mix(in srgb, var(--color-decor) 12%, transparent);
  color: var(--color-decor);
  font-size: var(--fs-12, 12px);
}

.ps-stage-tab--support.ps-stage-tab--available .ps-stage-tab-state {
  color: var(--color-text);
}

/* ---------- daily voice ---------- */

.sp-wordmark {
  display: block;
  width: auto;
}

/* Headlines keep the dashboard's own font: only the wordmark carries daily's
   typeface (as an image), so the tab reads as part of NeuroClarity. P-27 (UI polish
   round 2): the same 600 weight as every other heading (400 read lighter than the rest). */
.sp-voice {
  font-family: inherit;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--sp-slate);
}

.sp-daily {
  padding: 26px 28px;
  border: 1px solid var(--color-line);
  border-radius: 16px;
  background: var(--sp-vellum);
  color: var(--sp-slate);
}

.sp-daily--quiet {
  padding: 30px 28px;
}

/* The Daily card on the Intake tab (intake-daily-card.js): the same quiet panel, with the
   padding of the Intake tab's other cards, and the one line spaced off the wordmark. */
.sp-intake-daily .sp-daily--quiet {
  padding: 22px 24px;
}

.sp-intake-daily-line {
  margin-top: 12px;
}

/* A phone number in a Daily line never breaks at its hyphen: "(202) 555-" / "0142". */
.sp-daily .sp-lede strong {
  white-space: nowrap;
}

.sp-daily-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 36px;
  align-items: start;
}

.sp-headline {
  max-width: 30ch;
  margin: 16px 0 8px;
  font-size: var(--fs-26, 26px);
  line-height: 1.3;
}

.sp-ok {
  color: var(--sp-ember);
  font-size: var(--fs-20, 20px);
  vertical-align: 1px;
}

.sp-lede {
  max-width: 54ch;
  margin: 0 0 16px;
  color: var(--sp-slate-soft);
  font-size: var(--fs-15, 15px);
  line-height: 1.6;
}

.sp-petals {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin: 0 0 22px;
  padding: 0;
  list-style: none;
  font-size: var(--fs-14, 14px);
  line-height: 1.5;
}

/* Each point carries a small Ember petal, echoing the dot of the wordmark's "i". */
.sp-petals li {
  position: relative;
  padding-left: 20px;
}

.sp-petals li::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 7px;
  width: 7px;
  height: 7px;
  border-radius: 50% 0 50% 50%;
  background: var(--sp-ember);
  transform: rotate(-30deg);
}

.acp-cta.sp-cta-daily {
  background: var(--color-main);
  color: var(--color-on-main);
  box-shadow: none;
  font-size: var(--fs-15, 15px);
  padding: 11px 24px;
}

.acp-cta.sp-cta-daily:hover {
  background: var(--sp-slate-hover);
}

.acp-cta.sp-cta-small {
  padding: 7px 16px;
  font-size: var(--fs-13, 13px);
}

.sp-cta-block {
  width: 100%;
}

/* The two paid links under daily. No lead-in line above them (no helper lines); a
   link is hidden while its purchase is open (PatientSupportUI.offer). Each link is a
   44px target. */
.sp-direct {
  display: flex;
  flex-wrap: wrap;
  gap: 0 26px;
  margin-top: 14px;
}

.sp-direct-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--sp-slate);
  font: inherit;
  font-size: var(--fs-14, 14px);
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: var(--color-line);
  text-underline-offset: 4px;
}

.sp-direct-link:hover {
  text-decoration-color: var(--sp-slate);
}

.sp-direct-link i {
  font-size: var(--fs-15, 15px);
}

/* The sample conversation, drawn as a small phone thread. */
.sp-thread {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 240px;
  margin: 0;
  padding: 14px 12px 10px;
  border-radius: 22px;
  background: var(--sp-parchment);
}

.sp-thread-head {
  display: flex;
  justify-content: center;
  margin-bottom: 6px;
}

.sp-bubble {
  max-width: 88%;
  padding: 8px 11px;
  border-radius: 14px;
  font-size: var(--fs-13, 13px);
  line-height: 1.45;
}

.sp-bubble--them {
  align-self: flex-start;
  background: var(--sp-vellum);
}

.sp-bubble--me {
  align-self: flex-end;
  background: var(--color-main);
  color: var(--color-on-main);
}

.sp-thread figcaption {
  margin-top: 4px;
  color: var(--sp-slate-dim);
  font-size: var(--fs-12, 12px);
  text-align: center;
}

.sp-nudge {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 14px;
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--sp-vellum);
  color: var(--sp-slate);
  font-size: var(--fs-14, 14px);
}

.sp-nudge span {
  flex: 1 1 200px;
}

/* ---------- Consent dialog (daily voice) ---------- */

/* The UiDialog frame (UI polish round 2, P-27 / P-33): the same backdrop, radius 18, a 44 px ×
   top right, and the same motion both ways (fade + 8 px rise, 200 ms; none under reduced
   motion). The card keeps daily's parchment and voice. */
.sp-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(21, 37, 30, 0.32);
}

.sp-dialog {
  position: relative;
  width: 100%;
  max-width: 460px;
  max-height: 90vh;
  overflow: auto;
  padding: 24px;
  border-radius: 18px;
  background: var(--sp-parchment);
  color: var(--sp-slate);
  box-shadow: 0 24px 60px rgba(21, 37, 30, 0.25);
}

.sp-dialog-title {
  margin: 14px 0 10px;
  font-size: var(--fs-24, 24px);
}

.sp-consent-points {
  margin: 0 0 12px;
  padding-left: 18px;
  font-size: var(--fs-14, 14px);
  line-height: 1.7;
}

/* The legal words show in full at a smaller size (a scroll box hid the last sentence at 430). */
.sp-consent-terms {
  padding: 10px 12px;
  border: 1px solid var(--color-line);
  border-radius: 8px;
  color: var(--sp-slate-dim);
  font-size: var(--fs-13, 13px); /* P-27: 13 px, readable (was 11-12) */
  line-height: 1.5;
}

.sp-dialog-x {
  position: absolute;
  top: 12px;
  right: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--sp-slate-dim);
  font: inherit;
  font-size: var(--fs-24, 24px);
  line-height: 1;
  cursor: pointer;
}

.sp-dialog-x:hover { background: var(--color-panel); color: var(--sp-slate); }
.sp-dialog-x:disabled { opacity: 0.4; cursor: default; }

@media (prefers-reduced-motion: no-preference) {
  .sp-overlay { animation: sp-fade 150ms ease backwards; }
  .sp-overlay > .sp-dialog { animation: sp-rise 200ms ease backwards; }
  .sp-overlay.is-closing { animation: sp-fade 150ms ease reverse forwards; pointer-events: none; }
  .sp-overlay.is-closing > .sp-dialog { animation: sp-rise 200ms ease reverse forwards; }
}
@keyframes sp-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes sp-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.sp-consent-phone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 14px 0;
  font-size: var(--fs-14, 14px);
}

.sp-consent-phone .sp-field {
  flex: 1;
}

.sp-text-btn {
  display: block;
  margin: 10px auto 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ps-text-soft);
  font: inherit;
  font-size: var(--fs-13, 13px);
  cursor: pointer;
}

.sp-consent-phone .sp-text-btn {
  margin: 0;
}

/* Every quiet text button (Not now, Change, Cancel) is a 44px target and the number
   field is the patient input height, at every width (layout QA round 2: on a computer
   "Not now" was 16 px tall and the field 37 px; this used to apply on phones only). The
   target grows around the words; dropping the 10px top margin keeps the words about
   where they were. */
.sp-text-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-width: 44px;
  min-height: 44px;
  margin-top: 0;
}

.sp-field input {
  min-height: var(--input-h, 48px);
}

/* Inside a line of words (a refund's "Ask us") the button stays in the line. */
.sp-fu-refund .sp-text-btn {
  display: inline-flex;
  vertical-align: middle;
}

/* Change and Resend under the daily states (support-daily.js): one row, left-aligned,
   44px targets on a phone. */
.sp-daily-actions {
  display: flex;
  gap: 24px;
  align-items: center;
  margin-top: 4px;
}

.sp-daily-actions .sp-text-btn {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin: 0;
  font-size: var(--fs-14, 14px);
}

.sp-text-btn--underline {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.sp-error {
  margin: 0;
  color: var(--ps-red);
  font-size: var(--fs-13, 13px);
}

/* ---------- NeuroClarity services (platform voice) ---------- */

.sp-back {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  margin-bottom: 2px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ps-text-soft);
  font: inherit;
  font-size: var(--fs-13, 13px);
  cursor: pointer;
}

.ps-stage-body .sp-service-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.sp-price {
  color: var(--ps-text);
  font-size: var(--fs-18, 18px);
  font-weight: 600;
  white-space: nowrap;
}

.sp-list {
  margin: 0;
  padding-left: 18px;
  color: var(--ps-text-soft);
  font-size: var(--fs-14, 14px);
  line-height: 1.7;
}

.sp-label {
  color: var(--ps-text);
  font-size: var(--fs-14, 14px);
  font-weight: 600;
}

.sp-hint {
  color: var(--ps-text-dim);
  font-size: var(--fs-13, 13px);
  font-weight: 400;
}

/* The picker's time-zone line, styled like the Diagnostic session picker's (.bsp-tz). */
.sp-tz {
  margin: 0;
  color: var(--color-muted);
  font-size: var(--fs-12, 12px);
}

.sp-slots {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sp-slot-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.sp-slot-day {
  width: 110px;
  color: var(--ps-text-soft);
  font-size: var(--fs-13, 13px);
}

.sp-slot {
  min-height: 44px;
  padding: 7px 16px;
  border: 1px solid var(--ps-border);
  border-radius: 999px;
  background: var(--color-card);
  color: var(--ps-text);
  font: inherit;
  font-size: var(--fs-13, 13px);
  cursor: pointer;
}

.sp-slot:hover {
  border-color: color-mix(in srgb, var(--color-text) 28%, transparent);
}

.sp-slot[aria-pressed="true"] {
  border-color: var(--ps-accent);
  background: var(--ps-accent-dim);
  color: var(--ps-accent-text);
}

/* The hold is a plain line with its clock (no side stripe; flow review finding 21). */
.sp-hold {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  font-size: var(--fs-13, 13px);
}

.sp-pay {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  border-radius: 12px;
  background: var(--ps-surface-soft);
}

.sp-pay-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  font-size: var(--fs-14, 14px);
  font-weight: 600;
}

.sp-pay-element {
  width: 100%;
  box-sizing: border-box;
  padding: 16px;
  border: 1px dashed var(--color-line);
  border-radius: 8px;
  background: var(--color-card);
  color: var(--ps-text-dim);
  font-size: var(--fs-13, 13px);
  text-align: center;
}

.sp-pay-note {
  margin: 0;
  color: var(--ps-text-soft);
  font-size: var(--fs-13, 13px);
  line-height: 1.5;
}

.sp-callout {
  padding: 14px 16px;
  border-radius: 10px;
  background: var(--ps-surface-soft);
}

.sp-callout-title {
  margin-bottom: 4px;
  font-size: var(--fs-14, 14px);
  font-weight: 600;
}

/* "Add more until Nov 20" and its button: one line in the card, not an inset box. */
.sp-add-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: var(--fs-13, 13px);
}

.sp-callout--row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: var(--fs-13, 13px);
}

.sp-done-title {
  font-size: var(--fs-18, 18px);
  font-weight: 600;
}

.sp-done-title i {
  color: var(--ps-green);
}

.sp-notice {
  margin: 0;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--ps-blue-bg);
  font-size: var(--fs-13, 13px);
}

.sp-fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

.sp-fieldset legend {
  margin-bottom: 8px;
  padding: 0;
}

.sp-check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px 16px;
}

.sp-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-14, 14px);
  cursor: pointer;
}

.sp-files {
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
  font-size: var(--fs-13, 13px);
}

.sp-upload {
  margin-top: 8px;
  font-size: var(--fs-13, 13px);
}

.sp-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sp-field input,
.sp-field textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 9px 12px;
  border: 1px solid var(--ps-border);
  border-radius: 8px;
  background: var(--color-card);
  color: var(--ps-text);
  font: inherit;
  font-size: var(--fs-14, 14px);
}

.sp-dialog .sp-field span {
  font-size: var(--fs-13, 13px);
}

@media (max-width: 760px) {
  .sp-daily {
    padding: 22px 18px;
  }

  .sp-daily-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
  }

  .sp-thread {
    width: auto;
    max-width: 340px;
  }

  .sp-headline {
    font-size: var(--fs-24, 24px);
  }

  .sp-slot-day {
    width: 100%;
  }
}

/* Inside a service card the quiet text buttons line up with the content. */
.acp-card-body .sp-text-btn {
  align-self: flex-start;
  margin: 0;
}

/* ---------- Report tab (support-report.js) ---------- */

/* NeuroClarity's services under the report: a plain platform card. */
.sp-report-rows {
  gap: 0;
  padding-top: 4px;
  padding-bottom: 4px;
}

.sp-report-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
}

/* The line sits only between two shown rows (a bought service's row is hidden). */
.sp-report-row:not([hidden]) + .sp-report-row {
  border-top: 1px solid var(--ps-border-soft);
}

.sp-report-icon {
  display: inline-flex;
  flex: 0 0 34px;
  align-items: center;
  justify-content: center;
  height: 34px;
  border-radius: 10px;
  background: var(--ps-surface-soft);
  color: var(--ps-text-soft);
}

.sp-report-text {
  flex: 1;
  min-width: 0;
}

.sp-report-name {
  color: var(--ps-text);
  font-size: var(--fs-14, 14px);
  font-weight: 600;
}

.sp-report-keep {
  white-space: nowrap;
}

.sp-report-price {
  /* Accent words (--color-link, 5.7:1 on white), as in the Evergreen picture. */
  color: var(--color-link);
  font-weight: 400;
}

.sp-report-desc {
  margin-top: 2px;
  color: var(--ps-text-soft);
  font-size: var(--fs-13, 13px);
  line-height: 1.45;
}

.sp-report-row .acp-cta {
  flex: 0 0 auto;
  padding: 7px 14px;
  font-size: var(--fs-13, 13px);
}

/* After the download: the next step leads the tab, in daily's voice. */
.sp-report-next {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  --sp-slate: var(--color-text);
  --sp-slate-hover: var(--color-text);
  --sp-slate-soft: var(--color-muted);
  --sp-parchment: var(--color-card);
  --sp-vellum: var(--color-panel);
}

.sp-report-next .sp-wordmark {
  flex: 0 0 auto;
}

.sp-report-next-eyebrow {
  /* Muted ink, 6.4:1 on the panel (was 3.4:1 see-through slate on Vellum). */
  color: var(--color-muted);
  font-size: var(--fs-12, 12px);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.sp-report-next-lede {
  margin-top: 6px;
}

@media (max-width: 760px) {
  .sp-report-row {
    flex-wrap: wrap;
  }

  .sp-report-row .acp-cta {
    margin-left: 48px;
  }

  /* On a phone the text takes the row and the button goes under it, so the
     name and price stay on one or two lines instead of a narrow column. */
  .sp-report-text {
    flex: 1 1 calc(100% - 48px);
  }

  .sp-report-next {
    flex-direction: column-reverse;
    align-items: flex-start;
  }
}

/* -- Recommendation follow-up (Daily Support wave 2; support-followup*.js) -- */

/* Every control in the flow is at least 44px tall on a phone. */
.sp-cta-tall,
.ps-stage-body .sp-cta-tall {
  min-height: 44px;
}

/* On a phone every button on the Support tab and in the Report tab's services card
   is a 44px target. `.ps-stage-body .acp-cta` (patient-shell.css) sets 38px with two
   classes, so these need the same weight. */
@media (max-width: 760px) {
  .ps-stage-body .sp-root .acp-cta,
  .ps-stage-body .sp-report-row .acp-cta,
  .ps-stage-body .sp-report-next .acp-cta {
    min-height: 44px;
  }
}

.ps-stage-body .sp-service-head h2.acp-card-title {
  margin: 0;
}

.sp-pay-card {
  width: 100%;
  min-height: 44px;
}

.sp-fu-card {
  margin-bottom: 16px;
  text-align: left;
}

/* "Your follow-up" on the Session tab and "Your request" on the Report tab
   (support-paid-items.js). The stage body's 14px gap owns the spacing there, so the
   cards drop their own margins; a place with nothing in it (no follow-up, no request)
   takes no room and adds no gap. */
.ps-stage-body .sp-paid .sp-fu-card,
.ps-stage-body .sp-paid .sp-cards {
  margin: 0;
}

.ps-stage-body .sp-paid:not(:has(.acp-card, .sp-error, .sp-back)) {
  display: none;
}

.sp-fu-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.ps-stage-body .sp-fu-card h3.acp-card-title {
  margin: 0;
}

.sp-fu-badge {
  color: var(--ps-text-soft);
  font-size: var(--fs-13, 13px);
}

.sp-fu-reason {
  color: var(--ps-text-soft);
}

.sp-fu-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

.sp-fu-actions a.acp-cta {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

/* [hidden] must win over the display rules above (one follow-up at a time; the cancel
   question; a bought service's row and the services card on the Report tab). */
.sp-fu-actions[hidden],
.sp-direct-link[hidden],
.sp-report-row[hidden],
.sp-report-services[hidden] {
  display: none;
}

.sp-fu-picker {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* A support link's page (short_link_support.html) has no patient-shell.css, whose
   .ps-sr-only hides the hold's spoken "10 minutes left": without it the line read
   "· 9:57" and "10 minutes left" both (LEFTOVERS 36). The same rule, for that page. */
.sl-support-card .ps-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
