/* SPPC 70 — visual tokens follow prototype/index.html (SPEC section 23). iPad first: targets are at least 44px. */
:root {
  --navy: #17467C; --navy-dark: #0F3157; --bg: #EEF3F7; --card: #FFFFFF; --line: #D5DEE8; --line-strong: #8696A8;
  --ink: #16263A; --muted: #4A5D75; --focus: #1B8FCB;
  --ok-fg: #1F5F35; --ok-bg: #E3F3E8; --wait-fg: #6B4300; --wait-bg: #FDF0D5; --info-fg: #0B4F7A; --info-bg: #DDEFFA;
  --warn-fg: #7A3E00; --warn-bg: #FDE9D2; --bad-fg: #8A1F2B; --bad-bg: #FBE4E6;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: 'IBM Plex Sans Thai', system-ui, sans-serif; font-size: 16px; line-height: 1.5; }
a { color: var(--navy); } a:hover { color: var(--navy-dark); }
h1 { margin: 0; font-size: 26px; font-weight: 700; color: var(--navy); }
h2 { margin: 0 0 12px; font-size: 17px; font-weight: 600; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.layout { display: flex; min-height: 100vh; }
.side { width: 244px; flex-shrink: 0; background: var(--card); border-right: 1px solid var(--line); padding: 22px 16px; display: flex; flex-direction: column; gap: 20px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand img { width: 62px; height: 44px; object-fit: contain; }
.brand .word { font-family: 'Oswald', sans-serif; font-size: 24px; font-weight: 500; letter-spacing: .5px; color: var(--navy); line-height: 1.2; display: block; }
.brand .sub { font-size: 12px; color: var(--muted); line-height: 1.3; display: block; }
.menu { display: flex; flex-direction: column; gap: 6px; flex-grow: 1; }
.menu a { display: flex; align-items: center; min-height: 50px; padding: 4px 14px; border-radius: 10px; text-decoration: none; font-size: 15px; font-weight: 500; color: var(--ink); }
.menu a[aria-current="page"] { background: var(--navy); color: #fff; }
.who { border-top: 1px solid var(--line); padding-top: 14px; display: flex; flex-direction: column; gap: 2px; }
.who strong { font-size: 15px; font-weight: 600; } .who span { font-size: 13px; color: var(--muted); }
.main { flex-grow: 1; min-width: 0; padding: 26px 30px; display: flex; flex-direction: column; gap: 18px; }
.head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.head .meta { font-size: 14px; color: var(--muted); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 20px; }
.grid { display: grid; gap: 18px; } .g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.stat span { font-size: 14px; color: var(--muted); display: block; } .stat strong { font-size: 24px; font-weight: 700; color: var(--navy); }
.row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.muted { color: var(--muted); } .small { font-size: 14px; } .tiny { font-size: 13px; color: var(--muted); }
.stack { display: flex; flex-direction: column; gap: 14px; }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--navy); background: #fff; color: var(--navy); font-family: inherit; font-size: 15px; font-weight: 600; white-space: nowrap; cursor: pointer; text-decoration: none; }
.btn.primary { background: var(--navy); color: #fff; } .btn.primary:hover { background: var(--navy-dark); color: #fff; }
.btn.wide { width: 100%; min-height: 50px; font-size: 17px; }
.link-btn { background: none; border: 0; padding: 0; min-height: 44px; font: inherit; font-weight: 600; color: var(--navy); cursor: pointer; text-decoration: underline; }
.chip { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-strong); background: #fff; color: var(--ink); font-size: 15px; font-weight: 500; text-decoration: none; white-space: nowrap; }
.chip[aria-current="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.pill { display: inline-block; padding: 4px 12px; border-radius: 999px; white-space: nowrap; font-size: 14px; font-weight: 600; }
.pill.ok { color: var(--ok-fg); background: var(--ok-bg); } .pill.wait { color: var(--wait-fg); background: var(--wait-bg); }
.pill.info { color: var(--info-fg); background: var(--info-bg); } .pill.mute { color: var(--muted); background: var(--bg); }
.pill.bad { color: var(--bad-fg); background: var(--bad-bg); }

label, .label { font-size: 15px; font-weight: 600; display: block; margin-bottom: 8px; }
input[type=text], input[type=password], input[type=search], input[type=file], select, textarea { min-height: 46px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 10px; font-family: inherit; font-size: 16px; color: var(--ink); background: #fff; width: 100%; }
input[type=file] { padding: 9px 12px; }
.field { margin-bottom: 16px; } .field .help { font-size: 13px; color: var(--muted); display: block; margin-top: 6px; }
.field ul { list-style: none; margin: 0; padding: 0; } .field .helptext, .field .help ul { font-size: 13px; color: var(--muted); }
.errorlist { list-style: none; margin: 6px 0 0; padding: 0; color: var(--bad-fg); font-size: 14px; font-weight: 500; }
.choices > div, .choices { display: flex; flex-direction: column; gap: 8px; }
.choices label { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 6px 14px; border: 1px solid var(--line-strong); border-radius: 10px; font-weight: 500; margin: 0; cursor: pointer; }
.choices input { width: 20px; height: 20px; accent-color: var(--navy); }

table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 14px; font-weight: 600; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); }
td { font-size: 15px; padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table-wrap { overflow-x: auto; }

.note { padding: 14px 18px; border-radius: 12px; border: 1px solid var(--info-fg); background: var(--info-bg); }
.note.ok { border-color: var(--ok-fg); background: var(--ok-bg); } .note.warn { border-color: var(--warn-fg); background: var(--warn-bg); }
.note.bad { border-color: var(--bad-fg); background: var(--bad-bg); }
.note strong { display: block; } .note ul { margin: 6px 0 0; padding-left: 20px; }
.secret { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 30px; font-weight: 700; letter-spacing: 2px; color: var(--navy); user-select: all; }

.auth { min-height: 100vh; display: flex; align-items: stretch; background: var(--bg); }
.auth .panel { width: 460px; flex-shrink: 0; max-width: 100%; background: var(--card); padding: 40px; display: flex; flex-direction: column; gap: 22px; }
.auth .art { flex-grow: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 12px; padding: 40px; }
.auth .art img { width: 100%; max-height: 70vh; object-fit: cover; border-radius: 18px; }
.center { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.center .card { width: 620px; max-width: 100%; border-radius: 18px; padding: 36px 40px; display: flex; flex-direction: column; gap: 18px; }

@media (max-width: 900px) {
  .layout { flex-direction: column; }
  .side { width: 100%; border-right: 0; border-bottom: 1px solid var(--line); padding: 12px 16px; gap: 10px; }
  .menu { flex-direction: row; flex-wrap: wrap; } .who { flex-direction: row; align-items: center; justify-content: space-between; flex-wrap: wrap; }
  .main { padding: 18px 16px; } .g2, .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .auth .art { display: none; } .auth .panel { width: 100%; }
}
@media (max-width: 560px) { .g2, .g4 { grid-template-columns: minmax(0, 1fr); } }

/* track tags (SPEC section 23: track colours for tags only) */
.pill.t-care { color: #8A1F4D; background: #FBE4EE; } .pill.t-sap { color: #7A3E00; background: #FDE9D2; }
.pill.t-pco { color: #4B2E83; background: #ECE6F7; } .pill.t-tech { color: #0B5C5A; background: #DDF2F1; }
.kv { display: flex; flex-direction: column; gap: 12px; } .kv > div > span:first-child { font-size: 14px; color: var(--muted); display: block; }
.kv > div > span + * , .kv .v { font-size: 16px; font-weight: 500; }
textarea { padding: 10px 12px; min-height: 96px; }
.check { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: 10px; margin: 0; font-weight: 500; cursor: pointer; }
.check input { width: 22px; height: 22px; margin-top: 2px; flex-shrink: 0; accent-color: var(--navy); }
.check small { display: block; font-size: 13px; font-weight: 400; color: var(--muted); }
fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin: 0 0 16px; } legend { font-size: 15px; font-weight: 600; padding: 0 6px; }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } @media (max-width: 900px) { .g3 { grid-template-columns: minmax(0, 1fr); } }
a.rowlink { display: block; padding: 14px 0; border-top: 1px solid var(--line); text-decoration: none; color: inherit; }

/* meeting log */
input[type=date], input[type=number] { min-height: 46px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 10px; font-family: inherit; font-size: 16px; color: var(--ink); background: #fff; width: 100%; }
.choices label.off { background: var(--bg); color: var(--muted); cursor: not-allowed; border-style: dashed; }
.choices label small { display: block; font-size: 13px; font-weight: 400; color: var(--muted); }
.bar { height: 10px; border-radius: 999px; background: var(--bg); margin: 8px 0; } .bar > div { height: 10px; border-radius: 999px; background: var(--navy); }

/* tap-to-score (SPEC section 2: tap instead of typing) */
.item { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-top: 1px solid var(--line); }
.item .text { font-size: 15px; min-width: 0; flex: 1; } .item .text strong { color: var(--navy); }
.tap { display: flex; gap: 8px; flex-shrink: 0; }
.tap label { margin: 0; position: relative; }
.tap input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.tap span { display: flex; align-items: center; justify-content: center; width: 52px; height: 52px; border-radius: 12px; border: 1px solid var(--line-strong); background: #fff; font-size: 18px; font-weight: 600; color: var(--ink); }
.tap input:checked + span { background: var(--navy); border-color: var(--navy); color: #fff; }
.tap input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.sticky-bar { position: sticky; bottom: 0; background: var(--card); border-top: 1px solid var(--line); margin: 0 -20px -20px; padding: 14px 20px; border-radius: 0 0 14px 14px; }
@media (max-width: 700px) { .item { flex-direction: column; align-items: stretch; } .tap { justify-content: space-between; } }

/* abstract */
.abs-page { border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; margin-top: 10px; }
.abs-title { font-size: 17px; margin: 8px 0 4px; color: var(--navy); } .abs-title.en { margin-top: 18px; }
.abs-meta { font-size: 14px; color: var(--muted); margin: 0 0 10px; } .abs-text { font-size: 15px; margin: 0 0 8px; }
