:root {
  --bg: #0a0e16; --surface: #111723; --surface2: #182030; --line: #232d42; --text: #eaf0fb; --muted: #8e9bb5; --accent: #7b93ff;
  --ok: #2fd39a; --fail: #ff5f6d; --run: #ffb648; --skip: #566179; --blocked: #ff8a3d; --on-solid: #0a0e16;
  --ok-bg: rgba(47,211,154,.12); --fail-bg: rgba(255,95,109,.13); --run-bg: rgba(255,182,72,.13); --skip-bg: rgba(86,97,121,.14);
  --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 8px 24px rgba(0,0,0,.25);
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #eef1f8; --surface: #fff; --surface2: #f5f7fc; --line: #dde3f0; --text: #131a2b; --muted: #5f6b86; --accent: #4560e8;
    --ok: #12a573; --fail: #d93a4a; --run: #c77d0a; --skip: #8a94ab; --blocked: #c2570c; --on-solid: #fff;
    --ok-bg: rgba(18,165,115,.10); --fail-bg: rgba(217,58,74,.10); --run-bg: rgba(199,125,10,.12); --skip-bg: rgba(138,148,171,.14);
    --shadow: 0 1px 2px rgba(20,30,60,.06), 0 8px 24px rgba(20,30,60,.06);
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { font-size: 17px; color-scheme: dark light; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: Inter, "Segoe UI Variable", "Segoe UI", system-ui, sans-serif; line-height: 1.45; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* guidance banner */
.head { position: sticky; top: 0; z-index: 5; }
.banner { --lc: var(--accent); position: relative; display: flex; flex-wrap: wrap; align-items: flex-start; gap: 6px 24px; padding: 12px 40px; border-bottom: 3px solid var(--lc); background: color-mix(in srgb, var(--lc) 14%, var(--surface)); }
.banner[data-level="ok"] { --lc: var(--ok); }
.banner[data-level="attention"] { --lc: var(--run); --cycle: 2.4s; }
.banner[data-level="blocked"] { --lc: var(--blocked); --cycle: 2s; }
.banner[data-level="failed"] { --lc: var(--fail); --cycle: 1.6s; }
.banner.flash { border-bottom-width: 6px; }
.banner.flash::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: var(--lc); opacity: 0; animation: banner-pulse var(--cycle, 2s) ease-in-out infinite; }
@keyframes banner-pulse { 0%, 100% { opacity: 0; } 50% { opacity: .26; } }
.banner-body { flex: 1 1 360px; min-width: 0; }
.banner-body:empty { display: none; }
.banner-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.banner-tag { padding: 2px 10px; border: 2px solid var(--lc); border-radius: 999px; background: var(--surface); font-size: .76rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.banner-head { font-weight: 800; font-size: 1.08rem; overflow-wrap: anywhere; }
.banner-steps { margin: 6px 0 0; padding-left: 1.4em; font-size: .94rem; }
.banner-steps li { margin: 2px 0; overflow-wrap: anywhere; }
.step-link { font: inherit; color: var(--accent); background: none; border: 0; padding: 0; text-align: left; text-decoration: underline; cursor: pointer; }
.banner-time { margin-left: auto; color: var(--muted); font-size: .82rem; white-space: nowrap; }
@media (prefers-reduced-motion: reduce) {
  .banner.flash::after { display: none; }
  .banner.flash { box-shadow: inset 0 0 0 4px var(--lc); }
}

/* top bar */
.top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; padding: 16px 40px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.logo { width: 38px; height: 38px; border-radius: 11px; background: linear-gradient(135deg, var(--accent), var(--ok)); display: grid; place-items: center; color: var(--on-solid); font-weight: 800; font-size: 17px; }
.top h1 { font-size: 1.35rem; margin: 0; letter-spacing: -.01em; }
.top .sub { color: var(--muted); font-size: .85rem; overflow-wrap: anywhere; }
.grow { flex: 1; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: .9rem; font-weight: 600; }
.chip .dot { width: 10px; height: 10px; }
.chip.mac { padding: 6px 12px; font-size: .84rem; white-space: nowrap; }
.chip .admin { padding: 1px 8px; border-radius: 999px; background: var(--accent); color: var(--on-solid); font-size: .7rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.live { color: var(--muted); font-size: .88rem; display: flex; align-items: center; gap: 8px; }
.live i { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); animation: pulse 2s infinite; }
.live.off i { background: var(--fail); animation: none; }
.signout, .refbtn { font: inherit; font-size: .82rem; font-weight: 600; color: var(--accent); background: none; border: 1px solid var(--line); border-radius: 8px; padding: 3px 10px; cursor: pointer; }
.signout:disabled, .refbtn:disabled { opacity: .6; cursor: progress; }
.refbtn.busy::before { content: ""; display: inline-block; width: 9px; height: 9px; margin-right: 6px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -1px; }

.dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; background: var(--skip); flex: none; }
.s-success { --c: var(--ok); --cbg: var(--ok-bg); } .s-failure { --c: var(--fail); --cbg: var(--fail-bg); }
.s-in_progress { --c: var(--run); --cbg: var(--run-bg); } .s-queued, .s-skipped, .s-cancelled, .s-neutral { --c: var(--skip); --cbg: var(--skip-bg); }
.dot[class*="s-"] { background: var(--c); }
.dot.s-in_progress { animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
@keyframes spin { to { transform: rotate(360deg); } }

main { padding: 18px 40px 24px; width: 100%; }
@media (max-width: 1100px) { .top { padding: 12px 20px; gap: 10px 14px; } .banner { padding: 12px 20px; } main { padding: 16px 20px 24px; } }

/* workflow cards */
.tabs { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 16px; }
.tab { flex: 1 1 280px; max-width: 460px; display: flex; align-items: center; gap: 14px; text-align: left; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 12px 18px; cursor: pointer; box-shadow: var(--shadow); }
.tab:hover { border-color: var(--accent); }
.tab.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset, var(--shadow); background: var(--surface2); }
.tab .pf { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 1.4rem; background: var(--surface2); flex: none; }
.tab.on .pf { background: var(--surface); }
.tab .pf.android { color: #3ddc84; }
.tab b { display: block; font-size: 1.15rem; line-height: 1.2; }
.tab small { color: var(--muted); font-size: .84rem; }
.tab .dot { margin-left: auto; width: 14px; height: 14px; }
.track-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; margin-bottom: 14px; }
.track-head h2 { margin: 0 8px 0 0; font-size: 1.25rem; letter-spacing: -.01em; }
.track-head .actions { margin: 0; padding: 0; background: none; border: 0; box-shadow: none; gap: 10px; }
.track-head .actions button { padding: 7px 14px; font-size: .88rem; }
.actionnote { flex-basis: 100%; margin: 0; color: var(--muted); font-size: .9rem; }
.actionnote:empty { display: none; }
.path { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr); gap: 10px; align-items: stretch; margin-bottom: 16px; }
.env { border: 1px solid var(--line); border-radius: 18px; padding: 10px 12px 12px; background: color-mix(in srgb, var(--surface) 55%, transparent); min-width: 0; display: flex; flex-direction: column; }
.env-title { display: flex; align-items: center; gap: 8px; margin: 0 4px 8px; font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.env-cards { display: grid; grid-template-columns: minmax(0, 1fr); grid-auto-rows: 1fr; gap: 12px; flex: 1; }
.arrow { align-self: center; color: var(--muted); font-size: 1.5rem; }
.wf { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 14px 20px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.wf::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 5px; background: var(--c, var(--skip)); }
.wf .name { color: var(--muted); font-size: .86rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.wf .state { font-size: 1.5rem; font-weight: 750; margin: 2px 0 0; color: var(--c, var(--text)); display: flex; align-items: center; gap: 12px; letter-spacing: -.01em; }
.wf .state.muted { color: var(--muted); }
.wf .meta { color: var(--muted); font-size: .92rem; overflow-wrap: anywhere; }
.spark { display: flex; gap: 4px; align-items: flex-end; height: 18px; margin-top: 8px; }
.spark span { flex: 1; max-width: 18px; border-radius: 4px; background: var(--c); height: 100%; opacity: .9; }
.spark span.s-skipped, .spark span.s-cancelled, .spark span.s-queued { height: 45%; opacity: .5; }
.spark span.s-in_progress { animation: pulse 1.2s infinite; }

/* layout */
.layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
@media (max-width: 1250px) { .path { grid-template-columns: minmax(0, 1fr); } .arrow { display: none; } }
.panel, .run-head h2, .now, .row { min-width: 0; overflow-wrap: anywhere; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }

/* run header */
.facts { padding: 14px 24px 18px; border-top: 1px solid var(--line); }
.facts h3 { margin: 0 0 8px; font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.facts dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 20px; margin: 0; font-size: .92rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.run-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 28px; align-items: center; padding: 14px 24px 12px; border-bottom: 1px solid var(--line); }
.run-head .eyebrow { color: var(--muted); font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.run-head h2 { margin: 2px 0 6px; font-size: 1.15rem; letter-spacing: -.01em; line-height: 1.25; }
.run-head .row { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; color: var(--muted); font-size: .9rem; }
.badge { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px; border-radius: 999px; font-weight: 700; font-size: .9rem; color: var(--c); background: var(--cbg); }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 10px; background: var(--surface2); border: 1px solid var(--line); color: var(--text); font-weight: 600; font-size: .88rem; }
.btn:hover { text-decoration: none; border-color: var(--accent); }
.run-sum { display: flex; align-items: center; gap: 14px; }
.run-sum .big { font-size: 1.45rem; font-weight: 750; font-variant-numeric: tabular-nums; line-height: 1.1; }
.run-sum small { color: var(--muted); font-size: .8rem; }

/* rings */
.ring { position: relative; display: inline-grid; place-items: center; flex: none; color: var(--c); }
.ring.sz42 { width: 42px; height: 42px; }
.ring.sz68 { width: 68px; height: 68px; }
.ring > svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.ring circle { fill: none; stroke: var(--c); stroke-width: 5; }
.ring .trk { opacity: .18; }
.ring .arc { stroke-linecap: round; transition: stroke-dashoffset .5s; }
.ring .rsp { stroke-linecap: round; stroke-dasharray: 26 100; transform-box: fill-box; transform-origin: center; animation: spin 1.1s linear infinite; }
.ring .mid { position: relative; display: grid; place-items: center; font-weight: 750; font-size: .78rem; font-variant-numeric: tabular-nums; }

/* pipeline */
.job { padding: 12px 20px 12px; border-bottom: 1px solid var(--line); }
.job:last-child { border-bottom: 0; }
.job-title { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-weight: 700; font-size: 1rem; margin-bottom: 4px; }
.job-title .t { color: var(--muted); font-weight: 500; font-size: .9rem; }
.now { margin: 0 0 0 auto; color: var(--muted); font-size: .85rem; font-weight: 400; }
.now b { color: var(--run); }
.pipe { display: flex; align-items: stretch; overflow-x: auto; padding: 6px 2px 10px; scroll-snap-type: x proximity; }
.conn { flex: none; width: 26px; height: 2px; margin-top: 40px; align-self: flex-start; position: relative; background: var(--c); opacity: .65; }
.conn::after { content: ""; position: absolute; right: -1px; top: -4px; border: 5px solid transparent; border-right: 0; border-left: 7px solid var(--c); }
.conn.s-queued, .conn.s-skipped, .conn.s-cancelled { background: none; border-top: 2px dashed var(--line); opacity: 1; }
.stg { flex: 1 1 0; min-width: 172px; scroll-snap-align: start; padding: 10px 8px 8px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface2); }
.stg.s-in_progress, .stg.s-failure { background: var(--cbg); border-color: var(--c); }
.stg.s-queued, .stg.s-skipped { opacity: .72; }
.stg-head { display: flex; align-items: center; gap: 10px; padding: 0 2px 8px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.stg-head b { display: block; font-size: 1rem; line-height: 1.2; }
.stg-head small { color: var(--muted); font-size: .8rem; font-variant-numeric: tabular-nums; }
.stp { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; gap: 7px; align-items: start; padding: 3px 6px; border-radius: 8px; font-size: .82rem; line-height: 1.25; }
.stp .ico { color: var(--c); display: grid; margin-top: 1px; }
.stp .nm { display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.stp .du { color: var(--muted); font-size: .76rem; white-space: nowrap; font-variant-numeric: tabular-nums; padding-top: 1px; }
.stp.s-in_progress, .stp.s-failure { background: var(--cbg); }
.stp.s-in_progress .du, .stp.s-failure .du { color: var(--c); font-weight: 650; }
.stp.s-queued .nm, .stp.s-skipped .nm, .stp.s-cancelled .nm { color: var(--muted); }
.spinner { animation: spin 1s linear infinite; transform-origin: center; }
@media (max-width: 700px) {
  html { font-size: 16px; }
  .head { position: static; }
  .top { padding: 12px 16px; gap: 10px 12px; }
  .banner { padding: 12px 16px; }
  .banner-time { margin-left: 0; }
  .top .grow { display: none; }
  .live { flex-basis: 100%; flex-wrap: wrap; row-gap: 6px; }
  main { padding: 16px 16px 40px; }
  .wf { padding: 18px 18px; }
  .run-head { grid-template-columns: minmax(0, 1fr); padding: 16px; } .run-head h2 { font-size: 1.2rem; }
  .job { padding: 14px 12px 16px; }
  .stg { min-width: 200px; }
  .actions { padding: 14px 16px; }
  .runs-head { padding: 14px 16px 4px; } .hist { padding: 10px 16px 14px; }
  .facts { padding: 14px 16px 18px; }
  .facts dl { grid-template-columns: minmax(0, 1fr); gap: 0; } .facts dd { margin-bottom: 6px; }
}

/* history */
.runs-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; padding: 14px 22px 2px; }
.runs-head h3 { margin: 0; font-size: 1.05rem; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filters button { font: inherit; font-size: .85rem; font-weight: 600; color: var(--muted); background: var(--surface2); border: 1px solid var(--line); border-radius: 999px; padding: 5px 14px; cursor: pointer; }
.filters button.on { background: var(--accent); border-color: var(--accent); color: var(--on-solid); }
.hist { display: flex; gap: 10px; overflow-x: auto; padding: 8px 22px 12px; }
.item { flex: none; min-width: 170px; display: flex; align-items: center; gap: 10px; padding: 7px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface2); cursor: pointer; font: inherit; color: var(--text); text-align: left; }
.item:hover { border-color: var(--accent); }
.item.sel { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.item .dot { margin: 0; }
.item .t1 { display: flex; flex: 1; gap: 10px; align-items: baseline; font-weight: 650; font-size: .9rem; white-space: nowrap; }
.item .t1 small { color: var(--muted); font-weight: 500; font-size: .8rem; margin-left: auto; white-space: nowrap; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-bottom: 16px; padding: 10px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.actions button, .linkbtn { font: inherit; font-weight: 650; font-size: .92rem; border-radius: 10px; padding: 9px 18px; cursor: pointer; border: 1px solid var(--accent); background: var(--accent); color: var(--on-solid); }
.actions button.prod { background: var(--fail); border-color: var(--fail); color: var(--on-solid); }
.actions button[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.actions button.spot { outline: 3px solid var(--run); outline-offset: 3px; }
.linkbtn { background: none; border: none; color: var(--accent); padding: 4px 0; font-size: .85rem; }
.empty { padding: 28px; color: var(--muted); }
.err { margin-bottom: 20px; padding: 14px 18px; border-radius: 12px; background: var(--fail-bg); color: var(--fail); font-weight: 600; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login-card { width: min(420px, 100%); padding: 32px 28px; text-align: center; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.login-card .logo { margin: 0 auto 14px; width: 52px; height: 52px; font-size: 22px; border-radius: 15px; }
.login-card h1 { margin: 0 0 4px; font-size: 1.4rem; }
.login-card p { margin: 6px 0 18px; color: var(--muted); font-size: .95rem; }
.login-msg { margin: 0 0 16px; padding: 10px 14px; border-radius: 12px; background: var(--fail-bg); color: var(--fail); font-weight: 600; font-size: .92rem; }
.login-btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; width: 100%; padding: 12px 18px; border-radius: 12px; background: var(--accent); color: var(--on-solid); font-weight: 700; font-size: 1rem; }
.login-btn:hover { text-decoration: none; filter: brightness(1.08); }

/* frozen badge, admin link, toasts */
.chip .frozen { padding: 1px 8px; border-radius: 999px; background: var(--fail); color: var(--on-solid); font-size: .7rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
a.signout { display: inline-block; text-decoration: none; }
a.signout:hover { text-decoration: none; border-color: var(--accent); }
.toasts { position: fixed; z-index: 40; right: 16px; bottom: 16px; display: grid; gap: 8px; width: min(380px, calc(100vw - 32px)); }
.toast { font: inherit; font-size: .92rem; font-weight: 600; text-align: left; color: var(--text); padding: 12px 16px; border-radius: 12px; border: 1px solid var(--line); border-left-width: 5px; background: var(--surface); box-shadow: var(--shadow); cursor: pointer; overflow-wrap: anywhere; }
.toast.good { border-left-color: var(--ok); }
.toast.bad { border-left-color: var(--fail); }

/* confirm dialog (native <dialog>) */
.dlg { width: min(520px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow: auto; margin: auto; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); padding: 20px 24px; }
.dlg::backdrop { background: rgba(5,8,14,.6); }
.dlg.danger { border: 2px solid var(--fail); }
.dlg.danger h3 { color: var(--fail); }
.dlg h3 { margin: 0 0 8px; font-size: 1.2rem; }
.dlg p { margin: 6px 0; color: var(--muted); font-size: .92rem; }
.dlg p.question { color: var(--text); font-size: 1rem; font-weight: 700; overflow-wrap: anywhere; }
.dlg .facts-mini { margin: 10px 0; padding: 10px 12px; border-radius: 12px; background: var(--surface2); font-size: .9rem; overflow-wrap: anywhere; }
.dlg .opts { display: grid; gap: 8px; margin: 12px 0; }
.dlg .opt { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; font-weight: 650; }
.dlg .opt:has(input:checked) { border-color: var(--accent); background: var(--surface2); }
.dlg .warn { padding: 10px 12px; border-radius: 12px; background: var(--run-bg); color: var(--run); font-size: .9rem; font-weight: 600; margin: 8px 0; }
.dlg input[type=text] { width: 100%; font: inherit; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--text); margin-top: 6px; }
.dlg .verr { min-height: 1.2em; margin-top: 4px; color: var(--fail); font-size: .85rem; font-weight: 600; }
.dlg .btns { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.dlg .btns button { font: inherit; font-weight: 650; font-size: .92rem; border-radius: 10px; padding: 9px 18px; cursor: pointer; border: 1px solid var(--line); background: var(--surface2); color: var(--text); }
.dlg .btns button.go { background: var(--accent); border-color: var(--accent); color: var(--on-solid); }
.dlg.danger .btns button.go { background: var(--fail); border-color: var(--fail); }
.dlg .btns button:disabled { opacity: .45; cursor: not-allowed; }

/* admin page */
.admin main { max-width: 1200px; margin: 0 auto; }
.admin h2 { margin: 24px 0 6px; font-size: 1.2rem; }
.admin .help { margin: 0 0 12px; color: var(--muted); font-size: .9rem; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); padding: 14px 18px; margin-bottom: 16px; }
.card.danger { border-color: var(--fail); }
.tablewrap { overflow-x: auto; }
.atable { width: 100%; border-collapse: collapse; font-size: .9rem; }
.atable th { text-align: left; color: var(--muted); font-size: .76rem; letter-spacing: .06em; text-transform: uppercase; padding: 6px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.atable td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.atable tr:last-child td { border-bottom: 0; }
.permgrid { display: grid; grid-template-columns: repeat(2, minmax(150px, 1fr)); gap: 4px 14px; min-width: 330px; }
.permgrid h4 { margin: 0 0 2px; font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.chk { display: flex; align-items: center; gap: 6px; font-size: .86rem; white-space: nowrap; }
.chk input { width: 16px; height: 16px; accent-color: var(--accent); }
.chk.off { opacity: .5; }
.rowbtn, .abtn { font: inherit; font-weight: 650; font-size: .86rem; border-radius: 10px; padding: 6px 14px; cursor: pointer; border: 1px solid var(--accent); background: var(--accent); color: var(--on-solid); }
.abtn.plain { background: var(--surface2); border-color: var(--line); color: var(--text); }
.abtn.bad, .rowbtn.bad { background: var(--fail); border-color: var(--fail); }
.rowbtn:disabled, .abtn:disabled { opacity: .5; cursor: not-allowed; }
.rowbtn.small { padding: 3px 10px; background: var(--surface2); border-color: var(--line); color: var(--text); }
.form { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.form label { display: grid; gap: 4px; font-size: .82rem; color: var(--muted); font-weight: 600; }
.form input[type=text] { font: inherit; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--text); min-width: 0; width: 200px; }
.statebar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.statebar .pill { padding: 3px 12px; border-radius: 999px; font-weight: 800; font-size: .8rem; letter-spacing: .05em; text-transform: uppercase; }
.pill.on { background: var(--fail); color: var(--on-solid); }
.pill.offp { background: var(--ok-bg); color: var(--ok); }
.inline-msg { margin: 8px 0 0; min-height: 1.2em; font-size: .88rem; font-weight: 600; color: var(--muted); }
.inline-msg.bad { color: var(--fail); }
.reason { color: var(--muted); font-size: .8rem; }
details.params summary { cursor: pointer; color: var(--accent); font-size: .85rem; }
details.params div { margin-top: 4px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .8rem; overflow-wrap: anywhere; color: var(--muted); }
.res { font-weight: 700; color: var(--c, var(--muted)); }
@media (max-width: 700px) {
  .toasts { right: 16px; left: 16px; width: auto; bottom: 12px; }
  .dlg { padding: 16px; }
  .admin main { padding: 12px 16px 40px; }
  .form input[type=text] { width: 100%; }
  .form label { flex: 1 1 140px; }
  .atable.stack thead { display: none; }
  .atable.stack, .atable.stack tbody, .atable.stack tr, .atable.stack td { display: block; width: 100%; }
  .atable.stack tr { padding: 10px 0; border-bottom: 1px solid var(--line); }
  .atable.stack td { border: 0; padding: 3px 0; }
  .atable.stack td[data-label]::before { content: attr(data-label); display: block; color: var(--muted); font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; }
  .permgrid { min-width: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chk { white-space: normal; }
}

.suggest-wrap { position: relative; min-width: 0; }
.suggest { position: absolute; left: 0; right: 0; top: 100%; z-index: 20; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.18); max-height: 260px; overflow: auto; margin-top: 4px; }
.suggest .sugg { display: block; width: 100%; text-align: left; padding: 9px 12px; background: none; border: 0; font: inherit; color: inherit; cursor: pointer; }
.suggest .sugg:hover, .suggest .sugg:focus-visible { background: var(--surface2); outline: none; }
.sugg-empty { padding: 10px 12px; font-size: .86rem; opacity: .8; }
.whocard { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; }
.who-av { width: 48px; height: 48px; border-radius: 50%; }
.who-txt { flex: 1; min-width: 120px; }
