:root {
  --bg: #F4F5F7;
  --surface: #FFFFFF;
  --raised: #FAFAFB;
  --sunken: #ECEDF0;
  --border: #E3E5E9;
  --border-strong: #D5D8DE;
  --text: #17181B;
  --text-2: #565A62;
  --muted: #9AA0A8;
  --red: #E0242B;
  --red-hover: #B51C22;
  --red-tint: #FDF2F2;
  --red-border: #F6C9CB;
  --amber: #A15C07;
  --amber-tint: #FDF6EA;
  --amber-border: #F1DDB5;
  --green: #1D7A4E;
  --shadow: 0 1px 2px rgba(16,18,22,.04), 0 2px 6px rgba(16,18,22,.06);
  --shadow-lg: 0 1px 2px rgba(16,18,22,.05), 0 8px 24px rgba(16,18,22,.08);
  --radius: 14px;
  --radius-sm: 8px;
  --side-w: 264px;
  --row-h: 44px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Meiryo", system-ui, sans-serif;
  --mono: "SF Mono", ui-monospace, "Menlo", "Consolas", monospace;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 14px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "palt" 1;
}
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
kbd {
  font: 500 11px/1 var(--mono); color: var(--muted);
  border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 5px;
  padding: 2px 5px; background: var(--surface);
}
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.num, .tabular { font-variant-numeric: tabular-nums; }

/* ---------- shell (after the DERECHO lab's frame: floating sidebar card, measuring grid, strip) ---------- */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("/fonts/inter.woff2") format("woff2"); }
html { background: var(--bg); }
/* Nothing shows until /api/me confirms a session: signed-out visitors go straight to /login. */
html.booting body { visibility: hidden; }
body {
  background-color: var(--bg);
  background-image:
    radial-gradient(1100px 480px at 12% -12%, rgba(224, 36, 43, .055), transparent 62%),
    linear-gradient(rgba(16, 18, 22, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16, 18, 22, .035) 1px, transparent 1px);
  background-size: auto, 44px 44px, 44px 44px;
  background-attachment: fixed;
}
.side {
  position: fixed; inset: 12px auto 12px 12px; width: var(--side-w); z-index: 40;
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; overflow: hidden;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 18px 18px 16px; border-bottom: 1px solid var(--border); }
.brand-mark {
  width: 30px; height: 30px; border-radius: 8px; background: var(--red); color: #fff; flex: none;
  display: grid; place-items: center; font: 800 15px/1 var(--font);
  box-shadow: 0 1px 2px rgba(224,36,43,.3), inset 0 -1px 0 rgba(0,0,0,.12);
}
.brand-text b { display: block; font: 800 15px/1.1 var(--font); letter-spacing: .14em; }
.brand-text span { display: block; color: var(--muted); font: 500 12px/1.3 var(--font); margin-top: 3px; }
.side-links { flex: 1; overflow-y: auto; padding: 12px 10px 16px; scrollbar-width: none; }
.side-links::-webkit-scrollbar { display: none; }
.side-search {
  width: 100%; display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 10px; margin-bottom: 2px;
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text-2);
  cursor: pointer; font-size: 13.5px; font-weight: 500; box-shadow: var(--shadow); transition: border-color .12s, color .12s;
}
.side-search:hover { color: var(--text); border-color: var(--red-border); }
.side-search svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; flex: none; }
.side-search span { flex: 1; text-align: left; }

/* the main search: one palette over every page */
.palette { position: fixed; inset: 0; z-index: 80; background: rgba(16,18,22,.32); display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; }
.palette[hidden] { display: none; }
.pal-box {
  width: min(640px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  box-shadow: 0 2px 4px rgba(16,18,22,.06), 0 24px 64px rgba(16,18,22,.22); overflow: hidden; display: flex; flex-direction: column; max-height: 76vh;
}
.pal-input { display: flex; align-items: center; gap: 10px; padding: 0 16px; height: 56px; border-bottom: 1px solid var(--border); }
.pal-input svg { width: 18px; height: 18px; fill: none; stroke: var(--red); stroke-width: 1.9; flex: none; }
.pal-input input { flex: 1; border: 0; outline: none; font-size: 16px; background: transparent; min-width: 0; }
.pal-input input::placeholder { color: var(--muted); }
.pal-list { overflow-y: auto; padding: 6px; }
.pal-label { padding: 10px 10px 6px; font: 600 11px/1 var(--font); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.pal-item { display: grid; grid-template-columns: 76px 1fr auto; gap: 12px; align-items: center; padding: 9px 10px; border-radius: 10px; cursor: pointer; }
.pal-item .no { font: 500 12.5px var(--mono); color: var(--text-2); }
.pal-item .who { min-width: 0; }
.pal-item .who b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pal-item .who small { display: block; color: var(--text-2); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pal-item .tags { display: flex; gap: 6px; }
.pal-item.sel { background: var(--red-tint); box-shadow: inset 3px 0 0 var(--red); }
.pal-none { padding: 28px 12px; text-align: center; color: var(--text-2); font-size: 13px; }
.pal-foot { display: flex; gap: 16px; padding: 9px 16px; border-top: 1px solid var(--border); background: var(--raised); font-size: 12px; color: var(--muted); }
.pal-foot span:last-child { margin-left: auto; }

/* table filters: local to one table, visibly not the main search */
.filter { background: var(--surface); border: 1px solid var(--border); box-shadow: none; height: 34px; border-radius: 9px; }
.filter svg { stroke: var(--text-2); }
.filter .count { font: 500 12px var(--mono); color: var(--muted); white-space: nowrap; }
.toolbar .filter { height: 40px; border-radius: 10px; }
.table-tools { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--raised); flex-wrap: wrap; }
.table-tools .filter { flex: 0 1 340px; }
.side-group { color: var(--muted); font: 600 11px/1 var(--font); letter-spacing: .12em; text-transform: uppercase; padding: 18px 10px 8px; }
.side-links a {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px;
  color: var(--text-2); font: 500 14px/1.3 var(--font); transition: background .12s, color .12s;
}
.side-links a svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.side-links a span { flex: 1; min-width: 0; }
.side-links a:hover { color: var(--text); background: var(--raised); }
.side-links a.active { color: var(--red); background: var(--red-tint); font-weight: 600; }
.side-badge { background: var(--red); color: #fff; font: 700 11px/1 var(--font); padding: 3px 7px; border-radius: 999px; }
.side-count { color: var(--muted); font: 500 12px/1 var(--mono); }
.side-foot { border-top: 1px solid var(--border); padding: 12px 18px 14px; }
.side-foot-row { display: flex; align-items: center; gap: 10px; }
.side-avatar { width: 32px; height: 32px; flex: none; border-radius: 50%; display: grid; place-items: center; background: #E7F2EC; }
.side-avatar i { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(29,122,78,.15); }
.side-who { min-width: 0; flex: 1; }
.side-who b { display: block; font: 600 13.5px/1.2 var(--font); }
.side-who small { display: block; color: var(--muted); font: 500 12px/1.3 var(--font); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.topbar { display: none; }
.scrim { display: none; }

.shell {
  margin-left: calc(var(--side-w) + 24px); height: 100vh; height: 100dvh;
  display: flex; flex-direction: column; padding: 26px 32px 0; max-width: calc(1480px + var(--side-w) + 24px);
}
.strip {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 0 0 12px; margin: 0 0 4px; border-bottom: 1px solid var(--border);
  font: 600 11px/1.2 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
}
.strip a:hover { color: var(--red); }
.strip-path { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; min-width: 0; }
.strip-path i { font-style: normal; opacity: .45; }
.strip-path b { color: var(--red); font-weight: 700; }
.strip-right { display: flex; gap: 14px; align-items: center; }
.strip-alert { color: var(--red); }
.strip-alert::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--red); margin-right: 6px; vertical-align: 1px; box-shadow: 0 0 0 3px var(--red-tint); }

/* corner brackets on the panels that hold live data (the lab's .lab-panel) */
.bracket { position: relative; }
.bracket::before, .bracket::after {
  content: ""; position: absolute; width: 14px; height: 14px; pointer-events: none; z-index: 3;
  border: 1.5px solid rgba(224, 36, 43, .55);
}
.bracket::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; border-top-left-radius: var(--radius); }
.bracket::after { bottom: -1px; right: -1px; border-left: 0; border-top: 0; border-bottom-right-radius: var(--radius); }

main { min-width: 0; min-height: 0; flex: 1; overflow: hidden; display: flex; flex-direction: column; outline: none; }
.page { display: flex; flex-direction: column; min-height: 0; flex: 1; padding: 18px 0 20px; gap: 16px; }
.page-scroll { overflow-y: auto; margin: 0 -8px; padding-left: 8px; padding-right: 8px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 26px; font-weight: 700; letter-spacing: -.025em; }
.page-head .sub { color: var(--text-2); font-size: 13px; margin-top: 4px; }
.page-head .sub b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- toolbar ---------- */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.search {
  flex: 1 1 320px; display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px;
  background: var(--sunken); border: 1px solid transparent; border-radius: 10px;
  box-shadow: inset 0 1px 2px rgba(16,18,22,.05); transition: background .12s, border-color .12s, box-shadow .12s;
}
.search:focus-within { background: var(--surface); border-color: var(--red-border); box-shadow: 0 0 0 3px var(--red-tint); }
.search svg { width: 16px; height: 16px; stroke: var(--muted); fill: none; stroke-width: 1.8; flex: none; }
.search input { flex: 1; border: 0; background: transparent; outline: none; min-width: 0; font-size: 14px; }
.search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.search input::placeholder { color: var(--muted); }
.select {
  height: 40px; padding: 0 30px 0 12px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5l3 3 3-3' fill='none' stroke='%239AA0A8' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E") right 10px center / 12px no-repeat;
  appearance: none; box-shadow: var(--shadow); cursor: pointer; color: var(--text-2); font-size: 13px; font-weight: 500;
}
.select.on { color: var(--red); border-color: var(--red-border); }
.select:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }
.btn {
  height: 36px; padding: 0 14px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface);
  box-shadow: var(--shadow); cursor: pointer; font-weight: 550; font-size: 13px; color: var(--text-2);
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
}
.btn:hover { background: var(--raised); color: var(--text); }
.btn.primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn.primary:hover { background: var(--red-hover); }
.btn.ghost { box-shadow: none; border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--sunken); }
.btn.icon { width: 36px; padding: 0; justify-content: center; }
.btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.btn:disabled { opacity: .4; cursor: default; }
.link-btn { border: 0; background: none; color: var(--red); cursor: pointer; padding: 0; font-weight: 550; font-size: 12px; }
.link-btn:hover { color: var(--red-hover); text-decoration: underline; }

/* ---------- table ---------- */
.table-card {
  flex: 1; min-height: 0; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column;
}
.table-scroll { flex: 1; overflow: auto; position: relative; overscroll-behavior: contain; }
.grid-row {
  --cols: 112px minmax(140px, 1.3fr) minmax(140px, 1.1fr) 96px 92px minmax(110px, 1fr) 150px 116px;
  display: grid; grid-template-columns: var(--cols); align-items: center; min-width: 980px;
}
.grid-row > * { padding: 0 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thead {
  position: sticky; top: 0; z-index: 2; height: 38px; background: var(--sunken);
  border-bottom: 1px solid var(--border); font-size: 12px; font-weight: 600; color: var(--text-2);
}
.thead button { all: unset; cursor: pointer; display: inline-flex; gap: 4px; align-items: center; }
.thead button:hover { color: var(--text); }
.thead .sorted { color: var(--text); }
.tbody { position: relative; }
.trow {
  position: absolute; left: 0; right: 0; height: var(--row-h); border-bottom: 1px solid var(--border);
  cursor: pointer; font-size: 13.5px; transition: background .08s;
}
.trow:hover { background: var(--raised); }
.trow.sel { background: var(--raised); box-shadow: inset 3px 0 0 var(--red); }
.trow .no { font: 500 12.5px var(--mono); color: var(--text-2); }
.trow .name { font-weight: 600; }
.trow .kana { color: var(--text-2); font-size: 12.5px; }
.trow .dim { color: var(--muted); }
.trow mark, .hl { background: var(--red-tint); color: var(--red); border-radius: 3px; padding: 0 1px; }
.empty-row { padding: 48px 16px; text-align: center; color: var(--text-2); }
.table-foot {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 14px;
  border-top: 1px solid var(--border); background: var(--raised); font-size: 12px; color: var(--muted);
}
.table-foot .keys { display: flex; gap: 14px; align-items: center; }

/* ---------- data tables (table.js) ---------- */
.dt .table-tools { justify-content: space-between; }
.dt .table-wrap { max-height: none; }
.dt-table th { padding: 0; }
.dt-table th button { all: unset; display: block; box-sizing: border-box; width: 100%; padding: 8px 14px; cursor: pointer; white-space: nowrap; }
.dt-table th button:hover { color: var(--text); }
.dt-table th button.sorted { color: var(--text); }
.dt-table th.num button, .dt-table td.num { text-align: right; }
.dt-table td.num { font-variant-numeric: tabular-nums; }
.dt-table tr.link { cursor: pointer; }
.dt-table tbody tr.link:hover td { background: var(--raised); }
.dt-table td { vertical-align: middle; }
.dt-table td .dim, .dim { color: var(--muted); }
.dt-empty { text-align: center; color: var(--text-2); padding: 32px 14px !important; }
.dt-more { padding: 10px; text-align: center; border-top: 1px solid var(--border); }
.tabs.seg { padding: 3px; }
.tabs.seg a { padding: 5px 11px; font-size: 12.5px; }
.cell-link { color: var(--text); text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 3px; }
.cell-link:hover { color: var(--red); text-decoration-color: var(--red-border); }
.clip { display: inline-block; max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.red { color: var(--red); }

/* ---------- schedule bar ---------- */
.sched { padding: 26px 4px 0; }
.sched-track { position: relative; height: 34px; background: var(--sunken); border-radius: 8px; box-shadow: inset 0 1px 2px rgba(16,18,22,.05); }
.sched-track .work { position: absolute; top: 0; bottom: 0; background: linear-gradient(180deg, #F04A50, var(--red)); border-radius: 8px; box-shadow: 0 1px 3px rgba(224,36,43,.3); }
.sched-track .brk {
  position: absolute; top: 4px; bottom: 4px; border-radius: 5px; background: var(--surface);
  background-image: repeating-linear-gradient(135deg, var(--sunken) 0 4px, var(--surface) 4px 8px); box-shadow: 0 0 0 1px var(--red-border);
}
.sched-track .pin { position: absolute; top: -22px; transform: translateX(-50%); font: 600 12px var(--mono); color: var(--text); }
.sched-ticks { position: relative; height: 20px; margin-top: 6px; }
.sched-ticks span { position: absolute; transform: translateX(-50%); font: 500 11px var(--mono); color: var(--muted); }

/* ---------- chips ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; border: 1px solid var(--border); background: var(--surface); color: var(--text-2);
  white-space: nowrap; line-height: 1;
}
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .7; }
.chip.plain::before { display: none; }
.chip.active { color: var(--green); border-color: #CFE6DA; }
.chip.retired { color: var(--muted); background: var(--sunken); border-color: transparent; }
.chip.inactive { color: var(--text-2); background: var(--sunken); border-color: transparent; }
.chip.expired { color: #fff; background: var(--red); border-color: var(--red); }
.chip.expired::before { background: #fff; opacity: 1; }
.chip.critical { color: var(--red); background: var(--red-tint); border-color: var(--red-border); }
.chip.soon { color: var(--amber); background: var(--amber-tint); border-color: var(--amber-border); }
.chip.ok { color: var(--text-2); }

/* ---------- detail ---------- */
.detail-top { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.crumbs { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.crumbs a:hover { color: var(--text); }
.pager { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }
.hero {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 20px 22px; display: flex; gap: 18px; align-items: center; flex-wrap: wrap;
}
.avatar {
  width: 56px; height: 56px; border-radius: 14px; background: var(--sunken); color: var(--text-2);
  display: grid; place-items: center; font-size: 22px; font-weight: 650; flex: none;
  box-shadow: inset 0 0 0 1px var(--border);
}
.hero-main { flex: 1; min-width: 220px; }
.hero h1 { margin: 0; font-size: 24px; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; }
.hero .kana { color: var(--text-2); font-size: 13px; margin-top: 3px; }
.hero .kana span + span::before { content: "·"; margin: 0 8px; color: var(--muted); }
.hero-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; align-items: center; }
.hero-meta .no { font: 600 12px var(--mono); color: var(--text-2); background: var(--sunken); border-radius: 6px; padding: 3px 7px; }
.hero-figs { display: flex; gap: 0; border-left: 1px solid var(--border); }
.fig { padding: 2px 22px; border-right: 1px solid var(--border); }
.fig:last-child { border-right: 0; }
.fig small { display: block; color: var(--muted); font-size: 11.5px; font-weight: 500; }
.fig b { display: block; font-size: 20px; font-weight: 650; letter-spacing: -.01em; font-variant-numeric: tabular-nums; margin-top: 2px; }
.fig b.red { color: var(--red); }
.fig b small { display: inline; font-size: 12px; color: var(--text-2); font-weight: 500; margin-left: 2px; }

.tabs {
  display: flex; gap: 2px; padding: 4px; background: var(--sunken); border-radius: 10px; align-self: flex-start;
  max-width: 100%; overflow-x: auto; scrollbar-width: none;
}
.tabs a {
  padding: 6px 14px; border-radius: 7px; font-size: 13px; font-weight: 550; color: var(--text-2); white-space: nowrap;
  display: inline-flex; align-items: center; gap: 6px;
}
.tabs a:hover { color: var(--text); }
.tabs a.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.tabs a .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--red); }
.tabs a .n { color: var(--muted); font-weight: 500; font-size: 12px; }

.panel { flex: 1; min-height: 0; overflow-y: auto; margin: 0 -6px; padding: 2px 6px 12px; }
.cards { display: grid; grid-template-columns: repeat(12, 1fr); gap: 14px; align-items: start; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  grid-column: span 6; min-width: 0;
}
.card.w4 { grid-column: span 4; } .card.w8 { grid-column: span 8; } .card.w12 { grid-column: span 12; }
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 13px 18px; border-bottom: 1px solid var(--border);
}
.card-head h2 { margin: 0; font-size: 13px; font-weight: 650; display: flex; gap: 8px; align-items: center; }
.card-head h2 em { font-style: normal; color: var(--muted); font-weight: 500; font-size: 12px; }
.card-head .aside { font-size: 12px; color: var(--muted); }
.card-body { padding: 16px 18px; }
.card-body.flush { padding: 0; }
.fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px 20px; margin: 0; }
.fields.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.f { min-width: 0; }
.f dt { font-size: 11.5px; color: var(--muted); font-weight: 500; margin-bottom: 2px; }
.f dd { margin: 0; font-size: 14px; font-weight: 500; overflow-wrap: anywhere; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.f dd.empty { color: var(--border-strong); }
.f dd.mono { font-family: var(--mono); font-size: 13px; }
.f.wide { grid-column: 1 / -1; }
.f .note { color: var(--text-2); font-weight: 400; font-size: 12.5px; }
.f.warn dd { color: var(--red); }
.key-figs { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 1px; background: var(--border); border-bottom: 1px solid var(--border); }
.key-figs > div { background: var(--surface); padding: 14px 18px; }
.key-figs small { display: block; font-size: 11.5px; color: var(--muted); font-weight: 500; }
.key-figs b { font-size: 22px; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.key-figs b.red { color: var(--red); }
.key-figs b.none { color: var(--border-strong); }

.callout {
  display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 10px;
  background: var(--raised); border: 1px solid var(--border); font-size: 13px; color: var(--text-2);
}
.callout.red { background: var(--red-tint); border-color: var(--red-border); color: var(--red-hover); }
.callout.amber { background: var(--amber-tint); border-color: var(--amber-border); color: var(--amber); }
.callout b { color: inherit; }
.callout svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; margin-top: 1px; }

.timeline { display: grid; gap: 10px; }
.tl-row { display: grid; grid-template-columns: 150px 1fr 120px; gap: 12px; align-items: center; font-size: 13px; }
.tl-row .lbl { color: var(--text-2); }
.tl-bar { height: 8px; background: var(--sunken); border-radius: 999px; position: relative; overflow: hidden; }
.tl-bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px; background: var(--border-strong); }
.tl-bar i.critical, .tl-bar i.expired { background: var(--red); }
.tl-bar i.soon { background: #E3A84A; }
.tl-row .when { text-align: right; font-variant-numeric: tabular-nums; }

.mini-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.mini-table th {
  text-align: left; font-size: 11.5px; font-weight: 600; color: var(--text-2); background: var(--sunken);
  padding: 8px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; position: sticky; top: 0;
}
.mini-table td { padding: 9px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.mini-table tr:last-child td { border-bottom: 0; }
.mini-table tr.absent td { background: var(--red-tint); color: var(--red-hover); }
.mini-table tr.absent td:first-child { box-shadow: inset 3px 0 0 var(--red); }
.mini-table tr.leave td { color: var(--text-2); }
.mini-table tr.current td:first-child { box-shadow: inset 3px 0 0 var(--red); }
.table-wrap { overflow: auto; max-height: 520px; }

.days { display: grid; grid-template-columns: repeat(14, 1fr); gap: 4px; }
.day { aspect-ratio: 1; border-radius: 5px; background: var(--sunken); display: grid; place-items: center; font-size: 10.5px; color: var(--muted); }
.day.work { background: #E7F2EC; color: var(--green); }
.day.absent { background: var(--red); color: #fff; }
.day.leave { background: var(--amber-tint); color: var(--amber); }

.empty-state { text-align: center; padding: 36px 20px; color: var(--text-2); }
.empty-state .ico {
  width: 44px; height: 44px; border-radius: 12px; margin: 0 auto 12px; background: var(--sunken);
  display: grid; place-items: center;
}
.empty-state .ico svg { width: 22px; height: 22px; fill: none; stroke: var(--muted); stroke-width: 1.6; }
.empty-state h3 { margin: 0 0 4px; font-size: 14px; color: var(--text); }
.empty-state p { margin: 0 auto; max-width: 420px; font-size: 13px; }
.empty-state code, .callout code, .card code { font: 12px var(--mono); background: var(--sunken); padding: 1px 5px; border-radius: 4px; color: var(--text); }

.all-tools { display: flex; gap: 10px; align-items: center; padding: 12px 18px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.all-tools .search { height: 34px; flex: 1 1 240px; }
.toggle { display: inline-flex; gap: 8px; align-items: center; font-size: 13px; color: var(--text-2); cursor: pointer; user-select: none; }
.toggle input { accent-color: var(--red); width: 15px; height: 15px; }
.all-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.all-list .kv { display: grid; grid-template-columns: minmax(130px, 42%) 1fr; gap: 12px; padding: 7px 18px; border-bottom: 1px solid var(--border); font-size: 13px; }
.all-list .kv:nth-child(odd) { border-right: 1px solid var(--border); }
.all-list .kv .k { color: var(--text-2); overflow-wrap: anywhere; }
.all-list .kv .k small { color: var(--muted); font: 10.5px var(--mono); margin-right: 6px; }
.all-list .kv .v { font-weight: 500; overflow-wrap: anywhere; }
.all-list .kv .v.empty { color: var(--border-strong); }

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 18px; }
.stat small { color: var(--muted); font-size: 12px; font-weight: 500; }
.stat b { display: block; font-size: 26px; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat b.red { color: var(--red); }

.loading { display: grid; place-items: center; flex: 1; color: var(--muted); font-size: 13px; }
.skeleton { background: linear-gradient(90deg, var(--sunken), var(--raised), var(--sunken)); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 6px; }
@keyframes sk { to { background-position: -200% 0; } }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .grid-row { --cols: 100px minmax(140px, 1.3fr) 100px 90px minmax(110px, 1fr) 140px; min-width: 680px; }
  .grid-row .c-kana, .grid-row .c-reg { display: none; }
  .card, .card.w4, .card.w8 { grid-column: span 12; }
  .card.half-md { grid-column: span 6; }
  .hero-figs { border-left: 0; width: 100%; border-top: 1px solid var(--border); padding-top: 14px; }
  .fig:first-child { padding-left: 0; }
  .all-list { grid-template-columns: 1fr; }
  .all-list .kv:nth-child(odd) { border-right: 0; }
}
/* phone and tablet portrait: the lab's top bar and drawer */
@media (max-width: 899px) {
  .topbar {
    display: flex; align-items: center; gap: 6px; position: fixed; top: 0; left: 0; right: 0; z-index: 30;
    height: calc(60px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 12px 0;
    background: rgba(255,255,255,.86); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
    border-bottom: 1px solid var(--border);
  }
  .topbar .brand { border: 0; padding: 0 6px; }
  .menu-btn { width: 40px; height: 40px; border: 0; background: none; border-radius: 10px; cursor: pointer; display: grid; place-items: center; color: var(--text); }
  .menu-btn:hover { background: var(--sunken); }
  .menu-btn svg { width: 20px; height: 20px; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; fill: none; }
  .side { transform: translateX(calc(-100% - 24px)); transition: transform .2s ease; z-index: 50; box-shadow: var(--shadow-lg); }
  body.side-open .side { transform: none; }
  body.side-open .scrim { display: block; position: fixed; inset: 0; z-index: 45; background: rgba(16,18,22,.28); }
  .shell { margin-left: 0; padding: calc(72px + env(safe-area-inset-top)) 16px 0; }
  .grid-row { --cols: 84px minmax(120px, 1fr) 84px 130px; min-width: 0; }
  .grid-row .c-dept, .grid-row .c-place { display: none; }
  .card.half-md { grid-column: span 12; }
  .tl-row { grid-template-columns: 1fr 100px; }
  .tl-row .tl-bar { display: none; }
  .table-foot .keys { display: none; }
  .fields.two { grid-template-columns: 1fr; }
  .strip-right { display: none; }
}
@media (min-width: 900px) and (max-width: 1180px) {
  :root { --side-w: 232px; }
  .shell { padding: 22px 22px 0; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- data navigator (table.js) ---------- */
.dt-bar { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--border); background: var(--raised); flex-wrap: wrap; border-radius: var(--radius) var(--radius) 0 0; }
.dt-search { flex: 1 1 260px; max-width: 420px; height: 36px; }
.dt-total { margin-left: auto; display: flex; align-items: baseline; gap: 6px; white-space: nowrap; font-size: 13px; color: var(--text-2); }
.dt-total b { font-size: 17px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.dt-total span { color: var(--muted); font-variant-numeric: tabular-nums; }
.dt-total small { color: var(--amber); font-size: 11.5px; margin-left: 4px; }
.dt-btns { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.dt-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 11px; border-radius: 9px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font: 550 12.5px var(--font); white-space: nowrap; box-shadow: var(--shadow);
}
.dt-btn:hover { color: var(--text); border-color: var(--border-strong); }
.dt-btn.on { color: var(--red); border-color: var(--red-border); background: var(--red-tint); }
.dt-btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.dt-btn.icon-only { width: 34px; padding: 0; justify-content: center; }
.caret { width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 5px solid currentColor; opacity: .55; }
.dt-chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--border); background: var(--surface); }
.fchip { display: inline-flex; align-items: stretch; border: 1px solid var(--red-border); background: var(--red-tint); border-radius: 999px; overflow: hidden; font-size: 12px; }
.fchip-edit { all: unset; cursor: pointer; padding: 4px 4px 4px 10px; color: var(--red-hover); }
.fchip-edit b { font-weight: 650; margin-right: 4px; }
.fchip-x { all: unset; cursor: pointer; padding: 0 8px; display: grid; place-items: center; color: var(--red); }
.fchip-x:hover { background: rgba(224,36,43,.1); }
.fchip-x svg { width: 11px; height: 11px; stroke: currentColor; stroke-width: 2; fill: none; }
.dt-table thead th { position: sticky; top: 0; z-index: 1; }
.dt-table tbody tr.sel td { background: var(--red-tint); }
.dt-table tbody tr.sel td:first-child { box-shadow: inset 3px 0 0 var(--red); }
.dt-table tfoot td { background: var(--sunken); border-top: 1px solid var(--border-strong); padding: 9px 14px; font-variant-numeric: tabular-nums; white-space: nowrap; position: sticky; bottom: 0; }
.dt-table tfoot td.num { text-align: right; }
.dt-group td { background: var(--raised); cursor: pointer; border-bottom: 1px solid var(--border); }
.dt-group td b { font-weight: 650; }
.dt-group .n { color: var(--muted); font-size: 12px; margin-left: 8px; }
.dt-group td.num { text-align: right; }
.tw { display: inline-block; width: 0; height: 0; margin-right: 8px; border-top: 4px solid transparent; border-bottom: 4px solid transparent; border-left: 5px solid var(--text-2); transition: transform .12s; }
.tw.open { transform: rotate(90deg); }
.dt .table-wrap { max-height: calc(100vh - 260px); max-height: calc(100dvh - 260px); }
.page-scroll .dt .table-wrap { max-height: 70vh; }

/* popovers & menus */
.pop { position: fixed; z-index: 90; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 2px 4px rgba(16,18,22,.06), 0 16px 40px rgba(16,18,22,.16); }
.menu { display: flex; flex-direction: column; padding: 6px; min-width: 220px; max-height: min(460px, 70vh); overflow-y: auto; }
.pop.wide .menu { min-width: 300px; }
.menu-h { font: 600 11px/1 var(--font); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 8px 8px 6px; }
.menu > button { all: unset; display: flex; justify-content: space-between; gap: 16px; padding: 7px 10px; border-radius: 8px; cursor: pointer; font-size: 13px; color: var(--text-2); }
.menu > button[hidden] { display: none; }
.menu > button:hover { background: var(--raised); color: var(--text); }
.menu > button.on { color: var(--red); background: var(--red-tint); font-weight: 600; }
.menu .n { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.menu-search, .range-in input, .cal-inputs input {
  height: 34px; border: 1px solid var(--border); border-radius: 8px; background: var(--sunken); padding: 0 10px; margin: 2px 4px 6px; outline: none; font-size: 13px;
}
.menu-search:focus, .range-in input:focus, .cal-inputs input:focus { background: var(--surface); border-color: var(--red-border); box-shadow: 0 0 0 3px var(--red-tint); }
.menu-list { overflow-y: auto; max-height: 300px; }
.menu-check { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; cursor: pointer; font-size: 13px; }
.menu-check[hidden] { display: none; }
.menu-check:hover { background: var(--raised); }
.menu-check span:first-of-type { flex: 1; }
.menu-check input { accent-color: var(--red); width: 15px; height: 15px; }
.menu-foot { display: flex; gap: 10px; align-items: center; padding: 8px 6px 2px; border-top: 1px solid var(--border); margin-top: 6px; }
.menu-foot .btn { height: 30px; }
.range-in { display: flex; align-items: center; gap: 4px; padding: 4px; }
.range-in input { width: 120px; margin: 0; }

/* calendar range picker */
.cal-pop { width: min(720px, calc(100vw - 16px)); }
.cal-body { display: flex; }
.cal-presets { display: flex; flex-direction: column; gap: 1px; padding: 10px 6px; border-right: 1px solid var(--border); background: var(--raised); border-radius: 12px 0 0 12px; min-width: 112px; max-height: 420px; overflow-y: auto; }
.cal-presets button { all: unset; padding: 6px 10px; border-radius: 7px; font-size: 12.5px; color: var(--text-2); cursor: pointer; white-space: nowrap; }
.cal-presets button:hover { background: var(--surface); color: var(--red); }
.cal-main { flex: 1; padding: 12px 14px; min-width: 0; }
.cal-nav { display: flex; align-items: center; gap: 8px; }
.cal-nav .btn { font-size: 18px; }
.cal-inputs { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; }
.cal-inputs input { width: 130px; margin: 0; font-family: var(--mono); font-size: 12.5px; text-align: center; }
.cal-months { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 10px; }
.cal-mh { text-align: center; font-weight: 650; font-size: 13.5px; margin-bottom: 6px; }
.cal-wd, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-wd span { text-align: center; font-size: 11px; color: var(--muted); padding: 4px 0; }
.cal-wd .sun, .cal-d.sun { color: var(--red); } .cal-wd .sat, .cal-d.sat { color: #2B6CB0; }
.cal-d { all: unset; text-align: center; height: 32px; line-height: 32px; font-size: 13px; cursor: pointer; font-variant-numeric: tabular-nums; position: relative; }
.cal-d:hover { background: var(--raised); border-radius: 8px; }
.cal-d.out { opacity: .32; }
.cal-d.today::after { content: ""; position: absolute; left: 50%; bottom: 3px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--red); }
.cal-d.in { background: var(--red-tint); color: var(--red-hover); border-radius: 0; }
.cal-d.edge { background: var(--red); color: #fff; border-radius: 8px; font-weight: 650; }
.cal-d.edge.today::after { background: #fff; }
.cal-foot { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); }
.cal-sum { flex: 1; text-align: center; font: 600 12.5px var(--mono); color: var(--text-2); }

/* 勤怠カレンダー */
.cal-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.cal-left { display: flex; align-items: center; gap: 6px; }
.cal-title { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; font-size: 20px; font-weight: 700; letter-spacing: -.02em; padding: 4px 10px; border-radius: 8px; margin-left: 4px; }
.cal-title:hover { background: var(--sunken); }
.att-bar { border: 1px solid var(--border); border-radius: 12px; }
.mcal { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.mcal-wd { display: grid; grid-template-columns: repeat(7, 1fr); background: var(--sunken); border-bottom: 1px solid var(--border); }
.mcal-wd span { padding: 8px 10px; font-size: 12px; font-weight: 600; color: var(--text-2); }
.mcal-wd .sun { color: var(--red); } .mcal-wd .sat { color: #2B6CB0; }
.mcal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.mcal-d { all: unset; box-sizing: border-box; min-height: 118px; padding: 8px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); cursor: pointer; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.mcal-d:nth-child(7n) { border-right: 0; }
.mcal-d:hover { background: var(--raised); }
.mcal-d.out { background: repeating-linear-gradient(135deg, transparent 0 6px, rgba(16,18,22,.018) 6px 12px); }
.mcal-d.out .mcal-n { color: var(--muted); }
.mcal-n { font: 650 13px var(--mono); }
.mcal-d.sun .mcal-n { color: var(--red); } .mcal-d.sat .mcal-n { color: #2B6CB0; }
.mcal-d.today .mcal-n { background: var(--red); color: #fff; border-radius: 999px; padding: 1px 7px; align-self: flex-start; }
.mcal-stats { display: flex; gap: 3px; flex-wrap: wrap; }
.mcal-job { display: flex; gap: 4px; align-items: center; font-size: 11.5px; background: var(--sunken); border-radius: 5px; padding: 2px 6px; white-space: nowrap; overflow: hidden; color: var(--text-2); }
.mcal-job b { color: var(--text); font-family: var(--mono); font-size: 11px; }
.mcal-job i { margin-left: auto; font-style: normal; font-weight: 650; color: var(--text); }
.mcal-job.has-absent { box-shadow: inset 2px 0 0 var(--red); }
.mcal-more { font-size: 11px; color: var(--muted); }
.sd { display: inline-flex; align-items: center; gap: 4px; font: 600 11px var(--mono); padding: 1px 6px; border-radius: 999px; }
.sd.work { background: #E7F2EC; color: var(--green); }
.sd.absent { background: var(--red); color: #fff; }
.sd.unentered { background: var(--amber-tint); color: var(--amber); }
.sd.planned { background: var(--sunken); color: var(--text-2); }
.cal-legend { display: flex; gap: 8px; margin-top: 10px; }
.cal-legend .sd { font-family: var(--font); padding: 3px 9px; }
.wk-wrap { max-height: calc(100dvh - 300px); }
.wk th, .wk td { min-width: 112px; vertical-align: top; }
.wk .wk-who { position: sticky; left: 0; background: var(--surface); z-index: 1; min-width: 180px; box-shadow: 1px 0 0 var(--border); }
.wk thead .wk-who { background: var(--sunken); z-index: 2; }
.wk th.today, .wk td.today { background: #FFF8F8; }
.wk th.sun .wk-day { color: var(--red); } .wk th.sat .wk-day { color: #2B6CB0; }
.wk-day { all: unset; cursor: pointer; font-weight: 650; display: block; }
.wk-day:hover { color: var(--red); }
.wk-sum { display: flex; gap: 3px; margin-top: 4px; flex-wrap: wrap; }
.shift { display: block; border-radius: 7px; padding: 5px 8px; font-size: 12px; line-height: 1.3; font-variant-numeric: tabular-nums; }
.shift small { display: block; font-size: 11px; opacity: .85; }
.shift.work { background: #E7F2EC; color: #155C3A; }
.shift.absent { background: var(--red); color: #fff; }
.shift.unentered { background: var(--amber-tint); color: var(--amber); box-shadow: inset 0 0 0 1px var(--amber-border); }
.shift.planned { background: var(--sunken); color: var(--text-2); }
.shift.inline { display: inline-block; padding: 2px 8px; }
.flushcard { overflow: hidden; }

/* rates table */
.rates th.grp { text-align: center; border-left: 1px solid var(--border); }
.rates th.grp.pay, .rates th.pay { background: #EEF4F0; }
.rates th.grp.bill, .rates th.bill { background: #FBEFEF; }
.rates th.num, .rates td.num { text-align: right; }
.rates td.strong { font-weight: 650; }
.stat-btn { all: unset; box-sizing: border-box; cursor: pointer; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 18px; }
.stat-btn:hover { border-color: var(--red-border); }

@media (max-width: 899px) {
  .cal-body { flex-direction: column; }
  .cal-presets { flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--border); border-radius: 12px 12px 0 0; max-height: none; }
  .cal-months { grid-template-columns: 1fr; }
  .cal-months .cal-m + .cal-m { display: none; }
  .mcal-d { min-height: 76px; padding: 5px; }
  .mcal-job { display: none; }
  .dt-search { max-width: none; }
}

/* ---------- login ---------- */
.login-body { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 16px; }
.login { width: min(400px, 100%); }
.login-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-lg); overflow: hidden; }
.login-brand { padding: 22px 26px 18px; }
.login-form { padding: 22px 26px 8px; display: grid; gap: 14px; }
.login-form h1 { margin: 0; font-size: 22px; letter-spacing: -.02em; }
.login-sub { margin: -8px 0 4px; color: var(--text-2); font-size: 13px; }
.login-field { display: grid; gap: 6px; font-size: 12.5px; color: var(--text-2); font-weight: 550; }
.login-field input { height: 42px; border: 1px solid var(--border); border-radius: 10px; background: var(--sunken); padding: 0 12px; font-size: 15px; outline: none; box-shadow: inset 0 1px 2px rgba(16,18,22,.05); }
.login-field input:focus { background: var(--surface); border-color: var(--red-border); box-shadow: 0 0 0 3px var(--red-tint); }
.login-error { margin: 0; padding: 10px 12px; border-radius: 9px; background: var(--red-tint); border: 1px solid var(--red-border); color: var(--red-hover); font-size: 13px; }
.login-btn { height: 42px; justify-content: center; font-size: 14px; margin-top: 4px; }
.login-foot { display: flex; align-items: center; gap: 8px; margin: 14px 0 0; padding: 12px 26px 16px; border-top: 1px solid var(--border); color: var(--muted); font-size: 12px; }
.login-foot i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(29,122,78,.15); }
.side-out { all: unset; cursor: pointer; margin-left: auto; flex: none; white-space: nowrap; font-size: 12px; line-height: 1.2; color: var(--text-2); padding: 5px 8px; border-radius: 8px; border: 1px solid var(--border); }
.side-out:hover { color: var(--red); border-color: var(--red-border); }
.side-avatar.user { background: var(--red-tint); color: var(--red); font: 700 14px/1 var(--font); }
/* navigator bar: row 1 = search + count, row 2 = the buttons */
.dt-bar { display: grid; grid-template-columns: minmax(0, 520px) 1fr; grid-template-areas: "search total" "btns btns"; gap: 10px 14px; }
.dt-bar .dt-search { grid-area: search; max-width: none; }
.dt-bar .dt-total { grid-area: total; justify-self: end; align-self: center; }
.dt-bar .dt-btns { grid-area: btns; }
.att-bar { grid-template-areas: "search btns"; grid-template-columns: minmax(0, 520px) 1fr; }
@media (max-width: 899px) { .dt-bar { grid-template-columns: 1fr; grid-template-areas: "search" "total" "btns"; } .dt-bar .dt-total { justify-self: start; } }
.dt-chips[hidden], .dt-more[hidden] { display: none; }
.login-ca { margin-left: auto; color: var(--text-2); text-decoration: underline; text-underline-offset: 3px; }
.login-steps { margin: 0 0 4px; padding-left: 20px; font-size: 13px; color: var(--text-2); display: grid; gap: 4px; }
.login-qr { display: grid; place-items: center; padding: 10px; background: #fff; border: 1px solid var(--border); border-radius: 12px; width: 200px; margin: 6px auto; }
.login-qr svg { width: 180px; height: 180px; }
.login-form code { font: 600 13px var(--mono); letter-spacing: .06em; background: var(--sunken); padding: 3px 6px; border-radius: 6px; color: var(--text); word-break: break-all; }
/* admin */
.row-acts { display: inline-flex; gap: 12px; align-items: center; white-space: nowrap; }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12px; }
.drop { display: grid; gap: 4px; place-items: center; text-align: center; padding: 34px 20px; border: 2px dashed var(--border-strong); border-radius: 14px; background: var(--raised); cursor: pointer; transition: border-color .12s, background .12s; }
.drop:hover, .drop.over { border-color: var(--red); background: var(--red-tint); }
.drop b { font-size: 15px; } .drop span { color: var(--text-2); font-size: 13px; } .drop small { color: var(--muted); font-size: 12px; margin-top: 6px; max-width: 520px; }
.up-log { display: grid; gap: 6px; margin-top: 12px; }
.up-line { font-size: 13px; padding: 8px 12px; border-radius: 9px; background: var(--sunken); }
.up-line.ok { background: #E7F2EC; color: #155C3A; } .up-line.bad { background: var(--red-tint); color: var(--red-hover); }
.nav-admin[hidden], #nav-admin[hidden] { display: none; }
.login-form[hidden], #enroll[hidden] { display: none; }
.side-who b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
