/* patient-polish.css — small patient-shell fixes from the 2026-11-11 UI audit (zone P1b).

   Kept in its own sheet so patient-shell.css (2,000+ lines) does not grow. Loaded by
   templates/patient_shell.html after patient-shell.css, so equal-specificity rules here win.
   Each block names the finding it answers (design/ui-polish/findings/patient*.md). */

/* -- P-08: one line under the stage tabs that says what happens next ------ */
.ps-stage-next {
  /* Space below too, so the line never touches the card under it (owner, 2026-11-11). No side
     margin: the line starts on the same left edge as the tabs and the cards (layout QA round 2). */
  margin: 12px 0 14px;
  font-size: var(--fs-14, 14px);
  line-height: 1.5;
  color: var(--ps-text-soft);
}
.ps-stage-next strong {
  font-weight: 600;
  color: var(--ps-text);
}

/* What else is open, under the one next step: the same quiet text, on its own line. */
.ps-stage-next-rest {
  display: block;
}

/* -- P-08: the stage tabs' look moved to patient-r2.css (.ui-tabs, UI polish round 2). */

/* -- P-33: the new stage tab's content fades in (120 ms), none under reduced motion -- */
.ps-stage-body--fade {
  animation: ps-stage-fade 120ms ease-out;
}
@keyframes ps-stage-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .ps-stage-body--fade { animation: none; }
}

@media (max-width: 760px) {
  /* -- P-09: header icons are real 44 px tap targets on a phone ------------- */
  .ps-header .ps-icon-btn {
    width: 44px;
    height: 44px;
    font-size: var(--fs-16, 16px);
  }
  /* The 34 px button used a -6px ::after to reach 44 px; at 44 px it is not needed. */
  .ps-header .ps-icon-btn::after { content: none; }
  .ps-header .ps-header-actions { gap: 4px; }
  .ps-header { padding-right: 12px; }

  /* -- P-10: on a phone the "Have a question?" line sits at the end of the page,
     not pinned over the bottom 64 px of every screen and under dialogs. The shell's
     root column scrolls instead of the workspace (html and body stay overflow:hidden,
     patient-shell.css), so the footer follows the content and the header stays on top. */
  .ps-root {
    overflow-y: auto;
  }
  .ps-workspace {
    flex: 1 0 auto;
    overflow: visible;
  }
  .ps-header {
    position: sticky;
    top: 0;
    z-index: 30;
  }
  .ps-footer {
    padding: 16px;
    background: transparent;
  }
  .ps-footer-link {
    /* A 44 px tap target for each contact link (was 36; 2026-11-11 QA). */
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0;
    vertical-align: middle;
  }

  /* -- 2026-11-11 QA: Session and Evidence tab buttons are 44 px tap targets on a phone
     (Join video call, Invite someone, Provide evidence were 38; Reschedule, Cancel session 37). */
  .ps-stage-body .acp-cta,
  .ps-stage-body .acp-inline-link {
    min-height: 44px;
  }
}

/* -- P-18: the Session tab's "Next steps" card reads like the rest of the page --------
   The option name was the only serif (Lora 17px) on the page and the price looked like a
   warning; Inter 17/600 and plain ink, like the Pay $300 card (balance-card.js). */
.scr-next__name {
  font: 600 var(--fs-17, 17px)/1.3 var(--font-ui, "Inter", system-ui, sans-serif);
}
.scr-next__price {
  font-size: var(--fs-15, 15px);
  color: var(--ps-text);
}
.scr-next__opts.is-one { grid-template-columns: minmax(0, 1fr); }
.scr-next__opts.is-one .scr-next__go { width: auto; min-width: 220px; min-height: 48px; }
@media (max-width: 640px) {
  .scr-next__opts.is-one .scr-next__go { width: 100%; }
}

/* -- P2-31: the "starts in 4 days" line is information, not a warning: ink, not brick red. */
.acp-session-countdown {
  font-size: var(--fs-13, 13px);
  font-weight: 500;
  color: var(--ps-text-soft);
}

/* -- P-31 / P-33: the patient's hand-built windows open (and the guarded ones close) with the
   UiDialog motion: backdrop fades 150 ms, card fades and rises 8 px in 200 ms. Covers "Add a
   person", "A couple of details first", Invite to live session, Reschedule, Cancel session,
   Settings and Feedback & Questions. `backwards` fill only, so no transform is left on the card
   after the motion (a leftover transform would trap position:fixed children inside it).
   Nothing moves under reduced motion. */
@media (prefers-reduced-motion: no-preference) {
  .ps-modal-overlay,
  .atlas-settings-overlay:not(.hidden) .atlas-settings-backdrop {
    animation: ps-dlg-fade 150ms ease backwards;
  }
  .ps-modal-overlay > .ps-modal,
  .atlas-settings-overlay:not(.hidden) .atlas-settings-card {
    animation: ps-dlg-rise 200ms ease backwards;
  }
  .ps-modal-overlay.is-closing {
    animation: ps-dlg-fade-out 150ms ease forwards;
    pointer-events: none;
  }
  .ps-modal-overlay.is-closing > .ps-modal {
    animation: ps-dlg-sink 200ms ease forwards;
  }
}
@keyframes ps-dlg-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes ps-dlg-fade-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes ps-dlg-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes ps-dlg-sink { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(8px); } }

/* -- P-15: the informant rows' Edit / Nudge / Remove. Remove stays on every row, not a
   terracotta pill beside the status badge. Round 2 standard: Remove is the outlined danger
   button (.ui-btn--danger: red outline and text, white fill; the filled red stays in the
   confirm window), so it no longer looks the same as Edit (Codex run 3). */
.ps-informant-remove {
  border-color: var(--ps-red);
  color: var(--ps-red);
  font-weight: 500;
}
.ps-informant-remove:hover {
  background: var(--ps-red-bg);
}
@media (max-width: 760px) {
  /* 44 px tap targets on a phone (were 25 px pills; "Invite someone" was 34 px). */
  .ps-informant-nudge,
  .ps-informant-remove,
  .ps-informant-add {
    min-height: 44px;
    padding: 0 11px;
    font-size: var(--fs-13, 13px);
  }
  /* The status badge gets its own line under the name, so the buttons sit together on the
     next line instead of wrapping one by one beside the badge (the margin pushes the rest of
     the line away; the badge keeps its own width). */
  .ps-informant-person--flat:not(.ps-informant-teen) {
    column-gap: 8px;
  }
  .ps-informant-person--flat:not(.ps-informant-teen) > .ps-informant-status {
    margin-right: 100%;
  }
  /* The word alone is enough on the quiet Remove; it lets Edit, Nudge and Remove share one line. */
  .ps-informant-remove > i { display: none; }
}
