:root { --foc-red: #c0392b; --ink: #2c2c2c; --band: #1f1f1f; --line: #d8d8d8; --bg: #f6f4f2; }
* { box-sizing: border-box; }
body { margin:0; font-family: -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; background: var(--bg); color: var(--ink); }
.proto-banner { background:#8a6d00; color:#fff; text-align:center; font-size:13px; padding:7px 10px; position:sticky; top:0; z-index:50; }
.wrap { max-width: 760px; margin: 0 auto; padding: 14px 14px 90px; }
h1 { font-size: 20px; margin: 12px 0 4px; }
h2 { font-size: 16px; margin: 22px 0 8px; color: var(--foc-red); }
.sub { color:#666; font-size: 13px; margin-bottom: 14px; }
.card { background:#fff; border:1px solid var(--line); border-radius:10px; padding:14px; margin-bottom:14px; }
.dochead { background:var(--band); color:#fff; padding:10px 12px; border-radius:8px 8px 0 0; display:flex; align-items:center; gap:10px; }
.dochead img { height:30px; background:#fff; border-radius:4px; padding:2px; }
.dochead .t { font-weight:700; font-size:13px; letter-spacing:.4px; }
.docbody { border:1px solid var(--line); border-top:none; border-radius:0 0 8px 8px; background:#fff; padding:12px 14px; font-size:13.5px; line-height:1.55; }
.docbody p { margin: 6px 0; }
.docbody ul { margin:4px 0 10px; padding-left:22px; }
.docbody li { margin:3px 0; }
.sec-h { font-weight:700; margin:14px 0 4px; font-size:13.5px; text-transform:uppercase; letter-spacing:.3px;}
label { display:block; font-size:13px; font-weight:600; margin:12px 0 4px; }
input[type=text], input[type=email], input[type=tel], input[type=date], select, textarea { width:100%; padding:11px 12px; border:1px solid #bbb; border-radius:8px; font-size:16px; background:#fff; }
.row2 { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.chips { display:flex; flex-wrap:wrap; gap:8px; margin-top:6px; }
.chip { border:1.5px solid #bbb; background:#fff; border-radius:999px; padding:8px 14px; font-size:14px; cursor:pointer; user-select:none; }
.chip.on { border-color:var(--foc-red); color:var(--foc-red); font-weight:600; background:#fdf3f2; }
.ack { display:flex; gap:10px; align-items:flex-start; background:#fbf7ec; border:1px solid #e8dcb8; border-radius:8px; padding:10px; margin:10px 0; font-size:13.5px;}
.ack input { margin-top:3px; transform:scale(1.4); }
.sigbox { border:2px dashed #999; border-radius:10px; background:#fff; margin-top:6px; }
.sigbox canvas { display:block; width:100%; height:170px; touch-action:none; border-radius:10px; }
.sig-label { font-size:12px; color:#777; padding:6px 10px 0; }
.btnrow { display:flex; gap:10px; margin-top:16px; }
button, .btn { appearance:none; border:none; border-radius:9px; padding:13px 18px; font-size:15px; font-weight:600; cursor:pointer; }
.btn-primary { background:var(--foc-red); color:#fff; flex:1; }
.btn-secondary { background:#eee; color:#333; }
.btn-small { padding:8px 12px; font-size:13px; }
.btn-ghost { background:none; color:#777; font-weight:500; }
.steps { display:flex; gap:6px; margin:10px 0 16px; }
.steps div { flex:1; height:4px; border-radius:2px; background:#ddd; }
.steps div.on { background:var(--foc-red); }
.notice { background:#eef6ee; border:1px solid #cfe3cf; border-radius:8px; padding:10px 12px; font-size:13px; margin:10px 0; }
.warn { background:#fdf0ef; border:1px solid #f0c8c4; }
.sim { display:inline-block; background:#8a6d00; color:#fff; font-size:10.5px; font-weight:700; border-radius:4px; padding:2px 7px; letter-spacing:.5px; vertical-align:middle; margin-left:6px;}
table.register { width:100%; border-collapse:collapse; background:#fff; font-size:13px; }
table.register th, table.register td { border:1px solid var(--line); padding:8px 8px; text-align:left; vertical-align:top;}
table.register th { background:#f0ece9; font-size:12px; }
.badge { display:inline-block; border-radius:4px; padding:2px 7px; font-size:11px; font-weight:700;}
.badge.ok { background:#e2f3e4; color:#1e6b2a; } .badge.due { background:#fdeccb; color:#8a5a00; } .badge.miss { background:#fbd9d5; color:#9c2115; }
a { color: var(--foc-red); }
.nav { display:flex; gap:14px; margin:8px 0 2px; font-size:14px; }
@media (max-width:480px){ .row2{grid-template-columns:1fr;} table.register{font-size:12px;} }
.read-first{background:#f6f1e7;border:1px solid #e3d7bd;border-radius:10px;padding:12px 14px;margin:12px 0;font-size:13.5px}
.read-links{display:flex;flex-wrap:wrap;gap:8px;margin-top:8px}
.read-links a{display:inline-block;background:#fff;border:1px solid #b3261e;color:#b3261e;border-radius:8px;padding:8px 12px;font-weight:600;text-decoration:none}
.read-docx{font-size:12.5px;color:#666;margin-top:8px}
.badge.sub { background:#dce9fb; color:#1a4f9c; }
.badge.wait { background:#eee7f7; color:#5b3d99; }

/* usability fixes */
.table-scroll { overflow-x:auto; -webkit-overflow-scrolling:touch; }
.table-scroll table.register { min-width:620px; }
.hint { font-size:12px; color:#777; margin-top:3px; font-weight:400; }
.date-echo { color:#1e6b2a; font-weight:600; margin-left:6px; }
.steps { flex-wrap:nowrap; }
.steps div { position:relative; padding-top:0; }
.steps div span { position:absolute; top:8px; left:0; right:0; text-align:center; font-size:10.5px; color:#999; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.steps div.on span { color:var(--foc-red); font-weight:600; }
.steps { margin-bottom:34px; }
.review-box { background:#f8f6f3; border:1px solid var(--line); border-radius:8px; padding:10px 12px; font-size:13px; margin:10px 0; }
.review-box b { display:inline-block; min-width:150px; color:#555; font-weight:600; }
.review-box div { padding:2px 0; }
.field-error { color:#9c2115; font-size:12.5px; margin-top:3px; font-weight:600; }
@media (max-width:480px){ .steps div span{ font-size:9.5px; } }

/* ===== Design pass v2 (17 Oct): world-class bar + elderly-accessible ===== */
:root { --pri:#B3261E; --pri-d:#8F1D17; --ink2:#1F2937; --mut:#5B6470; --card-line:#E7E1DA; --focus:rgba(179,38,30,.16); }
body { color: var(--ink2); font-size: 16px; }
.wrap { max-width: 720px; padding: 18px 16px 110px; }
h1 { font-size: 24px; line-height: 1.25; margin: 16px 0 6px; letter-spacing: -.01em; }
h2 { font-size: 17px; color: var(--pri); margin: 26px 0 10px; }
.sub { font-size: 15px; color: var(--mut); line-height: 1.5; margin-bottom: 18px; }
.proto-banner { font-size: 13.5px; padding: 9px 12px; font-weight: 500; }
.card { border: 1px solid var(--card-line); border-radius: 14px; padding: 20px; margin-bottom: 18px; box-shadow: 0 1px 2px rgba(31,41,55,.05), 0 6px 20px rgba(31,41,55,.05); }
.nav { gap: 6px; margin: 10px 0 4px; }
.nav a { text-decoration: none; color: var(--mut); padding: 8px 12px; border-radius: 999px; font-weight: 500; }
.nav a b { color: var(--pri); font-weight: 700; }
.nav a:hover { background: #F0EBE6; }
.steps { counter-reset: focstep; gap: 10px; margin: 18px 0 42px; }
.steps div { background: transparent; height: auto; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.steps div::before { counter-increment: focstep; content: counter(focstep); width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; background: #EDE8E2; color: #8A837B; }
.steps div.on::before { background: var(--pri); color: #fff; }
.steps div[aria-current="step"]::before { box-shadow: 0 0 0 4px var(--focus); }
.steps div span { position: static; font-size: 12px; color: var(--mut); }
.steps div[aria-current="step"] span { color: var(--pri); font-weight: 700; }
label { font-size: 15px; margin: 16px 0 6px; }
input[type=text], input[type=email], input[type=tel], input[type=date], select, textarea { padding: 13px 14px; border: 1.5px solid #C9C3BC; border-radius: 10px; font-size: 17px; min-height: 50px; transition: border-color .15s, box-shadow .15s; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible, .chip:focus-visible { outline: none; border-color: var(--pri); box-shadow: 0 0 0 4px var(--focus); }
[aria-invalid="true"] { border-color: #9C2115 !important; }
.field-error { font-size: 14px; }
.hint { font-size: 13.5px; color: var(--mut); }
.chip { padding: 11px 18px; font-size: 15.5px; border-color: #C9C3BC; border-radius: 12px; }
.chip.on { border-color: var(--pri); background: #FCEFED; }
button, .btn { min-height: 52px; padding: 14px 22px; font-size: 16.5px; border-radius: 12px; transition: transform .06s, background .15s; }
button:active, .btn:active { transform: scale(.985); }
.btn-primary { background: var(--pri); box-shadow: 0 2px 6px rgba(179,38,30,.25); }
.btn-primary:hover { background: var(--pri-d); }
.btn-primary:disabled { background: #D8B3B0; box-shadow: none; cursor: default; }
.btn-secondary { background: #F0EBE6; color: #3B4252; }
.btnrow { margin-top: 20px; gap: 12px; }
@media (max-width:480px){ .btnrow { flex-direction: column; } .btnrow .btn-primary, .btnrow .btn-secondary { width: 100%; } .btnrow .btn-primary { order: 1; } .btnrow .btn-secondary { order: 2; } }
.sigbox { border: 2px dashed #B7B0A8; background: #FCFBFA; border-radius: 14px; }
.sigbox:focus-within { border-color: var(--pri); }
.sigbox canvas { height: 200px; }
.sig-label { display: flex; justify-content: space-between; align-items: center; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #9A938A; padding: 8px 12px 0; }
.sig-clear { min-height: 0; padding: 4px 10px; font-size: 13.5px; background: none; color: var(--pri); font-weight: 600; }
.notice { border-radius: 10px; font-size: 14.5px; line-height: 1.5; }
#done-box { border-left: 5px solid #1E6B2A; font-size: 15px; }
table.register th { background: #F4F0EB; font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; color: #6B7280; }
table.register th, table.register td { padding: 10px; }
table.register tbody tr:nth-child(even) { background: #FAF8F6; }
table.register td a { display: inline-block; padding: 6px 10px; border-radius: 8px; background: #FCEFED; text-decoration: none; font-weight: 600; margin: 1px 2px; }
.dochead { border-radius: 12px 12px 0 0; }
.docbody { border-radius: 0 0 12px 12px; font-size: 14.5px; }
.ack { font-size: 14.5px; }
.steps div.on { background: transparent; }
.steps div { background: transparent; }
table.register th:nth-child(4), table.register td:nth-child(4) { white-space: nowrap; min-width: 96px; }
table.register th:nth-child(3), table.register td:nth-child(3) { min-width: 110px; overflow-wrap: anywhere; }
table.register th:nth-child(7) { min-width: 120px; }

/* Mobile: tables become stacked cards with per-field labels */
@media (max-width: 640px) {
  table.register, table.register thead, table.register tbody, table.register tr, table.register td { display: block; width: 100%; }
  table.register thead { display: none; }
  table.register tr { border: 1px solid #e3d9c8; border-radius: 10px; margin-bottom: 10px; padding: 6px 10px; box-sizing: border-box; }
  table.register td { border: none; padding: 6px 4px; white-space: normal; word-break: break-word; }
  table.register td::before { content: attr(data-label); display: block; font-size: 11px; font-weight: 700; color: #8a6d1d; text-transform: uppercase; letter-spacing: 0.4px; }
  .table-scroll { overflow-x: visible; }
  .table-scroll table.register { min-width: 0; }
  table.register th:nth-child(4), table.register td:nth-child(4),
  table.register th:nth-child(3), table.register td:nth-child(3),
  table.register th:nth-child(7) { min-width: 0; white-space: normal; }
}


/* Mobile: .tbl admin tables stack into labelled cards like table.register */
@media (max-width: 640px) {
  table.tbl { table-layout: auto !important; }
  table.tbl colgroup { display: none; }
  table.tbl, table.tbl thead, table.tbl tbody, table.tbl tr, table.tbl td { display: block; width: 100%; }
  table.tbl thead { display: none; }
  table.tbl tbody tr { border: 1px solid #e3d9c8; border-radius: 10px; margin-bottom: 10px; padding: 6px 10px; box-sizing: border-box; background: #fff; }
  table.tbl td { border: none; padding: 6px 4px; white-space: normal !important; word-break: break-word; }
  table.tbl td::before { content: attr(data-label); display: block; font-size: 11px; font-weight: 700; color: #8a6d1d; text-transform: uppercase; letter-spacing: 0.4px; }
}
/* Admin left-nav workspaces (18 Oct restructure) */
.admin-shell { display: block; }
.wrap.wrap-wide { max-width: 1180px; }
.menu-toggle { display: none; width: 100%; text-align: left; background: var(--pri); color: #fff; border: none; border-radius: 8px; padding: 12px 14px; font-size: 15px; font-weight: 600; margin: 0 0 10px; cursor: pointer; }
.menu-toggle::before { content: "\2630\0020"; }
.side { margin: 0 0 12px; }
.side-link { display: block; width: 100%; text-align: left; background: #fff; color: var(--ink2); border: 1px solid var(--card-line); border-radius: 8px; padding: 12px 14px; font-size: 15px; font-weight: 600; margin: 0 0 6px; cursor: pointer; }
.side-link.on { background: var(--pri, #B3261E); border-color: var(--pri, #B3261E); color: #fff; }
.side-link:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }
.ws { display: none; }
.ws.on { display: block; }
@media (min-width: 900px) {
  .menu-toggle { display: none; }
  .admin-shell { display: grid; grid-template-columns: 200px 1fr; gap: 18px; align-items: start; }
  .side { position: sticky; top: 12px; margin: 0; }
  .ws-area { min-width: 0; }
}
@media (max-width: 899px) {
  .menu-toggle { display: block; }
  .side { display: none; }
  .side.open { display: block; }
}

.steps > div.done span { color: var(--pri); font-weight: 600; }
