:root {
  --bg: #0b0d10;
  --panel: #12161b;
  --surface: #14181d;
  --raise: #1a1f26;
  --line: #232a33;
  --line-2: #2e3742;
  --ink: #e8ecf1;
  --ink-2: #a9b3bf;
  --muted: #74808d;
  --accent: #ffb020;
  --accent-ink: #1a1200;
  --danger: #ff4d3d;
  --ok: #3ddc97;
  --warn: #ffb020;
  --serious: #ff8a3d;
  --c-impersonation: #3987e5;
  --c-spam: #d95926;
  --c-malicious_link: #199e70;
  --c-other: #c98500;
  --r: 6px;
  --font-display: 'Chakra Petch', system-ui, sans-serif;
  --font-body: 'IBM Plex Sans', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body, #app { height: 100%; }
body {
  background: var(--bg); color: var(--ink); font: 14px/1.5 var(--font-body);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
.muted { color: var(--muted); }
.mono { font-family: var(--font-mono); font-size: 12.5px; }
.ico { display: inline-flex; flex: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- login ---------- */
.login-wrap {
  min-height: 100%; display: grid; place-items: center; padding: 24px;
  background:
    linear-gradient(transparent 0 calc(100% - 1px), #ffffff06 0) 0 0 / 100% 32px,
    radial-gradient(ellipse at 50% 0%, #ffb02012, transparent 60%), var(--bg);
}
.login {
  width: min(380px, 100%); background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; padding: 32px; display: grid; gap: 18px;
}
.brand { display: flex; align-items: center; gap: 10px; font: 600 18px var(--font-display); letter-spacing: .04em; }
.brand .ico { color: var(--accent); }
.brand small { display: block; font: 500 11px var(--font-mono); color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }
.landing { width: min(460px, 100%); gap: 22px; }
.appeal { width: min(560px, 100%); gap: 20px; }
.appeal-guild { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; }
.appeal-guild img, .appeal-guild .avatar { width: 44px; height: 44px; border-radius: 12px; flex: none; }
.appeal-guild b { display: block; font: 600 16px var(--font-display); }
.appeal-title { font: 600 20px/1.25 var(--font-display); }
.appeal-form { display: grid; gap: 14px; }
.appeal-form textarea { resize: vertical; }
.appeal-status h3 { display: flex; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.appeal-status p + p { margin-top: 6px; }
.appeal-answer { margin-top: 8px; }
.appeal-answer small { display: block; font: 500 11px var(--font-mono); color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }
.appeal-answer p { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13.5px; }
.appeal-head { padding: 14px 18px; display: grid; gap: 10px; border-bottom: 1px solid var(--line); }
.appeal-link { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.appeal-link code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 12.5px var(--font-mono); padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; }
.landing-head h1 { font: 600 24px/1.25 var(--font-display); letter-spacing: .01em; text-wrap: balance; }
.landing-head p { margin-top: 6px; }
.features { list-style: none; display: grid; gap: 12px; }
.features li { display: flex; gap: 12px; align-items: flex-start; }
.features li > .ico { color: var(--accent); margin-top: 2px; }
.features b { display: block; font-weight: 600; font-size: 13.5px; }
.features span { font-size: 13px; }
.landing-cta { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.landing-cta .btn { justify-content: center; }
.btn-lg { height: 42px; font-size: 14.5px; }
details.owner { border-top: 1px solid var(--line); padding-top: 14px; }
details.owner summary { cursor: pointer; color: var(--muted); font-size: 13px; }
details.owner summary:hover { color: var(--ink-2); }
.owner-login { display: grid; gap: 12px; margin-top: 12px; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100%; }
.side {
  background: var(--panel); border-right: 1px solid var(--line); padding: 18px 12px;
  display: flex; flex-direction: column; gap: 18px; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.side .brand { padding: 0 8px; }
.guild-pick select { width: 100%; }
.nav { display: grid; gap: 2px; }
.nav-label { font: 600 10.5px var(--font-mono); color: var(--muted); letter-spacing: .1em; text-transform: uppercase; padding: 12px 10px 6px; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: var(--r);
  color: var(--ink-2); text-decoration: none; font-weight: 500;
}
.nav a:hover { background: var(--raise); color: var(--ink); }
.nav a.active { background: #ffb02014; color: var(--accent); box-shadow: inset 2px 0 0 var(--accent); }
.nav .count {
  margin-left: auto; font: 600 11px var(--font-mono); background: var(--danger); color: #fff;
  border-radius: 10px; padding: 0 6px; min-width: 18px; text-align: center;
}
.side-foot { margin-top: auto; display: grid; gap: 10px; }
.who { display: flex; gap: 10px; align-items: center; font-weight: 500; font-size: 13px; min-width: 0; }
.who > div { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who small { display: block; color: var(--muted); font-size: 11.5px; font-weight: 400; }
.avatar { width: 28px; height: 28px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: var(--raise); border: 1px solid var(--line-2); color: var(--accent); font: 600 12px var(--font-display); object-fit: cover; }

.main { min-width: 0; }
.topbar {
  display: flex; align-items: center; gap: 14px; padding: 14px 28px; border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(6px);
  position: sticky; top: 0; z-index: 5;
}
.topbar h1 { font: 600 19px var(--font-display); letter-spacing: .02em; }
.topbar .spacer { flex: 1; }
.content { padding: 24px 28px 60px; display: grid; gap: 20px; max-width: 1400px; }

.status {
  display: inline-flex; align-items: center; gap: 8px; font: 500 12px var(--font-mono);
  padding: 4px 10px; border: 1px solid var(--line-2); border-radius: 20px; color: var(--ink-2);
}
.status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.status.on .dot { background: var(--ok); box-shadow: 0 0 0 3px #3ddc9726; animation: pulse 2.4s infinite; }
.status.off .dot { background: var(--danger); }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px #3ddc9700; } }

/* ---------- panels ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; min-width: 0; }
.panel > header {
  display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line);
}
.panel > header h2 { font: 600 14px var(--font-display); letter-spacing: .04em; text-transform: uppercase; }
.panel > header .spacer { flex: 1; }
.panel-body { padding: 18px; }
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; display: grid; gap: 4px; }
.kpi .label { font: 500 11px var(--font-mono); color: var(--muted); letter-spacing: .08em; text-transform: uppercase; display: flex; gap: 6px; align-items: center; }
.kpi .value { font: 600 28px var(--font-display); font-variant-numeric: tabular-nums; }
.kpi .sub { font-size: 12px; color: var(--ink-2); }
.kpi.alert .value { color: var(--danger); }

/* ---------- controls ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 14px; border-radius: var(--r);
  border: 1px solid var(--line-2); background: var(--raise); font-weight: 500; cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: var(--muted); }
.btn:disabled { opacity: .5; cursor: default; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn-primary:hover { background: #ffc04d; border-color: #ffc04d; }
.btn-danger { background: transparent; border-color: #ff4d3d80; color: var(--danger); }
.btn-danger:hover { background: #ff4d3d14; border-color: var(--danger); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12.5px; }
.iconbtn { background: none; border: 0; padding: 6px; border-radius: var(--r); cursor: pointer; color: var(--ink-2); display: inline-flex; }
.iconbtn:hover { background: var(--raise); color: var(--ink); }

input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], input[type=date], select, textarea {
  background: var(--bg); border: 1px solid var(--line-2); border-radius: var(--r); padding: 7px 10px; min-height: 34px; width: 100%;
}
textarea { resize: vertical; min-height: 80px; font-family: var(--font-mono); font-size: 12.5px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
input[type=color] { width: 44px; height: 34px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--bg); padding: 2px; }

.field { display: grid; gap: 6px; }
.field-label { font-weight: 500; font-size: 13px; color: var(--ink-2); }
.hint { font-size: 12px; color: var(--muted); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.form-error { color: var(--danger); font-size: 13px; min-height: 0; }
.form-error:empty { display: none; }

.switch { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13.5px; }
.switch input { appearance: none; width: 34px; height: 20px; border-radius: 10px; background: var(--line-2); position: relative; cursor: pointer; flex: none; transition: background .15s; }
.switch input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--ink-2); transition: transform .15s; }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { transform: translateX(14px); background: var(--accent-ink); }

.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.filters .search { position: relative; flex: 1; min-width: 220px; max-width: 360px; }
.filters .search .ico { position: absolute; left: 10px; top: 8px; color: var(--muted); }
.filters .search input { padding-left: 34px; }
.filters select { width: auto; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--r); overflow: hidden; }
.seg button { background: none; border: 0; padding: 6px 12px; cursor: pointer; color: var(--ink-2); font-size: 13px; }
.seg button + button { border-left: 1px solid var(--line-2); }
.seg button.on { background: var(--raise); color: var(--ink); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font: 600 11px var(--font-mono); color: var(--muted); letter-spacing: .08em; text-transform: uppercase; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #ffffff04; }
td.num { font-variant-numeric: tabular-nums; text-align: right; }
td.nowrap, th.nowrap { white-space: nowrap; }
.cell-main { font-weight: 500; }
.cell-sub { font-size: 12px; color: var(--muted); }
.msg { white-space: pre-wrap; word-break: break-word; max-width: 560px; font-size: 13px; }
.msg.null { color: var(--muted); font-style: italic; }
.diff-before { color: var(--ink-2); text-decoration: line-through; text-decoration-color: #ff4d3d80; }
.more[hidden] { display: none; }
.more { display: flex; justify-content: center; padding: 14px; }

.idchip { font: 12px var(--font-mono); color: var(--ink-2); background: var(--bg); border: 1px solid var(--line); border-radius: 4px; padding: 1px 6px; cursor: copy; }
.idchip:hover { border-color: var(--line-2); color: var(--ink); }
.tag { display: inline-flex; align-items: center; gap: 6px; font: 500 12px var(--font-mono); padding: 2px 8px; border-radius: 4px; background: var(--raise); border: 1px solid var(--line-2); color: var(--ink-2); white-space: nowrap; }
.tag .sw { width: 8px; height: 8px; border-radius: 2px; }
.tag.ok { color: var(--ok); border-color: #3ddc9740; }
.tag.bad { color: var(--danger); border-color: #ff4d3d40; }
.tag.warn { color: var(--warn); border-color: #ffb02040; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; }

.risk { display: inline-flex; align-items: center; gap: 5px; font: 600 11.5px var(--font-mono); padding: 2px 8px; border-radius: 4px; white-space: nowrap; }
.risk-glyph { font-size: 9px; }
.risk-critical { background: #ff4d3d1f; color: #ff7a6d; }
.risk-serious { background: #ff8a3d1a; color: var(--serious); }
.risk-warning { background: #ffb0201a; color: var(--warn); }
.risk-info { background: var(--raise); color: var(--ink-2); }

/* ---------- alert list ---------- */
.alist { display: grid; }
.aitem { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line); align-items: start; }
.aitem:last-child { border-bottom: 0; }
.aitem.open { box-shadow: inset 3px 0 0 var(--danger); }
.aitem .title { font-weight: 600; }
.aitem .desc { color: var(--ink-2); font-size: 13px; white-space: pre-wrap; word-break: break-word; }
.aitem .meta { font-size: 12px; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; align-items: center; }
.aitem .side-r { display: grid; gap: 6px; justify-items: end; }

/* ---------- chart ---------- */
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid-line { stroke: var(--line); stroke-width: 1; }
.chart .axis-text { fill: var(--muted); font: 11px var(--font-mono); }
.chart .hit { fill: transparent; cursor: crosshair; }
.chart .hit:hover { fill: #ffffff08; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2); margin-bottom: 12px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 2px; }
.tooltip {
  position: absolute; pointer-events: none; background: var(--raise); border: 1px solid var(--line-2); border-radius: var(--r);
  padding: 8px 10px; font-size: 12px; min-width: 150px; box-shadow: 0 8px 24px #0008; z-index: 3; display: none;
}
.tooltip strong { display: block; font: 600 12px var(--font-mono); margin-bottom: 4px; }
.tooltip .row { display: flex; align-items: center; gap: 8px; color: var(--ink-2); }
.tooltip .row i { width: 8px; height: 8px; border-radius: 2px; }
.tooltip .row b { margin-left: auto; color: var(--ink); font-variant-numeric: tabular-nums; }

/* ---------- tiers ---------- */
.tiers { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.tier { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 16px; display: grid; gap: 10px; border-top: 3px solid var(--tc, var(--accent)); align-content: start; }
.tier h3 { font: 600 17px var(--font-display); display: flex; align-items: center; gap: 8px; }
.tier .price { font: 500 12px var(--font-mono); color: var(--ink-2); }
.tier ul { list-style: none; display: grid; gap: 4px; font-size: 13px; color: var(--ink-2); }
.tier li { display: flex; gap: 6px; }
.tier li .ico { color: var(--ok); margin-top: 2px; }
.tier .actions { display: flex; gap: 6px; margin-top: 4px; }

/* ---------- settings ---------- */
.settings-section { display: grid; gap: 16px; }
.settings-section + .settings-section { border-top: 1px solid var(--line); padding-top: 20px; margin-top: 4px; }
.savebar { position: sticky; bottom: 0; display: flex; justify-content: flex-end; gap: 10px; align-items: center; padding: 14px 0; background: linear-gradient(transparent, var(--bg) 40%); }
.savebar .dirty { color: var(--warn); font-size: 13px; }

/* ---------- misc ---------- */
.empty { display: grid; justify-items: center; gap: 8px; text-align: center; padding: 40px 20px; color: var(--muted); }
.empty strong { color: var(--ink); font: 600 15px var(--font-display); }
.empty p { max-width: 440px; font-size: 13px; }
.empty .ico { color: var(--line-2); }
.loading { display: flex; gap: 10px; align-items: center; padding: 30px; color: var(--muted); font: 12px var(--font-mono); }
.scan { width: 60px; height: 2px; background: linear-gradient(90deg, transparent, var(--accent), transparent); background-size: 200% 100%; animation: scan 1s linear infinite; }
@keyframes scan { from { background-position: 100% 0; } to { background-position: -100% 0; } }

.callout { border: 1px solid var(--line-2); background: var(--panel); border-radius: 10px; padding: 18px 20px; display: grid; gap: 10px; }
.callout.warn { border-color: #ffb02055; background: #ffb02008; }
.callout h3 { font: 600 15px var(--font-display); display: flex; gap: 8px; align-items: center; }
.callout ol { padding-left: 20px; display: grid; gap: 6px; color: var(--ink-2); }
.callout code, .code { font: 12.5px var(--font-mono); background: var(--bg); border: 1px solid var(--line); border-radius: 4px; padding: 1px 6px; color: var(--ink); }
pre.code { display: block; padding: 12px; overflow-x: auto; white-space: pre; }

.overlay { position: fixed; inset: 0; background: #000a; display: grid; place-items: center; z-index: 50; padding: 20px; }
.modal { width: min(520px, 100%); max-height: 90vh; overflow-y: auto; background: var(--panel); border: 1px solid var(--line-2); border-radius: 10px; display: grid; }
.modal header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal header h3 { font: 600 16px var(--font-display); }
.modal-body { padding: 20px; display: grid; gap: 14px; }
.modal .form-error { padding: 0 20px 10px; }
.modal footer { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); }

.toast { position: fixed; bottom: 20px; right: 20px; background: var(--raise); border: 1px solid var(--line-2); border-left: 3px solid var(--ok); padding: 10px 16px; border-radius: var(--r); z-index: 60; transform: translateY(20px); opacity: 0; transition: .25s; }
.toast.in { transform: none; opacity: 1; }
.toast-err { border-left-color: var(--danger); }

.menu-btn { display: none; }
@media (max-width: 980px) {
  .grid-2, .grid-main { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: 260px; z-index: 40; transform: translateX(-100%); transition: transform .2s; }
  .shell.nav-open .side { transform: none; box-shadow: 0 0 0 100vmax #0009; }
  .menu-btn { display: inline-flex; }
  .topbar, .content { padding-left: 16px; padding-right: 16px; }
}
@media (forced-colors: active) {
  .chart rect.seg { stroke: CanvasText; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- server list (add to server) ---------- */
.server-list { list-style: none; display: grid; gap: 2px; }
.server-list li { display: flex; align-items: center; gap: 12px; padding: 10px 6px; border-bottom: 1px solid var(--line); }
.server-list li:last-child { border-bottom: 0; }
.server-ico { width: 36px; height: 36px; border-radius: 10px; flex: none; display: grid; place-items: center;
  background: var(--raise); border: 1px solid var(--line-2); font: 600 12px var(--font-display); color: var(--ink-2); object-fit: cover; }
.server-name { flex: 1; min-width: 0; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.server-name small { display: block; color: var(--muted); font-size: 12px; font-weight: 400; }
a.btn { text-decoration: none; color: var(--ink); }
a.btn-primary { color: var(--accent-ink); }

/* ---------- plan & billing ---------- */
.bill-current { display: grid; gap: 16px; }
.bill-plan { display: flex; gap: 12px; align-items: center; }
.bill-plan .ico { color: var(--accent); }
.bill-plan b { display: block; font: 600 20px var(--font-display); }
.bill-rows { display: grid; gap: 8px; }
.kv { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.kv > span:first-child { color: var(--muted); min-width: 110px; }
.bill-email { max-width: 360px; }
.bill-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.bill-card { display: flex; flex-direction: column; gap: 12px; border: 1px solid var(--line); border-radius: 10px; padding: 16px; background: var(--panel); }
.bill-card.picked { border-color: var(--accent); }
.bill-card h3 { font: 600 16px var(--font-display); }
.bill-card .price b { font: 600 22px var(--font-display); }
.bill-card .price .per { color: var(--muted); margin-left: 4px; font-size: 12.5px; }
.bill-card .btn { justify-content: center; }
.bill-card ul { list-style: none; display: grid; gap: 6px; font-size: 13px; color: var(--ink-2); border-top: 1px solid var(--line); padding-top: 12px; }
.bill-card li::before { content: '› '; color: var(--accent); }
.bill-comp { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.bill-comp input { width: 130px; }
@media (max-width: 1200px) { .bill-cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .bill-cards { grid-template-columns: 1fr; } }

/* staff panel: server detail, payments, roles */
.server-head { display: grid; gap: 12px; }
.server-head > .btn { justify-self: start; }
.server-id { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.server-id h2 { font: 600 20px var(--font-display); }
.server-id .meta { font-size: 12px; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; align-items: center; }
.server-id .spacer { flex: 1; }
.avatar-lg { width: 44px; height: 44px; font-size: 18px; }
.kvs { display: grid; gap: 10px; }
.kv { display: flex; justify-content: space-between; gap: 16px; font-size: 13.5px; }
.kv > :last-child { text-align: right; }
.danger-zone { border-color: #ff4d3d40; }
.bar-row { display: grid; grid-template-columns: 110px 1fr auto; gap: 12px; align-items: center; padding: 6px 0; font-size: 13px; }
.bar-track { height: 10px; background: var(--raise); border-radius: 4px; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--accent); border-radius: 0 4px 4px 0; min-width: 2px; }
.role-card { border-bottom: 1px solid var(--line); padding: 16px 18px; display: grid; gap: 12px; }
.role-card:last-child { border-bottom: 0; }
.role-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.role-head input[type=text] { max-width: 240px; }
.role-head input[type=color] { width: 36px; height: 32px; padding: 2px; border-radius: 6px; background: transparent; border: 1px solid var(--line-2); }
.role-head select { max-width: 240px; }
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.role-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- security, evidence, backups, branding ---------- */
.modal.wide { width: min(880px, 100%); }
.lock-callout .btn { justify-self: start; }
.locked-section { opacity: .55; pointer-events: none; }
.lock-note { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--warn); }
.lock-note a { color: inherit; text-decoration: underline; pointer-events: auto; }
.sec-score { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
.sec-score .num { font: 600 56px/1 var(--font-display); letter-spacing: -.02em; }
.sec-score .num small { font-size: 18px; color: var(--muted); }
.sec-score .num.good { color: var(--ok); } .sec-score .num.mid { color: var(--warn); } .sec-score .num.bad { color: var(--danger); }
.finding { display: grid; grid-template-columns: auto 1fr; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.finding:last-child { border-bottom: 0; }
.finding p { color: var(--ink-2); font-size: 13.5px; margin-top: 2px; }
.finding .fix { margin-top: 6px; font-size: 13px; color: var(--ink); }
.finding .fix b { color: var(--muted); font: 500 11px var(--font-mono); text-transform: uppercase; letter-spacing: .06em; margin-right: 6px; }
.lvl-critical { color: var(--danger); border-color: #ff4d3d55; }
.lvl-high { color: #ff8a3d; border-color: #ff8a3d55; }
.lvl-medium { color: var(--warn); border-color: #ffb02055; }
.lvl-low { color: var(--ink-2); }
.spark { width: 100%; height: 64px; display: block; }
.spark path { fill: none; stroke: var(--ok); stroke-width: 2; }
.spark circle { fill: var(--ok); stroke: var(--panel); stroke-width: 2; }
.spark line { stroke: var(--line); }
.ev-msgs { display: grid; gap: 2px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.ev-msg { padding: 8px 12px; background: var(--bg); font-size: 13px; }
.ev-msg.off { background: #ff4d3d14; box-shadow: inset 3px 0 0 var(--danger); }
.ev-msg .who { font: 500 12px var(--font-mono); color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; }
.ev-msg p { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 2px; }
.ev-files { display: flex; gap: 8px; flex-wrap: wrap; }
.ev-files img { max-width: 220px; max-height: 160px; border-radius: 6px; border: 1px solid var(--line); display: block; }
.case { display: grid; gap: 14px; margin-top: 10px; padding: 14px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--bg); }
.case h4 { font: 500 11px var(--font-mono); color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }
.case ul { list-style: none; display: grid; gap: 6px; font-size: 13px; }
.case li { display: flex; gap: 8px; flex-wrap: wrap; align-items: baseline; }
.case .ev-card { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; display: grid; gap: 8px; background: var(--panel); }
.brand-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 340px); gap: 24px; }
@media (max-width: 860px) { .brand-grid { grid-template-columns: 1fr; } }
.embed-prev { background: #2b2d31; color: #dbdee1; border-radius: 8px; padding: 14px; font: 14px/1.4 system-ui, sans-serif; }
.embed-prev .bot { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.embed-prev .bot img, .embed-prev .bot .av { width: 36px; height: 36px; border-radius: 50%; background: #5865f2; display: grid; place-items: center; color: #fff; object-fit: cover; }
.embed-prev .bot b { color: #fff; } .embed-prev .bot .app { font-size: 10px; background: #5865f2; color: #fff; border-radius: 3px; padding: 0 4px; margin-left: 4px; }
.embed-prev .emb { border-left: 4px solid #ffb020; background: #232428; border-radius: 4px; padding: 10px 12px; display: grid; gap: 4px; }
.embed-prev .emb small { color: #949ba4; font-size: 12px; }
