/* Trestle Tools. Brand: Trestle blue #36588c and grey #818381, taken from the logo. */
@font-face { font-family: "Public Sans"; font-weight: 400; font-display: swap; src: url(assets/fonts/public-sans-400.woff2) format("woff2"); }
@font-face { font-family: "Public Sans"; font-weight: 600; font-display: swap; src: url(assets/fonts/public-sans-600.woff2) format("woff2"); }
@font-face { font-family: "Public Sans"; font-weight: 700; font-display: swap; src: url(assets/fonts/public-sans-700.woff2) format("woff2"); }
@font-face { font-family: "Source Serif 4"; font-weight: 700; font-display: swap; src: url(assets/fonts/source-serif-4-700.woff2) format("woff2"); }

:root {
  --brand: #36588c; --brand-ink: #263f66; --brand-600: #2f4e7d; --brand-50: #eef2f8; --brand-100: #dce4f0; --brand-200: #bccbe1;
  --grey: #818381; --grey-50: #f3f4f3;
  --bg: #f4f6f9; --surface: #ffffff; --surface-2: #f8f9fb; --ink: #1c2430; --muted: #566070; --faint: #7d8694;
  --line: #dfe4eb; --line-2: #ccd3dd;
  --red: #b42318; --red-50: #fdecea; --green: #23704a; --green-50: #e7f4ec; --amber: #9a5b00; --amber-50: #fdf1de;
  --purple: #5f4598; --purple-50: #f0ebfa; --blue-50: #e8eef8;
  --shadow: 0 1px 2px rgba(20, 30, 50, .06), 0 4px 14px rgba(20, 30, 50, .06);
  --shadow-lg: 0 10px 40px rgba(20, 30, 50, .18);
  --radius: 12px; --radius-sm: 8px; --on-brand: #ffffff;
  --sans: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Source Serif 4", Georgia, serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand: #7c9fd6; --brand-ink: #a9c1e8; --brand-600: #93b1e0; --brand-50: #1d2a40; --brand-100: #24344f; --brand-200: #34496d;
    --grey-50: #222830;
    --bg: #12161c; --surface: #1a1f27; --surface-2: #20262f; --ink: #e8ecf2; --muted: #aab3c0; --faint: #8b95a3;
    --line: #2d3540; --line-2: #3a4350;
    --red: #f07a70; --red-50: #3a1d1b; --green: #6fcf97; --green-50: #16301f; --amber: #f0b45c; --amber-50: #3a2a12;
    --purple: #b8a2ec; --purple-50: #2a2240; --blue-50: #1d2a40;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 4px 14px rgba(0,0,0,.3); --on-brand: #0f1726; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --brand: #7c9fd6; --brand-ink: #a9c1e8; --brand-600: #93b1e0; --brand-50: #1d2a40; --brand-100: #24344f; --brand-200: #34496d;
  --grey-50: #222830;
  --bg: #12161c; --surface: #1a1f27; --surface-2: #20262f; --ink: #e8ecf2; --muted: #aab3c0; --faint: #8b95a3;
  --line: #2d3540; --line-2: #3a4350;
  --red: #f07a70; --red-50: #3a1d1b; --green: #6fcf97; --green-50: #16301f; --amber: #f0b45c; --amber-50: #3a2a12;
  --purple: #b8a2ec; --purple-50: #2a2240; --blue-50: #1d2a40;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 4px 14px rgba(0,0,0,.3); --on-brand: #0f1726; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: var(--brand); }
h1, h2, h3 { margin: 0; line-height: 1.2; }
.serif { font-family: var(--serif); font-weight: 700; }
.muted { color: var(--muted); }
.small { font-size: .85em; }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:focus-visible { outline: 3px solid var(--brand-200); outline-offset: 2px; }

/* ---- Buttons and fields ---- */
.btn { appearance: none; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font: 600 .95em/1 var(--sans);
  padding: 12px 18px; border-radius: 10px; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; min-height: 46px;
  text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s, box-shadow .15s; }
.btn:hover { border-color: var(--brand-200); background: var(--surface-2); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.btn.primary:hover { background: var(--brand-600); border-color: var(--brand-600); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--brand); }
.btn.ghost:hover { background: var(--brand-50); }
.btn.danger { color: var(--red); border-color: var(--red-50); }
.btn.danger.armed { background: var(--red); color: #fff; border-color: var(--red); }
.btn.small { min-height: 36px; padding: 8px 12px; font-size: .85em; }
.btn.big { min-height: 56px; padding: 16px 24px; font-size: 1.05em; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn svg { width: 1.15em; height: 1.15em; flex: none; }

label.field { display: block; margin: 0 0 14px; }
label.field > span { display: block; font-weight: 600; font-size: .9em; margin-bottom: 6px; }
label.field > small { display: block; color: var(--muted); font-size: .8em; margin-top: 4px; }
input[type=text], input[type=email], input[type=date], input[type=search], select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line-2); border-radius: 10px;
  padding: 11px 13px; min-height: 48px; }
textarea { min-height: 110px; resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-100); }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.row > * { flex: 1 1 180px; }
.quick { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }

/* ---- Cards, pills, chips ---- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card.pad { padding: 20px; }
.pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 4px 11px; font-size: .78em; font-weight: 700; white-space: nowrap; }
.pill.open { background: var(--blue-50); color: var(--brand); }
.pill.progress { background: var(--amber-50); color: var(--amber); }
.pill.waiting { background: var(--purple-50); color: var(--purple); }
.pill.done { background: var(--green-50); color: var(--green); }
.pill.overdue { background: var(--red-50); color: var(--red); }
.pill.soon { background: var(--grey-50); color: var(--muted); border: 1px dashed var(--line-2); }
.tag { font-size: .7em; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; padding: 2px 7px; border-radius: 5px; }
.tag.high { background: var(--red-50); color: var(--red); }
.tag.sample { background: var(--grey-50); color: var(--muted); border: 1px solid var(--line); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 9px 16px;
  font: 600 .9em var(--sans); cursor: pointer; min-height: 42px; }
.chip b { margin-left: 6px; color: var(--muted); }
.chip[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.chip[aria-pressed="true"] b { color: rgba(255,255,255,.85); }
.chip.red[aria-pressed="false"] b { color: var(--red); }

.notice { border-radius: var(--radius-sm); padding: 14px 16px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.notice.info { background: var(--brand-50); border: 1px solid var(--brand-100); }
.notice.warn { background: var(--amber-50); border: 1px solid transparent; color: var(--ink); }
.notice.bad { background: var(--red-50); color: var(--red); font-weight: 600; }
.notice.good { background: var(--green-50); color: var(--green); font-weight: 600; }
.notice .grow { flex: 1 1 260px; }

/* ---- Tool header and tabs ---- */
.toolhead { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.toolhead h1 { font-family: var(--serif); font-size: clamp(1.6rem, 3.4vw, 2.1rem); color: var(--brand-ink); }
.toolhead p { margin: 2px 0 0; color: var(--muted); }
.toolhead .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--line); margin: 16px 0 18px; overflow-x: auto; }
.tabs a { padding: 12px 18px; font-weight: 700; text-decoration: none; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -2px; white-space: nowrap; }
.tabs a[aria-current="page"] { color: var(--brand); border-color: var(--brand); }

/* ---- Item list ---- */
.filters { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 10px; margin: 14px 0; }
@media (max-width: 760px) { .filters { grid-template-columns: 1fr; } }
.list { display: flex; flex-direction: column; gap: 8px; }
.irow { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.irow:hover { border-color: var(--brand-200); }
.irow.late { border-left: 4px solid var(--red); }
.irow.isdone { opacity: .82; }
.check { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--line-2); background: var(--surface); cursor: pointer; display: grid; place-items: center; color: transparent; }
.check:hover { border-color: var(--green); color: var(--green); }
.check.on { background: var(--green); border-color: var(--green); color: #fff; }
.check svg { width: 18px; height: 18px; }
.ititle { font-weight: 700; font-size: 1.02em; background: none; border: 0; padding: 0; color: var(--ink); text-align: left; cursor: pointer; font-family: inherit; }
.ititle:hover { color: var(--brand); text-decoration: underline; }
.imeta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: .85em; color: var(--muted); margin-top: 3px; }
.irow > div:nth-child(2) { min-width: 0; }
.inote { font-size: .85em; color: var(--muted); margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.iright { display: grid; grid-template-columns: 130px 110px 115px 100px; gap: 4px 14px; align-items: center; text-align: left; font-size: .85em; }
.iright > :last-child { justify-self: end; }
.iright .k { color: var(--faint); font-size: .8em; font-weight: 600; }
.iright .late { color: var(--red); font-weight: 700; }
@media (max-width: 900px) {
  .irow { grid-template-columns: auto 1fr; }
  .iright { grid-column: 1 / -1; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; text-align: left; border-top: 1px solid var(--line); padding-top: 10px; }
}
.empty { text-align: center; padding: 48px 16px; color: var(--muted); }
.empty svg { width: 46px; height: 46px; color: var(--brand-200); }

/* ---- Slide-in panels ---- */
.scrim { position: fixed; inset: 0; background: rgba(15, 22, 35, .42); z-index: 40; animation: fade .15s; }
.panel { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100vw); background: var(--surface); z-index: 41; box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; animation: slide .2s ease-out; }
.panel.wide { width: min(980px, 100vw); }
.panel header { padding: 18px 22px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; }
.panel header h2 { font-family: var(--serif); font-size: 1.4em; color: var(--brand-ink); }
.panel header .x { margin-left: auto; }
.panel .body { padding: 20px 22px; overflow-y: auto; flex: 1; }
.panel footer { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; gap: 10px; flex-wrap: wrap; background: var(--surface-2); }
.panel footer .right { margin-left: auto; }
.err { background: var(--red-50); color: var(--red); border-radius: var(--radius-sm); padding: 12px 14px; font-weight: 600; margin-bottom: 14px; }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
.history { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 16px; }
.history h3 { font-size: 1em; margin-bottom: 10px; }
.hnote { padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); margin-bottom: 8px; }
.hnote.closing { background: var(--green-50); }
.hnote .when { font-size: .8em; color: var(--muted); font-weight: 600; }
.hnote p { margin: 4px 0 0; white-space: pre-wrap; }

/* ---- Drop zone and jobs ---- */
.drop { border: 2px dashed var(--brand-200); border-radius: var(--radius); padding: 26px 18px; text-align: center; background: var(--brand-50); cursor: pointer; transition: background .15s; }
.drop:hover, .drop.over { background: var(--brand-100); }
.drop svg { width: 34px; height: 34px; color: var(--brand); }
.drop b { display: block; margin-top: 6px; color: var(--brand-ink); }
.files { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.file { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 5px 8px 5px 12px; font-size: .85em; display: flex; gap: 6px; align-items: center; }
.file button { border: 0; background: none; cursor: pointer; color: var(--muted); font-size: 1.1em; }
.working { display: flex; gap: 12px; align-items: center; padding: 16px; border-radius: var(--radius); background: var(--brand-50); margin: 14px 0; font-weight: 600; color: var(--brand-ink); }
.spin { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--brand-100); border-top-color: var(--brand); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Bulk rows ---- */
.drows { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.drow { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; display: grid; grid-template-columns: auto 1fr; gap: 10px 12px; background: var(--surface); }
.drow.off { background: var(--surface-2); opacity: .8; }
.drow input[type=checkbox] { width: 22px; height: 22px; margin-top: 12px; accent-color: var(--brand); }
.drow .g { display: grid; grid-template-columns: 1fr 170px 130px; gap: 8px; }
@media (max-width: 700px) { .drow .g { grid-template-columns: 1fr; } }
.drow .flag { font-size: .82em; color: var(--amber); font-weight: 600; margin-top: 6px; }
.drow .ev { font-size: .82em; color: var(--muted); font-style: italic; margin-top: 4px; }

/* ---- Report paper ---- */
.paper { background: #fff; color: #1c2430; border-radius: 6px; box-shadow: var(--shadow-lg); padding: 36px 40px; max-width: 860px; margin: 18px auto; font-size: 14px; }
.paper .phead { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; }
.paper .phead h2 { font-family: var(--serif); font-size: 28px; }
.paper .phead .sub { color: #36588c; font-weight: 600; margin-top: 4px; }
.paper .phead .meta { color: #4a5363; font-size: 12.5px; margin-top: 6px; }
.paper .phead img { width: 190px; height: auto; }
.banner { background: #36588c; border-radius: 12px; display: grid; grid-template-columns: repeat(4, 1fr); padding: 16px; margin: 22px 0 6px; color: #fff; }
@media (max-width: 640px) { .banner { grid-template-columns: repeat(2, 1fr); gap: 12px; } .paper { padding: 20px 14px; overflow-x: auto; } .paper .phead { flex-direction: column-reverse; } .paper .phead img { width: 150px; } .paper td, .paper th { font-size: 11.5px; padding: 6px 5px; } }
.banner div { display: flex; align-items: center; gap: 12px; }
.banner .b { width: 46px; height: 46px; border-radius: 50%; background: #dce1ea; color: #36588c; display: grid; place-items: center; flex: none; }
.banner .b.red { color: #c0261c; }
.banner .b svg { width: 22px; height: 22px; }
.banner strong { font-family: var(--serif); font-size: 28px; display: block; line-height: 1; }
.banner small { font-size: 10px; font-weight: 700; letter-spacing: .05em; }
.paper h3 { color: #36588c; font-size: 13px; letter-spacing: .05em; margin: 22px 0 8px; }
.paper table { width: 100%; border-collapse: collapse; }
.paper th { background: #36588c; color: #fff; text-align: left; font-size: 12px; padding: 7px 8px; }
.paper td { padding: 7px 8px; vertical-align: top; font-size: 13px; }
.paper tbody.z { background: #f2f4f8; }
.paper tbody { border-bottom: 1px solid #e2e6ec; }
.paper td.t { font-weight: 700; }
.paper td.n { color: #3f4856; font-size: 12.5px; padding-top: 0; }
.paper td.n .d { color: #6b7380; margin-right: 8px; }
.paper .od { color: #b42318; font-weight: 700; }
.paper .pfoot { border-top: 1px solid #d9dee6; margin-top: 26px; padding-top: 8px; display: flex; justify-content: space-between; color: #818381; font-size: 11.5px; }
.paper .none { font-style: italic; color: #818381; }

/* ---- Tables (team, people, bids) ---- */
.tablewrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
table.grid { width: 100%; border-collapse: collapse; font-size: .9em; }
table.grid th { text-align: left; padding: 12px 14px; background: var(--surface-2); color: var(--muted); font-size: .8em; text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.grid td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.grid tr.group td { background: var(--brand-50); color: var(--brand-ink); font-weight: 700; }
table.grid td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.grid .bad { color: var(--red); font-weight: 700; }
table.grid tr:last-child td { border-bottom: 0; }
.summary { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin: 14px 0; }
@media (max-width: 820px) { .summary { grid-template-columns: repeat(3, 1fr); } }
.summary div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; }
.summary strong { font-family: var(--serif); font-size: 1.6em; display: block; color: var(--brand-ink); }
.summary span { font-size: .8em; color: var(--muted); font-weight: 600; }
.summary .bad strong { color: var(--red); }
table.cmp th:first-child, table.cmp td:first-child { width: 190px; font-weight: 700; color: var(--ink); }
table.cmp th { background: var(--brand); color: #fff; text-transform: none; font-size: .95em; letter-spacing: 0; }
table.cmp td.low { background: var(--green-50); }
table.cmp td.low::after { content: "Lowest"; display: block; font-size: .72em; font-weight: 800; color: var(--green); margin-top: 4px; text-transform: uppercase; letter-spacing: .05em; }

/* ---- Arch checks ---- */
.verdict { border-radius: var(--radius); padding: 18px 20px; display: flex; gap: 14px; align-items: center; margin: 16px 0; }
.verdict.ok { background: var(--green-50); color: var(--green); }
.verdict.no { background: var(--amber-50); color: var(--amber); }
.verdict svg { width: 34px; height: 34px; flex: none; }
.verdict h3 { font-size: 1.25em; }
.checks { display: flex; flex-direction: column; gap: 8px; }
.ck { display: grid; grid-template-columns: 32px 1fr; gap: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.ck .m { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; }
.ck.found .m { background: var(--green-50); color: var(--green); }
.ck.missing .m { background: var(--red-50); color: var(--red); }
.ck.unclear .m { background: var(--amber-50); color: var(--amber); }
.ck .e { font-size: .85em; color: var(--muted); margin-top: 2px; }
.twocol { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 900px) { .twocol { grid-template-columns: 1fr; } }
.rulecard { padding: 16px 18px; }
.rulecard h3 { font-size: 1.05em; }
.rulecard ul { margin: 8px 0; padding-left: 20px; color: var(--muted); font-size: .9em; }
.rulecard .cn { font-size: .88em; background: var(--amber-50); border-radius: 8px; padding: 8px 10px; margin-top: 8px; }

/* ---- Sign in ---- */
.signin { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background:
  radial-gradient(1200px 500px at 10% -10%, var(--brand-100), transparent 60%), radial-gradient(900px 500px at 110% 110%, var(--grey-50), transparent 60%), var(--bg); }
.signin .card { width: min(460px, 100%); padding: 34px 30px; text-align: center; }
.signin .logo { width: 250px; max-width: 80%; margin: 0 auto 6px; display: block; }
.signin h1 { font-family: var(--serif); color: var(--brand-ink); font-size: 1.8em; margin: 14px 0 4px; }
.signin form { text-align: left; margin-top: 18px; }
.signin .or { display: flex; align-items: center; gap: 10px; color: var(--faint); font-size: .85em; margin: 20px 0 6px; }
.signin .or::before, .signin .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.signin .btn { width: 100%; justify-content: center; }
.codebox { font-size: 1.6em !important; letter-spacing: .4em; text-align: center; font-weight: 700; }
.ms { background: #fff !important; color: #1f1f1f !important; border-color: #8c8c8c !important; }
.ms svg { width: 20px; height: 20px; }

/* ---- The fish (top-left corner of every screen) and its markup screen ---- */
.fish { position: fixed; top: 7px; left: 14px; z-index: 35; width: 58px; height: 58px; border: 0; padding: 0; background: none; cursor: pointer;
  border-radius: 50%; transition: transform .15s; filter: drop-shadow(0 2px 4px rgba(20,30,50,.25)); }
.fish img { width: 58px; height: 58px; display: block; }
.fish:hover { transform: scale(1.08) rotate(-4deg); }
.fish.busy { animation: fishswim .7s ease-in-out infinite alternate; }
@keyframes fishswim { from { transform: translateX(-3px) rotate(-6deg); } to { transform: translateX(3px) rotate(6deg); } }
@media (max-width: 900px) { .fish { top: 7px; left: 10px; width: 46px; height: 46px; } .fish img { width: 46px; height: 46px; } }
.fish-tip { position: fixed; top: 74px; left: 14px; z-index: 36; width: min(330px, calc(100vw - 28px)); background: var(--surface); color: var(--ink);
  border: 2px solid var(--brand); border-radius: 14px; padding: 14px 16px; box-shadow: var(--shadow-lg); font-size: .92em; display: flex; flex-direction: column; gap: 10px; }
.fish-tip::before { content: ""; position: absolute; top: -10px; left: 22px; border: 9px solid transparent; border-top: 0; border-bottom-color: var(--brand); }
.fish-tip .btn { align-self: flex-start; }
.fishx { position: fixed; inset: 0; z-index: 70; background: rgba(15,22,35,.6); display: grid; place-items: center; padding: 16px; animation: fade .15s; }
.fx-panel { background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-lg); width: min(1100px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; padding: 18px 20px; }
.fx-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.fx-head h2 { font-family: var(--serif); color: var(--brand-ink); font-size: 1.4em; flex: 1; }
.fx-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.fx-tools .btn[aria-pressed="true"] { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }
.fx-colors { display: inline-flex; gap: 6px; margin: 0 6px; }
.fx-color { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--line-2); cursor: pointer; }
.fx-color[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--ink); }
.fx-stagewrap { text-align: center; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 8px; }
.fx-stage { position: relative; display: inline-block; max-width: 100%; vertical-align: top; line-height: 0; box-shadow: var(--shadow); }
.fx-shot { display: block; max-width: 100%; max-height: min(52vh, 620px); width: auto; height: auto; user-select: none; }
.fx-draw { position: absolute; inset: 0; width: 100%; height: 100%; cursor: crosshair; touch-action: none; }
.fx-noshot { padding: 30px; text-align: center; color: var(--muted); }
.fx-foot { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.rq { display: grid; grid-template-columns: 220px 1fr; gap: 16px; align-items: start; }
@media (max-width: 700px) { .rq { grid-template-columns: 1fr; } }
.rq-pic img { width: 100%; border-radius: 8px; border: 1px solid var(--line); display: block; }
.rq-pic.none { display: grid; place-items: center; height: 120px; background: var(--brand-50); border-radius: 8px; }
.rq-pic.none img { width: 56px; height: 56px; border: 0; opacity: .7; }
/* ---- Toast ---- */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: var(--surface); padding: 12px 20px; border-radius: 999px;
  font-weight: 600; z-index: 60; box-shadow: var(--shadow-lg); animation: fade .2s; max-width: calc(100vw - 32px); }
.adminnav { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.adminnav a { text-decoration: none; display: inline-flex; align-items: center; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: .9em; }

/* =====================================================================================================
   App shell: sidebar + top bar
   ===================================================================================================== */
.shell { display: grid; grid-template-columns: 264px 1fr; min-height: 100vh; background: linear-gradient(to right, var(--surface) 263px, var(--line) 263px, var(--line) 264px, var(--bg) 264px); }
@media (max-width: 900px) { .shell { background: var(--bg); } }
.shell.hidden { display: none; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 6px; padding: 12px 12px 14px;
  background: var(--surface); border-right: 1px solid var(--line); overflow-y: auto; z-index: 30; }
.side-head { height: 58px; display: flex; align-items: center; padding-left: 70px; margin-bottom: 6px; }
.side-logo img { display: block; width: 158px; height: auto; background: #fff; border-radius: 6px; padding: 2px 3px; }
.side-search { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface-2); color: var(--muted); font: 500 .92em var(--sans); cursor: pointer; margin: 4px 0 10px; }
.side-search:hover { border-color: var(--brand-200); color: var(--ink); }
.side-search span { flex: 1; text-align: left; }
.side-search svg { width: 17px; height: 17px; }
kbd { font: 600 .72em var(--sans); color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 1px 6px; }
.side-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-label { font-size: .7em; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); padding: 16px 12px 6px; }
.nav { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 9px; color: var(--ink); text-decoration: none; font-weight: 600; font-size: .95em; position: relative; }
.nav svg { width: 19px; height: 19px; color: var(--muted); flex: none; }
.nav span:first-of-type { flex: 1; }
.nav:hover { background: var(--surface-2); }
.nav[aria-current="page"] { background: var(--brand-50); color: var(--brand-ink); }
.nav[aria-current="page"] svg { color: var(--brand); }
.nav[aria-current="page"]::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand); }
.nav.soon { color: var(--faint); cursor: default; font-weight: 500; }
.nav.soon svg { color: var(--line-2); }
.nav-soon { font-size: .7em; font-weight: 700; color: var(--faint); border: 1px dashed var(--line-2); border-radius: 999px; padding: 1px 7px; }
.nav-badge { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--brand); color: var(--on-brand); font-size: .75em; font-weight: 700; display: inline-grid; place-items: center; }
.nav-badge.red { background: var(--red); color: #fff; }
.side-foot { display: flex; flex-direction: column; gap: 2px; border-top: 1px solid var(--line); padding-top: 10px; }
.side-user { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 8px; margin-top: 6px; border: 0; border-radius: 10px; background: none; cursor: pointer; color: var(--ink); text-align: left; font-family: inherit; }
.side-user:hover { background: var(--surface-2); }
.su-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.su-text b { font-size: .9em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.su-text small { font-size: .76em; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user > svg { width: 18px; height: 18px; color: var(--faint); }

.col { min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 20; height: 64px; display: flex; align-items: center; gap: 14px; padding: 0 28px;
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line); }
.crumbs { display: flex; align-items: center; gap: 8px; font-size: .9em; color: var(--muted); min-width: 0; white-space: nowrap; overflow: hidden; }
.crumbs a { color: var(--muted); text-decoration: none; font-weight: 500; }
.crumbs a:hover { color: var(--brand); }
.crumb-sep { color: var(--line-2); }
.crumb-here { color: var(--ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.top-right kbd { margin-left: 4px; }
main { width: 100%; max-width: 1240px; margin: 0 auto; padding: 28px 28px 110px; }
.menu-btn { display: none; width: 42px; height: 42px; border: 0; background: none; border-radius: 10px; cursor: pointer; flex-direction: column; justify-content: center; gap: 5px; padding: 0 10px; margin-left: 52px; }
.menu-btn span { display: block; height: 2px; background: var(--ink); border-radius: 2px; }
.side-scrim { display: none; }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 284px; transform: translateX(-104%); transition: transform .22s ease; box-shadow: var(--shadow-lg); }
  .shell.drawer .side { transform: none; }
  .shell.drawer .side-scrim { display: block; position: fixed; inset: 0; background: rgba(15,22,35,.4); z-index: 25; }
  .menu-btn { display: inline-flex; }
  .top { padding: 0 14px; }
  .kbd-hint span, .kbd-hint kbd, .top-right .btn.primary span { display: none; }
  main { padding: 20px 16px 100px; }
}

/* Menus */
.menu-pop { position: fixed; z-index: 80; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; animation: pop .14s ease-out; min-width: 220px; }
@keyframes pop { from { opacity: 0; transform: translateY(4px) scale(.98); } }
.mp-head { padding: 8px 10px; display: flex; flex-direction: column; } .mp-head small { color: var(--muted); }
.mp-sep { height: 1px; background: var(--line); margin: 6px 0; }
.mp-label { font-size: .72em; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); padding: 4px 10px; }
.mp-seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px 6px 6px; }
.mp-seg button { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 6px; font: 600 .82em var(--sans); color: var(--ink); cursor: pointer; }
.mp-seg button[aria-pressed="true"] { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }
.mp-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; background: none; border-radius: 8px; color: var(--ink); font: 500 .92em var(--sans); text-decoration: none; cursor: pointer; }
.mp-item:hover { background: var(--surface-2); }
.mp-item svg { width: 18px; height: 18px; color: var(--muted); }

/* =====================================================================================================
   Page furniture
   ===================================================================================================== */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head .actions, .toolhead .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.eyebrow { margin: 0 0 4px; font-size: .78em; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--brand); }
.display { font-family: var(--serif); font-size: clamp(1.9rem, 3.4vw, 2.6rem); color: var(--ink); letter-spacing: -.01em; line-height: 1.1; }
.toolhead h1 { color: var(--ink); letter-spacing: -.01em; }
.toolhead p:not(.eyebrow) { margin-top: 4px; }
.toolbar { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar input { flex: 1 1 280px; } .toolbar select { flex: 0 1 240px; }
.listbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; padding: 7px 12px; border-radius: 8px; font: 600 .86em var(--sans); color: var(--muted); cursor: pointer; }
.seg button svg { width: 16px; height: 16px; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(20,30,50,.12); }

.av { display: inline-grid; place-items: center; border-radius: 50%; color: #fff; font-weight: 700; letter-spacing: .02em; flex: none; box-shadow: 0 0 0 2px var(--surface); user-select: none; }
.av-empty { width: 26px; height: 26px; border-radius: 50%; border: 1.5px dashed var(--line-2); display: inline-block; flex: none; }
.avs { display: inline-flex; } .avs .av + .av { margin-left: -7px; }
.mono { display: inline-grid; place-items: center; border-radius: 11px; color: #fff; font-family: var(--serif); font-weight: 700; flex: none; letter-spacing: .02em; }
.who-cell { display: flex; align-items: center; gap: 8px; }

.skeleton-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.skel { height: 118px; border-radius: 14px; background: linear-gradient(90deg, var(--surface-2), var(--surface), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.2s infinite linear; border: 1px solid var(--line); }
@keyframes shimmer { to { background-position: -200% 0; } }

/* =====================================================================================================
   Dashboard
   ===================================================================================================== */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
@media (max-width: 1000px) { .kpis, .skeleton-grid { grid-template-columns: repeat(2, 1fr); } }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; text-decoration: none; color: inherit;
  display: flex; flex-direction: column; gap: 6px; transition: border-color .15s, box-shadow .15s, transform .15s; }
.kpi:hover { border-color: var(--brand-200); box-shadow: var(--shadow); transform: translateY(-1px); }
.kpi-top { display: flex; justify-content: space-between; align-items: center; }
.kpi-label { font-size: .8em; font-weight: 600; color: var(--muted); }
.kpi-ic { width: 30px; height: 30px; border-radius: 9px; background: var(--brand-50); color: var(--brand); display: grid; place-items: center; }
.kpi-ic svg { width: 17px; height: 17px; }
.kpi-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; color: var(--green); }
.kpi-num { font-family: var(--serif); font-size: 2.3rem; line-height: 1; color: var(--ink); font-weight: 700; letter-spacing: -.02em; }
.kpi-sub { font-size: .8em; color: var(--muted); }
.kpi.alert .kpi-num { color: var(--red); }
.kpi.alert .kpi-ic { background: var(--red-50); color: var(--red); }
.kpi.alert { border-color: color-mix(in srgb, var(--red) 28%, var(--line)); }
.dash { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 14px; margin-bottom: 14px; align-items: start; }
.dash > *, .feed-row > div { min-width: 0; }
@media (max-width: 1000px) { .dash { grid-template-columns: minmax(0, 1fr); } }
.panel-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 6px 0 8px; margin-bottom: 14px; }
.dash .panel-card { margin-bottom: 0; }
.pc-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 18px 8px; }
.pc-head h2 { font-size: 1.02em; font-weight: 700; }
.pc-link { font-size: .85em; font-weight: 600; text-decoration: none; }
.pc-note { font-size: .82em; color: var(--muted); }
.pc-empty { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; padding: 26px 18px 22px; color: var(--muted); font-size: .92em; }
.pc-empty svg { width: 30px; height: 30px; color: var(--green); margin-bottom: 4px; }
.pc-empty b { color: var(--ink); }
.pc-empty.boxed { background: var(--surface); border: 1px dashed var(--line-2); border-radius: 14px; }
.pc-empty .btn { margin-top: 8px; }
.lines { display: flex; flex-direction: column; }
.lines.boxed { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 6px 0; }
.line { display: grid; grid-template-columns: 10px 1fr auto auto auto; align-items: center; gap: 12px; padding: 10px 18px; text-decoration: none; color: inherit; border-top: 1px solid var(--line); }
.lines .line:first-child { border-top: 0; }
.line:hover { background: var(--surface-2); }
.line-main { min-width: 0; display: flex; flex-direction: column; }
.line-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.line-sub { font-size: .82em; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; gap: 6px; align-items: center; }
.line-meta { font-size: .82em; white-space: nowrap; }
span.late { color: var(--red); font-weight: 600; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--brand); }
.dot.late { background: var(--red); box-shadow: 0 0 0 4px var(--red-50); } .dot.nodate { background: var(--amber); } .dot.stale { background: var(--line-2); }
.dot.progress { background: var(--amber); } .dot.waiting { background: var(--purple); } .dot.done { background: var(--green); } .dot.open { background: var(--brand); }
@media (max-width: 700px) { .line { grid-template-columns: 10px 1fr auto; } .line .pill, .line .line-meta { display: none; } }
.week { display: flex; flex-direction: column; padding: 0 10px 6px; }
.wk-day { display: grid; grid-template-columns: 88px 1fr; gap: 10px; padding: 10px 8px; border-top: 1px solid var(--line); }
.wk-day:first-child { border-top: 0; }
.wk-date { display: flex; flex-direction: column; font-size: .85em; line-height: 1.3; } .wk-date span { color: var(--muted); }
.wk-items { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.wk-item { display: flex; flex-direction: column; padding: 7px 10px; border-radius: 9px; background: var(--brand-50); text-decoration: none; color: inherit; border-left: 3px solid var(--brand); }
.wk-item:hover { background: var(--brand-100); }
.wk-item span { font-weight: 600; font-size: .9em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wk-item small { color: var(--muted); font-size: .78em; }
.ctable { display: flex; flex-direction: column; }
.ct-row { display: grid; grid-template-columns: minmax(220px, 2.2fr) 70px 80px 110px 110px 130px; align-items: center; gap: 12px; padding: 10px 18px; border-top: 1px solid var(--line); text-decoration: none; color: inherit; }
a.ct-row:hover { background: var(--surface-2); }
.ct-head { font-size: .72em; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); border-top: 0; padding-top: 4px; padding-bottom: 6px; }
.ct-name { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ct-name > span { display: flex; flex-direction: column; min-width: 0; }
.ct-name b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .ct-name small { color: var(--muted); font-size: .8em; }
.ct-row .num { font-variant-numeric: tabular-nums; font-weight: 600; } .ct-row .num.bad { color: var(--red); }
.ct-row .muted { font-size: .85em; }
@media (max-width: 900px) { .ct-row { grid-template-columns: 1fr 60px 70px; } .ct-row > :nth-child(n+4) { display: none; } }
.feed { display: flex; flex-direction: column; }
.feed-row { display: grid; grid-template-columns: 30px 1fr; gap: 12px; padding: 11px 18px; border-top: 1px solid var(--line); text-decoration: none; color: inherit; }
.feed-row:first-child { border-top: 0; } .feed-row:hover { background: var(--surface-2); }
.feed-top { font-size: .9em; } .feed-top b:last-child { font-weight: 600; }
.feed-text { font-size: .88em; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 2px; }
.feed-when { font-size: .76em; color: var(--faint); margin-top: 3px; }
.trend { padding-bottom: 14px; }
.trend-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 18px; }
.trend-row > div { display: flex; flex-direction: column; }
.trend-num { font-family: var(--serif); font-weight: 700; font-size: 1.6rem; line-height: 1.1; }
.trend-row:nth-of-type(2) { color: var(--brand); } .trend-row:nth-of-type(3) { color: var(--green); }
.trend-row .trend-num { color: var(--ink); }
.idea { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; margin: 10px 18px 0; padding: 12px 14px; border-radius: 12px; background: var(--brand-50); }
.idea div { display: flex; flex-direction: column; font-size: .88em; } .idea span { color: var(--muted); }
@media (max-width: 600px) { .idea { grid-template-columns: 40px 1fr; } .idea .btn { grid-column: 1 / -1; } }

/* =====================================================================================================
   Communities
   ===================================================================================================== */
.cgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.ccard { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px; text-decoration: none; color: inherit; display: flex; flex-direction: column; gap: 14px;
  transition: border-color .15s, box-shadow .15s, transform .15s; }
.ccard:hover { border-color: var(--brand-200); box-shadow: var(--shadow); transform: translateY(-2px); }
.cc-top { display: flex; gap: 12px; align-items: center; }
.cc-id { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cc-id b { font-size: 1.05em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-id small { color: var(--muted); font-size: .8em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.cc-stats > div { display: flex; flex-direction: column; }
.cc-num { font-family: var(--serif); font-weight: 700; font-size: 1.55rem; line-height: 1.1; }
.cc-num.bad { color: var(--red); }
.cc-stats small { color: var(--muted); font-size: .76em; font-weight: 600; }
.cc-bar { height: 6px; border-radius: 99px; background: var(--brand-50); display: flex; overflow: hidden; }
.cc-bar-done { background: var(--green); } .cc-bar-late { background: var(--red); margin-left: auto; }
.cc-foot { display: flex; justify-content: space-between; align-items: center; }
.c-hero { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-bottom: 18px; }
.c-hero-id { flex: 1; min-width: 240px; }
.c-facts { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 8px; color: var(--muted); font-size: .9em; }
.c-facts span { display: inline-flex; align-items: center; gap: 7px; } .c-facts svg { width: 16px; height: 16px; }
.c-hero .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.c-stats { display: grid; grid-template-columns: repeat(4, 1fr); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.cs { padding: 14px 18px; border-left: 1px solid var(--line); display: flex; flex-direction: column; }
.cs:first-child { border-left: 0; }
.cs-num { font-family: var(--serif); font-weight: 700; font-size: 1.7rem; line-height: 1.1; }
.cs-num.small { font-family: var(--sans); font-size: 1.05rem; font-weight: 700; padding-top: 8px; }
.cs-label { font-size: .78em; color: var(--muted); font-weight: 600; }
.cs.alert .cs-num { color: var(--red); }
@media (max-width: 700px) { .c-stats { grid-template-columns: repeat(2, 1fr); } .cs:nth-child(3) { border-left: 0; } .cs:nth-child(n+3) { border-top: 1px solid var(--line); } }
dl.facts { display: grid; grid-template-columns: 180px 1fr; gap: 10px 18px; margin: 4px 18px 12px; }
dl.facts dt { color: var(--muted); font-weight: 600; font-size: .9em; } dl.facts dd { margin: 0; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }

/* =====================================================================================================
   Action Tracker board
   ===================================================================================================== */
.board-wrap { overflow-x: auto; padding-bottom: 6px; }
.board { display: grid; grid-template-columns: repeat(4, minmax(250px, 1fr)); gap: 12px; min-width: 1040px; }
.bcol { background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; padding: 10px; display: flex; flex-direction: column; gap: 8px; min-height: 260px; transition: background .12s, border-color .12s; }
.bcol.over { background: var(--brand-50); border-color: var(--brand); border-style: dashed; }
.bcol-head { display: flex; justify-content: space-between; align-items: center; padding: 2px 4px 4px; }
.bcol-count { font-size: .8em; font-weight: 700; color: var(--muted); }
.bcol-body { display: flex; flex-direction: column; gap: 8px; }
.bcol-empty { font-size: .85em; color: var(--faint); text-align: center; padding: 24px 8px; border: 1px dashed var(--line-2); border-radius: 10px; }
.bcard { background: var(--surface); border: 1px solid var(--line); border-radius: 11px; padding: 11px 12px; cursor: pointer; display: flex; flex-direction: column; gap: 4px;
  box-shadow: 0 1px 2px rgba(20,30,50,.05); transition: box-shadow .12s, border-color .12s, transform .12s; }
.bcard:hover { border-color: var(--brand-200); box-shadow: var(--shadow); }
.bcard.late { border-left: 3px solid var(--red); }
.bcard.dragging { opacity: .45; transform: rotate(1.5deg); }
.bc-title { font-weight: 600; font-size: .92em; line-height: 1.35; }
.bc-sub { font-size: .8em; color: var(--muted); }
.bc-foot { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: .8em; }
.bc-tags { flex: 1; display: flex; gap: 4px; }

/* =====================================================================================================
   Search (⌘K)
   ===================================================================================================== */
.pal-wrap { position: fixed; inset: 0; z-index: 90; background: rgba(15,22,35,.45); display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; animation: fade .12s; }
.pal { width: min(640px, 100%); background: var(--surface); border-radius: 16px; box-shadow: 0 24px 80px rgba(10,20,40,.35); overflow: hidden; border: 1px solid var(--line); animation: pop .14s ease-out; }
.pal-top { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.pal-top svg { width: 20px; height: 20px; color: var(--muted); }
.pal-input { border: 0 !important; box-shadow: none !important; padding: 4px 0 !important; min-height: 0 !important; font-size: 1.08em !important; background: none !important; }
.pal-list { max-height: min(56vh, 460px); overflow-y: auto; padding: 6px; }
.pal-group { font-size: .7em; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); padding: 10px 10px 4px; }
.pal-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 10px; border: 0; background: none; border-radius: 10px; cursor: pointer; text-align: left; color: var(--ink); font-family: inherit; }
.pal-row[aria-selected="true"] { background: var(--brand-50); }
.pal-ic { width: 26px; height: 26px; border-radius: 7px; background: var(--surface-2); display: grid; place-items: center; color: var(--muted); flex: none; }
.pal-ic svg { width: 16px; height: 16px; }
.pal-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pal-label { font-weight: 600; font-size: .94em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pal-sub { font-size: .8em; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pal-empty { padding: 28px 16px; text-align: center; color: var(--muted); font-size: .92em; }
.pal-foot { display: flex; gap: 18px; padding: 9px 16px; border-top: 1px solid var(--line); font-size: .78em; color: var(--muted); background: var(--surface-2); }
.pal-foot kbd { margin-right: 2px; }

/* Refinements to existing components for the new frame */
.irow { border-radius: 12px; box-shadow: none; }
.irow:hover { box-shadow: var(--shadow); }
@media (min-width: 901px) { .iright { grid-template-columns: 170px 110px 115px 100px; } }
.card, .tablewrap { box-shadow: none; }
.tabs { margin-top: 18px; }
.signin .card { box-shadow: var(--shadow-lg); }

/* =====================================================================================================
   Phones
   ===================================================================================================== */
@media (max-width: 900px) {
  .iright { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px 14px; }
  .iright > :last-child { justify-self: start; }
  .irow { padding: 14px; gap: 12px; }
  .inote { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
}
@media (max-width: 700px) {
  .btn { white-space: normal; text-align: left; line-height: 1.25; }
  .page-head .actions, .toolhead .actions { width: 100%; }
  .toolhead .actions .btn, .page-head .actions .btn { flex: 1 1 auto; justify-content: center; }
  .crumbs > :not(:last-child) { display: none; }
  .display { font-size: 1.85rem; }
  .toolhead h1 { font-size: 1.7rem; }
  /* Tables become one card per row; labels come from the header (data-label, set in app.js). */
  .tablewrap { overflow: visible; background: none; border: 0; }
  table.grid, table.grid tbody { display: block; }
  table.grid thead { display: none; }
  table.grid tr { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 6px 14px; margin-bottom: 10px; }
  table.grid tr.group { background: none; border: 0; padding: 10px 2px 2px; margin: 0; }
  table.grid tr.group td { background: none; padding: 0; }
  table.grid td { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; padding: 7px 0; border-bottom: 1px solid var(--line); text-align: right; }
  table.grid td:last-child { border-bottom: 0; }
  table.grid td::before { content: attr(data-label); color: var(--muted); font-size: .8em; font-weight: 600; text-align: left; flex: none; }
  table.grid td[data-label=""]::before, table.grid td:not([data-label])::before { content: none; }
  table.grid td:first-child { font-size: 1.02em; }
  table.grid td.num { text-align: right; }
  table.cmp td:first-child { width: auto; }
  .tablewrap.cmp-wrap { overflow-x: auto; }
  .fx-head { flex-wrap: wrap; }
  .fx-head h2 { font-size: 1.2em; }
  .fx-head a.btn { display: none; }
  .fx-panel { padding: 14px; }
  .banner > div { min-width: 0; }
  .banner small { white-space: normal; line-height: 1.2; display: block; }
  .paper { margin: 12px 0; }
  .summary { grid-template-columns: repeat(2, 1fr); }
  .chips { gap: 6px; } .chip { padding: 8px 12px; }
  .listbar .seg { margin-left: auto; }
  .panel footer .right { margin-left: 0; }
  /* The header's × closes a panel, so on a phone the footer keeps only its actions, side by side. */
  .panel footer .right, .panel footer .right ~ .btn.ghost { display: none; }
  .panel footer { padding: 12px 14px; } .panel footer > .btn { flex: 1 1 0; justify-content: center; padding-left: 10px; padding-right: 10px; }
  .c-hero .actions { width: 100%; } .c-hero .actions .btn { flex: 1 1 auto; justify-content: center; }
  dl.facts { grid-template-columns: 1fr; gap: 2px; } dl.facts dd { margin-bottom: 10px; }
  .wk-day { grid-template-columns: 1fr; gap: 6px; }
  .kpi-num { font-size: 2rem; }
  .rq { grid-template-columns: 1fr; }
}

/* =====================================================================================================
   Board packet, Governing documents, settings
   ===================================================================================================== */
.pk-h { font-size: .82em; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 18px 0 8px; }
.pk-parts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 700px) { .pk-parts { grid-template-columns: 1fr; } }
.pk-part { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--brand-200); background: var(--brand-50); border-radius: 12px; cursor: pointer; }
.pk-part.off { background: var(--surface); border-color: var(--line); opacity: .7; }
.pk-part:has(input:disabled) { cursor: default; opacity: .55; }
.pk-part input { width: 20px; height: 20px; accent-color: var(--brand); margin-top: 2px; flex: none; }
.pk-text { display: flex; flex-direction: column; } .pk-text small { color: var(--muted); font-size: .82em; }
.pk-sum { margin-top: 6px; }
.pk-sum-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.pk-sum-head .pk-h { margin-bottom: 8px; }
.pk-send { margin-top: 16px; padding: 16px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }

.ask { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px; margin-bottom: 22px; box-shadow: var(--shadow); }
.ask-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.ask-ic { width: 44px; height: 44px; border-radius: 12px; background: var(--brand-50); color: var(--brand); display: grid; place-items: center; flex: none; }
.ask-ic svg { width: 22px; height: 22px; }
.ask-input { flex: 1 1 320px; font-size: 1.05em !important; min-height: 52px !important; }
.ask-row select { flex: 0 1 240px; min-height: 52px; }
.ask-row .btn { min-height: 52px; }
.ask-examples { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.chip.small-chip { min-height: 32px; padding: 5px 12px; font-size: .8em; font-weight: 500; }
.answer { margin-top: 16px; border-radius: 14px; background: var(--brand-50); padding: 16px 18px; border-left: 4px solid var(--brand); }
.answer.notfound { background: var(--surface-2); border-left-color: var(--line-2); }
.ans-q { font-size: .85em; color: var(--muted); font-weight: 600; margin-bottom: 6px; }
.ans-text { font-size: 1.05em; line-height: 1.55; white-space: pre-wrap; }
.ans-cites { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.ans-from { font-size: .72em; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--brand); }
.cite { text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 10px 12px; cursor: pointer; display: flex; flex-direction: column; gap: 4px; font-family: inherit; color: var(--ink); }
.cite:hover { border-color: var(--brand); box-shadow: var(--shadow); }
.cite-ref { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: .85em; color: var(--brand-ink); }
.cite-ref svg { width: 15px; height: 15px; }
.cite-quote { font-size: .9em; color: var(--muted); font-style: italic; }
.ans-note { font-size: .76em; color: var(--faint); margin: 12px 0 0; }
.doc-groups { display: grid; gap: 14px; }
.doc-line { grid-template-columns: 10px 1fr auto auto auto; }
.doc-meta { display: flex; gap: 6px; color: var(--muted); font-size: .85em; margin-bottom: 10px; }
.doc-meta span + span::before { content: "· "; }
.doc-page { white-space: pre-wrap; line-height: 1.6; font-size: .95em; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; }
.doc-page mark { background: #fff1a8; color: inherit; padding: 1px 0; border-radius: 3px; }

.setting { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.setting > svg { width: 26px; height: 26px; color: var(--brand); }
.setting-actions { display: flex; gap: 12px; align-items: center; }
.switch { position: relative; display: inline-block; width: 46px; height: 26px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; inset: 0; background: var(--line-2); border-radius: 99px; transition: background .15s; cursor: pointer; }
.slider::before { content: ""; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform .15s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + .slider { background: var(--green); }
.switch input:checked + .slider::before { transform: translateX(20px); }
.switch input:focus-visible + .slider { outline: 3px solid var(--brand-200); }
@media (max-width: 700px) {
  .ask-row select, .ask-row .btn { flex: 1 1 100%; }
  .doc-line { grid-template-columns: 10px 1fr; } .doc-line > :nth-child(n+3) { grid-column: 2; justify-self: start; }
}
h2.section { font-size: 1.05rem; font-weight: 700; margin: 0 0 10px; color: var(--ink); }

/* ---- First-visit tour ---- */
.tour-block { position: fixed; inset: 0; z-index: 94; }
.tour-spot { position: fixed; z-index: 95; border-radius: 12px; pointer-events: none; box-shadow: 0 0 0 9999px rgba(15,22,35,.5), 0 0 0 3px var(--brand-200); transition: all .25s ease; }
.tour-card { position: fixed; z-index: 96; width: min(360px, calc(100vw - 24px)); background: var(--surface); color: var(--ink); border-radius: 14px; padding: 18px 18px 14px; box-shadow: var(--shadow-lg); border: 1px solid var(--line); animation: pop .16s ease-out; }
.tour-card.center { top: 50%; left: 50%; transform: translate(-50%, -50%); animation: none; width: min(420px, calc(100vw - 24px)); box-shadow: 0 0 0 9999px rgba(15,22,35,.5), var(--shadow-lg); }
.tour-card.bottom { left: 12px; right: 12px; bottom: 12px; top: auto; width: auto; }
.tour-card.dock-top { left: 12px; right: 12px; top: 12px; bottom: auto; width: auto; }
.tour-card h2 { margin: 0 0 6px; font-family: var(--serif); font-size: 1.25rem; color: var(--brand-ink); }
.tour-card p { margin: 0 0 14px; line-height: 1.5; color: var(--ink-2, var(--ink)); }
.tour-count { font-size: .72em; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.tour-actions { display: flex; align-items: center; gap: 8px; }
.tour-actions .right { margin-left: auto; }
.tour-skip { background: none; border: 0; padding: 6px 4px; color: var(--muted); font: inherit; font-size: .85em; cursor: pointer; }
.tour-skip:hover { color: var(--ink); text-decoration: underline; }
