/* SSMC secure intake portal — layered on assets/site.css (same palette and type).
   Phone first: one column, 44 px touch targets; the staff viewer prints as an A4 form. */

.intake { padding-block: 1.5rem 3rem; }
.intake .wrap { max-width: 860px; }
.site-header .secure { display: inline-flex; align-items: center; gap: .4rem; font-size: .9rem; color: var(--muted); }
.ico { width: 1em; height: 1em; flex: none; color: var(--accent); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }
/* site.css styles every form and label as a grid (for the enquiry form); undo that here so
   wide content scrolls inside its own box and the required star stays on its label's line */
.intake-form { display: block; }
.intake label { display: block; font-weight: 400; font-size: 1rem; }
.intake .flabel { font-weight: 600; font-size: .97rem; }
.intake .ipill { display: inline-block; }
.intake .opt { display: flex; }

.form-head { margin-bottom: 1rem; }
.form-head h1 { margin-top: .25rem; }
.intro { margin: 0 0 .75rem; }
.privacy { display: flex; gap: .6rem; align-items: flex-start; background: var(--panel); border-radius: var(--radius);
  padding: .75rem 1rem; font-size: .95rem; margin: 0 0 .75rem; max-width: none; }
.privacy .ico { margin-top: .25rem; }
.notice { border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); padding: .8rem 1rem; margin: .75rem 0; }
.notice.warn { border-color: #d9a400; background: #fff8e1; }
.notice ul { margin: .4rem 0 0; }
.flagnote { border-color: #c0392b; background: #fdecea; }
.req { color: #b3261e; font-weight: 600; }
.small { font-size: .9rem; }

/* sections */
.fsec { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem 1.2rem; margin: 1rem 0; }
.fsec h2 { font-size: 1.25rem; display: flex; gap: .6rem; align-items: baseline; margin-bottom: .5rem; }
.fsec h2 .num { font-family: var(--font-body); font-size: .85rem; color: var(--accent-ink); background: var(--accent); border-radius: 999px; min-width: 1.6rem; text-align: center; padding: .05rem .4rem; }
.fsec .note, .field .note { color: var(--muted); font-size: .95rem; margin: 0 0 .6rem; max-width: none; }
.subh { font-family: var(--font-body); font-size: 1rem; font-weight: 600; margin: .8rem 0 .4rem; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { font-weight: 600; padding: 0; margin-bottom: .35rem; }
.field { margin: .9rem 0; }
.field.noleg { margin-top: .3rem; }

/* inputs */
.fi { display: grid; gap: .25rem; margin: .5rem 0; }
.flabel { font-weight: 600; font-size: .97rem; }
.fi input, .fi textarea, .fi select, .detail, .list input, .codeform input {
  font: inherit; font-size: 1rem; color: var(--fg); background: #fff; border: 1px solid #b9c7d0; border-radius: var(--radius);
  padding: .55rem .65rem; min-height: 44px; width: 100%; }
textarea { resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 3px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.name { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 .75rem; }
.name legend { grid-column: 1 / -1; }
@media (max-width: 560px) { .name { grid-template-columns: 1fr; } }
.dparts { display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; }
.dparts input { width: 3.6rem; text-align: center; min-height: 44px; font: inherit; border: 1px solid #b9c7d0; border-radius: var(--radius); padding: .5rem .3rem; }
.dparts input.yy { width: 5rem; }
.hint { color: var(--muted); font-size: .88rem; }
.invalid { outline: 2px solid #b3261e; outline-offset: 3px; border-radius: var(--radius); }

/* options */
.opts { display: grid; gap: .35rem .9rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); }
.opts.cols-1 { grid-template-columns: 1fr; }
.opts.cols-2 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.opts.inline { display: flex; flex-wrap: wrap; gap: .3rem 1rem; }
.opt { display: flex; align-items: flex-start; gap: .55rem; min-height: 44px; padding: .45rem .2rem; cursor: pointer; line-height: 1.35; }
.opt input { width: 1.3rem; height: 1.3rem; margin: .05rem 0 0; flex: none; accent-color: var(--accent); }
.opt.single { margin: .4rem 0; }
.opt.flag span { color: #8a1c14; }
.opt-detail { display: grid; gap: .25rem; }
.opt-detail .detail { margin-left: 1.85rem; width: calc(100% - 1.85rem); }

/* pills: yes/no, scale, matrix */
.ipills { display: flex; flex-wrap: wrap; gap: .4rem; }
.ipill { position: relative; }
.ipill input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.ipill span { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: .3rem .8rem;
  border: 1px solid #b9c7d0; border-radius: var(--radius); background: #fff; font-weight: 600; }
.ipill.wide span { font-weight: 400; font-size: .95rem; text-align: center; }
.ipill input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.ipill input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.scale-row { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; }
.scale-row .end { font-size: .92rem; color: var(--muted); }
.scale .ipills { gap: .3rem; }
.scale .ipill span { min-width: 40px; padding: .3rem; }
/* phones: 0–10 on one line, the two anchors underneath at each end */
@media (max-width: 560px) {
  .scale-row { display: grid; grid-template-columns: 1fr 1fr; gap: .35rem .5rem; }
  .scale-row .ipills { grid-column: 1 / -1; grid-row: 1; display: grid; grid-template-columns: repeat(11, minmax(0, 1fr)); gap: 3px; }
  .scale-row .end { grid-row: 2; font-size: .85rem; }
  .scale-row .end:last-child { grid-column: 2; text-align: right; }
  .scale .ipill span { min-width: 0; width: 100%; padding: .3rem 0; }
}
.mx-row, .yn-row { border-top: 1px solid var(--line); padding: .7rem 0; }
.mx-row legend, .yn-row legend { font-weight: 400; float: left; width: 100%; margin-bottom: .45rem; }
.mx-row .ipills, .yn-row .ipills { clear: both; }
.yn-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .3rem 1rem; align-items: center; }
.yn-row legend { float: none; grid-column: 1; margin: 0; }
.yn-row > .detail { grid-column: 1; }
.yn-row .ipills.yn { grid-column: 2; grid-row: 1; }
.yn-detail { grid-column: 1 / -1; }
.yn-detail .fi { margin: .2rem 0 0; }
/* every question prompt sits on a light grey band, answers stay on white, so the eye finds where each
   question starts (JP, 2026-10-27). Sub-labels inside an answer (Last / First, Date) stay plain. */
.intake-form { --prompt-bg: #eef2f5; }
.intake-form .field > legend:not(.sr), .intake-form .fi.field > .flabel, .intake-form .fsec > .fi > .flabel,
.intake-form .certify > .fi > .flabel, .intake-form .mx-row > legend, .intake-form .yn-row > legend {
  display: block; box-sizing: border-box; background: var(--prompt-bg); border-radius: 6px;
  padding: .45rem .65rem; margin-left: -.65rem; width: calc(100% + 1.3rem); }
.intake-form .fi.field > .flabel, .intake-form .fsec > .fi > .flabel, .intake-form .certify > .fi > .flabel { margin-bottom: .4rem; }
.intake-form .name .fi > .flabel, .intake-form .yn-detail .flabel, .intake-form .ck-row .flabel { font-weight: 400; font-size: .92rem; }
.intake-form .mx-row > legend { margin-bottom: .5rem; }
.intake-form .yn-row > legend { width: calc(100% + .65rem); float: left; grid-column: 1; grid-row: 1; align-self: center; }
/* floated, the legend becomes a grid item, so No / Yes sit on the same line as the prompt */
.intake-form .mx-row, .intake-form .yn-row { border-top: 0; padding: .45rem 0; }
.ck-row { border-top: 1px solid var(--line); padding: .4rem 0 .6rem; display: grid; gap: .2rem; }
.ck-row .fi { margin: .1rem 0 0 1.85rem; }

/* write-in tables */
.list-wrap { overflow-x: auto; }
.list table { border-collapse: collapse; width: 100%; min-width: 520px; }
.list th { text-align: left; font-size: .9rem; color: var(--muted); font-weight: 600; padding: .3rem .3rem; }
.list td { padding: .2rem .3rem; }
.btn.small { padding: .35rem .8rem; font-size: .92rem; }
.btn.big { font-size: 1.1rem; padding: .8rem 1.6rem; }
.btn[disabled] { opacity: .6; cursor: progress; }
.list .add-row { margin-top: .4rem; }

/* body diagram */
.bodymap { position: relative; max-width: 480px; margin: .3rem auto; border: 1px solid var(--line); border-radius: var(--radius);
  background: #fff; cursor: crosshair; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.bodymap img, .map img { width: 100%; height: auto; }
.bodymap svg, .map svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.bodymap line, .map line { stroke: #c0392b; stroke-width: 5; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.map-count { color: var(--muted); font-size: .92rem; }

.certify p { margin-bottom: .6rem; }
.submit-bar { text-align: center; padding: 1rem 0; }
.submit-bar .notice { text-align: left; }
.done { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; }
.done h2 { margin-bottom: .6rem; }
.done .btn { margin: .6rem .4rem 0 0; }

/* start page */
.grid.forms { margin: 1rem 0; }
.formcard { text-decoration: none; color: inherit; }
.formcard:hover { border-color: var(--accent); }
.formcard .status { color: var(--accent); font-weight: 600; }
.formcard.received .status { color: #1e7a3c; }
.codeform { display: grid; gap: .6rem; max-width: 420px; }

.intake-foot { border-top: 1px solid var(--line); padding-block: 1.25rem 2rem; font-size: .9rem; color: var(--muted); }
.intake-foot .wrap { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; justify-content: space-between; max-width: 860px; }

/* ---------------------------------------------------------------- staff inbox */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.2rem; margin: 1rem 0; }
.panel h2 { font-size: 1.3rem; margin-bottom: .5rem; }
.panel p, .panel ul { margin-bottom: .6rem; }
.row { display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-end; }
.row.between { justify-content: space-between; align-items: center; }
.row .fi { flex: 1 1 220px; }
.stack { display: grid; gap: .3rem; max-width: 460px; }
.tabs { display: flex; gap: .3rem; align-items: center; border-bottom: 1px solid var(--line); margin-top: 1rem; flex-wrap: wrap; }
.tabs a { padding: .5rem .8rem; text-decoration: none; color: var(--fg); }
.tabs a[aria-current] { color: var(--accent); font-weight: 600; box-shadow: inset 0 -2px 0 var(--accent); }
.tabs #lock { margin-left: auto; }
table.list { width: 100%; border-collapse: collapse; font-size: .95rem; }
table.list th, table.list td { text-align: left; padding: .45rem .5rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
td.warn { color: #8a1c14; }
.invite-out { background: var(--panel); border-radius: var(--radius); padding: .8rem 1rem; margin: .8rem 0; }
.invite-out textarea { font-size: .95rem; }
#pubcfg { font-family: ui-monospace, Menlo, monospace; font-size: .8rem; width: 100%; }
.viewer-bar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: 1rem 0; }
.viewer-bar .notice { flex-basis: 100%; }
.notebox { background: var(--panel); border-radius: var(--radius); padding: .8rem 1rem; margin: 0 0 1rem; }
.notebox textarea { width: 100%; font-family: Menlo, Consolas, monospace; font-size: .78rem; }
.warnlist { color: #8a5a00; margin: .3rem 0 .6rem 1.2rem; padding: 0; }

/* the opened form (screen and print) */
.doc { background: #fff; border: 1px solid var(--line); padding: 1.5rem 1.8rem; font-size: .95rem; line-height: 1.4; color: #111; }
.doc .dochead { display: flex; gap: 1rem; align-items: center; border-bottom: 2px solid #006992; padding-bottom: .6rem; }
.doc .dochead img { width: 170px; }
.doc .dochead h2 { font-size: 1.35rem; }
.doc .dochead p { margin: .1rem 0 0; color: #444; font-size: .88rem; }
.doc .meta { font-size: .85rem; color: #333; margin: .5rem 0; max-width: none; }
.doc .warnline { background: #fff8e1; padding: .3rem .5rem; font-size: .85rem; max-width: none; }
.doc section { break-inside: auto; margin-top: .7rem; }
.doc h3 { font-family: var(--font-body); font-size: .92rem; text-transform: uppercase; letter-spacing: .04em; color: #fff; background: #006992;
  padding: .2rem .5rem; margin: .6rem 0 .35rem; break-after: avoid; }
.doc h4 { font-family: var(--font-body); font-size: .92rem; margin: .4rem 0 .2rem; }
.doc .n { color: #444; font-size: .85rem; margin: 0 0 .3rem; max-width: none; }
.doc .qa { margin: .18rem 0; max-width: none; }
.doc .qa .q { font-weight: 600; }
.doc .qa.ml .a { display: block; white-space: pre-wrap; padding-left: .8rem; }
.doc .qa.block .q { display: block; }
.doc .og { display: grid; gap: .05rem 1rem; margin: .15rem 0 .3rem; }
.doc .og.c1 { grid-template-columns: 1fr; } .doc .og.c2 { grid-template-columns: 1fr 1fr; }
.doc .og.c3 { grid-template-columns: repeat(3, 1fr); } .doc .og.c4 { grid-template-columns: repeat(4, 1fr); }
.doc .og.c5, .doc .og.c6 { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
.doc .o { color: #555; } .doc .o.on { color: #000; font-weight: 600; }
.doc .box { font-size: 1.05em; margin-right: .25rem; } .doc .box.on { color: #006992; }
.doc .blankval { color: #999; }
.doc table.t { border-collapse: collapse; width: 100%; margin: .2rem 0 .4rem; font-size: .88rem; }
.doc table.t th { background: #e3eef4; text-align: left; padding: .2rem .4rem; border: 1px solid #bcbcbc; font-weight: 600; }
.doc table.t td { border: 1px solid #bcbcbc; padding: .2rem .4rem; vertical-align: top; }
.doc table.t td.c { text-align: center; width: 3.2rem; }
.doc table.mx td:first-child { width: 40%; } .doc table.mx td.c { width: auto; }
.doc .scale { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem; font-size: .85rem; }
.doc .sc { display: inline-block; min-width: 1.6rem; text-align: center; border: 1px solid #bcbcbc; }
.doc .sc.on { background: #006992; color: #fff; font-weight: 700; border-color: #006992; }
.doc .map { position: relative; width: 300px; margin: .2rem 0; border: 1px solid #bcbcbc; }
.doc .sig { border: 1px solid #bcbcbc; padding: .4rem .6rem; }
.doc .office h3 { background: #5a6b77; }
.doc .foot { font-size: .8rem; color: #555; border-top: 1px solid #bcbcbc; padding-top: .4rem; margin-top: 1rem; max-width: none; }

@media print {
  @page { size: A4; margin: 12mm; }
  body { background: #fff; }
  body > *:not(main), .intake .form-head, #flash, .panel, .tabs, .viewer-bar, .notebox, #uploadbanner { display: none !important; }
  .intake { padding: 0; }
  .intake .wrap { max-width: none; padding: 0; }
  .doc { border: 0; padding: 0; font-size: 9.5pt; }
  .doc h3 { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .doc .sc.on, .doc table.t th { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .doc .office { break-before: page; }
}

.doc table.dy th:not(:nth-child(4)), .doc table.dy td:not(:nth-child(4)) { white-space: nowrap; width: 1%; }

/* pain diary: step headings, one card per hour, a saved part collapses to its confirmation */
.intake h2.step { font-size: 1.15rem; margin: 1.8rem 0 .2rem; }
ol.steps, ul.steps { margin: .4rem 0 .2rem 1.25rem; padding: 0; }
ol.steps li, ul.steps li { margin: .3rem 0; }
.diary-part .due { font-family: var(--font-body); font-size: .9rem; font-weight: 400; color: var(--muted); }
.diary-part .part-bar { margin: -.5rem 0 1.2rem; text-align: center; }
.diary-part .part-bar .notice { text-align: left; }
.diary-part .saved { margin: -.5rem 0 1.2rem; border-color: #b7d9c2; background: #eef8f1; }
.diary-part.is-saved .fsec { padding-bottom: .7rem; }
.diary-part.is-saved .fsec h2 { margin-bottom: 0; }

/* inbox: which chart a form belongs to */
#uploadbanner { margin: 0 0 1rem; }
#uploadbanner b { font-size: 1.05em; }

/* staff hub sign-in bar (inbox), MRN check option and tag (added 2026-10-29) */
.whobar { display: flex; flex-wrap: wrap; gap: .4rem 1rem; align-items: center; color: var(--muted); margin: 0 0 .75rem; }
.whobar .linkbtn { background: none; border: 0; color: var(--accent); text-decoration: underline; cursor: pointer; font: inherit; padding: 0; }
.askmrn { align-self: end; min-height: 44px; }
.askmrn.muted span { color: var(--muted); }
.tagmrn { display: inline-block; font-size: .72rem; font-weight: 600; background: var(--panel); color: var(--accent-strong); border-radius: 999px; padding: .05rem .5rem; vertical-align: middle; margin-left: .3rem; }
.codeform .hint { font-weight: 400; }
