@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=IBM+Plex+Mono:wght@500;700&display=swap');

/* --oak is the brand colour (set in /brand.css). */
:root {
  --oak: #1f3a5f; --oak-2: #2c5280; --tint: #e8eef5;
  --ink: #17150f; --ink-2: #6f685d; --faint: #9a9388;
  --line: #e7e2d9; --paper: #f4f1ea; --card: #ffffff;
  --slab: #23211b;
  --leaf: #2f7d4f; --leaf-bg: #e9f4ee;
  --amber: #b6852a; --amber-bg: #fbf2dd;
  --brick: #c0392b; --brick-bg: #fbeae7;
  --sky: #2d5a78; --sky-bg: #e6eef3;
  --shadow: 0 1px 2px rgba(23,21,15,.04), 0 10px 30px rgba(23,21,15,.06);
  --mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --radius: 13px;
  --rail: 248px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); color: var(--ink); background: var(--paper); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.02em; }
h1 { font-size: 1.45rem; font-weight: 800; }
h2 { font-size: 1.1rem; font-weight: 700; }
h3 { font-size: .98rem; font-weight: 700; }
p { margin: 0 0 .75em; }
a { color: var(--oak); }
:focus-visible { outline: 2px solid var(--oak); outline-offset: 2px; }
.muted { color: var(--ink-2); }
.small { font-size: .82rem; }
.hidden { display: none !important; }

/* ---------- forms ---------- */
label { display: block; font-weight: 700; font-size: .78rem; margin: 0 0 .35rem; }
.field { margin-bottom: 1rem; }
.hint { font-weight: 500; color: var(--ink-2); font-size: .78rem; }
input:not([type]), input[type=text], input[type=tel], input[type=email], input[type=password], input[type=number], input[type=date], input[type=search], select, textarea {
  width: 100%; font: inherit; font-size: .92rem; color: inherit; padding: .62rem .75rem; border: 1px solid var(--line); border-radius: 9px; background: #fff;
}
textarea { min-height: 5rem; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--oak); outline: none; box-shadow: 0 0 0 3px var(--tint); }
input[type=file] { font-size: .85rem; }
.row { display: grid; gap: 0 1rem; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.check { display: flex; gap: .65rem; align-items: flex-start; font-weight: 500; font-size: .9rem; padding: .7rem .8rem; border: 1px solid var(--line); border-radius: 9px; background: #fff; cursor: pointer; }
.check input { width: 1.15rem; height: 1.15rem; margin-top: .1rem; accent-color: var(--oak); flex: none; }

/* ---------- buttons ---------- */
.btn { font: inherit; font-size: .84rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: .4rem; border: 1px solid var(--oak); border-radius: 9px;
  padding: .55rem 1rem; background: var(--oak); color: #fff; cursor: pointer; text-decoration: none; min-height: 2.4rem; transition: background .15s, border-color .15s; white-space: nowrap; }
.btn:hover { background: var(--oak-2); border-color: var(--oak-2); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn.ghost { background: #fff; color: var(--ink); border-color: var(--line); font-weight: 600; }
.btn.ghost:hover { background: var(--paper); border-color: var(--line); }
.btn.quiet { background: transparent; border-color: transparent; color: var(--ink-2); padding: .3rem .55rem; min-height: auto; font-weight: 700; }
.btn.quiet:hover { color: var(--oak); background: var(--tint); }
.btn.danger { background: var(--brick); border-color: var(--brick); }
.btn.small { font-size: .74rem; padding: .32rem .7rem; min-height: 1.9rem; border-radius: 7px; }
.btn.small.ghost { color: var(--ink-2); }
.btn.small.ghost:hover { color: var(--oak); border-color: var(--oak); background: #fff; }
.btn.big { width: 100%; font-size: 1.05rem; font-weight: 800; min-height: 3.4rem; border-radius: 12px; }

/* ---------- notes & pills ---------- */
.note { padding: .75rem 1rem; border-radius: 10px; margin-bottom: 1rem; font-size: .88rem; font-weight: 600; }
.note.err { background: var(--brick-bg); color: var(--brick); }
.note.ok { background: var(--leaf-bg); color: var(--leaf); }
.note.warn { background: var(--amber-bg); color: #8a6219; }
.note.info { background: var(--sky-bg); color: var(--sky); }

.pill { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: .7rem; font-weight: 700; letter-spacing: .02em; padding: .22rem .6rem; border-radius: 20px; white-space: nowrap; }
.pill.yes, .pill.published, .pill.accepted { background: var(--leaf-bg); color: var(--leaf); }
.pill.under_review { background: var(--amber-bg); color: var(--amber); }
.pill.no, .pill.returned { background: var(--brick-bg); color: var(--brick); }
.pill.received { background: var(--sky-bg); color: var(--sky); }
.pill.draft, .pill.grey, .pill.superseded { background: #efece5; color: var(--ink-2); }

/* ---------- office shell (sidebar + topbar) ---------- */
.ad-shell { display: grid; grid-template-columns: var(--rail) 1fr; min-height: 100vh; }
.ad-nav { background: var(--slab); color: #cfc9bd; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; overflow-y: auto; }
.rail-brand { padding: 22px 22px 18px; border-bottom: 1px solid rgba(255,255,255,.08); }
.rail-brand .logo { background: #fff; border-radius: 9px; padding: 7px 10px; display: inline-flex; margin-bottom: 12px; max-width: 100%; }
.rail-brand .logo img { height: 28px; max-width: 180px; object-fit: contain; display: block; }
.rail-brand .t { font-size: 13px; font-weight: 700; color: #fff; letter-spacing: -.01em; }
.rail-brand .s { font-size: 11px; color: #8e8779; margin-top: 1px; }
.ad-nav nav { padding: 10px 12px; flex: 1; }
.nav-label { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: #7a7367; font-weight: 700; padding: 12px 12px 6px; }
.ad-nav a { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 9px; color: #cfc9bd; font-size: 14px; font-weight: 500; text-decoration: none; border: 1px solid transparent; margin-bottom: 2px; transition: .12s; }
.ad-nav a:hover { background: rgba(255,255,255,.05); color: #fff; }
.ad-nav a.on { background: var(--oak); border-color: var(--oak); color: #fff; font-weight: 600; }
.ad-nav .ic { width: 18px; height: 18px; flex-shrink: 0; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ad-nav .count { margin-left: auto; font-family: var(--mono); font-size: 11px; font-weight: 700; background: rgba(255,255,255,.12); padding: 1px 7px; border-radius: 20px; }
.ad-nav a.on .count { background: rgba(255,255,255,.25); }
.rail-foot { padding: 16px 22px; border-top: 1px solid rgba(255,255,255,.08); font-size: 11px; color: #8e8779; }
.rail-foot .live { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: #cfc9bd; }
.rail-foot .dot { width: 6px; height: 6px; border-radius: 50%; background: #7fd1a0; }

.ad-body { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 5; background: rgba(244,241,234,.88); backdrop-filter: saturate(160%) blur(8px); border-bottom: 1px solid var(--line);
  padding: 16px 34px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.topbar h1 { font-size: 19px; margin: 0; font-weight: 800; }
.topbar .crumb { font-size: 12px; color: var(--ink-2); margin-top: 1px; }
.userchip { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--ink-2); }
.userchip b { color: var(--ink); font-weight: 600; }
.userchip button { background: none; border: 0; padding: 0; font: inherit; font-size: 11px; font-weight: 700; color: var(--oak); cursor: pointer; }
.burger { display: none; background: none; border: none; cursor: pointer; padding: 6px; }
.burger svg { width: 24px; height: 24px; stroke: var(--ink); fill: none; stroke-width: 2; }
.scrim { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 40; }

.ad-main { padding: 26px 34px 70px; max-width: 1200px; }
.ad-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.3rem; }
.ad-head h1 { margin: 0; font-size: 1.45rem; }
.ad-head p { margin: .2rem 0 0; font-size: .88rem; }
.ad-head > div:last-child:not(:first-child) { display: flex; gap: .5rem; flex-wrap: wrap; }
.ad-main > h2, .ad-main > div > h2.sec { display: flex; align-items: center; gap: 14px; font-size: 11.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-2); font-weight: 700; margin: 1.8rem 0 .9rem; }
.ad-main > h2::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.ad-main > h3 { font-size: .9rem; margin-top: 1.4rem; }
.toolbar { display: flex; gap: .7rem; flex-wrap: wrap; align-items: end; margin-bottom: 1rem; }
.toolbar .field { margin: 0; min-width: 180px; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 22px; margin-bottom: 1.25rem; box-shadow: var(--shadow); }
.panel h2 { font-size: .98rem; margin-bottom: .3rem; }

/* ---------- tables ---------- */
.tablewrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 1.25rem; box-shadow: var(--shadow); padding: 6px 12px; }
table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
th { text-align: left; font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); font-weight: 700; padding: 12px 10px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .12s; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--paper); }
td b { font-weight: 600; }
.empty { padding: 2.6rem 1rem; text-align: center; color: var(--ink-2); font-size: .9rem; }
.empty b { display: block; color: var(--ink); font-size: 1rem; margin-bottom: .3rem; }

/* ---------- dashboard ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin-bottom: 1.6rem; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); text-decoration: none; color: inherit; display: flex; flex-direction: column-reverse; justify-content: flex-end; transition: border-color .12s; }
.stat:hover { border-color: var(--oak); }
.stat .l { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); font-weight: 700; margin-bottom: 10px; }
.stat .n { font-size: 34px; font-weight: 800; line-height: 1; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.stat.accent .n { color: var(--oak); }
.stat.bad .n { color: var(--brick); }
.flags { display: grid; gap: 10px; margin-bottom: 1.4rem; }
.flag { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 13px 18px; border-radius: 11px; background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--amber); box-shadow: var(--shadow); font-size: .9rem; font-weight: 500; }
.flag.red { border-left-color: var(--brick); }
.flag.green { border-left-color: var(--leaf); }

/* ---------- training matrix & sign-off register ---------- */
.matrix { width: auto; min-width: 100%; }
.matrix td:first-child { min-width: 190px; }
.matrix th.rot { width: 84px; min-width: 84px; white-space: normal; vertical-align: bottom; text-align: center; padding: 12px 4px 10px; line-height: 1.3; letter-spacing: .04em; }
.matrix th.rot > div { font-size: 9.5px; }
.matrix td.c { text-align: center; padding: 8px 4px; min-width: 60px; cursor: pointer; vertical-align: middle; }
.matrix td.c > span, .matrix td.c:not(:empty) { font-family: var(--mono); font-size: 11px; font-weight: 700; }
.matrix td.c.valid, .matrix td.c.expiring, .matrix td.c.expired, .matrix td.c.missing { background-clip: padding-box; border-left: 3px solid #fff; border-right: 3px solid #fff; border-radius: 6px; }
.matrix td.c:hover { background: var(--tint); }
.matrix td.c.valid:hover, .matrix td.c.expiring:hover, .matrix td.c.expired:hover, .matrix td.c.missing:hover { filter: brightness(.96); }
.c.valid { background: var(--leaf-bg); color: var(--leaf); }
.c.expiring { background: var(--amber-bg); color: var(--amber); }
.c.expired, .c.missing { background: var(--brick-bg); color: var(--brick); }
.signmatrix td.c { cursor: default; }
.signmatrix td.c:hover { box-shadow: none; }
.legend { display: flex; gap: 1.1rem; flex-wrap: wrap; font-size: .8rem; color: var(--ink-2); margin-bottom: .9rem; }
.legend span::before { content: ''; display: inline-block; width: .85rem; height: .85rem; border-radius: 4px; vertical-align: -2px; margin-right: .4rem; }
.legend .valid::before { background: var(--leaf-bg); border: 1px solid var(--leaf); }
.legend .expiring::before { background: var(--amber-bg); border: 1px solid var(--amber); }
.legend .expired::before { background: var(--brick-bg); border: 1px solid var(--brick); }
.legend .none::before { background: #fff; border: 1px solid var(--line); }

.linkbox { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.linkbox input { flex: 1; min-width: 220px; font-family: var(--mono); font-size: .8rem; background: var(--paper); }
.tabs { display: flex; gap: .2rem; border-bottom: 1px solid var(--line); margin-bottom: 1.1rem; }
.tabs button { font: inherit; font-size: .88rem; font-weight: 600; background: none; border: 0; padding: .6rem .9rem; cursor: pointer; color: var(--ink-2); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button.on { color: var(--ink); border-bottom-color: var(--oak); }
.info-list { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 1rem; }
.info-list > div { padding: .75rem 1rem; border-bottom: 1px solid var(--line); }
.info-list > div:last-child { border-bottom: 0; }
.info-list dt { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); font-weight: 700; }
.info-list dd { margin: .15rem 0 0; white-space: pre-wrap; }
details summary { cursor: pointer; margin: .4rem 0; }

/* Talk editor */
.ed-block { border: 1px solid var(--line); border-radius: 11px; padding: 14px 16px; margin-bottom: .8rem; background: #fff; box-shadow: var(--shadow); }
.ed-block .ed-tools { display: flex; gap: .2rem; justify-content: flex-end; margin-bottom: .3rem; }
.ed-opt { display: flex; gap: .5rem; align-items: center; margin-bottom: .4rem; }
.ed-opt input[type=radio] { accent-color: var(--leaf); width: 1.1rem; height: 1.1rem; flex: none; }

/* Dialogs */
dialog { border: 0; border-radius: 14px; padding: 0; width: min(640px, 94vw); max-height: 90vh; box-shadow: 0 30px 80px rgba(0,0,0,.4); }
dialog::backdrop { background: rgba(23,21,15,.5); }
.dlg-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 24px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff; z-index: 1; }
.dlg-head h2 { margin: 0; font-size: 1.05rem; }
.dlg-body { padding: 20px 24px; }
.dlg-foot { display: flex; justify-content: flex-end; gap: .6rem; padding: 14px 24px; border-top: 1px solid var(--line); position: sticky; bottom: 0; background: #fff; }
.dlg-foot .left { margin-right: auto; }

/* Login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; background: var(--paper); padding: 1.5rem; }
.login-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 2rem; width: min(420px, 100%); box-shadow: var(--shadow); }
.login-card img { height: 36px; max-width: 220px; object-fit: contain; margin-bottom: 1.4rem; display: block; }
.login-card h1 { font-size: 1.3rem; }
.login-card .sub { font-size: .78rem; color: var(--faint); margin: -.3rem 0 1.2rem; font-family: var(--mono); letter-spacing: .04em; text-transform: uppercase; }

/* ---------- operative pages (phones) ---------- */
body.signin { background: var(--paper); min-height: 100vh; }
.si-top { max-width: 900px; margin: 0 auto; padding: 22px 20px 0; text-align: center; }
.si-top img { height: 34px; max-width: 200px; object-fit: contain; display: block; margin: 0 auto 14px; }
.si-head { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; box-shadow: var(--shadow); }
.si-addr { font-family: var(--mono); font-size: 11px; font-weight: 700; color: var(--oak); letter-spacing: .05em; margin: 0; text-transform: uppercase; }
.si-site { font-size: 1.15rem; font-weight: 800; margin: 2px 0 0; letter-spacing: -.02em; line-height: 1.25; }
.si-body { padding: 18px 20px 48px; }
.si-inner { max-width: 900px; margin: 0 auto; }
.si-inner h1 { font-size: 1.3rem; }
.si-who { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 10px 14px; background: #fff; border: 1px solid var(--line); border-radius: 11px; margin-bottom: 1.1rem; font-size: .9rem; }
.si-who b { display: block; }
.si-done { text-align: center; padding: 2rem 0 1rem; }
.si-done .tick { width: 76px; height: 76px; border-radius: 50%; background: var(--leaf); color: #fff; display: grid; place-items: center; margin: 0 auto 1rem; font-size: 2.3rem; }
.si-done h1 { margin-bottom: .3rem; }
.ind-section { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 1rem; box-shadow: var(--shadow); font-size: .98rem; }
.ind-section h2 { font-size: 1.1rem; }
.ind-section .body { white-space: pre-wrap; }
.ind-progress { font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); margin-bottom: .6rem; }
.quiz-q { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 1rem; }
.quiz-q.wrong { border-color: var(--brick); background: #fffaf9; }
.quiz-q .opts { display: grid; gap: .5rem; margin-top: .7rem; }
.quiz-q .opts label { font-size: .95rem; font-weight: 500; display: flex; gap: .65rem; align-items: flex-start; padding: .7rem .8rem; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; margin: 0; }
.quiz-q .opts label:has(input:checked) { border-color: var(--oak); background: var(--tint); }
.quiz-q .opts input { accent-color: var(--oak); width: 1.1rem; height: 1.1rem; margin-top: .15rem; flex: none; }
.sig-wrap { background: #fff; border: 1.5px dashed #c8c0b3; border-radius: 12px; padding: .4rem; margin-bottom: .4rem; }
.sig-wrap canvas { width: 100%; height: 170px; display: block; touch-action: none; border-radius: 8px; }
.doc-card { display: flex; justify-content: space-between; align-items: center; gap: .8rem; background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--brick); border-radius: 12px; padding: 14px 16px; margin-bottom: .7rem; box-shadow: var(--shadow); }
.doc-card.done { border-left-color: var(--leaf); }
.doc-card.info { border-left-color: var(--line); }
.doc-card b { display: block; margin: 1px 0 4px; }
.doc-card .k { font-family: var(--mono); font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--faint); }
.link-row { text-align: center; margin-top: 1rem; }

.print-only { display: none; }

@media (max-width: 900px) {
  .ad-shell { grid-template-columns: 1fr; }
  .ad-nav { position: fixed; left: 0; top: 0; width: var(--rail); z-index: 50; transform: translateX(-100%); transition: transform .2s; box-shadow: 0 0 40px rgba(0,0,0,.3); }
  .ad-nav.open { transform: translateX(0); }
  .burger { display: block; }
  .scrim.show { display: block; }
  .topbar { padding: 12px 16px; }
  .userchip span { display: none; }
  .ad-main { padding: 20px 16px 60px; }
  .stats { grid-template-columns: 1fr 1fr; }
}

@media print {
  .ad-nav, .topbar, .toolbar, .no-print, .btn { display: none !important; }
  .ad-shell { display: block; }
  body { background: #fff; }
  .tablewrap, .panel { border: 0; box-shadow: none; }
  .print-only { display: block; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
.userchip button { white-space: nowrap; }

/* Talk library */
.libgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; margin-bottom: 1rem; }
.libcard { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; justify-content: space-between; gap: .8rem; }
.libcard .k { font-family: var(--mono); font-size: 10.5px; font-weight: 700; letter-spacing: .05em; color: var(--oak); }
.libcard b { display: block; font-size: .98rem; margin: 2px 0 6px; }
.libcard p { margin: 0 0 .4rem; }
.libact { display: flex; gap: .4rem; justify-content: flex-end; }

/* Standard toolbox talk layout: full page, numbered sections, sign-off last. */
.tbt-hero { background: #000; color: #fff; border-radius: var(--radius); padding: 26px 28px; margin-bottom: 1.1rem; }
.tbt-ref { font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--oak); margin: 0 0 .5rem; }
.tbt-hero h1 { font-size: 1.75rem; line-height: 1.15; margin: 0 0 .5rem; letter-spacing: -.02em; }
.tbt-sub { margin: 0; color: #cfcfcf; font-size: .95rem; }
.tbt-sec { position: relative; background: #fff; border: 1px solid var(--line); border-left: 5px solid var(--oak); border-radius: var(--radius); padding: 20px 24px 20px 70px; margin-bottom: 1rem; box-shadow: var(--shadow); font-size: 1rem; }
.tbt-num { position: absolute; left: 20px; top: 18px; width: 34px; height: 34px; border-radius: 50%; background: var(--oak); color: #fff; font-weight: 800; display: flex; align-items: center; justify-content: center; font-size: .95rem; }
.tbt-sec h2 { font-size: 1.15rem; margin: 4px 0 .6rem; }
.tbt-sec .body { white-space: pre-wrap; line-height: 1.55; }
.tbt-sign { border-left-color: #000; }
.tbt-sign .sig-wrap canvas { height: 180px; }
.tbt-foot { text-align: center; font-size: .78rem; color: var(--faint); margin: 1.5rem 0 0; }
@media (max-width: 600px) { .tbt-sec { padding: 18px 16px 18px 58px; } .tbt-num { left: 12px; width: 30px; height: 30px; } .tbt-hero { padding: 20px 18px; } .tbt-hero h1 { font-size: 1.4rem; } }
.tbt-ref { color: #9fdbe4; }
.risk-edit td { padding: .3rem; vertical-align: top; }
.risk-edit textarea, .risk-edit input { width: 100%; min-width: 60px; font-size: .8rem; padding: .35rem .45rem; }
.risk-edit td:nth-child(5) { min-width: 320px; } .risk-edit td:nth-child(1), .risk-edit td:nth-child(2), .risk-edit td:nth-child(8) { min-width: 150px; }
.risk-edit td:nth-child(3), .risk-edit td:nth-child(4), .risk-edit td:nth-child(7) { width: 58px; }
.pol-doc h2 { font-size: 1.15rem; margin-bottom: .6rem; } .pol-doc h3 { font-size: .98rem; margin: .9rem 0 .3rem; } .pol-doc p, .pol-doc li { font-size: .93rem; line-height: 1.55; } .pol-doc ul { padding-left: 1.3rem; margin: .3rem 0 .6rem; }
.sig-wrap { background: #fff; border: 1.5px dashed #c8c0b3; border-radius: 12px; padding: .4rem; margin-bottom: .4rem; } .sig-wrap canvas { width: 100%; height: 150px; display: block; touch-action: none; border-radius: 8px; }

/* ---------- daily site diaries ---------- */
.diary-day { display: flex; justify-content: space-between; align-items: center; gap: 1rem; background: #fff; border: 1px solid var(--line); border-left: 5px solid var(--oak); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 1rem; box-shadow: var(--shadow); }
.diary-day .k { display: block; font-family: var(--mono); font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--faint); }
.diary-day b { font-size: 1.05rem; }
.diary-day input[type=date] { width: auto; max-width: 11rem; }
.lab-list { display: grid; gap: .4rem; }
.lab-row { display: grid; grid-template-columns: 1fr 5.2rem; gap: .5rem; align-items: center; }
.lab-row .check { margin: 0; }
.lab-row.extra { grid-template-columns: 1.4fr 1fr 4.2rem; }
.lab-list details { margin: .3rem 0; } .lab-list details > .lab-row { margin-top: .4rem; }
.mic-row { display: flex; justify-content: flex-end; margin-top: .3rem; }
.btn.rec { background: var(--brick-bg); color: var(--brick); border-color: var(--brick); animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 5px rgba(192,57,43,.18); } }
.ph-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .7rem; }
figure.ph { margin: 0; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: .4rem; display: flex; flex-direction: column; gap: .3rem; }
figure.ph img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; display: block; }
figure.ph figcaption { font-size: .78rem; color: var(--ink-2); min-height: 1em; }
figure.ph input { font-size: .8rem; padding: .35rem .5rem; }
.covgrid { display: grid; gap: 6px; overflow-x: auto; }
.cov-head, .cov-row { display: grid; grid-template-columns: minmax(150px, 1fr) repeat(14, 22px); gap: 4px; align-items: center; }
.cov-head span { font-family: var(--mono); font-size: 9px; font-weight: 700; color: var(--faint); text-align: center; } .cov-head span.we { color: #c8c0b3; }
.cov-row a:first-child { font-size: .85rem; text-decoration: none; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-right: .5rem; }
.cov { display: block; width: 22px; height: 22px; border-radius: 5px; background: var(--brick-bg); border: 1px solid #f0cfc9; }
.cov.has { background: var(--leaf); border-color: var(--leaf); } .cov.off { background: #f1eee7; border-color: #e7e2d9; } .cov.today { background: #fff; border: 1.5px dashed var(--oak); }
.dy-meta { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 1rem; }
.dy-meta > div { background: #fff; border: 1px solid var(--line); border-radius: 11px; padding: 10px 14px; }
.dy-meta .k { display: block; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); font-weight: 700; }
.dy-sec { background: #fff; border: 1px solid var(--line); border-left: 5px solid var(--line); border-radius: var(--radius); padding: 14px 18px; margin-bottom: .8rem; box-shadow: var(--shadow); }
.dy-sec h3 { font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); margin-bottom: .4rem; }
.dy-sec .body { white-space: pre-wrap; line-height: 1.55; }
.dy-sec.warn { border-left-color: var(--amber); } .dy-sec.bad { border-left-color: var(--brick); }
.dy-sec table { font-size: 13px; } .dy-sec th { padding-top: 4px; }
.btn.danger-text { color: var(--brick); }
.diary-panel { border-left: 5px solid var(--oak); }
@media (max-width: 700px) { .dy-meta { grid-template-columns: 1fr 1fr; } .lab-row.extra { grid-template-columns: 1fr 1fr 4rem; } .diary-day { flex-direction: column; align-items: stretch; } .diary-day input[type=date] { max-width: none; } }

/* ---------- job costing ---------- */
.r { text-align: right; } td.neg, .neg { color: var(--brick); }
.money-strip { display: grid; grid-template-columns: repeat(5, 1fr) auto; gap: 10px; background: #fff; border: 1px solid var(--line); border-left: 5px solid var(--line); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 1rem; box-shadow: var(--shadow); align-items: start; }
.money-strip.green { border-left-color: var(--leaf); } .money-strip.amber { border-left-color: var(--amber); } .money-strip.red { border-left-color: var(--brick); }
.money-strip .k { display: block; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); font-weight: 700; }
.money-strip b { font-size: 1.25rem; display: block; line-height: 1.2; } .money-strip .s { display: block; font-size: .76rem; color: var(--ink-2); min-height: 1em; }
.money-strip .act { display: flex; flex-direction: column; gap: .4rem; align-items: flex-end; justify-content: center; align-self: center; }
.bar { height: 6px; background: #ece8df; border-radius: 4px; overflow: hidden; margin-top: 6px; } .bar i { display: block; height: 100%; background: var(--leaf); border-radius: 4px; }
.bar.warn i { background: var(--amber); } .bar.bad i { background: var(--brick); } .bar.flat { margin-top: 0; height: 10px; } .bar.flat i { background: var(--oak); }
.two-col { display: grid; grid-template-columns: 1fr 1.3fr; gap: 1rem; } .two-col .panel { margin-bottom: 1rem; }
tr.total td { border-top: 2px solid var(--line); font-weight: 600; }
.stat.bad .n { color: var(--brick); }
table.hours th.we { color: #c8c0b3; }
.dlg-sub { font-weight: 700; margin: .8rem 0 .4rem; padding-top: .6rem; border-top: 1px solid var(--line); } .dlg-sub .hint { font-weight: 400; }
.row.three { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 900px) { .money-strip { grid-template-columns: 1fr 1fr; } .money-strip .act { grid-column: span 2; flex-direction: row; } .two-col { grid-template-columns: 1fr; } .row.three { grid-template-columns: 1fr; } }
table.costs td { white-space: nowrap; } table.costs td.jobcell { white-space: normal; min-width: 220px; } table.costs td.jobcell .small { white-space: normal; }
table.ledger td:first-child, table.weeks td:first-child, table.ledger td:nth-child(2) { white-space: nowrap; }
