:root {
  --bg: #f5f6fb; --panel: #ffffff; --ink: #0f1222; --ink2: #2b3046; --muted: #6b7189; --line: #e7e9f2; --line2: #f0f1f7;
  --accent: #5b5bf0; --accent2: #a855f7; --accent-soft: #eef0ff; --accent-ink: #fff;
  --grad: linear-gradient(135deg, #6366f1 0%, #8b5cf6 55%, #c026d3 100%);
  --ok: #059669; --ok-bg: #e6f7f0; --warn: #c2410c; --warn-bg: #fff3e8; --bad: #dc2626; --bad-bg: #fdeeee;
  --info: #0284c7; --info-bg: #e6f4fb; --amz: #ff9900; --amz-bg: #fff6e6;
  --hover: #f6f7fc; --side: #0e1024; --side2: #161a36; --side-ink: #aab0cf;
  --radius: 14px; --shadow: 0 1px 2px rgba(16,18,40,.04), 0 8px 24px -8px rgba(16,18,40,.08);
  --shadow-lg: 0 24px 60px -12px rgba(16,18,40,.28);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0d19; --panel: #12152a; --ink: #eceefa; --ink2: #cfd3ea; --muted: #8b91b0; --line: #23284a; --line2: #1a1e3a;
    --accent: #8187ff; --accent-soft: #1d2150; --ok: #34d399; --ok-bg: #0d2a22; --warn: #fb923c; --warn-bg: #2d1a0d;
    --bad: #f87171; --bad-bg: #2c1218; --info: #38bdf8; --info-bg: #0c2333; --amz-bg: #2b1f08;
    --hover: #181c38; --side: #080a16; --side2: #10132a; --shadow: none;
  }
}
* { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; }
body { margin: 0; font: 14px/1.5 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--ink); display: flex; min-height: 100vh; }
svg.i { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

/* sidebar */
.side { width: 240px; background: radial-gradient(120% 60% at 0% 0%, #23206b 0%, transparent 60%), var(--side); color: var(--side-ink); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; flex-shrink: 0; }
.brand { display: flex; gap: 11px; align-items: center; padding: 20px 18px 16px; color: #fff; }
.brand b { display: block; font-size: 16px; letter-spacing: -.01em; }
.brand small { display: block; font-size: 11px; color: var(--side-ink); opacity: .8; }
.logo { width: 36px; height: 36px; border-radius: 10px; background: var(--grad); display: grid; place-items: center; box-shadow: 0 6px 18px -4px rgba(139,92,246,.6); }
.logo svg { width: 20px; height: 20px; fill: #fff; }
nav { padding: 4px 10px; overflow-y: auto; }
.navlabel { font-size: 10.5px; text-transform: uppercase; letter-spacing: .09em; color: #6a7099; padding: 14px 10px 6px; font-weight: 600; }
nav a { display: flex; gap: 10px; align-items: center; padding: 8px 10px; margin: 1px 0; color: var(--side-ink); cursor: pointer; text-decoration: none; border-radius: 9px; font-weight: 500; transition: background .15s, color .15s; }
nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
nav a.on { background: rgba(129,135,255,.16); color: #fff; box-shadow: inset 0 0 0 1px rgba(129,135,255,.25); }
nav a.on svg { color: #a5a9ff; }
nav kbd { margin-left: auto; }
kbd { font: 600 10px Inter, sans-serif; border: 1px solid rgba(255,255,255,.18); border-radius: 5px; padding: 1px 5px; opacity: .7; }
.syncwidget { margin: auto 12px 14px; padding: 12px; border-radius: 12px; background: var(--side2); border: 1px solid rgba(255,255,255,.06); font-size: 12px; cursor: pointer; }
.syncwidget:hover { border-color: rgba(255,255,255,.14); }
.syncwidget .t { display: flex; align-items: center; gap: 7px; color: #fff; font-weight: 600; margin-bottom: 6px; }
.syncwidget .r { display: flex; justify-content: space-between; gap: 8px; padding: 2px 0; }
.syncwidget .r span:last-child { color: #dfe2f5; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #6b7189; display: inline-block; flex-shrink: 0; }
.dot.on { background: #34d399; box-shadow: 0 0 0 3px rgba(52,211,153,.18); }
.dot.manual { background: #60a5fa; }
.dot.busy { background: #fbbf24; animation: pulse 1s infinite; }
.dot.err { background: #f87171; }
@keyframes pulse { 50% { opacity: .35; } }

/* layout */
main { flex: 1; padding: 28px 32px 70px; min-width: 0; max-width: 1500px; }
.head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
h1 { font-size: 26px; margin: 0; letter-spacing: -.025em; font-weight: 800; }
h2 { font-size: 15px; margin: 0 0 12px; letter-spacing: -.01em; font-weight: 700; display: flex; align-items: center; gap: 8px; }
h3 { font-size: 13px; margin: 0 0 8px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.sub { color: var(--muted); margin: 4px 0 0; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.grow { flex: 1; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: 1fr 1fr; } .g3 { grid-template-columns: repeat(3, 1fr); } .g32 { grid-template-columns: 3fr 2fr; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); min-width: 0; }
.card.flat { box-shadow: none; }
.card-h { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.card-h h2 { margin: 0; }

/* hero */
.hero { position: relative; overflow: hidden; border-radius: 18px; padding: 22px 24px; color: #fff; background: var(--grad); box-shadow: 0 18px 40px -16px rgba(124,58,237,.55); margin-bottom: 18px; }
.hero::after { content: ""; position: absolute; right: -60px; top: -80px; width: 260px; height: 260px; border-radius: 50%; background: rgba(255,255,255,.12); }
.hero::before { content: ""; position: absolute; right: 120px; bottom: -110px; width: 200px; height: 200px; border-radius: 50%; background: rgba(255,255,255,.08); }
.hero h1 { color: #fff; }
.hero .sub { color: rgba(255,255,255,.82); }
.hero button { background: rgba(255,255,255,.16); color: #fff; border-color: rgba(255,255,255,.28); backdrop-filter: blur(6px); }
.hero button:hover { background: rgba(255,255,255,.26); }
.hero button.white { background: #fff; color: #4c1d95; border-color: #fff; }
.hero-stats { display: flex; gap: 28px; flex-wrap: wrap; margin-top: 16px; position: relative; z-index: 1; }
.hero-stats div b { display: block; font-size: 24px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.hero-stats div span { font-size: 12px; opacity: .8; }

/* KPI */
.kpis { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-bottom: 18px; }
.kpi { display: flex; gap: 14px; align-items: center; }
.kpi .ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0; background: var(--accent-soft); color: var(--accent); }
.kpi .ic.ok { background: var(--ok-bg); color: var(--ok); } .kpi .ic.bad { background: var(--bad-bg); color: var(--bad); }
.kpi .ic.warn { background: var(--warn-bg); color: var(--warn); } .kpi .ic.amz { background: var(--amz-bg); color: var(--amz); }
.kpi .ic.info { background: var(--info-bg); color: var(--info); }
.kpi .v { font-size: 24px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.kpi .l { color: var(--muted); font-size: 12.5px; font-weight: 500; }

/* tables */
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line2); vertical-align: middle; }
th { font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; position: sticky; top: 0; background: var(--panel); z-index: 1; border-bottom: 1px solid var(--line); }
td.n, th.n { text-align: right; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: var(--hover); }
tr.click, td.click { cursor: pointer; }
.tablewrap { overflow: auto; max-height: 68vh; margin: 0 -18px; padding: 0 6px; }
.mono { font-family: "Cascadia Mono", ui-monospace, Consolas, monospace; font-size: 12.5px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.thumb { width: 38px; height: 38px; border-radius: 8px; object-fit: cover; background: var(--hover); border: 1px solid var(--line); flex-shrink: 0; display: grid; place-items: center; color: var(--muted); }
.thumb.lg { width: 84px; height: 84px; border-radius: 12px; }
.cell { display: flex; gap: 11px; align-items: center; min-width: 0; }
.cell > div { min-width: 0; }
.trunc { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 420px; }

.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 99px; font-size: 11.5px; font-weight: 600; white-space: nowrap; line-height: 1.6; }
.pill.ok { background: var(--ok-bg); color: var(--ok); } .pill.low, .pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.out, .pill.bad { background: var(--bad-bg); color: var(--bad); } .pill.neutral { background: var(--hover); color: var(--muted); }
.pill.info { background: var(--info-bg); color: var(--info); } .pill.amz { background: var(--amz-bg); color: #b45309; }
.pill.accent { background: var(--accent-soft); color: var(--accent); }

/* controls */
button, .btn { font: inherit; font-weight: 500; border: 1px solid var(--line); background: var(--panel); color: var(--ink); padding: 8px 14px; border-radius: 10px; cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 7px; transition: background .15s, border-color .15s, transform .05s, box-shadow .15s; }
button:hover { background: var(--hover); border-color: #d5d8e8; }
button:active { transform: translateY(1px); }
button.primary { background: var(--grad); color: #fff; border-color: transparent; font-weight: 600; box-shadow: 0 6px 16px -6px rgba(99,102,241,.6); }
button.primary:hover { filter: brightness(1.06); box-shadow: 0 8px 20px -6px rgba(99,102,241,.7); }
button.amz { background: var(--amz); color: #1a1205; border-color: transparent; font-weight: 600; }
button.danger { color: var(--bad); }
button.small { padding: 4px 10px; font-size: 12px; border-radius: 8px; }
button:disabled { opacity: .5; cursor: default; transform: none; }
button svg.i { width: 16px; height: 16px; }
input, select, textarea { font: inherit; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--ink); min-width: 0; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
input.big { font-size: 18px; padding: 14px 16px 14px 46px; width: 100%; border-radius: 14px; }
.searchbox { position: relative; }
.searchbox svg { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 20px; height: 20px; }
label.f { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--muted); font-weight: 500; }
label.f input, label.f select { color: var(--ink); font-size: 14px; }
label.f span { font-size: 11.5px; }
.form { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.seg { display: inline-flex; background: var(--hover); border: 1px solid var(--line); border-radius: 11px; padding: 3px; gap: 2px; }
.seg button { border: 0; border-radius: 8px; background: transparent; padding: 6px 12px; color: var(--muted); }
.seg button:hover { background: transparent; color: var(--ink); }
.seg button.on { background: var(--panel); color: var(--ink); box-shadow: 0 1px 3px rgba(16,18,40,.12); font-weight: 600; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; }
.tabs button { flex-shrink: 0; }
.tabs button { border: 0; border-radius: 0; background: transparent; padding: 10px 14px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 600; }
.tabs button:hover { background: transparent; color: var(--ink); }
.tabs button.on { color: var(--accent); border-bottom-color: var(--accent); }
.switch { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--line2); cursor: pointer; }
.switch:last-child { border-bottom: 0; }
.switch input { display: none; }
.switch .tg { width: 38px; height: 22px; border-radius: 99px; background: var(--line); position: relative; flex-shrink: 0; transition: background .2s; margin-top: 1px; }
.switch .tg::after { content: ""; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.switch input:checked + .tg { background: var(--accent); }
.switch input:checked + .tg::after { transform: translateX(16px); }
.switch b { display: block; font-weight: 600; }
.switch small { color: var(--muted); }

/* mode picker */
.modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.mode { border: 1.5px solid var(--line); border-radius: 12px; padding: 12px; cursor: pointer; background: var(--panel); transition: border-color .15s, background .15s; text-align: left; display: block; white-space: normal; }
.mode:hover { border-color: #c9cce6; background: var(--panel); }
.mode.on { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 3px var(--accent-soft); }
.mode b { display: flex; align-items: center; gap: 7px; font-size: 14px; margin-bottom: 3px; }
.mode small { color: var(--muted); font-size: 12px; line-height: 1.4; display: block; }

/* flow diagram */
.flow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12.5px; }
.flow .st { padding: 8px 12px; border-radius: 10px; background: var(--hover); border: 1px solid var(--line); font-weight: 600; }
.flow .ar { color: var(--muted); }

.modal { position: fixed; inset: 0; background: rgba(10,12,30,.5); backdrop-filter: blur(3px); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; z-index: 50; overflow: auto; animation: fade .15s; }
.modal.hidden { display: none; }
.modal-box { background: var(--panel); border-radius: 18px; padding: 24px; width: min(720px, 100%); box-shadow: var(--shadow-lg); border: 1px solid var(--line); animation: pop .18s ease-out; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
#toasts { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 60; }
.toast { background: #111427; color: #fff; padding: 11px 16px; border-radius: 12px; max-width: 400px; box-shadow: var(--shadow-lg); display: flex; gap: 9px; align-items: center; animation: pop .2s ease-out; font-weight: 500; }
.toast::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #34d399; flex-shrink: 0; }
.toast.bad::before { background: #f87171; }
.spark { display: flex; align-items: flex-end; gap: 3px; height: 110px; padding-top: 6px; }
.spark i { flex: 1; background: var(--grad); border-radius: 4px 4px 1px 1px; min-height: 2px; opacity: .9; transition: opacity .15s; }
.spark i:hover { opacity: 1; filter: brightness(1.1); }
.meter { height: 8px; border-radius: 99px; background: var(--line2); overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 99px; background: var(--grad); }
.empty { padding: 36px 20px; text-align: center; color: var(--muted); }
.empty svg { width: 34px; height: 34px; opacity: .5; margin-bottom: 6px; }
.suggest { border: 1px solid var(--line); border-radius: 14px; margin-top: 8px; max-height: 360px; overflow: auto; background: var(--panel); box-shadow: var(--shadow); }
.suggest > div { padding: 9px 12px; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 10px; border-bottom: 1px solid var(--line2); }
.suggest > div:hover, .suggest > div.on { background: var(--accent-soft); }
.popmenu > div { justify-content: flex-start; font-size: 13px; }
.popmenu svg.i { width: 16px; height: 16px; color: var(--muted); }
.alert { padding: 11px 14px; border-radius: 12px; background: var(--warn-bg); color: var(--warn); margin: 10px 0; display: flex; gap: 10px; align-items: flex-start; }
.alert.bad { background: var(--bad-bg); color: var(--bad); }
.alert.ok { background: var(--ok-bg); color: var(--ok); }
.alert.info { background: var(--info-bg); color: var(--info); }
.alert svg.i { margin-top: 1px; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 12px; }
.chg-up { color: var(--ok); font-weight: 600; } .chg-down { color: var(--bad); font-weight: 600; }
details summary { cursor: pointer; color: var(--accent); font-weight: 600; }
pre { background: var(--hover); padding: 12px; border-radius: 10px; overflow: auto; max-height: 300px; font-size: 12px; }
.spin { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; display: inline-block; animation: rot .7s linear infinite; }
@keyframes rot { to { transform: rotate(360deg); } }
/* roles: hidden / locked controls */
[data-noperm] { display: none !important; }
.locked, .locked * { cursor: not-allowed !important; }
.mode.locked { opacity: .65; }

/* boot + sign-in screens */
.splash { display: none; }
body.booting .side, body.booting main, body.booting #auth { display: none; }
body.booting .splash { display: grid; place-items: center; flex: 1; min-height: 100vh; color: var(--accent); }
#auth { display: none; }
body.signed-out .side, body.signed-out main { display: none; }
body.signed-out #auth { display: block; flex: 1; }
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: minmax(320px, 1fr) minmax(380px, 560px); }
.auth-brand { position: relative; overflow: hidden; color: #fff; padding: 40px 48px; display: flex; flex-direction: column; justify-content: space-between; gap: 32px;
  background: radial-gradient(90% 70% at 0% 0%, #3b2fa8 0%, transparent 60%), radial-gradient(70% 60% at 100% 100%, #7e22ce 0%, transparent 60%), var(--side); }
.auth-brand::after { content: ""; position: absolute; width: 420px; height: 420px; right: -140px; top: 18%; border-radius: 50%; background: var(--grad); opacity: .22; filter: blur(8px); }
.auth-brand .brand { padding: 0; position: relative; z-index: 1; }
.auth-pitch { position: relative; z-index: 1; }
.auth-pitch h2 { font-size: 36px; line-height: 1.12; font-weight: 800; letter-spacing: -.03em; max-width: 460px; margin: 0 0 26px; display: block; }
.auth-pitch ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.auth-pitch li { display: flex; gap: 12px; align-items: center; color: #d9dcf3; font-weight: 500; }
.auth-pitch li span { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.14); flex-shrink: 0; }
.auth-foot { position: relative; z-index: 1; display: flex; gap: 8px; align-items: center; color: var(--side-ink); font-size: 12.5px; }
.auth-card { display: grid; place-items: center; padding: 36px 24px; background: var(--bg); }
.auth-inner { width: min(400px, 100%); }
.auth-inner h1 { font-size: 30px; }
.auth-form { display: grid; gap: 14px; margin-top: 22px; }
.auth-form input { padding: 11px 14px; font-size: 15px; width: 100%; }
.auth-form input[type=checkbox] { width: 17px; height: 17px; padding: 0; flex-shrink: 0; }
button.big { padding: 11px 16px; font-size: 15px; justify-content: center; width: 100%; border-radius: 12px; }
.pw { position: relative; display: block; }
.pw input { width: 100%; padding-right: 44px; }
.pw .eye { position: absolute; right: 5px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; padding: 6px; color: var(--muted); }
.pw .eye:hover { background: var(--hover); color: var(--ink); }
label.check { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--ink2); cursor: pointer; }
.meter-pw { height: 6px; border-radius: 99px; background: var(--line2); overflow: hidden; margin-top: 6px; }
.meter-pw i { display: block; height: 100%; border-radius: 99px; transition: width .25s, background .25s; }

/* people */
.avatar { --h: 250; width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center; flex-shrink: 0; color: #fff; font-weight: 700; font-size: 12.5px; letter-spacing: .02em;
  background: linear-gradient(135deg, hsl(var(--h) 72% 60%), hsl(calc(var(--h) + 45) 70% 47%)); box-shadow: 0 2px 6px -2px hsl(var(--h) 60% 40% / .5); }
.avatar.xs { width: 22px; height: 22px; font-size: 9.5px; box-shadow: none; }
.avatar.lg { width: 58px; height: 58px; font-size: 20px; }
.who-chip { display: inline-flex; gap: 7px; align-items: center; font-size: 12.5px; font-weight: 500; white-space: nowrap; }
.userbox { margin: 0 12px 14px; }
.userbtn { width: 100%; background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.08); color: #fff; padding: 8px 10px; border-radius: 12px; justify-content: flex-start; gap: 10px; }
.userbtn:hover { background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.16); }
.userbtn svg.i { color: var(--side-ink); }
.ub-who { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; flex: 1; line-height: 1.25; }
.ub-who b { font-size: 13px; max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ub-who small { color: var(--side-ink); font-size: 11px; }
.syncwidget { margin-bottom: 10px; }
.pill.role-admin { background: linear-gradient(135deg, #ede9fe, #fae8ff); color: #7c3aed; }
.pill.role-manager { background: var(--info-bg); color: var(--info); }
.pill.role-staff { background: var(--ok-bg); color: var(--ok); }
.pill.role-viewer { background: var(--hover); color: var(--muted); }
.g4roles { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.role-card { padding: 12px 14px; }
.roles-pick { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.matrix td.c, .matrix th.c { text-align: center; }
.matrix .yes { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--ok-bg); color: var(--ok); }
.matrix .yes svg { width: 14px; height: 14px; }
.matrix .no { color: var(--muted); opacity: .5; }
.act { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: var(--ok-bg); color: var(--ok); flex-shrink: 0; }
.act svg { width: 14px; height: 14px; }
.act.bad { background: var(--bad-bg); color: var(--bad); } .act.info { background: var(--info-bg); color: var(--info); }
.act.warn { background: var(--warn-bg); color: var(--warn); } .act.neutral { background: var(--hover); color: var(--muted); }
.kv { display: inline-flex; gap: 5px; background: var(--hover); border: 1px solid var(--line2); border-radius: 7px; padding: 1px 7px; margin: 2px 4px 2px 0; font-size: 11.5px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kv span { color: var(--muted); }
.dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-top: 16px; }
.dl div { background: var(--hover); border-radius: 10px; padding: 10px 12px; }
.dl b { display: block; font-size: 13px; margin-top: 2px; }
.dl span { font-size: 11.5px; color: var(--muted); }
@media (prefers-color-scheme: dark) {
  .pill.role-admin { background: #2a1d4f; color: #c4b5fd; }
}

@media (max-width: 1000px) { .g32 { grid-template-columns: 1fr; } }
@media (max-width: 900px) {
  body { flex-direction: column; }
  .side { width: 100%; height: auto; position: static; }
  nav { display: flex; overflow-x: auto; padding: 0 8px 8px; }
  .navlabel, nav kbd, .syncwidget { display: none; }
  nav a { white-space: nowrap; }
  main { padding: 18px 16px 60px; }
  .g2, .g3, .modes, .roles-pick { grid-template-columns: 1fr; }
  .tablewrap { margin: 0 -18px; }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-brand { padding: 24px; gap: 14px; }
  .auth-pitch h2 { font-size: 24px; margin-bottom: 0; }
  .auth-pitch ul, .auth-foot { display: none; }
  .userbox { margin: 0 12px 10px; }
}
