/* FishySchedule shared styles (from v3's index.html) */
/* FishySchedule: fish-camp + roadside diner.
   Two main colors (harbor navy, dock-board tan). Red is the small third: the one main button,
   "this week", warnings. Shift tints are quiet versions of those same colors. */
:root {
  --navy: #1f3550;
  --navy-2: #2d4a6b;
  --wood: #c9a877;
  --wood-soft: #e6d6b8;
  --red: #b8372b;
  --board: #ebe2d0;          /* page background: sun-bleached boards */
  --paper: #fbf8f1;          /* menu paper: cards, chat */
  --text: #1d2a38;
  --muted: #6b6455;
  --line: rgba(31, 53, 80, .16);
  --line-strong: rgba(31, 53, 80, .38);
  --hover: #f3ead8;
  --user-bubble: var(--navy);
  --user-text: #fbf8f1;
  --bot-bubble: #f4eee2;

  /* shift tints */
  --c-mgr-bg: #dfe5ee;   --c-mgr: #1f3550;
  --c-train-bg: #e3ebe4; --c-train: #3c6650;
  --c-r-bg: #f5ece7;     --c-r: #a3352a;
  --c-dbl-bg: #efe3cb;   --c-dbl: #6b4a1f;
  --c-closed-bg: #e8e2d6; --c-closed: #9a917f;
  --c-grid: var(--line);
  --c-cell-hover: var(--hover);

  --fish-1: #ffd23f; --fish-2: #e8892c; --fish-line: #b8621a;

  --r-sm: 6px; --r-md: 10px; --r-lg: 14px;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px;
  --display: "Libre Baskerville", "Baskerville", "Times New Roman", Georgia, serif;   /* the sign's "SEAFOOD RESTAURANT" */
  --brand: "Bangers", "Impact", sans-serif;                                            /* the sign's "SOMETHING FISHy" */
  --pink: #fc3392;
  --body: "Barlow", "Segoe UI", system-ui, -apple-system, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
}
@media (prefers-color-scheme: dark) {
  :root {
    --board: #121d29;
    --paper: #182637;
    --text: #ece3d1;
    --muted: #a39a87;
    --line: rgba(236, 227, 209, .12);
    --line-strong: rgba(236, 227, 209, .3);
    --hover: #213347;
    --user-bubble: var(--wood);
    --user-text: #14202c;
    --bot-bubble: #1e2f43;
    --c-mgr-bg: #263d5a;   --c-mgr: #d6e1ef;
    --c-train-bg: #22392f; --c-train: #b9d8c4;
    --c-r-bg: #2a2a31;     --c-r: #ec9c8f;
    --c-dbl-bg: #3a2f1c;   --c-dbl: #ead2a3;
    --c-closed-bg: #1a2533; --c-closed: #6f7a86;
    --red: #e0604f;
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--body);
  font-size: 16px;
  color: var(--text);
  background-color: var(--board);
  /* faint board seams, like a dock or a shack wall */
  background-image: repeating-linear-gradient(180deg, transparent 0 71px, rgba(31, 53, 80, .07) 71px 72px);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font-family: inherit; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }


/* ---------- layout ---------- */
.app {
  position: relative; z-index: 1; height: 100%;
  display: flex; flex-direction: row; align-items: stretch; justify-content: center;
  gap: var(--s4); padding: var(--s4);
}
.main { flex: 1 1 auto; min-width: 0; max-width: 860px; display: flex; flex-direction: column; }

/* ---------- sign (brand) ---------- */
.brand {
  flex: 0 0 auto; align-self: flex-start;
  display: flex; align-items: center; gap: var(--s3);
  padding: 6px 18px 7px 12px; margin-bottom: var(--s3);
  background: #fff; color: var(--navy);
  border-radius: var(--r-md);
  /* the sign's navy double border */
  box-shadow: inset 0 0 0 2px #1d1b4c, inset 0 0 0 4px #fff, inset 0 0 0 5.5px #1d1b4c;
}
.fish { width: 50px; height: auto; flex: 0 0 50px; }
h1 {
  margin: 0; font-family: var(--brand); font-weight: 400; color: var(--pink);
  font-size: 1.95rem; letter-spacing: .04em; line-height: 1; transform: rotate(-2deg);
}
h1 small { display: block; font-family: var(--display); font-size: .68rem; letter-spacing: .02em;
  color: #1d1b4c; transform: rotate(2deg); margin-top: 3px; }

/* ---------- the menu board (chat + panels) ---------- */
.chat {
  flex: 1 1 auto; min-height: 0; width: 100%;
  display: flex; flex-direction: column;
  background: var(--paper);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-lg);
  box-shadow: 0 1px 0 var(--line-strong), 0 10px 24px -14px rgba(31, 53, 80, .35);
  overflow: hidden;
}

.messages {
  flex: 1 1 auto; overflow-y: auto;
  padding: var(--s5) var(--s5) var(--s2);
  display: flex; flex-direction: column; gap: var(--s3);
}

.empty { margin: auto; text-align: center; max-width: 460px; }
.empty h2 { margin: 0 0 var(--s2); font-family: var(--display); font-weight: 700; font-size: 1.6rem; color: var(--navy); line-height: 1.15; }
@media (prefers-color-scheme: dark) { .empty h2 { color: var(--wood); } }
.empty p { margin: 0 0 var(--s4); color: var(--muted); line-height: 1.5; }
.chips { display: flex; flex-wrap: wrap; gap: var(--s2); justify-content: center; }
.chip {
  border: 1px solid var(--line-strong); background: transparent; color: var(--text);
  padding: 7px 14px; border-radius: var(--r-sm); cursor: pointer; font-size: .95rem; font-weight: 500;
  transition: background .12s, border-color .12s;
}
.chip:hover { background: var(--hover); border-color: var(--navy); }

.msg { display: flex; gap: var(--s2); align-items: flex-end; max-width: 100%; }
.msg.user { justify-content: flex-end; }
.bubble {
  padding: 10px 14px; border-radius: var(--r-md); line-height: 1.5;
  white-space: pre-wrap; word-wrap: break-word; max-width: 76%;
  animation: arrive .22s var(--ease);
}
.msg.user .bubble { background: var(--user-bubble); color: var(--user-text); border-bottom-right-radius: 3px; }
.msg.bot .bubble  { background: var(--bot-bubble); border: 1px solid var(--line); border-bottom-left-radius: 3px; }
.avatar { width: 28px; height: 28px; flex: 0 0 28px; margin-bottom: 4px; }
@keyframes arrive { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.typing { display: inline-flex; gap: 5px; padding: 4px 2px; }
.typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: bob 1s infinite ease-in-out; }
.typing span:nth-child(2) { animation-delay: .15s; }
.typing span:nth-child(3) { animation-delay: .3s; }
@keyframes bob { 0%,80%,100% { transform: translateY(0); opacity: .45; } 40% { transform: translateY(-4px); opacity: 1; } }

/* ---------- composer ---------- */
.composer {
  display: flex; gap: var(--s2); align-items: flex-end;
  margin: var(--s2) var(--s4) var(--s3); padding: 6px 6px 6px var(--s4);
  border-radius: var(--r-md); background: var(--paper);
  border: 1px solid var(--line-strong);
  transition: border-color .12s, box-shadow .12s;
}
.composer:focus-within { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(31, 53, 80, .12); }
@media (prefers-color-scheme: dark) { .composer:focus-within { border-color: var(--wood); } }
textarea {
  flex: 1; resize: none; border: 0; outline: 0; background: transparent; color: var(--text);
  font-size: 1rem; line-height: 1.4; padding: 8px 0; max-height: 180px;
}
textarea:focus-visible { outline: 0; }
textarea::placeholder { color: var(--muted); }
.send {
  flex: 0 0 42px; width: 42px; height: 42px; border-radius: var(--r-sm); border: 0; cursor: pointer;
  background: var(--red); display: grid; place-items: center;
  transition: transform .12s var(--ease), opacity .12s;
}
.send:hover:not(:disabled) { transform: translateY(-1px); }
.send:active:not(:disabled) { transform: translateY(1px) scale(.97); }
.send:disabled { opacity: .35; cursor: default; }

.status { text-align: center; font-size: .78rem; color: var(--muted); margin: 0 0 var(--s3); }
.status b { color: var(--text); font-weight: 600; }

/* ---------- schedule card (lives inside a chat bubble) ---------- */
.msg.bot.wide .bubble { max-width: 100%; flex: 1 1 auto; min-width: 0; white-space: normal; }
.sched-text { white-space: pre-wrap; margin-bottom: var(--s3); }
.sched { min-width: 0; }
.sched-top { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 12px; margin-bottom: var(--s2); }
.sched-top b { font-family: var(--display); font-weight: 700; font-size: 1.05rem; color: var(--navy); letter-spacing: .01em; }
@media (prefers-color-scheme: dark) { .sched-top b { color: var(--wood); } }
.pill { font-size: .78rem; font-weight: 600; padding: 2px 10px; border-radius: var(--r-sm); background: var(--wood-soft); color: #5a4422; }
.pill.posted { background: var(--c-train-bg); color: var(--c-train); }
.pill.dirty { background: var(--c-r-bg); color: var(--c-r); }
.sched-scroll { overflow-x: auto; border-radius: var(--r-md); border: 1px solid var(--line-strong); background: var(--paper); }
.sched table { border-collapse: collapse; width: 100%; font-size: .92rem; font-variant-numeric: tabular-nums; }
.sched th, .sched td { border-bottom: 1px solid var(--c-grid); padding: 0; text-align: center; }
.sched thead th {
  padding: 7px 6px; font-size: .8rem; font-weight: 600; line-height: 1.2;
  color: var(--paper); background: var(--navy);
}
@media (prefers-color-scheme: dark) { .sched thead th { color: #14202c; background: var(--wood); } }
.sched thead th.closed { opacity: .55; }
.sched tbody th, .sched tfoot th { text-align: left; padding: 4px 10px; font-weight: 600; white-space: nowrap;
  position: sticky; left: 0; background: var(--paper); z-index: 1; }
.sched thead th:first-child { position: sticky; left: 0; z-index: 2; }
.sched tbody tr { animation: rowIn .3s var(--ease) backwards; }
.sched tbody tr:nth-child(2) { animation-delay: .03s; } .sched tbody tr:nth-child(3) { animation-delay: .06s; }
.sched tbody tr:nth-child(4) { animation-delay: .09s; } .sched tbody tr:nth-child(5) { animation-delay: .12s; }
.sched tbody tr:nth-child(6) { animation-delay: .15s; } .sched tbody tr:nth-child(7) { animation-delay: .18s; }
.sched tbody tr:nth-child(8) { animation-delay: .21s; } .sched tbody tr:nth-child(n+9) { animation-delay: .24s; }
@keyframes rowIn { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }
.sched tbody th .star { color: var(--red); font-size: .85em; }
.sched tbody th .new { font-size: .72rem; color: var(--muted); font-weight: 500; }
.sched tfoot th, .sched tfoot td { font-size: .8rem; color: var(--muted); padding: 4px 6px; border-bottom: 0; }
.sched tfoot tr:first-child th, .sched tfoot tr:first-child td { border-top: 1px solid var(--line-strong); }
.cell {
  width: 100%; min-width: 46px; height: 34px; border: 0; background: transparent; color: var(--text);
  font-size: inherit; font-weight: 600; cursor: pointer; position: relative; border-radius: 0;
  transition: background .1s, box-shadow .1s;
}
.cell:hover, .cell:focus-visible { background: var(--c-cell-hover); outline: none; box-shadow: inset 0 0 0 2px var(--navy); }
@media (prefers-color-scheme: dark) { .cell:hover, .cell:focus-visible { box-shadow: inset 0 0 0 2px var(--wood); } }
.cell.open-pop { box-shadow: inset 0 0 0 2px var(--red); }
.cell.mgr   { background: var(--c-mgr-bg); color: var(--c-mgr); }
.cell.train { background: var(--c-train-bg); color: var(--c-train); }
.cell.r     { background: var(--c-r-bg); color: var(--c-r); font-weight: 500; }
.cell.off   { color: var(--muted); font-weight: 400; }
.cell.closed {
  background: repeating-linear-gradient(135deg, var(--c-closed-bg) 0 6px, transparent 6px 12px);
  color: var(--c-closed); font-weight: 400; cursor: default; box-shadow: none;
}
.cell.edited::after { content: ""; position: absolute; top: 4px; right: 4px; width: 6px; height: 6px; border-radius: 50%; background: var(--red); }
.cell.flash { animation: flash .6s ease-out; }
@keyframes flash { from { box-shadow: inset 0 0 0 3px var(--red); } to { box-shadow: none; } }
.sched tfoot td.warn-cell { color: var(--red); font-weight: 700; }
.sched-legend { display: flex; flex-wrap: wrap; gap: 6px; margin-top: var(--s2); font-size: .78rem; color: var(--muted); align-items: center; }
.sched-legend span.k { padding: 1px 8px; border-radius: 4px; font-weight: 600; }
.sched-flags { margin: var(--s3) 0 0; padding: var(--s2) var(--s3) var(--s2) 30px; border-radius: var(--r-md);
  background: var(--c-r-bg); color: var(--text); font-size: .88rem; line-height: 1.45; border-left: 3px solid var(--red); }
.sched-flags.ok { background: var(--c-train-bg); border-left-color: var(--c-train); list-style: none; padding-left: var(--s3); }
.sched-actions { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s3); }
.btn {
  border: 1px solid var(--line-strong); background: transparent; color: var(--text); font-size: .9rem;
  font-weight: 600; padding: 7px 14px; border-radius: var(--r-sm); cursor: pointer; text-decoration: none;
  transition: background .12s, border-color .12s, transform .12s var(--ease);
}
.btn:hover:not(:disabled) { background: var(--hover); border-color: var(--navy); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .4; cursor: default; }
.btn.primary { border-color: var(--red); color: #fff; background: var(--red); }
.btn.primary:hover:not(:disabled) { background: #a02f24; border-color: #a02f24; }
.sched.stale { opacity: .55; }
.sched.stale .cell, .sched.stale .btn { pointer-events: none; }
.stale-note { font-size: .82rem; color: var(--muted); margin-top: 6px; }
.sched-err { color: var(--red); font-size: .88rem; margin-top: 6px; min-height: 0; }

/* ---------- cell picker (grows out of the clicked cell) ---------- */
.picker {
  position: fixed; z-index: 50; width: 256px; padding: var(--s3); border-radius: var(--r-md);
  background: var(--paper); border: 1px solid var(--line-strong);
  box-shadow: 0 14px 30px -10px rgba(20, 32, 44, .45);
  animation: grow .16s var(--ease);
}
@keyframes grow { from { opacity: 0; transform: scale(.92); } to { opacity: 1; transform: none; } }
.picker .who { font-weight: 600; font-size: .85rem; margin: 0 2px var(--s2); padding-bottom: var(--s2); border-bottom: 1px solid var(--line); }
.picker .row { display: grid; grid-template-columns: 58px repeat(3, 1fr); gap: 5px; align-items: center; margin-bottom: 5px; }
.picker .row.two { grid-template-columns: 1fr 1fr; margin-top: var(--s1); }
.picker label { font-size: .8rem; font-weight: 600; color: var(--muted); }
.picker button {
  height: 34px; border-radius: var(--r-sm); border: 1px solid var(--line-strong); background: transparent; color: var(--text);
  font-weight: 600; font-size: .92rem; cursor: pointer;
}
.picker button:hover, .picker button:focus-visible { border-color: var(--navy); outline: none; box-shadow: inset 0 0 0 1px var(--navy); }
@media (prefers-color-scheme: dark) { .picker button:hover, .picker button:focus-visible { border-color: var(--wood); box-shadow: inset 0 0 0 1px var(--wood); } }
.picker button.cur { box-shadow: 0 0 0 2px var(--red); border-color: var(--red); }
.picker button.mgr { background: var(--c-mgr-bg); color: var(--c-mgr); }
.picker button.train { background: var(--c-train-bg); color: var(--c-train); }
.picker button.r { background: var(--c-r-bg); color: var(--c-r); }
.picker button.dbl { background: var(--c-dbl-bg); color: var(--c-dbl); }
.picker .hint { font-size: .74rem; color: var(--muted); margin: var(--s2) 2px 0; }
.picker .dlabel { font-size: .8rem; font-weight: 600; color: var(--muted); margin: var(--s2) 2px 5px; }
.picker .dgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin-bottom: var(--s1); }
.picker .dgrid.one { grid-template-columns: 1fr; }
.picker .dgrid button { font-size: .84rem; }

/* ---------- sidebar ---------- */
.side {
  flex: 0 0 240px; display: flex; flex-direction: column; min-height: 0;
  background: var(--paper); border: 1px solid var(--line-strong); border-radius: var(--r-lg);
  overflow: hidden;
}
/* the one loud thing: a checked fish-camp tablecloth across the top of the menu */
.side::before {
  content: ""; flex: 0 0 14px;
  background-color: var(--paper);
  background-image:
    linear-gradient(90deg, rgba(184, 55, 43, .55) 50%, transparent 50%),
    linear-gradient(0deg, rgba(184, 55, 43, .55) 50%, transparent 50%);
  background-size: 14px 14px;
}
.side-head { display: flex; align-items: center; gap: var(--s2); padding: var(--s3) var(--s4) var(--s2);
  font-family: var(--display); font-weight: 700; font-size: 1rem; color: var(--navy); }
@media (prefers-color-scheme: dark) { .side-head { color: var(--wood); } }
.side-head svg { width: 30px; height: 20px; }
nav { padding: 0 var(--s2); }
.nav-item, .week-item {
  width: 100%; display: flex; align-items: center; gap: var(--s3); text-align: left;
  border: 0; background: transparent; color: var(--text); font-size: inherit; cursor: pointer;
  border-radius: var(--r-sm); transition: background .1s;
}
.nav-item { padding: 9px var(--s3); font-weight: 600; font-size: .98rem; }
.nav-item svg { width: 18px; height: 18px; flex: 0 0 18px; stroke: var(--muted); }
.nav-item:hover, .week-item:hover { background: var(--hover); }
.nav-item.active, .week-item.active { background: var(--navy); color: var(--paper); }
.nav-item.active svg { stroke: var(--paper); }
@media (prefers-color-scheme: dark) {
  .nav-item.active, .week-item.active { background: var(--wood); color: #14202c; }
  .nav-item.active svg { stroke: #14202c; }
}
.nav-item .count { margin-left: auto; font-size: .8rem; font-weight: 500; opacity: .7; }
.side-sec { display: flex; align-items: center; gap: var(--s2); margin: var(--s4) var(--s4) var(--s1);
  padding-top: var(--s3); border-top: 1px solid var(--line);
  font-size: .85rem; font-weight: 600; color: var(--muted); }
.side-sec svg { width: 15px; height: 15px; stroke: var(--muted); }
.weeks { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 0 var(--s2); }
.week-item { padding: 6px var(--s3); font-size: .94rem; font-variant-numeric: tabular-nums; }
.week-item .dot { width: 7px; height: 7px; border-radius: 50%; margin-left: auto; flex: 0 0 7px; background: var(--c-train); }
.week-item .dot.draft { background: var(--red); }
.week-item .dot.saved { background: var(--muted); opacity: .6; }
.week-item .tag { font-size: .74rem; font-weight: 600; color: var(--red); }
.week-item.active .tag { color: inherit; opacity: .85; }
.weeks .yr { font-size: .78rem; color: var(--muted); font-weight: 600; margin: var(--s3) var(--s3) 2px; }
.side-foot { font-size: .76rem; color: var(--muted); padding: var(--s2) var(--s4) var(--s3); display: flex; gap: var(--s3); flex-wrap: wrap; border-top: 1px solid var(--line); }
.side-foot i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 4px; vertical-align: 1px; }

.menu-btn, .scrim { display: none; }

/* ---------- panel views (employees / a past week / time cards) ---------- */
.view { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.view[hidden] { display: none; }
.panel-head { display: flex; align-items: center; gap: var(--s3); padding: var(--s4) var(--s5) var(--s3); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.panel-head h2 { margin: 0; font-family: var(--display); font-weight: 700; font-size: 1.2rem; color: var(--navy); flex: 1 1 auto; }
@media (prefers-color-scheme: dark) { .panel-head h2 { color: var(--wood); } }
.panel-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: var(--s4) var(--s5) var(--s5); }
.panel-note { font-size: .9rem; color: var(--muted); margin: 0 0 var(--s3); line-height: 1.5; }
.toast { font-size: .9rem; margin: 0 0 var(--s3); padding: var(--s2) var(--s3); border-radius: var(--r-sm);
  background: var(--c-train-bg); color: var(--c-train); border-left: 3px solid var(--c-train); }
.toast.err { background: var(--c-r-bg); color: var(--c-r); border-left-color: var(--red); }
.toast:empty { display: none; }

/* employees */
.add-row { display: flex; gap: var(--s2); flex-wrap: wrap; margin-bottom: var(--s4); }
.add-row input, .add-row select, .panel-head select {
  font-size: .95rem; color: var(--text); background: var(--paper); border: 1px solid var(--line-strong);
  border-radius: var(--r-sm); padding: 7px var(--s3); outline: none;
}
.add-row input { flex: 1 1 160px; min-width: 0; }
.add-row input:focus, .add-row select:focus, .panel-head select:focus { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(31, 53, 80, .12); }
@media (prefers-color-scheme: dark) { .add-row select option, .panel-head select option { background: var(--paper); } }
.emp-list { border: 1px solid var(--line-strong); border-radius: var(--r-md); overflow: hidden; }
.emp { display: flex; align-items: center; gap: var(--s3); padding: var(--s2) var(--s3); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.emp:nth-child(even) { background: rgba(201, 168, 119, .08); }
.emp:last-child { border-bottom: 0; }
.emp .nm { font-weight: 600; flex: 1 1 120px; min-width: 0; }
.emp .nm .star { color: var(--red) !important; }
.emp .nm small { font-weight: 500; color: var(--muted); margin-left: 6px; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--r-sm); overflow: hidden; }
.seg button { border: 0; background: transparent; color: var(--muted); font-size: .84rem; font-weight: 600; padding: 5px 12px; cursor: pointer; }
.seg button + button { border-left: 1px solid var(--line-strong); }
.seg button.on, .seg button.on.ws { background: var(--navy); color: var(--paper); }
@media (prefers-color-scheme: dark) { .seg button.on, .seg button.on.ws { background: var(--wood); color: #14202c; } }
.btn.sm { padding: 4px 10px; font-size: .84rem; }
.btn.danger { border-color: rgba(184, 55, 43, .45); color: var(--red); }
.btn.danger:hover:not(:disabled) { background: var(--c-r-bg); border-color: var(--red); }
.confirm { font-size: .86rem; display: inline-flex; align-items: center; gap: 6px; }
.emp-sec { margin: var(--s5) 0 var(--s2); font-size: .92rem; font-weight: 600; color: var(--muted); }

/* time cards */
.tc table { border-collapse: collapse; width: 100%; font-size: .88rem; font-variant-numeric: tabular-nums; }
.tc th, .tc td { border-bottom: 1px solid var(--c-grid); padding: 6px 8px; text-align: center; white-space: nowrap; }
.tc thead th { font-size: .8rem; font-weight: 600; color: var(--paper); background: var(--navy); }
@media (prefers-color-scheme: dark) { .tc thead th { color: #14202c; background: var(--wood); } }
.tc tbody th { text-align: left; position: sticky; left: 0; background: var(--paper); font-weight: 600; }
.tc tbody th span { color: var(--red) !important; }
.tc td .t { display: block; font-weight: 600; }
.tc td .h { display: block; font-size: .74rem; color: var(--muted); }
.tc td.dbl { background: var(--c-dbl-bg); }
.tc td.dbl .t { color: var(--c-dbl); }
.tc td.closed { color: var(--c-closed); background: var(--c-closed-bg); }
.tc td.tot { font-weight: 700; background: var(--c-mgr-bg); color: var(--c-mgr); }
.tc tfoot th, .tc tfoot td { font-weight: 700; border-bottom: 0; border-top: 1px solid var(--line-strong); }
.tc-sum { display: flex; gap: var(--s2); flex-wrap: wrap; margin-bottom: var(--s4); }
.stat { padding: var(--s2) var(--s4); border-radius: var(--r-md); background: var(--bot-bubble); border: 1px solid var(--line); min-width: 120px; }
.stat b { display: block; font-family: var(--display); font-weight: 400; font-size: 1.4rem; color: var(--navy); font-variant-numeric: tabular-nums; }
@media (prefers-color-scheme: dark) { .stat b { color: var(--wood); } }
.stat span { font-size: .8rem; color: var(--muted); }
.cell.ro { display: flex; align-items: center; justify-content: center; cursor: default; }
.cell.ro:hover { box-shadow: none; }
.cell.span { font-size: .8rem; }
.cell.dbl { background: var(--c-dbl-bg); color: var(--c-dbl); }
.cell .hf { padding: 1px 4px; border-radius: 4px; }
.cell .hf.m { background: var(--c-mgr-bg); color: var(--c-mgr); }
.cell .sep { opacity: .6; margin: 0 1px; }

@media (max-width: 900px) {
  .app { padding: var(--s3); }
  .side {
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 40; width: 272px;
    border-radius: 0 var(--r-lg) var(--r-lg) 0; transform: translateX(-105%); transition: transform .22s var(--ease);
  }
  .app.menu-open .side { transform: none; }
  .scrim { position: fixed; inset: 0; z-index: 30; background: rgba(18, 29, 41, .45); }
  .app.menu-open .scrim { display: block; }
  .menu-btn {
    display: grid; place-items: center; position: fixed; top: var(--s3); right: var(--s3); z-index: 20;
    width: 44px; height: 44px; border-radius: var(--r-md); border: 1px solid var(--line-strong);
    background: var(--paper); cursor: pointer;
  }
  .menu-btn svg { width: 22px; height: 22px; stroke: var(--navy); }
  @media (prefers-color-scheme: dark) { .menu-btn svg { stroke: var(--wood); } }
}

@media (max-width: 600px) {
  .bubble { max-width: 88%; }
  .messages { padding: var(--s4) var(--s3) var(--s2); }
  .msg.bot.wide .avatar { display: none; }
  .cell { min-width: 40px; }
  .panel-head, .panel-body { padding-left: var(--s4); padding-right: var(--s4); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
}
