/* ============================================================
   RP Katalog – design system
   ============================================================ */
:root {
  --bg-0: #101216;      /* game rail */
  --bg-2: #15181d;      /* channel + member columns */
  --bg: #1b1e24;        /* main column */
  --surface: #20242b;
  --surface-2: #262a32;
  --surface-3: #2e333c;
  --input: #121418;
  --hover: rgba(255, 255, 255, .05);
  --active: rgba(255, 255, 255, .09);
  --border: rgba(255, 255, 255, .06);
  --border-2: rgba(255, 255, 255, .11);
  --text: #eceef1;
  --text-2: #b0b5bd;
  --text-3: #7c828c;
  --accent: #e3b341;
  --accent-2: #f2cd6b;
  --accent-soft: rgba(227, 179, 65, .14);
  --accent-ink: #1a1405;
  --blue: #5aa9e6;
  --violet: #a77be8;
  --danger: #ef6b73;
  --danger-soft: rgba(239, 107, 115, .13);
  --ok: #5cc98a;
  --radius: 8px;
  --radius-sm: 6px;
  --shadow: 0 8px 24px rgba(0, 0, 0, .4);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, .3);
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
  --serif: "Georgia", "Cambria", serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text);
  font: 14px/1.45 var(--font); -webkit-font-smoothing: antialiased; overflow: hidden; }
::selection { background: var(--accent-soft); color: var(--accent-2); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
[class^="icon-"], [class*=" icon-"] { font-size: 16px; line-height: 1; vertical-align: -2px; }

/* scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.08); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.16); background-clip: padding-box; }
::-webkit-scrollbar-corner, ::-webkit-scrollbar-track { background: transparent; }

/* ---------- app shell: rail | channels | center | members ---------- */
#app { display: flex; height: 100vh; }
#guilds { width: 72px; flex: none; background: var(--bg-0); display: flex; flex-direction: column; align-items: center;
  gap: 8px; padding: 12px 0; overflow-y: auto; scrollbar-width: none; }
#guilds::-webkit-scrollbar { display: none; }
.guild { position: relative; width: 72px; display: flex; justify-content: center; cursor: pointer; }
.guild .gi { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; overflow: hidden;
  background: var(--surface) center / cover no-repeat; color: var(--text); font-weight: 650; font-size: 14px;
  transition: border-radius .15s ease, background-color .15s; }
.guild .gi .logo { font-weight: 800; letter-spacing: -.5px; }
.guild:hover .gi, .guild.on .gi { border-radius: 16px; }
.guild.on .gi:has(.logo), .guild:hover .gi:has(.logo) { background-color: var(--accent); color: var(--accent-ink); }
.guild .gi:has(img.logo) { background: transparent !important; }
.guild .gi img.logo { width: 100%; height: 100%; display: block; transform: scale(1.12); }
.guild .pill { position: absolute; left: 0; top: 50%; width: 4px; height: 0; margin-top: 0; border-radius: 0 4px 4px 0;
  background: var(--text); transition: height .15s, margin-top .15s; }
.guild:hover .pill { height: 20px; margin-top: -10px; }
.guild.on .pill { height: 40px; margin-top: -20px; }
.gsep { width: 32px; height: 2px; border-radius: 1px; background: var(--surface-2); flex: none; }

#channels { width: 240px; flex: none; background: var(--bg-2); display: flex; flex-direction: column; min-height: 0; }
.chan-head { height: 48px; flex: none; display: flex; align-items: center; gap: 6px; padding: 0 16px; font-weight: 650;
  font-size: 15px; border-bottom: 1px solid rgba(0,0,0,.25); box-shadow: 0 1px 0 var(--border); cursor: pointer; }
.chan-head:hover { background: var(--hover); }
.chan-head > span { flex: 1; }
.chan-body { flex: 1; overflow-y: auto; padding: 8px 8px 12px; min-height: 0; }
.cat { display: flex; align-items: center; gap: 2px; padding: 16px 4px 4px 2px; font-size: 11.5px; font-weight: 650;
  letter-spacing: .03em; text-transform: uppercase; color: var(--text-3); cursor: pointer; user-select: none; }
.cat:first-child { padding-top: 6px; }
.cat:hover { color: var(--text-2); }
.cat i { font-size: 12px; transition: transform .12s; }
.cat.closed i { transform: rotate(-90deg); }
.chan { display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 8px; margin: 1px 0; border-radius: 4px;
  color: var(--text-3); cursor: pointer; font-size: 14.5px; font-weight: 500; }
.chan i { font-size: 18px; opacity: .8; }
.chan:hover { background: var(--hover); color: var(--text-2); }
.chan.on { background: var(--active); color: var(--text); }
.chan-slot:empty { display: none; }
.chan-slot { margin-top: 6px; }

/* now playing + user bar */
.np { flex: none; margin: 0 8px 8px; padding: 10px 10px 8px; border-radius: 8px; background: var(--bg-0); }
.np-top { display: flex; gap: 8px; align-items: flex-start; }
.np-state { font-size: 12.5px; font-weight: 650; color: var(--ok); }
.np-state.paused { color: var(--text-3); }
.np-title { font-size: 13px; color: var(--text); cursor: pointer; margin-top: 1px; }
.np-title:hover { text-decoration: underline; }
.np-time { font-size: 11.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.np-prog { height: 3px; border-radius: 2px; background: var(--surface-3); margin: 8px 0 6px; overflow: hidden; }
.np-prog i { display: block; height: 100%; background: var(--accent); }
.np-ctl { display: flex; justify-content: space-between; }
.npb { width: 32px; height: 32px; border: 0; border-radius: 4px; background: none; color: var(--text-2); cursor: pointer;
  display: grid; place-items: center; flex: none; }
.npb i { font-size: 18px; }
.npb:hover { background: var(--hover); color: var(--text); }
.npb.on { color: var(--accent); }
.userbar { flex: none; height: 52px; display: flex; align-items: center; gap: 8px; padding: 0 8px; background: var(--bg-0); }
.ub-avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--accent);
  color: var(--accent-ink); font-weight: 800; font-size: 12px; flex: none; }
.ub-name { font-size: 13.5px; font-weight: 600; }
.ub-sub { font-size: 11.5px; color: var(--text-3); }

#center { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--bg); }
#topbar { height: 48px; flex: none; display: flex; align-items: center; gap: 10px; padding: 0 12px 0 16px;
  border-bottom: 1px solid rgba(0,0,0,.25); box-shadow: 0 1px 0 var(--border); }
.tb-title { display: flex; align-items: center; gap: 8px; font-weight: 650; font-size: 15px; white-space: nowrap; }
.tb-title i { font-size: 20px; color: var(--text-3); }
.tb-sep { width: 1px; height: 24px; background: var(--border-2); flex: none; }
.tb-topic { color: var(--text-3); font-size: 13.5px; }
.tb-btn { width: 32px; height: 32px; border: 0; border-radius: 4px; background: none; color: var(--text-3); cursor: pointer;
  display: grid; place-items: center; }
.tb-btn i { font-size: 20px; }
.tb-btn:hover, .tb-btn.on { color: var(--text); }
#view { flex: 1; min-height: 0; min-width: 0; display: flex; flex-direction: column; position: relative; }
#view .page-head h1 { display: none; }
#view .page-head { padding: 14px 24px 8px; min-height: 0; }

#members { width: 240px; flex: none; background: var(--bg-2); overflow-y: auto; padding: 0 8px 16px; }
.mem-cat { padding: 20px 8px 6px; font-size: 11.5px; font-weight: 650; letter-spacing: .03em; text-transform: uppercase; color: var(--text-3); }
.mem { display: flex; align-items: center; gap: 12px; height: 44px; padding: 0 8px; border-radius: 4px; cursor: pointer; }
.mem:hover { background: var(--hover); }
.mem.gone { opacity: .4; }
.mem .mav { position: relative; flex: none; }
.mem .mav .avatar { border: 0; box-shadow: none; }
.mem .st { position: absolute; right: -2px; bottom: -2px; width: 12px; height: 12px; border-radius: 50%; border: 3px solid var(--bg-2); }
.mem .mn { font-size: 14.5px; font-weight: 500; line-height: 1.2; }
.mem .ms { font-size: 12px; color: var(--text-3); line-height: 1.25; }
.mem-empty { display: flex; flex-direction: column; align-items: center; gap: 10px; color: var(--text-3); padding: 60px 10px; text-align: center; }
.mem-empty > i { font-size: 30px; }
.char-pop { position: fixed; z-index: 250; width: 300px; border-radius: 8px; overflow: hidden; background: var(--bg-0);
  box-shadow: 0 8px 30px rgba(0,0,0,.5); animation: pop .12s var(--ease); }
.char-pop .cp-banner { height: 60px; }
.char-pop .cp-av { position: absolute; top: 18px; left: 14px; border-radius: 50%; padding: 5px; background: var(--bg-0); }
.char-pop .cp-av .avatar { border: 0; box-shadow: none; }
.char-pop .cp-body { margin: 46px 12px 12px; padding: 12px; border-radius: 8px; background: var(--surface); }
.char-pop .cp-name { font-size: 19px; font-weight: 700; }
.char-pop .cp-sub { font-size: 13px; color: var(--text-2); }
.char-pop .cp-sec { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); font-size: 13px; }
.char-pop .cp-h { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--text-3); margin-bottom: 6px; }
.char-pop .cp-ev { display: flex; align-items: center; gap: 8px; padding: 4px 4px; border-radius: 4px; cursor: pointer; }
.char-pop .cp-ev:hover { background: var(--hover); }
.char-pop .cp-ev .ellipsis { flex: 1; }

/* ---------- layout helpers ---------- */
.row { display: flex; align-items: center; gap: 8px; }
.col { display: flex; flex-direction: column; gap: 8px; }
.grow { flex: 1; min-width: 0; }
.wrap { flex-wrap: wrap; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.small { font-size: 12px; }
.tiny { font-size: 11px; }
.mono { font-variant-numeric: tabular-nums; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scroll { overflow: auto; }
.hidden { display: none !important; }
.sep { height: 1px; background: var(--border); margin: 8px 0; }
.vsep { width: 1px; align-self: stretch; background: var(--border); }

.page-head { display: flex; align-items: center; gap: 12px; padding: 18px 24px 14px; }
.page-head h1 { margin: 0; font: 600 22px/1.2 var(--font-display); letter-spacing: -.3px; }
.page-head .sub { color: var(--text-3); font-size: 13px; }
.toolbar { display: flex; align-items: center; gap: 8px; padding: 0 24px 14px; flex-wrap: wrap; }
.section-title { font-size: 12px; font-weight: 650; letter-spacing: .02em; text-transform: uppercase;
  color: var(--text-3); margin: 22px 0 8px; display: flex; align-items: center; gap: 8px; }
.section-title > i { display: none; }
.section-title .line { display: none; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 32px; padding: 0 14px;
  border-radius: 4px; border: 0; background: var(--surface-3); color: var(--text); font-weight: 500;
  cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, transform .05s; font-size: 13px; }
.btn:hover { background: color-mix(in srgb, var(--surface-3) 80%, white 8%); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; pointer-events: none; }
.btn.primary { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn.primary:hover { background: color-mix(in srgb, var(--accent) 88%, black); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--hover); color: var(--text); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: var(--danger-soft); }
.btn.icon { width: 32px; padding: 0; }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12.5px; border-radius: 4px; }
.btn.sm.icon { width: 28px; }
.btn.lg { height: 38px; padding: 0 18px; font-size: 14px; }
.btn.active { background: var(--accent-soft); color: var(--accent-2); }

/* segmented control */
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 6px; background: var(--input); }
.seg button { height: 26px; padding: 0 11px; border: 0; border-radius: 4px; background: none; color: var(--text-2);
  cursor: pointer; display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--surface-3); color: var(--text); }

/* ---------- inputs ---------- */
.input, select.input, textarea.input { height: 36px; width: 100%; padding: 0 11px; border-radius: 4px;
  background: var(--input); border: 1px solid transparent; outline: none; transition: border-color .15s; }
textarea.input { height: auto; padding: 9px 11px; resize: vertical; min-height: 70px; }
.input:focus { border-color: var(--accent); }
.input::placeholder { color: var(--text-3); }
.input.bare { background: transparent; border-color: transparent; padding: 0 4px; }
.input.bare:hover { border-color: var(--border); }
.input.bare:focus { background: var(--input); }
.search { position: relative; }
.search i { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text-3); }
.search .input { padding-left: 34px; }
label.field { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--text-2); }
.check { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; color: var(--text-2); font-size: 13px; user-select: none; }
.check input { accent-color: var(--accent); width: 15px; height: 15px; }
input[type=range], input[type=checkbox], input[type=radio] { accent-color: var(--accent); }
.test-chip { display: inline-block; margin-left: 6px; padding: 0 5px; border-radius: 4px; font: 700 10px/16px var(--font-ui, sans-serif); letter-spacing: .06em; color: #1b1300; background: #f0b429; vertical-align: middle; }
input[type=datetime-local].input, input[type=date].input { color-scheme: dark; }
input[type=color] { width: 34px; height: 34px; padding: 0; border: 0; background: none; cursor: pointer; }

/* ---------- chips / badges ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 4px;
  background: var(--surface-2); border: 1px solid transparent; color: var(--text-2); font-size: 12.5px;
  cursor: pointer; white-space: nowrap; transition: all .15s; }
.chip:hover { color: var(--text); border-color: var(--border-2); }
.chip.on { background: var(--accent-soft); color: var(--accent-2); }
.chip .x { opacity: .5; margin-right: -4px; }
.chip .x:hover { opacity: 1; color: var(--danger); }
.chip .count { color: var(--text-3); font-size: 11px; }
.tag { color: var(--accent); font-size: 12px; }
.badge { display: inline-flex; align-items: center; gap: 4px; height: 18px; padding: 0 6px; border-radius: 3px;
  font-size: 11px; font-weight: 600; }
.badge.clip { background: rgba(90,169,230,.18); color: #8cc6f2; }
.badge.session { background: rgba(227,179,65,.18); color: var(--accent-2); }
.badge.manual { background: rgba(167,123,232,.18); color: #c4a5f2; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }

/* avatar */
.avatar { flex: none; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #111;
  background-size: cover; background-position: center; border: 2px solid rgba(0,0,0,.35);
  box-shadow: 0 0 0 1px var(--border-2); }
.avatars { display: inline-flex; }
.avatars .avatar { margin-left: -7px; }
.avatars .avatar:first-child { margin-left: 0; }
.char-chip { display: inline-flex; align-items: center; gap: 7px; height: 28px; padding: 0 10px 0 3px; border-radius: 99px;
  background: var(--surface-2); border: 1px solid transparent; font-size: 12.5px; cursor: pointer; }
.char-chip:hover { border-color: var(--border-2); background: var(--surface-3); }
.char-chip .role { color: var(--text-3); font-size: 11.5px; }

/* ---------- cards & panels ---------- */
.card { background: var(--surface); border-radius: var(--radius); }
.panel { background: var(--surface); border-left: 1px solid var(--border); }
.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  color: var(--text-3); text-align: center; padding: 40px 20px; }
.empty > i { font-size: 34px; color: var(--text-3); opacity: .6; }
.empty h3 { margin: 0; color: var(--text-2); font-weight: 600; }

/* list rows */
.list-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 4px; cursor: pointer; }
.list-row:hover { background: var(--hover); }
.list-row.on { background: var(--active); }

/* ---------- media tiles ---------- */
.mtile { position: relative; border-radius: 6px; overflow: hidden; background: #000; cursor: pointer; aspect-ratio: 16/9; }
.mtile img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s var(--ease); }
.mtile:hover img { transform: scale(1.04); }
.mtile .dur { position: absolute; right: 6px; bottom: 6px; background: rgba(0,0,0,.72); color: #fff;
  font-size: 11px; padding: 1px 6px; border-radius: 5px; font-variant-numeric: tabular-nums; backdrop-filter: blur(4px); }
.mtile .badge { position: absolute; left: 6px; top: 6px; backdrop-filter: blur(6px); }
.mtile .play { position: absolute; inset: 0; display: grid; place-items: center; opacity: 0; transition: opacity .2s;
  background: radial-gradient(circle, rgba(0,0,0,.35), transparent 70%); }
.mtile .play i { font-size: 34px; color: #fff; filter: drop-shadow(0 2px 8px rgba(0,0,0,.6)); }
.mtile:hover .play { opacity: 1; }
.mtile.noimg { display: grid; place-items: center; color: var(--text-3); background: var(--surface-2); }

/* ---------- overlays: modal, menu, toast ---------- */
.backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.7); display: grid;
  place-items: center; z-index: 100; animation: fade .15s; }
.modal { width: min(520px, 92vw); max-height: 88vh; display: flex; flex-direction: column; background: var(--bg);
  border-radius: 8px; box-shadow: var(--shadow); animation: pop .18s var(--ease); }
.modal.wide { width: min(880px, 94vw); }
.modal.xwide { width: min(1180px, 96vw); }
.modal header { padding: 18px 20px 6px; display: flex; align-items: center; gap: 10px; }
.modal header h2 { margin: 0; font: 600 17px var(--font-display); flex: 1; }
.modal .body { padding: 10px 20px; overflow: auto; }
.modal footer { padding: 14px 20px; display: flex; justify-content: flex-end; gap: 8px; background: var(--bg-2); border-radius: 0 0 8px 8px; margin-top: 10px; }
.menu { position: fixed; z-index: 200; min-width: 200px; padding: 6px; background: var(--bg-0);
  border: 1px solid var(--border); border-radius: 6px; box-shadow: var(--shadow); animation: pop .12s var(--ease); }
.menu .mi { display: flex; align-items: center; gap: 9px; height: 32px; padding: 0 8px; border-radius: 3px; cursor: pointer;
  font-size: 13px; color: var(--text); white-space: nowrap; position: relative; }
.menu .mi:hover { background: var(--accent); color: var(--accent-ink); }
.menu .mi:hover i { color: inherit; }
.menu .mi i { color: var(--text-2); width: 16px; }
.menu .mi.danger, .menu .mi.danger i { color: var(--danger); }
.menu .mi.disabled { opacity: .4; pointer-events: none; }
.menu .mi .arrow { margin-left: auto; color: var(--text-3); }
.menu .msep { height: 1px; background: var(--border); margin: 4px 6px; }
.menu .mhead { padding: 6px 10px 4px; font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; }
#toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 300; display: flex;
  flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { pointer-events: auto; padding: 10px 16px; border-radius: 6px; background: var(--bg-0);
  border: 1px solid var(--border); box-shadow: var(--shadow); display: flex; align-items: center; gap: 10px;
  animation: pop .2s var(--ease); font-size: 13px; }
.toast.ok i { color: var(--ok); }
.toast.err { border-color: rgba(239,107,115,.4); }
.toast.err i { color: var(--danger); }
.toast .act { color: var(--accent); cursor: pointer; font-weight: 600; margin-left: 6px; }

@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.98); } }
@keyframes slidein { from { opacity: 0; transform: translateX(16px); } }

/* picker (characters / events) */
.picker-list { max-height: 52vh; overflow: auto; display: flex; flex-direction: column; gap: 2px; margin-top: 10px; }
.picker-list .list-row.sel { background: var(--accent-soft); }
.picker-list .list-row .check-mark { margin-left: auto; color: var(--accent); }

/* kbd */
.kbd { display: inline-block; padding: 1px 6px; border-radius: 3px; border: 1px solid var(--border-2);
  background: var(--surface-2); font-size: 11px; color: var(--text-2); font-family: var(--font); }

/* drag & drop */
.drop-target { outline: 2px dashed var(--accent); outline-offset: -2px; background: var(--accent-soft) !important; }

/* view navigation hosted in the channel column */
.chan-slot .lib-side .grp { padding: 16px 4px 4px 2px; margin: 0; }
.chan-slot .lib-side .it { height: 32px; border-radius: 4px; font-size: 14px; padding: 0 8px; color: var(--text-3); }
.chan-slot .lib-side .it:hover { color: var(--text-2); }
.chan-slot .lib-side .it.on { background: var(--active); color: var(--text); }
.chan-slot .ev-node .cnt { display: none; }
.chan-slot .ev-node .nm { font-size: 14px; }

/* narrow window (e.g. player docked beside): drop side columns progressively */
@media (max-width: 1180px) { #members { display: none; } }
@media (max-width: 820px) { #channels { width: 200px; } }
@media (max-width: 640px) { #channels { display: none; } }
.np-ctl .npb { width: 28px; }
.np { overflow: hidden; }

/* pane under the docked player */
.pane-detail body { background: var(--bg); }
.pane-detail #app { display: block; height: 100vh; }
.pane-detail .pane-scroll { height: 100vh; overflow-y: auto; }
.pane-detail .lib-insp.pane { width: auto; border: 0; }
.pane-detail .lib-insp.pane .pad { padding: 14px 18px 24px; }
.pane-detail .empty { height: 100vh; }
.ch-hero { align-items: flex-start !important; }
.ch-fields .seg { flex-wrap: wrap; }
.ch-fields .seg button { white-space: nowrap; }

.cat .grow { flex: 1; }
.cat-add { opacity: 0; padding: 0 4px; }
.cat:hover .cat-add { opacity: 1; }
.cat-add:hover { color: var(--text); }
.chan-n { margin-left: auto; font-size: 11px; color: var(--text-3); }

/* transcripts: library card flags and search hits (the rest is in transcript.css) */
.mcard .flags .tr-flag { color: var(--accent-2); }
.mcard .flags .tr-flag.vis { color: var(--violet); }
.tr-hit { display: flex; gap: 6px; align-items: baseline; margin-top: 4px; font-size: 12px; color: var(--text-2);
  padding: 3px 4px; border-radius: 4px; cursor: pointer; min-width: 0; }
.tr-hit:hover { background: var(--hover); color: var(--text); }
.tr-hit .kbd { font-size: 10px; flex: none; }
.tr-hit mark { background: var(--accent-soft); color: var(--text); }

/* ---------- Settings: sections with a side navigation ---------- */
.set-wrap { display: flex; gap: 28px; padding: 0 24px 60px; align-items: flex-start; }
.set-nav { position: sticky; top: 8px; flex: none; width: 190px; display: flex; flex-direction: column; gap: 2px; }
.set-nav a { display: flex; align-items: center; gap: 9px; padding: 7px 10px; border-radius: 6px; color: var(--text-2);
  font-size: 13px; cursor: pointer; text-decoration: none; }
.set-nav a:hover { background: var(--hover); color: var(--text); }
.set-nav a.on { background: var(--accent-soft); color: var(--accent-2); }
.set-main { flex: 1; min-width: 0; max-width: 820px; }
.set-sec { scroll-margin-top: 10px; margin-bottom: 26px; }
.set-sec > h2 { display: flex; align-items: center; gap: 9px; margin: 6px 0 12px; font: 600 17px var(--font-display); }
.set-row { display: flex; flex-wrap: wrap; gap: 14px 30px; align-items: flex-end; }
.set-hint { color: var(--text-3); font-size: 12px; margin: 2px 0 0 22px; }
.set-kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; font-size: 13px; }
.set-kv > :nth-child(odd) { color: var(--text-3); }
@media (max-width: 900px) { .set-nav { display: none; } }

/* ---------- updates, feedback, error prompt ---------- */
.upd-bar { height: 6px; border-radius: 3px; background: var(--input); overflow: hidden; }
.upd-bar > div { height: 100%; background: var(--accent); transition: width .3s var(--ease); }
.md-notes { max-height: 280px; overflow: auto; padding: 10px 14px; border-radius: 8px; background: var(--input); font-size: 13px; color: var(--text-2); }
.md-notes p { margin: 4px 0; } .md-notes ul { margin: 4px 0; padding-left: 20px; } .md-notes .md-h { margin: 10px 0 4px; color: var(--text); font-size: 13px; }
.md-notes code { font-size: 12px; padding: 0 4px; border-radius: 3px; background: var(--surface); }
.fb-preview { max-height: 260px; overflow: auto; margin: 0; padding: 10px; border-radius: 8px; background: var(--input); font: 11px/1.45 ui-monospace, monospace;
  white-space: pre-wrap; word-break: break-word; color: var(--text-2); user-select: text; }
.crash-bar { position: fixed; right: 18px; bottom: 18px; z-index: 310; display: flex; align-items: center; gap: 10px; max-width: 560px;
  padding: 10px 12px 10px 14px; border-radius: 10px; background: var(--surface); border: 1px solid var(--danger); box-shadow: var(--shadow); font-size: 13px; }
