/* A client's own page: the look of the form pages (../c/page.css), with cards for each part. */
.pin { display: block; width: 100%; min-height: 60px; padding: 10px 14px; border: 1px solid #7F889C; border-radius: 12px; font: 700 30px/1.2 ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: .4em; text-indent: .4em; text-align: center; color: var(--ink); background: var(--surface); }
.pin:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px; }
/* the PIN and its button sit together in one card */
/* THE PIN SCREEN IS ONE NARROW COLUMN, IN THE MIDDLE (Tom, 21 Nov, on a tablet: the heading ran wide, the card was
   narrower and to the left, the button under it a third width: "it's not even in the centre"). Heading, words, the
   card, "I have forgotten my PIN" and the line under them all share one width and one left edge; on a tall wide
   screen the column starts a little way down, not at the very top. */
main:has(> form .pin) { max-width: 440px; }
@media (min-width: 700px) and (min-height: 640px) { main:has(> form .pin) { padding-top: 12vh; } }
form:has(.pin) { border: 1px solid var(--line); border-radius: 16px; background: var(--surface); padding: 20px; }
main:has(> form .pin) .askagain { max-width: none; }
main:has(> form .pin) .askagain button { width: 100%; }
form:has(.pin) button { margin-top: 12px; }
.pinlabel { display: block; font-weight: 600; margin: 0 0 10px; }
.card { border: 1px solid var(--line); border-radius: 16px; background: var(--surface); margin: 0 0 16px; padding: 16px; }
.card h2 { font-size: 19px; line-height: 1.3; margin: 0 0 10px; }
.card .none { color: var(--faint); margin: 0; }
.when { font-weight: 700; margin: 0 0 8px; }
.form { display: block; padding: 12px 14px; margin: 8px 0 0; border: 1px solid var(--line); border-radius: 10px; color: var(--accent); font-weight: 700; text-decoration: none; }
.form span { display: block; color: var(--faint); font-weight: 400; font-size: 15px; }
.form:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.foot { color: var(--faint); font-size: 15px; margin: 22px 0 0; }
.stale { color: var(--ink2); font-weight: 600; }
@media (max-width: 380px) { .card { padding: 14px; } }
/* slice 2: invoices */
.owed { font-weight: 700; font-size: 19px; margin: 0 0 10px; }
.owed.clear { color: var(--ink2); font-weight: 600; font-size: 17px; }
a.pay { display: block; padding: 14px; margin: 8px 0 0; border-radius: 12px; background: var(--accent); color: #fff; font-weight: 700; text-align: center; text-decoration: none; }
a.pay:focus-visible, .inv-link:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
details.invoice { border-top: 1px solid var(--line); padding: 10px 0; }
details.invoice:first-of-type { margin-top: 10px; }
details.invoice summary { cursor: pointer; list-style: none; display: block; padding: 4px 0; }
details.invoice summary::-webkit-details-marker { display: none; }
details.invoice summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.inv-top { display: flex; justify-content: space-between; gap: 12px; font-variant-numeric: tabular-nums; }
.inv-sub { display: block; color: var(--ink2); font-size: 15px; overflow-wrap: anywhere; }
.tag { display: inline-block; margin-top: 4px; padding: 2px 10px; border-radius: 999px; background: var(--riskSoft); color: var(--risk); font-size: 14px; font-weight: 600; }
.tag.paid { background: var(--soft); color: var(--ink2); }
.inv-body { margin: 10px 0 0; }
.inv-body p { margin: 0 0 4px; }
.inv-line { color: var(--ink2); font-size: 15px; overflow-wrap: anywhere; }
.keep { white-space: pre-line; }
.inv-small { color: var(--faint); font-size: 14px; margin-top: 10px !important; }
.inv-strong { font-weight: 700; }
.inv-to { margin: 10px 0 6px; }
.inv-link { display: block; color: var(--accent); font-weight: 600; overflow-wrap: anywhere; margin: 0 0 4px; }
table.inv-table { width: 100%; border-collapse: collapse; margin: 8px 0; font-size: 15px; font-variant-numeric: tabular-nums; }
.inv-table th { text-align: left; color: var(--faint); font-weight: 400; font-size: 13px; padding: 4px 4px 4px 0; border-bottom: 1px solid var(--line); }
.inv-table td { padding: 6px 4px 6px 0; border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
.inv-table .num { text-align: right; white-space: nowrap; padding-right: 0; }
.inv-table tr.total td { font-weight: 700; border-bottom: 0; }
#printout { display: none; }
@media print {
  body.printing > footer, body.printing > main, body.printing > noscript { display: none !important; }
  body.printing { background: #fff; }
  body.printing #printout { display: block; color: #000; font-size: 11pt; }
  .inv-head { display: flex; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
  .inv-facts { text-align: right; }
  .inv-name { font-size: 16pt; }
  .inv-title { font-size: 22pt; }
  .inv-link { color: #000; }
}
/* slice 3: book another session */
/* video: the card at the top on the day of a session by video, and its one button */
.card.video { border: 2px solid var(--accent); }
.card.video .late { margin: 0; }
a.join { margin-top: 12px; }
/* "Ask for a new one" (21 Nov 2026): the button on an ending, and what it says once pressed */
.askagain { max-width: 420px; }
.askagain .said { margin-top: 12px; }
/* remember this phone (21 Nov 2026): the tick under the PIN, and "Forget this phone" beside "Lock this page" */
.remember { margin: 14px 0 4px; }
.remember .tickrow { display: flex; align-items: center; gap: 10px; }
.remember input { flex: none; width: 22px; height: 22px; margin: 0; accent-color: var(--accent); }
.remember label { font-weight: 600; cursor: pointer; }
.remember .small { margin: 4px 0 0 32px; }
.locks { display: flex; flex-wrap: wrap; gap: 0 8px; }
.locks button { flex: 1 1 180px; width: auto; }
.locks .small { flex: 1 1 180px; margin-top: 12px; }
/* the therapist looking at a client portal ("View as"): one line across the top, and the way back */
.preview { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 16px; padding: 10px 16px; background: var(--ink); color: #fff; font-size: 15px; }
.preview button { width: auto; min-height: 0; margin: 0; padding: 7px 14px; border-radius: 10px; background: #fff; color: var(--ink); font-weight: 700; font-size: 15px; }

/* THE PORTAL AS AN APP (22 Nov 2026): tabs along the bottom, one short screen each. The icons are files
   (tab-*.svg): the page's rules allow images from here only, never data: addresses. */
.ptop h1 { font-size: 26px; margin: 2px 0 0; }
.ptop .from { margin: 0; }
.ptop { margin: 0 0 16px; }
.panel[hidden] { display: none; }
body.tabbed main { padding-top: 20px; padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
body.tabbed .by { display: none; }
.card.next { border: 2px solid var(--accent); }
.card .owed { font-size: 24px; margin: 0 0 6px; }
button.onward { display: block; width: 100%; margin: 12px 0 0; }
nav.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; display: flex; justify-content: center; background: var(--surface); border-top: 1px solid var(--line); padding: 6px max(8px, env(safe-area-inset-right, 0px)) calc(8px + env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left, 0px)); }
nav.tabs .tab { position: relative; flex: 1; max-width: 128px; min-height: 56px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border: 0; background: none; color: var(--faint); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; border-radius: 12px; padding: 4px 2px; }
nav.tabs .tab.on { color: var(--accent); }
nav.tabs .tab:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
nav.tabs .ico { width: 24px; height: 24px; background: currentColor; -webkit-mask: var(--i) center / contain no-repeat; mask: var(--i) center / contain no-repeat; }
nav.tabs .count { position: absolute; top: 2px; left: calc(50% + 6px); min-width: 18px; height: 18px; box-sizing: border-box; padding: 0 5px; border-radius: 9px; background: #B3261E; color: #fff; font-size: 11.5px; line-height: 18px; text-align: center; }
.ico-home { --i: url("tab-home.svg"); }
.ico-sessions { --i: url("tab-sessions.svg"); }
.ico-todo { --i: url("tab-todo.svg"); }
.ico-pay { --i: url("tab-pay.svg"); }
.ico-more { --i: url("tab-more.svg"); }
@media print { nav.tabs { display: none; } .panel[hidden] { display: none; } }
.card .urgent { border: 0; padding: 0; margin: 0; background: none; }

/* "Stop my portal": the confirmation is on the page itself */
.sure { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 12px; }
.sure[hidden] { display: none; }
button.stop { display: block; width: 100%; font: inherit; font-weight: 700; color: #fff; background: #B3261E; border: 0; border-radius: 12px; padding: 14px; margin: 0 0 8px; cursor: pointer; }
button.stop:disabled { opacity: .6; }
.sure .quiet { display: block; width: 100%; }
.sure .said { color: #B3261E; font-weight: 600; }

/* "Leave quickly": at the top of every screen of the opened portal */
.ptop { position: relative; padding-right: 128px; }
button.leave { position: absolute; top: 0; right: 0; width: auto; min-height: 0; margin: 0; white-space: nowrap; font: inherit; font-size: 14px; font-weight: 700; color: var(--ink); background: var(--surface); border: 1.5px solid var(--ink2); border-radius: 10px; padding: 8px 12px; cursor: pointer; }
button.leave:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* "I am at risk": at the foot of every screen */
.riskrow { margin: 20px 0 0; }
button.risk { display: block; width: 100%; font: inherit; font-weight: 700; color: #B3261E; background: var(--surface); border: 1.5px solid #B3261E; border-radius: 12px; padding: 12px; cursor: pointer; }
button.risk[hidden] { display: none; }
.riskrow .sure { border: 1.5px solid #B3261E; border-radius: 12px; background: var(--surface); padding: 14px; margin: 0; }

/* the practice's cancellation terms, said before "I can't come" is sent at short notice (23 Nov 2026) */
.terms { margin: 0 0 12px; padding: 10px 12px; border-left: 3px solid var(--warn, #b26a00); background: color-mix(in srgb, var(--warn, #b26a00) 9%, transparent); border-radius: 6px; }

/* ---- 23 Nov 2026: a calmer look (Tom: "very, very clunky visually ... doesn't look very professional") ----
   One row a session with a quiet Change; one accent bar on the card that matters, not a heavy outline; the quiet
   onward links read as links; "I am at risk" stays on every screen, small and clear at the foot. */
.session { padding: 12px 0 10px; }
.session .srow { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.session .srow .when { margin: 0; font-weight: 600; }
.session .srow .how { margin: 2px 0 0; font-size: 14.5px; color: var(--ink2); }
button.chg { flex: none; display: inline-block; width: auto; margin: 0; padding: 8px 4px 8px 12px; border: 0; background: transparent; color: var(--accent); font: inherit; font-size: 15.5px; font-weight: 700; cursor: pointer; }
button.chg[hidden] { display: none; }
button.chg:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.session .choices { margin-top: 10px; }
.session .choices[hidden] { display: none; }
.session .choices button { padding: 10px 8px; font-size: 15.5px; border-radius: 10px; }
.session .said { margin: 8px 0 0; }
.card { border-radius: 14px; box-shadow: 0 1px 2px rgba(22, 28, 44, .04); }
.card.next, .card.video { border: 1px solid var(--line); border-left: 4px solid var(--accent); }
.card h2 { font-size: 17px; margin: 0 0 8px; }
button.quiet.onward { width: auto; margin: 8px 0 0; padding: 6px 0; border: 0; background: transparent; text-align: left; font-size: 15.5px; }
button.quiet.onward::after { content: ' \203A'; }
.riskrow { margin: 28px 0 0; text-align: center; }
button.risk { display: inline-block; width: auto; padding: 8px 16px; border-width: 1px; border-radius: 99px; font-size: 14.5px; font-weight: 600; background: transparent; }

/* a cancelled session, said in its place in the list (23 Nov 2026) */
.session.off .when { color: var(--ink2); text-decoration: line-through; font-weight: 600; }

/* the practice's policies, on the More tab: a name that opens to the words (23 Nov 2026) */
details.policy { border-top: 1px solid var(--line); }
details.policy:first-of-type { border-top: 0; }
details.policy > summary { cursor: pointer; padding: 12px 0; font-weight: 600; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
details.policy > summary::-webkit-details-marker { display: none; }
details.policy > summary::after { content: '\203A'; color: var(--accent); font-size: 20px; line-height: 1; transition: transform .15s; }
details.policy[open] > summary::after { transform: rotate(90deg); }
details.policy > summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
details.policy .ptext { padding: 0 0 12px; }
details.policy .ptext h3 { font-size: 16px; margin: 14px 0 4px; }
details.policy .ptext p { margin: 0 0 8px; color: var(--ink2); }
@media (prefers-reduced-motion: reduce) { details.policy > summary::after { transition: none; } }

/* what the client has already filled in or signed, ticked (23 Nov 2026) */
ul.donelist { list-style: none; margin: 12px 0 0; padding: 12px 0 0; border-top: 1px solid var(--line); }
ul.donelist li { position: relative; padding: 4px 0 4px 28px; color: var(--ink2); }
ul.donelist li::before { content: '\2713'; position: absolute; left: 4px; top: 4px; color: var(--accent); font-weight: 700; }
