:root {
  --bg: #0a0c11;
  --bg-2: #0e1118;
  --surface: #131722;
  --surface-2: #191e2b;
  --surface-3: #212736;
  --border: #242a3a;
  --border-2: #2f3648;
  --text: #e8eaf1;
  --text-2: #b8bdcc;
  --muted: #858ca0;
  --accent: #8b5cf6;
  --accent-2: #22d3ee;
  --accent-soft: rgba(139, 92, 246, 0.14);
  --grad: linear-gradient(135deg, #a78bfa 0%, #22d3ee 100%);
  --ok: #22c55e;
  --ok-soft: rgba(34, 197, 94, 0.14);
  --warn: #f59e0b;
  --warn-soft: rgba(245, 158, 11, 0.14);
  --bad: #ef4444;
  --bad-soft: rgba(239, 68, 68, 0.14);
  --info: #3b82f6;
  --info-soft: rgba(59, 130, 246, 0.14);
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --font: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --sidebar: 272px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  background-image:
    radial-gradient(1200px 600px at 100% -10%, rgba(139, 92, 246, 0.10), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(34, 211, 238, 0.07), transparent 60%);
  background-attachment: fixed;
  color: var(--text);
  font: 15px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: #a5b4fc; text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
img { display: block; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.muted { color: var(--muted); }
.hidden { display: none !important; }

/* ---------- boot / spinner ---------- */
.boot { min-height: 100vh; display: grid; place-items: center; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--surface-3); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(440px, 100%); background: rgba(19, 23, 34, .85); border: 1px solid var(--border); border-radius: 22px; padding: 40px 32px; text-align: center; box-shadow: var(--shadow); backdrop-filter: blur(10px); }
.logo-big { width: 72px; height: 72px; margin: 0 auto 18px; }
.login-card h1 { margin: 0 0 6px; font-size: 28px; letter-spacing: -.02em; }
.login-card p { margin: 0 0 26px; color: var(--muted); }
.login-features { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 26px; }
.login-features span { font-size: 12px; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--border-2); background: var(--surface-2); color: var(--text); font-weight: 600; cursor: pointer; transition: background .15s, border-color .15s, transform .05s; white-space: nowrap; }
.btn:hover { background: var(--surface-3); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: transparent; color: #fff; }
.btn.primary:hover { background: #7c4dff; }
.btn.discord { background: #5865f2; border-color: transparent; color: #fff; height: 48px; padding: 0 22px; font-size: 16px; width: 100%; }
.btn.discord:hover { background: #4752c4; }
.btn.danger { background: var(--bad-soft); border-color: rgba(239, 68, 68, .35); color: #fca5a5; }
.btn.danger:hover { background: rgba(239, 68, 68, .24); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn.icon { width: 36px; padding: 0; }
.btn svg { width: 18px; height: 18px; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; background: rgba(14, 17, 24, .92); border-right: 1px solid var(--border); backdrop-filter: blur(10px); z-index: 30; }
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 12px; font-weight: 800; font-size: 18px; letter-spacing: -.02em; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand img { width: 30px; height: 30px; }
.brand b { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

.guild-switch { margin: 6px 12px 10px; position: relative; }
.guild-switch > button { width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; text-align: left; }
.guild-switch > button:hover { border-color: var(--border-2); }
.guild-switch > button > svg { width: 16px; height: 16px; flex: 0 0 16px; color: var(--muted); }
.gicon svg { width: 18px; height: 18px; }
.guild-switch .gname { flex: 1; min-width: 0; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gicon { width: 34px; height: 34px; border-radius: 10px; flex: 0 0 34px; background: var(--surface-3); display: grid; place-items: center; font-weight: 800; font-size: 13px; color: var(--text-2); overflow: hidden; }
.gicon img { width: 100%; height: 100%; object-fit: cover; }
.dropdown { position: absolute; left: 0; right: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--border-2); border-radius: 12px; padding: 6px; box-shadow: var(--shadow); max-height: 340px; overflow: auto; z-index: 40; }
.dropdown button { width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px; border: 0; background: none; border-radius: 8px; cursor: pointer; text-align: left; }
.dropdown button:hover, .dropdown button.active { background: var(--surface-2); }

.nav { flex: 1; overflow-y: auto; padding: 4px 10px 16px; }
.nav-group { margin-top: 14px; }
.nav-group > span { display: block; padding: 0 10px 6px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.nav a { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 10px; color: var(--text-2); font-weight: 600; font-size: 14.5px; }
.nav a:hover { background: var(--surface); color: var(--text); text-decoration: none; }
.nav a.active { background: var(--accent-soft); color: #fff; box-shadow: inset 2px 0 0 var(--accent); }
.nav a svg { width: 18px; height: 18px; flex: 0 0 18px; opacity: .9; }
.nav a .dot { margin-left: auto; width: 8px; height: 8px; border-radius: 50%; background: var(--surface-3); }
.nav a .dot.on { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }

.me { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-top: 1px solid var(--border); }
.me img { width: 34px; height: 34px; border-radius: 50%; }
.me .who { flex: 1; min-width: 0; }
.me .who b { display: block; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me .who span { font-size: 12px; color: var(--muted); }

.lang-switch { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.lang-switch button { border: 0; background: none; padding: 4px 8px; font-size: 12px; font-weight: 700; color: var(--muted); cursor: pointer; }
.lang-switch button.active { background: var(--surface-3); color: var(--text); }

.main { min-width: 0; }
.topbar { display: none; }
.content { max-width: 1080px; margin: 0 auto; padding: 32px 32px 120px; }

/* ---------- page head ---------- */
.page-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 26px; }
.page-head .ph-icon { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--accent-soft); color: #c4b5fd; flex: 0 0 46px; }
.page-head .ph-icon svg { width: 24px; height: 24px; }
.page-head h1 { margin: 0; font-size: 26px; letter-spacing: -.02em; line-height: 1.2; }
.page-head p { margin: 4px 0 0; color: var(--muted); max-width: 640px; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ---------- cards ---------- */
.card { background: rgba(19, 23, 34, .88); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 18px; }
.card-head { display: flex; align-items: center; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.card-head h2 { margin: 0; font-size: 16.5px; }
.card-head p { margin: 2px 0 0; font-size: 13.5px; color: var(--muted); }
.card-head .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.card-body { padding: 8px 22px; }
.card-body.pad { padding: 20px 22px; }

.grid { display: grid; gap: 18px; }
.grid.two { grid-template-columns: 1fr 1fr; }
.grid.stats { grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }

/* ---------- stat ---------- */
.stat { background: rgba(19, 23, 34, .88); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; position: relative; overflow: hidden; }
.stat .label { font-size: 12.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.stat .value { font-size: 30px; font-weight: 800; letter-spacing: -.02em; margin-top: 4px; }
.stat .sub { font-size: 12.5px; color: var(--muted); }
.stat::after { content: ''; position: absolute; inset: auto -30px -40px auto; width: 110px; height: 110px; border-radius: 50%; background: var(--accent-soft); filter: blur(10px); }
.stat.c2::after { background: rgba(34, 211, 238, .12); }
.stat.c3::after { background: var(--ok-soft); }
.stat.c4::after { background: var(--warn-soft); }

/* ---------- module status ---------- */
.modules { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.module-tile { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); }
.module-tile:hover { border-color: var(--border-2); text-decoration: none; }
.module-tile svg { width: 20px; height: 20px; color: #c4b5fd; }
.module-tile b { flex: 1; font-size: 14px; }

/* ---------- chart ---------- */
.bars { display: flex; align-items: flex-end; gap: 6px; height: 140px; padding-top: 10px; }
.bars .col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; height: 100%; position: relative; }
.bars .seg { border-radius: 4px 4px 0 0; min-height: 2px; }
.bars .seg.a { background: var(--accent); }
.bars .seg.b { background: var(--accent-2); opacity: .8; border-radius: 0; }
.bars .col:hover .tip { display: block; }
.bars .tip { display: none; position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); background: var(--surface-3); border: 1px solid var(--border-2); padding: 6px 8px; border-radius: 8px; font-size: 12px; white-space: nowrap; z-index: 5; }
.bars-x { display: flex; gap: 6px; margin-top: 6px; }
.bars-x span { flex: 1; text-align: center; font-size: 10.5px; color: var(--muted); }
.legend { display: flex; gap: 14px; font-size: 12.5px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* ---------- form rows ---------- */
.row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 18px; align-items: center; padding: 16px 0; border-bottom: 1px solid var(--border); }
.row:last-child { border-bottom: 0; }
.row.stack { grid-template-columns: 1fr; gap: 10px; }
.row .lbl b { display: block; font-size: 14.5px; font-weight: 700; }
.row .lbl span { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; }
.row .ctl { min-width: 0; }
.row .ctl.end { display: flex; justify-content: flex-end; }

.input, .select, .textarea { width: 100%; background: var(--bg-2); border: 1px solid var(--border-2); border-radius: 10px; padding: 0 12px; height: 40px; outline: none; transition: border-color .15s, box-shadow .15s; }
.textarea { height: auto; min-height: 110px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23858ca0' stroke-width='2'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 34px; }
.select option, .select optgroup { background: var(--surface); }
.counter { font-size: 12px; color: var(--muted); text-align: right; margin-top: 4px; }
.input-group { display: flex; gap: 8px; }
.input-group .input { flex: 1; }
.color-input { display: flex; align-items: center; gap: 10px; }
.color-input input[type=color] { width: 42px; height: 40px; border: 1px solid var(--border-2); border-radius: 10px; background: var(--bg-2); padding: 4px; cursor: pointer; }
.color-input .input { width: 120px; font-family: var(--mono); }

/* toggle */
.toggle { position: relative; width: 46px; height: 26px; flex: 0 0 46px; }
.toggle input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.toggle span { position: absolute; inset: 0; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--border-2); transition: background .15s; }
.toggle span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #c7cbd6; transition: transform .15s, background .15s; }
.toggle input:checked + span { background: var(--accent); border-color: transparent; }
.toggle input:checked + span::after { transform: translateX(20px); background: #fff; }
.toggle input:focus-visible + span { box-shadow: 0 0 0 3px var(--accent-soft); }

/* module switch banner */
.module-switch { display: flex; align-items: center; gap: 16px; padding: 16px 22px; border: 1px solid var(--border); border-radius: var(--radius); background: linear-gradient(90deg, rgba(139, 92, 246, .10), rgba(34, 211, 238, .04)); margin-bottom: 18px; }
.module-switch b { font-size: 15.5px; }
.module-switch span { display: block; font-size: 13px; color: var(--muted); }
.module-switch .toggle { margin-left: auto; }

/* chips / roles */
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 6px 0 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border-2); font-size: 13px; font-weight: 600; }
.chip i { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 10px; }
.chip button { border: 0; background: none; color: var(--muted); cursor: pointer; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 15px; line-height: 1; }
.chip button:hover { background: var(--surface-3); color: var(--text); }
.chip-add { height: 30px; border-radius: 999px; min-width: 170px; max-width: 100%; font-size: 13px; padding: 0 30px 0 12px; }
.var-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.var-chips button { border: 1px dashed var(--border-2); background: none; padding: 2px 8px; border-radius: 6px; font-family: var(--mono); font-size: 12px; color: var(--text-2); cursor: pointer; }
.var-chips button:hover { border-color: var(--accent); color: #fff; }

/* badges */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: #86efac; }
.badge.warn { background: var(--warn-soft); color: #fcd34d; }
.badge.bad { background: var(--bad-soft); color: #fca5a5; }
.badge.info { background: var(--info-soft); color: #93c5fd; }
.badge.accent { background: var(--accent-soft); color: #c4b5fd; }

/* table */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; padding: 12px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr.click { cursor: pointer; }
.table tr.click:hover td { background: rgba(255, 255, 255, .02); }
.table .num { font-family: var(--mono); color: var(--text-2); }
.table .reason { max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 14px 22px; border-bottom: 1px solid var(--border); }
.toolbar .input { max-width: 300px; }
.tabs { display: inline-flex; gap: 4px; padding: 4px; background: var(--bg-2); border: 1px solid var(--border); border-radius: 12px; flex-wrap: wrap; }
.tabs button { border: 0; background: none; padding: 6px 12px; border-radius: 8px; font-weight: 700; font-size: 13px; color: var(--muted); cursor: pointer; }
.tabs button.active { background: var(--surface-3); color: var(--text); }
.tabs button .n { margin-left: 6px; font-size: 11px; color: var(--muted); }
.pager { display: flex; justify-content: space-between; align-items: center; padding: 12px 22px; border-top: 1px solid var(--border); }

.empty { text-align: center; padding: 46px 20px; color: var(--muted); }
.empty > svg { width: 42px; height: 42px; margin: 0 auto 10px; opacity: .6; display: block; }
.empty b { display: block; color: var(--text); font-size: 16px; margin-bottom: 4px; }

/* category list */
.cat-list { display: grid; gap: 10px; padding: 16px 22px; }
.cat { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); }
.cat .emoji { width: 40px; height: 40px; border-radius: 10px; background: var(--surface-2); display: grid; place-items: center; font-size: 20px; flex: 0 0 40px; }
.cat .info { flex: 1; min-width: 0; }
.cat .info b { display: block; }
.cat .info span { display: block; font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat .meta { display: flex; gap: 6px; flex-wrap: wrap; }
.cat .ops { display: flex; gap: 4px; }
.cat.off { opacity: .55; }

/* questions editor */
.q-list { display: grid; gap: 10px; }
.q-item { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; align-items: center; padding: 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-2); }
.q-item .flags { display: flex; gap: 10px; align-items: center; font-size: 12.5px; color: var(--text-2); }
.q-item label { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; white-space: nowrap; }
.q-item input[type=checkbox] { accent-color: var(--accent); }

/* warn actions */
.wa-item { display: grid; grid-template-columns: 110px 1fr 160px auto; gap: 8px; align-items: center; margin-bottom: 8px; }

/* discord preview */
.preview { background: #313338; border-radius: 10px; padding: 14px 16px; color: #dbdee1; font-family: 'gg sans', 'Noto Sans', system-ui, sans-serif; font-size: 15px; }
.preview .pv-msg { display: flex; gap: 14px; }
.preview .pv-avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--grad); flex: 0 0 40px; }
.preview .pv-head { display: flex; gap: 6px; align-items: center; }
.preview .pv-name { color: #fff; font-weight: 600; }
.preview .pv-tag { background: #5865f2; color: #fff; font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 4px; }
.preview .pv-time { color: #949ba4; font-size: 12px; }
.preview .pv-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.preview .pv-mention { background: rgba(88, 101, 242, .3); color: #c9cdfb; border-radius: 3px; padding: 0 2px; }
.preview .pv-embed { margin-top: 6px; background: #2b2d31; border-left: 4px solid; border-radius: 4px; padding: 10px 14px 14px; max-width: 520px; display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.preview .pv-embed .pv-title { color: #fff; font-weight: 700; grid-column: 1; }
.preview .pv-embed .pv-desc { grid-column: 1; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; }
.preview .pv-embed .pv-thumb { grid-column: 2; grid-row: 1 / span 2; width: 64px; height: 64px; border-radius: 6px; background: var(--grad); }
.preview .pv-embed .pv-img { grid-column: 1 / -1; max-width: 100%; border-radius: 6px; margin-top: 6px; }
.preview .pv-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.preview .pv-btn { height: 32px; padding: 0 14px; border-radius: 4px; display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 500; color: #fff; }
.preview .pv-btn.primary { background: #5865f2; }
.preview .pv-btn.secondary { background: #4e5058; }
.preview .pv-btn.success { background: #248046; }
.preview .pv-btn.danger { background: #da373c; }
.preview .pv-select { margin-top: 8px; height: 40px; border-radius: 4px; background: #1e1f22; border: 1px solid #1e1f22; display: flex; align-items: center; padding: 0 12px; color: #949ba4; max-width: 520px; }

/* save bar */
.savebar { opacity: 0; pointer-events: none; position: fixed; left: calc(var(--sidebar) + 24px); right: 24px; bottom: 20px; max-width: 1032px; margin: 0 auto; display: flex; align-items: center; gap: 12px; padding: 12px 14px 12px 20px; background: #1b2030; border: 1px solid var(--border-2); border-radius: 14px; box-shadow: var(--shadow); transform: translateY(150%); transition: transform .2s ease, opacity .2s ease; z-index: 50; }
.savebar.show { transform: none; opacity: 1; pointer-events: auto; }
.savebar span { flex: 1; font-weight: 600; }

/* modal */
dialog.modal { width: min(720px, calc(100vw - 24px)); max-height: calc(100vh - 40px); padding: 0; border: 1px solid var(--border-2); border-radius: 18px; background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
dialog.modal::backdrop { background: rgba(5, 6, 10, .7); backdrop-filter: blur(3px); }
.modal-head { display: flex; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); z-index: 2; }
.modal-head h3 { margin: 0; font-size: 18px; }
.modal-head .btn { margin-left: auto; }
.modal-body { padding: 6px 22px 10px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--border); position: sticky; bottom: 0; background: var(--surface); }

/* toasts */
#toasts { position: fixed; right: 20px; top: 20px; display: grid; gap: 8px; z-index: 100; }
.toast { min-width: 260px; max-width: 380px; padding: 12px 16px; border-radius: 12px; background: #1b2030; border: 1px solid var(--border-2); box-shadow: var(--shadow); font-weight: 600; animation: toast-in .2s ease; display: flex; gap: 10px; align-items: flex-start; }
.toast.ok { border-color: rgba(34, 197, 94, .4); }
.toast.bad { border-color: rgba(239, 68, 68, .45); }
.toast i { font-style: normal; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-6px); } }

/* home */
.home { max-width: 980px; margin: 0 auto; padding: 48px 24px; }
.home-head { display: flex; align-items: center; gap: 14px; margin-bottom: 28px; }
.home-head h1 { margin: 0; font-size: 30px; letter-spacing: -.02em; }
.guild-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.guild-card { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 24px 16px; border-radius: 16px; border: 1px solid var(--border); background: rgba(19, 23, 34, .88); color: var(--text); text-align: center; transition: border-color .15s, transform .15s; }
.guild-card:hover { border-color: var(--accent); transform: translateY(-2px); text-decoration: none; }
.guild-card .gicon { width: 72px; height: 72px; border-radius: 20px; font-size: 22px; }
.guild-card b { font-size: 16px; }
.guild-card.invite { border-style: dashed; color: var(--text-2); }

/* ticket detail */
.kv { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--border); border-radius: 12px; overflow: hidden; }
.kv > div { background: var(--surface); padding: 14px 16px; }
.kv span { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
.kv b { display: block; margin-top: 2px; overflow-wrap: anywhere; }
.person { display: inline-flex; align-items: center; gap: 8px; }
.person img { width: 22px; height: 22px; border-radius: 50%; }
.answers { display: grid; gap: 12px; }
.answers div b { display: block; font-size: 13px; color: var(--muted); }
.answers div p { margin: 2px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.stars { color: #fbbf24; letter-spacing: 2px; }

/* audit */
.audit-item { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.audit-item:last-child { border-bottom: 0; }
.audit-item .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); margin-top: 7px; flex: 0 0 10px; box-shadow: 0 0 0 4px var(--accent-soft); }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .grid.stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: min(300px, 86vw); transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow); }
  .shell.nav-open .sidebar { transform: none; }
  .shell.nav-open::after { content: ''; position: fixed; inset: 0; background: rgba(0, 0, 0, .5); z-index: 20; }
  .topbar { display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 15; padding: 10px 14px; background: rgba(10, 12, 17, .9); border-bottom: 1px solid var(--border); backdrop-filter: blur(10px); }
  .topbar b { font-weight: 800; }
  .content { padding: 20px 16px 120px; }
  .grid.two { grid-template-columns: 1fr; }
  .row { grid-template-columns: 1fr; gap: 10px; }
  .row .ctl.end { justify-content: flex-start; }
  .page-head { flex-wrap: wrap; }
  .page-head .actions { margin-left: 0; width: 100%; }
  .savebar { left: 12px; right: 12px; bottom: 12px; }
  .kv { grid-template-columns: 1fr 1fr; }
  .q-item { grid-template-columns: 1fr; }
  .wa-item { grid-template-columns: 1fr 1fr; }
  .card-head, .card-body, .toolbar, .pager, .cat-list { padding-left: 16px; padding-right: 16px; }
}
@media (max-width: 520px) {
  .grid.stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat .value { font-size: 24px; }
  .kv { grid-template-columns: 1fr; }
  .cat { flex-wrap: wrap; }
}

/* ---------- drobne ---------- */
.card.flush > .card-body { padding: 0; }
.num-input { max-width: 140px; }
.row .ctl .chips { justify-content: flex-start; }

/* ---------- stopka autora ---------- */
.author-footer { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; margin-top: 40px; padding: 18px 0 4px; border-top: 1px solid var(--border); color: var(--text-2); font-size: 13px; }
.author-footer img { width: 20px; height: 20px; }
.author-footer b { color: var(--text); }
.login-card .author-footer, .home .author-footer { border-top: 0; margin-top: 26px; }
.rule-card .card-body > div.rule-off { opacity: .45; }
.rule-card { margin-bottom: 0; }
.grid.two + .card, .grid.two + .grid.two { margin-top: 18px; }
.grid.two > .card { margin-bottom: 0; }
.grid.two { margin-bottom: 18px; }

/* ---------- aktywność ---------- */
.xpbar { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.xpbar i { display: block; height: 100%; background: var(--grad); border-radius: 999px; }
.pair-row { display: grid; grid-template-columns: 1fr 1fr 40px; gap: 8px; align-items: center; margin-bottom: 8px; }
.pair-row.head { font-size: 12px; font-weight: 700; margin-bottom: 6px; }
.ops { display: flex; gap: 4px; }
.lb-icon { width: 64px; height: 64px; flex: 0 0 64px; border-radius: 18px; font-size: 20px; }
.lb-list { display: grid; }
.lb-row { display: grid; grid-template-columns: 56px 44px 1fr 70px 120px; gap: 14px; align-items: center; padding: 12px 20px; border-bottom: 1px solid var(--border); }
.lb-row:last-child { border-bottom: 0; }
.lb-row img { width: 44px; height: 44px; border-radius: 50%; }
.lb-rank { font-weight: 800; font-size: 18px; text-align: center; color: var(--text-2); }
.lb-row.top1 { background: linear-gradient(90deg, rgba(251, 191, 36, .10), transparent 60%); }
.lb-row.top2 { background: linear-gradient(90deg, rgba(203, 213, 225, .08), transparent 60%); }
.lb-row.top3 { background: linear-gradient(90deg, rgba(217, 119, 6, .08), transparent 60%); }
.lb-name b { display: block; margin-bottom: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-level { text-align: center; }
.lb-level span { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.lb-level b { font-size: 20px; }
.lb-xp { text-align: right; font-family: var(--mono); font-size: 13px; }
@media (max-width: 640px) {
  .lb-row { grid-template-columns: 40px 36px 1fr 54px; padding: 10px 12px; gap: 10px; }
  .lb-row img { width: 36px; height: 36px; }
  .lb-xp { display: none; }
}

/* ---------- struktura serwera ---------- */
.dropzone { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 26px; border: 2px dashed var(--border-2); border-radius: 14px; cursor: pointer; color: var(--text-2); text-align: center; }
.dropzone:hover { border-color: var(--accent); color: var(--text); }
.dropzone svg { width: 30px; height: 30px; }
.file-input { display: none; }
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.thumbs img { height: 90px; border-radius: 8px; border: 1px solid var(--border); }
.st-main { align-items: start; }
.st-group { border: 1px solid var(--border); border-radius: 12px; padding: 10px; margin: 12px 0; background: var(--bg-2); }
.st-group-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 12.5px; font-weight: 700; }
.st-cat-ic { font-size: 18px; }
.st-cat-input { font-weight: 800; text-transform: uppercase; letter-spacing: .03em; }
.st-row { display: grid; grid-template-columns: 150px 1fr auto; gap: 8px; align-items: center; margin-bottom: 6px; }
.tree { font-size: 14.5px; }
.tree-cat { margin-top: 12px; }
.tree-cat-name { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 4px; }
.tree-ch { display: flex; gap: 8px; align-items: center; padding: 4px 8px; border-radius: 6px; color: var(--text-2); }
.tree-ch:hover { background: var(--surface-2); }
.tree-ic { width: 20px; text-align: center; color: var(--muted); }
@media (max-width: 640px) { .st-row { grid-template-columns: 1fr; } }
/* gotowe presety serwera */
.preset-grid { align-items: start; gap: 20px; }
.preset-h { margin: 0 0 8px; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.preset-h:not(:first-child) { margin-top: 18px; }
.preset-roles { display: flex; flex-direction: column; gap: 4px; }
.preset-role { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 8px; background: var(--bg-2); font-weight: 600; font-size: 14px; }
.preset-role .badge { margin-left: auto; }
.role-dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.preset-cat { margin-top: 6px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-2); padding: 0 6px; }
.preset-cat[open] { padding-bottom: 6px; }
.preset-cat-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 4px; cursor: pointer; list-style: none; }
.preset-cat-head::-webkit-details-marker { display: none; }
.preset-cat-head .tree-cat-name { margin: 0; color: var(--text); }
.preset-cat-meta { display: flex; align-items: center; gap: 8px; font-size: 12.5px; flex: none; }
.preset-cat .tree-ch .badge { margin-left: auto; }
.callout { display: flex; gap: 10px; align-items: flex-start; margin: 16px 0 4px; padding: 12px 14px; border-radius: 10px; background: var(--warn-soft); color: #fcd34d; font-size: 14px; font-weight: 600; }
.callout svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.toggle.disabled { opacity: .45; pointer-events: none; }
@media (max-width: 640px) { .preset-cat-meta .muted { display: none; } }
.lang-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.lang-btn { padding: 6px 14px; border-radius: 6px; background: #4e5058; color: #fff; font-weight: 600; font-size: 14px; }
.role-icon { width: 20px; text-align: center; }
.preset-role .badge { margin-left: auto; }
.preset-ch-meta { margin-left: auto; display: flex; gap: 8px; align-items: center; font-size: 12.5px; }
.preset-cat .tree-ch .badge { margin-left: 0; }
.preset-note { font-size: 12.5px; margin: 8px 0 0; }
.preset-flow { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: 14px; color: var(--text-2); }
.preset-grid > div > div + div { margin-top: 18px; }
/* dopasowanie szablonu do obecnego serwera */
.mode-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 20px 0 6px; }
.mode-btn { text-align: left; display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--border); background: var(--bg-2); color: var(--text); cursor: pointer; font: inherit; }
.mode-btn span { color: var(--muted); font-size: 13px; }
.mode-btn.active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.map-editor { margin-top: 12px; display: grid; gap: 14px; }
.callout.ok { background: color-mix(in srgb, #22c55e 14%, transparent); color: #86efac; }
.map-summary { display: flex; flex-wrap: wrap; gap: 8px; }
.map-group { border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; background: var(--bg-2); }
.map-group > summary { cursor: pointer; margin: 0; }
.map-cat { padding: 6px 0 8px; border-top: 1px solid var(--border); }
.map-cat:first-of-type { border-top: 0; }
.map-row { display: grid; grid-template-columns: minmax(0, 1fr) 20px minmax(0, 1.2fr) 86px; gap: 8px; align-items: center; padding: 4px 0; font-size: 14px; }
.map-row .map-tpl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-row .map-ch { padding-left: 14px; color: var(--text-2); }
.map-arrow { color: var(--muted); text-align: center; }
.map-select { width: 100%; min-width: 0; }
.map-status { text-align: right; }
.map-row.dupe .map-select { border-color: var(--bad, #ef4444); box-shadow: 0 0 0 1px var(--bad, #ef4444) inset; }
@media (max-width: 640px) {
  .mode-switch { grid-template-columns: 1fr; }
  .map-row { grid-template-columns: minmax(0, 1fr) 70px; }
  .map-row .map-arrow { display: none; }
  .map-row .map-select { grid-column: 1 / -1; grid-row: 2; }
}
/* baza języków */
.lang-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; padding: 14px 0 6px; }
.lang-tile { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg-2); }
.lang-tile.on { border-color: color-mix(in srgb, #22c55e 55%, transparent); }
.lang-flag { font-size: 22px; line-height: 1; }
.lang-names { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.lang-names b, .lang-names span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lang-names span { font-size: 12.5px; }
.preset-grid > * { min-width: 0; }
.preset-role { min-width: 0; }
.preset-role > span:not(.role-dot):not(.role-icon) { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preset-role .badge { flex: none; max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 640px) { .preset-grid { grid-template-columns: minmax(0, 1fr); } }
.lang-actions { display: flex; gap: 6px; flex: none; }

/* ---------- własne komendy ---------- */
dialog.modal.wide { width: min(1100px, calc(100vw - 24px)); }
.cc-editor { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 22px; }
.cc-preview-sticky { position: sticky; top: 76px; padding-top: 16px; display: grid; gap: 10px; }
.cc-trigger { display: flex; justify-content: flex-end; }
.cc-trigger span { background: #5865f2; color: #fff; border-radius: 14px 14px 4px 14px; padding: 6px 12px; }
.cc-prefix { display: grid; place-items: center; min-width: 40px; padding: 0 10px; border-radius: 10px; background: var(--surface-3); border: 1px solid var(--border-2); color: var(--text-2); }
.cc-sub { margin: 18px 0 0; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.cc-btn-row { display: grid; grid-template-columns: 64px 1fr 1.6fr auto; gap: 8px; margin-bottom: 8px; }
.cc-window .num-input { max-width: 90px; }
.cc-window span { align-self: center; }
.actions-cell { white-space: nowrap; text-align: right; }
@media (max-width: 900px) { .cc-editor { grid-template-columns: 1fr; } .cc-btn-row { grid-template-columns: 56px 1fr; } }

/* ---------- statystyki ekipy ---------- */
.grid.stats.six { grid-template-columns: repeat(6, 1fr); }
.grid.stats.six .stat .value { font-size: 24px; }
.st-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.st-toolbar .select { width: auto; min-width: 220px; }
.st-toolbar .input { max-width: 240px; }
.person { display: flex; align-items: center; gap: 10px; min-width: 180px; }
.person .av { width: 34px; height: 34px; border-radius: 50%; flex: 0 0 34px; background: var(--surface-3); display: grid; place-items: center; font-size: 12px; font-weight: 800; color: var(--text-2); overflow: hidden; }
.person .av img { width: 100%; height: 100%; object-fit: cover; }
.person b { display: block; font-size: 14px; line-height: 1.25; }
.person .role-tag { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 5px; }
.person .role-tag i { width: 8px; height: 8px; border-radius: 50%; }
.scorecell { min-width: 110px; }
.scorecell b { font-family: var(--mono); font-size: 13px; }
.meter { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; margin-top: 4px; }
.meter i { display: block; height: 100%; border-radius: 999px; background: var(--grad); }
.meter.ok i { background: var(--ok); }
.meter.warn i { background: var(--warn); }
.table th.sort { cursor: pointer; user-select: none; }
.table th.sort:hover { color: var(--text); }
.table th.sort.on { color: var(--text); }
.table td.n { font-family: var(--mono); font-size: 13px; white-space: nowrap; }
.table td.n small { display: block; color: var(--muted); font-family: var(--font); font-size: 11.5px; }
.st-badges { display: flex; flex-wrap: wrap; gap: 4px; }
.bars .seg.stk { border-radius: 0; opacity: 1; }
.bars .col .seg.stk.top { border-radius: 4px 4px 0 0; }
.grid.two > * { min-width: 0; }
.card-head .legend { flex-wrap: wrap; justify-content: flex-end; row-gap: 4px; }
.st-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 18px; }
@media (max-width: 1100px) { .st-grid { grid-template-columns: 1fr; } }
.heat { display: grid; grid-template-columns: 34px repeat(24, minmax(0, 1fr)); gap: 3px; font-size: 10.5px; color: var(--muted); }
.heat .c { aspect-ratio: 1; border-radius: 3px; background: var(--surface-3); min-height: 10px; }
.heat .h { text-align: center; }
.heat .d { align-self: center; }
.heat-legend { display: flex; align-items: center; gap: 6px; margin-top: 10px; font-size: 12px; color: var(--muted); }
.heat-legend i { width: 14px; height: 14px; border-radius: 3px; display: inline-block; }
.crit { display: grid; gap: 8px; }
.crit .ci { display: grid; grid-template-columns: 26px 1fr auto; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); }
.crit .ci .mk { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 800; }
.crit .ci.pass .mk { background: var(--ok-soft); color: #86efac; }
.crit .ci.fail .mk { background: var(--bad-soft); color: #fca5a5; }
.crit .ci.unknown .mk { background: var(--surface-3); color: var(--muted); }
.crit .ci span.v { font-family: var(--mono); font-size: 13px; color: var(--text-2); }
.promo-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.promo-head .big { font-size: 34px; font-weight: 800; letter-spacing: -.02em; }
.promo-head .meter { flex: 1; height: 10px; }
.promo-list { display: grid; gap: 8px; }
.promo-item { display: grid; grid-template-columns: minmax(180px, 1.2fr) 140px minmax(0, 2fr) auto; gap: 14px; align-items: center; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); cursor: pointer; }
.promo-item:hover { border-color: var(--border-2); }
.promo-item .chips-sm { display: flex; flex-wrap: wrap; gap: 4px; }
.promo-item .chips-sm span { font-size: 11.5px; padding: 2px 8px; border-radius: 999px; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.promo-item .chips-sm span.pass { background: var(--ok-soft); color: #86efac; }
.promo-item .chips-sm span.fail { background: var(--bad-soft); color: #fca5a5; }
.profile-head { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.profile-head .av { width: 76px; height: 76px; border-radius: 50%; overflow: hidden; background: var(--surface-3); flex: 0 0 76px; display: grid; place-items: center; font-size: 24px; font-weight: 800; }
.profile-head .av img { width: 100%; height: 100%; object-fit: cover; }
.profile-head h2 { margin: 0; font-size: 22px; }
.profile-head .facts { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 8px; font-size: 13px; color: var(--muted); }
.profile-head .facts b { color: var(--text-2); font-weight: 700; }
.profile-head .chips { margin-top: 8px; }
.profile-head .chip { padding-right: 10px; }
.timeline { display: grid; gap: 0; }
.timeline .ev { display: grid; grid-template-columns: 22px 1fr auto; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); align-items: center; font-size: 13.5px; }
.timeline .ev:last-child { border-bottom: 0; }
.timeline .ev .mk { font-weight: 800; text-align: center; }
.timeline .ev .mk.add { color: var(--ok); }
.timeline .ev .mk.rem { color: var(--bad); }
.act-cat td:first-child { font-weight: 700; color: var(--text); }
.act-cat td { background: rgba(255, 255, 255, .02); }
.trend.up { color: #86efac; }
.trend.down { color: #fca5a5; }
.info-banner { display: flex; gap: 14px; align-items: center; padding: 14px 18px; border-radius: var(--radius); border: 1px solid rgba(59, 130, 246, .35); background: var(--info-soft); margin-bottom: 18px; }
.info-banner svg { width: 22px; height: 22px; color: #93c5fd; flex: 0 0 22px; }
.info-banner div { flex: 1; font-size: 14px; }
.weights { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px 18px; }
.weights .w { display: grid; grid-template-columns: 1fr 90px; gap: 10px; align-items: center; font-size: 13.5px; }
.weights .w .input { height: 34px; }
.weights h4 { grid-column: 1 / -1; margin: 12px 0 2px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
@media (max-width: 1100px) { .grid.stats.six { grid-template-columns: repeat(3, 1fr); } .promo-item { grid-template-columns: 1fr 120px; } .promo-item .chips-sm { grid-column: 1 / -1; } }
@media (max-width: 640px) { .grid.stats.six { grid-template-columns: repeat(2, 1fr); } .heat { grid-template-columns: 26px repeat(24, minmax(0, 1fr)); gap: 2px; } }
.card-body > .legend { flex-wrap: wrap; row-gap: 4px; margin-bottom: 6px; }
.table td > .st-badges { margin: 6px 0 0 44px; }
.table td > .st-badges:empty { display: none; }
.st-badges.nowrap { flex-wrap: nowrap; } .nowrap { white-space: nowrap; }

/* ---------- karta komendy (szablon ROB RUN) ---------- */
.cc-looks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 12px 0 6px; }
.cc-look { display: grid; grid-template-columns: 34px 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center; text-align: left; padding: 12px; border-radius: 12px; border: 1px solid var(--border-2); background: var(--surface); color: var(--text); cursor: pointer; }
.cc-look:hover { border-color: var(--muted); }
.cc-look.active { border-color: #c6ff2e; box-shadow: 0 0 0 3px rgba(198, 255, 46, .14); }
.cc-look b { font-size: 13.5px; }
.cc-look small { grid-column: 2; font-size: 12px; color: var(--muted); line-height: 1.3; }
.cc-look-swatch { grid-row: 1 / span 2; width: 34px; height: 34px; border-radius: 9px; }
.cc-look.robrun .cc-look-swatch { background: linear-gradient(135deg, #c6ff2e 0 22%, #000 22% 78%, #c6ff2e 78%); }
.cc-look.clean .cc-look-swatch { background: var(--surface-3); border-left: 5px solid var(--accent); }
.cc-look.classic .cc-look-swatch { background: #2b2d31; border-left: 5px solid #5865f2; }
.cc-paste textarea { min-height: 220px; font-size: 14px; line-height: 1.5; }
.cc-swatches { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cc-swatches .sw { width: 30px; height: 30px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12); }
.cc-swatches .sw.on { border-color: #fff; }
.cc-swatches .sw.auto { background: var(--surface-3); color: var(--text-2); font-weight: 800; font-size: 12px; }
.cc-swatches .color-input { margin-left: 6px; }
.cc-icons { display: flex; flex-wrap: wrap; gap: 6px; }
.cc-icons button { width: 36px; height: 36px; border-radius: 9px; border: 1px solid var(--border-2); background: var(--surface); font-size: 18px; cursor: pointer; }
.cc-icons button:hover { background: var(--surface-3); }
.cc-emoji { max-width: 70px; text-align: center; }
.cc-preview .preview { padding: 14px 14px 16px; }

/* podgląd wiadomości Components V2 */
.v2-card { margin-top: 6px; max-width: 560px; background: #393a41; border: 1px solid #44454c; border-left: 4px solid #c6ff2e; border-radius: 8px; padding: 14px 16px; display: grid; gap: 8px; }
.v2-banner { width: 100%; border-radius: 6px; display: block; }
.v2-section { display: grid; grid-template-columns: minmax(0, 1fr) 85px; gap: 14px; align-items: start; }
.v2-thumb { width: 85px; height: 85px; border-radius: 8px; object-fit: cover; }
.v2-thumb.ph { background: var(--grad); }
.v2-md { font-size: 15px; line-height: 1.375; color: #dbdee1; overflow-wrap: anywhere; min-width: 0; }
.v2-md .v2-h1 { font-size: 24px; font-weight: 700; color: #f2f3f5; margin: 4px 0; }
.v2-md .v2-h2 { font-size: 20px; font-weight: 700; color: #f2f3f5; margin: 2px 0 4px; }
.v2-md .v2-h3 { font-size: 16px; font-weight: 700; color: #f2f3f5; margin: 4px 0; }
.v2-md .v2-gap { height: 8px; }
.v2-md ul { margin: 2px 0; padding-left: 22px; }
.v2-md .v2-quote { border-left: 4px solid #4e5058; padding-left: 10px; }
.v2-md code { background: #2b2d31; border-radius: 4px; padding: 0 4px; font-size: 13px; }
.v2-link { color: #00a8fc; }
.v2-sub, .v2-md .v2-sub { font-size: 12px; color: #949ba4; }
.v2-sep { height: 1px; background: #4e5058; margin: 4px 0; }
.v2-sep.thin { background: transparent; margin: 0; }
.v2-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.v2-btn { height: 32px; padding: 0 14px; border-radius: 8px; background: #4e5058; color: #fff; font-size: 14px; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; }
.v2-btn i { font-style: normal; opacity: .75; font-size: 12px; }
@media (max-width: 900px) { .cc-looks { grid-template-columns: 1fr; } }

/* ---------- Bot na żywo (strona główna) ---------- */
.live-card { margin-bottom: 18px; }
.live-status { display: flex; align-items: center; gap: 6px; font-size: 12.5px; white-space: nowrap; }
.live-h { margin: 14px 0 8px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.live-body > .live-h:first-child, .live-body > .live-alert + .live-h { margin-top: 4px; }
.live-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.live-tile { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border); background: rgba(255, 255, 255, .02); min-width: 0; }
.live-tile .lt-label { font-size: 12px; font-weight: 700; color: var(--muted); }
.live-tile .lt-value { font-size: 22px; font-weight: 800; letter-spacing: -.01em; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-tile .lt-sub { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-tile.ok { box-shadow: inset 3px 0 0 var(--ok); }
.live-tile.warn { box-shadow: inset 3px 0 0 var(--warn); background: var(--warn-soft); }
.live-tile.bad { box-shadow: inset 3px 0 0 var(--bad); background: var(--bad-soft); }
.live-alert { padding: 10px 14px; border-radius: 12px; margin-bottom: 8px; font-weight: 600; font-size: 13.5px; }
.live-alert.bad { background: var(--bad-soft); border: 1px solid rgba(239, 68, 68, .35); }
.live-alert.warn { background: var(--warn-soft); border: 1px solid rgba(245, 158, 11, .35); }
.live-chart-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.live-spark { display: block; width: 100%; height: 90px; border-radius: 10px; background: rgba(255, 255, 255, .02); border: 1px solid var(--border); }
@media (max-width: 560px) {
  .live-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .live-tile .lt-value { font-size: 19px; }
}
