/* ONE screen standard (card M-16, 2026-11-15 — locked; the values are web/qeeg-analysis/_shared/ui_standard.json, tools/ui_check.py checks
   this file against it and every screen against its "check" block before every deploy). Used by: the QEEG order (who-for + steps 1–6), the
   done screen, the clients board, Open report and the Admin order detail. A screen's own stylesheet keeps layout only (grid, which column,
   what is hidden) and takes every font size, line height, spacing, radius, colour and control height from the tokens below.
   Genius: readable · the big structure first, then choose inside it · no long lists · tidy for professionals · press without thinking. */
:root {
  --u-font: 'Segoe UI', 'Malgun Gothic', 'Apple SD Gothic Neo', Arial, sans-serif;
  --u-fs-body: 17px; --u-fs-small: 15px; --u-fs-tiny: 13px; --u-fs-label: 15px; --u-fs-btn: 16px;
  --u-fs-h1: 28px; --u-fs-h2: 21px; --u-fs-h3: 18px;
  --u-lh: 1.6; --u-lh-head: 1.25; --u-measure: 72ch;
  --u-s1: 4px; --u-s2: 8px; --u-s3: 12px; --u-s4: 16px; --u-s5: 24px; --u-s6: 32px; --u-s7: 48px;
  --u-radius: 8px; --u-ctl: 48px; --u-check: 22px;
  --u-ink: #1F2A37; --u-muted: #4A5562; --u-line: #D6DCE3; --u-border: #8A96A3; --u-paper: #FFFFFF; --u-page: #F7F8FA;
  --u-accent: #1F5F8F; --u-accent-ink: #FFFFFF; --u-accent-hover: #174A70; --u-accent-soft: #E8F0F6;
  --u-error: #B42318; --u-error-bg: #FEF3F2; --u-ok: #0F7A55;
}

/* type */
body.u { margin: 0; font-family: var(--u-font); font-size: var(--u-fs-body); line-height: var(--u-lh); color: var(--u-ink); background: var(--u-paper); }
.u h1, .u-h1 { font-family: var(--u-font); font-size: var(--u-fs-h1); line-height: var(--u-lh-head); font-weight: 600; margin: 0 0 var(--u-s3); color: var(--u-ink); }
.u h2, .u-h2 { font-family: var(--u-font); font-size: var(--u-fs-h2); line-height: var(--u-lh-head); font-weight: 600; margin: 0 0 var(--u-s2); color: var(--u-ink); }
.u h3, .u-h3 { font-family: var(--u-font); font-size: var(--u-fs-h3); line-height: var(--u-lh-head); font-weight: 600; margin: 0 0 var(--u-s2); color: var(--u-ink); }
.u p { max-width: var(--u-measure); }
.u-small, .u small { font-size: var(--u-fs-small); color: var(--u-muted); font-weight: 400; }
.u-tiny { font-size: var(--u-fs-tiny); color: var(--u-muted); }
.u-label { display: block; font-size: var(--u-fs-label); font-weight: 600; color: var(--u-ink); margin: 0 0 var(--u-s2); }

/* a group = one rounded box; groups stack with s5 between them */
.u-box { border: 1px solid var(--u-line); border-radius: var(--u-radius); background: var(--u-paper); padding: var(--u-s4) var(--u-s5); margin: 0 0 var(--u-s5); }
.u-box > :last-child { margin-bottom: 0; }
.u-box-h { display: flex; align-items: baseline; justify-content: space-between; gap: var(--u-s3); flex-wrap: wrap; margin: 0 0 var(--u-s3); }
.u-box-h h2, .u-box-h h3 { margin: 0; }

/* a list = one item a line: [checkbox] [name + one-line description] [items · minutes at the right edge]; every checkbox on one left line */
.u-list { list-style: none; margin: 0; padding: 0; }
.u-row { display: grid; grid-template-columns: var(--u-check) minmax(0, 1fr) auto; align-items: start; column-gap: var(--u-s3);
  min-height: var(--u-ctl); padding: var(--u-s2) 0; border-top: 1px solid var(--u-line); cursor: pointer; }
.u-row:first-child { border-top: 0; }
.u-row > input[type=checkbox] { width: var(--u-check); height: var(--u-check); margin: 2px 0 0; accent-color: var(--u-accent); grid-column: 1; }
.u-row-name { grid-column: 2; font-size: var(--u-fs-body); font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.u-row-desc { display: block; font-size: var(--u-fs-small); font-weight: 400; color: var(--u-muted); }
.u-row-meta { grid-column: 3; font-size: var(--u-fs-small); color: var(--u-muted); white-space: nowrap; text-align: right; }

/* buttons: exactly one primary (u-btn) on a screen; everything else is u-btn2 (outline) or u-link (text) */
.u-btn, .u-btn2 { display: inline-flex; align-items: center; justify-content: center; gap: var(--u-s2); min-height: var(--u-ctl); padding: 0 var(--u-s5);
  border-radius: var(--u-radius); font-family: var(--u-font); font-size: var(--u-fs-btn); font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; }
.u-btn { border: 1px solid var(--u-accent); background: var(--u-accent); color: var(--u-accent-ink); }
.u-btn:hover { background: var(--u-accent-hover); border-color: var(--u-accent-hover); }
.u-btn2 { border: 1px solid var(--u-accent); background: var(--u-paper); color: var(--u-accent); }
.u-btn2:hover { background: var(--u-accent-soft); }
.u-btn:disabled, .u-btn2:disabled { opacity: .55; cursor: default; }
.u-link { background: none; border: 0; padding: 0; min-height: var(--u-ctl); font-family: var(--u-font); font-size: var(--u-fs-btn); font-weight: 500; color: var(--u-accent);
  cursor: pointer; text-decoration: none; }
.u-link:hover { text-decoration: underline; }

/* the step's error: directly above its buttons; a field's own error under that field */
.u-err { color: var(--u-error); background: var(--u-error-bg); border-left: 4px solid var(--u-error); border-radius: var(--u-radius); padding: var(--u-s3) var(--u-s4);
  font-size: var(--u-fs-body); margin: var(--u-s4) 0 0; }
.u-err:empty { display: none; }

/* the step bar: one line at the top, the current step bold, done steps ticked */
.u-steps { list-style: none; display: flex; flex-wrap: wrap; gap: var(--u-s2) var(--u-s4); margin: 0; padding: 0; font-size: var(--u-fs-small); color: var(--u-muted); }
.u-steps li { display: inline-flex; align-items: center; gap: var(--u-s2); white-space: nowrap; }
.u-steps li.on { color: var(--u-ink); font-weight: 600; }
.u-steps li.done { color: var(--u-ok); }

/* the "Ordering for · You are" band at the top of every order step (card M-16 C3) */
.u-band { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--u-s1) var(--u-s4); border: 1px solid var(--u-line); border-radius: var(--u-radius);
  background: var(--u-page); padding: var(--u-s3) var(--u-s4); margin: 0 0 var(--u-s5); font-size: var(--u-fs-small); color: var(--u-muted); }
.u-band b { color: var(--u-ink); font-weight: 600; }
.u-band .u-link { min-height: 0; font-size: var(--u-fs-small); margin-left: auto; }

/* big choices (who is this order for): one column of large buttons, each with one line under its name */
.u-choices { display: grid; gap: var(--u-s3); max-width: 640px; margin: 0 0 var(--u-s5); }
.u-choice { display: block; width: 100%; text-align: left; border: 1px solid var(--u-line); border-radius: var(--u-radius); background: var(--u-paper); color: var(--u-ink);
  padding: var(--u-s4) var(--u-s5); font-family: var(--u-font); font-size: var(--u-fs-h3); font-weight: 600; line-height: var(--u-lh-head); cursor: pointer; }
.u-choice span { display: block; margin-top: var(--u-s1); font-size: var(--u-fs-small); font-weight: 400; line-height: var(--u-lh); color: var(--u-muted); }
.u-choice:hover { border-color: var(--u-accent); }
.u-choice[aria-pressed="true"] { border: 2px solid var(--u-accent); background: var(--u-accent-soft); padding: calc(var(--u-s4) - 1px) calc(var(--u-s5) - 1px); }
.u-note { font-size: var(--u-fs-small); color: var(--u-muted); margin: var(--u-s2) 0 0; }

/* folded "Add more" groups */
.u-fold { border: 1px solid var(--u-line); border-radius: var(--u-radius); margin: 0 0 var(--u-s3); background: var(--u-paper); }
.u-fold > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: var(--u-s3);
  min-height: var(--u-ctl); padding: 0 var(--u-s4); font-size: var(--u-fs-body); font-weight: 600; }
.u-fold > summary::-webkit-details-marker { display: none; }
.u-fold { padding: 0; border-top: 1px solid var(--u-line); margin-top: 0; }   /* a page's own details rule (border-top, padding, a '+ ' before the title) never reaches a fold */
.u-fold > summary::before { content: none; }
.u-fold[open] > summary { margin-bottom: 0; }
.u-fold > summary::after { content: "+"; color: var(--u-accent); font-weight: 600; }
.u-fold[open] > summary::after { content: "−"; }
.u-fold > .u-list { padding: 0 var(--u-s4) var(--u-s2); }

@media (max-width: 720px) {
  .u-box { padding: var(--u-s4); }
  .u-row { grid-template-columns: var(--u-check) minmax(0, 1fr); }
  .u-row-meta { grid-column: 2; text-align: left; white-space: normal; }
  .u-choice { font-size: var(--u-fs-body); }
}

/* card M-20 추가2-2: the table row standard (ui_standard.json table_row) — a list of rows (the Clients list) */
.u-table { width: 100%; table-layout: fixed; border-collapse: collapse; }
.u-table td, .u-table th { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
.u-table tbody tr { height: 64px; }
.u-table .u-one { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.u-table .u-tag { display: inline-flex; align-items: center; height: 28px; padding: 0 var(--u-s3); border-radius: 999px; font-size: var(--u-fs-small); font-weight: 600; white-space: nowrap; }
.u-table .u-cellbtn { width: 112px; min-height: 36px; padding: 0 var(--u-s2); font-size: var(--u-fs-small); }
.u-table .u-nextbtn { width: 196px; }

/* card M-27: an error shown again blinks once */
@keyframes u-again{0%{opacity:.35}100%{opacity:1}}
.u-again{animation:u-again .45s ease-out}
