/* Project Roria staff site. One stylesheet for every page. Tokens come from the approved design (STYLE.md).
   The CSP (public/_headers) blocks inline styles, so every style lives here; scripts only set CSS variables. */

:root {
  --sky-400: #4a86ea; --sky-600: #2c5fd6; --sky-800: #1d3f9e; --sky-100: #e8effc;
  --canvas: #f4f7fd; --surface: #fff; --line: #dbe4f5; --line-input: #c6d4f0;
  --ink: #141821; --ink-2: #4a5568; --ink-3: #5b6577;
  --gold: #ffc61a; --gold-edge: #d9a400; --gold-100: #fff1c2; --gold-900: #7a4d00;
  --green-100: #dcf5e4; --green-900: #14532d; --green: #2f9442;
  /* Not in STYLE.md: errors and the "Security" badge only. */
  --red-100: #fde4e7; --red-900: #8a1424;
  --p-critical: #d42a3c; --p-high: #e5661c; --p-medium: #d39400; --p-low: #8a94a4;
  --shadow-sm: 0 1px 2px rgba(20, 40, 90, .08);
  --shadow-md: 0 4px 12px rgba(20, 40, 90, .14);
  --shadow-lg: 0 12px 32px rgba(20, 40, 90, .22);
  --font-body: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Baloo 2", system-ui, -apple-system, "Segoe UI", sans-serif;
  --sidebar-w: 248px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html.drawer-open { overflow: hidden; }
body {
  margin: 0; background: var(--canvas); color: var(--ink);
  font: 400 14px/20px var(--font-body);
}
[hidden] { display: none !important; }
h1, h2, h3, p, ul, ol, blockquote, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--sky-600); }
a:hover { color: var(--sky-800); }
img { display: block; }
svg { flex: none; }

:focus-visible { outline: 3px solid var(--sky-600); outline-offset: 2px; }
.sidebar :focus-visible { outline-color: var(--gold); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: 16px; top: -48px; z-index: 100; padding: 8px 16px; border-radius: 999px;
  background: var(--gold); color: var(--ink); font-weight: 700; text-decoration: none;
}
.skip:focus { top: 16px; }

/* ---------- type ---------- */
.display { font: 800 32px/40px var(--font-display); }
.title { font: 700 20px/28px var(--font-display); }
.heading { font: 700 18px/24px var(--font-display); }
.label { font-weight: 700; }
.small { font-size: 12px; line-height: 16px; font-weight: 700; }
.muted { color: var(--ink-3); }
.ink-2 { color: var(--ink-2); }

/* ---------- controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: 999px; border: 2px solid transparent;
  font-weight: 700; font-size: 14px; line-height: 20px; text-decoration: none; white-space: nowrap;
  cursor: pointer; background: none; color: var(--ink);
}
.btn:hover { filter: brightness(.96); color: var(--ink); }
.btn:disabled { cursor: not-allowed; opacity: .55; filter: none; }
.btn-gold {
  padding: 0 20px; background: var(--gold); border: 1px solid var(--gold-edge); color: var(--ink);
  font: 700 16px/24px var(--font-display);
}
.btn-gold.has-icon { padding: 0 20px 0 16px; }
.btn-secondary { background: var(--surface); border-color: var(--line-input); }
.btn-white { background: #fff; color: var(--ink); border: 0; }
.btn-danger { background: var(--surface); border-color: var(--line-input); color: var(--red-900); }
.btn-danger:hover { color: var(--red-900); }
.btn-lg { height: 48px; padding: 0 24px; font: 700 18px/24px var(--font-display); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 14px; }
.btn-white.btn-sm { padding: 0 16px; }
.btn-block { width: 100%; }
.btn-icon { width: 32px; height: 32px; padding: 0; border-radius: 999px; background: var(--surface); border: 2px solid var(--line-input); }
.link-btn {
  padding: 0; border: 0; background: none; color: var(--sky-600); font-weight: 700; cursor: pointer;
  text-decoration: underline; text-underline-offset: 2px; text-align: left;
}
.link-btn:hover { color: var(--sky-800); }

.input, .select, .textarea {
  width: 100%; height: 40px; padding: 0 12px; border-radius: 12px;
  background: var(--canvas); border: 2px solid var(--line-input); color: var(--ink); font-weight: 600;
}
.input:focus-visible, .select:focus-visible, .textarea:focus-visible { border-color: var(--sky-600); }
.input:disabled, .select:disabled, .textarea:disabled { opacity: .7; cursor: not-allowed; }
.textarea { height: auto; min-height: 64px; padding: 8px 12px; resize: vertical; line-height: 20px; font-weight: 400; }
/* The reply box: 64px at rest like the design, grows with what's typed where the browser can. */
.textarea-grow { resize: none; field-sizing: content; max-height: 240px; }
.select {
  appearance: none; padding-right: 36px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%234a5568' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.field { display: flex; flex-direction: column; gap: 8px; }
.field > label, .field-label { font-weight: 700; }
.hint { color: var(--ink-3); font-size: 12px; line-height: 16px; font-weight: 600; }
.error-text { color: var(--red-900); font-weight: 600; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 0; accent-color: var(--sky-600); }
.check input:disabled + span { opacity: .6; }

kbd {
  display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 4px;
  border-radius: 4px; border: 1px solid var(--line-input); border-bottom-width: 2px; background: var(--surface);
  color: var(--ink-2); font: 700 12px/16px var(--font-body);
}

/* chips, badges, pills, avatar */
.chip {
  display: inline-flex; align-items: center; gap: 4px; max-width: 100%; padding: 2px 8px; border-radius: 8px;
  background: var(--canvas); border: 1px solid var(--line); color: var(--ink-2);
  font-size: 12px; line-height: 16px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.role-chip { border-radius: 999px; border-color: transparent; background: var(--chip-bg, var(--sky-100)); color: var(--chip-fg, var(--sky-800)); }
.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; border: 1px solid transparent;
  font-size: 12px; line-height: 16px; font-weight: 700; white-space: nowrap;
}
.badge-public { background: var(--sky-100); color: var(--sky-800); }
.badge-tester { background: var(--gold-100); color: var(--gold-900); }
.badge-board, .badge-closed { background: var(--canvas); color: var(--ink-2); border-color: var(--line); }
.badge-secret { background: var(--red-100); color: var(--red-900); }
.badge-fixed { background: var(--green-100); color: var(--green-900); }
.pill {
  display: inline-flex; align-items: center; justify-content: center; min-width: 24px; padding: 2px 8px; border-radius: 999px;
  background: var(--surface); color: var(--sky-800); font: 700 12px/16px var(--font-body);
}
.avatar {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 24px; height: 24px; border-radius: 50%; overflow: hidden; object-fit: cover;
  background: var(--sky-100); color: var(--sky-800); font-size: 12px; line-height: 16px; font-weight: 700;
}
.avatar-lg { width: 32px; height: 32px; }
.prio { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; color: var(--ink-2); font-size: 12px; line-height: 16px; }
.prio::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--p-low); }
.prio-critical::before { background: var(--p-critical); }
.prio-high::before { background: var(--p-high); }
.prio-medium::before { background: var(--p-medium); }
.prio-lg { gap: 8px; font-size: 14px; line-height: 20px; font-weight: 600; color: var(--ink); }

/* ---------- app shell ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 24px;
  padding: 24px 16px; background: var(--sky-600); color: #fff;
}
.wordmark { padding: 0 16px; font: 800 26px/28px var(--font-display); color: #fff; text-decoration: none; }
.wordmark:hover { color: #fff; }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-link {
  display: flex; align-items: center; gap: 12px; height: 44px; padding: 0 16px; border-radius: 999px;
  color: #fff; text-decoration: none; font: 700 16px/24px var(--font-body);
}
.nav-link:hover { color: #fff; background: var(--sky-800); }
.nav-link[aria-current="page"], .nav-link[aria-current="page"]:hover { background: #fff; color: var(--sky-800); }
.nav-pill {
  margin-left: auto; padding: 2px 8px; border-radius: 999px; background: var(--sky-100);
  color: var(--sky-800); font-size: 12px; line-height: 16px; font-weight: 700;
}
.account {
  margin-top: auto; display: flex; flex-direction: column; gap: 12px;
  padding: 16px; border-radius: 16px; background: var(--sky-800);
}
.account-who { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.account-id { display: flex; align-items: center; gap: 8px; min-width: 0; }
.account-name { min-width: 0; font-weight: 700; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-role { display: flex; flex: none; min-width: 0; max-width: 60%; }

.main { display: flex; flex-direction: column; gap: 16px; padding: 24px 32px; min-width: 0; outline: none; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; min-height: 40px; }
.page-title { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.page-count { font-weight: 600; color: var(--ink-3); white-space: nowrap; }
.page-actions { display: flex; align-items: center; gap: 8px; }
.page-intro { color: var(--ink-2); }
.state-box {
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 40px 24px; text-align: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; color: var(--ink-2);
}
.state-box .state-title { font-weight: 700; color: var(--ink); }

/* ---------- board ---------- */
/* The board page fills the window: the columns scroll on their own and the hints stay at the bottom. */
.shell-fixed { height: 100vh; height: 100dvh; }
.shell-fixed .main { min-height: 0; }

.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.search { position: relative; width: 280px; max-width: 100%; }
.search .input { padding: 0 40px 0 36px; background: var(--surface); }
.search svg { position: absolute; left: 12px; top: 12px; color: var(--ink-3); pointer-events: none; }
.search kbd { position: absolute; right: 12px; top: 10px; }
.menu { position: relative; }
.filter { padding: 0 12px 0 16px; }
.filter > span { max-width: 200px; overflow: hidden; text-overflow: ellipsis; }
.filter.is-set, .toggle[aria-pressed="true"] { background: var(--sky-100); border-color: var(--sky-600); color: var(--sky-800); }
.listbox {
  position: absolute; top: calc(100% + 4px); left: 0; z-index: 30; min-width: max(100%, 200px); max-height: 320px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 2px; padding: 4px; outline: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-md);
}
.listbox:focus-visible { outline: 3px solid var(--sky-600); outline-offset: 2px; }
.option {
  display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 8px 12px; border-radius: 8px;
  font-weight: 600; white-space: nowrap; cursor: pointer;
}
.option:hover { background: var(--canvas); }
.option.active { background: var(--sky-100); color: var(--sky-800); }
.option[aria-selected="true"] { font-weight: 700; }
.option .tick { margin-left: auto; color: var(--sky-600); visibility: hidden; }
.option[aria-selected="true"] .tick { visibility: visible; }
.option .prio { font-size: 14px; line-height: 20px; font-weight: inherit; color: inherit; gap: 8px; }
.switch {
  margin-left: auto; display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 4px;
  border: 0; border-radius: 999px; background: transparent; color: var(--ink); font-weight: 700; white-space: nowrap; cursor: pointer;
}
.switch:hover { filter: brightness(.96); }
.switch-track { position: relative; flex: none; width: 36px; height: 20px; border-radius: 999px; background: var(--line-input); transition: background .15s; }
.switch-track::after {
  content: ""; position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgba(20, 40, 90, .2); transition: transform .15s;
}
.switch[aria-checked="true"] .switch-track { background: var(--sky-600); }
.switch[aria-checked="true"] .switch-track::after { transform: translateX(16px); }
.switch-count { margin-left: -4px; color: var(--ink-3); font-weight: 600; }

.board {
  flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: minmax(0, 1fr); gap: 12px;
}
.board > .state-box { grid-column: 1 / -1; align-self: start; }
.column {
  display: flex; flex-direction: column; gap: 8px; min-width: 0; min-height: 0; padding: 8px; overflow: hidden;
  border-radius: 16px; background: var(--sky-100); border: 2px solid transparent;
}
.column.drop-target { border-color: var(--sky-600); border-style: dashed; }
.column-head { display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 8px; flex: none; }
.column-head h2 { flex: 1; min-width: 0; font: 700 18px/24px var(--font-display); }
/* The cards scroll inside the column. The padding/negative margin pair keeps the focus ring and hover shadow unclipped. */
.cards {
  flex: 1 1 auto; min-height: 40px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px;
  margin: -6px -6px -6px; padding: 6px;
}
.card {
  display: flex; flex-direction: column; gap: 8px; width: 100%; flex: none; padding: 12px; text-align: left;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-sm);
  color: var(--ink); cursor: pointer; transition: border-color .15s ease, box-shadow .15s ease;
}
.card:hover { border-color: var(--sky-600); box-shadow: var(--shadow-md); }
.card[draggable="true"] { cursor: grab; }
.card.dragging { opacity: .5; }
.card.closed { background: var(--canvas); }
.card.closed .card-title { color: var(--ink-2); }
.card-title { display: block; font-weight: 700; overflow-wrap: anywhere; }
.card-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.card-meta { display: flex; align-items: center; gap: 12px; min-height: 24px; font-size: 12px; line-height: 16px; }
.card-meta .meta-text { font-weight: 600; color: var(--ink-3); }
.card-meta .avatar { margin-left: auto; }
.drop-line { flex: none; height: 4px; border-radius: 4px; background: var(--sky-600); }
.empty-col {
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 20px 16px; text-align: center;
  border: 2px dashed var(--line-input); border-radius: 12px; color: var(--ink-2);
}
.empty-col .check-ring {
  display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%;
  background: var(--green-100); color: var(--green-900);
}
.empty-col strong { color: var(--ink); }
.col-note { flex: none; padding: 0 8px; color: var(--ink-3); font-size: 12px; line-height: 16px; font-weight: 600; }
.hints {
  display: flex; justify-content: flex-end; align-items: center; gap: 16px; flex-wrap: wrap; flex: none;
  color: var(--ink-3); font-size: 12px; line-height: 16px; font-weight: 600;
}
.hints span { display: inline-flex; align-items: center; gap: 4px; }

/* ---------- drawer ---------- */
.overlay { position: fixed; top: 0; right: 0; bottom: 0; left: var(--sidebar-w); z-index: 40; background: rgba(20, 24, 33, .32); }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 41; width: 720px; max-width: 100%;
  display: flex; flex-direction: column; background: var(--surface); border-left: 1px solid var(--line);
  box-shadow: var(--shadow-lg); outline: none;
}
.drawer-head { display: flex; flex-direction: column; gap: 8px; padding: 24px 24px 16px; border-bottom: 1px solid var(--line); }
.drawer-top { display: flex; align-items: center; gap: 16px; }
.drawer-top h2 { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.close-row { display: flex; align-items: center; gap: 8px; }
.drawer-meta {
  display: flex; align-items: center; gap: 4px 12px; flex-wrap: wrap;
  color: var(--ink-3); font-size: 12px; line-height: 16px; font-weight: 600;
}
.drawer-meta a { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; line-height: 20px; font-weight: 700; }
.drawer-body {
  flex: 1; min-height: 0; overflow-y: auto; display: grid; grid-template-columns: minmax(0, 1fr) 224px; gap: 24px;
  padding: 20px 24px 24px; align-items: start; align-content: start;
}
.drawer-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.section { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.section h3, .section-label { font: 700 14px/20px var(--font-body); color: var(--ink); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.section-note { color: var(--ink-3); font-size: 12px; line-height: 16px; font-weight: 600; text-align: right; }
.panel-soft { padding: 16px; border-radius: 12px; background: var(--canvas); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row .input { flex: 1 1 120px; width: auto; }
.panel-soft .row .input { background: var(--surface); }
.prewrap { white-space: pre-wrap; overflow-wrap: anywhere; }
.report {
  display: flex; flex-direction: column; gap: 8px; padding: 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; color: var(--ink);
}
.report-by { color: var(--ink-3); font-size: 12px; line-height: 16px; font-weight: 600; }
.facts { display: flex; flex-direction: column; gap: 4px; padding-left: 20px; list-style: decimal; color: var(--ink-2); }
.dupes { display: flex; flex-direction: column; gap: 8px; }
.dupe {
  display: flex; align-items: center; gap: 12px; padding: 8px 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
}
.dupe-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dupe-open {
  padding: 0; border: 0; background: none; color: var(--ink); font-weight: 700; text-align: left; cursor: pointer;
  overflow-wrap: anywhere; text-underline-offset: 2px;
}
.dupe-open:hover { color: var(--sky-800); text-decoration: underline; }
.dupe-meta { color: var(--ink-3); font-size: 12px; line-height: 16px; font-weight: 600; }
.reply-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.side-field { display: flex; flex-direction: column; gap: 8px; }
.side-stack { display: flex; flex-direction: column; gap: 4px; }
.side-value { font-weight: 600; }
.side-stack > .btn { align-self: flex-start; }
.side-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.assignee { display: flex; align-items: center; gap: 8px; min-width: 0; }
.assignee span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nobody { color: var(--ink-2); }
.activity-section { padding-top: 16px; border-top: 1px solid var(--line); }
.activity { display: flex; flex-direction: column; gap: 12px; }
.activity li { display: flex; flex-direction: column; overflow-wrap: anywhere; }
.activity .when { color: var(--ink-3); font-size: 12px; line-height: 16px; font-weight: 600; }
.activity q { color: var(--ink-2); quotes: "\201C" "\201D"; }
.danger-zone { padding-top: 16px; border-top: 1px solid var(--line); }

/* ---------- dialogs ---------- */
.dialog {
  width: 560px; max-width: calc(100vw - 32px); max-height: calc(100vh - 32px); padding: 0; border: 1px solid var(--line);
  border-radius: 16px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lg);
}
.dialog::backdrop { background: rgba(20, 24, 33, .32); }
.dialog form, .dialog-inner { display: flex; flex-direction: column; gap: 16px; padding: 20px; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.answer { max-height: 50vh; overflow-y: auto; }
.shortcuts { display: grid; grid-template-columns: auto 1fr; gap: 12px 16px; align-items: center; justify-items: start; }

/* ---------- staff page ---------- */
.panel { padding: 20px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 12px; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { padding: 0 12px 8px 0; text-align: left; font-size: 12px; line-height: 16px; font-weight: 700; color: var(--ink-2); white-space: nowrap; }
.table td { height: 48px; padding: 0 12px 0 0; border-top: 1px solid var(--line); vertical-align: middle; }
.table .who { display: flex; align-items: center; gap: 12px; font-weight: 700; min-width: 0; }
.table .who span { overflow-wrap: anywhere; }
.table .roles { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px 0; }
.table td.seen { color: var(--ink-2); white-space: nowrap; }
.table td.actions { text-align: right; padding-right: 0; white-space: nowrap; }
.you { color: var(--ink-2); font-size: 12px; line-height: 16px; font-weight: 700; }

/* ---------- toast ---------- */
.toasts { position: fixed; left: 50%; bottom: 24px; z-index: 60; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: max-content; max-width: calc(100vw - 32px); }
.toast { padding: 8px 16px; border-radius: 12px; background: var(--ink); color: #fff; font-weight: 600; box-shadow: var(--shadow-md); }
.toast.error { background: var(--red-900); }

/* ---------- login and no-access ---------- */
.sky {
  position: relative; min-height: 100vh; overflow: hidden; display: flex; align-items: center; justify-content: center;
  padding: 24px 16px 120px; background: linear-gradient(180deg, var(--sky-400) 0%, var(--sky-600) 100%);
}
.sky-art { position: absolute; inset: 0; width: 100%; height: 100%; }
.login-card {
  position: relative; width: 424px; max-width: 100%; display: flex; flex-direction: column; gap: 24px;
  padding: 24px 32px 32px; background: var(--surface); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow-lg);
}
.login-brand { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.login-brand img { width: 360px; max-width: 100%; height: auto; aspect-ratio: 360 / 183; object-fit: contain; }
.login-body { display: flex; flex-direction: column; gap: 16px; text-align: center; color: var(--ink-2); }
.notice { padding: 12px 16px; border-radius: 12px; background: var(--red-100); color: var(--red-900); font-weight: 600; text-align: left; }
.notice-info { background: var(--sky-100); color: var(--sky-800); }

/* ---------- smaller screens ---------- */
@media (max-width: 1180px) {
  .board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  :root { --sidebar-w: 0px; }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px 16px;
  }
  .wordmark { padding: 0; font-size: 22px; line-height: 28px; }
  .sidebar > nav { order: 3; width: 100%; }
  .nav { flex-direction: row; gap: 8px; }
  .nav-link { height: 40px; padding: 0 12px; font-size: 14px; line-height: 20px; gap: 8px; }
  .account { margin: 0 0 0 auto; flex-direction: row; align-items: center; gap: 12px; padding: 4px 4px 4px 16px; border-radius: 999px; min-width: 0; }
  .account-who { min-width: 0; }
  .main { padding: 16px; }
  /* Stacked columns can't share one screen: the page scrolls instead. */
  .shell-fixed { height: auto; }
  .board { flex: none; grid-auto-rows: auto; align-items: start; }
  .column, .cards { overflow: visible; }
  .drawer-body { grid-template-columns: minmax(0, 1fr); padding: 16px 16px 24px; }
  .drawer-head { padding: 16px; }
  .hints { display: none; }
}
@media (max-width: 640px) {
  .board { grid-template-columns: minmax(0, 1fr); }
  .search { width: 100%; }
  .search kbd { display: none; }
  .search .input { padding-right: 12px; }
  .switch { margin-left: 0; }
  .account-role { display: none; }
  .account-name { max-width: 120px; }
  .page-head { min-height: 0; }
  .two { grid-template-columns: 1fr; }
  .login-card { padding: 24px 16px; }
  .display { font-size: 28px; line-height: 36px; }
  /* Staff rows: name and action on one line, roles and last active under it. */
  .table thead { display: none; }
  .table, .table tbody { display: block; width: 100%; }
  .table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 12px; padding: 12px 0; border-top: 1px solid var(--line); }
  .table td { display: block; height: auto; border: 0; padding: 0; grid-column: 1 / -1; }
  .table td.cell-main { grid-column: 1; }
  .table td.actions { grid-column: 2; grid-row: 1; }
  .table td.seen[data-label]::before { content: attr(data-label) " "; color: var(--ink-3); font-weight: 600; }
  .table .roles { padding: 0; }
}

/* Touch screens have no keyboard to hint at. */
@media (pointer: coarse) {
  .hints, .search kbd, .drawer-top kbd { display: none; }
  .search .input { padding-right: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
