/* SAFE Admin. Palette and faces follow the public SAFE site (navy, gold, red; Bebas Neue + Libre Franklin).
   Layout concept: a docket. Every task leads with a big date block; signatures carry a ruled signature line. */
:root {
  --bg: #f7f6f2;
  --paper: #ffffff;
  --ink: #182238;
  --ink-2: #45526b;
  --muted: #6b7489;
  --line: #e4e1d8;
  --navy: #16264d;
  --red: #b02e23;
  --gold: #a87a08;
  --gold-soft: #f6ecd2;
  --c4: #b02e23;  --c4-soft: #f8e3df;
  --c3: #1f4c8a;  --c3-soft: #e1eaf6;
  --ok: #1d6b45;
  --focus: #c8930f;
  --display: "Bebas Neue", Impact, "Arial Narrow", sans-serif;
  --sans: "Libre Franklin", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --r: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1526; --paper: #161e33; --ink: #e9ecf3; --ink-2: #bcc4d6; --muted: #8e98ae; --line: #2a3450;
    --navy: #c9d5f2; --red: #ff8a7d; --gold: #e3b54a; --gold-soft: #3a3016;
    --c4: #ff8a7d; --c4-soft: #3b2024; --c3: #8db4ec; --c3-soft: #1d2b46; --ok: #6fd3a0;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 15px/1.55 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: var(--navy); text-underline-offset: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
code { font-size: .92em; background: var(--gold-soft); padding: 1px 5px; border-radius: 4px; }
[hidden] { display: none !important; }

/* top bar */
.bar { position: sticky; top: 0; z-index: 10; background: var(--paper); border-bottom: 1px solid var(--line); }
.bar-in { max-width: 1180px; margin: 0 auto; padding: 10px max(16px, env(safe-area-inset-left)); display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.brand { display: flex; align-items: baseline; gap: 6px; text-decoration: none; color: var(--ink); }
.brand-mark { font-family: var(--display); font-size: 30px; letter-spacing: .02em; color: var(--red); line-height: 1; }
.brand-word { font-weight: 600; font-size: 15px; color: var(--ink-2); }
.nav { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
.nav a { white-space: nowrap; padding: 7px 12px; border-radius: 999px; text-decoration: none; color: var(--ink-2); font-weight: 500; }
.nav a:hover { background: var(--bg); }
.nav a[aria-current="page"] { background: var(--ink); color: var(--paper); }
.who { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--ink-2); }
.who-name { font-weight: 600; color: var(--ink); }
.demo-tag { background: var(--gold-soft); color: var(--gold); font-weight: 700; font-size: 12px; padding: 3px 8px; border-radius: 999px; }
.scope { border-top: 1px solid var(--line); }
.scope-in { max-width: 1180px; margin: 0 auto; padding: 8px max(16px, env(safe-area-inset-left)); display: flex; gap: 8px; flex-wrap: wrap; }
.chip { font: 600 13px var(--sans); border: 1px solid var(--line); background: var(--paper); color: var(--ink-2); border-radius: 999px; padding: 5px 12px; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.chip-c4[aria-pressed="true"] { background: var(--c4); border-color: var(--c4); color: #fff; }
.chip-c3[aria-pressed="true"] { background: var(--c3); border-color: var(--c3); color: #fff; }

/* page frame */
.main { max-width: 1180px; margin: 0 auto; padding: 28px max(16px, env(safe-area-inset-left)) 80px; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 40px; align-items: start; }
@media (max-width: 900px) { .layout { grid-template-columns: minmax(0, 1fr); } }
.page { min-width: 0; }
.h1 { font-family: var(--display); font-weight: 400; font-size: clamp(34px, 5vw, 48px); line-height: 1; letter-spacing: .01em; margin: 0 0 8px; text-wrap: balance; }
.h2 { font-size: 16px; font-weight: 700; margin: 0 0 10px; display: flex; align-items: center; gap: 8px; }
.h3 { font-size: 14px; font-weight: 700; margin: 0 0 10px; }
.lede { color: var(--ink-2); font-size: 17px; margin: 0 0 24px; max-width: 68ch; }
.hint { color: var(--muted); font-size: 13px; margin: 0 0 10px; }
.err { color: var(--red); font-weight: 600; }
.empty { color: var(--ink-2); padding: 24px; border: 1px dashed var(--line); border-radius: var(--r); background: var(--paper); }
.count { font: 600 12px var(--sans); color: var(--muted); background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; }
.group { margin: 0 0 32px; }
details.group > summary { cursor: pointer; list-style: none; }
details.group > summary::-webkit-details-marker { display: none; }
.callout { background: var(--gold-soft); border-radius: var(--r); padding: 14px 16px; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }

/* buttons */
.btn, .entry .do button, .entry .do a { font: 600 13px var(--sans); border-radius: 8px; padding: 7px 12px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; min-height: 34px; }
.btn { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn-quiet { background: var(--paper); color: var(--ink); border-color: var(--line); }
.entry .do .btn-done { border-color: var(--ok); color: var(--ok); }
.entry .do .btn-done:hover { background: var(--ok); color: var(--paper); }
.entry .do .btn-sign { background: var(--gold); border-color: var(--gold); color: #fff; }
.entry .do .btn-open { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.entry .do button:hover { border-color: var(--ink-2); }
.link { background: none; border: 0; padding: 0; color: var(--navy); font: inherit; text-decoration: underline; cursor: pointer; }
button:disabled { opacity: .6; cursor: default; }

/* the docket */
.docket { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.entry { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 18px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.entry.is-busy { opacity: .55; pointer-events: none; }
.entry.is-done .act { text-decoration: line-through; color: var(--muted); }
.when { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding-top: 2px; color: var(--navy); }
.when .mo { font-family: var(--display); font-size: 17px; line-height: 1; letter-spacing: .06em; }
.when .dd { font-family: var(--display); font-size: 44px; line-height: .9; font-variant-numeric: tabular-nums; }
.when .wd { font-size: 11px; font-weight: 600; color: var(--muted); margin-top: 4px; text-align: center; }
.when.late { color: var(--red); }
.when.late .wd { color: var(--red); }
.when.nodate { color: var(--line); }
.what { min-width: 0; }
.meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.pill { font-weight: 700; font-size: 11px; padding: 2px 8px; border-radius: 999px; }
.pill-c4 { background: var(--c4-soft); color: var(--c4); }
.pill-c3 { background: var(--c3-soft); color: var(--c3); }
.kind { font-weight: 700; color: var(--ink-2); }
.owner { font-weight: 600; color: var(--ink); }
.waiting { font-weight: 700; color: var(--gold); }
.tid { margin-left: auto; font-variant-numeric: tabular-nums; }
.act { margin: 0 0 8px; font-size: 16px; font-weight: 500; line-height: 1.4; max-width: 70ch; }
.note { margin: -2px 0 8px; font-size: 13px; color: var(--ink-2); font-style: italic; }
.do { display: flex; gap: 8px; flex-wrap: wrap; }
.sigline { display: flex; align-items: flex-end; gap: 10px; margin: 2px 0 12px; max-width: 360px; }
.sigline span { font-size: 11px; color: var(--muted); }
.sigline::after { content: ""; flex: 1; border-bottom: 1.5px solid var(--gold); height: 18px; }
.is-sign .when { color: var(--gold); }
.is-sign.is-busy .when, .is-sign .when.late { color: var(--red); }
.drawer-form { margin-top: 12px; padding: 14px; background: var(--bg); border-radius: var(--r); display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.drawer-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.drawer-form label.grow, .drawer-form label:has(input[type=text]) { flex: 1 1 260px; }
.drawer-form input, .drawer-form select { font: 15px var(--sans); padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); color: var(--ink); min-height: 38px; }
.drawer-form .hint { flex-basis: 100%; margin: 0; }
.drawer-btns { display: flex; gap: 14px; align-items: center; }
.addrow { margin: -8px 0 32px; }

/* side cards */
.side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; min-width: 0; }
.mini { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.mini li { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; font-size: 14px; }
.mini-when { grid-column: 1 / -1; font-size: 12px; font-weight: 700; color: var(--navy); }
.mini-alert .mini-when { color: var(--red); }
.mini-what { min-width: 0; }
.mini-ent { color: var(--muted); font-size: 12px; }
.mini-note { grid-column: 1 / -1; font-size: 12px; color: var(--muted); }
.mini-head { font-size: 12px; font-weight: 700; color: var(--muted); margin: 10px 0 4px; }
.links, .files { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.files li { display: flex; flex-direction: column; }
.file-meta { font-size: 12px; color: var(--muted); }

/* organization */
.wide { max-width: 1100px; }
.org { margin: 0 0 56px; }
.org-head { border-left: 6px solid var(--ink); padding-left: 16px; margin-bottom: 24px; }
.org-c4 .org-head { border-color: var(--c4); }
.org-c3 .org-head { border-color: var(--c3); }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--r); background: var(--paper); margin-bottom: 28px; }
.stat { padding: 14px 16px; border-right: 1px solid var(--line); display: flex; flex-direction: column; }
.stat:last-child { border-right: 0; }
.stat-n { font-family: var(--display); font-size: 40px; line-height: 1; font-variant-numeric: tabular-nums; }
.stat-l { font-size: 13px; color: var(--muted); }
.stat-bad .stat-n { color: var(--red); }
@media (max-width: 600px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .stat:nth-child(2) { border-right: 0; } .stat:nth-child(-n+2) { border-bottom: 1px solid var(--line); } }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 28px; margin-bottom: 28px; }
.bars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.bars li { display: grid; grid-template-columns: 150px minmax(0, 1fr) 44px; gap: 10px; align-items: center; font-size: 14px; }
.bar-track { height: 10px; background: var(--bg); border-radius: 999px; overflow: hidden; border: 1px solid var(--line); }
.bar-fill { display: block; height: 100%; background: var(--navy); }
.org-c4 .bar-fill { background: var(--c4); }
.org-c3 .bar-fill { background: var(--c3); }
.bar-n { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.bar-what { grid-column: 1 / -1; font-size: 13px; color: var(--muted); margin: -4px 0 4px; }
.goals { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.goals li { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.goal-name { font-weight: 700; }
.goal-owner { font-size: 13px; color: var(--muted); }
.goal-target { grid-column: 1 / -1; font-size: 14px; color: var(--ink-2); }

/* calendar */
.agday { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 18px; padding: 14px 0; border-top: 1px solid var(--line); }
.agdate { margin: 0; display: flex; flex-direction: column; align-items: center; font-size: 12px; font-weight: 600; color: var(--muted); text-align: center; }
.agdate .dd { font-family: var(--display); font-size: 36px; line-height: 1; color: var(--navy); font-weight: 400; }
.agday ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ag { display: grid; grid-template-columns: 76px minmax(0, 1fr) auto; gap: 12px; align-items: baseline; font-size: 15px; }
.ag-time { font-size: 12px; font-weight: 700; color: var(--muted); }
.ag-meet .ag-time { color: var(--navy); }
.ag-late .ag-time { color: var(--red); }
.ag-file .ag-time { color: var(--gold); }
.ag-owner { font-size: 12px; color: var(--muted); }

/* guide */
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--paper); }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 640px; }
.tbl th { text-align: left; font-size: 12px; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl td:first-child { font-weight: 700; width: 22%; }
.tbl td:nth-child(3) { width: 18%; white-space: nowrap; }
.tnote { display: block; white-space: normal; font-size: 12px; color: var(--muted); }
.row-alert td:nth-child(3) { color: var(--red); font-weight: 600; }
.row-alert .tnote { color: var(--red); }
.kv { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 10px 20px; margin: 0; font-size: 15px; }
.kv dt { font-weight: 700; color: var(--ink-2); }
.kv dd { margin: 0; }
@media (max-width: 600px) { .kv { grid-template-columns: minmax(0, 1fr); } .kv dd { margin-bottom: 8px; } .bars li { grid-template-columns: 110px minmax(0, 1fr) 40px; } }

/* sign-in */
.gate { max-width: 560px; margin: 12vh auto 0; }
.gate-title { font-family: var(--display); font-weight: 400; font-size: 64px; line-height: .95; margin: 0 0 14px; color: var(--ink); }
.gate-lede { font-size: 18px; color: var(--ink-2); margin: 0 0 24px; }
.gate-small { font-size: 14px; color: var(--muted); }
.btn-google { font-size: 16px; padding: 12px 20px; min-height: 48px; }

/* toast */
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(20px + env(safe-area-inset-bottom)); background: var(--ink); color: var(--paper); padding: 12px 16px; border-radius: 10px; display: flex; gap: 16px; align-items: center; font-weight: 600; font-size: 14px; max-width: calc(100vw - 32px); box-shadow: 0 8px 24px rgba(0,0,0,.18); }
.toast button { background: none; border: 1px solid currentColor; color: inherit; border-radius: 6px; padding: 4px 10px; font: inherit; cursor: pointer; }
@media (prefers-reduced-motion: no-preference) { .toast { animation: rise .18s ease-out; } @keyframes rise { from { transform: translate(-50%, 8px); opacity: 0; } } }
@media (max-width: 600px) {
  .entry, .agday { grid-template-columns: 56px minmax(0, 1fr); gap: 12px; }
  .when .dd { font-size: 34px; }
  .ag { grid-template-columns: minmax(0, 1fr) auto; }
  .ag-time { grid-column: 1 / -1; }
  .nav { order: 3; flex-basis: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .nav a { flex: 0 0 auto; }
}

/* connect your AI */
.connect { max-width: 760px; }
.steps { margin: 0 0 16px; padding-left: 22px; }
.steps > li { margin: 0 0 22px; padding-left: 4px; }
.steps > li::marker { font-family: var(--display); font-size: 22px; color: var(--red); }
.steps p { margin: 0 0 10px; max-width: 68ch; }
.copybox { display: flex; gap: 10px; align-items: flex-start; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 10px; margin: 0 0 10px; }
.copybox pre { flex: 1; min-width: 0; margin: 0; font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 260px; overflow: auto; }
.copybox .btn { flex: none; }
.try q { display: inline-block; background: var(--paper); border: 1px solid var(--line); border-radius: 999px; padding: 3px 12px; margin: 4px 6px 0 0; font-size: 14px; quotes: none; }
.back { margin: 0 0 16px; }
@media (max-width: 560px) { .copybox { flex-direction: column; } }
