/* Pawper console
   Layout: sticky top bar (brand, status, ask bar) + live ticker, a case board as the
   home screen, and a floating dock for the other views. Customers open in a drawer.
   Identity: dotted case-paper ground, wine "stamp ink" for received documents. */
:root {
  --bg: #F1EFF4;
  --dot: #D9D3DF;
  --surface: #FFFFFF;
  --raised: #FFFFFF;
  --sunk: #F6F4F8;
  --ink: #17131A;
  --muted: #6E6575;
  --line: #E4DFE8;
  --accent: #A61E4D;
  --accent-ink: #FFFFFF;
  --accent-soft: #F9E6EC;
  --ok: #1E9E57;
  --ok-soft: #E3F3EA;
  --warn: #A86A00;
  --warn-soft: #FAF0D9;
  --bad: #B3261E;
  --bad-soft: #FBE5E3;
  --shadow: 0 1px 2px rgba(23, 19, 26, .06), 0 8px 24px -12px rgba(23, 19, 26, .18);
  --shadow-lg: 0 24px 64px -16px rgba(23, 19, 26, .35);
  --font: "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
  --r: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121014; --dot: #241F27; --surface: #1B171D; --raised: #221D25; --sunk: #17141A;
    --ink: #F2ECF4; --muted: #A398A8; --line: #2F2833;
    --accent: #EC6F98; --accent-ink: #1B0A11; --accent-soft: #3A1B27;
    --ok: #4CC183; --ok-soft: #15301F; --warn: #E3B04B; --warn-soft: #33290F; --bad: #F2918A; --bad-soft: #3A1A18;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px -12px rgba(0,0,0,.6); --shadow-lg: 0 24px 64px -16px rgba(0,0,0,.7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121014; --dot: #241F27; --surface: #1B171D; --raised: #221D25; --sunk: #17141A;
  --ink: #F2ECF4; --muted: #A398A8; --line: #2F2833;
  --accent: #EC6F98; --accent-ink: #1B0A11; --accent-soft: #3A1B27;
  --ok: #4CC183; --ok-soft: #15301F; --warn: #E3B04B; --warn-soft: #33290F; --bad: #F2918A; --bad-soft: #3A1A18;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px -12px rgba(0,0,0,.6); --shadow-lg: 0 24px 64px -16px rgba(0,0,0,.7);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { height: 100%; }
body {
  margin: 0; min-height: 100%;
  background-color: var(--bg);
  background-image: radial-gradient(var(--dot) 1px, transparent 1.2px);
  background-size: 18px 18px;
  color: var(--ink); font: 14.5px/1.5 var(--font);
  padding-bottom: calc(110px + env(safe-area-inset-bottom, 0px));
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
svg { flex: none; }
kbd { font-family: var(--mono); font-size: 11px; padding: 1px 6px; border-radius: 5px; border: 1px solid var(--line); background: var(--sunk); color: var(--muted); }

/* ---------- top bar ---------- */
.top {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 14px;
  padding: calc(12px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) 12px max(16px, env(safe-area-inset-left, 0px));
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); }
.mark { width: 30px; height: 30px; }
.mark-sheet { fill: var(--accent); }
.mark-fold { fill: var(--accent-soft); }
.mark-paw { fill: var(--surface); }
.wordmark { font-weight: 800; font-size: 21px; letter-spacing: -0.04em; }
.status {
  display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--surface);
  border-radius: 999px; padding: 5px 12px 5px 10px; font-size: 12.5px; font-weight: 700; cursor: pointer;
}
.status .orb { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 60%, transparent); animation: pulse 2.2s infinite; }
.status.paused .orb { background: var(--warn); animation: none; }
.status.problem .orb { background: var(--bad); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 55%, transparent); } 70% { box-shadow: 0 0 0 8px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.ask {
  flex: 1; max-width: 560px; margin-left: auto; display: flex; align-items: center; gap: 10px;
  border: 1.5px solid var(--line); background: var(--surface); border-radius: 12px; padding: 8px 12px; cursor: text; color: var(--muted); text-align: left;
  box-shadow: var(--shadow); transition: border-color .15s;
}
.ask:hover { border-color: var(--accent); }
.ask svg, .palette-input > svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.ask-text { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me { width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--ink); color: var(--bg); font-weight: 800; font-size: 13px; cursor: pointer; }
.me-menu { position: absolute; right: max(16px, env(safe-area-inset-right, 0px)); top: 62px; background: var(--raised); border: 1px solid var(--line); border-radius: 12px; padding: 12px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; gap: 8px; min-width: 200px; }
.me-menu button { border: 0; background: var(--sunk); border-radius: 8px; padding: 7px 10px; cursor: pointer; text-align: left; font-weight: 600; }
.me-name { font-size: 13px; color: var(--muted); }
.me-menu[hidden] { display: none; }

/* ---------- live ticker ---------- */
.ticker { display: flex; align-items: center; gap: 12px; padding: 7px max(16px, env(safe-area-inset-right, 0px)) 7px max(16px, env(safe-area-inset-left, 0px)); border-bottom: 1px solid var(--line); background: var(--surface); font-size: 13px; }
.ticker-label { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); flex: none; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: blink 1.6s infinite; }
@keyframes blink { 50% { opacity: .25; } }
.ticker-track { overflow: hidden; flex: 1; mask-image: linear-gradient(90deg, transparent, #000 4%, #000 92%, transparent); }
.ticker-move { display: inline-flex; gap: 36px; white-space: nowrap; animation: tick 60s linear infinite; }
.ticker:hover .ticker-move { animation-play-state: paused; }
.ticker-move span time { font-family: var(--mono); color: var(--muted); margin-right: 6px; font-size: 12px; }
@keyframes tick { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---------- main ---------- */
main { padding: 22px max(16px, env(safe-area-inset-right, 0px)) 0 max(16px, env(safe-area-inset-left, 0px)); display: flex; flex-direction: column; gap: 18px; min-width: 0; }
main:focus { outline: none; }
.page-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px; }
h1 { font-size: clamp(24px, 3vw, 32px); font-weight: 800; letter-spacing: -0.03em; margin: 0; line-height: 1.1; text-wrap: balance; }
h2 { font-size: 15px; font-weight: 700; margin: 0; }
.sub { color: var(--muted); margin: 4px 0 0; }
.muted { color: var(--muted); }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }

.btn { border: 1.5px solid var(--line); background: var(--surface); border-radius: 10px; padding: 7px 13px; font-weight: 700; cursor: pointer; font-size: 13.5px; display: inline-flex; align-items: center; gap: 6px; }
.btn:hover { border-color: var(--ink); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); }
.btn.small { padding: 4px 9px; font-size: 12.5px; border-radius: 8px; }
.btn:disabled { opacity: .5; cursor: default; }
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--sunk); color: var(--muted); white-space: nowrap; }
.chip.accent { background: var(--accent-soft); color: var(--accent); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.green { color: var(--ok); background: var(--ok-soft); }
.pill.amber { color: var(--warn); background: var(--warn-soft); }
.pill.red { color: var(--bad); background: var(--bad-soft); }

/* ---------- board ---------- */
.board-stats { display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: 13px; color: var(--muted); }
.board-stats b { color: var(--ink); font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; margin-right: 4px; }
.needs-lane { display: flex; flex-direction: column; gap: 10px; }
.needs-lane h2 { display: flex; align-items: center; gap: 8px; }
.needs-row { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 4px; }
.needs-card { flex: 0 0 280px; background: var(--surface); border: 1.5px solid var(--accent); border-radius: var(--r); padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; cursor: pointer; text-align: left; box-shadow: var(--shadow); }
.needs-card .why { font-size: 13px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.board-wrap { overflow-x: auto; padding-bottom: 6px; }
.board { display: grid; grid-template-columns: repeat(5, minmax(232px, 1fr)); gap: 12px; min-width: 1220px; align-items: start; }
.col { background: color-mix(in srgb, var(--surface) 55%, transparent); border: 1px dashed var(--line); border-radius: 18px; padding: 10px; display: flex; flex-direction: column; gap: 10px; min-height: 220px; transition: background .15s, border-color .15s; }
.col.drop-ok { border-color: var(--accent); background: var(--accent-soft); }
.col-head { display: flex; flex-direction: column; gap: 2px; padding: 4px 6px 6px; }
.col-head .t { display: flex; align-items: center; justify-content: space-between; font-weight: 800; font-size: 13px; letter-spacing: .02em; }
.col-head .n { font-family: var(--mono); font-size: 12px; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 0 8px; }
.col-head .h { font-size: 12px; color: var(--muted); }
.col-empty { font-size: 12.5px; color: var(--muted); text-align: center; padding: 18px 8px; }

.case { background: var(--raised); border: 1px solid var(--line); border-radius: 12px; padding: 12px 12px 10px; display: flex; flex-direction: column; gap: 9px; cursor: pointer; box-shadow: var(--shadow); position: relative; transition: transform .12s, box-shadow .12s; }
.case:hover { transform: translateY(-1px); box-shadow: var(--shadow-lg); }
.case[draggable="true"] { cursor: grab; }
.case.dragging { opacity: .45; }
.case.with-team { border-color: var(--accent); }
.case.dim { opacity: .7; }
.case .who { display: flex; justify-content: space-between; gap: 8px; align-items: start; }
.case .owner { font-weight: 800; font-size: 14.5px; line-height: 1.2; }
.case .pet { color: var(--muted); font-size: 13px; }
.case .phone { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.case .foot { display: flex; justify-content: space-between; align-items: center; gap: 6px; flex-wrap: wrap; }
.nudges { display: inline-flex; gap: 3px; align-items: center; font-size: 11.5px; color: var(--muted); }
.nudges i { width: 6px; height: 6px; border-radius: 50%; background: var(--line); }
.nudges i.on { background: var(--warn); }

/* stamps: one per required document */
.stamps { display: flex; gap: 6px; }
.stamp { width: 34px; height: 34px; border-radius: 50%; border: 1.5px dashed color-mix(in srgb, var(--muted) 55%, transparent); display: grid; place-items: center; color: color-mix(in srgb, var(--muted) 70%, transparent); position: relative; }
.stamp svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.stamp.got { border: 2px solid var(--accent); color: var(--accent); background: var(--accent-soft); transform: rotate(var(--tilt, -8deg)); }
.stamp.got::after { content: ""; position: absolute; inset: 2px; border-radius: 50%; border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); }
.stamp.fresh { animation: stampIn .5s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes stampIn { 0% { transform: scale(1.9) rotate(18deg); opacity: 0; } 60% { opacity: 1; } 100% { transform: scale(1) rotate(var(--tilt, -8deg)); } }
.stamps.big .stamp { width: 56px; height: 56px; }
.stamps.big .stamp svg { width: 26px; height: 26px; }
.stamp-legend { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.stamp-legend .s { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; font-size: 12px; }
.stamp-legend a { font-size: 12px; font-weight: 700; }

/* ---------- dock ---------- */
.dock {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 25;
  display: flex; gap: 2px; padding: 6px; border-radius: 20px;
  background: color-mix(in srgb, var(--ink) 92%, transparent); backdrop-filter: blur(10px); box-shadow: var(--shadow-lg);
  max-width: calc(100% - 32px); overflow-x: auto;
}
.dock a { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 66px; padding: 7px 8px 6px; border-radius: 14px; text-decoration: none; color: color-mix(in srgb, var(--bg) 70%, transparent); font-size: 11px; font-weight: 700; }
.dock a svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.dock a:hover { color: var(--bg); background: color-mix(in srgb, var(--bg) 10%, transparent); }
.dock a.on { color: var(--ink); background: var(--bg); }
.dock .badge { position: absolute; top: 3px; right: 10px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 11px; display: grid; place-items: center; }
.dock .badge[hidden] { display: none; }
.signature { position: fixed; left: max(16px, env(safe-area-inset-left, 0px)); bottom: calc(10px + env(safe-area-inset-bottom, 0px)); margin: 0; font-family: var(--mono); font-size: 10.5px; color: var(--muted); letter-spacing: .02em; z-index: 1; }

/* ---------- drawer ---------- */
.drawer { position: fixed; inset: 0; z-index: 40; pointer-events: none; }
.drawer-backdrop { position: absolute; inset: 0; background: rgba(10, 6, 12, .38); opacity: 0; transition: opacity .2s; }
.drawer-panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(560px, 100%); background: var(--bg); border-left: 1px solid var(--line);
  box-shadow: var(--shadow-lg); transform: translateX(104%); transition: transform .26s cubic-bezier(.2, .8, .2, 1);
  overflow-y: auto; padding: calc(20px + env(safe-area-inset-top, 0px)) max(20px, env(safe-area-inset-right, 0px)) calc(28px + env(safe-area-inset-bottom, 0px)) 20px;
  display: flex; flex-direction: column; gap: 14px;
}
.drawer.open { pointer-events: auto; }
.drawer.open .drawer-backdrop { opacity: 1; }
.drawer.open .drawer-panel { transform: none; }
.drawer-close { position: absolute; top: calc(14px + env(safe-area-inset-top, 0px)); right: max(14px, env(safe-area-inset-right, 0px)); width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); font-size: 20px; line-height: 1; cursor: pointer; }
.drawer h1 { font-size: 26px; padding-right: 44px; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: 13.5px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.chat { display: flex; flex-direction: column; gap: 6px; max-height: 340px; overflow-y: auto; padding: 4px 2px; }
.bubble { max-width: 82%; padding: 7px 11px; border-radius: 14px; white-space: pre-wrap; overflow-wrap: break-word; width: fit-content; font-size: 13.5px; }
.bubble.in { background: var(--surface); border: 1px solid var(--line); align-self: flex-start; border-bottom-left-radius: 4px; }
.bubble.out { background: var(--accent-soft); align-self: flex-end; border-bottom-right-radius: 4px; }
.bubble small { display: block; color: var(--muted); font-size: 10.5px; margin-top: 2px; font-family: var(--mono); }
.banner { border-radius: 12px; padding: 11px 14px; font-weight: 600; font-size: 13.5px; }
.banner.accent { background: var(--accent-soft); color: var(--accent); }
.banner.warn { background: var(--warn-soft); color: var(--warn); }

/* ---------- palette ---------- */
.palette { position: fixed; inset: 0; z-index: 50; display: grid; place-items: start center; padding: 12vh 16px 16px; }
.palette[hidden] { display: none; }
.palette-backdrop { position: absolute; inset: 0; background: rgba(10, 6, 12, .45); backdrop-filter: blur(3px); }
.palette-panel { position: relative; width: min(640px, 100%); background: var(--raised); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-lg); overflow: hidden; display: flex; flex-direction: column; max-height: 72vh; }
.palette-input { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); color: var(--muted); }
.palette-input input { flex: 1; border: 0; background: transparent; font-size: 17px; outline: none; color: var(--ink); min-width: 0; }
.attach { cursor: pointer; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; }
.attach:hover { background: var(--sunk); }
.attach svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.palette-file { padding: 6px 16px; font-size: 12.5px; background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.palette-body { overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 8px; min-height: 120px; }
.palette-section { font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 6px 8px 2px; }
.p-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; cursor: pointer; border: 0; background: transparent; text-align: left; width: 100%; }
.p-item.sel, .p-item:hover { background: var(--accent-soft); }
.p-item .k { font-size: 12px; color: var(--muted); }
.suggest { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 6px; }
.suggest button { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 5px 11px; font-size: 13px; cursor: pointer; }
.suggest button:hover { border-color: var(--accent); color: var(--accent); }
.p-chat { display: flex; flex-direction: column; gap: 8px; padding: 4px 6px; }
.p-chat .bubble.agent { background: var(--surface); border: 1px solid var(--line); align-self: flex-start; }
.p-chat .bubble.me { background: var(--ink); color: var(--bg); align-self: flex-end; }
.typing { display: inline-flex; gap: 4px; padding: 10px 12px; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: blink 1s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
.palette-foot { display: flex; gap: 16px; padding: 9px 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }

/* ---------- other views ---------- */
.big-status { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.heartbeat { width: min(360px, 100%); height: 56px; }
.heartbeat path { fill: none; stroke: var(--ok); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 520; animation: beat 2.6s linear infinite; }
.heartbeat.amber path { stroke: var(--warn); } .heartbeat.red path { stroke: var(--bad); }
@keyframes beat { from { stroke-dashoffset: 520; } to { stroke-dashoffset: -520; } }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.check { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; display: flex; flex-direction: column; gap: 6px; }
.check .top-line { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.check p { margin: 0; font-size: 13px; color: var(--muted); }
.numbers { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.number { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
.number .v { font-size: 30px; font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.number .k { font-size: 12.5px; color: var(--muted); }
.meter { height: 10px; background: var(--sunk); border-radius: 999px; overflow: hidden; border: 1px solid var(--line); }
.meter > i { display: block; height: 100%; background: var(--ok); }
.meter.warn > i { background: var(--warn); }
.stagebar { display: flex; height: 18px; border-radius: 999px; overflow: hidden; border: 1px solid var(--line); }
.stagebar i { display: block; height: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

.feed { display: flex; flex-direction: column; }
.feed .item { display: grid; grid-template-columns: 112px 1fr; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.feed .item:last-child { border-bottom: 0; }
.feed time { font-family: var(--mono); font-size: 11.5px; color: var(--muted); padding-top: 2px; }
.feed .item.error span { color: var(--bad); }
.feed .item.warn span { color: var(--warn); }
.feed .by { color: var(--muted); font-size: 12px; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
th { font-family: var(--mono); font-size: 10.5px; font-weight: 500; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); background: var(--sunk); }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 800; font-size: 12px; background: var(--accent-soft); color: var(--accent); margin-right: 8px; vertical-align: middle; }

input[type=text], input[type=email], input[type=tel], input[type=number], input[type=search], select, textarea {
  background: var(--surface); border: 1.5px solid var(--line); border-radius: 10px; padding: 8px 11px; min-width: 0;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; }
textarea { width: 100%; resize: vertical; }
label { font-weight: 700; font-size: 12.5px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.hint { font-size: 12px; color: var(--muted); font-weight: 500; }
.checks { display: flex; flex-wrap: wrap; gap: 6px; }
.checks label { font-weight: 600; display: inline-flex; align-items: center; gap: 6px; border: 1.5px solid var(--line); border-radius: 999px; padding: 4px 11px; cursor: pointer; background: var(--surface); }
.checks label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.checks input { accent-color: var(--accent); }
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; align-items: start; }
.save-bar { position: sticky; bottom: calc(96px + env(safe-area-inset-bottom, 0px)); display: flex; justify-content: flex-end; }

#toast { position: fixed; bottom: calc(100px + env(safe-area-inset-bottom, 0px)); left: 50%; transform: translateX(-50%); background: var(--accent); color: var(--accent-ink); padding: 10px 18px; border-radius: 999px; font-weight: 700; z-index: 60; max-width: calc(100% - 32px); box-shadow: var(--shadow-lg); }
dialog { border: 1px solid var(--line); border-radius: 18px; background: var(--raised); color: var(--ink); padding: 22px; max-width: min(480px, calc(100% - 32px)); box-shadow: var(--shadow-lg); }
dialog::backdrop { background: rgba(10, 6, 12, .45); }
.admin-only[hidden] { display: none !important; }

@media (max-width: 760px) {
  .top { flex-wrap: wrap; gap: 10px; }
  .ask { order: 5; flex-basis: 100%; max-width: none; margin-left: 0; }
  .status { margin-left: auto; }
  .signature { display: none; }
  .dock a { min-width: 56px; }
  .dock a span { font-size: 10px; }
  .feed .item { grid-template-columns: 1fr; gap: 0; }
  .stamp-legend { grid-template-columns: repeat(2, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .ticker-track { overflow-x: auto; }
}
