/* ============================================================================
   Corona — content plan & brief hub
   Design tokens + shared components.

   Palette: warm neutral paper surfaces with a single ochre accent
   (corona = halo, and the content is editorial — cool grey/indigo would read
   as generic SaaS). One accent only; status colours carry the meaning.
   Type: Inter for the dense workspace, Source Serif 4 for document headings
   on the published side.
   ========================================================================= */

:root {
  color-scheme: light;

  --bg: #faf9f7;
  --surface: #ffffff;
  --sunken: #f3f1ec;
  --sunken-2: #ece9e2;

  --ink: #1a1917;
  --ink-2: #57534d;
  --muted: #8a857c;
  --faint: #a8a29a;

  --border: #e7e3db;
  --border-strong: #d6d1c6;

  --accent: #b45309;
  --accent-hover: #92400e;
  --accent-soft: #fdf3e3;
  --accent-line: #f0d6a8;

  --danger: #b91c1c;
  --danger-soft: #fdecec;
  --ok: #15803d;
  --ok-soft: #e9f6ee;

  --shadow-1: 0 1px 2px rgba(26, 25, 23, 0.05);
  --shadow-2: 0 2px 8px rgba(26, 25, 23, 0.07), 0 1px 2px rgba(26, 25, 23, 0.05);
  --shadow-3: 0 12px 32px rgba(26, 25, 23, 0.14), 0 2px 6px rgba(26, 25, 23, 0.07);

  --r-sm: 6px;
  --r: 10px;
  --r-lg: 14px;

  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --serif: 'Source Serif 4', 'Iowan Old Style', Georgia, 'Times New Roman', serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;

  --rail: 236px;
  --topbar: 56px;
}

:root[data-theme='dark'] {
  color-scheme: dark;

  --bg: #131211;
  --surface: #1c1b18;
  --sunken: #201f1c;
  --sunken-2: #262420;

  --ink: #f2efe9;
  --ink-2: #bcb6aa;
  --muted: #918b80;
  --faint: #736d63;

  --border: #2e2c28;
  --border-strong: #3d3a34;

  --accent: #f0a03c;
  --accent-hover: #f7b45f;
  --accent-soft: rgba(240, 160, 60, 0.13);
  --accent-line: rgba(240, 160, 60, 0.32);

  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, 0.12);
  --ok: #4ade80;
  --ok-soft: rgba(74, 222, 128, 0.12);

  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-2: 0 2px 8px rgba(0, 0, 0, 0.45);
  --shadow-3: 0 14px 36px rgba(0, 0, 0, 0.55);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'cv05' 1, 'tnum' 0;
}

h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.011em; }
p { margin: 0; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--accent); color: #fff; padding: 8px 14px;
  border-radius: var(--r-sm); text-decoration: none; transition: top .15s;
}
.skip-link:focus { top: 12px; }

/* ── generic ───────────────────────────────────────────────────────────── */

.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.spacer { flex: 1 1 auto; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack.tight { gap: 6px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hidden { display: none !important; }

.eyebrow {
  font-size: 11px; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted);
}

/* ── buttons ───────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 34px; padding: 6px 12px;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--border-strong); border-radius: var(--r-sm);
  font-size: 13px; font-weight: 500; text-decoration: none;
  cursor: pointer; transition: background .12s, border-color .12s, color .12s;
  white-space: nowrap;
}
.btn:hover { background: var(--sunken); }
.btn:active { transform: translateY(0.5px); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.btn-primary {
  background: var(--accent); border-color: var(--accent); color: #fff;
}
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
:root[data-theme='dark'] .btn-primary { color: #1a1917; }

.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--sunken); color: var(--ink); }

.btn-danger { color: var(--danger); border-color: var(--border-strong); }
.btn-danger:hover { background: var(--danger-soft); border-color: var(--danger); }

.btn-sm { min-height: 28px; padding: 3px 9px; font-size: 12.5px; }
.btn-lg { min-height: 40px; padding: 9px 18px; font-size: 14px; }

.btn-icon {
  width: 34px; padding: 0; min-height: 34px;
  background: transparent; border-color: transparent; color: var(--ink-2);
}
.btn-icon:hover { background: var(--sunken); }
.btn-icon.sm { width: 26px; min-height: 26px; }

/* ── form controls ─────────────────────────────────────────────────────── */

.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > label, .label {
  font-size: 12px; font-weight: 600; color: var(--ink-2); letter-spacing: .006em;
}
.field .hint { font-size: 11.5px; color: var(--muted); }

.input, .select, .textarea {
  width: 100%; min-height: 36px; padding: 7px 10px;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--border-strong); border-radius: var(--r-sm);
  transition: border-color .12s, box-shadow .12s;
}
.input:hover, .select:hover, .textarea:hover { border-color: var(--muted); }
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.textarea { min-height: 84px; resize: vertical; line-height: 1.55; }
.textarea.tall { min-height: 150px; }
.input[readonly] { background: var(--sunken); color: var(--ink-2); }

.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5' fill='none' stroke='%238a857c' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
  padding-right: 28px;
}

.search {
  position: relative; display: flex; align-items: center;
}
.search .input { padding-left: 30px; }
.search svg { position: absolute; left: 10px; color: var(--muted); pointer-events: none; }

.switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track {
  width: 38px; height: 22px; border-radius: 999px; background: var(--sunken-2);
  border: 1px solid var(--border-strong); position: relative; transition: background .15s;
  flex: none;
}
.switch .track::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px;
  background: #fff; border-radius: 50%; box-shadow: var(--shadow-1); transition: transform .15s;
}
.switch input:checked + .track { background: var(--accent); border-color: var(--accent); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ── chips, pills, badges ──────────────────────────────────────────────── */

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 28px; padding: 3px 10px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 999px; font-size: 12.5px; color: var(--ink-2);
  cursor: pointer; user-select: none; transition: background .12s, border-color .12s, color .12s;
}
.chip:hover { border-color: var(--border-strong); background: var(--sunken); }
.chip[aria-pressed='true'] {
  background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent);
  font-weight: 500;
}
:root[data-theme='dark'] .chip[aria-pressed='true'] { color: var(--accent); }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 8px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; letter-spacing: .01em;
  background: var(--sunken); color: var(--ink-2); border: 1px solid transparent;
}
.pill .dot { width: 6px; height: 6px; border-radius: 50%; flex: none; }

.status-pill { border-color: var(--border); }
.status-pill .dot { background: currentColor; }

.tag {
  display: inline-block; padding: 2px 7px; border-radius: 4px;
  font-size: 11.5px; background: var(--sunken); color: var(--ink-2);
  border: 1px solid var(--border);
}

/* ── cards & surfaces ─────────────────────────────────────────────────── */

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); box-shadow: var(--shadow-1);
}
.card-pad { padding: 16px; }
.card-head {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
}
.card-head h3 { font-size: 13.5px; }

.hairline { height: 1px; background: var(--border); border: 0; margin: 0; }

/* ── topbar ───────────────────────────────────────────────────────────── */

.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 14px;
  height: var(--topbar); padding: 0 20px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; }
.brand .mark {
  width: 28px; height: 28px; flex: none; border-radius: 8px;
  background: var(--accent); color: #fff; display: grid; place-items: center;
}
:root[data-theme='dark'] .brand .mark { color: #1a1917; }
.brand .name { font-weight: 600; font-size: 14.5px; letter-spacing: -0.01em; }
.brand .sub { font-size: 11.5px; color: var(--muted); }

.navlink {
  padding: 5px 10px; border-radius: var(--r-sm); font-size: 13px;
  color: var(--ink-2); text-decoration: none; font-weight: 500;
}
.navlink:hover { background: var(--sunken); color: var(--ink); }
.navlink[aria-current='page'] { color: var(--ink); background: var(--sunken); }

/* ── layout shells ────────────────────────────────────────────────────── */

.shell { display: grid; grid-template-columns: var(--rail) 1fr; min-height: calc(100vh - var(--topbar)); }

/* Signed out: the workspace shell keeps the root, the rail goes away and the
   sign-in card takes the whole surface. */
.shell.auth-mode { grid-template-columns: 1fr; }
.shell.auth-mode .rail { display: none; }

.rail {
  border-right: 1px solid var(--border); background: var(--bg);
  padding: 14px 10px; position: sticky; top: var(--topbar);
  height: calc(100vh - var(--topbar)); overflow-y: auto;
  display: flex; flex-direction: column; gap: 14px;
}
.rail-section { display: flex; flex-direction: column; gap: 2px; }
.rail-label { padding: 6px 10px 4px; }
.rail-item {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 10px; border-radius: var(--r-sm);
  font-size: 13px; color: var(--ink-2); text-decoration: none;
  border: 1px solid transparent; cursor: pointer; background: none; text-align: left;
  width: 100%; min-height: 34px;
}
.rail-item:hover { background: var(--sunken); color: var(--ink); }
.rail-item[aria-current='true'] {
  background: var(--surface); border-color: var(--border);
  color: var(--ink); font-weight: 500; box-shadow: var(--shadow-1);
}
.rail-item .count { margin-left: auto; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

.main { padding: 22px 26px 80px; max-width: 1500px; min-width: 0; }
.page-head { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { font-size: 20px; letter-spacing: -0.018em; }
.page-head .sub { color: var(--muted); font-size: 13px; margin-top: 2px; }

.toolbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 10px 0;
}
.toolbar.bordered { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

/* ── stats ────────────────────────────────────────────────────────────── */

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.stat {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); padding: 12px 14px;
}
.stat .k { font-size: 11.5px; color: var(--muted); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.stat .v { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; margin-top: 2px; }
.stat .d { font-size: 12px; color: var(--muted); }

.bar { height: 6px; border-radius: 999px; background: var(--sunken-2); overflow: hidden; display: flex; }
.bar > span { display: block; height: 100%; }

/* ── calendar ─────────────────────────────────────────────────────────── */

.cal { border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); overflow: hidden; }
.cal-dow {
  display: grid; grid-template-columns: repeat(7, 1fr);
  background: var(--sunken); border-bottom: 1px solid var(--border);
}
.cal-dow div {
  padding: 7px 10px; font-size: 11.5px; font-weight: 600;
  color: var(--muted); text-transform: uppercase; letter-spacing: .05em;
}
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-day {
  min-height: 116px; padding: 6px 6px 8px;
  border-right: 1px solid var(--border); border-bottom: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 4px; min-width: 0;
}
.cal-day:nth-child(7n) { border-right: 0; }
.cal-day.out { background: var(--sunken); }
.cal-day.out .cal-date { color: var(--faint); }
.cal-day.today { background: var(--accent-soft); }
.cal-day.today .cal-date { color: var(--accent); font-weight: 700; }
.cal-day.dragover { background: var(--accent-soft); outline: 2px dashed var(--accent); outline-offset: -3px; }
.cal-date {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; font-weight: 600; color: var(--ink-2);
  font-variant-numeric: tabular-nums; padding: 1px 3px;
}
.cal-date .addone {
  border: 0; background: none; color: var(--muted); cursor: pointer;
  font-size: 15px; line-height: 1; padding: 0 3px; border-radius: 4px; opacity: 0;
}
.cal-day:hover .cal-date .addone { opacity: 1; }
.cal-date .addone:hover { background: var(--sunken-2); color: var(--accent); }

.cal-item {
  display: flex; align-items: flex-start; gap: 6px;
  padding: 5px 7px; border-radius: var(--r-sm);
  background: var(--sunken); border: 1px solid var(--border);
  font-size: 12px; line-height: 1.35; cursor: pointer; text-align: left;
  width: 100%; min-height: 26px;
}
.cal-item:hover { background: var(--sunken-2); border-color: var(--border-strong); }
.cal-item[draggable='true'] { cursor: grab; }
.cal-item.dragging { opacity: .45; }
.cal-item .rail-dot { width: 3px; align-self: stretch; border-radius: 2px; flex: none; background: var(--muted); }
.cal-item .body { min-width: 0; flex: 1; }
.cal-item .t { font-weight: 500; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-item .m { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 11px; margin-top: 1px; }
.cal-item.is-draft { opacity: .72; }
.cal-item .lock { color: var(--muted); flex: none; margin-top: 2px; }

/* ── board ────────────────────────────────────────────────────────────── */

.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(240px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 12px; }
.board-col {
  background: var(--sunken); border: 1px solid var(--border); border-radius: var(--r);
  display: flex; flex-direction: column; min-height: 220px; min-width: 0;
}
.board-col.dragover { outline: 2px dashed var(--accent); outline-offset: -3px; background: var(--accent-soft); }
.board-col-head {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px;
  border-bottom: 1px solid var(--border); position: sticky; top: 0;
  background: var(--sunken); border-radius: var(--r) var(--r) 0 0; z-index: 1;
}
.board-col-head .n { margin-left: auto; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.board-col-body { padding: 8px; display: flex; flex-direction: column; gap: 7px; flex: 1; }
.board-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-sm);
  padding: 9px 10px; box-shadow: var(--shadow-1); cursor: grab; text-align: left; width: 100%;
  display: flex; flex-direction: column; gap: 5px;
}
.board-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-2); }
.board-card.dragging { opacity: .45; }
.board-card .t { font-size: 12.5px; font-weight: 500; line-height: 1.35; }
.board-card .m { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 11px; color: var(--muted); }
.board-empty { padding: 16px 12px; font-size: 12px; color: var(--faint); text-align: center; }

/* ── table ────────────────────────────────────────────────────────────── */

.table-wrap { border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); overflow: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl th {
  text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); font-weight: 600; padding: 9px 12px;
  background: var(--sunken); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 1; white-space: nowrap;
}
table.tbl td { padding: 8px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.tbl tbody tr:hover { background: var(--sunken); }
table.tbl tbody tr:last-child td { border-bottom: 0; }
table.tbl td.tight { width: 1%; white-space: nowrap; }
table.tbl .cell-input {
  width: 100%; min-height: 28px; padding: 4px 6px; font-size: 12.5px;
  background: transparent; border: 1px solid transparent; border-radius: 5px;
}
table.tbl .cell-input:hover { border-color: var(--border-strong); background: var(--surface); }
table.tbl .cell-input:focus { outline: none; border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 3px var(--accent-soft); }
.cell-btn { cursor: pointer; text-align: left; font-size: 12.5px; }

/* ── empty states ─────────────────────────────────────────────────────── */

.empty {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  text-align: center; padding: 46px 24px; color: var(--muted);
  border: 1px dashed var(--border-strong); border-radius: var(--r); background: var(--surface);
}
.empty h3 { color: var(--ink); font-size: 15px; }
.empty p { max-width: 44ch; font-size: 13px; }
.empty .mark { width: 38px; height: 38px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }

/* ── drawer (brief editor) ────────────────────────────────────────────── */

.scrim {
  position: fixed; inset: 0; background: rgba(20, 18, 15, .42);
  opacity: 0; pointer-events: none; transition: opacity .18s; z-index: 60;
}
.scrim.open { opacity: 1; pointer-events: auto; }

.drawer {
  position: fixed; top: 0; right: 0; height: 100%; width: min(760px, 100%);
  background: var(--bg); border-left: 1px solid var(--border);
  box-shadow: var(--shadow-3); z-index: 61;
  display: flex; flex-direction: column;
  transform: translateX(102%); transition: transform .22s cubic-bezier(.32, .72, 0, 1);
}
.drawer.open { transform: none; }
.drawer-head {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px;
  border-bottom: 1px solid var(--border); background: var(--surface);
}
.drawer-body { overflow-y: auto; padding: 18px 20px 120px; }
.drawer-foot {
  position: absolute; bottom: 0; left: 0; right: 0;
  display: flex; align-items: center; gap: 10px; padding: 12px 16px;
  border-top: 1px solid var(--border); background: var(--surface);
}

.section { margin-bottom: 20px; }
.section-head {
  display: flex; align-items: center; gap: 8px; margin-bottom: 10px;
  padding-bottom: 6px; border-bottom: 1px solid var(--border);
}
.section-head h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.grid-span { grid-column: 1 / -1; }

/* ── brief sheet (published) ──────────────────────────────────────────── */

/* The document is centred at a comfortable measure: on a wide screen the gutters
   are intentional margin, not an unfinished right-hand column. */
.sheet-wrap, .doc-actions { max-width: 880px; margin-left: auto; margin-right: auto; }

.sheet {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 38px 44px; max-width: 880px; margin: 0 auto;
  box-shadow: var(--shadow-2);
}
.sheet-brand {
  font-size: 11.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 12px;
}
.sheet h1 {
  font-family: var(--serif); font-weight: 600; font-size: 32px;
  letter-spacing: -0.015em; line-height: 1.15; margin-bottom: 8px;
  text-wrap: balance;
}
.sheet .lede { font-size: 16px; color: var(--ink-2); max-width: 60ch; line-height: 1.6; }
.sheet-meta {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px 22px; margin: 24px 0 10px; padding-bottom: 4px;
}
.sheet-meta .k { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 600; }
.sheet-meta .v { font-size: 13.5px; margin-top: 4px; }
.sheet-section { padding-top: 20px; margin-top: 20px; border-top: 1px solid var(--border); }
.sheet-section h2 {
  font-family: var(--serif); font-size: 19px; font-weight: 600;
  letter-spacing: -0.005em; margin-bottom: 8px;
}
.sheet-section .body { font-size: 15px; line-height: 1.68; color: var(--ink-2); white-space: pre-wrap; max-width: 68ch; }
.sheet-section .body.strong { color: var(--ink); font-size: 16px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.caption-box {
  background: var(--sunken); border: 1px solid var(--border); border-radius: var(--r);
  padding: 14px 16px; white-space: pre-wrap; font-size: 14px; line-height: 1.62; max-width: 68ch;
}
.list-check { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.list-check li { display: flex; gap: 9px; font-size: 14px; color: var(--ink-2); }
.list-check li::before { content: ''; flex: none; width: 5px; height: 5px; margin-top: 8px; border-radius: 50%; background: var(--accent); }

/* ── filter bar ───────────────────────────────────────────────────────── */

.filters {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 10px 0 14px;
}
.filters .search { min-width: 210px; flex: 1 1 210px; max-width: 320px; }

.viewtabs {
  display: inline-flex; padding: 3px; gap: 2px;
  background: var(--sunken); border: 1px solid var(--border); border-radius: 8px;
}
.viewtabs button {
  border: 0; background: none; padding: 5px 11px; border-radius: 6px;
  font-size: 12.5px; font-weight: 500; color: var(--ink-2); cursor: pointer;
}
.viewtabs button[aria-selected='true'] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }

/* ── toast ────────────────────────────────────────────────────────────── */

.toasts {
  position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; gap: 8px; z-index: 90; align-items: center;
  pointer-events: none;
}
.toast {
  background: var(--ink); color: var(--bg); padding: 9px 15px; border-radius: 999px;
  font-size: 13px; box-shadow: var(--shadow-3); animation: toast-in .18s ease-out;
}
.toast.err { background: var(--danger); color: #fff; }
.toast.ok { background: var(--ok); color: #fff; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ── login ────────────────────────────────────────────────────────────── */

.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-3); padding: 30px 28px; }
.auth-card .mark { width: 40px; height: 40px; border-radius: 11px; background: var(--accent); color: #fff; display: grid; place-items: center; margin: 0 auto 14px; }
:root[data-theme='dark'] .auth-card .mark { color: #1a1917; }
.auth-card h1 { font-size: 18px; text-align: center; }
.auth-card .sub { text-align: center; color: var(--muted); font-size: 13px; margin: 4px 0 20px; }
/* The form fields are the only interactive elements here, so give the borders
   enough contrast to be found without hunting. */
.auth-card .input { border-color: var(--faint); }
.alert { padding: 9px 12px; border-radius: var(--r-sm); font-size: 13px; border: 1px solid transparent; }
.alert.err { background: var(--danger-soft); color: var(--danger); border-color: currentColor; }
.alert.ok { background: var(--ok-soft); color: var(--ok); border-color: currentColor; }
.alert.info { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-line); }

/* ── list rows (published list view) ──────────────────────────────────── */

.rows { display: flex; flex-direction: column; }
.prow {
  display: grid; grid-template-columns: 92px 1fr auto; gap: 14px; align-items: center;
  padding: 13px 16px; border-bottom: 1px solid var(--border);
  text-decoration: none; cursor: pointer;
}
.prow:last-child { border-bottom: 0; }
.prow:hover { background: var(--sunken); }
.prow .date { font-variant-numeric: tabular-nums; color: var(--ink-2); font-size: 12.5px; }
.prow .date .d { font-weight: 600; color: var(--ink); display: block; font-size: 13px; }
.prow .title { font-weight: 500; font-size: 13.5px; }
.prow .meta { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-top: 3px; }

/* ── responsive ───────────────────────────────────────────────────────── */

@media (max-width: 1080px) {
  .shell { grid-template-columns: 1fr; }
  .rail { position: static; height: auto; flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--border); }
  .rail-section { flex-direction: row; }
  .rail-label { display: none; }
  .main { padding: 18px 16px 70px; }
}

@media (max-width: 720px) {
  .grid-2, .grid-3, .grid-4, .two-col { grid-template-columns: 1fr; }
  .cal-day { min-height: 78px; }
  .cal-item .m { display: none; }
  .sheet { padding: 22px 18px; }
  .sheet h1 { font-size: 24px; }
  .prow { grid-template-columns: 1fr; gap: 4px; }
  .topbar { padding: 0 12px; gap: 8px; }
  .drawer-body { padding: 14px 14px 120px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ── print: the brief sheet and the calendar become a PDF ─────────────── */

@media print {
  :root { --bg: #fff; --surface: #fff; --ink: #000; --ink-2: #333; --muted: #666; --border: #ddd; }
  .topbar, .rail, .toolbar, .filters, .no-print, .drawer, .scrim, .toasts { display: none !important; }
  .main { padding: 0; max-width: none; }
  .shell { display: block; }
  .sheet, .card, .cal { border: 0; box-shadow: none; border-radius: 0; padding: 0; }
  .sheet-section { break-inside: avoid; }
  a { text-decoration: none; }
  .cal-day { min-height: 92px; }
  body { font-size: 11pt; }
}
