/* AGORA brand (agora.ooo crimson #780000) · font: Inter, as in the AVAx Events app · day/night themes */
@font-face { font-family: "Inter"; font-style: italic; font-weight: 100 900; font-display: swap;
  src: url("../fonts/inter-cyrillic-ext-italic.ae340a0bea48.woff2") format("woff2"); unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family: "Inter"; font-style: italic; font-weight: 100 900; font-display: swap;
  src: url("../fonts/inter-cyrillic-italic.b865cacd5d2d.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Inter"; font-style: italic; font-weight: 100 900; font-display: swap;
  src: url("../fonts/inter-greek-ext-italic.835e02a4d22c.woff2") format("woff2"); unicode-range: U+1F00-1FFF; }
@font-face { font-family: "Inter"; font-style: italic; font-weight: 100 900; font-display: swap;
  src: url("../fonts/inter-greek-italic.d9c48c9af414.woff2") format("woff2"); unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF; }
@font-face { font-family: "Inter"; font-style: italic; font-weight: 100 900; font-display: swap;
  src: url("../fonts/inter-vietnamese-italic.56a57d7d0e6f.woff2") format("woff2"); unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; }
@font-face { font-family: "Inter"; font-style: italic; font-weight: 100 900; font-display: swap;
  src: url("../fonts/inter-latin-ext-italic.426540d878df.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Inter"; font-style: italic; font-weight: 100 900; font-display: swap;
  src: url("../fonts/inter-latin-italic.6960e1e36129.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("../fonts/inter-cyrillic-ext.1ccb3a727cc2.woff2") format("woff2"); unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("../fonts/inter-cyrillic.9b525081d757.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("../fonts/inter-greek-ext.f1df20cef90e.woff2") format("woff2"); unicode-range: U+1F00-1FFF; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("../fonts/inter-greek.0e729a968283.woff2") format("woff2"); unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("../fonts/inter-vietnamese.9b7ac2047bc6.woff2") format("woff2"); unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("../fonts/inter-latin-ext.e7fdb0113866.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("../fonts/inter-latin.e990806dbc9b.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
:root {
  --ink: #1a1a1a; --ink-2: #4a4a4a; --muted: #7a7a7a; --line: #ebe4e4; --line-2: #f3eeee;
  --bg: #f7f6f6; --panel: #fff; --card: #fff; --row-alt: #fcfbfb;
  --brand: #780000; --brand-dark: #560000; --brand-2: #a00000; --brand-faint: #f9f0f0; --brand-tint: #fbf4f4;
  --brand-fill: #780000; --brand-fill-hover: #560000; --on-brand: #fff;
  --accent: #a00000; --accent-soft: #e8c5c5;
  --good: #2e7d4f; --good-bg: #e7f5ec; --warn: #9a5b00; --warn-bg: #fdf1dc; --bad: #b3261e; --bad-bg: #fcebe9;
  --info: #1f5fae; --info-bg: #eaf2fc; --shadow: none;
  --radius: 0; --side: 248px;
  --fs-s: .8462rem; --fs-m: 1rem; --fs-l: 1.1538rem; --fs-xl: 1.4615rem;  /* 11 / 13 / 15 / 19 px – the only sizes */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px; --sp-6: 32px;  /* spacing scale */
  color-scheme: light;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-optical-sizing: auto; font-feature-settings: "cv11", "ss03"; color: var(--ink);
}
/* Night: "auto" follows the device; the switch can force day or night (stored per device). */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --ink: #ece7e7; --ink-2: #c9c1c1; --muted: #978d8d; --line: #332c2d; --line-2: #2a2425;
  --bg: #131112; --panel: #1c1819; --card: #1c1819; --row-alt: #201b1c;
  --brand: #f19a9a; --brand-dark: #ffb4b4; --brand-2: #e07a7a; --brand-faint: #3a1d1f; --brand-tint: #2a1e1f;
  --brand-fill: #a00000; --brand-fill-hover: #bd1a1a; --on-brand: #fff;
  --accent: #e07a7a; --accent-soft: #5c2c2e;
  --good: #7fd09a; --good-bg: #17301f; --warn: #f0b55a; --warn-bg: #3a2a10; --bad: #ff8b82; --bad-bg: #3d1d1c;
  --info: #8ab8f0; --info-bg: #152a42; --shadow: none;
  color-scheme: dark;
} }
:root[data-theme="dark"] {
  --ink: #ece7e7; --ink-2: #c9c1c1; --muted: #978d8d; --line: #332c2d; --line-2: #2a2425;
  --bg: #131112; --panel: #1c1819; --card: #1c1819; --row-alt: #201b1c;
  --brand: #f19a9a; --brand-dark: #ffb4b4; --brand-2: #e07a7a; --brand-faint: #3a1d1f; --brand-tint: #2a1e1f;
  --brand-fill: #a00000; --brand-fill-hover: #bd1a1a; --on-brand: #fff;
  --accent: #e07a7a; --accent-soft: #5c2c2e;
  --good: #7fd09a; --good-bg: #17301f; --warn: #f0b55a; --warn-bg: #3a2a10; --bad: #ff8b82; --bad-bg: #3d1d1c;
  --info: #8ab8f0; --info-bg: #152a42; --shadow: none;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { font-size: 13px; }
body { margin: 0; background: var(--bg); color: var(--ink); line-height: 1.55; -webkit-font-smoothing: antialiased; transition: background-color .15s; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 var(--sp-3); letter-spacing: -0.011em; }
p { margin: 0 0 var(--sp-3); }
h1 { font-size: var(--fs-xl); font-weight: 700; }
h2 { font-size: var(--fs-l); font-weight: 600; }
h3 { font-size: var(--fs-m); font-weight: 600; }
small, .muted { color: var(--muted); }
small { font-size: var(--fs-s); }
code { background: var(--line-2); padding: 1px 5px; border-radius: 0; font-size: .9em; }

/* ---------- sidebar ---------- */
.side { position: fixed; inset: 0 auto 0 0; width: var(--side); background: var(--panel); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: var(--sp-5) var(--sp-3) var(--sp-3); overflow-y: auto; z-index: 20; }
.side .brand { display: block; padding: 0 8px; text-decoration: none; }
.side .brand img { height: 30px; display: block; }
.side .brand span { display: block; color: var(--muted); font-size: var(--fs-s); letter-spacing: .02em; margin-top: 6px; }
.side .brand-rule { height: 3px; border-radius: 0; margin: var(--sp-3) var(--sp-2) var(--sp-4); background: linear-gradient(90deg, var(--brand) 0 55%, var(--brand-2) 55% 80%, var(--accent-soft) 80%); }
.side .switcher { width: 100%; margin-bottom: var(--sp-3); font-weight: 500; }
.side nav { flex: 1; }
.side .side-menu { flex: 1; }
.side .side-menu[hidden] { display: none; }
/* admins: Retreats | AGORA admin */
.side-mode { display: flex; margin: 0 0 var(--sp-3); border: 1px solid var(--line); }
.side-mode button { flex: 1; border: 0; background: transparent; padding: 6px var(--sp-2); font: inherit; font-size: var(--fs-s); font-weight: 600;
  color: var(--ink-2); cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px; }
.side-mode button[aria-selected="true"] { background: var(--brand-faint); color: var(--brand); }
.side-mode button:hover { color: var(--brand); }
.side nav a { display: flex; align-items: center; gap: var(--sp-2); padding: 6px var(--sp-2); border-radius: 0; color: var(--ink); font-size: var(--fs-m); }
.side nav a i { font-style: normal; width: 18px; text-align: center; color: var(--muted); font-size: var(--fs-m); }
.side nav a:hover { background: var(--brand-tint); text-decoration: none; }
.side nav a.on { background: var(--brand-faint); color: var(--brand); font-weight: 600; }
.side nav a.on i { color: var(--brand); }
.side nav .label { font-size: var(--fs-s); font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: var(--sp-4) var(--sp-2) var(--sp-1); }
.side .me { border-top: 1px solid var(--line); margin-top: 14px; padding: 12px 8px 0; display: flex; justify-content: space-between; align-items: flex-end; gap: 8px; font-size: var(--fs-m); }
.side .me small { word-break: break-all; }
.badge { margin-left: auto; background: var(--brand-faint); color: var(--brand); border-radius: 0; font-size: var(--fs-s); padding: 1px 7px; font-weight: 600; }

main { padding: var(--sp-5) var(--sp-6) 56px; max-width: 1320px; }
body.has-side main { margin-left: var(--side); }
.mbar, .tabbar, .side-backdrop { display: none; }
@media (max-width: 900px) {
  /* top bar */
  .mbar { display: flex; align-items: center; gap: var(--sp-3); position: sticky; top: 0; z-index: 40; height: 52px; padding: 0 var(--sp-4) 0 var(--sp-2);
    background: var(--panel); border-bottom: 1px solid var(--line); }
  .menu-btn { width: 40px; height: 40px; padding: 10px 9px; border: 0; background: none; display: flex; flex-direction: column; justify-content: space-between; }
  .menu-btn { align-items: stretch; flex: none; }
  .menu-btn span { display: block; width: 22px; height: 2px; background: var(--ink); transition: transform .2s, opacity .2s; }
  body.menu-open .menu-btn span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
  body.menu-open .menu-btn span:nth-child(2) { opacity: 0; }
  body.menu-open .menu-btn span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
  .mbar-brand img { height: 20px; display: block; }
  .mbar-title { margin-left: auto; text-align: right; min-width: 0; line-height: 1.2; }
  .mbar-title small, .mbar-title b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .mbar-title small { font-size: var(--fs-s); color: var(--muted); }
  .mbar-title b { font-size: var(--fs-m); font-weight: 600; }
  /* the menu slides in from the left */
  .side { position: fixed; top: 52px; bottom: 0; left: 0; width: min(86vw, 320px); z-index: 60; transform: translateX(-102%);
    transition: transform .22s ease; box-shadow: none; padding-top: var(--sp-4); -webkit-overflow-scrolling: touch; }
  body.menu-open .side { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.25); }
  .side-backdrop { display: block; position: fixed; inset: 52px 0 0 0; z-index: 55; background: rgba(0,0,0,.35); opacity: 0; pointer-events: none; transition: opacity .2s; }
  body.menu-open .side-backdrop { opacity: 1; pointer-events: auto; }
  body.menu-open { overflow: hidden; }
  .side nav a { padding: 9px var(--sp-2); }  /* bigger tap targets */
  .side .brand, .side .brand-rule { display: none; }  /* the top bar already shows the logo */
  .mbar { z-index: 65; }
  body.has-side main { margin-left: 0; }
  main { padding: var(--sp-4) var(--sp-4) var(--sp-6); }
  /* bottom tab bar inside a retreat */
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    background: var(--panel); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
  .tabbar a, .tabbar button { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 2px 6px;
    border: 0; background: none; color: var(--muted); font-size: 10px; font-weight: 500; text-decoration: none; min-width: 0; }
  .tabbar i { font-style: normal; font-size: 17px; line-height: 1.1; }
  .tabbar .on { color: var(--brand); font-weight: 600; }
  .tabbar .badge { position: absolute; top: 3px; left: 50%; margin-left: 6px; font-size: 9px; padding: 0 4px; }
  body.has-tabbar main { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
}

/* ---------- page head ---------- */
.head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-4); margin-bottom: var(--sp-5); flex-wrap: wrap; }
.head h1 { margin: 0 0 var(--sp-1); }
.head p, .head .muted { margin: 0; color: var(--ink-2); }
.head .actions { display: flex; gap: var(--sp-2); flex-wrap: wrap; align-items: center; }

/* ---------- cards & grids ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 0; padding: var(--sp-4) var(--sp-5); margin-bottom: var(--sp-4); box-shadow: var(--shadow); }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.card.flush { padding: 0; overflow: hidden; }
.grid { display: grid; gap: var(--sp-4); }
.grid.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: var(--sp-3); margin-bottom: var(--sp-5); }
@media (max-width: 900px) { .grid.c2, .grid.c3, .grid.c4 { grid-template-columns: 1fr; } }

.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 0; padding: var(--sp-3) var(--sp-4); color: var(--ink); display: block; }
a.stat:hover { text-decoration: none; background: var(--row-alt); }
.stat.on { background: var(--brand-faint); }
.stat.on .value, .stat.on .label { color: var(--brand); }
.stat .value { font-size: var(--fs-xl); font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; }
.stat .value small { font-size: var(--fs-m); font-weight: 500; }
.stat .label { font-size: var(--fs-m); color: var(--ink); margin-top: 2px; }
.stat .sub { font-size: var(--fs-s); color: var(--muted); }

/* ---------- buttons ---------- */
.btn, button { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--panel); color: var(--ink);
  padding: 6px var(--sp-3); border-radius: 0; font: inherit; font-size: var(--fs-m); font-weight: 500; cursor: pointer; text-decoration: none; white-space: nowrap; line-height: 1.3; }
.btn:hover, button:hover { background: var(--brand-tint); color: var(--brand); text-decoration: none; }
.btn.primary, button.primary { background: var(--brand-faint); border-color: var(--brand-faint); color: var(--brand); font-weight: 600; }
.btn.primary:hover, button.primary:hover { background: var(--accent-soft); border-color: var(--accent-soft); color: var(--brand-dark); }
.btn.accent, button.accent { background: var(--brand-faint); border-color: var(--brand-faint); color: var(--brand); font-weight: 600; }
.btn.danger, button.danger { color: var(--ink); }
.btn.sm, button.sm { padding: 2px var(--sp-2); font-size: var(--fs-s); border-radius: 0; }
button.link { border: 0; background: none; padding: 0; color: var(--brand); font-weight: 400; font-size: inherit; }
form.inline { display: inline; margin: 0; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: var(--fs-m); }
th, td { text-align: left; padding: var(--sp-2) var(--sp-3); border-bottom: 1px solid var(--line-2); vertical-align: top; }
th { font-size: var(--fs-s); text-transform: uppercase; letter-spacing: .08em; color: var(--ink-2); font-weight: 600; background: var(--panel); border-bottom: 1px solid var(--line); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.group td { background: var(--brand-faint); font-weight: 600; color: var(--ink); padding-top: 9px; padding-bottom: 9px; border-bottom: 1px solid var(--line); }
tr.group td small { font-weight: 400; margin-left: 6px; }
td.time { color: var(--brand); white-space: nowrap; font-variant-numeric: tabular-nums; width: 110px; }
td .t { font-weight: 600; }
td.nowrap, th.nowrap { white-space: nowrap; }
td .sub, .sub { color: var(--muted); font-size: var(--fs-m); }
tr.done td { color: var(--muted); }
tr.done td .t { text-decoration: line-through; font-weight: 400; }
tr.clickable { cursor: pointer; } tr.clickable:hover td { background: var(--brand-tint); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 0; margin-right: 7px; vertical-align: 1px; background: var(--muted); }
.k-plenary { background: var(--brand); } .k-workshop { background: #2563eb; } .k-breakout { background: #0d9488; }
.k-talk { background: #7c3aed; } .k-reflection { background: #16a34a; } .k-social { background: #ea580c; }
.k-meal { background: #d97706; } .k-break, .k-logistics { background: #a3a3a3; }
tr.k-row-break td, tr.k-row-meal td, tr.k-row-logistics td { background: var(--row-alt); }
tr.k-row-break .t, tr.k-row-meal .t, tr.k-row-logistics .t { text-transform: uppercase; letter-spacing: .03em; font-size: var(--fs-m); }

.pill { display: inline-block; font-size: var(--fs-s); font-weight: 600; padding: 2px 9px; border-radius: 0; background: var(--line-2); color: var(--ink-2); white-space: nowrap; }
.pill.good { background: var(--good-bg); color: var(--good); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill.info { background: var(--info-bg); color: var(--info); }
.pill.brand { background: var(--brand-faint); color: var(--brand); }
.overdue { color: var(--bad); font-weight: 600; }

.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 14px; }
.tabs a { padding: 5px 12px; border-radius: 0; color: var(--ink-2); font-size: var(--fs-m); border: 1px solid transparent; }
.tabs a.on { background: var(--panel); border-color: var(--line); color: var(--brand); font-weight: 600; }
.tabs a:hover { text-decoration: none; color: var(--brand); }
.tabs a .n { color: var(--muted); margin-left: 4px; font-weight: 400; }

.messages { list-style: none; padding: 0; margin: 0 0 16px; }
.messages li { padding: 10px 14px; border-radius: 0; margin-bottom: 6px; background: var(--info-bg); color: var(--info); }
.messages li.success { background: var(--good-bg); color: var(--good); }
.messages li.warning { background: var(--warn-bg); color: var(--warn); }
.messages li.error { background: var(--bad-bg); color: var(--bad); }

/* ---------- forms ---------- */
.form > div, .field { margin-bottom: var(--sp-4); }
.form label, .field label { display: block; font-weight: 600; font-size: var(--fs-m); margin-bottom: var(--sp-1); }
input[type=text], input[type=email], input[type=url], input[type=number], input[type=date], input[type=time], input[type=password],
input[type=search], select, textarea {
  width: 100%; padding: 6px var(--sp-2); border: 1px solid var(--line); border-radius: 0; font: inherit; font-size: var(--fs-m); background: var(--panel); color: var(--ink); }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-soft); outline-offset: -1px; border-color: transparent; }
input[type=checkbox], input[type=radio] { width: auto; margin-right: 6px; accent-color: var(--brand); }
.form .helptext, .helptext { display: block; font-size: var(--fs-s); color: var(--muted); margin-top: var(--sp-1); line-height: 1.4; }
.form ul.errorlist, .errorlist { color: var(--bad); list-style: none; padding: 0; margin: 2px 0; font-size: var(--fs-m); }
.form div:has(> input[type=checkbox]) { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.form div:has(> input[type=checkbox]) label { margin: 0; order: 2; }
.form div:has(> input[type=checkbox]) .helptext { order: 3; width: 100%; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.form-grid > .wide { grid-column: 1 / -1; }
@media (max-width: 700px) { .form-grid { grid-template-columns: 1fr; } }
.form-actions { display: flex; gap: 8px; margin-top: 8px; }
.checklist { max-height: 340px; overflow: auto; border: 1px solid var(--line); border-radius: 0; padding: 6px 10px; background: var(--panel); }
.checklist label, .checklist div { font-weight: 400 !important; }
.filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.filters input[type=search] { width: 260px; }
.filters select { width: auto; min-width: 150px; }
.filters .count { color: var(--muted); font-size: var(--fs-m); }
fieldset { border: 0; padding: 0; margin: 0 0 var(--sp-5); }
fieldset + fieldset { padding-top: var(--sp-4); border-top: 1px solid var(--line-2); }
.form fieldset > div, .form .form-grid > div, .form div:has(> label + input), .form div:has(> label + select), .form div:has(> label + textarea) { margin-bottom: var(--sp-4); }
fieldset legend { font-weight: 600; font-size: var(--fs-s); letter-spacing: .08em; text-transform: uppercase; margin: 0 0 var(--sp-3); padding: 0; color: var(--muted); }

.progress { height: 10px; border-radius: 0; background: var(--line-2); overflow: hidden; display: flex; }
.progress > span { display: block; height: 100%; }
.progress .spent { background: var(--brand-fill); }
.progress .committed { background: var(--brand-2); opacity: .5; }
.progress .planned { background: var(--accent-soft); }
.legend { display: flex; gap: 14px; font-size: var(--fs-s); color: var(--ink-2); margin-top: 6px; flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 0; margin-right: 5px; vertical-align: -1px; }

.kv { display: grid; grid-template-columns: 150px 1fr; gap: 6px 14px; font-size: var(--fs-m); }
.kv dt { color: var(--muted); } .kv dd { margin: 0; white-space: pre-line; }
.empty { text-align: center; color: var(--muted); padding: 28px 10px; }
.log li { margin-bottom: 6px; font-size: var(--fs-m); }
.mail-body { white-space: pre-wrap; font-family: inherit; background: var(--panel); border: 1px solid var(--line); border-radius: 0; padding: 16px; max-height: 600px; overflow: auto; }
.unread td { font-weight: 600; }
iframe.preview { width: 100%; height: 900px; border: 1px solid var(--line); border-radius: 0; background: #fff; color-scheme: light; }
.auth { max-width: 400px; margin: 80px auto; }
.auth-logo { display: block; height: 36px; margin: 0 auto 6px; }
@media print {
  .side, .head .actions, .no-print, .messages { display: none !important; }
  body.has-side main { margin: 0; } main { padding: 0; } .card { border: 0; box-shadow: none; padding: 0; }
  tr.group td { background: #f3f3f3 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------- timeline ---------- */
.countdown { padding: 20px 24px; }
.cd-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; flex-wrap: wrap; }
.cd-nums { display: flex; gap: 34px; }
.cd-nums b { display: block; font-size: var(--fs-xl); font-weight: 700; line-height: 1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.cd-nums span { display: block; text-transform: uppercase; letter-spacing: .1em; font-size: var(--fs-s); color: var(--ink-2); margin-top: 6px; }
.cd-until { text-align: right; }
.cd-until span { display: block; text-transform: uppercase; letter-spacing: .1em; font-size: var(--fs-s); color: var(--muted); }
.cd-until strong { display: block; font-size: var(--fs-l); }
.cd-until small { color: var(--ink-2); }
.cd-bar { display: flex; align-items: center; gap: 14px; margin-top: 18px; flex-wrap: wrap; font-size: var(--fs-m); }
.cd-bar .progress { height: 8px; }
.cd-bar a.pill:hover { text-decoration: none; }
.nowrap { white-space: nowrap; }

.tl { margin-top: 8px; }
.tl-month { text-transform: uppercase; letter-spacing: .1em; font-weight: 600; font-size: var(--fs-m); color: var(--ink-2); padding: 22px 0 8px 6px; }
.tl-item { display: grid; grid-template-columns: 96px 26px 1fr auto; gap: 0 10px; align-items: start; padding: 10px 12px 12px 6px; border-radius: 0; position: relative; }
.tl-item:hover { background: var(--panel); }
.tl-item.is-today { background: var(--brand-tint); }
.tl-item.is-done { opacity: .6; }
.tl-item.is-done .tl-title { text-decoration: line-through; }
.tl-date { text-align: right; color: var(--ink-2); font-size: var(--fs-m); padding-top: 2px; white-space: nowrap; }
.tl-mark { position: relative; align-self: stretch; display: flex; justify-content: center; }
.tl-mark::before { content: ""; position: absolute; top: -12px; bottom: -14px; left: 50%; width: 2px; margin-left: -1px; background: var(--line); }
.tl-mark i { position: relative; margin-top: 4px; width: 14px; height: 14px; background: var(--panel); }
.tl-mark .ring { border-radius: 50%; border: 3px solid var(--brand); }
.tl-mark .diamond { transform: rotate(45deg); border: 3px solid var(--brand); background: var(--brand-faint); width: 13px; height: 13px; }
.tl-mark .late { border-color: var(--bad); }
.tl-mark .diamond.late { background: #f7c7c2; }
.tl-mark .ok { border-color: var(--good); background: var(--good-bg); }
.tl-title { font-weight: 600; font-size: var(--fs-m); }
.tl-flags { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; padding-top: 2px; }
@media (max-width: 700px) {
  .tl-item { grid-template-columns: 70px 22px 1fr; }
  .tl-flags { grid-column: 3; justify-content: flex-start; margin-top: 4px; }
  .cd-nums b { font-size: var(--fs-xl); } .cd-until { text-align: left; }
}

/* ---------- task groups ---------- */
.task-group { margin-bottom: 16px; }
.tg-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px 10px; }
.tg-head h2 { margin: 0; text-transform: uppercase; letter-spacing: .03em; font-size: var(--fs-m); }
.task-group table td { padding: 9px 14px; vertical-align: middle; }
.task-group table tr:first-child td { border-top: 1px solid var(--line-2); }

/* ---------- logo per theme, theme switch, footer ---------- */
.logo-dark { display: none !important; }
:root[data-theme="dark"] .logo-light { display: none !important; }
:root[data-theme="dark"] .logo-dark { display: block !important; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo-light { display: none !important; }
  :root:not([data-theme="light"]) .logo-dark { display: block !important; }
}
.theme-switch { display: inline-flex; border: 1px solid var(--line); border-radius: 0; padding: 2px; gap: 2px; background: var(--bg); }
.theme-switch button { border: 0; background: transparent; color: var(--muted); padding: 3px 9px; border-radius: 0; font-size: var(--fs-s); font-weight: 500; }
.theme-switch button:hover { color: var(--ink); }
.theme-switch button[aria-pressed="true"] { background: var(--brand-faint); color: var(--brand); font-weight: 600; }
.side .foot { border-top: 1px solid var(--line); margin-top: 14px; padding: 10px 8px 0; font-size: var(--fs-s); color: var(--muted); }
.side .foot .row { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.side .foot a { color: var(--ink-2); }
.side .me { border-top: 0; margin-top: 0; padding: 0 0 10px; }
.changelog h2 { margin-top: 26px; padding-top: 12px; border-top: 1px solid var(--line); }
.changelog h2:first-of-type { border-top: 0; margin-top: 0; }
.changelog li { margin-bottom: 4px; }

/* ---------- right-hand drawer ---------- */
.drawer { position: fixed; inset: 0; z-index: 50; pointer-events: none; }
.drawer-backdrop { position: absolute; inset: 0; background: rgba(20, 10, 10, .28); opacity: 0; transition: opacity .2s; }
.drawer-panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(560px, 100vw); background: var(--bg);
  border-left: 1px solid var(--line); box-shadow: -12px 0 32px rgba(0,0,0,.14); display: flex; flex-direction: column;
  transform: translateX(102%); transition: transform .24s cubic-bezier(.2,.8,.2,1); }
.drawer.wide .drawer-panel { width: min(860px, 100vw); }
.drawer.open { pointer-events: auto; }
.drawer.open .drawer-backdrop { opacity: 1; }
.drawer.open .drawer-panel { transform: none; }
.drawer-bar { display: flex; align-items: center; gap: 8px; padding: 10px 14px 10px 20px; border-bottom: 1px solid var(--line); background: var(--panel); }
.drawer-title { flex: 1; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drawer-full, .drawer-x { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 0;
  border: 1px solid transparent; background: transparent; color: var(--muted); font-size: var(--fs-l); padding: 0; text-decoration: none; }
.drawer-full:hover, .drawer-x:hover { background: var(--brand-faint); color: var(--brand); border-color: transparent; text-decoration: none; }
.drawer-x { font-size: var(--fs-xl); line-height: 1; }
.drawer-body { flex: 1; overflow-y: auto; padding: 18px 20px 40px; }
.drawer.loading .drawer-body { opacity: .5; transition: opacity .15s .1s; }
.drawer.loading .drawer-bar { background-image: linear-gradient(90deg, var(--brand-fill) 0 30%, transparent 30%); background-size: 200% 2px; background-repeat: no-repeat; background-position: 0 100%; animation: drawer-load 1s linear infinite; }
@keyframes drawer-load { to { background-position: -200% 100%; } }
.drawer-body .head { margin-bottom: 14px; }
.drawer-body .head h1 { font-size: var(--fs-l); }
.drawer-body .card { max-width: none !important; }
.drawer-body .grid.c2 { grid-template-columns: 1fr; }
.drawer.wide .drawer-body .grid.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
html.drawer-lock { overflow: hidden; }
@media (max-width: 700px) { .drawer-panel, .drawer.wide .drawer-panel { width: 100vw; } }

/* ---------- public pages (apply) ---------- */
.public-wrap { max-width: 760px; margin: 0 auto; padding: 28px 16px 40px; }
.public-logo { display: flex; align-items: center; gap: 12px; justify-content: center; margin-bottom: 22px; }
.public-logo img { height: 32px; }
.public-logo span { color: var(--muted); border-left: 1px solid var(--line); padding-left: 12px; font-size: var(--fs-m); }
.hero-public { background: var(--brand-fill); color: #fff; border-radius: 0; padding: 28px 28px 22px; margin-bottom: 18px; }
.hero-public h1 { font-size: var(--fs-xl); color: #fff; margin: 6px 0 10px; }
.hero-public p, .hero-public li { color: rgba(255,255,255,.92); }
.hero-public ul { padding-left: 18px; margin: 10px 0 0; } .hero-public li { margin-bottom: 4px; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: var(--fs-s); font-weight: 600; opacity: .8; }
.card .eyebrow { color: var(--brand); opacity: 1; }

/* ---------- contracts ---------- */
.contract { line-height: 1.65; }
.contract h2 { font-size: var(--fs-m); margin: 20px 0 6px; }
.contract blockquote { margin: 0 0 14px; padding: 10px 14px; background: var(--warn-bg); color: var(--warn); border-radius: 0; }
.contract blockquote p { margin: 0; }
.sig-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.sig { font-family: "Snell Roundhand", "Segoe Script", "Brush Script MT", cursive; font-size: 1.6rem; color: var(--ink); border-bottom: 1px solid var(--line); padding: 4px 0; min-height: 2.2rem; }
@media (max-width: 900px) { .grid[style*="3fr"] { grid-template-columns: 1fr !important; } }
@media print { .contract blockquote { display: none; } }

/* ---------- e-signature envelope ---------- */
@font-face { font-family: "Dancing Script"; font-weight: 600; font-display: swap; src: url("../fonts/dancing-script-latin.c092fca252c5.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+20AC; }
@font-face { font-family: "Dancing Script"; font-weight: 600; font-display: swap; src: url("../fonts/dancing-script-latin-ext.7880332a419a.woff2") format("woff2"); unicode-range: U+0100-02BA, U+1E00-1E9F, U+A720-A7FF; }
:root { --sig-ink: #1b2a6b; --tag: #ffd84d; --tag-ink: #3a2c00; }
:root[data-theme="dark"] { --sig-ink: #cfd8ff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --sig-ink: #cfd8ff; } }
.env-steps { list-style: none; padding: 0; margin: 0 0 16px; display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; counter-reset: s; }
.env-steps li { position: relative; padding: 8px 10px 8px 34px; border-radius: 0; background: var(--panel); border: 1px solid var(--line); font-size: var(--fs-m); color: var(--muted); counter-increment: s; }
.env-steps li::before { content: counter(s); position: absolute; left: 9px; top: 9px; width: 18px; height: 18px; border-radius: 50%; background: var(--line-2); color: var(--muted); font-size: var(--fs-s); display: grid; place-items: center; font-weight: 600; }
.env-steps li.done { color: var(--ink); border-color: var(--good-bg); }
.env-steps li.done::before { content: "✓"; background: var(--good); color: #fff; }
.env-steps small { display: block; color: var(--muted); font-size: var(--fs-s); }
@media (max-width: 800px) { .env-steps { grid-template-columns: 1fr 1fr; } }
.sign-bar { display: flex; gap: 16px; align-items: center; justify-content: space-between; background: var(--tag); color: var(--tag-ink); border-radius: 0; padding: 12px 16px; margin-bottom: 16px; position: sticky; top: 8px; z-index: 5; }
.sign-bar .consent { display: flex; gap: 8px; align-items: flex-start; font-size: var(--fs-m); margin-top: 6px; cursor: pointer; }
.sign-bar .consent input { margin-top: 3px; }

.sig-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line); }
.sig-role { font-size: var(--fs-s); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: 6px; }
.sig-img { display: block; max-height: 70px; max-width: 100%; border-bottom: 1px solid var(--ink-2); padding-bottom: 4px; }
:root[data-theme="dark"] .sig-img { filter: invert(.9) hue-rotate(180deg); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .sig-img { filter: invert(.9) hue-rotate(180deg); } }
.sig-empty { height: 70px; border-bottom: 1px solid var(--ink-2); }
.sig-name { font-weight: 600; margin-top: 6px; }
.sign-tag { height: 70px; width: 100%; justify-content: center; background: var(--tag); color: var(--tag-ink); border: 2px dashed #b38f00; font-weight: 700; border-radius: 0; opacity: .55; }
.sign-tag.ready { opacity: 1; animation: tag-bob 1.6s ease-in-out infinite; }
.sign-tag:hover { color: var(--tag-ink); border-color: #3a2c00; }
.sign-tag.done { background: transparent; border: 0; border-bottom: 1px solid var(--ink-2); opacity: 1; animation: none; padding: 0; justify-content: flex-start; }
.sign-tag.done img { max-height: 66px; max-width: 100%; }
@keyframes tag-bob { 50% { transform: translateY(-3px); } }
.finish-btn:disabled { opacity: .45; cursor: not-allowed; }
.finish-btn.pulse { box-shadow: 0 0 0 4px var(--tag), 0 0 0 6px #b38f00; }
.shake { animation: shake .4s; } @keyframes shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.modal { position: fixed; inset: 0; z-index: 60; background: rgba(20,10,10,.4); display: grid; place-items: center; padding: 16px; }
.modal[hidden] { display: none; }
.modal-card { background: var(--panel); border-radius: 0; width: min(560px, 100%); padding: 20px 22px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.sig-pad { position: relative; height: 150px; border: 1px solid var(--line); border-radius: 0; background: var(--bg); touch-action: none; }
.sig-pad canvas { width: 100%; height: 100%; display: block; cursor: crosshair; }
.sig-line { position: absolute; left: 14px; right: 14px; bottom: 34px; border-bottom: 1px dashed var(--muted); pointer-events: none; }
.audit { list-style: none; padding: 0; margin: 0; } .audit li { padding: 6px 0; border-bottom: 1px solid var(--line-2); font-size: var(--fs-m); } .audit li:last-child { border: 0; }

/* ---------- searchable dropdowns (Tom Select) ---------- */
.ts-wrapper.single .ts-control, .ts-wrapper .ts-control { border: 1px solid var(--line); border-radius: 0; padding: 7px 10px; background: var(--panel) !important; color: var(--ink); font: inherit; font-size: var(--fs-m); box-shadow: none; }
.ts-wrapper.focus .ts-control { outline: 2px solid var(--accent-soft); outline-offset: -1px; border-color: transparent; }
.ts-control input { color: var(--ink) !important; font: inherit !important; }
.ts-dropdown { background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 0; box-shadow: 0 10px 30px rgba(0,0,0,.12); font-size: var(--fs-m); z-index: 70; }
.ts-dropdown .option { padding: 6px 10px; }
.ts-dropdown .active { background: var(--brand-faint); color: var(--brand); }
.ts-dropdown .no-results { padding: 6px 10px; color: var(--muted); }
.ts-wrapper { min-width: 160px; }
.filters .ts-wrapper { width: auto; min-width: 200px; }

/* ---------- notices (toasts) with undo ---------- */
.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 80; display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 36px)); }
.toast { display: flex; align-items: center; gap: 10px; background: #1f1a1b; color: #fff; padding: 10px 10px 10px 14px; border-radius: 0;
  box-shadow: 0 8px 24px rgba(0,0,0,.25); font-size: var(--fs-m); animation: toast-in .2s ease-out; }
.toast span { flex: 1; }

.toast.out { opacity: 0; transform: translateY(8px); transition: all .3s; }
.toast-undo { background: transparent; border: 1px solid rgba(255,255,255,.4); color: #fff; padding: 3px 10px; font-size: var(--fs-s); }
.toast-undo:hover { background: #fff; color: #1f1a1b; border-color: #fff; }
.toast-x { background: none; border: 0; color: rgba(255,255,255,.6); font-size: var(--fs-l); padding: 0 4px; }
.toast-x:hover { color: #fff; border: 0; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }
@media print { .toasts { display: none; } }

/* ---------- notes & history ---------- */
.note { padding: 8px 0; border-bottom: 1px solid var(--line-2); }
.note:last-of-type { border-bottom: 0; }
.note-head { font-size: var(--fs-m); display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }
.note-body { margin-top: 3px; font-size: var(--fs-m); }
.audit li.reverted { opacity: .55; }
.sheet-bar { display: flex; gap: 14px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 12px 16px; }
.sheet-bar input[type=url] { min-width: 420px; flex: 1; }
.page-tabs { border-bottom: 1px solid var(--line); gap: 0; margin: 4px 0 16px; }
.page-tabs a { border: 0; border-bottom: 2px solid transparent; border-radius: 0; padding: 8px 16px; font-weight: 600; background: none !important; }
.page-tabs a.on { border-bottom-color: var(--brand); color: var(--brand); }
.apply-form fieldset { margin-bottom: var(--sp-5); }
.app-field { margin-bottom: var(--sp-4); }
.app-field > label { display: block; font-weight: 600; font-size: var(--fs-m); margin-bottom: 5px; }
.app-field.check { display: flex; gap: 8px; align-items: flex-start; }
.app-field.check label { font-weight: 400; margin: 0; }
.app-field ul { list-style: none; padding: 0; margin: 4px 0; display: flex; flex-direction: column; gap: 4px; }
.app-field ul label { font-weight: 400; display: flex; gap: 6px; align-items: center; }
.req { color: var(--bad); }

/* ---------- Fundraising & Claude ---------- */
.ai-banner { }
.ai-status { margin: 10px 0; padding: 8px 12px; border-radius: 0; font-size: var(--fs-m); background: var(--panel); border: 1px solid var(--line); }
.ai-status.failed { background: var(--bad-bg); color: var(--bad); border-color: transparent; }
.spinner { display: inline-block; width: 12px; height: 12px; border: 2px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -1px; margin-right: 4px; }
@keyframes spin { to { transform: rotate(360deg); } }
.ai-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.ai-head h2 { margin: 0; }
.fit { display: flex; gap: 14px; margin-top: 12px; align-items: flex-start; }
.fit .score { flex: none; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: var(--fs-l); background: var(--panel); }
.fit .score.good { background: var(--good-bg); color: var(--good); } .fit .score.warn { background: var(--warn-bg); color: var(--warn); } .fit .score.bad { background: var(--bad-bg); color: var(--bad); }
.fit ul { margin: 6px 0; padding-left: 18px; font-size: var(--fs-m); }
.fit ul.plus li::marker { content: "+  "; color: var(--good); } .fit ul.minus li::marker { content: "–  "; color: var(--bad); }
.prose { font-size: var(--fs-m); line-height: 1.55; } .prose p { margin: .5em 0; }
details > summary { cursor: pointer; }
table.found td { vertical-align: top; padding: 10px 6px; border-top: 1px solid var(--line); }
pre.facts { white-space: pre-wrap; font: inherit; font-size: var(--fs-m); color: var(--muted); margin: 0; }
.crumbs { font-size: var(--fs-m); margin: 0 0 4px; color: var(--muted); }
.bar { height: 4px; background: var(--line); border-radius: 0; margin-top: 4px; overflow: hidden; } .bar i { display: block; height: 100%; background: var(--brand); }
.section .q-head { font-weight: 600; display: flex; gap: 10px; }
.section .q-head textarea { font-weight: 600; flex: 1; }
.section .qnum { flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--panel); display: grid; place-items: center; font-size: var(--fs-s); margin-top: 4px; }
.section .q-meta { display: flex; gap: 10px; align-items: center; justify-content: flex-end; font-size: var(--fs-s); color: var(--muted); margin: 6px 0; }
.section .wc.over { color: var(--bad); font-weight: 600; }
.section .q-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.section .q-actions .instr { flex: 1; min-width: 200px; }
.section .q-actions .danger { margin-left: auto; }
.suggestion { margin-top: 12px; padding: 12px 14px; border: 1px dashed var(--line); border-radius: 0; background: var(--panel); }
.sticky-save { position: sticky; bottom: 0; background: var(--bg); padding: 10px 0; z-index: 2; }
.default-submit { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Searchable dropdowns: keep the typed text on the same line as the choice ---------- */
.ts-wrapper .ts-control { display: flex; flex-wrap: wrap; align-items: center; min-height: 36px; }
.ts-wrapper .ts-control > input, .ts-wrapper .ts-control > input[type=text] {
  flex: 1 1 4rem; width: auto !important; min-width: 4rem; border: 0 !important; padding: 0 !important; margin: 0 !important;
  background: transparent !important; outline: none !important; box-shadow: none !important; }
.ts-wrapper.single.typing .ts-control > .item { display: none; }  /* while searching, show only what's typed */
.ts-wrapper.single .ts-control::after { border-color: var(--muted) transparent transparent; }

/* ---------- Application form ---------- */
.apply-steps { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; font-size: var(--fs-s); }
.apply-steps a { padding: 4px 10px; border-radius: 0; background: var(--panel); border: 1px solid var(--line); color: var(--ink-2); }
.apply-form legend { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-m); letter-spacing: 0; text-transform: none; color: var(--ink); }
.apply-form legend .n { width: 24px; height: 24px; border-radius: 50%; background: var(--brand-faint); color: var(--brand); display: grid; place-items: center; font-size: var(--fs-s); }
.form-errors { background: var(--bad-bg); color: var(--bad); padding: 10px 14px; border-radius: 0; margin-bottom: 14px; }
.rank-title { font-size: var(--fs-l); margin: var(--sp-5) 0 var(--sp-2); } .rank-title .sub { font-weight: 400; }
/* Two tabs (v0.30.0): .apply-page[data-kind] decides what shows; both tabs fill in the one form, so answers stay. */
.apply-page[data-kind="retreat"] [data-only="gathering"], .apply-page[data-kind="gathering"] [data-only="retreat"] { display: none !important; }
.kind-tabs { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); background: var(--card); margin: 0 0 6px;
  position: sticky; top: 0; z-index: 4; }
.kind-tab { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 12px 16px 10px; cursor: pointer;
  border-bottom: 3px solid transparent; }
.kind-tab + .kind-tab { border-left: 1px solid var(--line); }
.kind-tab input { position: absolute; opacity: 0; pointer-events: none; }
.kind-tab b { font-size: var(--fs-l); color: var(--ink); }
.kind-tab span { font-size: var(--fs-s); color: var(--muted); }
.kind-tab:hover { background: var(--row-alt); }
.kind-tab:has(input:checked) { background: var(--brand-tint); border-bottom-color: var(--brand); }
.kind-tab:has(input:checked) b { color: var(--brand); }
.kind-tab:has(input:focus-visible) { outline: 2px solid var(--accent-soft); outline-offset: -2px; }
.kind-note { font-size: var(--fs-s); color: var(--muted); margin: 0 0 14px; }
.resume-box { background: var(--card); border: 1px solid var(--line); padding: 12px 16px; margin: 0 0 18px; font-size: var(--fs-m); }
.resume-box p { margin: 0 0 6px; }
.resume-form label { display: block; font-size: var(--fs-s); color: var(--muted); margin: 8px 0 4px; }
.resume-row { display: flex; gap: 8px; flex-wrap: wrap; }
.resume-row input { flex: 1; min-width: 200px; }
.apply-actions { position: sticky; bottom: 0; z-index: 3; background: var(--card); margin: 0 calc(-1 * var(--sp-5)) calc(-1 * var(--sp-4)); padding: 12px var(--sp-5);
  border-top: 1px solid var(--line); flex-wrap: wrap; align-items: center; }
@media (max-width: 560px) {
  .kind-tab { padding: 10px 10px 8px; } .kind-tab span { display: none; }
  .apply-actions .sub { flex-basis: 100%; }
}
.input-prefix { display: flex; align-items: stretch; border: 1px solid var(--line); border-radius: 0; background: var(--panel); overflow: hidden; }
.input-prefix:focus-within { outline: 2px solid var(--accent-soft); outline-offset: -1px; border-color: transparent; }
.input-prefix > span { padding: 7px 4px 7px 10px; color: var(--muted); font-size: var(--fs-m); white-space: nowrap; background: var(--row-alt); display: flex; align-items: center; }
.input-prefix > input { border: 0 !important; outline: none !important; border-radius: 0; min-width: 0; padding-left: 2px; }
.repeater { margin-top: 6px; }
.repeater .rep-head, .repeater .rep-row { display: grid; grid-template-columns: 1fr 1fr 1.4fr 32px; gap: 8px; align-items: center; }
.repeater.budget .rep-head, .repeater.budget .rep-row { grid-template-columns: minmax(170px, 1.2fr) 2fr 130px 32px; }
.repeater .rep-head { font-size: var(--fs-s); color: var(--muted); margin-bottom: 4px; }
.repeater .rep-row { margin-bottom: 8px; }
.repeater .rep-row select { padding: 7px 8px; }
.repeater .rep-row input[type=number] { text-align: right; }
.repeater .rep-del { border: 0; background: none; color: var(--muted); font-size: var(--fs-l); line-height: 1; padding: 0; cursor: pointer; }
.repeater .rep-del:hover { color: var(--bad); }
.repeater .num { text-align: right; }
.budget-total { display: grid; grid-template-columns: repeat(3, auto) 1fr; gap: 4px 22px; margin-top: 12px; padding: 12px 14px; border-radius: 0; background: var(--brand-tint); align-items: end; }
.budget-total > div { display: flex; flex-direction: column; }
.budget-total span { font-size: var(--fs-s); color: var(--muted); }
.budget-total b { font-size: var(--fs-l); font-variant-numeric: tabular-nums; }
.budget-total b.over { color: var(--warn); }
.budget-total .t-rate { grid-column: 1 / -1; }
.legacy-note { margin-top: 8px; font-size: var(--fs-m); color: var(--ink-2); background: var(--row-alt); padding: 8px 10px; border-radius: 0; }
@media (max-width: 640px) {
  .repeater .rep-head { display: none; }
  .repeater .rep-row, .repeater.budget .rep-row { grid-template-columns: 1fr 1fr 32px; }
  .repeater .rep-row > :nth-child(3) { grid-column: 1 / 3; }
  .budget-total { grid-template-columns: 1fr 1fr; }
}

/* ---------- Application detail (side panel and full page) ---------- */
.app-detail { container-type: inline-size; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; margin-bottom: 16px; }
.facts > div { background: var(--panel); border: 1px solid var(--line); border-radius: 0; padding: 8px 12px; }
.facts span { display: block; font-size: var(--fs-s); color: var(--muted); } .facts b { font-size: var(--fs-m); }
.app-cols { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
@container (max-width: 980px) { .app-cols { grid-template-columns: minmax(0, 1fr); } }
.sect-tools { text-align: right; font-size: var(--fs-s); margin: -6px 0 6px; color: var(--muted); }
details.sect > summary { list-style: none; cursor: pointer; display: flex; align-items: baseline; gap: 10px; }
details.sect > summary::-webkit-details-marker { display: none; }
details.sect > summary h2 { margin: 0; font-size: var(--fs-m); }
details.sect > summary::before { content: "▸"; color: var(--muted); transition: transform .15s; display: inline-block; }
details.sect[open] > summary::before { transform: rotate(90deg); }
details.sect[open] > summary { margin-bottom: 12px; }
details.sect h4 { margin: 14px 0 4px; font-size: var(--fs-m); color: var(--ink-2); }
details.sect h4:first-of-type { margin-top: 4px; }
.answer { line-height: 1.6; overflow-wrap: anywhere; }
.app-detail .kv { grid-template-columns: minmax(110px, 170px) minmax(0, 1fr); }
.app-detail .kv dd { overflow-wrap: anywhere; white-space: normal; }
.people { list-style: none; padding: 0; margin: 4px 0 0; display: grid; gap: 4px; }
.budget-table { width: 100%; } .budget-table tfoot th { border-top: 2px solid var(--line); }
.app-side .checks { display: flex; flex-direction: column; gap: 6px; }
.app-side .checks label { font-weight: 400; display: flex; gap: 6px; align-items: center; margin: 0; }

/* ---------- Contract template editor ---------- */
.tpl-title { width: min(640px, 100%) !important; font-size: var(--fs-l) !important; font-weight: 700; border-color: transparent !important; padding: 2px 6px !important; margin-left: -6px; background: transparent !important; }
.tpl-title:hover { border-color: var(--line) !important; }
.tpl-active { display: flex; align-items: center; gap: 4px; font-weight: 400; margin: 0 8px 0 0; }
.tpl-panes { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 1100px) { .tpl-panes { grid-template-columns: minmax(0, 1fr); } }
.tpl-toolbar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 10px; font-size: var(--fs-s); }
.tpl-toolbar .sep { width: 1px; height: 20px; background: var(--line); margin: 0 4px; }
.chip { border: 1px solid var(--line); background: var(--row-alt); border-radius: 0; padding: 3px 10px; font-size: var(--fs-s); color: var(--ink); cursor: pointer; }
.chip:hover { color: var(--brand); background: var(--brand-tint); }
#tpl-body { min-height: 60vh; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: var(--fs-m); line-height: 1.6; resize: none; overflow: hidden; }
.tpl-preview { position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow: auto; }
.tpl-preview-head { margin-bottom: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.app-field.follow-up { margin-left: 14px; padding-left: 12px; border-left: 2px solid var(--line); }
.field-note { margin-top: 6px; font-size: var(--fs-s, .8571rem); color: var(--warn); }
.ts-wrapper .ts-control, .ts-dropdown, .ts-wrapper.multi .ts-control > div { border-radius: 0 !important; }
.lang-switch { flex: 1 1 100%; } .lang-switch select { width: 100%; padding: 4px 8px; font-size: var(--fs-s); margin-bottom: var(--sp-2); }
.side .foot .row { flex-wrap: wrap; }
td select[name=role] { width: auto; min-width: 160px; padding: 4px 8px; }

/* ---------- Application scoring & dashboard ---------- */
.score-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--sp-3); }
.score-head h2 { margin: 0; }
.score-big { font-size: var(--fs-xl); font-weight: 700; font-variant-numeric: tabular-nums; }
.score-big small { font-size: var(--fs-s); font-weight: 500; color: var(--muted); }
.score-big.good { color: var(--good); } .score-big.warn { color: var(--warn); } .score-big.bad { color: var(--bad); } .score-big.none { color: var(--muted); }
.checks-list { list-style: none; padding: 0; margin: var(--sp-3) 0; display: grid; gap: 2px; font-size: var(--fs-s); }
.checks-list li::before { content: "● "; } .checks-list .good::before { color: var(--good); } .checks-list .warn::before { color: var(--warn); }
.checks-list .bad::before { color: var(--bad); } .checks-list .info::before { color: var(--muted); }
.ai-box { border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); padding: var(--sp-3) 0; margin-bottom: var(--sp-3); display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.ai-box .ai-sum { width: 100%; font-size: var(--fs-m); } .ai-box .ai-sum p { margin: var(--sp-1) 0; }
.ai-box h4 { margin: var(--sp-2) 0 2px; font-size: var(--fs-s); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.ai-box ul, .ai-box ol { margin: 0; padding-left: 18px; }
table.rubric { width: 100%; } table.rubric th, table.rubric td { padding: var(--sp-2) var(--sp-1); border-bottom: 1px solid var(--line-2); }
.rubric .crit { font-weight: 600; } .rubric .w { color: var(--muted); font-weight: 400; font-size: var(--fs-s); }
.rubric .guide { font-size: var(--fs-s); color: var(--muted); line-height: 1.4; margin-top: 2px; }
.rubric .ai-reason { font-size: var(--fs-s); color: var(--ink-2); margin-top: var(--sp-1); }
.rubric .scale, .rubric .scale-head { white-space: nowrap; width: 1%; }
.rubric .scale-head span { display: inline-block; width: 24px; text-align: center; font-weight: 500; }
.rubric .scale label { display: inline-block; margin: 0; cursor: pointer; }
.rubric .scale input { position: absolute; opacity: 0; width: 0; }
.rubric .scale label span { display: inline-block; width: 24px; height: 24px; line-height: 22px; text-align: center; border: 1px solid var(--line); margin-left: -1px; font-size: var(--fs-s); }
.rubric .scale input:checked + span { background: var(--brand-faint); color: var(--brand); font-weight: 700; }
.rubric .scale input:focus-visible + span { outline: 2px solid var(--accent-soft); }
.score-form .rec { display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: center; margin: var(--sp-3) 0 var(--sp-2); font-size: var(--fs-m); }
.score-form .rec label { font-weight: 400; display: flex; align-items: center; gap: 4px; margin: 0; }
.reviews { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--sp-2); font-size: var(--fs-m); }
.funnel { display: flex; gap: 2px; min-height: 32px; }
.funnel .seg { display: flex; align-items: center; gap: 4px; padding: 0 var(--sp-2); background: var(--line-2); color: var(--ink); font-size: var(--fs-s); white-space: nowrap; overflow: hidden; min-width: 28px; }
.funnel .seg:hover { text-decoration: none; color: var(--brand); }
.funnel .s-approved { background: var(--good-bg); } .funnel .s-rejected, .funnel .s-withdrawn { background: var(--bad-bg); }
.funnel .s-interview, .funnel .s-review { background: var(--warn-bg); } .funnel .s-new { background: var(--info-bg); }
table.ranking th.crit-col { text-align: center; width: 34px; cursor: help; }
table.ranking td.cell { text-align: center; font-variant-numeric: tabular-nums; font-size: var(--fs-s); }
td.cell.hi { background: var(--good-bg); } td.cell.mid { background: var(--line-2); } td.cell.lo { background: var(--bad-bg); }
.bar-score { width: 60px; height: 6px; background: var(--line-2); display: inline-block; margin-right: 6px; vertical-align: middle; }
.bar-score i { display: block; height: 100%; } .bar-score i.good { background: var(--good); } .bar-score i.warn { background: var(--warn); } .bar-score i.bad { background: var(--bad); }
.flag { margin-right: 3px; font-size: var(--fs-s); cursor: help; } .flag.warn { color: var(--warn); } .flag.bad { color: var(--bad); }
table.countries td { vertical-align: middle; }
.chip-app { display: inline-block; border: 1px solid var(--line); padding: 2px var(--sp-2); margin: 2px 4px 2px 0; font-size: var(--fs-s); color: var(--ink); }
.chip-app.sel { background: var(--good-bg); } .chip-app.out { color: var(--muted); text-decoration: line-through; }

.crit-legend { display: flex; flex-wrap: wrap; gap: 4px var(--sp-4); margin: var(--sp-2) 0 0; }

/* ---------- Phones: pages ---------- */
@media (max-width: 700px) {
  .head { flex-direction: column; gap: var(--sp-3); margin-bottom: var(--sp-4); }
  .head .actions { width: 100%; }
  .head .actions .btn, .head .actions button { flex: 1 1 auto; justify-content: center; }
  h1 { font-size: var(--fs-l); }
  /* stats become one swipeable row of compact boxes */
  .stats { display: flex; overflow-x: auto; gap: var(--sp-2); margin: 0 calc(-1 * var(--sp-4)) var(--sp-4); padding: 0 var(--sp-4) 2px;
    scroll-snap-type: x proximity; scrollbar-width: none; }
  .stats::-webkit-scrollbar { display: none; }
  .stat { flex: 0 0 auto; min-width: 116px; max-width: 170px; padding: var(--sp-2) var(--sp-3); scroll-snap-align: start; }
  .stat .value { font-size: var(--fs-l); }
  .stat .sub { display: none; }
  .card { padding: var(--sp-3) var(--sp-4); margin-bottom: var(--sp-3); }
  .card.flush { padding: 0; }
  th, td { padding: var(--sp-2); }
  .table-wrap, .card.flush { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .filters { flex-wrap: wrap; }
  .filters input[type=search] { flex: 1 1 100%; width: 100%; min-width: 0; }
  .filters select, .filters .ts-wrapper { flex: 1 1 0; width: auto; min-width: 0; }
  .table-wrap td, .card.flush td { white-space: nowrap; }  /* compact rows; the table scrolls sideways */
  .table-wrap td .sub, .card.flush td .sub { white-space: nowrap; }
  .tabs { overflow-x: auto; flex-wrap: nowrap; white-space: nowrap; scrollbar-width: none; }
  .kv, .app-detail .kv { grid-template-columns: 1fr; gap: 0; } .kv dt { margin-top: var(--sp-2); }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  input, select, textarea { font-size: 16px !important; }  /* stops iOS zooming into fields */
  .drawer-bar { position: sticky; top: 0; }
  .toasts { left: var(--sp-3); right: var(--sp-3); }
}
@media (max-width: 900px) { body.has-tabbar .toasts { bottom: calc(70px + env(safe-area-inset-bottom)); } }
@media (max-width: 900px) { .drawer { z-index: 90; } .drawer-bar { min-height: 52px; } }

/* ---------- App: offline / sync bar ---------- */
.net-bar { position: fixed; left: 50%; transform: translateX(-50%); top: var(--sp-2); z-index: 85; background: var(--brand-faint); color: var(--brand);
  padding: 6px var(--sp-3); font-size: var(--fs-s); max-width: calc(100vw - 24px); text-align: center; }
.net-bar a { color: inherit; text-decoration: underline; }
@media (max-width: 900px) { .net-bar { top: 56px; } }
ol.steps { padding-left: 20px; margin: 0 0 var(--sp-3); display: grid; gap: var(--sp-1); }

/* ---------- All-retreats dashboard ---------- */
.attention h2 { margin-bottom: var(--sp-2); }
.todo { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-5); }
.todo a { color: var(--brand); }
.retreat-card { color: inherit; text-decoration: none; display: block; }
.retreat-card:hover { text-decoration: none; background: var(--row-alt); }
.rc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--sp-2); }
.rc-head h2 { margin: 0 0 2px; }
.rc-nums { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-4); margin-top: var(--sp-3); font-size: var(--fs-s); color: var(--muted); }
.rc-nums b { font-size: var(--fs-l); color: var(--ink); } .rc-nums small { color: var(--muted); }
.rc-flags { display: flex; flex-wrap: wrap; gap: var(--sp-1); margin-top: var(--sp-3); }
@media (max-width: 700px) { .filters input[type=search] { min-width: 0; } }

/* ---------- View as (admins only, testing aid) ---------- */
.viewas { position: fixed; top: 0; left: 50%; transform: translateX(-50%); z-index: 95; font-size: var(--fs-s); }
.viewas-pill { background: var(--panel); color: var(--muted); border: 1px solid var(--line); border-top: 0; padding: 2px var(--sp-3); cursor: default; }
.viewas.on .viewas-pill { background: var(--brand-faint); color: var(--brand); font-weight: 600; }
.viewas-menu { display: none; position: absolute; top: 100%; left: 50%; transform: translateX(-50%); min-width: 280px; background: var(--panel);
  border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(0,0,0,.14); padding: var(--sp-2) 0; }
.viewas:hover .viewas-menu, .viewas:focus-within .viewas-menu { display: block; }
.viewas-title { padding: var(--sp-1) var(--sp-3); font-size: var(--fs-s); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.viewas-menu button, .viewas-menu a { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 6px var(--sp-3); color: var(--ink); font-size: var(--fs-m); }
.viewas-menu button:hover, .viewas-menu a:hover { background: var(--brand-tint); color: var(--brand); text-decoration: none; }
.viewas-menu .cur { color: var(--brand); font-weight: 600; }
.viewas-note { padding: 4px var(--sp-3) 6px; color: var(--muted); font-size: var(--fs-s); }
.viewas-menu { max-height: 70vh; overflow-y: auto; }
.viewas-menu small { color: var(--muted); font-weight: 400; }
@media (max-width: 900px) { .viewas { top: 52px; } .viewas-pill { border-top: 1px solid var(--line); } }

.stat .value .unit { font-size: var(--fs-s); font-weight: 500; color: var(--muted); letter-spacing: 0; }

/* autosaved drafts: offer to restore unsaved input */
.draft-bar { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; margin: 0 0 var(--sp-3); padding: var(--sp-2) var(--sp-3);
  background: var(--brand-faint); color: var(--ink); font-size: var(--fs-s); }
.draft-bar span { flex: 1; min-width: 200px; }

/* Gatherings: check-in list, meals table, question threads */
.checkin-list { list-style: none; margin: 0; padding: 0; }
.checkin-list li { border-top: 1px solid var(--line-2); }
.checkin-list li:first-child { border-top: 0; }
.checkin-list form { margin: 0; }
.checkin-btn { display: flex; width: 100%; align-items: center; gap: 14px; padding: 14px 16px; border: 0; background: none; text-align: left; font-size: var(--fs-l); cursor: pointer; }
.checkin-btn:hover { background: var(--brand-tint); color: var(--ink); }
.checkin-box { width: 30px; height: 30px; flex: 0 0 30px; display: inline-flex; align-items: center; justify-content: center; border: 2px solid var(--line); color: transparent; font-weight: 700; }
.checkin-list li.in .checkin-box { background: var(--good-bg); border-color: var(--good); color: var(--good); }
.checkin-list li.in .checkin-name b { color: var(--good); }
.checkin-name { flex: 1; }
.checkin-name .sub { display: block; font-size: var(--fs-s); }
.quick-table input, .quick-table select { width: 100%; min-width: 90px; }
.thread-list { list-style: none; margin: 0; padding: 0; }
.thread-list li a { display: block; padding: 12px 16px; border-top: 1px solid var(--line-2); color: var(--ink); text-decoration: none; }
.thread-list li.on a, .thread-list li a:hover { background: var(--brand-tint); }
.thread-list .sub { display: block; }
.note-team { border-left: 3px solid var(--brand); padding-left: 10px; }
.faq-edit { border-top: 1px solid var(--line-2); padding: 8px 0; }
.faq-edit summary { cursor: pointer; }
.faq-edit form { display: grid; gap: 6px; margin-top: 8px; }

/* Admin planning dashboard (retreats/_planning.html) */
.rag { display: inline-block; width: 10px; height: 10px; margin-right: 6px; vertical-align: 0; background: var(--line); }
.rag.red { background: var(--bad); } .rag.amber { background: var(--warn); } .rag.green { background: var(--good); } .rag.done { background: var(--muted); opacity: .5; }
.planning td { vertical-align: top; }
.planning .sub { display: block; margin-top: 3px; }
.reason-red { color: var(--bad); font-weight: 600; }
.attention-list li.tone-bad a, .attention-list li.tone-bad { color: var(--bad); }
