/* Case tab additions (case-panel.js, patient-filters.js, protocols.js, session.js, case-store.js). */
.case-tools { display: flex; flex-wrap: wrap; gap: 8px; margin: -8px 0 14px; }
.case-tools button, .check .act, .seg button { border: 1px solid var(--line); background: var(--d-panel, #fff); border-radius: 9px; min-height: 36px; padding: 0 12px; font: 600 13px "Plus Jakarta Sans", system-ui, sans-serif; color: var(--ink); cursor: pointer; }
.case-tools button.on { background: var(--indigo); border-color: var(--indigo); color: #fff; }
.case-tools button.wait { background: var(--boost); border-color: var(--boost); }
.case-tools button:not(.on):hover, .check .act:hover { background: var(--indigo-soft); }

.chk, .sel { display: flex; align-items: center; gap: 8px; font-size: 14px; min-height: 36px; }
.chk input { width: 18px; height: 18px; accent-color: var(--indigo); }
.chk small { color: var(--muted); }
.sel .dd-btn { margin-inline-start: auto; min-width: 140px; }

.pline { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 12px; padding: 8px 8px 8px 10px; margin: -4px 0 18px; }
.pline > span:nth-child(2) { flex: 1; min-width: 0; display: grid; font-size: 14px; line-height: 1.3; }
.pline small { color: var(--d-warn-ink, #8a4b00); font-size: 12px; font-weight: 600; }
.pline.empty { border-style: dashed; color: var(--muted); }
.pline.empty small { color: var(--muted); font-weight: 500; }
.pico { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--indigo-soft); color: var(--indigo); font-weight: 800; flex: none; }
.pline button { border: 1px solid var(--line); background: var(--d-panel, #fff); border-radius: 9px; min-height: 36px; padding: 0 12px; font: 600 13px "Plus Jakarta Sans", system-ui, sans-serif; color: var(--indigo); cursor: pointer; }
.flag.pos { background: var(--d-panel2, #eef1f6); color: var(--d-ink, #39404f); }
.saved-row.mine b { color: var(--indigo); }

.pform { position: relative; padding: 24px; display: grid; gap: 12px; overflow-y: auto; }
.pform .hiw-x { position: absolute; top: 14px; inset-inline-end: 14px; }
.pform h2 { margin: 0; font-size: 22px; }
.pform > label { display: grid; gap: 4px; font-size: 13px; font-weight: 600; color: var(--muted); }
.pform input:not([type="checkbox"]) { min-height: 42px; border: 1px solid var(--line); border-radius: 10px; font: 500 16px "Plus Jakarta Sans", system-ui, sans-serif; padding: 0 12px; color: var(--ink); }
.pform fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 6px 12px 8px; margin: 0; }
.pform legend { font-size: 12px; font-weight: 700; color: var(--muted); padding: 0 4px; }
.pnote { margin: 0; font-size: 14px; color: var(--d-warn-ink, #8a4b00); }
.pnote.small { font-size: 12px; color: var(--muted); }
.perr { margin: 0; color: var(--d-bad-ink, #a3161b); font-size: 13px; font-weight: 600; min-height: 1em; }
.pbtns { display: flex; gap: 8px; align-items: center; }
.pbtns .spacer { flex: 1; }
.pbtns button { min-height: 42px; border-radius: 10px; border: 1px solid var(--line); background: var(--d-panel, #fff); padding: 0 14px; font: 700 14px "Plus Jakarta Sans", system-ui, sans-serif; cursor: pointer; }
.pbtns .pri { background: var(--ink); color: #fff; border-color: var(--ink); }

.rec .img { font-size: 12px; color: var(--indigo); font-weight: 600; margin-top: 2px; }
.boost .rec .img { color: var(--d-warn-ink, #a4520c); }
.flags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.flag { font-size: 11px; font-weight: 700; border-radius: 6px; padding: 1px 6px; background: var(--d-warn, #fff4e0); color: var(--d-warn-ink, #8a4b00); cursor: help; }
.flag.stop { background: var(--d-bad, #ffe8e8); color: var(--d-bad-ink, #a3161b); }
.hidden-note { font-size: 12.5px; color: var(--muted); background: var(--d-panel2, #f5f6f9); border-radius: 8px; padding: 6px 10px; margin: 8px 0 0; }

.two { margin-top: 16px; padding-top: 12px; border-top: 1px dashed var(--line); }
.two .sub2 { font-size: 13px; color: var(--muted); margin: 0 0 6px; }

.proto { margin-top: 14px; border: 1px solid #f5d27a; background: var(--d-warn, #fffbef); border-radius: 12px; padding: 10px 14px; font-size: 13.5px; line-height: 1.5; }
.proto p { margin: 0 0 6px; }
.proto .ph { font-weight: 700; font-size: 14.5px; }
.proto .badge { font: 700 10.5px "Plus Jakarta Sans", system-ui, sans-serif; font-style: normal; text-transform: uppercase; background: #f5b400; color: #3d2c00; border-radius: 5px; padding: 1px 6px; margin-inline-end: 4px; }
/* Direct equivalency leads the answer; on the sole the 5-Systems ranking folds under it. */
.proto.lead { margin: 0 0 12px; }
.other5 > summary { cursor: pointer; font-weight: 700; font-size: 13.5px; padding: 8px 0; color: var(--muted); }
.other5[open] > summary { margin-bottom: 6px; }
.proto-pts { display: flex; flex-wrap: wrap; gap: 6px; }
.proto-pts .opt { border: 1px solid #f0c75a; background: var(--d-panel, #fff); border-radius: 8px; min-height: 34px; padding: 0 10px; font: 700 12.5px "JetBrains Mono", ui-monospace, monospace; color: var(--d-warn-ink, #8a5a00); cursor: pointer; }
.proto-pts .opt small { font: 500 11px "Plus Jakarta Sans", system-ui, sans-serif; color: var(--muted); }

.checkbox { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 14px; }
.check { margin: 0 0 10px; padding-inline-start: 20px; font-size: 13.5px; line-height: 1.5; }
.check li { margin-bottom: 6px; }
.check .act { min-height: 32px; padding: 0 10px; font-size: 12.5px; color: var(--indigo); margin-inline-start: 4px; }
.refer { font-size: 12.5px; color: var(--muted); margin: 0 0 14px; }
.refer.on { background: var(--d-bad, #ffe8e8); color: var(--d-bad-ink, #a3161b); font-weight: 700; padding: 8px 10px; border-radius: 9px; }

.pdf-name { margin: 0 0 14px; }
.pdf-name label { display: grid; gap: 4px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.pdf-name input { min-height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; font: 600 15px "Plus Jakarta Sans", system-ui, sans-serif; color: var(--ink); background: var(--d-panel, #fff); }
.pdf-name small { display: block; margin-top: 4px; font-size: 11.5px; color: var(--muted); }
.sx-row { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; font-size: 13px; }
#session .sx-row input { width: 64px; min-height: 38px; border: 1px solid var(--line); border-radius: 8px; font: 700 16px "JetBrains Mono", ui-monospace, monospace; padding: 0 8px; }
#session .sx-row input[aria-invalid="true"] { border-color: var(--pain); outline-color: var(--pain); box-shadow: 0 0 0 1px var(--pain); }
.imp { margin-inline-start: auto; font-weight: 700; font-size: 13px; padding: 2px 8px; border-radius: 6px; background: var(--d-panel2, #f1f3f7); }
.imp.good { background: var(--d-ok, #e9fbf2); color: var(--d-ok-ink, #00804a); } .imp.bad { background: var(--d-bad, #ffe8e8); color: var(--d-bad-ink, #a3161b); }

/* The visit as five steps: a numbered dot per step, joined by a line that fills as steps are done. */
.sx-steps { list-style: none; margin: 0; padding: 0; }
.sx-steps > li { position: relative; padding: 0 0 18px; padding-inline-start: 38px; }
.sx-steps > li::before { content: ""; position: absolute; inset-inline-start: 13px; top: 30px; bottom: 2px; width: 2px; background: var(--line); }
.sx-steps > li:last-child::before { display: none; }
.sx-steps > li.done::before { background: var(--indigo); }
.sx-dot { position: absolute; inset-inline-start: 0; top: 0; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--d-panel2, #f1f2f6); color: var(--muted); font: 700 12px "JetBrains Mono", ui-monospace, monospace; }
.sx-steps > li.done .sx-dot { background: var(--indigo); color: #fff; }
.sx-steps > li.now .sx-dot { background: var(--d-panel, #fff); box-shadow: inset 0 0 0 2px var(--indigo); color: var(--indigo); }
.sx-steps h4 { margin: 4px 0 8px; font-size: 14px; }
.sx-steps > li.wait .sx-scale { opacity: .45; }
.sx-scale button:disabled { cursor: not-allowed; }
.sx-how.sx-after { margin: 6px 0 0; }
.rt-end { margin-top: 8px; min-height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--d-panel, #fff); color: var(--indigo); font: 700 13px "Plus Jakarta Sans", system-ui, sans-serif; cursor: pointer; }
.sx-nudge { margin: 8px 0 0; font-size: 12.5px; font-weight: 700; color: var(--d-ok-ink, #00804a); }

.sx-scale { display: grid; grid-template-columns: repeat(11, minmax(0, 1fr)); gap: 3px; }
.sx-scale button { min-height: 34px; padding: 0; border: 1px solid var(--line); border-radius: 7px; background: var(--d-panel, #fff); color: var(--ink); font: 700 12px "JetBrains Mono", ui-monospace, monospace; cursor: pointer; }
.sx-scale button[aria-pressed="true"] { color: #fff; border-color: transparent; background: hsl(calc(140 - var(--v) * 14) 62% 42%); }

.sx-pts { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.sx-pts button { border: 1px solid var(--line); background: var(--d-panel, #fff); border-radius: 8px; min-height: 36px; min-width: 52px; font: 700 12px "JetBrains Mono", ui-monospace, monospace; cursor: pointer; }
.sx-pts button.on { background: var(--indigo); border-color: var(--indigo); color: #fff; }
.sx-bar { height: 6px; border-radius: 9px; background: var(--d-panel2, #f1f2f6); overflow: hidden; }
.sx-bar i { display: block; height: 100%; background: var(--indigo); transition: width .3s linear; }

.ncount { display: grid; grid-template-columns: 40px minmax(0, 1fr) 40px; gap: 10px; align-items: center; }
.ncount > button { height: 40px; border: 1px solid var(--line); background: var(--d-panel2, #f1f2f6); border-radius: 10px; font: 700 18px "Plus Jakarta Sans", system-ui, sans-serif; color: var(--ink); cursor: pointer; }
.nc-mid { display: grid; gap: 5px; min-width: 0; }
.nc-num { display: flex; align-items: baseline; gap: 8px; font-size: 12px; color: var(--muted); }
.nc-num b { font: 700 18px "JetBrains Mono", ui-monospace, monospace; color: var(--ink); }
.ncount.warn b { color: var(--d-warn-ink, #c76a00); } .ncount.warn .sx-bar i { background: #c76a00; }
.ncount.stop b, .ncount.stop span { color: var(--d-bad-ink, #a3161b); font-weight: 700; } .ncount.stop .sx-bar i { background: #a3161b; }

.rtimer { display: flex; align-items: center; gap: 10px; padding: 8px; padding-inline-start: 8px; border: 1px solid var(--line); border-radius: 12px; }
.rtimer b { font: 700 22px "JetBrains Mono", ui-monospace, monospace; color: var(--ink); font-variant-numeric: tabular-nums; }
.rt-mid { flex: 1; min-width: 0; display: grid; gap: 4px; }
.rt-mid small { font-size: 12px; font-weight: 600; color: var(--muted); line-height: 1.3; }
.rtimer button { flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; padding: 0; }
.rtimer button svg { width: 20px; height: 20px; }
.rt-go { border: 0; background: var(--indigo); color: #fff; box-shadow: 0 4px 12px #4b5bdc40; }
.rt-reset { border: 1px solid var(--line); background: var(--d-panel, #fff); color: var(--ink); }
.rtimer.done { border-color: #00a85a; background: var(--d-ok, #e9fbf2); }
.rtimer.done .rt-go { background: #00a85a; box-shadow: none; }
.rtimer.done b, .rtimer.done small { color: var(--d-ok-ink, #00804a); }
.rtimer.done .sx-bar i { background: #00a85a; }
:is(.sx-scale, .sx-pts, .ncount, .rtimer) button:focus-visible { outline: 2px solid var(--indigo); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .sx-bar i { transition: none; } }

#saved details { margin-top: 10px; font-size: 13px; }
#saved summary { cursor: pointer; color: var(--indigo); font-weight: 600; min-height: 32px; display: flex; align-items: center; }
.saved-row { display: flex; align-items: center; gap: 6px; padding: 6px 0; border-top: 1px solid var(--line); }
.saved-row span { flex: 1; min-width: 0; display: grid; }
.saved-row small { color: var(--muted); }
.saved-row button { border: 1px solid var(--line); background: var(--d-panel, #fff); border-radius: 8px; min-height: 34px; min-width: 36px; padding: 0 10px; cursor: pointer; font: 600 12.5px "Plus Jakarta Sans", system-ui, sans-serif; }

.print-only { display: none; }
#printSummary { display: none; }
@media print {
  @page { size: A4; margin: 16mm 15mm; }
  html, body { background: var(--d-panel, #fff) !important; }
  body > *:not(#printSummary) { display: none !important; }
  #printSummary { display: block; }
}
/* The treatment page: printed (Save as PDF), and drawn off screen at A4 width for the shared PDF file. */
.tdoc { font: 11pt/1.5 "Plus Jakarta Sans", system-ui, sans-serif; color: var(--d-ink, #111); }
.tdoc header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding-bottom: 10px; margin-bottom: 14px; border-bottom: 2px solid #4b5bdc; }
.tdoc h1 { margin: 0; font-size: 19pt; letter-spacing: -.01em; }
.tdoc header p { margin: 2px 0 0; color: var(--d-muted, #555); }
.tdoc header p.who { margin-top: 6px; color: var(--d-ink, #111); font-size: 12.5pt; font-weight: 700; }
.tdoc .brand { font-weight: 800; color: #4b5bdc; white-space: nowrap; }
.tdoc section { margin: 0 0 14px; break-inside: avoid; }
.tdoc h2 { margin: 0 0 6px; font: 700 8.5pt "JetBrains Mono", ui-monospace, monospace; letter-spacing: .08em; text-transform: uppercase; color: #4b5bdc; }
[dir="rtl"] .tdoc h2 { letter-spacing: 0; font-family: inherit; font-size: 9.5pt; }
.tdoc .lead { margin: 0 0 6px; font-size: 13pt; font-weight: 700; }
.tdoc table { width: 100%; border-collapse: collapse; }
.tdoc th, .tdoc td { padding: 5px 8px; border-bottom: 1px solid var(--d-line, #e3e5ea); text-align: start; vertical-align: top; }
.tdoc .kv th { width: 32%; font-weight: 600; color: var(--d-muted, #555); }
.tdoc .code { font: 700 10.5pt "JetBrains Mono", ui-monospace, monospace; color: #4b5bdc; white-space: nowrap; }
.tdoc .tpts td.code { width: 64px; }
.tdoc .tpts td:last-child { width: 32%; color: var(--d-muted, #555); }
.tdoc .muted { color: var(--d-muted, #666); }
.tdoc footer { margin-top: 18px; padding-top: 8px; border-top: 1px solid var(--d-line, #e3e5ea); font-size: 8.5pt; color: var(--d-muted, #666); }
.tdoc-offscreen { position: fixed; top: 0; left: -10000px; }
.tdoc-render { width: 794px; padding: 60px 57px; background: var(--d-panel, #fff); }


/* Three steps (Assess · Treat · Session) with a footer per step — "option A" in dock-arrangements.html. */
.steps { display: grid; grid-template-columns: auto repeat(3, 1fr); gap: 4px; background: var(--bg); border-radius: 12px; padding: 4px; margin: 0 0 18px; }
.steps button { border: 0; background: none; min-height: 40px; border-radius: 9px; font: 600 13.5px "Plus Jakarta Sans", system-ui, sans-serif; color: var(--muted); display: flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer; }
.steps button b { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--d-panel, #fff); font: 700 11px "JetBrains Mono", ui-monospace, monospace; }
.steps button.on { background: var(--d-panel, #fff); color: var(--ink); box-shadow: 0 1px 3px #0002; }
.steps button.on b { background: var(--indigo); color: #fff; }
[data-pane][hidden] { display: none; }
.imgline { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--indigo); font-weight: 600; background: var(--indigo-soft); border-radius: 10px; padding: 6px 6px 6px 12px; margin: 4px 0 12px; }
.imgline span { flex: 1; }
.imgline button { border: 0; background: var(--d-panel, #fff); border-radius: 8px; min-height: 34px; padding: 0 12px; font: 700 12.5px "Plus Jakarta Sans", system-ui, sans-serif; color: var(--indigo); cursor: pointer; }
.noresult > summary { cursor: pointer; list-style: none; display: flex; align-items: center; min-height: 40px; font: 700 11px "JetBrains Mono", ui-monospace, monospace; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.noresult > summary::-webkit-details-marker { display: none; }
.noresult > summary::after { content: ""; width: 7px; height: 7px; margin-inline-start: auto; margin-inline-end: 4px; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg) translateY(-2px); }
.noresult[open] > summary::after { transform: rotate(-135deg) translateY(-2px); }
.noresult summary b { color: var(--d-bad-ink, #a3161b); margin-inline-start: 4px; }
.stepfoot { position: sticky; bottom: -24px; z-index: 2; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 18px -24px -24px; padding: 12px 24px; background: var(--panel); border-top: 1px solid var(--line); }
.stepfoot > button { flex: 1; min-height: 46px; border-radius: 12px; border: 1px solid var(--line); background: var(--d-panel, #fff); font: 700 14.5px "Plus Jakarta Sans", system-ui, sans-serif; color: var(--ink); cursor: pointer; }
.stepfoot > button.pri { background: var(--ink); border-color: var(--ink); color: #fff; }
.stepfoot #storeMsg { flex-basis: 100%; font-size: 12.5px; color: var(--d-ok-ink, #00804a); font-weight: 600; }
.stepfoot #storeMsg:empty { display: none; }
.stepfoot > button.wide { flex-basis: 100%; }
.stepfoot > button:disabled { opacity: .6; cursor: progress; }

/* Share: the PDF through the device's share sheet, or WhatsApp / email links. */
.sharedlg { width: min(420px, calc(100% - 32px)); border: 0; border-radius: 18px; padding: 20px; box-shadow: 0 20px 60px #0004; font: 14px/1.5 "Plus Jakarta Sans", system-ui, sans-serif; color: var(--ink); }
.sharedlg::backdrop { background: #0d101880; }
.sh-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.sh-head h2 { margin: 0; font-size: 18px; }
.sh-file { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; padding: 10px 12px; border-radius: 12px; background: var(--d-panel2, #f1f2f6); font-size: 12.5px; font-weight: 600; overflow-wrap: anywhere; }
.sh-file span { flex: none; padding: 3px 6px; border-radius: 6px; background: #d43d3d; color: #fff; font: 700 10px "JetBrains Mono", ui-monospace, monospace; }
.sh-main { width: 100%; display: grid; gap: 2px; min-height: 56px; margin-bottom: 8px; border: 0; border-radius: 12px; background: var(--indigo); color: #fff; font: 700 15px "Plus Jakarta Sans", system-ui, sans-serif; cursor: pointer; }
.sh-main small { font-weight: 600; font-size: 12px; opacity: .85; }
.sh-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sh-btn { display: grid; place-items: center; min-height: 46px; border: 1px solid var(--line); border-radius: 12px; background: var(--d-panel, #fff); color: var(--ink); font-weight: 700; text-decoration: none; }
.sh-note { margin: 10px 0 0; font-size: 12px; color: var(--muted); }
.sh-msg { margin: 8px 0 0; font-size: 12.5px; font-weight: 600; color: var(--d-bad-ink, #a3161b); }
.sh-msg:empty { display: none; }
:is(.sh-main, .sh-btn):focus-visible { outline: 2px solid var(--indigo); outline-offset: 2px; }
/* Desktop: the Case panel fills the aside so the footer sits at the bottom even on short steps (62px = tabs). */
@media (min-width: 1025px) {
  #casePanel:not([hidden]) { display: flex; flex-direction: column; min-height: calc(100% - 62px); }
  .stepfoot { margin-top: auto; }
}
@media (max-width: 1024px) {
  .stepfoot { bottom: 0; margin: 18px -16px -32px; padding: 12px 16px; }
}

/* Patient-panel icon in the page header — only shown when a host clinic system has a patient panel. */
.bar-end { display: flex; align-items: center; gap: 8px; }
.pat-toggle { width: 42px; height: 42px; border: 1px solid var(--line); background: var(--d-glass, #ffffffd9); border-radius: 12px; color: var(--indigo); display: grid; place-items: center; cursor: pointer; }
.pat-toggle[hidden] { display: none; }
.pat-toggle:hover { background: var(--indigo-soft); }
.pat-toggle svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pat-toggle .strike { display: none; }
.pat-toggle.off .strike { display: inline; }
.pat-toggle .gap { stroke: #fff; stroke-width: 5; }
.pat-toggle.off { color: var(--muted); }

/* Instructor case loaded into the Case tab: decide first, then reveal */
.ccase { border: 1px solid var(--indigo); background: var(--indigo-soft); border-radius: 12px; padding: 10px 12px; margin: 0 0 12px; }
.ccase .k { margin: 0 0 2px; }
.ccase p { margin: 6px 0; font-size: 13.5px; }
.ccase-ans { background: var(--d-panel, #fff); border-radius: 10px; padding: 6px 10px; margin-top: 8px; }
.ccase-diff { color: var(--d-warn-ink, #a15c00); font-weight: 600; }
.ccase-act { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.ccase-act button { min-height: 38px; border-radius: 10px; padding: 0 12px; font: 600 13px "Plus Jakarta Sans", system-ui, sans-serif; cursor: pointer; border: 1px solid var(--line); background: var(--d-panel, #fff); color: var(--indigo); }
.ccase-act .pri { background: var(--indigo); border-color: var(--indigo); color: #fff; }
/* No case yet: the footer has no buttons and nothing to report, so it takes no room. */
.stepfoot:not(:has(button)):has(#storeMsg:empty) { display: none; }

/* Treatment · ways in (plan.js): the doors, a listed point's row, the hara reading, the point entry box. */
#ways h1 { margin-bottom: 14px; }
.doors { display: grid; gap: 8px; }
.doors button { display: grid; grid-template-columns: 40px 1fr; gap: 0 12px; align-items: center; text-align: start; min-height: 64px; padding: 10px 12px; border: 1px solid var(--line); background: var(--d-panel, #fff); border-radius: 12px; font: inherit; color: var(--ink); cursor: pointer; }
.doors button:hover { border-color: var(--indigo); background: var(--indigo-soft); }
.doors svg { grid-row: span 2; width: 40px; height: 40px; padding: 10px; border-radius: 10px; background: var(--indigo-soft); color: var(--indigo); fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.doors b { font-size: 15px; }
.doors small { color: var(--muted); font-size: 12.5px; }
.ways-back { display: inline-flex; align-items: center; min-height: 36px; padding: 0 10px; margin: 0 0 10px; margin-inline-start: -10px; border: 0; background: none; border-radius: 9px; font: 700 13px "Plus Jakarta Sans", system-ui, sans-serif; color: var(--indigo); cursor: pointer; }
.ways-back:hover { background: var(--indigo-soft); }
#planBox { margin-top: 16px; }
#planBox .ways-back { margin-top: 10px; }
.way-tools { margin: 12px 0 0; }
.pt-entry { display: flex; gap: 8px; margin: 12px 0 4px; }
.pt-entry input { flex: 1; min-width: 0; min-height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; font: 600 14px "JetBrains Mono", ui-monospace, monospace; color: var(--ink); background: var(--d-panel, #fff); }
.pt-entry button { min-height: 40px; padding: 0 16px; border: 1px solid var(--line); background: var(--d-panel, #fff); border-radius: 10px; font: 700 13px "Plus Jakarta Sans", system-ui, sans-serif; color: var(--indigo); cursor: pointer; }
.pt-entry button:hover { background: var(--indigo-soft); }
.pt-err { margin: 0 0 8px; font-size: 12.5px; font-weight: 600; color: var(--d-bad-ink, #b42318); }
.pt-err:empty { display: none; }
.rec.added { grid-template-columns: 64px 1fr 36px; }
.rec.added .srcs { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.rec.added .src { padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; background: var(--d-panel2, #eef0f4); color: var(--d-ink, #3d4352); }
.rec.added .src.hara { background: var(--d-info, #dbeafe); color: var(--d-info-ink, #1e40af); }
.rec.added .src.ind { background: var(--d-ok, #dcfce7); color: var(--d-ok-ink, #166534); }
.rec.added .src.method { background: var(--indigo-soft, #eef0fb); color: var(--indigo, #4b5bdc); }
/* Treatment · By method (method-way.js): the wizard's cards (methods.css) inside Assess, then the chosen method's points. */
#ways .mw h3 { margin: 6px 0 6px; font-size: 16px; }
#ways .mw-pick { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
#ways .mw-ch { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: 13px; color: var(--muted); }
.rec.added .rm { width: 36px; height: 36px; border: 0; background: none; border-radius: 9px; color: var(--muted); font-size: 14px; cursor: pointer; }
.rec.added .rm:hover { background: var(--d-panel2, #eef0f4); color: var(--ink); }
.plan-basis { display: grid; gap: 4px; padding: 10px 12px; margin-bottom: 14px; border-radius: 12px; background: var(--d-panel2, #f5f6f9); font-size: 13px; }
.hara-res { display: grid; gap: 8px; padding: 14px; border-radius: 12px; background: var(--indigo-soft); }
.hara-res .k, .hara-res .muted { margin: 0; }
.hara-res { scroll-margin-top: 12px; }
.hara-ok { margin: 0; font-size: 13px; font-weight: 700; color: var(--indigo); animation: hara-ok .9s ease-out; }
@keyframes hara-ok { from { opacity: 0; translate: 0 6px; } }
@media (prefers-reduced-motion: reduce) { .hara-ok { animation: none; } }
.hara-res .muted { font-size: 12.5px; }
.hara-res label { display: grid; grid-template-columns: 1fr minmax(0, 150px); align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }
.hara-res select { min-height: 38px; padding: 0 8px; border: 1px solid var(--d-soft-line, #c3c8f1); border-radius: 9px; background: var(--d-panel, #fff); font: 700 13px "Plus Jakarta Sans", system-ui, sans-serif; color: var(--ink); }
.shiatsu { margin: 0 0 8px; padding-inline-start: 20px; display: grid; gap: 10px; font-size: 13px; }
.shiatsu li span, .sx-how { display: block; margin: 2px 0 0; color: var(--muted, #5b6170); font-size: 12.5px; line-height: 1.45; }
.sx-how { margin: -4px 0 8px; }
.sx-five { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: -2px 0 8px; font-size: 12.5px; color: var(--ink); }
.sx-five button { min-height: 32px; padding: 0 12px; border: 1px solid var(--indigo, #4b5bdc); border-radius: 99px; background: none; color: var(--indigo, #4b5bdc); font: 700 13px "JetBrains Mono", ui-monospace, monospace; cursor: pointer; }
.hara-pts { display: flex; flex-wrap: wrap; gap: 6px; }
.hara-pts button { min-height: 36px; padding: 0 12px; border: 1px solid var(--d-soft-line, #c3c8f1); background: var(--d-panel, #fff); border-radius: 9px; font: 600 12.5px "Plus Jakarta Sans", system-ui, sans-serif; color: var(--ink); cursor: pointer; text-align: start; }
.hara-pts button.on { background: var(--indigo); border-color: var(--indigo); color: #fff; }
/* Indications opened from Treatment: the bar that leads back, and the buttons that add points. */
.ichoose { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 8px 8px 12px; margin-bottom: 10px; border-radius: 10px; background: var(--indigo); color: #fff; font-size: 13px; font-weight: 700; }
.ichoose[hidden] { display: none; }
.ichoose button { flex: none; min-height: 34px; padding: 0 12px; border: 0; border-radius: 8px; background: var(--d-panel, #fff); color: var(--indigo); font: 700 12.5px "Plus Jakarta Sans", system-ui, sans-serif; cursor: pointer; }
.cadd { display: block; width: 100%; min-height: 40px; margin: 10px 0 0; border: 0; border-radius: 10px; background: var(--indigo); color: #fff; font: 700 13px "Plus Jakarta Sans", system-ui, sans-serif; cursor: pointer; }
.cadd:disabled { background: var(--d-panel2, #eef0f4); color: var(--muted); cursor: default; }
.rec-card > .cadd { margin: 0 0 8px; }

/* Needles | Shiatsu (technique.js): the treatment's technique, a small switch at the top of the treatment card (owner, 2026-11-30). */
/* The patient's last visit on this device (patient-store.js), under the name. */
.pdf-last { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 8px; font-size: 13px; color: var(--muted, #5d6672); }
.pdf-last[hidden] { display: none; }

/* The tap hint over the shoulder: a finger presses, a ring spreads, the pain dot and "Tap where it hurts" show; twice. */
.stage > .tap-hint { position: absolute; z-index: 6; width: 0; height: 0; pointer-events: none; }
.tap-hint i, .tap-hint b, .tap-hint .th-finger { position: absolute; }
.tap-hint .th-ring { left: -22px; top: -22px; width: 44px; height: 44px; box-sizing: border-box; border: 3px solid #fff; border-radius: 50%; opacity: 0; animation: th-ring 4.2s ease-out 2; }
.tap-hint .th-dot { left: -9px; top: -9px; width: 18px; height: 18px; border-radius: 50%; background: #ff5a4f; box-shadow: 0 0 0 6px #ff5a4f4d; opacity: 0; animation: th-dot 4.2s ease-out 2; }
.tap-hint .th-tag { left: -18px; top: 18px; padding: 9px 14px; border-radius: 4px 16px 16px 16px; background: #141a30eb; box-shadow: 0 6px 20px #0006; color: #eef0fa;
  font: 700 15px "Plus Jakarta Sans", system-ui, sans-serif; white-space: nowrap; opacity: 0; animation: th-tag 4.2s ease-out 2; }
.tap-hint .th-finger { left: -27px; top: -14px; width: 56px; height: 56px; opacity: 0; transform-origin: 27px 14px; filter: drop-shadow(0 3px 6px #0009); animation: th-finger 4.2s ease-in-out 2; }
.tap-hint .th-finger svg { display: block; width: 100%; height: 100%; fill: #fff; }
@keyframes th-finger {
  0% { opacity: 0; transform: translate(80px, 110px); }
  12% { opacity: 1; transform: translate(80px, 110px); }
  34% { opacity: 1; transform: translate(0, 0); }
  40% { opacity: 1; transform: scale(.84); }
  47% { opacity: 1; transform: scale(1); }
  62% { opacity: 1; transform: translate(46px, 70px); }
  72%, 100% { opacity: 0; transform: translate(46px, 70px); }
}
@keyframes th-ring { 0%, 39% { opacity: 0; transform: scale(.3); } 41% { opacity: .9; transform: scale(.4); } 70%, 100% { opacity: 0; transform: scale(2.6); } }
@keyframes th-dot { 0%, 39% { opacity: 0; transform: scale(.2); } 44% { opacity: 1; transform: scale(1.25); } 50%, 88% { opacity: 1; transform: scale(1); } 96%, 100% { opacity: 0; } }
@keyframes th-tag { 0%, 44% { opacity: 0; transform: translateY(8px); } 52%, 88% { opacity: 1; transform: none; } 96%, 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .tap-hint .th-finger, .tap-hint .th-ring { display: none; }
  .tap-hint .th-dot, .tap-hint .th-tag { animation: none; opacity: 1; }
}

/* tap-guard.js: "Session in progress · New treatment" or "New pain spot · Undo", at the top of the stage for a few seconds. */
.stage > .tap-guard { position: absolute; z-index: 7; top: 14px; left: 50%; translate: -50% 0; display: flex; align-items: center; gap: 10px; max-width: calc(100% - 24px);
  padding: 5px 5px 5px 16px; border-radius: 999px; background: #141a30eb; color: #eef0fa; box-shadow: 0 6px 20px #0006; font: 600 14px "Plus Jakarta Sans", system-ui, sans-serif;
  white-space: nowrap; animation: tg-in .25s ease-out; }
[dir="rtl"] .stage > .tap-guard { padding: 5px 16px 5px 5px; }
.stage > .tap-guard[hidden] { display: none; }
.tap-guard span { overflow: hidden; text-overflow: ellipsis; }
.tap-guard button { flex: none; min-height: 34px; padding: 0 16px; border: 0; border-radius: 999px; background: var(--indigo, #4f5bd5); color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
@media (max-width: 1024px) { /* phones: text over the button, narrow enough to sit between the menu and the tool column */
  .stage > .tap-guard, [dir="rtl"] .stage > .tap-guard { top: 54px; flex-direction: column; gap: 6px; padding: 8px 10px 10px; border-radius: 16px; font-size: 13px; max-width: calc(100% - 140px); white-space: normal; text-align: center; }
}
@keyframes tg-in { from { opacity: 0; transform: translateY(-6px); } }

/* Pain › Treat with the sheet folded (pain-float.js, option D): the case's points as circles at the body's foot, numbered
   in palpation order and ringed in their channel's colour, the protocol's ashi areas as chips under them, then Assess /
   Details / Start session. They take the folded sheet's pill's place. */
.app.pain-float > .m-pill { display: none; }
.stage > .pfoot { position: absolute; z-index: 5; left: 8px; right: 8px; bottom: 12px; display: flex; flex-direction: column; align-items: center; gap: 12px; pointer-events: none; }
.stage > .pfoot[hidden] { display: none; }
.stage > .pfoot > * { pointer-events: auto; }
.pfoot .pf-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 16px; max-height: 140px; overflow-y: auto; padding: 8px 6px 8px; scrollbar-width: none; }
.pfoot .pf-c { position: relative; flex: none; width: 54px; height: 54px; padding: 0; border: 2.5px solid var(--c); border-radius: 50%; background: #141a30d9;
  color: #f2f4fb; font: 800 13px "Plus Jakarta Sans", system-ui, sans-serif; box-shadow: 0 2px 8px #0008; }
.pfoot .pf-c.last { border-style: dashed; }
.pfoot .pf-c.on { background: var(--c); border-color: #fff; color: #fff; text-shadow: 0 1px 2px #0009; box-shadow: 0 0 0 3px #ffffff55, 0 2px 8px #0008; }
.pfoot .pf-c em { position: absolute; top: -7px; inset-inline-end: -7px; min-width: 20px; height: 20px; padding: 0 5px; box-sizing: border-box; border-radius: 10px;
  background: var(--c); color: #fff; font: 800 10px/20px "Plus Jakarta Sans", system-ui, sans-serif; font-style: normal; text-shadow: 0 1px 1px #0008; box-shadow: 0 1px 4px #0008; }
.pfoot .pf-c.on em { background: #fff; color: #141826; text-shadow: none; }
.pfoot .pf-warn { position: absolute; bottom: -6px; inset-inline-start: -4px; font-style: normal; font-size: 13px; filter: drop-shadow(0 1px 2px #000c); }
.pfoot .pf-ashi { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.pfoot .pf-a { height: 32px; padding: 0 10px; border: 1.5px dotted var(--c); border-radius: 16px; background: #141a30cc; color: #eef0fa; font: 700 12px "Plus Jakarta Sans", system-ui, sans-serif; }
.pfoot .pf-a small { font-weight: 500; color: #c9cfe6; }
.pfoot .pf-a.on { border-style: solid; background: var(--c); color: #fff; }
.pfoot .pf-a.on small { color: #fff; }
.pfoot .pf-bar { display: flex; gap: 8px; width: 100%; max-width: 440px; }
.pfoot .pf-bar button { flex: none; min-height: 46px; padding: 0 14px; border: 1px solid #ffffff2e; border-radius: 23px; background: #141a30d9; color: #eef0fa; font: 700 13px "Plus Jakarta Sans", system-ui, sans-serif; }
.pfoot .pf-bar .pri { flex: 1; border: 0; background: var(--indigo, #5b63f0); color: #fff; }
.stage > .pf-line { z-index: 4; }
.pfoot .pf-c em.pf-last { inset-inline-end: auto; left: 50%; translate: -50% 0; top: auto; bottom: -11px; white-space: nowrap; }

/* The main actions over the body are white with dark ink (owner, 2026-11-30): indigo vanished into the blue stage. */
.pfoot .pf-bar .pri, .tap-guard button { background: #fff; color: #232a6b; box-shadow: 0 2px 10px #0003; }

/* Treatment before anything is chosen (pain-start.js, option 3): the ways in as circles at the body's foot, Pain lit. */
.app.pain-start > .m-pill { display: none; }
.stage > .pstart { position: absolute; z-index: 5; left: 0; right: 0; bottom: 16px; display: flex; justify-content: center; gap: 14px; pointer-events: none; }
.stage > .pstart[hidden] { display: none; }
.pstart .ps-c { pointer-events: auto; width: 70px; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 0; border: 0; background: none;
  color: #eef0fa; font: 700 12px "Plus Jakarta Sans", system-ui, sans-serif; text-shadow: 0 1px 3px #000c; }
.pstart .ps-c span { display: grid; place-items: center; width: 58px; height: 58px; box-sizing: border-box; border: 2.5px solid #8c93f5; border-radius: 50%; background: #141a30d9; box-shadow: 0 2px 8px #0008; }
.pstart .ps-c.on span { background: var(--indigo, #5b63f0); border-color: #fff; }
.pstart .ps-c svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pstart .ps-c svg .fill { fill: currentColor; }

/* Treatment's settings: a gear at the start of the step bar; its panel holds Needles | Shiatsu and Summary | Detailed,
   so the cards in Treatment carry no switches of their own (point-card.js mountCaseSettings). */
.steps .cset-btn { flex-direction: row; align-self: start; width: 38px; min-height: 38px; height: 38px; padding: 0; border-radius: 50%; color: var(--muted); }
.steps .cset-btn + button::before { display: none; }
.steps .cset-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.steps .cset-btn:hover, .steps .cset-btn[aria-expanded="true"] { color: var(--indigo); background: var(--indigo-soft); }
.cset-pop { display: grid; gap: 6px; justify-items: start; padding: 12px 14px; margin: -10px 0 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--d-panel, #fff); }
.cset-pop[hidden] { display: none; }
.cset-pop .k { margin: 4px 0 0; }
#casePanel .pdet .pc-toggles { display: none; }
