/* TS Panel - GitHub koyu tema renkleri (Primer dark default). Gradyan, parlama, bulanıklık yok. */
:root {
  --canvas: #0d1117;
  --canvas-inset: #010409;
  --surface: #161b22;
  --surface-2: #1c2128;
  --btn: #21262d;
  --btn-hover: #30363d;
  --border: #30363d;
  --border-muted: #21262d;
  --fg: #e6edf3;
  --fg-muted: #7d8590;
  --fg-subtle: #6e7681;
  --accent: #2f81f7;
  --accent-fg: #58a6ff;
  --accent-emphasis: #1f6feb;
  --accent-subtle: rgba(56, 139, 253, .1);
  --accent-muted: rgba(56, 139, 253, .4);
  --success: #238636;
  --success-hover: #2ea043;
  --success-fg: #3fb950;
  --danger: #da3633;
  --danger-fg: #f85149;
  --danger-subtle: rgba(248, 81, 73, .1);
  --attention-fg: #d29922;
  --attention-subtle: rgba(187, 128, 9, .15);
  --neutral-subtle: rgba(110, 118, 129, .1);
  --hover: rgba(177, 186, 196, .08);
  --selected: rgba(177, 186, 196, .12);
  --radius: 6px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body { margin: 0; background: var(--canvas); color: var(--fg); font: 14px/1.5 var(--font); }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent-fg); text-decoration: none; }
a:hover { text-decoration: underline; }
::selection { background: var(--accent-muted); }

.ic { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ic.sm { width: 14px; height: 14px; }
.ic.xs { width: 12px; height: 12px; }
.ic.lg { width: 20px; height: 20px; }

/* ---------- layout ---------- */
.app { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.sidebar {
  background: var(--canvas-inset); border-right: 1px solid var(--border-muted); padding: 16px 12px;
  display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px 14px; }
.brand-logo {
  width: 32px; height: 32px; border-radius: var(--radius); border: 1px solid var(--border);
  display: grid; place-items: center; color: var(--fg); flex: none; background: var(--surface);
}
.brand-name { font-weight: 600; font-size: 14px; line-height: 1.25; }
.brand-sub { color: var(--fg-muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }
.nav-label { color: var(--fg-muted); font-size: 12px; font-weight: 600; padding: 14px 8px 4px; }
.nav-item {
  position: relative; display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: var(--radius);
  color: var(--fg); cursor: pointer; border: 0; background: none; width: 100%; text-align: left;
}
.nav-item .ic { color: var(--fg-muted); }
.nav-item:hover { background: var(--hover); }
.nav-item.active { background: var(--selected); font-weight: 600; }
.nav-item.active::before {
  content: ""; position: absolute; left: -12px; top: 6px; bottom: 6px; width: 4px; border-radius: 0 6px 6px 0; background: var(--accent-emphasis);
}
.nav-item.active .ic { color: var(--fg); }
.nav-item .soon { margin-left: auto; font-size: 11px; color: var(--fg-muted); border: 1px solid var(--border); padding: 0 6px; border-radius: 2em; font-weight: 500; }
.sidebar-foot { margin-top: auto; border-top: 1px solid var(--border-muted); padding-top: 12px; }
.me { display: flex; align-items: center; gap: 8px; padding: 4px 8px; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; background: var(--btn); border: 1px solid var(--border);
  display: grid; place-items: center; font-weight: 600; color: var(--fg-muted); flex: none; font-size: 13px;
}
.me-name { font-weight: 600; font-size: 13px; }
.me-role { font-size: 12px; color: var(--fg-muted); display: flex; align-items: center; gap: 4px; }
.me-actions { display: flex; gap: 2px; margin-left: auto; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 12px; padding: 16px 24px; border-bottom: 1px solid var(--border-muted);
  background: var(--canvas); position: sticky; top: 0; z-index: 5;
}
.topbar h1 { margin: 0; font-size: 20px; font-weight: 600; line-height: 1.3; }
.topbar .sub { color: var(--fg-muted); font-size: 13px; }
.topbar .spacer { flex: 1; }
.content { padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.menu-btn { display: none; }

/* ---------- primitives ---------- */
.card { background: var(--canvas); border: 1px solid var(--border); border-radius: var(--radius); }
.card-head {
  display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--border);
  background: var(--surface); border-radius: var(--radius) var(--radius) 0 0;
}
.card-head .ic { color: var(--fg-muted); }
.card-head h2 { margin: 0; font-size: 14px; font-weight: 600; }
.card-head .spacer { flex: 1; }
.card-body { padding: 16px; }
.muted { color: var(--fg-muted); }
.faint { color: var(--fg-subtle); }
.mono { font-family: var(--mono); font-size: 12px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 12px;
  border-radius: var(--radius); border: 1px solid rgba(240, 246, 252, .1); background: var(--btn);
  cursor: pointer; font-weight: 500; font-size: 14px; white-space: nowrap; color: var(--fg);
}
.btn .ic { color: var(--fg-muted); }
.btn:hover { background: var(--btn-hover); border-color: #8b949e; }
.btn:focus-visible, .nav-item:focus-visible, .input:focus-visible, .icon-btn:focus-visible, .cl:focus-visible, .seg button:focus-visible {
  outline: 2px solid var(--accent); outline-offset: -2px;
}
.btn.primary { background: var(--success); border-color: rgba(240, 246, 252, .1); color: #fff; }
.btn.primary .ic { color: #fff; }
.btn.primary:hover { background: var(--success-hover); }
.btn.danger { color: var(--danger-fg); }
.btn.danger .ic { color: var(--danger-fg); }
.btn.danger:hover { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.danger:hover .ic { color: #fff; }
.btn.ghost { background: none; border-color: transparent; color: var(--fg-muted); }
.btn.ghost:hover { background: var(--hover); color: var(--fg); border-color: transparent; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn[disabled]:hover { background: var(--btn); border-color: rgba(240, 246, 252, .1); color: inherit; }
.btn.block { width: 100%; }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12px; }
.icon-btn {
  width: 32px; height: 32px; display: grid; place-items: center; border-radius: var(--radius); border: 0;
  background: none; color: var(--fg-muted); cursor: pointer;
}
.icon-btn:hover { background: var(--hover); color: var(--fg); }
.icon-btn.on { color: var(--accent-fg); background: var(--accent-subtle); }

.input, select.input, textarea.input {
  width: 100%; height: 32px; padding: 0 12px; background: var(--canvas); border: 1px solid var(--border);
  border-radius: var(--radius); outline: none; font-size: 14px;
}
textarea.input { height: auto; min-height: 84px; padding: 8px 12px; resize: vertical; }
.input:focus { border-color: var(--accent-emphasis); box-shadow: inset 0 0 0 1px var(--accent-emphasis); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 14px; font-weight: 600; }
.search { position: relative; }
.search .ic { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--fg-muted); }
.search .input { padding-left: 32px; }

.pill {
  display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 7px; border-radius: 2em;
  border: 1px solid var(--border); color: var(--fg-muted); font-size: 12px; font-weight: 500; white-space: nowrap; background: none;
}
.pill.accent { border-color: var(--accent-muted); color: var(--accent-fg); }
.pill.ok { border-color: rgba(46, 160, 67, .4); color: var(--success-fg); }
.pill.danger { border-color: rgba(248, 81, 73, .4); color: var(--danger-fg); }
.pill.warn { border-color: rgba(187, 128, 9, .4); color: var(--attention-fg); }

/* ---------- stats ---------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.stat { padding: 16px; display: flex; gap: 12px; align-items: flex-start; }
.stat-icon { color: var(--fg-muted); padding-top: 2px; }
.stat-label { color: var(--fg-muted); font-size: 12px; }
.stat-value { font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.4; }
.stat-value small { font-size: 12px; color: var(--fg-muted); font-weight: 400; }
.bar { height: 8px; background: var(--btn); border-radius: 6px; overflow: hidden; margin-top: 6px; }
.bar > i { display: block; height: 100%; background: var(--success); }

/* ---------- server tree ---------- */
.split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.tree { padding: 8px; max-height: calc(100vh - 280px); overflow: auto; }
.ch { display: flex; align-items: center; gap: 8px; padding: 4px 8px; border-radius: var(--radius); color: var(--fg-muted); min-height: 28px; min-width: 0; }
.ch .ch-name { color: var(--fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.ch .ch-meta { margin-left: auto; display: flex; gap: 6px; align-items: center; color: var(--fg-subtle); font-size: 12px; }
.ch.spacer { padding-top: 2px; padding-bottom: 2px; }
.ch.spacer .ch-name { color: var(--fg-subtle); font-size: 12px; }
.ch.spacer.center { justify-content: center; }
.ch.spacer.center .ch-name { color: var(--fg-muted); font-weight: 600; }
.ch.spacer.right { justify-content: flex-end; }
.ch.spacer.fill .ch-name { width: 100%; overflow: hidden; white-space: nowrap; text-overflow: clip; color: var(--border); }
.ch-children { margin-left: 16px; border-left: 1px solid var(--border-muted); padding-left: 4px; }
.cl { display: flex; align-items: center; gap: 8px; padding: 3px 8px; border-radius: var(--radius); cursor: pointer; min-width: 0; }
.cl:hover { background: var(--hover); }
.cl.selected { background: var(--accent-subtle); box-shadow: inset 2px 0 0 var(--accent-emphasis); }
.cl-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.cl-tags { margin-left: auto; display: flex; gap: 4px; flex-wrap: nowrap; overflow: hidden; }
.cl-tags .pill { height: 18px; font-size: 11px; padding: 0 6px; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; border: 1px solid var(--fg-subtle); }
.dot.talking { background: var(--success-fg); border-color: var(--success-fg); }
.dot.live { background: var(--success-fg); border-color: var(--success-fg); width: 7px; height: 7px; }
.cl .state { color: var(--danger-fg); display: inline-flex; }
.cl .state.away { color: var(--attention-fg); }
.flag { font-size: 11px; color: var(--fg-subtle); font-weight: 600; }

/* ---------- detail panel ---------- */
.detail { position: sticky; top: 80px; }
.detail-empty { padding: 32px 20px; text-align: center; color: var(--fg-muted); }
.detail-empty .ic { width: 24px; height: 24px; color: var(--fg-subtle); margin-bottom: 8px; }
.profile { display: flex; gap: 12px; align-items: center; padding: 16px; border-bottom: 1px solid var(--border); background: var(--surface); border-radius: var(--radius) var(--radius) 0 0; }
.profile .avatar { width: 40px; height: 40px; font-size: 16px; }
.profile-name { font-weight: 600; font-size: 16px; word-break: break-word; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; padding: 12px 16px; margin: 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.kv dt { color: var(--fg-muted); }
.kv dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.notice {
  margin: 12px 16px 0; padding: 8px 12px; border-radius: var(--radius); background: var(--attention-subtle);
  border: 1px solid rgba(187, 128, 9, .4); color: var(--fg); font-size: 13px; display: flex; gap: 8px; align-items: flex-start;
}
.notice .ic { color: var(--attention-fg); margin-top: 2px; }
.section-title { padding: 12px 16px 4px; font-size: 12px; color: var(--fg-muted); font-weight: 600; }
.groups { padding: 4px 8px 12px; display: flex; flex-direction: column; max-height: 340px; overflow: auto; }
.group-row { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: var(--radius); }
.group-row:hover { background: var(--hover); }
.group-row.locked { color: var(--fg-muted); }
.group-row .gname { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.switch { position: relative; display: inline-block; vertical-align: middle; width: 32px; height: 18px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; background: var(--btn); border: 1px solid var(--border); border-radius: 2em; cursor: pointer; }
.switch span::after { content: ""; position: absolute; width: 12px; height: 12px; left: 2px; top: 2px; background: var(--fg-muted); border-radius: 50%; transition: transform .12s; }
.switch input:checked + span { background: var(--accent-emphasis); border-color: var(--accent-emphasis); }
.switch input:checked + span::after { transform: translateX(14px); background: #fff; }
.switch input:disabled + span { cursor: not-allowed; opacity: .5; }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }

/* ---------- tables ---------- */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; color: var(--fg-muted); font-weight: 600; padding: 8px 16px; border-bottom: 1px solid var(--border); background: var(--surface); }
.table td { padding: 8px 16px; border-bottom: 1px solid var(--border-muted); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr.clickable { cursor: pointer; }
.table tbody tr.clickable:hover td { background: var(--hover); }
.table tbody tr.selected td { background: var(--accent-subtle); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
td.num { white-space: nowrap; }
td.num .btn + .btn, td.num .btn + .icon-btn, td.num a.btn + .btn { margin-left: 6px; }
td.num .icon-btn { display: inline-grid; vertical-align: middle; }
.pager { display: flex; align-items: center; gap: 8px; padding: 8px 16px; border-top: 1px solid var(--border); color: var(--fg-muted); font-size: 13px; }
.pager .spacer { flex: 1; }
.empty { padding: 24px; text-align: center; color: var(--fg-muted); }

/* ---------- login (GitHub giriş ekranı düzeni) ---------- */
.login-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; padding: 40px 16px; background: var(--canvas); }
.login-logo { width: 48px; height: 48px; display: grid; place-items: center; color: var(--fg); margin: 24px 0 16px; }
.login-logo .ic { width: 48px; height: 48px; stroke-width: 1.5; }
.login-title { font-size: 24px; font-weight: 300; margin: 0 0 16px; letter-spacing: -.5px; }
.login { width: 100%; max-width: 340px; padding: 16px; display: flex; flex-direction: column; gap: 14px; background: var(--surface); border: 1px solid var(--border-muted); border-radius: var(--radius); }
.login-note { width: 100%; max-width: 340px; margin-top: 16px; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius); text-align: center; color: var(--fg-muted); font-size: 13px; }
.form-error { color: var(--danger-fg); font-size: 13px; min-height: 0; }
.form-error:empty { display: none; }
.flash-error { padding: 12px 16px; border: 1px solid rgba(248, 81, 73, .4); background: var(--danger-subtle); border-radius: var(--radius); color: var(--fg); font-size: 13px; }

/* ---------- modal / toast ---------- */
.overlay { position: fixed; inset: 0; background: rgba(1, 4, 9, .8); display: grid; place-items: center; z-index: 50; padding: 20px; }
.modal { width: 100%; max-width: 440px; background: var(--surface); box-shadow: 0 8px 24px rgba(1, 4, 9, .75); }
.modal .card-head { background: var(--surface); }
.modal .card-body { display: flex; flex-direction: column; gap: 14px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--border); }
#toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 60; }
.toast {
  min-width: 260px; max-width: 380px; padding: 10px 14px; border-radius: var(--radius); background: var(--surface);
  border: 1px solid var(--border); box-shadow: 0 8px 24px rgba(1, 4, 9, .75); display: flex; gap: 10px; align-items: flex-start; font-size: 13px;
}
.toast.ok .ic { color: var(--success-fg); margin-top: 2px; }
.toast.err .ic { color: var(--danger-fg); margin-top: 2px; }

.soon-page { padding: 48px 20px; text-align: center; color: var(--fg-muted); }
.soon-page .ic { width: 24px; height: 24px; color: var(--fg-muted); margin-bottom: 8px; }
.soon-page h2 { color: var(--fg); margin: 0 0 6px; font-size: 16px; font-weight: 600; }

.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.form-row { display: grid; grid-template-columns: 1fr 1fr 140px auto; gap: 12px; align-items: end; }

/* ---------- tabs / segmented ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border-muted); }
.tab {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border: 0; background: none; cursor: pointer;
  color: var(--fg); border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab .ic { color: var(--fg-muted); }
.tab:hover { border-bottom-color: var(--border); }
.tab.active { border-bottom-color: #f78166; font-weight: 600; }
.tab .count { min-width: 20px; padding: 0 6px; border-radius: 2em; background: var(--neutral-subtle); font-size: 12px; color: var(--fg); }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.seg button { border: 0; background: var(--canvas); padding: 4px 12px; cursor: pointer; color: var(--fg-muted); font-size: 13px; }
.seg button + button { border-left: 1px solid var(--border); }
.seg button.active { background: var(--btn); color: var(--fg); font-weight: 600; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- SinusBot ---------- */
.player { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 16px; padding: 16px; align-items: center; }
.cover {
  width: 96px; height: 96px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface);
  display: grid; place-items: center; color: var(--fg-subtle);
}
.cover .ic { width: 36px; height: 36px; stroke-width: 1.5; }
.now-label { font-size: 12px; color: var(--fg-muted); display: flex; align-items: center; gap: 6px; }
.now-title { font-size: 20px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.now-artist { color: var(--fg-muted); overflow-wrap: anywhere; }
.progress { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-size: 12px; color: var(--fg-muted); font-variant-numeric: tabular-nums; }
.progress .bar { flex: 1; margin: 0; height: 6px; cursor: pointer; }
.progress .bar > i { background: var(--accent-emphasis); }
.controls { display: flex; align-items: center; gap: 4px; padding: 10px 16px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.controls .spacer { flex: 1; }
.volume { display: flex; align-items: center; gap: 8px; color: var(--fg-muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.volume input[type=range] { width: 140px; accent-color: var(--accent-emphasis); }
.bot-where { display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-top: 1px solid var(--border); font-size: 13px; color: var(--fg-muted); flex-wrap: wrap; }
.bot-where strong { color: var(--fg); font-weight: 600; }
.bot-where .move-ctl { display: flex; gap: 8px; margin-left: auto; flex: 1 1 240px; max-width: 340px; }
.bot-where .move-ctl select { flex: 1; min-width: 0; }
.list { display: flex; flex-direction: column; }
.list-row { display: flex; align-items: center; gap: 10px; padding: 8px 16px; border-bottom: 1px solid var(--border-muted); min-width: 0; }
.list-row:last-child { border-bottom: 0; }
.list-row:hover { background: var(--hover); }
.list-row .idx { width: 20px; color: var(--fg-subtle); font-size: 12px; text-align: right; flex: none; font-variant-numeric: tabular-nums; }
.list-row .main-text { flex: 1; min-width: 0; }
.list-row .t1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-row .t2 { color: var(--fg-muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-row .row-actions { display: flex; gap: 2px; flex: none; }
.stations { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; padding: 16px; }
.station .icon-btn { width: 28px; height: 28px; }
.station .del { opacity: 0; }
.station:hover .del, .station .del:focus-visible { opacity: 1; }
@media (hover: none) { .station .del { opacity: 1; } }
.station {
  display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 12px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--canvas); min-width: 0;
}
.station:hover { border-color: #8b949e; }
.station.playing { border-color: var(--accent-emphasis); background: var(--accent-subtle); }
.station .s-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.play-form { display: flex; flex-direction: column; gap: 12px; padding: 16px; }
.play-row { display: flex; gap: 8px; flex-wrap: wrap; }
.play-row .input { flex: 1 1 100%; min-width: 0; }
.play-row.inline .input { flex: 1 1 160px; }
.hint { color: var(--fg-muted); font-size: 12px; }
.script { border-bottom: 1px solid var(--border-muted); }
.script:last-child { border-bottom: 0; }
.script-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; }
.script-head .s-info { flex: 1; min-width: 0; }
.script-head .s-title { font-weight: 600; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.script-head .s-desc { color: var(--fg-muted); font-size: 13px; }
.script-form { padding: 4px 16px 16px; display: grid; gap: 12px; border-top: 1px dashed var(--border-muted); }
.script-form .field label { font-weight: 500; font-size: 13px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.check input { accent-color: var(--accent-emphasis); width: 16px; height: 16px; }
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }

/* ---------- groups & permissions ---------- */
.perm-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 16px; align-items: start; }
.group-list { display: flex; flex-direction: column; padding: 8px; max-height: calc(100vh - 230px); overflow: auto; }
.group-item {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; padding: 6px 8px; border: 0; border-radius: var(--radius);
  background: none; cursor: pointer; color: var(--fg); position: relative;
}
.group-item:hover { background: var(--hover); }
.group-item.selected { background: var(--selected); font-weight: 600; }
.group-item.selected::before { content: ""; position: absolute; left: -8px; top: 6px; bottom: 6px; width: 4px; border-radius: 0 6px 6px 0; background: var(--accent-emphasis); }
.group-item.sep { color: var(--fg-subtle); font-size: 12px; }
.group-item .gi-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.perm-facts { display: flex; gap: 16px; flex-wrap: wrap; padding: 10px 16px; border-bottom: 1px solid var(--border); color: var(--fg-muted); font-size: 13px; }
.perm-facts strong { color: var(--fg); }
.perm-toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 12px 16px 8px; }
.perm-cats { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 16px 12px; border-bottom: 1px solid var(--border); }
.chip-btn { border: 1px solid var(--border); background: none; border-radius: 2em; padding: 2px 10px; font-size: 12px; color: var(--fg-muted); cursor: pointer; }
.chip-btn:hover { color: var(--fg); border-color: #8b949e; }
.chip-btn.active { background: var(--accent-emphasis); border-color: var(--accent-emphasis); color: #fff; }
.table-wrap { overflow-x: auto; }
.perm-table td { padding-top: 6px; padding-bottom: 6px; }
.perm-table tr.unset td { color: var(--fg-muted); }
.perm-label { display: flex; gap: 6px; align-items: center; }
.perm-id { color: var(--fg-subtle); font-size: 11px; }
.crit { color: var(--attention-fg); display: inline-flex; }
.num-input { width: 120px; height: 28px; font-variant-numeric: tabular-nums; }
.flags { display: flex; gap: 10px; }

/* ---------- responsive ---------- */
@media (max-width: 1150px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split, .grid-2, .two-col, .perm-layout { grid-template-columns: minmax(0, 1fr); }
  .group-list { max-height: 260px; }
  .detail { position: static; }
  .tree { max-height: none; }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 260px; z-index: 40; transform: translateX(-100%); transition: transform .15s; }
  .app.nav-open .sidebar { transform: none; box-shadow: 0 8px 24px rgba(1, 4, 9, .75); }
  .menu-btn { display: grid; }
  .content { padding: 16px 12px 24px; }
  .topbar { padding: 12px; }
  .form-row { grid-template-columns: 1fr; }
  .player { grid-template-columns: 64px minmax(0, 1fr); }
  .cover { width: 64px; height: 64px; }
  .volume input[type=range] { width: 100px; }
}
