:root {
  --bg: #f4efe7;
  --panel: #fffdf9;
  --panel-2: #f9f4ec;
  --ink: #2a1f17;
  --muted: #76675a;
  --line: #e4d9ca;
  --accent: #9a5520;
  --accent-soft: #f3e3d0;
  --accent-ink: #ffffff;
  --live: #1d7f47;
  --live-soft: #dff2e6;
  --warn: #9a6400;
  --warn-soft: #fbefd2;
  --danger: #b42318;
  --danger-soft: #fbe3e0;
  --new: #fff3df;
  --shadow: 0 1px 2px rgba(60, 40, 20, .06), 0 4px 16px rgba(60, 40, 20, .06);
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, "Liberation Mono", monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius: 10px;
  --chart-1: #9a5520;
  --chart-2: #c99a6b;
  color-scheme: light;
}
/* ---- color schemes ----------------------------------------------------------------
   data-theme on <html>: light (Coffee, the default above), dark (Espresso), auto (follows the
   computer: Coffee or Espresso), ocean, midnight, forest, slate, night, contrast.
   Each scheme only sets the color tokens; everything else uses them. */
:root[data-theme="dark"] {
  --bg: #15110d; --panel: #1f1914; --panel-2: #271f18; --ink: #f2e9df; --muted: #a8978a; --line: #3a2f26;
  --accent: #e39b56; --accent-soft: #3b2a1b; --accent-ink: #1b120a; --live: #55c98c; --live-soft: #173325;
  --warn: #e6b65a; --warn-soft: #3a2e14; --danger: #f2786c; --danger-soft: #3d1c19; --new: #33261a;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.25); --chart-1: #e39b56; --chart-2: #8c6a4c;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]), :root[data-theme="auto"] {
    --bg: #15110d; --panel: #1f1914; --panel-2: #271f18; --ink: #f2e9df; --muted: #a8978a; --line: #3a2f26;
    --accent: #e39b56; --accent-soft: #3b2a1b; --accent-ink: #1b120a; --live: #55c98c; --live-soft: #173325;
    --warn: #e6b65a; --warn-soft: #3a2e14; --danger: #f2786c; --danger-soft: #3d1c19; --new: #33261a;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.25); --chart-1: #e39b56; --chart-2: #8c6a4c;
    color-scheme: dark;
  }
}
:root[data-theme="ocean"] {
  --bg: #edf2f8; --panel: #ffffff; --panel-2: #f3f7fb; --ink: #14222f; --muted: #57687a; --line: #d4dfea;
  --accent: #1d5fa8; --accent-soft: #dce8f7; --accent-ink: #ffffff; --live: #13804a; --live-soft: #dcf2e5;
  --warn: #8f5f00; --warn-soft: #fbefd2; --danger: #b42318; --danger-soft: #fbe3e0; --new: #e6f0fc;
  --shadow: 0 1px 2px rgba(20,40,70,.07), 0 4px 16px rgba(20,40,70,.07); --chart-1: #1d5fa8; --chart-2: #8db4e0;
  color-scheme: light;
}
:root[data-theme="midnight"] {
  --bg: #0c131e; --panel: #131c2a; --panel-2: #1a2535; --ink: #e6edf6; --muted: #93a3b8; --line: #263449;
  --accent: #62a9ff; --accent-soft: #1a3150; --accent-ink: #07101d; --live: #4cc38a; --live-soft: #133025;
  --warn: #e6b65a; --warn-soft: #352b14; --danger: #f2786c; --danger-soft: #3a1c1b; --new: #172a45;
  --shadow: 0 1px 2px rgba(0,0,0,.35), 0 4px 16px rgba(0,0,0,.3); --chart-1: #62a9ff; --chart-2: #3b5f8c;
  color-scheme: dark;
}
:root[data-theme="forest"] {
  --bg: #edf2ea; --panel: #fcfdfb; --panel-2: #f2f6ef; --ink: #1a2a1c; --muted: #5a6b5c; --line: #d5e1d1;
  --accent: #2e6b39; --accent-soft: #dbeadb; --accent-ink: #ffffff; --live: #1b7a8c; --live-soft: #dbf0f3;
  --warn: #8f5f00; --warn-soft: #fbefd2; --danger: #b42318; --danger-soft: #fbe3e0; --new: #ecf5e3;
  --shadow: 0 1px 2px rgba(20,50,20,.07), 0 4px 16px rgba(20,50,20,.07); --chart-1: #2e6b39; --chart-2: #9bbf8e;
  color-scheme: light;
}
:root[data-theme="slate"] {
  --bg: #eff0f3; --panel: #ffffff; --panel-2: #f5f6f8; --ink: #1b1e24; --muted: #5f6670; --line: #dadde2;
  --accent: #4338ca; --accent-soft: #e4e3fb; --accent-ink: #ffffff; --live: #13804a; --live-soft: #dcf2e5;
  --warn: #8f5f00; --warn-soft: #fbefd2; --danger: #b42318; --danger-soft: #fbe3e0; --new: #ecebfd;
  --shadow: 0 1px 2px rgba(20,20,40,.06), 0 4px 16px rgba(20,20,40,.06); --chart-1: #4338ca; --chart-2: #a5a1ee;
  color-scheme: light;
}
/* red-only and dim: keeps your night vision in a dark shack */
:root[data-theme="night"] {
  --bg: #000000; --panel: #0b0101; --panel-2: #130303; --ink: #e8412f; --muted: #a12d22; --line: #3b0c07;
  --accent: #ff3b28; --accent-soft: #2b0703; --accent-ink: #000000; --live: #ff7a5c; --live-soft: #250806;
  --warn: #ff9248; --warn-soft: #261104; --danger: #ff2414; --danger-soft: #320603; --new: #1c0402;
  --shadow: none; --chart-1: #d93a29; --chart-2: #7a1d14;
  color-scheme: dark;
}
:root[data-theme="contrast"] {
  --bg: #000000; --panel: #000000; --panel-2: #141414; --ink: #ffffff; --muted: #d6d6d6; --line: #8c8c8c;
  --accent: #ffd400; --accent-soft: #2e2600; --accent-ink: #000000; --live: #46ff86; --live-soft: #002b12;
  --warn: #ffd400; --warn-soft: #2b2400; --danger: #ff6b6b; --danger-soft: #3a0000; --new: #262000;
  --shadow: none; --chart-1: #ffd400; --chart-2: #00c8ff;
  color-scheme: dark;
}
:root[data-theme="contrast"] .btn, :root[data-theme="contrast"] input, :root[data-theme="contrast"] select,
:root[data-theme="contrast"] textarea, :root[data-theme="contrast"] .panel { border-width: 2px; }
:root[data-theme="night"] img { filter: grayscale(1) sepia(1) hue-rotate(-50deg) saturate(4) brightness(.6); }

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 var(--sans); }
body { min-height: 100vh; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
.mono, .call { font-family: var(--mono); letter-spacing: .02em; }
.call { font-weight: 700; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.boot { padding: 40px; color: var(--muted); }
[hidden] { display: none !important; }

/* buttons & inputs */
.btn { text-decoration: none; display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--panel);
  padding: 7px 12px; border-radius: 8px; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn.primary:hover { filter: brightness(1.06); }
.btn.danger { color: var(--danger); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--panel-2); border-color: var(--line); }
.btn.sm { padding: 4px 9px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: default; }
.icon-btn { border: 0; background: transparent; cursor: pointer; padding: 4px 6px; border-radius: 6px; color: var(--muted); }
.icon-btn:hover { background: var(--panel-2); color: var(--ink); }
input[type=text], input[type=password], input[type=date], input[type=search], select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel);
}
input:focus, select:focus, textarea:focus, .btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
label.f { display: block; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase;
  letter-spacing: .05em; margin: 10px 0 4px; }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.right { margin-left: auto; }

/* header */
.top { display: flex; align-items: center; gap: 16px; padding: 10px 18px; background: var(--panel);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand img { width: 30px; height: 30px; }
.brand .t1 { font-weight: 750; font-size: 16px; line-height: 1.1; }
.brand .t2 { font-size: 12px; color: var(--muted); }
.netinfo { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.netinfo .date { font-weight: 650; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; font-size: 12px;
  font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.pill.live { background: var(--live-soft); color: var(--live); }
.pill.live::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--live);
  animation: pulse 1.6s infinite; }
.pill.closed { background: var(--panel-2); color: var(--muted); }
.pill.offline { background: var(--danger-soft); color: var(--danger); }
@keyframes pulse { 50% { opacity: .35; } }
.count-big { font-variant-numeric: tabular-nums; font-weight: 750; }
.clock { font-family: var(--mono); font-size: 13px; color: var(--muted); text-align: right; line-height: 1.25; }
.clock b { color: var(--ink); font-size: 15px; }
.nav { display: flex; gap: 4px; margin-left: auto; align-items: center; flex-wrap: wrap; }

/* announcements */
.ann { padding: 10px 18px 12px; background: var(--panel-2); border-bottom: 1px solid var(--line); }
.ann-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ann-head h2 { margin: 0; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--accent);
  display: flex; align-items: center; gap: 8px; }
.ann-unread { font-size: 12px; letter-spacing: 0; text-transform: none; color: var(--warn); font-weight: 600; }
.ann-tools { margin-left: auto; gap: 6px; flex-wrap: wrap; }
.seg { display: inline-flex; }
.seg .btn:first-child { border-radius: 8px 0 0 8px; }
.seg .btn:last-child { border-radius: 0 8px 8px 0; margin-left: -1px; }
/* who's online: flag to the right of the NC button */
.nc-group { display: inline-flex; align-items: center; }
.presence-flag { margin-left: -2px; min-width: 24px; height: 22px; padding: 0 7px; border-radius: 99px; border: 0;
  background: var(--live); color: #fff; font: 700 12.5px/22px inherit; font-family: inherit; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 4px; position: relative; top: -6px; }
.presence-flag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.presence-flag.zero { background: var(--line); color: var(--muted); }
.presence-flag:hover { filter: brightness(1.08); }
.presence-flag:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pres-list { list-style: none; margin: 0; padding: 0; }
.pres-row { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.pres-row:last-child { border-bottom: 0; }
.pres-row .call { font-family: var(--mono, ui-monospace, Consolas, monospace); font-weight: 700; font-size: 16px; margin-right: 6px; }
.pres-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--live); flex: none; box-shadow: 0 0 0 3px var(--live-soft); }
.pres-tag { display: inline-block; margin-left: 6px; padding: 0 7px; border-radius: 99px; background: var(--accent-soft);
  color: var(--accent); font-size: 11.5px; font-weight: 700; }
.keybox { padding: 6px 10px; border-radius: 6px; background: var(--panel); border: 1px solid var(--line); font-size: 14px; user-select: all; word-break: break-all; }
/* notes between net controllers */
#notesnew { margin-left: 2px; background: var(--danger); color: #fff; }
.note-compose textarea { width: 100%; margin: 8px 0; resize: vertical; font: inherit; }
.note { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; }
.note.unread { border-color: var(--accent); box-shadow: inset 4px 0 0 var(--accent); }
.note.mine { background: var(--bg, transparent); }
.note-h { display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }
.note-h .call { font-weight: 700; }
.note-b { white-space: pre-wrap; margin: 6px 0; font-size: 15px; line-height: 1.4; overflow-wrap: anywhere; }
.note-a { display: flex; gap: 8px; align-items: center; }
.note-toast { cursor: pointer; max-width: 360px; text-align: left; }
.note-toast .nt-body { margin: 4px 0; white-space: pre-wrap; }
.count-pill { display: inline-block; min-width: 20px; padding: 0 7px; border-radius: 99px; background: var(--accent-soft);
  color: var(--accent); font-size: 12px; font-weight: 700; letter-spacing: 0; text-align: center; }
.ann-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr)); gap: 10px;
  margin-top: 10px; max-height: 46vh; overflow-y: auto; }
.ann-card { display: flex; gap: 12px; align-items: flex-start; background: var(--panel); border: 1px solid var(--line);
  border-left: 5px solid var(--line); border-radius: var(--radius); padding: 10px 12px; }
.ann-card.unread { border-left-color: var(--accent); }
.ann-card.standing { background: var(--panel); }
.ann-num { flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%; background: var(--accent-soft); color: var(--accent);
  font-weight: 800; display: flex; align-items: center; justify-content: center; font-size: 15px; }
.ann-main { flex: 1; min-width: 0; }
.ann-card .txt { font-size: var(--ann-size, 17px); line-height: 1.4; font-weight: 500; white-space: pre-wrap; overflow-wrap: anywhere; }
.ann-card .meta, .read-item .meta { font-size: 12.5px; color: var(--muted); margin-top: 5px; }
.meta b.unread { color: var(--accent); }
.ann-card .txt, .read-text { color: var(--ink); }
.ann-acts { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.ann-empty { color: var(--muted); font-style: italic; padding: 4px 0; }
/* read-on-air view */
.modal.wide { width: min(1300px, 100%); }
.modal.mid { width: min(820px, 100%); }
.readview .modal { min-height: 80vh; }
.read-item { display: flex; gap: 18px; align-items: flex-start; padding: 18px 6px; border-bottom: 1px solid var(--line); }
.read-item:last-child { border-bottom: 0; }
.read-num { flex: 0 0 auto; width: calc(var(--read-size, 30px) * 1.5); height: calc(var(--read-size, 30px) * 1.5);
  border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 800;
  font-size: var(--read-size, 30px); display: flex; align-items: center; justify-content: center; }
.read-text { font-size: var(--read-size, 30px); line-height: 1.35; font-weight: 550; white-space: pre-wrap; overflow-wrap: anywhere; }
.read-item:not(.unread) .read-text { opacity: .7; }
.read-item .meta { font-size: 14px; }
.read-btn { font-size: 16px; padding: 10px 16px; }
.read-acts { display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
/* stat tile explanations */
.tile[data-tip] { position: relative; cursor: help; }
.tile[data-tip]:hover::after, .tile[data-tip]:focus::after {
  content: attr(data-tip); position: absolute; left: 0; bottom: calc(100% + 8px); width: 270px; z-index: 60;
  background: var(--ink); color: var(--bg); padding: 9px 11px; border-radius: 8px; font-size: 12.5px; line-height: 1.45;
  font-weight: 400; text-transform: none; letter-spacing: 0; box-shadow: var(--shadow); white-space: normal; }
.tile[data-tip]:nth-child(3n)::after { left: auto; right: 0; }
.tile[data-tip]:nth-child(3n+2)::after { left: 50%; transform: translateX(-50%); }
.tile[data-tip]:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
/* exception report */
.subtabs { margin-top: 4px; }
.ex-bulk { margin: 0 0 8px; padding: 8px 0; position: sticky; top: 58px; background: var(--panel); z-index: 1; }
table.t.ex td { vertical-align: middle; }
table.t.ex input[type=text] { padding: 4px 7px; }
table.t.sheet td { white-space: nowrap; max-width: 380px; overflow: hidden; text-overflow: ellipsis; font-size: 13px; }
.tag { display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 4px;
  background: var(--accent-soft); color: var(--accent); letter-spacing: .03em; text-transform: uppercase; }

/* main layout */
.main > * { min-width: 0; }
.main { display: grid; grid-template-columns: minmax(440px, 44%) 1fr; gap: 16px; padding: 16px 18px; align-items: start; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.panel > header { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.panel > header h2 { margin: 0; font-size: 15px; }
.panel .body { padding: 14px; }
.sticky-col { position: sticky; top: 76px; }

/* check-in entry */
.entry .callwrap { position: relative; }
.entry input.callin { font-family: var(--mono); font-size: 26px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; padding: 10px 12px; }
.suggest { position: absolute; left: 0; right: 0; top: 100%; z-index: 30; background: var(--panel);
  border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); margin-top: 4px;
  max-height: 340px; overflow-y: auto; }
.suggest .opt { display: grid; grid-template-columns: 110px 1fr auto; gap: 8px; padding: 7px 12px; cursor: pointer;
  align-items: baseline; }
.suggest .opt.sel, .suggest .opt:hover { background: var(--accent-soft); }
.suggest .opt .n { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.suggest mark { background: none; color: var(--accent); }
.entry-grid { display: grid; grid-template-columns: 140px 1fr; gap: 8px; margin-top: 8px; }
.entry .logbtn { width: 100%; justify-content: center; margin-top: 10px; padding: 11px; font-size: 16px; }
.kbd { font-family: var(--mono); font-size: 11px; border: 1px solid var(--line); border-bottom-width: 2px;
  border-radius: 4px; padding: 0 4px; color: var(--muted); }

/* caller card */
.caller { margin-top: 14px; border-top: 1px dashed var(--line); padding-top: 14px; }
.caller .head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.caller .head .call { font-size: 24px; }
.caller .head .nm { font-size: 18px; }
.caller .loc { color: var(--muted); font-size: 13px; }
.banner { border-radius: 8px; padding: 8px 10px; margin: 10px 0 0; font-size: 14px; }
.banner.warn { background: var(--warn-soft); color: var(--warn); }
.banner.new { background: var(--live-soft); color: var(--live); font-weight: 600; }
.banner.milestone { background: var(--accent-soft); color: var(--accent); font-weight: 650; }
.banner.ok { background: var(--live-soft); color: var(--live); }
.banner.err { background: var(--danger-soft); color: var(--danger); }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.tile { background: var(--panel-2); border-radius: 8px; padding: 8px 10px; }
.tile .k { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.tile .v { font-size: 20px; font-weight: 750; font-variant-numeric: tabular-nums; line-height: 1.2; }
.tile .v.sm { font-size: 15px; }
.tile .s { font-size: 12px; color: var(--muted); }
.meter { height: 6px; background: var(--panel-2); border-radius: 3px; overflow: hidden; margin-top: 4px; }
.meter > i { display: block; height: 100%; background: var(--accent); }
.last10 { margin-top: 12px; }
.last10 h3, .section-h { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted);
  margin: 0 0 6px; }
.last10 ol { list-style: none; margin: 0; padding: 0; }
.last10 li { display: grid; grid-template-columns: 92px 1fr; gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--line);
  font-size: 13.5px; }
.last10 li:last-child { border-bottom: 0; }
.last10 .d { font-variant-numeric: tabular-nums; color: var(--muted); }
.notes-box { white-space: pre-wrap; background: var(--panel-2); border-radius: 8px; padding: 8px 10px; font-size: 13.5px; margin-top: 10px; }

/* net log */
.log-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.log-tools input[type=search] { width: 180px; padding: 5px 9px; }
table.t { width: 100%; border-collapse: collapse; }
table.t th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted);
  font-weight: 650; padding: 8px 10px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--panel); }
table.t td { padding: 7px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.t tr:last-child td { border-bottom: 0; }
table.t td.num { font-variant-numeric: tabular-nums; color: var(--muted); width: 1%; white-space: nowrap; }
table.t td.time { font-variant-numeric: tabular-nums; color: var(--muted); white-space: nowrap; width: 1%; font-size: 13px; }
table.t td.c { white-space: nowrap; width: 1%; }
table.t td.acts { width: 1%; white-space: nowrap; text-align: right; padding-top: 4px; padding-bottom: 4px; }
table.t td.acts .icon-btn { padding: 2px 6px; }
#logtable, .mbody { overflow-x: auto; }
table.t tr.flash td { animation: flash 2.4s ease-out; }
@keyframes flash { from { background: var(--new); } to { background: transparent; } }
table.t tr.sel td { background: var(--accent-soft); }
table.t tr.click { cursor: pointer; }
table.t tr.click:hover td { background: var(--panel-2); }
table.t tbody tr .acts .icon-btn { visibility: hidden; }
table.t tbody tr:hover .acts .icon-btn, table.t tbody tr:focus-within .acts .icon-btn { visibility: visible; }
.calllink { cursor: pointer; text-decoration: none; color: inherit; }
.calllink:hover { color: var(--accent); text-decoration: underline; }
.empty { padding: 30px; text-align: center; color: var(--muted); }
.netnotes { border-bottom: 1px solid var(--line); padding: 10px 14px; background: var(--panel-2); }
.netnotes summary { cursor: pointer; font-weight: 600; font-size: 13px; color: var(--muted); }
.netnotes .notes-text { white-space: pre-wrap; font-size: 14px; margin-top: 6px; }
.start-net { max-width: 520px; margin: 20px auto; padding: 10px; }
.start-net h3 { margin: 0 0 4px; }

/* modal */
.overlay { position: fixed; inset: 0; background: rgba(20, 12, 6, .45); z-index: 100; display: flex;
  align-items: flex-start; justify-content: center; padding: 4vh 16px; overflow-y: auto; }
.modal { background: var(--panel); border-radius: 14px; width: min(1100px, 100%); box-shadow: 0 10px 50px rgba(0,0,0,.35);
  border: 1px solid var(--line); }
.modal.narrow { width: min(520px, 100%); }
.modal > header { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line);
  position: sticky; top: -4vh; background: var(--panel); border-radius: 14px 14px 0 0; z-index: 2; }
/* top: -4vh pins the title to the very top of the screen (the overlay's padding), so rows can't scroll above it */
.modal > header h2 { margin: 0; font-size: 18px; }
.modal .mbody { padding: 16px 18px 20px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: -4px 0 14px; flex-wrap: wrap; }
.tabs button { border: 0; background: none; padding: 8px 12px; cursor: pointer; border-bottom: 2px solid transparent;
  color: var(--muted); font-weight: 600; }
.tabs button.on { color: var(--ink); border-bottom-color: var(--accent); }

/* stats */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.kpi { background: var(--panel-2); border-radius: 10px; padding: 10px 12px; }
.kpi .k { font-size: 12px; color: var(--muted); font-weight: 600; }
.kpi .v { font-size: 26px; font-weight: 780; font-variant-numeric: tabular-nums; line-height: 1.15; }
.kpi .s { font-size: 12px; color: var(--muted); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 18px; }
.card { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.card h3 { margin: 0 0 8px; font-size: 14px; }
.chart svg { width: 100%; height: auto; display: block; }
.chart .ax { fill: var(--muted); font-size: 11px; font-family: var(--sans); }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .bar { fill: var(--chart-1); }
.chart .bar2 { fill: var(--chart-2); }
.chart .bar:hover, .chart .bar2:hover { opacity: .8; }
.chart .ln { fill: none; stroke: var(--chart-1); stroke-width: 2.2; }
.chart .dot { fill: var(--chart-1); }
.chart .lab { fill: var(--ink); font-size: 11px; font-weight: 600; font-family: var(--sans); }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); margin-top: 4px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
table.t.compact td, table.t.compact th { padding: 5px 8px; font-size: 13.5px; }
.rank { color: var(--muted); font-variant-numeric: tabular-nums; width: 1%; }

/* login */
.center { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login { width: min(400px, 100%); padding: 26px; }
.login h1 { font-size: 20px; margin: 10px 0 2px; }
.login .btn.primary { width: 100%; justify-content: center; margin-top: 16px; padding: 10px; }

/* toasts */
#toasts { position: fixed; bottom: 18px; right: 18px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: 8px; box-shadow: var(--shadow);
  max-width: 380px; animation: tin .2s ease-out; }
.toast.err { background: var(--danger); color: #fff; }
@keyframes tin { from { transform: translateY(8px); opacity: 0; } }
.conn-lost { background: var(--danger-soft); color: var(--danger); text-align: center; padding: 6px; font-weight: 600; font-size: 14px; }

.edit-row input { padding: 4px 7px; }
.menu { position: relative; }
.menu-pop { position: absolute; right: 0; top: 110%; background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: var(--shadow); min-width: 210px; padding: 6px; z-index: 40; }
.menu-pop button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 7px 10px;
  border-radius: 6px; cursor: pointer; }
.menu-pop button:hover { background: var(--panel-2); }
.menu-pop .who { padding: 6px 10px 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; font-size: 13px; }
pre.result { white-space: pre-wrap; background: var(--panel-2); padding: 10px; border-radius: 8px; font-size: 13px; max-height: 300px; overflow: auto; }
.dropzone { border: 2px dashed var(--line); border-radius: 12px; padding: 22px; text-align: center; color: var(--muted); }
.dropzone.over { border-color: var(--accent); background: var(--accent-soft); }

/* check-in button, step 1 of 2: "Continue → comment" */
.logbtn.step1 { background: var(--panel); color: var(--accent); border: 2px solid var(--accent); }
.logbtn.step1:hover { background: var(--accent-soft); }
.logbtn:disabled { opacity: .55; cursor: not-allowed; }

/* roster panel: a third column that stays open beside the log */
body.roster-open .main { grid-template-columns: minmax(400px, 36%) minmax(0, 1fr) minmax(300px, 350px); }
.roster-col { position: sticky; top: 76px; max-height: calc(100vh - 92px); display: flex; flex-direction: column; min-height: 0; }
.roster-col[hidden] { display: none; }
.rp-body { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.rp-search { padding: 10px 12px 6px; border-bottom: 1px solid var(--line); }
.rp-search input { width: 100%; font-size: 16px; }
.rp-search .small { margin-top: 5px; }
.rp-list { overflow-y: auto; flex: 1; min-height: 120px; padding: 4px 0; }
.rp-item { border-bottom: 1px solid var(--line); }
.rp-item.open { background: var(--accent-soft); }
.rp-row { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: baseline; width: 100%; text-align: left;
  padding: 7px 12px; background: none; border: 0; color: var(--ink); font: inherit; cursor: pointer; }
.rp-row:hover { background: var(--accent-soft); }
.rp-row .call { font-weight: 700; }
.rp-row .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-row .n { color: var(--muted); font-size: 12px; white-space: nowrap; }
.rp-detail { padding: 2px 12px 12px; }
.rp-stats { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 4px 0; }
.rp-recent { margin: 6px 0 0; padding-left: 0; list-style: none; font-size: 13px; }
.rp-recent li { padding: 2px 0; }
.rp-recent .d { color: var(--muted); display: inline-block; min-width: 74px; }
.nav .btn.on { background: var(--accent-soft); color: var(--accent); }
@media (max-width: 1250px) {
  body.roster-open .main { grid-template-columns: minmax(400px, 44%) 1fr; }
  .roster-col { position: fixed; right: 12px; top: calc(var(--header-h, 70px) + 8px); bottom: 12px; max-height: none; width: min(360px, calc(100vw - 24px));
    z-index: 60; box-shadow: 0 10px 40px rgba(0,0,0,.3); }
}

@media (max-width: 980px) {
  .main, body.roster-open .main { grid-template-columns: 1fr; padding: 10px; }
  .sticky-col { position: static; }
  .grid2 { grid-template-columns: 1fr; }
  .ann { padding: 8px 10px; }
  .ann-tools { margin-left: 0; }
  .top { padding: 8px 10px; gap: 10px; }
  .clock { display: none; }
  .brand .t2, .nav .btn.ghost { font-size: 13px; }
  .nav { margin-left: 0; width: 100%; }
  .panel > header { flex-wrap: wrap; }
  .log-tools { margin-left: 0; }
  table.t tbody tr .acts .icon-btn { visibility: visible; }
}

@media print {
  .top, .ann, .entry-col, .log-tools, .acts, #toasts { display: none !important; }
  .main { display: block; padding: 0; }
  .panel { box-shadow: none; border: 0; }
}

/* versions, about */
.ver-bar { display: flex; align-items: center; gap: 10px; justify-content: center; flex-wrap: wrap; padding: 8px 14px;
  background: var(--accent-soft); color: var(--ink); font-size: 14px; border-bottom: 1px solid var(--line); }
.ver-link { color: inherit; text-decoration: none; border-bottom: 1px dotted currentColor; }
.ver-link:hover { color: var(--accent); }
.about { max-width: 760px; }
.about-hero { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 14px 16px; background: var(--panel-2); border-radius: 12px; margin-bottom: 14px; }
.about-hero .brand img { width: 44px; height: 44px; }
.about-hero .brand .t1 { font-size: 20px; }
.about-ver { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.about ul { padding-left: 20px; }
.about li { margin: 4px 0; }
.credits td:first-child { white-space: nowrap; width: 1%; }
.copyright { margin-top: 18px; font-size: 12.5px; color: var(--muted); text-align: center; }
.changelog h2 { font-size: 17px; margin: 20px 0 6px; padding-top: 12px; border-top: 1px solid var(--line); }
.changelog h2:first-child { border-top: 0; margin-top: 0; padding-top: 0; }
.changelog h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 12px 0 4px; }
.changelog ul { margin: 0; padding-left: 20px; }
.changelog li { margin: 4px 0; }
.changelog code { font-family: var(--mono); font-size: 13px; background: var(--panel-2); padding: 0 4px; border-radius: 4px; }

/* net controllers */
.nc-chip { display: inline-block; padding: 1px 8px; border-radius: 6px; font-size: 13px;
  background: hsl(var(--h) 60% 50% / .16); border: 1px solid hsl(var(--h) 55% 45% / .35); }
.rotation { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 6px; }
.rot { display: flex; flex-direction: column; gap: 3px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px;
  text-decoration: none; color: inherit; background: var(--panel); }
.rot:hover { border-color: var(--accent); }
.rot-d { font-size: 11.5px; color: var(--muted); }
.rot-co { font-size: 11px; color: var(--muted); font-family: var(--mono); }
.nc-table th[data-sort] { cursor: pointer; user-select: none; white-space: nowrap; }
.nc-table th.sorted { color: var(--accent); }
.nc-table td.strong { color: var(--ink); font-weight: 700; }
.up { color: var(--live); font-size: 11px; }
.down { color: var(--warn); font-size: 11px; }

/* the check-in panel: the most important thing on the screen */
.entry { border: 2px solid var(--accent); box-shadow: 0 2px 4px rgba(0,0,0,.06), 0 10px 30px color-mix(in srgb, var(--accent) 18%, transparent); }
.entry > header { background: var(--accent); color: var(--accent-ink); border-bottom: 0; border-radius: 10px 10px 0 0; padding: 12px 16px; }
.entry > header h2 { font-size: 19px; letter-spacing: .01em; }
.entry > header .muted, .entry > header .kbd { color: var(--accent-ink); opacity: .85; border-color: currentColor; }
/* talk timer in the check-in header */
.turn-timer { margin-left: auto; font: 800 30px/1 var(--mono); letter-spacing: .02em; padding: 4px 14px; border-radius: 10px;
  background: #1f9d55; color: #fff; box-shadow: 0 0 0 2px rgba(255,255,255,.35); font-variant-numeric: tabular-nums; min-width: 3.4em; text-align: center; }
.turn-timer.warn { background: #f2c200; color: #2a2000; }
.turn-timer.over { background: #d62828; color: #fff; animation: turn-pulse 1s ease-in-out infinite; }
.turn-timer.done { animation: none; opacity: .6; box-shadow: none; }
.turn-timer[hidden] { display: none; }
.turn-timer:not([hidden]) ~ .right { margin-left: 12px; }
@keyframes turn-pulse { 50% { box-shadow: 0 0 0 5px rgba(214,40,40,.35); } }
@media (prefers-reduced-motion: reduce) { .turn-timer.over { animation: none; } }
.next-no { margin-left: 10px; font-size: 14px; font-weight: 600; background: color-mix(in srgb, var(--accent-ink) 18%, transparent); padding: 2px 10px; border-radius: 99px; }
.entry .body { padding: 18px; }
.entry input.callin { font-size: 38px; padding: 14px 16px; letter-spacing: .08em; border-width: 2px; }
.entry input.callin:focus { outline: 3px solid var(--accent); outline-offset: 1px; }
.entry-grid { grid-template-columns: 180px 1fr; gap: 10px; margin-top: 10px; }
.entry-grid input { font-size: 18px; padding: 11px 12px; }
.entry .logbtn { font-size: 19px; padding: 14px; margin-top: 12px; }
.suggest .opt { padding: 9px 14px; font-size: 16px; grid-template-columns: 130px 1fr auto; }
.caller .head .call { font-size: 30px; }
.caller .head .nm { font-size: 22px; }
.caller .tile .v { font-size: 24px; }
.caller .tile .v.sm { font-size: 17px; }
.caller .last10 li { font-size: 15px; }
.caller .banner { font-size: 15.5px; padding: 10px 12px; }
@media (max-width: 980px) {
  .entry input.callin { font-size: 30px; }
  .entry-grid { grid-template-columns: 1fr; }
}
#logpanel > header { flex-wrap: wrap; row-gap: 8px; }
#logpanel > header h2 { white-space: nowrap; }
#logpanel .log-tools { flex-wrap: wrap; justify-content: flex-end; }
.caller .last10 li { grid-template-columns: 118px 1fr; }
.caller .last10 .d { white-space: nowrap; }

.ok-tag { display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 4px;
  background: var(--live-soft); color: var(--live); text-transform: uppercase; letter-spacing: .03em; }

/* bug reports & feature requests */
.fb-choice { flex: 1; min-width: 200px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; cursor: pointer; }
.fb-choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.fb-kind { white-space: nowrap; font-size: 13px; }
.fb-status { display: inline-block; font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 99px; white-space: nowrap;
  background: var(--panel-2); color: var(--muted); }
.fb-status.st-new { background: var(--accent-soft); color: var(--accent); }
.fb-status.st-planned, .fb-status.st-in_progress { background: var(--warn-soft); color: var(--warn); }
.fb-status.st-done { background: var(--live-soft); color: var(--live); }
.prio-high { color: var(--warn); font-weight: 600; }
.prio-urgent { color: var(--danger); font-weight: 700; }
.prio-low { color: var(--muted); }
.fb-meta { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px 16px;
  background: var(--panel-2); border-radius: 10px; padding: 12px 14px; }
.fb-meta .k { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 3px; }
.fb-comments { display: flex; flex-direction: column; gap: 8px; }
.fb-c { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.fb-c > div:last-child { white-space: pre-wrap; }
.fb-c .meta { font-size: 12px; color: var(--muted); margin-bottom: 3px; white-space: normal; }
.fb-c.sys { background: var(--panel-2); font-size: 13px; color: var(--muted); }
#fbnew { margin-left: 2px; background: var(--danger); color: #fff; }

/* clear the entry */
.callwrap .call-clear { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px;
  border-radius: 50%; border: 0; background: var(--panel-2); color: var(--muted); font-size: 18px; cursor: pointer; }
.callwrap .call-clear:hover { background: var(--danger-soft); color: var(--danger); }
.entry input.callin { padding-right: 58px; }
.log-row { display: flex; gap: 10px; align-items: stretch; margin-top: 12px; }
.log-row .logbtn { flex: 1; margin-top: 0; }
.log-row .clearbtn { font-size: 16px; padding: 0 18px; }
/* color scheme picker */
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.theme-card { display: flex; flex-direction: column; gap: 4px; text-align: left; padding: 10px; border: 2px solid var(--line);
  border-radius: 12px; background: var(--panel); cursor: pointer; color: var(--ink); }
.theme-card:hover { border-color: var(--accent); }
.theme-card.on { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.theme-prev { position: relative; display: block; height: 86px; border-radius: 8px; overflow: hidden; border: 1px solid rgba(128,128,128,.35); }
.tp-bar { position: absolute; left: 0; right: 0; top: 0; height: 14px; }
.tp-panel { position: absolute; left: 12px; right: 12px; top: 24px; bottom: 10px; border-radius: 6px; border: 2px solid; padding: 8px; }
.tp-line { display: block; height: 5px; border-radius: 3px; width: 80%; opacity: .75; margin-bottom: 6px; }
.tp-line.short { width: 50%; }
.tp-btn { position: absolute; right: 8px; bottom: 8px; width: 34px; height: 12px; border-radius: 4px; }
.tp-half { position: absolute; right: 0; top: 0; bottom: 0; width: 50%; opacity: .92; }
.theme-name { font-weight: 700; margin-top: 4px; }
.theme-desc { font-size: 12.5px; color: var(--muted); }
