/* SandOS layout and STANDARD PARTS. Colours and fonts come only from theme.css.
   Every module reuses these parts; see Admin › Standard parts for a live sheet. */

* { box-sizing: border-box; }
html, body { margin: 0; }
body { min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); color: var(--ink); font: 14px/1.5 var(--font-ui); -webkit-font-smoothing: antialiased; transition: background-color .2s, color .2s; }
a { color: var(--link); }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }
#root { flex: 1; display: flex; flex-direction: column; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* ---- Test environment strip ---- */
.env-strip { background: var(--strip); color: #FFFFFF; text-align: center; font-size: 11px; font-weight: 600; letter-spacing: .12em; padding: 6px 12px; }

/* =========================================================
   STANDARD PARTS
   ========================================================= */

/* Type */
.eyebrow { font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.title { margin: 0; font: 400 42px/1.08 var(--font-title); }
.title em { font-style: italic; }
.h2 { margin: 0; font: 600 21px/1.25 var(--font-title); }
.lead { margin: 0; color: var(--muted); max-width: 680px; }
.note { font-size: 12px; color: var(--muted); }
.figure { font: 400 32px/1.1 var(--font-title); font-variant-numeric: tabular-nums; }

/* Buttons — one primary per screen; all at least 44 px tall */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 20px;
  border-radius: var(--radius-control); border: 1px solid transparent; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { filter: brightness(.96); color: var(--on-accent); }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-secondary:hover { border-color: var(--link); color: var(--ink); }
.btn-quiet { background: transparent; color: var(--link); padding: 0 12px; }
.btn-quiet:hover { color: var(--ink); }
.btn-void { background: transparent; color: var(--err-fg); border-color: var(--err-fg); }
.btn-danger { background: var(--err-fg); color: var(--surface); }
.btn-icon { width: 46px; padding: 0; background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn:disabled { background: var(--surface2); color: var(--muted); border-color: transparent; cursor: default; filter: none; }
.btn-block { width: 100%; }

/* Status labels */
.pill { display: inline-block; font-size: 12px; font-weight: 600; border-radius: 999px; padding: 3px 12px; white-space: nowrap; }
.pill-ok { background: var(--ok-bg); color: var(--ok-fg); }
.pill-warn { background: var(--warn-bg); color: var(--warn-fg); }
.pill-err { background: var(--err-bg); color: var(--err-fg); }
.pill-info { background: var(--info-bg); color: var(--info-fg); }
.pill-void { background: var(--err-bg); color: var(--err-fg); text-decoration: line-through; }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card); padding: 24px; box-shadow: var(--shadow); }
.card-feature { background: var(--feature); color: var(--on-feature); border: 0; box-shadow: none; }
.card-feature .lead, .card-feature p { color: var(--on-feature-muted); }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }

/* Form fields */
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink); }
.field input, .field select, .field textarea { min-height: 46px; border: 1px solid var(--line); border-radius: var(--radius-control); padding: 0 12px;
  font: inherit; font-weight: 400; font-size: 14px; color: var(--ink); background: var(--input); min-width: 0; }
.field textarea { padding: 10px 12px; min-height: 96px; }
.field input[aria-invalid="true"] { border: 2px solid var(--err-fg); }
.field .hint { font-weight: 400; font-size: 12px; color: var(--muted); }
.field .error { font-weight: 400; font-size: 12px; color: var(--err-fg); }
.check { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font-size: 13px; font-weight: 600; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--c1); }
.toggle { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0; border: 0; background: transparent; color: var(--ink);
  font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.toggle .track { position: relative; flex: none; width: 52px; height: 30px; border-radius: 15px; border: 1px solid var(--line); background: var(--track); transition: background .15s; }
.toggle .knob { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: left .15s; }
.toggle[aria-checked="true"] .track { background: var(--c1); }
.toggle[aria-checked="true"] .knob { left: 25px; background: var(--accent); }

/* Messages */
.msg { display: flex; gap: 12px; align-items: center; padding: 14px 16px; border-radius: 14px; font-size: 13px; font-weight: 500; text-align: left; }
.msg svg { flex: none; }
.msg-ok { background: var(--ok-bg); color: var(--ok-fg); }
.msg-warn { background: var(--warn-bg); color: var(--warn-fg); }
.msg-err { background: var(--err-bg); color: var(--err-fg); }
.msg-info { background: var(--info-bg); color: var(--info-fg); }

/* Empty page */
.empty-state { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px; padding: 32px 16px; }
.empty-art { position: relative; width: 140px; height: 110px; }
.empty-art i { position: absolute; display: block; border-radius: 50%; }
.empty-art i:nth-child(1) { left: 0; top: 10px; width: 90px; height: 90px; background: var(--surface2); border: 1px solid var(--line); }
.empty-art i:nth-child(2) { left: 50px; top: 0; width: 80px; height: 80px; border: 1.5px dashed var(--c1); }
.empty-art i:nth-child(3) { left: 104px; top: 70px; width: 20px; height: 20px; background: var(--accent); }
.empty-state .empty-title { font: 400 22px/1.2 var(--font-title); }
.empty-state p { margin: 0; font-size: 13px; color: var(--muted); max-width: 360px; }

/* Confirm dialog (uses the native <dialog>) */
dialog.confirm { border: 1px solid var(--line); border-radius: var(--radius-card); padding: 24px; width: min(480px, calc(100% - 32px));
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow-pop); }
dialog.confirm::backdrop { background: var(--scrim); }
dialog.confirm .dlg-title { font: 400 22px/1.2 var(--font-title); margin: 0 0 8px; }
dialog.confirm .dlg-body { font-size: 13px; color: var(--muted); margin: 0 0 16px; }
dialog.confirm .dlg-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 16px; }

/* Filter chips and avatars (standard parts, added with People) */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.chip:hover { border-color: var(--link); }
.chip[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); border-color: transparent; }
.avatar-lg { width: 56px; height: 56px; font-size: 18px; }

/* Appearance switch */
.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: var(--radius-control); background: var(--surface2); border: 1px solid var(--line); }
.seg button { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 12px; border: 0; border-radius: 9px;
  background: transparent; color: var(--muted); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

/* Tables */
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.toolbar .spacer { flex: 1; }
.toolbar .field input { min-width: 200px; }
.table-box { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 760px; }
table.data th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; padding: 8px 10px 10px 0; }
table.data td { padding: 11px 10px 11px 0; border-top: 1px solid var(--line-soft); vertical-align: top; }
table.data td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.empty { color: var(--muted); padding: 24px 0 8px; }

/* =========================================================
   SIGN-IN
   ========================================================= */
.signin { flex: 1; display: flex; flex-wrap: wrap; }
.signin-brand { flex: 1 1 520px; background: var(--panel); color: var(--on-panel); position: relative; overflow: hidden; padding: 56px 64px;
  display: flex; flex-direction: column; justify-content: space-between; gap: 48px; min-height: 420px; }
.signin-brand .ring { position: absolute; border-radius: 50%; border: 1px solid var(--panel-line); pointer-events: none; }
.signin-brand .ring.r1 { right: -180px; bottom: -180px; width: 620px; height: 620px; }
.signin-brand .ring.r2 { right: -80px; bottom: -80px; width: 420px; height: 420px; }
.signin-brand .dot { position: absolute; right: 92px; bottom: 300px; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); }
.signin-brand > * { position: relative; }
.signin-brand img { height: 88px; width: auto; align-self: flex-start; }
.signin-brand .eyebrow { color: var(--on-panel-muted); letter-spacing: .16em; font-size: 12px; }
.signin-brand h1 { margin: 0; font: 400 52px/1.08 var(--font-title); }
.signin-brand h1 em { color: var(--accent); }
.signin-brand .about { margin: 0; font-size: 15px; line-height: 1.6; color: var(--on-panel-muted); max-width: 520px; }
.signin-way { display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; border-radius: 16px; background: var(--panel-hover); border: 1px solid var(--panel-line); max-width: 520px; }
.signin-way .bead { flex: none; width: 10px; height: 10px; margin-top: 6px; border-radius: 50%; background: var(--accent); }
.signin-way b { display: block; font-size: 15px; margin-top: 4px; }
.signin-way span { display: block; font-size: 13px; color: var(--on-panel-muted); margin-top: 2px; }
.signin-foot { font-size: 12px; color: var(--on-panel-muted); }
.signin-main { flex: 1 1 420px; display: flex; flex-direction: column; padding: 24px 32px 40px; }
.signin-main .top { display: flex; justify-content: flex-end; }
.signin-main .centre { flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px 0; }
.signin-form { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 24px; }
.signin-form h2 { margin: 0; font: 400 40px/1.1 var(--font-title); }
.signin-form p { margin: 0; color: var(--muted); font-size: 15px; }
.signin-form .btn { min-height: 52px; font-size: 15px; box-shadow: var(--shadow); }
.signin-form .small { font-size: 13px; color: var(--muted); }

/* =========================================================
   APP SHELL: menu panel + top bar + page
   ========================================================= */
.shell { flex: 1; display: flex; }
.panel { flex: 0 0 256px; background: var(--panel); color: var(--on-panel); padding: 22px 14px; display: flex; flex-direction: column; gap: 26px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.panel-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 6px 0; min-height: 48px; }
.brand img { height: 40px; width: auto; flex: none; }
.brand b { display: block; font-weight: 600; font-size: 14px; }
.brand span { display: block; font-size: 11px; color: var(--on-panel-muted); letter-spacing: .1em; text-transform: uppercase; }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav a { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: var(--radius-control);
  color: var(--on-panel); text-decoration: none; font-size: 14px; }
.nav a:hover { background: var(--panel-hover); color: var(--on-panel); }
.nav a[aria-current="page"] { background: var(--accent); color: var(--on-accent); font-weight: 600; }
.nav svg { flex: none; }
/* Section menu (standard part, 3 Nov 2026): a section's pages nested beneath it. No tabs across the page anywhere.
   Open section = bold with a thin gold mark; current page = gold; sub-pages indent one step further. */
.nav .nav-sec.is-open { font-weight: 600; box-shadow: inset 3px 0 0 var(--accent); }
.nav-sub ul { list-style: none; margin: 2px 0 6px; padding: 0 0 0 22px; display: flex; flex-direction: column; gap: 2px; border-left: 1px solid var(--panel-line); margin-left: 21px; }
.nav-sub ul.nav-kids { margin: 2px 0 4px 14px; padding-left: 12px; }
.nav .nav-page { min-height: 40px; padding: 0 12px; font-size: 13px; color: var(--on-panel-muted); gap: 8px; justify-content: space-between; }
.nav .nav-page:hover { color: var(--on-panel); }
.nav .nav-page.nav-parent.is-open { color: var(--on-panel); font-weight: 600; }
.nav .nav-page[aria-current="page"] { color: var(--on-accent); }
.nav .nav-kid { min-height: 38px; font-size: 12.5px; }
.nav-later { display: flex; align-items: center; min-height: 40px; padding: 0 12px; font-size: 13px; color: var(--on-panel-muted); opacity: .55; cursor: default; }
.nav-later::after { content: "Later"; margin-left: auto; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.nav-badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent); color: var(--on-accent); font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.nav-badge[hidden] { display: none; }
/* Standard parts sheet: static picture of the section menu */
.menu-demo { background: var(--panel); color: var(--on-panel); border-radius: 14px; padding: 12px; }
.menu-demo .nav-sec-demo { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: var(--radius-control); font-weight: 600; font-size: 14px; box-shadow: inset 3px 0 0 var(--accent); }
.menu-demo .nav-page { display: flex; align-items: center; border-radius: var(--radius-control); }
.menu-demo .nav-page.is-current { background: var(--accent); color: var(--on-accent); font-weight: 600; }
.nav .nav-page[aria-current="page"] .nav-badge { background: var(--on-accent); color: var(--accent); }
.who { margin-top: auto; background: var(--panel2); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 12px; }
.who-row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar { flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--accent); color: var(--on-accent);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; }
.who-name { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who-role { font-size: 11px; color: var(--on-panel-muted); }
.who .btn { min-height: 40px; width: 100%; background: transparent; color: var(--on-panel); border-color: var(--panel-line); font-size: 13px; }
.who .btn:hover { background: var(--panel-hover); }
.menu-toggle { display: none; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 14px 40px; border-bottom: 1px solid var(--line); }
.crumb { font-size: 13px; color: var(--muted); }
.crumb strong { color: var(--ink); font-weight: 600; }
.topbar .spacer { flex: 1; }
.page { padding: 28px 40px 56px; display: flex; flex-direction: column; gap: 24px; width: 100%; max-width: 1320px; }
.page:focus { outline: none; }

.tile { display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: var(--ink); min-height: 44px; }
.tile:hover { border-color: var(--link); color: var(--ink); }
.tile b { font: 600 18px/1.3 var(--font-title); }
.tile span { color: var(--muted); font-size: 13px; }
.coming { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-direction: column; }
.coming li { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-top: 1px solid var(--line-soft); }

/* ---- People (directory, record, form, org) ---- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.person-cell { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0; border: 0; background: transparent; color: inherit;
  font: inherit; text-align: left; cursor: pointer; }
.person-cell b { font-weight: 600; }
tr.sel td { background: var(--select); }
tr.sel td:first-child { box-shadow: inset 3px 0 0 var(--accent); padding-left: 10px; }
.dir-card-box { container-type: inline-size; container-name: dir; }
@container dir (max-width: 700px) { .col-joined { display: none; } }  /* Joined is also in the preview */
.dir-cards { display: none; }
.dir-card { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 12px 0; border-top: 1px solid var(--line-soft); color: inherit; text-decoration: none; }
.preview { padding: 0; overflow: hidden; position: sticky; top: 16px; }
.preview-head { display: flex; align-items: center; gap: 16px; padding: 24px; background: var(--feature); color: var(--on-feature); }
.preview-head .h2 { color: var(--on-feature); }
.on-feature-muted { font-size: 13px; color: var(--on-feature-muted); }
.preview-body { display: flex; flex-direction: column; gap: 18px; padding: 22px 24px 24px; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 20px; margin: 0; }
.facts-wide { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.facts dt { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.facts dd { margin: 3px 0 0; font-weight: 500; overflow-wrap: anywhere; }
.lock { display: flex; align-items: center; gap: 8px; margin: 0; }
.lock svg { flex: none; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px 20px; }
.form-actions { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 14px; padding-top: 6px; }
.tree ul { list-style: none; margin: 0; padding: 0 0 0 22px; border-left: 1px solid var(--line); }
.tree > ul { padding-left: 0; border-left: 0; }
.tree li { padding: 4px 0; }
.node { display: flex; align-items: center; gap: 12px; min-height: 48px; color: inherit; text-decoration: none; }
.node:hover b { text-decoration: underline; }

/* Standard parts sheet (Admin) */
.parts { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 20px; }
.parts .card { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.swatch i { display: block; height: 56px; border-radius: 12px; border: 1px solid var(--line); margin-bottom: 8px; }
.swatch b { display: block; font-size: 13px; }
.swatch span { font-size: 11px; color: var(--muted); }

/* ---- Phone and small screens ---- */
@media (max-width: 860px) {
  .split { grid-template-columns: 1fr; }
  #d-preview, .dir-table { display: none; }
  .dir-cards { display: block; }
  .shell { flex-direction: column; }
  .panel { position: static; height: auto; flex: none; padding: 12px 16px; gap: 12px; }
  .menu-toggle { display: inline-flex; min-height: 44px; background: transparent; color: var(--on-panel); border-color: var(--panel-line); }
  .panel:not(.open) .nav, .panel:not(.open) .who { display: none; }
  .topbar { padding: 12px 16px; }
  .page { padding: 24px 16px 40px; }
  .title { font-size: 32px; }
  .signin-brand { padding: 32px 24px; gap: 28px; min-height: 0; }
  .signin-brand h1 { font-size: 38px; }
  .signin-brand img { height: 64px; }
  .signin-main { padding: 16px 16px 32px; }
  .signin-form h2 { font-size: 32px; }
  .seg button span { display: none; }
}

/* =========================================================
   PEOPLE & LEAVE (Track A): additions to the standard parts
   ========================================================= */
.stack { display: flex; flex-direction: column; gap: 16px; }
.form-stack { display: flex; flex-direction: column; gap: 14px; }
.h3 { margin: 0; font: 600 16px/1.3 var(--font-title); }
.wide { grid-column: 1 / -1; }
.num { font-variant-numeric: tabular-nums; }
.btn-small { min-height: 44px; padding: 0 14px; font-size: 13px; }
.sep { border: 0; border-top: 1px solid var(--line); width: 100%; margin: 4px 0; }
code { font-size: 12px; background: var(--surface2); border: 1px solid var(--line-soft); border-radius: 6px; padding: 1px 6px; }
.gate { font-size: 11px; font-weight: 600; color: var(--warn-fg); background: var(--warn-bg); border-radius: 999px; padding: 1px 8px; margin-left: 6px; }

/* Banner: a whole-row link that asks for attention */
.banner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 16px; min-height: 48px; padding: 12px 18px; border-radius: 14px; text-decoration: none; font-size: 13px; }
.banner span { font-weight: 600; text-decoration: underline; }
.banner-warn { background: var(--warn-bg); color: var(--warn-fg); }
.banner-err { background: var(--err-bg); color: var(--err-fg); }
.banner-info { background: var(--info-bg); color: var(--info-fg); }
.banner:hover { filter: brightness(.97); }
#d-banners:empty { display: none; }

/* Rows in lists */
.list-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; padding: 14px 0; border-top: 1px solid var(--line-soft); color: inherit; }
.list-row:first-of-type { border-top: 0; }
a.list-row:hover { background: var(--select); }
.list-main { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1 1 280px; }
.list-side { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px; flex: 0 1 auto; }
.doc-icon { flex: none; width: 36px; height: 36px; border-radius: 10px; background: var(--surface2); display: flex; align-items: center; justify-content: center; color: var(--link); }

/* Leave: request form */
.type-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; border: 0; padding: 0; margin: 0; }
.type-card { position: relative; display: block; cursor: pointer; }
.type-card input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; cursor: pointer; }
.type-card > span { display: flex; flex-direction: column; gap: 2px; min-height: 64px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.type-card input:checked + span { border: 2px solid var(--accent); padding: 11px 13px; background: var(--select); }
.type-card input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.day-count { padding: 12px 16px; border-radius: 14px; background: var(--surface2); font-size: 13px; }
.day-count.good { background: var(--ok-bg); color: var(--ok-fg); }
.day-count.bad { background: var(--err-bg); color: var(--err-fg); }
.me-grid { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

/* Calendar and attendance grids */
.cal { max-width: 100%; }
.cal-table { border-collapse: separate; border-spacing: 0; font-size: 12px; }
.cal-table th, .cal-table td { padding: 0; border-bottom: 1px solid var(--line-soft); border-right: 1px solid var(--line-soft); text-align: center; min-width: 30px; width: 30px; height: 36px; }
.cal-table .cal-name { position: sticky; left: 0; z-index: 1; min-width: 150px; width: 150px; text-align: left; padding: 0 10px; background: var(--surface); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-table thead th { height: 44px; font-weight: 600; color: var(--muted); background: var(--surface); }
.cal-d span { display: block; font-size: 12px; color: var(--ink); }
.cal-d small { display: block; font-size: 10px; font-weight: 400; }
.cal-table td { font-size: 11px; font-weight: 700; }
.c-off { background: var(--surface2) !important; }
.c-hol { background: var(--info-bg) !important; box-shadow: inset 0 -3px 0 var(--accent); }
.c-leave { background: var(--ok-bg); color: var(--ok-fg); }
.c-pending { background: var(--warn-bg); color: var(--warn-fg); background-image: repeating-linear-gradient(45deg, transparent 0 4px, var(--line) 4px 5px); }
.c-nopay { background: var(--err-bg); color: var(--err-fg); }
.c-absent { background: var(--err-bg); color: var(--err-fg); }
.c-late { background: var(--warn-bg); color: var(--warn-fg); }
.c-half { background: var(--warn-bg); color: var(--warn-fg); }
.c-present { color: var(--muted); }
.c-na { background-image: repeating-linear-gradient(45deg, transparent 0 4px, var(--line-soft) 4px 5px); }
.cell-btn { width: 100%; height: 100%; min-height: 36px; border: 0; background: transparent; color: inherit; font: inherit; cursor: pointer; }
.cell-btn:hover { background: var(--select); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: var(--muted); align-items: center; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { display: inline-block; width: 14px; height: 14px; border-radius: 4px; border: 1px solid var(--line); }
.month-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.mday { display: flex; flex-direction: column; justify-content: center; align-items: center; min-height: 52px; border-radius: 10px; border: 1px solid var(--line-soft); font-size: 12px; text-align: center; padding: 4px 2px; }
.mday b { font-size: 14px; }
.mday small { font-size: 10px; line-height: 1.1; }

/* Checklists */
.progress { height: 8px; border-radius: 4px; background: var(--surface2); overflow: hidden; border: 1px solid var(--line-soft); width: 100%; }
.progress i { display: block; height: 100%; background: var(--c1); }
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li { border-top: 1px solid var(--line-soft); }
.checklist li:first-child { border-top: 0; }
.check-row { display: flex; gap: 14px; align-items: flex-start; padding: 14px 0; cursor: pointer; min-height: 44px; }
.check-row input { flex: none; width: 22px; height: 22px; margin-top: 1px; accent-color: var(--c1); }
.checklist .done .step-title { text-decoration: line-through; color: var(--muted); }
.tp-row { display: grid; grid-template-columns: 28px minmax(0, 3fr) minmax(0, 1fr) minmax(0, 1fr) auto; gap: 12px; align-items: end; padding: 12px 0; border-top: 1px solid var(--line-soft); }
.tp-n { align-self: center; color: var(--muted); font-weight: 600; }

/* Switch table (Settings) */
.switch-table td { vertical-align: middle; }

/* Notifications bell */
.bell-wrap { position: relative; }
.bell { position: relative; }
.bell-count { position: absolute; top: 4px; right: 4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: var(--on-accent); font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.bell-panel { position: absolute; right: 0; top: 52px; z-index: 30; width: min(380px, calc(100vw - 32px)); max-height: 70vh; overflow-y: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card); box-shadow: var(--shadow-pop); }
.bell-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.bell-panel ul { list-style: none; margin: 0; padding: 0; }
.bell-panel li { padding: 12px 16px; border-bottom: 1px solid var(--line-soft); font-size: 13px; }
.bell-panel li.unread { background: var(--select); }
.bell-panel li small { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }
.bell-panel a { color: var(--ink); text-decoration: none; }
.bell-panel a:hover { text-decoration: underline; }

/* Letters: a printable page with the Sandbox letterhead (paper colours stay the same in dark mode) */
.letter { background: var(--brand-paper); color: var(--brand-ink); border: 1px solid var(--line); border-radius: 12px; padding: 40px 44px; font-family: var(--font-ui); font-size: 13.5px; line-height: 1.65; }
.letter p { margin: 0 0 14px; }
.letter-head { display: flex; justify-content: flex-end; align-items: center; gap: 14px; margin-bottom: 30px; }
.letter-logo { height: 54px; width: auto; }
.letter-co { text-align: right; font-size: 13px; line-height: 1.4; }
.letter-co b { display: block; font-weight: 700; }
.letter-meta { display: flex; justify-content: space-between; margin-bottom: 18px; font-size: 12.5px; }
.letter-to { font-weight: 600; margin-bottom: 8px; }
.letter-title { font: 600 16px/1.3 var(--font-title); margin: 12px 0 16px; text-transform: uppercase; letter-spacing: .04em; }
.letter-sign { margin-top: 28px; }
.sign-space { height: 48px; }
dialog.letter-dialog { width: min(820px, calc(100% - 24px)); max-height: 94vh; overflow-y: auto; }
.letter-tools { display: flex; gap: 10px; justify-content: flex-end; margin-bottom: 14px; }

@media print {
  body.printing-letter #root, body.printing-letter .env-strip, .no-print { display: none !important; }
  body.printing-letter { background: #fff; }
  dialog.letter-dialog { position: static; display: block; width: 100%; max-height: none; overflow: visible; border: 0; box-shadow: none; padding: 0; background: #fff; }
  dialog.letter-dialog::backdrop { display: none; }
  .letter { border: 0; border-radius: 0; padding: 0; }
}

@media (max-width: 860px) {
  .tp-row { grid-template-columns: 1fr 1fr; }
  .tp-title { grid-column: 1 / -1; }
  .tp-n { display: none; }
  .letter { padding: 24px 20px; }
  .topbar { gap: 8px; }
  .list-side { justify-content: flex-start; }
  .cal-table .cal-name { min-width: 110px; width: 110px; }
}

.sp-row { grid-template-columns: 2fr 1fr auto; align-items: end; }
.stack > *, .form-grid > *, .card { min-width: 0; }
.field textarea, .field input, .field select { max-width: 100%; }
@media (max-width: 860px) {
  .sp-row { grid-template-columns: 1fr; }
  .tp-row > * { min-width: 0; }
  .tp-row .row { grid-column: 1 / -1; }
  code { overflow-wrap: anywhere; }
}
.btn { white-space: normal; text-align: center; }

/* Letters: signature and footer (Track A) */
.sign-img { display: block; max-height: 56px; max-width: 180px; margin: 8px 0 6px; }
.letter-foot { margin-top: 48px; text-align: center; font-size: 11px; color: var(--muted); }

/* Cases and concerns (Track A) */
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.checklist li::before { content: "○"; display: inline-block; width: 22px; }
.checklist li.done { color: var(--ink); }
.checklist li.done::before { content: "✓"; color: var(--ok-fg); font-weight: 700; }
a.case-row { color: inherit; text-decoration: none; }
a.case-row:hover b { text-decoration: underline; }

/* Privacy notice gate (PDPA) */
.privacy-gate { min-height: 100vh; display: flex; justify-content: center; padding: 24px 16px; background: var(--bg); }
.privacy-gate > .card { width: 100%; max-width: 760px; align-self: flex-start; }
.privacy-text { max-height: 46vh; overflow: auto; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface2, var(--surface)); }
.privacy-text p { margin: 4px 0 14px; }

/* =========================================================
   Culture (Track D). Theme colours only; no hex codes.
   One memorable element: the value of the week, set as a large italic numeral beside its title.
   ========================================================= */
.cu-head { margin-bottom: 4px; }
.cu-kicker { margin: 0; font-size: 13px; font-weight: 500; letter-spacing: .02em; color: var(--on-feature-muted); }
.cu-h3 { margin: 0 0 4px; font: 600 16px/1.3 var(--font-ui); }
.cu-sub { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.cu-lede { margin: 16px 0 0; max-width: 68ch; font: 400 18px/1.6 var(--font-title); }

/* Hero: the value of the week */
.cu-hero { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 40px; align-items: start; background: var(--feature); color: var(--on-feature); border-radius: 28px; padding: 40px 44px 36px; }
.cu-numeral { font: italic 400 176px/.78 var(--font-title); color: var(--accent); padding-top: 10px; min-width: .6em; }
.cu-hero-body { min-width: 0; }
.cu-hero-title { margin: 8px 0 0; font: 400 clamp(28px, 3.6vw, 42px)/1.1 var(--font-title); }
.cu-hero-text { margin: 12px 0 0; max-width: 54ch; color: var(--on-feature-muted); font-size: 16px; line-height: 1.6; }
.cu-practices { list-style: none; margin: 26px 0 0; padding: 0; }
.cu-practices li { border-top: 1px solid var(--panel-line); }
.cu-tick { display: flex; gap: 16px; align-items: flex-start; width: 100%; min-height: 56px; padding: 14px 4px; background: none; border: 0; color: inherit; font: 400 15px/1.5 var(--font-ui); text-align: left; cursor: pointer; border-radius: 10px; }
.cu-tick:hover { background: var(--panel-hover); }
.cu-tick:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cu-box { flex: none; display: grid; place-items: center; width: 26px; height: 26px; margin-top: 1px; border-radius: 50%; border: 2px solid var(--on-feature-muted); font-size: 14px; font-weight: 700; transition: background .15s, border-color .15s; }
.cu-tick[aria-checked="true"] .cu-box { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.cu-foot { margin: 14px 0 0; font-size: 13px; color: var(--on-feature-muted); }

/* Purpose */
.cu-purpose { padding: 20px 0 8px; }
.cu-purpose::before { content: ""; display: block; width: 56px; height: 4px; border-radius: 2px; background: var(--accent); margin-bottom: 20px; }
.cu-purpose-line { margin: 0; font: italic 400 clamp(40px, 7vw, 76px)/1 var(--font-title); letter-spacing: -.01em; }
.cu-purpose-sub { margin: 16px 0 0; max-width: 62ch; color: var(--muted); }
.cu-two { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; align-items: start; }

/* Values rose */
.cu-rose { width: 100%; max-width: 320px; margin: 0 auto; display: block; }
.cu-wedge { fill: var(--c1); }
.cu-wedge-none { fill: var(--line-soft); }
.cu-wedge-now { fill: var(--accent); stroke: var(--ink); stroke-width: 1.5; }
.cu-rose-n { fill: var(--muted); font: 600 12px var(--font-ui); }
.cu-rose-now { fill: var(--ink); font-weight: 700; }

/* Shout-outs */
.cu-shout { padding: 16px 0; border-top: 1px solid var(--line-soft); }
.cu-shout:first-child { border-top: 0; padding-top: 4px; }
.cu-shout-top { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.cu-shout-top > div { flex: 1; min-width: 0; }
.cu-vpill { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: var(--on-accent); font: 600 13px var(--font-ui); }
.cu-quote { margin: 10px 0 0 48px; font: 400 18px/1.5 var(--font-title); }
.cu-shout-hidden { opacity: .6; }
.cu-shout .btn { margin-left: 36px; }

/* The book */
.cu-bookbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.cu-toc { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 6px; max-width: 100%; }
.cu-toc a { flex: none; display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none; font-size: 13px; font-weight: 500; }
.cu-toc a:hover { border-color: var(--link); }
.cu-purpose-big { padding: 28px 0 8px; scroll-margin-top: 16px; }
.cu-p-title { margin: 0; font: italic 400 clamp(46px, 9vw, 104px)/.98 var(--font-title); letter-spacing: -.015em; }
.cu-p-body { margin-top: 28px; max-width: 58ch; }
.cu-p-body p { margin: 0 0 16px; font: 400 21px/1.6 var(--font-title); }
.cu-block { margin-top: 48px; scroll-margin-top: 16px; }
.cu-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px 36px; margin-top: 20px; }
.cu-cols p, .cu-values p, .cu-comp p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
.cu-values { list-style: none; margin: 24px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 30px 52px; }
.cu-values li { display: flex; gap: 18px; align-items: flex-start; }
.cu-vn { flex: none; width: 46px; text-align: center; font: italic 400 58px/.9 var(--font-title); color: var(--link); }
.cu-band { margin-top: 56px; padding: 56px 28px; border-radius: 28px; background: var(--feature); color: var(--on-feature); text-align: center; }
.cu-band-big { margin: 0; font: 400 clamp(32px, 6vw, 62px)/1.08 var(--font-title); }
.cu-band-small { margin: 12px 0 0; font: italic 400 clamp(20px, 3vw, 28px)/1.2 var(--font-title); color: var(--accent); }
.cu-defs { margin: 20px 0 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 44px; }
.cu-defs > div { padding: 14px 0; border-top: 1px solid var(--line); }
.cu-defs dt { font-weight: 600; font-size: 16px; }
.cu-defs dd { margin: 4px 0 0; color: var(--muted); font-size: 14px; line-height: 1.55; }
.cu-fail { background: var(--surface2); border-radius: 24px; padding: 30px 32px 20px; }
.cu-fail .cu-defs > div { border-top-color: var(--line); }
.cu-quad { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 22px; }
.cu-comp { background: var(--surface); border: 1px solid var(--line); border-top: 5px solid var(--tone); border-radius: 16px; padding: 22px; }
.cu-expected { margin: 56px 0 8px; max-width: 46ch; scroll-margin-top: 16px; }
.cu-expected p { margin: 14px 0 0; font: 400 22px/1.45 var(--font-title); }
.cu-expected p:last-child { font-style: italic; }
.cu-agreed { display: flex; gap: 14px; align-items: center; }
.cu-check { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--ok-bg); color: var(--ok-fg); font-weight: 700; }

/* Editor */
.cu-fs { border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: grid; gap: 14px; min-width: 0; }
.cu-fs legend { padding: 0 8px; font-weight: 600; font-size: 14px; }
.cu-pair { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; padding-bottom: 12px; border-bottom: 1px solid var(--line-soft); }
.cu-pair:last-child { border-bottom: 0; padding-bottom: 0; }

/* Photography from the culture book, ribbon, lift */
.cu-hero { grid-template-columns: auto minmax(0, 1fr) minmax(0, 300px); position: relative; overflow: hidden; }
.cu-photo-wrap { align-self: center; justify-self: center; padding: 8px 20px 8px 0; }
.cu-photo { position: relative; margin: 0; width: 280px; max-width: 100%; background: var(--surface); padding: 9px; border-radius: 30px; box-shadow: 0 22px 44px rgba(0,0,0,.35); transform: rotate(3deg); animation: cu-bob 5s ease-in-out infinite; }
.cu-photo img { display: block; width: 100%; height: 320px; object-fit: cover; object-position: 50% 15%; border-radius: 22px; }
.cu-sticker { position: absolute; right: -14px; bottom: 22px; background: var(--accent); color: var(--on-accent); font: 700 14px var(--font-ui); padding: 9px 16px; border-radius: 999px; box-shadow: 0 8px 18px rgba(0,0,0,.25); transform: rotate(-6deg); }
@keyframes cu-bob { 0%, 100% { transform: rotate(3deg) translateY(0); } 50% { transform: rotate(-1deg) translateY(-8px); } }
.cu-bar { height: 10px; margin-top: 18px; border-radius: 999px; background: var(--panel-line); overflow: hidden; }
.cu-bar i { display: block; height: 100%; border-radius: 999px; background: var(--accent); transition: width .3s ease; }
.cu-ribbon { overflow: hidden; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); padding: 12px 0; }
.cu-ribbon-track { display: flex; width: max-content; gap: 12px; padding-left: 12px; animation: cu-roll 60s linear infinite; }
.cu-ribbon:hover .cu-ribbon-track { animation-play-state: paused; }
.cu-chip { white-space: nowrap; padding: 7px 16px; border-radius: 999px; background: var(--surface2); color: var(--ink); font: 600 14px var(--font-ui); }
.cu-chip-now { background: var(--accent); color: var(--on-accent); }
@keyframes cu-roll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.cu-say { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 20px; background: var(--accent); color: var(--on-accent); border-radius: 28px; padding: 24px 28px; }
.cu-say > div { flex: 1 1 220px; min-width: 0; }
.cu-say-img { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; object-position: 50% 25%; border: 4px solid var(--surface); }
.cu-say-h { margin: 0; font: 600 28px/1.1 var(--font-title); }
.cu-say p { margin: 6px 0 0; font-size: 15px; }
.cu-say-btn { background: var(--on-accent); color: var(--accent); border-radius: 999px; min-height: 48px; padding: 0 24px; font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; }
.cu-say-btn:hover { filter: brightness(1.15); color: var(--accent); }
.cu-lift, .cu-say, .cu-hero .cu-tick { transition: transform .2s ease, box-shadow .2s ease; }
.cu-lift:hover, .cu-say:hover { transform: translateY(-3px); box-shadow: var(--shadow-pop); }
.cu-collage { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-top: 28px; }
.cu-collage img { width: 100%; height: 150px; object-fit: cover; border-radius: 18px; display: block; }
.cu-collage img:nth-child(odd) { transform: rotate(-1.5deg); } .cu-collage img:nth-child(even) { transform: rotate(1.5deg) translateY(8px); }

/* The daily culture moment */
dialog.cu-moment { position: fixed; border: 0; border-radius: 28px; padding: 40px 34px 30px; width: min(520px, calc(100% - 28px)); background: var(--feature); color: var(--on-feature); box-shadow: var(--shadow-pop); overflow: hidden; animation: cu-rise .55s cubic-bezier(.2, .8, .2, 1) both; transition: opacity .16s, transform .16s; }
dialog.cu-moment::backdrop { background: var(--scrim); }
dialog.cu-moment.cu-leaving { opacity: 0; transform: translateY(8px); }
.cu-m-glow { position: absolute; right: -90px; top: -90px; width: 280px; height: 280px; border-radius: 50%; background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 38%, transparent), transparent); animation: cu-breathe 7s ease-in-out infinite; pointer-events: none; }
.cu-m-title { position: relative; margin: 14px 0 0; font: 400 clamp(30px, 6vw, 40px)/1.1 var(--font-title); }
.cu-m-text { position: relative; margin: 14px 0 0; color: var(--on-feature-muted); font-size: 16px; line-height: 1.6; }
.cu-m-q { position: relative; margin: 22px 0 0; font: italic 400 22px/1.3 var(--font-title); color: var(--accent); }
.cu-m-actions { position: relative; display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.cu-m-ghost { background: transparent; color: var(--on-feature); border: 1px solid var(--on-feature-muted); }
.cu-m-ghost:hover { border-color: var(--on-feature); color: var(--on-feature); }
.cu-m-close { background: transparent; color: var(--on-feature-muted); margin-left: auto; }
.cu-m-close:hover { color: var(--on-feature); }
@keyframes cu-rise { from { opacity: 0; transform: translateY(18px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes cu-breathe { 0%, 100% { opacity: .55; transform: scale(1); } 50% { opacity: 1; transform: scale(1.12); } }

@media (max-width: 880px) {
  .cu-two { grid-template-columns: minmax(0, 1fr); }
  .cu-values, .cu-defs, .cu-quad { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 880px) { .cu-hero { grid-template-columns: auto minmax(0, 1fr); } .cu-photo-wrap { grid-column: 1 / -1; padding: 16px 0 0; } }
@media (max-width: 600px) {
  .cu-collage { grid-template-columns: repeat(3, minmax(0, 1fr)); } .cu-collage img { height: 110px; } .cu-collage img:nth-child(n+4) { display: none; }
  .cu-photo { width: 220px; } .cu-photo img { height: 240px; }
  .cu-hero { grid-template-columns: minmax(0, 1fr); padding: 26px 22px 24px; border-radius: 24px; gap: 0; }
  .cu-numeral { font-size: 96px; padding-top: 0; line-height: .85; }
  .cu-quote { margin-left: 0; }
  .cu-shout .btn { margin-left: 0; }
  .cu-band { padding: 40px 20px; }
  .cu-fail { padding: 24px 20px 14px; }
  .cu-p-body p { font-size: 19px; }
  dialog.cu-moment { padding: 32px 24px 24px; }
}

/* The book (matches the approved mock-up). Colours only from theme tokens. */
.cb-kick { margin: 0; font: 600 12px var(--font-ui); letter-spacing: .14em; color: var(--muted); }
.cb-kick-on { color: var(--on-feature-muted); } .cb-kick-dark { color: var(--on-accent); }
.cb-hero { display: flex; flex-wrap: wrap; gap: 28px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 32px; padding: 44px; overflow: hidden; }
.cb-hero-text { flex: 1 1 380px; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.cb-title { margin: 0; font: 600 clamp(44px, 6.4vw, 76px)/.98 var(--font-title); } .cb-title em, .cb-h em { font-style: italic; color: var(--link); font-weight: 400; }
.cb-lede { margin: 0; max-width: 460px; font-size: 18px; line-height: 1.6; }
.cb-hero .cu-toc a:first-child { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.cb-collage { flex: 1 1 430px; min-width: 430px; max-width: 100%; position: relative; height: 400px; }
.cb-collage img, .cb-collage .cu-photo-mini { position: absolute; object-fit: cover; border-radius: 24px; box-shadow: 0 12px 28px rgba(0,0,0,.2); }
.cb-p1 { left: 0; top: 30px; width: 200px; height: 260px; transform: rotate(-5deg); } .cb-p2 { left: 190px; top: 0; width: 230px; height: 170px; transform: rotate(4deg); } .cb-p3 { left: 230px; top: 200px; width: 190px; height: 190px; transform: rotate(-3deg); }
.cb-collage .cu-photo-mini { left: 40px; top: 240px; width: 150px; height: 160px; background: var(--surface); padding: 6px; border-radius: 26px; animation: cu-bob 5s ease-in-out infinite; }
.cu-photo-mini img { position: static; width: 100%; height: 100%; border-radius: 20px; box-shadow: none; object-position: 50% 15%; }
.cb-row { display: flex; flex-wrap: wrap; gap: 20px; align-items: stretch; scroll-margin-top: 16px; }
.cb-purpose { flex: 1 1 440px; min-width: 0; background: var(--panel); color: var(--on-feature); border-radius: 28px; padding: 40px; display: grid; gap: 14px; align-content: center; }
.cb-purpose-h { margin: 0; font: 600 clamp(36px, 5vw, 52px)/1.02 var(--font-title); } .cb-purpose-h em, .cb-q-h em { font-style: italic; font-weight: 400; color: var(--accent); }
.cb-purpose-p { margin: 0; font-size: 17px; line-height: 1.6; max-width: 480px; } .cb-dim { color: var(--on-feature-muted); }
.cb-chandelier { flex: 0 1 280px; width: 280px; min-height: 320px; object-fit: cover; border-radius: 28px; background: #0A0A0A; }
.cb-about { flex: 1 1 260px; min-width: 0; background: var(--accent); color: var(--on-accent); border-radius: 28px; padding: 30px; display: grid; gap: 10px; align-content: center; }
.cb-about-h { margin: 0; font: 600 28px/1.1 var(--font-title); } .cb-about p { margin: 0; font-size: 15px; line-height: 1.5; }
.cb-minis { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin-top: -4px; }
.cb-mini { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 18px; } .cb-mini p { margin: 4px 0 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.cb-values-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 20px; margin-top: 28px; }
.cb-h { margin: 8px 0 0; font: 600 clamp(30px, 4vw, 44px)/1.05 var(--font-title); max-width: 18em; }
.cb-bottle { height: 150px; width: auto; border-radius: 20px; }
.cb-values { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.cb-val { background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 26px; display: grid; gap: 6px; align-content: start; }
.cb-val h3 { margin: 0; font: 600 19px/1.3 var(--font-ui); } .cb-val p { margin: 0; font-size: 15px; line-height: 1.5; color: var(--muted); }
.cb-n { font: italic 400 64px/.9 var(--font-title); color: var(--accent); -webkit-text-stroke: 1px var(--ink); }
.cb-val.cv-green { background: var(--feature); color: var(--on-feature); border-color: transparent; } .cb-val.cv-teal { background: var(--panel); color: var(--on-feature); border-color: transparent; }
.cb-val.cv-green p, .cb-val.cv-teal p { color: var(--on-feature-muted); } .cv-green .cb-n, .cv-teal .cb-n { -webkit-text-stroke: 0; }
.cb-val.cv-gold { background: var(--accent); color: var(--on-accent); border-color: transparent; } .cv-gold p { color: var(--on-accent); } .cv-gold .cb-n { color: var(--on-accent); -webkit-text-stroke: 0; }
.cb-pair { display: flex; flex-wrap: wrap; gap: 24px; }
.cb-way, .cb-fail { flex: 1 1 440px; min-width: 0; border-radius: 28px; overflow: hidden; display: flex; }
.cb-way { flex-direction: column; background: #0A0A0A; color: #fff; } .cb-way img { width: 100%; height: 200px; object-fit: cover; } .cb-way > div { padding: 30px; }
.cb-way h2 { margin: 0 0 12px; font: 600 34px var(--font-title); color: var(--accent); }
.cb-fail { background: var(--surface); border: 1px solid var(--line); } .cb-fail > div { flex: 1 1 280px; padding: 30px; } .cb-fail img { flex: 0 1 170px; width: 170px; object-fit: cover; }
.cb-fail h2 { margin: 0 0 12px; font: 600 34px/1.05 var(--font-title); }
.cb-defs { margin: 0; display: grid; gap: 10px; } .cb-defs dt { font-weight: 600; font-size: 15px; } .cb-defs dd { margin: 2px 0 0; font-size: 14px; line-height: 1.5; opacity: .85; }
.cb-truths-row { display: flex; flex-wrap: wrap; gap: 24px; scroll-margin-top: 16px; }
.cb-truths-photo { flex: 1 1 300px; position: relative; min-height: 420px; border-radius: 28px; overflow: hidden; background: #0A0A0A; } .cb-truths-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cb-truths-cap { position: absolute; left: 16px; right: 16px; bottom: 16px; background: var(--surface); border-radius: 20px; padding: 18px 22px; } .cb-truths-cap h2 { margin: 0; font: 600 28px var(--font-title); } .cb-truths-cap p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.cb-truths { flex: 2 1 560px; min-width: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; align-content: start; }
.cb-truth { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 18px; } .cb-truth p { margin: 4px 0 0; font-size: 14px; color: var(--muted); }
.cb-truth.ct-gold { background: var(--accent); color: var(--on-accent); border-color: transparent; } .ct-gold p { color: var(--on-accent); }
.cb-truth.ct-green { background: var(--feature); color: var(--on-feature); border-color: transparent; } .ct-green p { color: var(--on-feature-muted); } .ct-green b { color: var(--accent); }
.cb-quantum { display: flex; flex-wrap: wrap; gap: 28px; align-items: center; background: var(--panel); color: var(--on-feature); border-radius: 28px; padding: 40px; scroll-margin-top: 16px; }
.cb-quantum > div:first-child { flex: 1 1 380px; min-width: 0; display: grid; gap: 12px; } .cb-q-h { margin: 0; font: 600 clamp(30px, 4vw, 42px)/1.05 var(--font-title); }
.cb-quad { flex: 1 1 400px; min-width: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; } .cb-quad > div { background: rgba(255,255,255,.1); border-radius: 20px; padding: 20px; } .cb-quad p { margin: 4px 0 0; font-size: 14px; color: var(--on-feature-muted); }
.cb-expected { display: flex; flex-wrap: wrap; gap: 28px; align-items: center; justify-content: space-between; background: var(--accent); color: var(--on-accent); border-radius: 32px; padding: 44px; scroll-margin-top: 16px; }
.cb-expected > div:first-child { flex: 1 1 440px; min-width: 0; } .cb-exp { margin: 12px 0 0; font-size: 17px; line-height: 1.6; max-width: 520px; } .cb-exp-last { margin: 12px 0 0; font: italic 400 26px var(--font-title); }
.cb-ack { flex: 1 1 300px; min-width: 0; display: flex; gap: 20px; align-items: center; flex-wrap: wrap; } .cb-ack-img { width: 110px; height: 110px; border-radius: 50%; object-fit: cover; object-position: 50% 20%; border: 5px solid var(--surface); animation: cu-bob 5s ease-in-out infinite; }
.cb-ack-h { margin: 0 0 8px; font: 600 22px var(--font-title); } .cb-ack .check, .cb-ack .note, .cb-ack b { color: var(--on-accent); } .cb-ack .btn-primary { background: #0A0A0A; color: #fff; }
@media (max-width: 600px) {
  .cb-hero, .cb-purpose, .cb-quantum, .cb-expected { padding: 26px 22px; border-radius: 24px; } .cb-collage { height: 360px; min-width: 0; flex-basis: 100%; } .cb-p1 { width: 150px; height: 220px; } .cb-p3 { left: 150px; width: 160px; height: 160px; } .cb-p2 { left: 130px; width: 180px; height: 140px; }
  .cb-quad { grid-template-columns: minmax(0, 1fr); } .cb-fail { flex-direction: column; } .cb-fail img { width: 100%; height: 160px; flex-basis: auto; }
}

/* Leave balances: one bar per type */
.lb { display: grid; gap: 8px; } .lb-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.lb-name { font-weight: 600; font-size: 16px; } .lb-num { color: var(--muted); font-size: 14px; } .lb-num b { color: var(--ink); font-size: 18px; }
.lb-track { height: 14px; border-radius: 999px; background: var(--surface2); overflow: hidden; } .lb-fill { height: 100%; border-radius: 999px; background: var(--accent); transition: width .4s ease; }
.lb-note { font-size: 13px; color: var(--muted); }
.lb-card { gap: 22px; }
/* Away this week (Home) */
.away-list { display: flex; flex-wrap: wrap; gap: 12px; }
.away-chip { display: flex; align-items: center; gap: 12px; padding: 10px 16px 10px 10px; border-radius: 999px; background: var(--surface); color: var(--ink); text-decoration: none; }
.away-chip:hover { color: var(--ink); filter: brightness(.97); } .away-chip small { display: block; color: var(--muted); font-size: 13px; }
.away-av { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: var(--on-accent); font: 700 13px var(--font-ui); }
/* Team cover calendar */
.tc-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; } .tc-h { text-align: center; font: 600 12px var(--font-ui); color: var(--muted); }
.tc { min-height: 60px; padding: 8px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); font-size: 13px; } .tc span { display: block; margin-top: 4px; font-size: 12px; }
.tc-off { background: var(--surface2); opacity: .6; border-color: transparent; } .tc-hol { background: var(--ok-bg); color: var(--ok-fg); border-color: transparent; }
.tc-nearly { background: color-mix(in srgb, var(--accent) 30%, var(--surface)); } .tc-full { background: var(--accent); color: var(--on-accent); border-color: transparent; }
.tc-sw { display: inline-block; width: 14px; height: 14px; border-radius: 4px; border: 1px solid var(--line); vertical-align: -2px; background: var(--surface); }
.tc-sw.tc-nearly { background: color-mix(in srgb, var(--accent) 30%, var(--surface)); } .tc-sw.tc-full { background: var(--accent); }
@media (max-width: 600px) { .tc { min-height: 48px; padding: 5px; } .tc span { font-size: 10px; } .tc-grid { gap: 4px; } }
.lb-mini { display: block; height: 8px; margin-top: 6px; min-width: 90px; }

/* ---------- Finance › Payroll (Track C) ---------- */
.fin-in { min-height: 40px; width: 100%; min-width: 90px; border: 1px solid var(--line); border-radius: var(--radius-control); padding: 0 10px;
  background: var(--input); color: var(--ink); font: inherit; font-variant-numeric: tabular-nums; }
.fin-in[aria-invalid="true"] { border: 2px solid var(--err-fg); }
.fin-formula { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; min-height: 56px; padding: 10px 12px; resize: vertical; }
.fin-check { font-size: 12px; margin-top: 6px; color: var(--muted); }
.fin-check.ok { color: var(--ok-fg); } .fin-check.err { color: var(--err-fg); }
.fin-slip { display: grid; gap: 4px; font-variant-numeric: tabular-nums; }
.fin-slip .ln { display: flex; justify-content: space-between; gap: 16px; padding: 6px 0; border-bottom: 1px solid var(--line-soft); font-size: 14px; }
.fin-slip .ln small { display: block; color: var(--muted); font-size: 12px; }
.fin-slip .ln.tot { font-weight: 600; border-bottom: 1px solid var(--line); }
.fin-slip .ln.neg b { color: var(--err-fg); font-weight: 500; }
.fin-net { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-top: 10px; padding: 14px 18px; border-radius: 14px;
  background: var(--feature); color: var(--on-feature); }
.fin-net b { font: 400 30px/1.1 var(--font-title); font-variant-numeric: tabular-nums; }
.fin-tag { display: inline-block; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; padding: 1px 6px; border-radius: 6px; background: var(--surface2); border: 1px solid var(--line-soft); }
.fin-diff { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: 13px; font-variant-numeric: tabular-nums; }
.fin-diff s { color: var(--muted); }
.fin-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.fin-kpis .card { padding: 18px 20px; }
.fin-kpis .figure { font-size: 26px; margin-top: 6px; }

/* ---------- Payslips and annual documents (Track C, P3): always paper-white, like the printed copy ---------- */
.ps { background: #fff; color: #0A0A0A; max-width: 820px; padding: 36px 40px; border-radius: 6px; box-shadow: var(--shadow); font-size: 13px; display: flex; flex-direction: column; gap: 16px; }
.ps-hd { display: flex; justify-content: space-between; gap: 20px; padding-bottom: 14px; border-bottom: 3px solid #FED401; }
.ps-hd img { height: 42px; } .ps-co { text-align: right; font-size: 11px; color: #5E5A50; line-height: 1.5; } .ps-co b { color: #0A0A0A; }
.ps-title { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px 16px; }
.ps-title h2 { font: 400 24px/1.2 var(--font-title); margin: 0; display: flex; align-items: center; gap: 14px; white-space: nowrap; }
.ps-title h2 i { width: 1.5px; height: 24px; background: #0A0A0A; opacity: .5; }
.ps-title > span { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; font-weight: 600; color: #10605C; }
.ps-ids, .ps-lv { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px 16px; margin: 0; background: #FBF7EE; border: 1px solid #E6DFCF; border-radius: 12px; padding: 14px 16px; }
.ps-lv { background: #fff; } .ps-lv .w2 { grid-column: span 2; }
.ps-ids dt, .ps-lv dt { font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase; color: #5E5A50; font-weight: 600; }
.ps-ids dd, .ps-lv dd { margin: 2px 0 0; font-weight: 500; font-size: 12.5px; overflow-wrap: anywhere; }
.ps-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.ps h3, .ps-h3 { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: #5E5A50; margin: 0 0 6px; font-weight: 600; }
.ps-r { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid #F3EEE2; font-variant-numeric: tabular-nums; }
.ps-r small { display: block; color: #5E5A50; font-size: 10.5px; } .ps-r.t { font-weight: 600; border-bottom: 1.5px solid #0A0A0A; } .ps-neg { color: #8A2A1E; }
.ps-net { display: flex; justify-content: space-between; align-items: center; gap: 12px; background: #233E2C; color: #fff; border-radius: 14px; padding: 16px 22px; }
.ps-net span { font-size: 12.5px; opacity: .9; } .ps-net em { display: block; font-style: normal; font-size: 11px; opacity: .8; margin-top: 2px; }
.ps-net b { font: 400 28px/1.1 var(--font-title); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ps-ctc { margin-top: 10px; display: flex; justify-content: space-between; align-items: center; gap: 10px; border: 1.5px solid #233E2C; border-radius: 12px; padding: 10px 14px; font-variant-numeric: tabular-nums; }
.ps-ctc small { display: block; color: #5E5A50; font-size: 10px; font-weight: 400; }
.ps-form { border: 1px solid #E6DFCF; border-radius: 12px; padding: 4px 14px; }
.ps-tbl { width: 100%; border-collapse: collapse; font-size: 12px; min-width: 560px; font-variant-numeric: tabular-nums; }
.ps-tbl th { text-align: right; font-size: 10px; color: #5E5A50; padding: 6px 4px; border-bottom: 1.5px solid #0A0A0A; } .ps-tbl td { text-align: right; padding: 6px 4px; border-bottom: 1px solid #F3EEE2; }
.ps-tbl th:first-child, .ps-tbl td:first-child { text-align: left; }
.ps-foot { display: flex; justify-content: space-between; gap: 16px; padding-top: 12px; border-top: 1px solid #E6DFCF; font-size: 10.5px; color: #5E5A50; }
@media (max-width: 700px) { .ps { padding: 20px 16px; } .ps-ids, .ps-lv { grid-template-columns: 1fr 1fr; } .ps-cols { grid-template-columns: 1fr; } .ps-title h2 { font-size: 20px; white-space: normal; } .ps-net b { font-size: 22px; } }
@media print {
  body * { visibility: hidden !important; }
  .print-area, .print-area * { visibility: visible !important; }
  .print-area { position: absolute; left: 0; top: 0; width: 100%; max-width: none; box-shadow: none; border-radius: 0; padding: 0; }
  @page { size: A4 portrait; margin: 14mm; }
}
.py-split { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 960px) { .py-split { grid-template-columns: minmax(0, 1fr); } }
.fin-guide { border-left: 4px solid var(--accent); }
.fin-steps { margin: 8px 0 0; padding-left: 20px; display: grid; gap: 6px; line-height: 1.5; }
.ps { position: relative; }
.ps-preview { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: #8A2A1E; color: #fff; font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; padding: 6px 14px; border-radius: 6px; }
@media print { .ps-preview { display: block; } }
