:root {
  --bg: #131417; --bg2: #1a1c21; --bg3: #22252c; --line: #2d3139; --text: #e8e6e1; --muted: #9a9ca3;
  --accent: #f2b134; --accent-ink: #131417; --ok: #4cc38a; --warn: #f2b134; --bad: #ef6461; --info: #6aa6ff;
  --prem: #c07cff; --stream: #39b8c9; --tv: #8f97a6;
  --radius: 10px; --shadow: 0 10px 40px rgba(0,0,0,.45);
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "JetBrains Mono", "SFMono-Regular", Menlo, monospace;
}
@media (prefers-color-scheme: light) {
  :root { --bg: #f6f4ef; --bg2: #ffffff; --bg3: #efece5; --line: #dedad1; --text: #1d1e22; --muted: #6b6d74;
    --accent: #c98700; --accent-ink: #fff; --shadow: 0 10px 40px rgba(0,0,0,.15); }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.45 var(--font); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }
.hidden { display: none !important; }
small { color: var(--muted); }

/* header */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 22px; padding: 10px 18px;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.brand { font-weight: 800; letter-spacing: -.02em; font-size: 17px; display: flex; align-items: center; gap: 8px; }
.brand .dot { color: var(--accent); }
.logo { width: 18px; height: 18px; border-radius: 5px; background: var(--accent);
  box-shadow: inset 0 -5px 0 rgba(0,0,0,.25); }
nav { display: flex; gap: 2px; overflow-x: auto; max-width: 100%; }
nav button { background: none; border: 0; padding: 7px 12px; border-radius: 8px; color: var(--muted); font-weight: 600; }
nav button:hover { color: var(--text); background: var(--bg3); }
nav button.active { color: var(--text); background: var(--bg3); box-shadow: inset 0 -2px 0 var(--accent); }
.badge { background: var(--accent); color: var(--accent-ink); border-radius: 99px; padding: 0 6px; font-size: 11px; margin-left: 4px; }
.health { margin-left: auto; display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }
.light { width: 9px; height: 9px; border-radius: 50%; background: var(--tv); display: inline-block; }
.light.ok { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.light.bad { background: var(--bad); box-shadow: 0 0 8px var(--bad); }
.light.busy { background: var(--warn); animation: pulse 1s infinite alternate; }
.hl { margin-right: 10px; }
@keyframes pulse { to { opacity: .35; } }

main { padding: 0 18px 40px; }
.view { display: none; }
.view.active { display: block; }
h2 { margin: 0; font-size: 18px; }

/* toolbars */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 0; }
.toolbar.sub { padding-top: 0; border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.spacer { flex: 1; }
.seg { display: inline-flex; background: var(--bg2); border: 1px solid var(--line); border-radius: 9px; padding: 2px; }
.seg button { border: 0; background: none; padding: 6px 12px; border-radius: 7px; color: var(--muted); font-weight: 600; }
.seg button small { font-weight: 500; margin-left: 4px; }
.seg button.active { background: var(--bg3); color: var(--text); box-shadow: 0 1px 0 var(--line); }
.chips { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.chip { border: 1px solid var(--line); background: var(--bg2); color: var(--muted); padding: 3px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; }
.chip.on { color: var(--text); border-color: color-mix(in srgb, var(--accent) 60%, var(--line)); background: color-mix(in srgb, var(--accent) 12%, var(--bg2)); }
.datenav { display: inline-flex; align-items: center; gap: 4px; }
.datenav button, button.ghost { border: 1px solid var(--line); background: var(--bg2); padding: 5px 10px; border-radius: 8px; }
#range-label { margin-left: 8px; font-weight: 700; min-width: 170px; }
input[type=search], input:not([type]), input[type=text], input[type=number], input[type=password], input[type=url], select, textarea {
  background: var(--bg2); border: 1px solid var(--line); border-radius: 8px; padding: 6px 9px; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
#q { width: 220px; }
.tog { display: inline-flex; flex-direction: row; align-items: center; gap: 5px; color: var(--muted); font-size: 13px; user-select: none; }
.inline { display: inline-flex; flex-direction: row; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
button.primary { background: var(--accent); color: var(--accent-ink); border: 0; padding: 7px 14px; border-radius: 8px; font-weight: 700; }
button.primary:disabled { opacity: .5; }
button.danger { background: none; border: 1px solid color-mix(in srgb, var(--bad) 60%, var(--line)); color: var(--bad); padding: 6px 12px; border-radius: 8px; }
button.link { background: none; border: 0; color: var(--accent); padding: 0; font-size: 12px; }
button.mini { border: 1px solid var(--line); background: var(--bg3); border-radius: 6px; padding: 2px 7px; font-size: 12px; }

/* calendar */
.cal-body { display: grid; grid-template-columns: 230px 1fr; gap: 16px; padding-top: 14px; }
.networks { position: sticky; top: 64px; align-self: start; max-height: calc(100vh - 80px); display: flex; flex-direction: column; gap: 8px; }
.nw-head { display: flex; justify-content: space-between; align-items: center; }
#nw-list { overflow: auto; display: flex; flex-direction: column; gap: 1px; padding-right: 4px; }
.nw { display: flex; align-items: center; gap: 7px; padding: 4px 6px; border-radius: 6px; cursor: pointer; font-size: 13px; }
.nw:hover { background: var(--bg3); }
.nw.on { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.nw .k { width: 7px; height: 7px; border-radius: 2px; background: var(--tv); flex: none; }
.nw .k.stream { background: var(--stream); }
.nw .n { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nw .c { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 12px; }

.progress { position: relative; height: 22px; background: var(--bg2); border: 1px solid var(--line); border-radius: 6px; margin-bottom: 10px; overflow: hidden; }
.progress div { position: absolute; inset: 0 auto 0 0; background: color-mix(in srgb, var(--accent) 30%, transparent); transition: width .4s; }
.progress span { position: relative; font-size: 12px; padding: 0 8px; line-height: 22px; color: var(--muted); }

/* month & week grids */
.grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.grid .wd { background: var(--bg2); padding: 6px 8px; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.day { background: var(--bg); min-height: 120px; padding: 6px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.day.other { background: color-mix(in srgb, var(--bg) 70%, var(--bg2)); opacity: .55; }
.day.today { background: color-mix(in srgb, var(--accent) 7%, var(--bg)); }
.day .dn { font-size: 12px; font-weight: 700; color: var(--muted); display: flex; justify-content: space-between; }
.day.today .dn b { background: var(--accent); color: var(--accent-ink); border-radius: 5px; padding: 0 5px; }
.week .day { min-height: 60vh; }
.ev { display: flex; gap: 5px; align-items: baseline; font-size: 12px; padding: 2px 5px; border-radius: 5px; cursor: pointer;
  border-left: 3px solid var(--tv); background: var(--bg2); min-width: 0; }
.ev:hover { background: var(--bg3); }
.ev.stream { border-left-color: var(--stream); }
.ev.premiere { border-left-color: var(--prem); }
.ev.sub { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ok) 60%, transparent); }
.ev .t { color: var(--muted); font-variant-numeric: tabular-nums; flex: none; }
.ev .s { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.ev .c { color: var(--muted); flex: none; font-family: var(--mono); font-size: 11px; }
.more { font-size: 12px; color: var(--accent); background: none; border: 0; text-align: left; padding: 2px 5px; }
.week .ev { flex-wrap: wrap; }
.week .ev .s { white-space: normal; }
.week .ev .p { width: 100%; color: var(--muted); font-size: 11px; }

/* list */
.daygroup { margin-bottom: 18px; }
.daygroup h3 { position: sticky; top: 56px; z-index: 2; margin: 0 0 6px; padding: 6px 0; font-size: 14px; background: var(--bg);
  display: flex; gap: 10px; align-items: baseline; border-bottom: 1px solid var(--line); }
.daygroup h3 small { font-weight: 500; }
.row { display: grid; grid-template-columns: 52px 84px minmax(0, 1fr) 200px 90px 34px; gap: 12px; align-items: center;
  padding: 7px 8px; border-radius: 8px; cursor: pointer; }
.row:hover { background: var(--bg2); }
.row img, .row .noimg { width: 52px; height: 74px; object-fit: cover; border-radius: 6px; background: var(--bg3); }
.row .time { font-variant-numeric: tabular-nums; font-weight: 700; }
.row .time small { display: block; font-weight: 500; font-size: 11px; }
.row .title { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .title .orig { color: var(--muted); font-weight: 500; margin-left: 6px; }
.row .meta { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .net { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .net .k { display: inline-block; width: 7px; height: 7px; border-radius: 2px; margin-right: 6px; background: var(--tv); }
.row .net .k.stream { background: var(--stream); }
.row .code { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.row .add { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg2); font-size: 18px; line-height: 1; }
.row .add.on { background: color-mix(in srgb, var(--ok) 22%, var(--bg2)); border-color: var(--ok); color: var(--ok); font-size: 14px; }
.flag { display: inline-block; font-size: 10px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; padding: 1px 6px;
  border-radius: 4px; margin-right: 4px; background: color-mix(in srgb, var(--prem) 22%, transparent); color: var(--prem); }
.flag.n { background: color-mix(in srgb, var(--stream) 20%, transparent); color: var(--stream); }
.flag.f { background: color-mix(in srgb, var(--bad) 20%, transparent); color: var(--bad); }
.src { font-size: 10px; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; margin-left: 4px; }
.empty { color: var(--muted); padding: 40px; text-align: center; }

/* drawer */
.scrim { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 40; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(760px, 100vw); background: var(--bg2); z-index: 50;
  box-shadow: var(--shadow); overflow: auto; padding: 22px 26px 60px; border-left: 1px solid var(--line); }
.drawer .close { position: absolute; top: 12px; right: 14px; border: 0; background: none; font-size: 26px; color: var(--muted); }
.hero { display: grid; grid-template-columns: 120px 1fr; gap: 18px; margin-bottom: 14px; }
.hero img, .hero .noimg { width: 120px; height: 172px; border-radius: 10px; object-fit: cover; background: var(--bg3); }
.hero h2 { font-size: 22px; letter-spacing: -.01em; margin-bottom: 2px; }
.hero .ov { color: var(--muted); font-size: 13px; max-height: 6.2em; overflow: auto; margin-top: 8px; }
.kv { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--muted); margin-top: 6px; }
.kv b { color: var(--text); font-weight: 600; }
.rhythm { display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 8px; margin: 6px 0;
  background: color-mix(in srgb, var(--accent) 12%, var(--bg3)); font-weight: 600; }
.rhythm::before { content: "↻"; color: var(--accent); }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); margin: 14px 0; padding: 12px 14px 14px; min-width: 0; }
legend { padding: 0 6px; font-weight: 700; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
label > input, label > select, label > textarea { color: var(--text); font-size: 13px; }
label > input:not([type=checkbox]):not([type=radio]), label > select, label > textarea { width: 100%; min-width: 0; }
.inline > select { width: auto; }
.grid2 > *, .grid3 > *, .grid4 > * { min-width: 0; }
label.row-l { flex-direction: row; align-items: center; gap: 7px; color: var(--text); font-size: 13px; }
.svc { display: grid; grid-template-columns: 22px 110px 1fr auto; gap: 8px; align-items: center; padding: 8px; border-radius: 8px;
  background: var(--bg); border: 1px solid var(--line); margin-bottom: 6px; }
.svc .rank { font-weight: 800; color: var(--muted); text-align: center; }
.svc.main .rank { color: var(--accent); }
.svc .acts { display: flex; gap: 4px; }
.svc .more-opts { grid-column: 2 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.svc .res { grid-column: 2 / -1; font-size: 12px; color: var(--muted); }
.svc .res.ok { color: var(--ok); }
.svc .res.bad { color: var(--bad); }
.search-res { grid-column: 2 / -1; display: flex; flex-direction: column; gap: 3px; max-height: 220px; overflow: auto; }
.search-res button { text-align: left; background: var(--bg2); border: 1px solid var(--line); border-radius: 6px; padding: 5px 8px; font-size: 12px; }
.search-res button:hover { border-color: var(--accent); }
.sugg { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; }
.sugg button { border: 1px dashed var(--accent); background: none; color: var(--text); border-radius: 99px; padding: 3px 10px; font-size: 12px; }
.radio { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.radio label { flex-direction: row; align-items: center; gap: 6px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px;
  color: var(--text); cursor: pointer; font-size: 13px; }
.radio label:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.hint { font-size: 12px; color: var(--muted); margin: 4px 0 0; }
.note { font-size: 12px; padding: 7px 10px; border-radius: 8px; background: var(--bg3); color: var(--muted); margin: 6px 0; }
.note.bad { color: var(--bad); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; position: sticky; bottom: -60px; padding: 12px 0;
  background: linear-gradient(transparent, var(--bg2) 30%); }
.eps { width: 100%; border-collapse: collapse; font-size: 12px; }
.eps td, .eps th { padding: 4px 6px; border-bottom: 1px solid var(--line); text-align: left; }
.eps th { color: var(--muted); font-weight: 600; }
.eps .code { font-family: var(--mono); }
.st { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 99px; background: var(--bg3); color: var(--muted); white-space: nowrap; }
.st.downloaded { background: color-mix(in srgb, var(--ok) 20%, transparent); color: var(--ok); }
.st.queued, .st.downloading { background: color-mix(in srgb, var(--info) 20%, transparent); color: var(--info); }
.st.waiting { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
.st.failed, .st.missed, .st.cancelled { background: color-mix(in srgb, var(--bad) 18%, transparent); color: var(--bad); }
.cands { display: flex; flex-direction: column; gap: 4px; }
.cands button { display: flex; gap: 10px; align-items: center; text-align: left; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 6px; }
.cands img { width: 34px; height: 50px; object-fit: cover; border-radius: 4px; background: var(--bg3); }
details summary { cursor: pointer; color: var(--muted); font-weight: 600; margin: 6px 0; }

/* subs */
.subs { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 12px; }
.sub-card { display: grid; grid-template-columns: 74px 1fr; gap: 12px; background: var(--bg2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 10px; cursor: pointer; }
.sub-card:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
.sub-card.off { opacity: .55; }
.sub-card img, .sub-card .noimg { width: 74px; height: 106px; border-radius: 7px; object-fit: cover; background: var(--bg3); }
.sub-card h4 { margin: 0 0 2px; font-size: 15px; }
.sub-card .svcs { display: flex; gap: 4px; flex-wrap: wrap; margin: 4px 0; }
.tag { font-family: var(--mono); font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 4px; background: var(--bg3); }
.tag.main { background: var(--accent); color: var(--accent-ink); }
.sub-card .line { font-size: 12px; color: var(--muted); }
.counts { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.cards.small { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.cards.small button { display: flex; gap: 8px; align-items: center; background: var(--bg2); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px 6px 6px; max-width: 320px; text-align: left; }
.cards.small img { width: 36px; height: 52px; object-fit: cover; border-radius: 4px; background: var(--bg3); }

/* tables */
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { color: var(--muted); font-weight: 600; font-size: 12px; }
.bar { height: 5px; background: var(--bg3); border-radius: 3px; overflow: hidden; width: 120px; margin-top: 4px; }
.bar div { height: 100%; background: var(--info); }
.err { color: var(--bad); font-size: 12px; max-width: 520px; }
.panel { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 14px; }
.panel .grid4 { margin-bottom: 10px; }
.log { font-family: var(--mono); font-size: 12px; }
.log div { padding: 4px 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 160px 70px 1fr; gap: 10px; }
.log .error { color: var(--bad); } .log .warning { color: var(--warn); } .log .success { color: var(--ok); }

/* settings */
.settings { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(420px, 100%), 1fr)); gap: 0 18px; }
.settings fieldset { margin: 8px 0; }
.settings label { margin-bottom: 8px; }
.settings textarea { width: 100%; min-height: 140px; font-family: var(--mono); font-size: 12px; }
.stations { display: flex; flex-wrap: wrap; gap: 4px; max-height: 220px; overflow: auto; }
.stations label { flex-direction: row; gap: 4px; align-items: center; font-size: 12px; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 2px 6px; margin: 0; }

.toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: var(--bg3); border: 1px solid var(--line);
  padding: 10px 16px; border-radius: 10px; box-shadow: var(--shadow); z-index: 60; max-width: 90vw; }
.toast.bad { border-color: var(--bad); color: var(--bad); }
.toast.ok { border-color: var(--ok); }

@media (max-width: 1000px) {
  .cal-body { grid-template-columns: 1fr; }
  .networks { position: static; max-height: 220px; }
  .row { grid-template-columns: 40px 54px minmax(0, 1fr) 34px; }
  .row img, .row .noimg { width: 40px; height: 58px; }
  .row .net, .row .code { display: none; }
  .grid2, .grid3, .grid4 { grid-template-columns: 1fr 1fr; }
  .top { flex-wrap: wrap; gap: 8px; }
  .health { display: none; }
  .day { min-height: 80px; }
}

.seg.tabs button b { font-weight: 600; font-size: 11px; color: var(--muted); margin-left: 3px; font-variant-numeric: tabular-nums; }
.seg.tabs button.active b { color: var(--accent); }
.seg.tabs button.dim { opacity: .55; }
#src-note { margin: 0 0 10px; }

.variant { display: grid; grid-template-columns: 22px 96px minmax(0, 1fr) 92px 110px auto 30px; gap: 8px; align-items: end;
  padding: 8px; border-radius: 8px; background: var(--bg); border: 1px solid var(--line); margin-bottom: 6px; }
.variant .rank { font-weight: 800; color: var(--muted); text-align: center; padding-bottom: 8px; }
.variant:first-child .rank { color: var(--accent); }
.variant .chips { padding: 3px 0; }
.variant label.row-l { padding-bottom: 6px; }
.tag.ver { background: color-mix(in srgb, var(--prem) 22%, var(--bg3)); color: var(--text); font-family: var(--font); }
.optgroup h4 { margin: 12px 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.svc-params { grid-column: 2 / -1; border-top: 1px dashed var(--line); padding-top: 8px; }
.vcell { min-width: 110px; }
.vcell label.row-l { gap: 5px; }
.err.small { font-size: 11px; max-width: 220px; }
details.err summary { cursor: pointer; color: var(--bad); font-weight: 500; }
@media (max-width: 1000px) { .variant { grid-template-columns: 22px 1fr 1fr; } }
.variant .chip { padding: 2px 7px; font-size: 11px; }

.preview { margin-top: 10px; }
.preview .rls { margin: 3px 0; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.preview code, .ppline code { font-family: var(--mono); font-size: 12px; background: var(--bg); padding: 2px 6px; border-radius: 5px; border: 1px solid var(--line); word-break: break-all; }
#r-params h4 { margin: 10px 0 4px; }
.st.pp-done { background: color-mix(in srgb, var(--ok) 20%, transparent); color: var(--ok); }
.st.pp-running, .st.pp-queued { background: color-mix(in srgb, var(--info) 20%, transparent); color: var(--info); }
.st.pp-failed { background: color-mix(in srgb, var(--bad) 18%, transparent); color: var(--bad); }
.ppline { margin-top: 6px; display: flex; flex-direction: column; gap: 3px; align-items: flex-start; }
.ppline pre { max-height: 260px; overflow: auto; font-size: 11px; background: var(--bg); padding: 8px; border-radius: 6px; white-space: pre-wrap; }
.settings fieldset.wide { grid-column: 1 / -1; }
.settings textarea.yaml { min-height: 320px; }
.settings textarea.yaml.small { min-height: 140px; }

.sub-card.rule { grid-template-columns: 44px 1fr; }
.rule-ico { width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; font-size: 20px;
  background: color-mix(in srgb, var(--accent) 16%, var(--bg3)); }
.sub-h { margin: 12px 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
label > .chips { margin-top: 2px; }
.st.act-new { background: color-mix(in srgb, var(--ok) 20%, transparent); color: var(--ok); }
.st.act-exists, .st.act-seen { background: var(--bg3); color: var(--muted); }
.st.act-no_service, .st.act-error { background: color-mix(in srgb, var(--bad) 18%, transparent); color: var(--bad); }

.st.dupe { background: color-mix(in srgb, var(--prem) 22%, transparent); color: var(--prem); }
.dupes { margin-top: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
.dupes .rls { margin: 4px 0; }

/* login and users */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { width: min(380px, 100%); background: var(--bg2); border: 1px solid var(--line); border-radius: 14px;
  padding: 26px 24px 22px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px; }
.login-card h1 { font-size: 18px; margin: 6px 0 0; }
.login-card label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.login-card input { width: 100%; }
.login-card .primary { margin-top: 4px; padding: 9px 14px; }
.login-card .hint { margin: 0; font-size: 12px; color: var(--muted); }
.usermenu { position: relative; }
.usermenu > button { background: var(--bg3); border: 1px solid var(--line); border-radius: 99px; padding: 3px 10px 3px 4px;
  display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; }
.usermenu .avatar { width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center; font-size: 11px; font-weight: 800; text-transform: uppercase; }
.usermenu .menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 210px; background: var(--bg2);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 6px; z-index: 30; }
.usermenu .menu .who { padding: 6px 8px 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; font-size: 12px; }
.usermenu .menu button { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 7px 8px; border-radius: 6px; }
.usermenu .menu button:hover { background: var(--bg3); }
.role { font-size: 11px; padding: 1px 7px; border-radius: 99px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.role.admin { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
.role.viewer { color: var(--info); }
.users { width: 100%; border-collapse: collapse; font-size: 13px; }
.users th { text-align: left; font-size: 11px; color: var(--muted); font-weight: 600; padding: 4px 6px; }
.users td { padding: 6px; border-top: 1px solid var(--line); vertical-align: middle; }
.users tr.off td { opacity: .5; }
.users td.acts { text-align: right; white-space: nowrap; }
.users td.acts button { margin-left: 4px; }
.users select { padding: 3px 6px; }
.user-add { display: grid; grid-template-columns: 1fr 1fr 130px auto; gap: 8px; align-items: end; margin-top: 10px; }
@media (max-width: 640px) {
  .user-add { grid-template-columns: 1fr 1fr; }
  .usermenu > button .uname { display: none; }
}
.pw-form { display: flex; flex-direction: column; gap: 10px; max-width: 360px; margin-top: 12px; }
.pw-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
input.invalid { border-color: var(--bad) !important; }
table.eps tr.skip td { opacity: .38; text-decoration: line-through; text-decoration-color: var(--muted); }
.hint .err { color: var(--bad); }
.pred { font-size: 11px; color: var(--muted); white-space: nowrap; }
.inrow { display: flex; gap: 6px; align-items: center; }
.inrow input { flex: 1; min-width: 0; }
.insecure { background: color-mix(in srgb, var(--bad) 18%, var(--bg2)); color: var(--text); border-bottom: 1px solid var(--bad);
  padding: 7px 18px; font-size: 13px; }
.dupes .why { color: var(--ok); white-space: nowrap; }
table.eps tr.proj td { color: var(--muted); }
table.eps td.ld { white-space: nowrap; }
