/* Acta: phone first, from 320 px, no sideways scroll. Palette from the stage 1W design. System fonts only.
   The standing layout rule (round 4, D1) is checked by tools/screens/check_layout.py: no sideways scroll at 320, 375,
   768 or 1280; buttons, fields and stand-alone links at least 44 px tall; text at least 16 px (14 px for small print);
   every text colour at least 4.5 to 1 on its background; keyboard focus always visible. */
:root {
  --ink: #111827; --muted: #4B5563; --line: #C9D1D9; --bg: #F3F5F7; --card: #fff;
  --brand: #0B5D5B; --brand-dark: #084544; --soft: #E6F2F1; --err-bg: #FDECEA; --err: #8A1C12;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); overflow-wrap: anywhere;
       font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
img, table, input, select, textarea, button { max-width: 100%; }
/* The bar and the page column share one width, so the bar's contents line up with the page at every width (D2) */
.bar { background: var(--brand); }
.bar-in, .wrap { max-width: 640px; margin: 0 auto; padding-left: 16px; padding-right: 16px; }
body.wide .bar-in, body.wide .wrap { max-width: 1048px; }
.bar-in { display: flex; flex-wrap: wrap; align-items: center; column-gap: 24px; }
.brand { display: inline-flex; align-items: center; min-height: 56px; color: #fff; font-size: 20px; font-weight: 600;
         text-decoration: none; }
.nav { display: flex; flex-wrap: wrap; flex: 1 1 100%; gap: 0 4px; margin: 0 -12px 8px; }
.nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 8px; color: #fff;
         font-weight: 500; text-decoration: none; }
.nav a:hover { background: var(--brand-dark); }
.nav a[aria-current="page"] { background: var(--brand-dark); font-weight: 600; text-decoration: underline;
                              text-underline-offset: 4px; }
.bar a:focus-visible { outline: 3px solid #fff; outline-offset: -3px; }
.wrap { padding-top: 16px; padding-bottom: 32px; }
h1 { font-size: 28px; line-height: 1.2; margin: 8px 0 16px; }
h2 { font-size: 20px; line-height: 1.2; margin: 24px 0 8px; }
p { margin: 0 0 12px; }
a { color: var(--brand); }
label { display: block; font-size: 16px; font-weight: 600; margin: 16px 0 6px; }
input, select, textarea { display: block; width: 100%; min-height: 56px; padding: 12px 14px; font: inherit;
       color: var(--ink); background: var(--card); border: 1px solid var(--muted); border-radius: 10px; }
::placeholder { color: #5B6573; opacity: 1; }
button, .btn { display: inline-flex; align-items: center; justify-content: center; min-height: 56px; padding: 12px 20px;
       font: inherit; font-weight: 600; color: #fff; background: var(--brand); border: 0; border-radius: 10px;
       text-decoration: none; cursor: pointer; }
button:hover, .btn:hover { background: var(--brand-dark); }
button.block, .btn.block { display: flex; width: 100%; }
/* A second-rank button: outlined, never filled like the main act (D4) */
.secondary, .btn.secondary { color: var(--brand); background: var(--card); border: 2px solid var(--brand); }
.secondary:hover, .btn.secondary:hover { color: var(--brand-dark); background: var(--soft); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--brand); outline-offset: 2px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 16px; margin: 0 0 12px; }
.error { background: var(--err-bg); color: var(--err); border: 1px solid var(--err); border-radius: 10px;
         padding: 12px 14px; margin: 0 0 12px; }
.muted { color: var(--muted); }
@media (min-width: 640px) {
  .bar-in, .wrap { padding-left: 24px; padding-right: 24px; }
  .wrap { padding-top: 24px; }
  .nav { flex: 0 1 auto; margin: 0 0 0 -12px; }
}
/* Accounts (stage 1W, DESIGN_stage1W_Main) */
.step { color: var(--muted); font-size: 14px; font-weight: 500; margin: 0 0 4px; text-align: right; }
.lnk { display: inline-flex; align-items: center; min-height: 56px; padding: 12px 0; background: none; border: 0;
       color: var(--brand); font-weight: 600; text-decoration: underline; cursor: pointer; }
.lnk:hover { background: none; color: var(--brand-dark); }
.sep { border-top: 1px solid var(--line); padding-top: 20px; margin-top: 8px; }
.note { background: var(--soft); color: var(--brand-dark); border-radius: 10px; padding: 12px 14px; margin: 0 0 12px;
        font-weight: 500; }
.msgbox { display: flex; flex-direction: column; align-items: center; gap: 6px; background: var(--card);
          border: 1.5px dashed var(--brand); border-radius: 14px; padding: 18px; margin: 0 0 16px; }
.msgbox .lbl { font-size: 14px; font-weight: 500; color: var(--muted); }
.code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 24px; letter-spacing: .12em;
        text-align: center; }
.cc { display: flex; gap: 8px; }
.cc input { flex: 1 1 auto; width: auto; min-width: 0; }
.cc-pre { display: flex; flex: none; align-items: center; min-height: 56px; padding: 0 14px; border: 1px solid var(--muted);
          border-radius: 10px; background: var(--bg); font-size: 17px; white-space: nowrap; }
.big { min-height: 64px; font-size: 18px; }
.choices { display: flex; flex-direction: column; gap: 12px; margin: 0 0 12px; }
.choice { display: flex; flex-direction: column; align-items: flex-start; width: 100%; min-height: 76px; gap: 2px;
          color: var(--brand); background: var(--card); border: 1.5px solid var(--brand); text-align: left; }
.choice:hover { background: var(--soft); }
.choice .sub { font-size: 14px; font-weight: 400; color: var(--muted); }
.tick { display: flex; align-items: center; justify-content: center; width: 64px; height: 64px; margin-top: 24px;
        border-radius: 50%; background: var(--brand); color: #fff; font-size: 32px; }
.small { font-size: 15px; }
.lead { font-size: 18px; }
.hero { padding: 8px 0 0; }
/* My Cases and import (W7, W9) */
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; }
.upper { text-transform: uppercase; }
.back { display: inline-flex; align-items: center; gap: 6px; min-height: 56px; margin: 0 0 -8px; padding: 0;
        color: var(--brand); font-weight: 600; text-decoration: none; }
.back:hover { text-decoration: underline; }
.cases { list-style: none; padding: 0; margin: 0 0 16px; }
.cases li { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.cases li > label { display: flex; flex-direction: column; gap: 2px; flex: 1; margin: 0; font-weight: 400; min-height: 56px; }
.cases input[type="checkbox"] { width: 28px; min-height: 28px; height: 28px; margin: 14px 0; flex: none; }
.ln { display: block; }
.cases li.imp { display: block; }
.cases li.imp > div + div { margin-top: 2px; }
.tally + form { margin-bottom: 16px; }
.fl { display: flex; flex-direction: column; margin-top: 8px; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 16px; }
.page-head .btn { flex: none; margin: 8px 0; }
.group h2, .week h2 { margin-top: 24px; }
/* The case card (K1, DESIGN_stage1W_Cases): one per case, 12 px apart; no inline style (the CSP forbids it) */
.cases.stack { display: flex; flex-direction: column; gap: 12px; }
.cases.stack > li { display: block; margin: 0; }
.cases.stack > li.card { margin: 0; }
.cases.stack > li > .case-card { height: 100%; }
.case-card { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; border-radius: 14px;
             background: #fff; border: 1px solid #E3E8ED; color: #111827; text-decoration: none; }
.case-title { font-size: 17px; line-height: 1.3; font-weight: 600; }
.case-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 14px; color: #4B5563; }
.case-meta .mono { color: #111827; }
.pill { align-self: flex-start; padding: 6px 10px; border-radius: 8px; background: #E6F2F1; color: #084544;
        font-size: 14px; font-weight: 500; }
.pill.past { background: #FEF3C7; color: #6B4000; }
.btn-row { display: flex; gap: 12px; }
.btn-row form { flex: 1 1 0; min-width: 0; }
.btn-row button { width: 100%; }
.foot { margin-top: 16px; }
/* The import file control: shown, so the browser names the chosen file itself; its own button is large (D4, QDB) */
.file { padding: 8px 10px; font-size: 16px; }
.file::file-selector-button { min-height: 44px; margin-right: 12px; padding: 0 20px; font: inherit; font-weight: 600;
                              color: var(--brand); background: var(--card); border: 2px solid var(--brand);
                              border-radius: 8px; cursor: pointer; }
.file::file-selector-button:hover { background: var(--soft); }
/* The import's review and result (D7): the main button stays in view; the tally is a compact row of figures */
.stick { position: sticky; bottom: 0; z-index: 2; margin-top: 8px; padding: 12px 0; background: var(--bg);
         border-top: 1px solid var(--line); }
.tally { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0 0 16px; }
.tally li { padding: 6px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--card);
            font-weight: 600; }
/* The case page (D6, C5): a case title used as the page heading is card-title size, in full; two equal columns from 1024,
   where the narrower is at least 440 px (944 / 2 = 472 at 1024, 484 at the full 1000); one column below that */
.case-h { font-size: 17px; line-height: 1.3; font-weight: 700; margin: 8px 0 12px; }
.cols h2 { font-size: 17px; }
.cols { display: block; }
.cases.stack > .order { padding: 0; }
/* N1: the case's Share, WhatsApp notices and Remove links, together under its details, second rank */
.case-acts { display: flex; flex-wrap: wrap; gap: 8px 12px; margin: 12px 0 0; }
.order a { display: flex; flex-direction: column; justify-content: center; gap: 2px; min-height: 56px;
           padding: 10px 16px; border-radius: 10px; color: var(--ink); text-decoration: none; }
.order a:hover { background: var(--soft); }
.order .o-main strong { color: var(--brand); text-decoration: underline; }
.order .o-sub { font-size: 14px; }
/* The administrator's page (D8): Suspend sits on the person's row from 768; the counts are a compact grid */
.cases.stack > .person { display: flex; flex-direction: column; gap: 12px; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; list-style: none;
         padding: 0; margin: 0 0 12px; }
.stats li { padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); }
/* C1: four menu links that do not fit one row sit as two equal rows of two, never three and one */
@media (max-width: 719px) {
  .nav:has(> a:nth-child(4)) { display: grid; grid-template-columns: 1fr 1fr; gap: 0 4px; }
}
/* C2: a second-rank button alone in its card is as wide as its words need, at least 120 px, at the left */
.btn-row > form:only-child { flex: 0 0 auto; }
.btn-row > form:only-child button { width: auto; min-width: 120px; }
.person .act .secondary.block { display: inline-flex; width: auto; min-width: 120px; }
@media (min-width: 768px) {
  .cases.grid2, .group > .cases, .week > .cases { display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
                                                  align-items: stretch; }
  .cases.grid2 > li { margin: 0; }
  .cases.stack > .person { flex-direction: row; align-items: center; justify-content: space-between; }
  .person .act { flex: 0 0 220px; }
  .btn.block.foot { display: inline-flex; width: auto; min-width: 240px; }
}
@media (min-width: 1024px) {
  .cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 32px; align-items: start; }
  .col > h2:first-child { margin-top: 0; }
}
/* T2: the site pages, the home page's lines and the foot's six links; no sideways scroll at any width */
.points { margin: 0 0 16px; padding-left: 20px; }
.points li { margin: 0 0 8px; }
.wrap ul, .wrap p { overflow-wrap: anywhere; }
.wrap table { border-collapse: collapse; width: 100%; margin: 8px 0 16px; background: var(--card); }
.wrap th, .wrap td { padding: 8px 12px; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.wrap td.num, .wrap thead th + th { text-align: right; }
.pagelink, .homelink a { display: inline-flex; align-items: center; min-height: 44px; }              /* S1: the home sections' links */
.sitefoot { display: flex; flex-wrap: wrap; gap: 0 4px; max-width: 640px; margin: 0 auto; padding: 0 16px 32px; }
body.wide .sitefoot { max-width: 1048px; }
.sitefoot a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 8px;
              color: var(--brand-dark); }
@media (min-width: 768px) {
  .sitefoot { padding-left: 24px; padding-right: 24px; }
}
