/* Dash Track */
:root {
  --bg: #F5F6F8; --surface: #FFFFFF; --surface2: #F0F1F5; --line: #E3E5EB; --line2: #D3D6DF;
  --text: #171A21; --muted: #5E6472; --faint: #9095A3;
  --accent: #5B4BF0; --accent-2: #0FA3A0; --accent-soft: #ECEAFE; --on-accent: #FFFFFF;
  --good: #12A150; --good-soft: #E3F6EB; --bad: #D93644; --bad-soft: #FDECEE; --warn: #C27A00;
  --heat: 91, 75, 240;
  --shadow: 0 1px 2px rgba(16, 20, 30, .05), 0 6px 20px rgba(16, 20, 30, .06);
  --shadow-lg: 0 20px 60px rgba(16, 20, 30, .22);
  --radius: 14px; --radius-sm: 9px;
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "Cascadia Mono", Consolas, ui-monospace, monospace;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #121419; --surface: #1A1D24; --surface2: #22262F; --line: #2B303A; --line2: #383E4A;
  --text: #ECEEF3; --muted: #A2A8B6; --faint: #6C7282;
  --accent: #8577FF; --accent-2: #2CC3BF; --accent-soft: #272449; --on-accent: #FFFFFF;
  --good: #3CCB7F; --good-soft: #193526; --bad: #FF6B76; --bad-soft: #3A1E23; --warn: #F0B13C;
  --heat: 133, 119, 255;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, .55);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121419; --surface: #1A1D24; --surface2: #22262F; --line: #2B303A; --line2: #383E4A;
    --text: #ECEEF3; --muted: #A2A8B6; --faint: #6C7282;
    --accent: #8577FF; --accent-2: #2CC3BF; --accent-soft: #272449; --on-accent: #FFFFFF;
    --good: #3CCB7F; --good-soft: #193526; --bad: #FF6B76; --bad-soft: #3A1E23; --warn: #F0B13C;
    --heat: 133, 119, 255;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, .55);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body, #app { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 14px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { margin: 0; letter-spacing: -.01em; }
h1 { font-size: 24px; font-weight: 700; }
h1 .count { display: inline-block; vertical-align: middle; margin-left: 6px; padding: 2px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 14px; font-weight: 700; letter-spacing: 0; }
h2 { font-size: 17px; font-weight: 650; }
h3 { font-size: 14.5px; font-weight: 650; }
p { margin: 0; color: var(--muted); }
a { color: var(--accent); }
button, input, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.mono { font-family: var(--font-mono); }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.hint { color: var(--muted); font-size: 12.5px; }
.grow { flex: 1; }
.row { display: flex; align-items: center; gap: 10px; }
.wrap { flex-wrap: wrap; }

/* ---------- buttons & fields ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--line2); background: var(--surface); cursor: pointer; font-weight: 550; white-space: nowrap; transition: background .12s, border-color .12s, transform .06s; }
a.btn { text-decoration: none; color: inherit; }
.btn:hover { background: var(--surface2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.primary { background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 70%, var(--accent-2))); border-color: transparent; color: var(--on-accent); box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 30%, transparent); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface2); }
.btn.danger { color: var(--bad); }
.btn.danger:hover { background: var(--bad-soft); border-color: var(--bad-soft); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn.icon { width: 36px; padding: 0; }
.btn.sm.icon { width: 30px; }
.btn svg { width: 16px; height: 16px; flex: none; }
.field { width: 100%; height: 38px; padding: 0 12px; border-radius: var(--radius-sm); border: 1px solid var(--line2); background: var(--surface); outline: none; transition: border-color .12s, box-shadow .12s; }
.field:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
label.f, div.f { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 13px; }
label.f .hint, div.f .hint { font-weight: 400; }
.err { color: var(--bad); font-size: 13px; min-height: 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.err:empty { display: none; }
.search { position: relative; display: block; width: 240px; max-width: 100%; }
.search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--faint); pointer-events: none; }
.search .field { height: 36px; padding-left: 34px; }
.card-head.wrap { flex-wrap: wrap; }
.searches { display: flex; gap: 8px; flex-wrap: wrap; }
.searches .search { width: 200px; }
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 11px; background: var(--surface2); border: 1px solid var(--line); }
.seg button { all: unset; cursor: pointer; padding: 6px 13px; border-radius: 8px; font-weight: 600; font-size: 13px; color: var(--muted); }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

/* ---------- sign in / setup ---------- */
.auth { min-height: 100%; display: grid; place-items: center; padding: 32px 16px;
  background: radial-gradient(1200px 500px at 10% -10%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 60%),
              radial-gradient(900px 500px at 110% 110%, color-mix(in srgb, var(--accent-2) 14%, transparent), transparent 60%), var(--bg); }
.auth-card { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 30px; box-shadow: var(--shadow-lg); }
.auth-card.wide { max-width: 560px; }
.auth-card form { display: flex; flex-direction: column; gap: 14px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 750; font-size: 17px; letter-spacing: -.01em; }
.brand img { width: 30px; height: 30px; }

/* ---------- app shell ---------- */
.shell { display: grid; grid-template-columns: 236px 1fr; height: 100%; }
.side { display: flex; flex-direction: column; gap: 4px; padding: 18px 12px; background: var(--surface); border-right: 1px solid var(--line); min-height: 0; }
.side .brand { padding: 4px 4px 18px 10px; }
.side .team { font-size: 12px; color: var(--muted); font-weight: 500; display: block; margin-top: 1px; }
.nav { all: unset; cursor: pointer; display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 10px; color: var(--muted); font-weight: 600; }
.nav svg { width: 18px; height: 18px; flex: none; }
.nav:hover { background: var(--surface2); color: var(--text); }
.nav.on { background: var(--accent-soft); color: var(--accent); }
.side .me { all: unset; box-sizing: border-box; margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; border: 1px solid var(--line); cursor: pointer; min-width: 0; }
.side .me .grow { min-width: 0; }
.side .me b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-gear { display: inline-flex; color: var(--muted); }
.me-gear svg { width: 17px; height: 17px; }
.side .me:hover .me-gear, .side .me.on .me-gear { color: var(--accent); }
.side .me.on { border-color: var(--accent); background: var(--accent-soft); }
.side .me:focus-visible, .mode:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.brand .mode { margin-left: auto; color: var(--muted); }
.brand .mode svg { width: 17px; height: 17px; }
.side .me:hover { background: var(--surface2); }
.side .me b { display: block; font-size: 13px; line-height: 1.2; }
.side .me span { font-size: 12px; color: var(--muted); }
.main { overflow: auto; min-width: 0; }
.page { padding: 26px 30px 60px; display: flex; flex-direction: column; gap: 20px; }
.page-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.page-head .titles { flex: 1; min-width: 200px; }
.page-head p { margin-top: 2px; }
.back { all: unset; cursor: pointer; color: var(--muted); font-weight: 600; font-size: 13px; display: inline-flex; align-items: center; gap: 4px; margin-bottom: 6px; }
.back:hover { color: var(--accent); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card.pad { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.card-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); }

/* ---------- avatars ---------- */
.av { width: 34px; height: 34px; border-radius: 50%; flex: none; display: grid; place-items: center; font-weight: 700; font-size: 12.5px; color: #fff; overflow: hidden; background: var(--faint); }
.av img { width: 100%; height: 100%; object-fit: cover; }
.av.lg { width: 64px; height: 64px; font-size: 22px; }
.av.xl { width: 96px; height: 96px; font-size: 32px; }
.av.sm { width: 26px; height: 26px; font-size: 10.5px; }

/* ---------- stat tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.tile { padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; }
.tile .k { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.tile .v { font-size: 26px; font-weight: 750; letter-spacing: -.02em; line-height: 1.15; }
.tile .s { color: var(--faint); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.tile .k svg { width: 14px; height: 14px; vertical-align: -2px; margin-right: 5px; color: var(--accent); }
.tile .v.sm { font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- update bar at the top of the app ---------- */
.updbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; padding: 12px 30px; color: #fff;
  background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 60%, var(--accent-2))); box-shadow: 0 4px 16px color-mix(in srgb, var(--accent) 30%, transparent); }
.updbar b { display: block; font-size: 14px; }
.updbar #upd-text { font-size: 12.5px; opacity: .9; }
.updbar .updico { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.18); flex: none; }
.updbar .updico svg { width: 18px; height: 18px; }
.updbar .btn.primary { background: #fff; color: var(--accent); box-shadow: none; }
.updbar .btn.primary:disabled { opacity: .8; }

/* ---------- trend chart: one series, bars from a shared baseline ---------- */
.pad-chart { padding: 18px 20px 14px; }
.chart { position: relative; padding-top: 18px; }
.chart-max { position: absolute; top: 0; left: 0; font-size: 11.5px; color: var(--faint); }
.bars { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 2px; height: 180px; border-top: 1px dashed var(--line); border-bottom: 1px solid var(--line2); }
.bcol { position: relative; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; outline: none; cursor: default; }
.bar-v { width: min(100%, 34px); margin: 0 auto; border-radius: 4px 4px 0 0; background: var(--accent); transition: filter .1s; }
.bcol:hover .bar-v, .bcol:focus .bar-v { filter: brightness(1.15); }
.bcol:hover { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.bcol .xl { position: absolute; top: calc(100% + 6px); left: 50%; transform: translateX(-50%); font-size: 11px; color: var(--muted); white-space: nowrap; }
.bcol .tip { display: none; position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); z-index: 5; background: var(--text); color: var(--bg); padding: 7px 10px; border-radius: 8px; white-space: nowrap; font-size: 12px; flex-direction: column; box-shadow: var(--shadow-lg); pointer-events: none; }
.bcol:hover .tip, .bcol:focus .tip { display: flex; }
.chart + * , .pad-chart { margin-bottom: 0; }
.pad-chart .chart { margin-bottom: 22px; }
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--text); }

/* ---------- tables ---------- */
.table-wrap { overflow: auto; }
table.grid { width: 100%; border-collapse: separate; border-spacing: 0; }
table.grid th, table.grid td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.grid thead th { position: sticky; top: 0; background: var(--surface); z-index: 1; font-size: 12px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
table.grid tbody tr:last-child td { border-bottom: 0; }
table.grid tbody tr.click { cursor: pointer; }
table.grid tbody tr.click:hover td { background: color-mix(in srgb, var(--accent) 5%, var(--surface)); }
table.grid td.num, table.grid th.num { text-align: right; }
table.grid tfoot td { font-weight: 700; border-top: 1px solid var(--line2); border-bottom: 0; }
.who { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.cell { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; border-radius: 9px; padding: 6px 10px; margin: -6px -10px; min-width: 92px; }
.cell b { font-size: 14px; }
.cell span { font-size: 12px; color: var(--muted); }
.cell.zero { color: var(--faint); }
td.cellwrap { cursor: pointer; }
td.cellwrap:hover .cell:not(.zero) { outline: 2px solid color-mix(in srgb, var(--accent) 45%, transparent); }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); display: flex; flex-direction: column; gap: 8px; align-items: center; }
.empty svg { width: 40px; height: 40px; color: var(--faint); }

/* ---------- dashboards ---------- */
.dgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.dcard { display: flex; flex-direction: column; gap: 14px; padding: 18px; }
.dcard .top { display: flex; gap: 12px; align-items: flex-start; }
.dico { width: 40px; height: 40px; border-radius: 11px; flex: none; display: grid; place-items: center; color: #fff; font-weight: 750; font-size: 16px; }
.dcard .top .t { flex: 1; min-width: 0; }
.dcard .top .t h3 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dcard .top .t span { display: block; color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cred { display: flex; flex-direction: column; gap: 6px; }
.cred .line { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 12px; background: var(--surface2); border-radius: 10px; min-height: 40px; }
.cred .line .lab { font-size: 11.5px; color: var(--muted); font-weight: 650; width: 66px; flex: none; text-transform: uppercase; letter-spacing: .04em; }
.cred .line .val { flex: 1; min-width: 0; font-family: var(--font-mono); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dcard .foot { display: flex; gap: 8px; margin-top: auto; }

/* ---------- person page ---------- */
.person-head { display: flex; align-items: center; gap: 16px; }
.bar { height: 6px; border-radius: 6px; background: var(--surface2); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.day { padding: 0; }
.day-head { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-bottom: 1px solid var(--line); background: var(--surface2); border-radius: var(--radius) var(--radius) 0 0; }
.day-head b { flex: 1; }
.visit { display: grid; grid-template-columns: 200px 1fr auto; gap: 14px; align-items: center; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.visit:last-child { border-bottom: 0; }
.visit .when { font-weight: 650; font-variant-numeric: tabular-nums; display: flex; align-items: center; gap: 8px; }
.visit .when .arrow { color: var(--faint); }
.visit .dn { display: flex; align-items: center; gap: 8px; min-width: 0; color: var(--muted); }
.visit .dn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.visit .dur { font-weight: 650; font-variant-numeric: tabular-nums; }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 99px; font-size: 11.5px; font-weight: 650; background: var(--surface2); color: var(--muted); }
.badge.good { background: var(--good-soft); color: var(--good); }
.badge.accent { background: var(--accent-soft); color: var(--accent); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.live { width: 7px; height: 7px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 0 var(--good); animation: pulse 1.8s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--good) 60%, transparent); } 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

/* ---------- date picker ---------- */
.datebar { display: flex; align-items: center; gap: 6px; }
.datebtn { min-width: 210px; justify-content: flex-start; }
.pop { position: fixed; z-index: 50; display: flex; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg); overflow: hidden; }
.pop .presets { display: flex; flex-direction: column; gap: 2px; padding: 12px; border-right: 1px solid var(--line); min-width: 150px; background: var(--surface2); }
.pop .presets button { all: unset; cursor: pointer; padding: 8px 12px; border-radius: 8px; font-weight: 550; font-size: 13px; }
.pop .presets button:hover { background: var(--surface); }
.pop .presets button.on { background: var(--accent-soft); color: var(--accent); }
.cal { padding: 14px 16px 12px; display: flex; flex-direction: column; gap: 10px; }
.cal-head { display: flex; align-items: center; gap: 6px; }
.cal-head b { flex: 1; text-align: center; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 38px); gap: 2px 0; }
.cal-grid .dow { text-align: center; font-size: 11.5px; font-weight: 650; color: var(--faint); padding: 4px 0; }
.cal-grid button { all: unset; box-sizing: border-box; height: 36px; text-align: center; cursor: pointer; font-variant-numeric: tabular-nums; font-size: 13px; position: relative; }
.cal-grid button span { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; }
.cal-grid button:hover span { background: var(--surface2); }
.cal-grid button.out { color: var(--faint); }
.cal-grid button.today span { box-shadow: inset 0 0 0 1px var(--accent); }
.cal-grid button.in { background: var(--accent-soft); }
.cal-grid button.a { background: linear-gradient(90deg, transparent 50%, var(--accent-soft) 50%); }
.cal-grid button.z { background: linear-gradient(90deg, var(--accent-soft) 50%, transparent 50%); }
.cal-grid button.a.z { background: none; }
.cal-grid button.a span, .cal-grid button.z span { background: var(--accent); color: var(--on-accent); font-weight: 700; }
.cal-grid button:disabled { color: var(--faint); opacity: .45; cursor: default; }
.cal-grid button:disabled:hover span { background: none; }
.cal-foot { display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--line); padding-top: 10px; }
.cal-foot .sel { flex: 1; font-size: 12.5px; color: var(--muted); }

/* ---------- modal & toast ---------- */
.scrim { position: fixed; inset: 0; z-index: 60; background: rgba(10, 12, 18, .45); display: grid; place-items: center; padding: 20px; animation: fade .12s ease-out; }
.modal { width: 100%; max-width: 480px; max-height: calc(100vh - 40px); overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-lg); padding: 22px; display: flex; flex-direction: column; gap: 16px; animation: rise .16s ease-out; }
.modal form { display: flex; flex-direction: column; gap: 14px; }
.modal .actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 4px; }
.toasts { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 80; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-weight: 600; box-shadow: var(--shadow-lg); animation: rise .16s ease-out; }
.toast.bad { background: var(--bad); color: #fff; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

/* ---------- settings ---------- */
.settings { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: start; }
.settings .col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.settings .sec { font-size: 14px; margin-top: 6px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.sub { font-size: 12.5px; font-weight: 650; color: var(--muted); }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; font-weight: 550; }
.check input { width: 17px; height: 17px; margin-top: 2px; accent-color: var(--accent); flex: none; }
.check .hint, .radio .hint { display: block; font-weight: 400; margin-top: 2px; }
.radio { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border: 1px solid var(--line2); border-radius: 11px; cursor: pointer; font-weight: 550; }
.radio input { margin-top: 3px; accent-color: var(--accent); flex: none; }
.radio.on { border-color: var(--accent); background: var(--accent-soft); }
ol.steps { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }

@media (max-width: 600px) { .two { grid-template-columns: 1fr; } }
.photo-edit { display: flex; align-items: center; gap: 16px; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 8px 14px; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.code-big { font-family: var(--font-mono); font-size: 22px; font-weight: 700; letter-spacing: .08em; }
.footnote { text-align: center; color: var(--faint); font-size: 12px; padding-top: 10px; }

/* ---------- narrow windows ---------- */
@media (max-width: 900px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .settings { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .side { flex-direction: row; align-items: center; padding: 8px 10px; border-right: 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
  .side .brand { padding: 0 8px 0 4px; }
  .side .brand .name, .nav .lbl, .side .me div { display: none; }
  .side .me { margin: 0 0 0 auto; border: 0; padding: 4px; }
  .page { padding: 18px 16px 50px; }
  .visit { grid-template-columns: 1fr auto; }
  .visit .dn { grid-column: 1 / -1; order: 3; }
  .pop { flex-direction: column; }
  .pop .presets { flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--line); }
}
.dtable { table-layout: fixed; width: 100%; }
.dtable .c-no { width: 52px; } .dtable .c-name { width: 24%; } .dtable .c-link { width: 24%; } .dtable .c-id { width: 20%; } .dtable .c-pw { width: 14%; } .dtable .c-act { width: 170px; }
.dtable td { overflow: hidden; }
.cp { display: flex; align-items: center; gap: 6px; min-width: 0; }
.cp .val, .cp .lnk { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp .lnk { color: var(--muted); }
.cp-b { display: inline-flex; gap: 2px; flex: none; }
@media (max-width: 1000px) { .dtable { table-layout: auto; } .dtable .cp .val, .dtable .cp .lnk { max-width: 200px; } }
.gsel { width: auto; min-width: 140px; height: 36px; }
.pfind { position: relative; }
.pf-list { position: absolute; z-index: 40; top: calc(100% + 6px); left: 0; width: max(100%, 300px); max-height: 340px; overflow: auto; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); }
.pf-i { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 10px; border-radius: 8px; cursor: pointer; font-weight: 600; }
.pf-i svg { width: 18px; height: 18px; color: var(--muted); margin: 0 3px; }
.pf-i.hi, .pf-i:hover { background: var(--surface2); }
.pf-i .hint { font-weight: 400; }
.pf-none { padding: 10px; color: var(--muted); }
textarea.field { height: auto; padding: 10px 12px; resize: vertical; line-height: 1.5; }
#seen-ip .btn { margin-left: 4px; vertical-align: middle; }

/* ---------- activity ---------- */
.notice { border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); background: color-mix(in srgb, var(--warn) 7%, var(--surface)); gap: 4px; }
.notice span { color: var(--muted); }
.tiles.six { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.two-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.pad-list { padding: 12px 20px 16px; }
.blist { display: flex; flex-direction: column; gap: 10px; }
.bl { display: grid; grid-template-columns: 1fr auto; gap: 3px 10px; align-items: center; }
.bl-n { font-weight: 600; font-size: 13.5px; min-width: 0; }
.bl-t { font-variant-numeric: tabular-nums; font-size: 13px; color: var(--muted); }
.bl .bar { grid-column: 1 / -1; height: 5px; }
.bar.thin { display: block; height: 3px; margin-top: 4px; max-width: 220px; }
.trunc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.act-t td { max-width: 760px; }
.act-t td .trunc { max-width: min(48vw, 760px); }
.btn.block { display: flex; width: calc(100% - 24px); margin: 8px 12px 12px; }
.stk { width: min(100%, 34px); margin: 0 auto; display: flex; flex-direction: column; border-radius: 4px 4px 0 0; overflow: hidden; }
.stk i, .legend i { display: block; }
.sa { background: var(--accent); }
.si { background: color-mix(in srgb, var(--warn) 55%, transparent); }
.stk .si { min-height: 0; }
.legend { display: flex; gap: 16px; margin-top: 30px; font-size: 12.5px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; }
@media (max-width: 1100px) { .tiles.six { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 900px) { .two-cards { grid-template-columns: 1fr; } .tiles.six { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- moving to a server ---------- */
.movebox { display: flex; flex-direction: column; gap: 8px; padding: 16px; border-radius: 14px; border: 1px dashed var(--line2); background: var(--surface2); }
.movebox ol { margin: 0; padding-left: 20px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
.movebox .kv { margin: 4px 0; }

/* ---------- bulk add ---------- */
.modal.xwide { max-width: min(980px, calc(100vw - 32px)) !important; }
.bulk-steps { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.bstep { display: flex; flex-direction: column; gap: 6px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface2); }
.bstep span { color: var(--muted); font-size: 13px; }
.bstep div { margin-top: auto; padding-top: 4px; }
.bk-table { max-height: 46vh; overflow: auto; border: 1px solid var(--line); border-radius: 12px; }
.bk-table th { position: sticky; top: 0; background: var(--surface); z-index: 1; }
.bk-bad td { background: var(--bad-soft); }
.bk-err { color: var(--bad); font-size: 12.5px; font-weight: 600; white-space: normal; display: inline-block; min-width: 220px; }
.done-box { display: flex; flex-direction: column; gap: 8px; padding: 16px; border-radius: 12px; background: var(--good-soft); }
.done-box span { color: var(--text); }
@media (max-width: 640px) { .bulk-steps { grid-template-columns: 1fr; } }
