/* VoiceCore panel. All colours come from theme tokens (themes.css). No underlines anywhere (colour/opacity changes only). */
:root { --radius: 10px; --radius-sm: 7px; --bar-h: 76px; --top-h: 56px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
a:hover, a:focus { text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 600; }
h1 { font-size: 20px; } h2 { font-size: 15px; } h3 { font-size: 13px; color: var(--muted); font-weight: 500; letter-spacing: .04em; text-transform: uppercase; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: var(--accent-soft); }
.mono { font-family: var(--mono); font-size: 12.5px; }
.muted { color: var(--muted); }
.grow { flex: 1 1 auto; min-width: 0; }
.row { display: flex; align-items: center; gap: 10px; }
.wrap { flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: 12px; }
.trunc { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hidden { display: none !important; }

/* ---- shell ------------------------------------------------------------------ */
.shell { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: var(--top-h) 1fr var(--bar-h); height: 100vh; height: 100dvh; }
.top { display: flex; align-items: center; gap: 6px; padding: 0 16px; background: var(--panel); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; letter-spacing: .01em; margin-right: 14px; }
.brand svg { width: 26px; height: 26px; }
.tabs { display: flex; gap: 2px; }
.tab { padding: 8px 14px; border-radius: var(--radius-sm); color: var(--muted); transition: color .12s, background .12s; }
.tab:hover { color: var(--text); background: var(--panel-2); }
.tab.on { color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.top .spacer { flex: 1; }
.main { display: grid; grid-template-columns: 240px 1fr; min-height: 0; }
.side { background: var(--panel); border-right: 1px solid var(--line); overflow-y: auto; padding: 12px 8px; display: flex; flex-direction: column; gap: 2px; }
.side h3 { padding: 14px 10px 6px; }
.nav { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--radius-sm); color: var(--muted); cursor: pointer; transition: color .12s, background .12s; }
.nav:hover { color: var(--text); background: var(--panel-2); }
.nav.on { color: var(--text); background: var(--raise); box-shadow: inset 2px 0 0 var(--accent); }
.nav .count { margin-left: auto; font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; }
.nav svg { width: 17px; height: 17px; flex: none; opacity: .85; }
.content { overflow-y: auto; padding: 22px 26px 30px; min-width: 0; }
.page { width: 100%; max-width: 1680px; display: flex; flex-direction: column; gap: 18px; }
.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.page-head .grow { display: flex; flex-direction: column; gap: 2px; }
.banner { background: var(--warn-bg); color: var(--warn); border-bottom: 1px solid var(--warn-line); padding: 7px 16px; font-size: 13px; text-align: center; }

/* ---- controls ----------------------------------------------------------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 36px; padding: 0 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--panel-2); cursor: pointer; font-weight: 500; transition: background .12s, border-color .12s, opacity .12s; white-space: nowrap; }
.btn:hover { background: var(--raise); border-color: var(--line-hi); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn.primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: rgba(248, 113, 113, .1); border-color: rgba(248, 113, 113, .4); }
/* confirm button of a destructive dialog: red from the first moment, not accent-colored until hovered */
.btn.primary.danger { background: rgba(248, 113, 113, .12); border-color: rgba(248, 113, 113, .4); color: var(--danger); }
.btn.primary.danger:hover, .btn.primary.danger:focus-visible { background: rgba(248, 113, 113, .2); border-color: rgba(248, 113, 113, .65); }
.btn.primary.danger:active { background: rgba(248, 113, 113, .3); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--panel-2); color: var(--text); }
.btn.icon { width: 34px; min-height: 34px; padding: 0; }
.btn svg { width: 16px; height: 16px; flex: none; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label { font-size: 12px; color: var(--muted); letter-spacing: .03em; }
.field .hint { font-size: 12px; color: var(--faint); }
input[type=text], input[type=number], input[type=password], input[type=url], input[type=search], select, textarea {
  width: 100%; min-height: 38px; padding: 7px 11px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm); transition: border-color .12s; }
input:hover, select:hover, textarea:hover { border-color: var(--line-hi); }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5' fill='none' stroke='%23888' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 12px; padding-right: 30px; }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
.switch { position: relative; width: 40px; height: 22px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; cursor: pointer; margin: 0; width: 100%; height: 100%; }
.switch i { position: absolute; inset: 0; border-radius: 11px; background: var(--raise); border: 1px solid var(--line); transition: background .15s; pointer-events: none; }
.switch i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--muted); transition: transform .15s, background .15s; }
.switch input:checked + i { background: var(--accent-soft); border-color: var(--accent); }
.switch input:checked + i::after { transform: translateX(18px); background: var(--accent); }
.switch input:focus-visible + i { outline: 2px solid var(--accent); outline-offset: 2px; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 40px; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.card-head { display: flex; align-items: center; gap: 10px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 99px; background: var(--raise); color: var(--muted); white-space: nowrap; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.ok { background: var(--accent-soft); color: var(--accent); }
.pill.warn { background: rgba(251, 191, 36, .12); color: var(--warn); }
.pill.bad { background: rgba(248, 113, 113, .12); color: var(--danger); }
.pill.plain::before { display: none; }
.note { background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; color: var(--muted); font-size: 13px; }
.note.warn { color: var(--warn); border-color: var(--warn-line); background: var(--warn-bg); }
.error-text { color: var(--danger); font-size: 13px; min-height: 18px; }
.empty { padding: 40px 16px; text-align: center; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 12px; }
.empty svg { width: 36px; height: 36px; opacity: .5; }

/* ---- tables / lists ------------------------------------------------------------ */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; font-weight: 500; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); position: sticky; top: -22px; background: var(--bg); z-index: 1; }
.table td { padding: 8px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table tr:hover td { background: var(--row-hover); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); white-space: nowrap; }
.table .actions { text-align: right; white-space: nowrap; }
.table .actions .btn { opacity: .0; transition: opacity .12s; }
.table tr:hover .actions .btn, .table tr:focus-within .actions .btn { opacity: 1; }
@media (hover: none) { .table .actions .btn { opacity: 1; } }
.table-wrap { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; }
.table-wrap .table th { background: var(--panel); top: 0; }
.fname { display: flex; align-items: center; gap: 10px; min-width: 0; }
.fname svg { width: 17px; height: 17px; flex: none; color: var(--faint); }
.fname.folder svg { color: var(--accent); }
.fname .t { min-width: 0; }
.fname .t b { font-weight: 500; display: block; }
.fname .t span { color: var(--muted); font-size: 12px; display: block; }
a.fname:hover b { color: var(--accent); }
.crumbs { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; color: var(--muted); }
.crumbs a:hover { color: var(--accent); }
.crumbs b { color: var(--text); font-weight: 600; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.toolbar input[type=search] { max-width: 280px; }

/* ---- player bar -------------------------------------------------------------------- */
.player { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(260px, 1.4fr) minmax(150px, 1fr); align-items: center; gap: 18px; padding: 0 18px; background: var(--panel); border-top: 1px solid var(--line); }
.np { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cover { width: 46px; height: 46px; border-radius: 9px; background: var(--cover); border: 1px solid var(--line); display: grid; place-items: center; flex: none; color: var(--accent); }
.cover svg { width: 22px; height: 22px; }
.cover.live svg { animation: bars 1.1s ease-in-out infinite alternate; }
@keyframes bars { from { transform: scaleY(.8); opacity: .7; } to { transform: scaleY(1.05); opacity: 1; } }
.np .t { min-width: 0; }
.np b { display: block; font-weight: 600; }
.np span { display: block; color: var(--muted); font-size: 12px; }
.transport { display: flex; flex-direction: column; gap: 6px; align-items: center; }
.transport .btns { display: flex; align-items: center; gap: 6px; }
.btn.play { width: 40px; height: 40px; min-height: 40px; border-radius: 50%; padding: 0; }
.progress { display: flex; align-items: center; gap: 8px; width: 100%; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.seek { position: relative; flex: 1; height: 20px; display: flex; align-items: center; touch-action: none; user-select: none; } /* fixed height: growing the bar must not push the controls above it */
.seek.seekable { cursor: pointer; }
.seek .bar { height: 6px; transform: scaleY(.6667); transition: transform .15s ease; } /* 4 px at rest, 6 px on hover: animated as a transform, so it grows smoothly (no pixel steps, no layout) */
.seek.seekable:hover .bar, .seek:focus-visible .bar, .seek.dragging .bar { transform: none; }
.seek .bar > i { width: calc(7px + (100% - 14px) * var(--f, 0)); } /* ends under the center of the thumb */
.seek.idle .bar > i { width: 0; }
.seek.stream .bar > i { width: 100%; }
.progress > span:first-child, .progress > span:last-child { flex: none; width: 52px; } /* equal columns: the bar stays centered, for a track and for LIVE alike */
.progress > span:first-child { text-align: right; }
.progress > span:last-child { display: inline-flex; align-items: center; justify-content: flex-start; } /* both numbers hug the bar */
.live-tag { display: inline-flex; align-items: center; gap: 6px; color: var(--danger); font-weight: 700; letter-spacing: .08em; }
.live-tag::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: pulse 2s ease-in-out infinite; }
.seek-thumb { position: absolute; top: 50%; left: calc(7px + (100% - 14px) * var(--f, 0)); width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: var(--text); pointer-events: none; }
.seek.idle .seek-thumb, .seek.stream .seek-thumb { display: none; }
.seek:focus-visible { outline: none; }
.bar { position: relative; flex: 1; height: 5px; border-radius: 3px; background: var(--raise); overflow: hidden; }
.bar > i { position: absolute; inset: 0 auto 0 0; width: var(--p, 0%); background: var(--accent); border-radius: 3px; }
.bar.live > i { animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .55; } }
.volume { display: flex; align-items: center; gap: 10px; justify-content: flex-end; }
.vol-btn { display: grid; place-items: center; width: 28px; height: 28px; flex: none; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; }
.vol-btn:hover:not(:disabled) { color: var(--text); background: var(--raise); }
.vol-btn svg { width: 18px; height: 18px; }
.vol-pct { flex: none; width: 4.5ch; text-align: right; font-variant-numeric: tabular-nums; } /* fixed width: the slider must not move while the number changes */
input[type=range] { -webkit-appearance: none; appearance: none; height: 5px; border-radius: 3px; background: linear-gradient(90deg, var(--accent) var(--v, 70%), var(--raise) var(--v, 70%)); width: 120px; padding: 0; min-height: 0; border: 0; cursor: pointer; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: var(--text); border: 0; }
input[type=range]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--text); border: 0; }

/* ---- skeleton -------------------------------------------------------------------------- */
.sk { display: block; border-radius: 6px; background: var(--raise); background-image: linear-gradient(90deg, var(--raise) 0%, var(--sk-hi) 50%, var(--raise) 100%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.sk.h14 { height: 14px; } .sk.h20 { height: 20px; } .sk.h36 { height: 36px; } .sk.circle { border-radius: 50%; }
.sk.w20 { width: 20%; } .sk.w30 { width: 30%; } .sk.w50 { width: 50%; } .sk.w70 { width: 70%; } .sk.w90 { width: 90%; } .sk.w16px { width: 16px; } .sk.w64px { width: 64px; border-radius: 99px; }
.sk-row { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border-bottom: 1px solid var(--line-soft); }
.sk-row:last-child { border-bottom: 0; }
.sk-row .grow { display: flex; flex-direction: column; gap: 8px; }
@media (prefers-reduced-motion: reduce) { .sk, .cover.live svg, .bar.live > i { animation: none; } * { transition: none !important; } }

/* ---- overlay: modal, toast, menu, dropzone ------------------------------------------------ */
dialog { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 14px; padding: 0; width: min(460px, calc(100vw - 32px)); box-shadow: 0 24px 80px rgba(0, 0, 0, .6); }
dialog::backdrop { background: var(--scrim); backdrop-filter: blur(2px); }
.dlg { padding: 22px; display: flex; flex-direction: column; gap: 16px; }
.dlg .actions { display: flex; justify-content: flex-end; gap: 8px; }
.toasts { position: fixed; right: 16px; bottom: calc(var(--bar-h) + 14px); display: flex; flex-direction: column; gap: 8px; z-index: 50; max-width: min(380px, calc(100vw - 32px)); }
.toast { background: var(--raise); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: var(--radius-sm); padding: 10px 14px; box-shadow: 0 8px 30px rgba(0, 0, 0, .5); animation: rise .18s ease-out; }
.toast.err { border-left-color: var(--danger); }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } }
.menu { position: fixed; z-index: 40; min-width: 200px; background: var(--raise); border: 1px solid var(--line); border-radius: var(--radius); padding: 5px; box-shadow: 0 16px 50px rgba(0, 0, 0, .55); max-height: 60vh; overflow-y: auto; }
.menu button { display: flex; width: 100%; align-items: center; gap: 9px; text-align: left; background: none; border: 0; padding: 8px 10px; border-radius: 6px; cursor: pointer; }
.menu button:hover, .menu button:focus-visible { background: var(--accent-soft); color: var(--accent); outline: none; }
.menu .sep { height: 1px; background: var(--line); margin: 4px 2px; }
.menu .hd { padding: 6px 10px 3px; font-size: 11px; color: var(--faint); letter-spacing: .05em; text-transform: uppercase; }
.dropzone { border: 1.5px dashed var(--line-hi); border-radius: var(--radius); padding: 40px 20px; text-align: center; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 12px; transition: border-color .15s, background .15s; }
.dropzone.over { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }
.dropzone svg { width: 34px; height: 34px; color: var(--accent); }
.upl { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line-soft); }
.upl:last-child { border-bottom: 0; }
.upl .bar { max-width: 160px; }
.tabbar { display: flex; gap: 2px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabbar a { padding: 10px 14px; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabbar a:hover { color: var(--text); }
.tabbar a.on { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 22px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.logbox { background: var(--log-bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 0; font-family: var(--mono); font-size: 12.5px; max-height: calc(100vh - 230px); overflow: auto; }
.logline { display: grid; grid-template-columns: 74px 52px 1fr; gap: 10px; padding: 2px 14px; }
.logline:hover { background: var(--row-hover); }
.logline .ts { color: var(--faint); } .logline .lv { color: var(--muted); text-transform: uppercase; }
.logline.error .lv, .logline.error .msg { color: var(--danger); } .logline.warn .lv { color: var(--warn); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 4px 3px 10px; border-radius: 99px; background: var(--raise); font-size: 12.5px; }
.chip button { background: none; border: 0; width: 20px; height: 20px; border-radius: 50%; cursor: pointer; color: var(--muted); line-height: 1; }
.chip button:hover { background: rgba(248, 113, 113, .15); color: var(--danger); }

/* ---- login ---------------------------------------------------------------------------------------- */
.login { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 20px; background: radial-gradient(900px 500px at 50% -10%, rgba(52, 211, 153, .1), transparent), var(--bg); }
.login .card { width: min(400px, 100%); padding: 28px; gap: 18px; }
.login .brand { font-size: 20px; margin: 0; justify-content: center; }
.login .brand svg { width: 34px; height: 34px; }

@media (max-width: 860px) {
  .main { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .hide-sm { display: none; }
  .player { overflow: hidden; } .np .t { max-width: 40vw; }
  .side { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 8px; }
  .side h3 { display: none; } .nav { white-space: nowrap; }
  .player { grid-template-columns: 1fr auto; gap: 10px; padding: 0 12px; }
  .volume { display: none; } .progress { display: none; }
  .content { padding: 16px 14px 24px; } .shell { --bar-h: 68px; }
  .brand span { display: none; }
}

svg:not([width]) { width: 18px; height: 18px; flex: none; }
.brand svg { width: 26px; height: 26px; }
.inst-select { width: auto; min-width: 200px; max-width: 320px; margin-right: 6px; }
.col-check { width: 44px; }
@media (max-width: 860px) { .inst-select { min-width: 0; flex: 1; width: 100%; } .top .spacer { display: none; } .top { gap: 4px; } .top { padding: 0 10px; } }

.table td.num:first-child { width: 56px; }

.hint { font-size: 12px; color: var(--faint); }

/* ---- 0.4: instance picker, power, search, player toggles --------------------------------- */
.picker { min-width: 190px; max-width: 280px; justify-content: space-between; gap: 8px; }
.picker .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--faint); flex: none; }
.picker .dot.running { background: var(--accent); } .picker .dot.starting { background: var(--warn); } .picker .dot.crashed { background: var(--danger); }
.btn.power { background: var(--danger); border-color: transparent; color: #1a0606; }
.btn.power.is-off { background: var(--accent); color: var(--accent-ink); }
.btn.power:disabled { opacity: .45; }
.gsearch { flex: 1 1 200px; width: auto; max-width: 460px; min-height: 34px; margin-left: 10px; }
.transport .btns .btn.on { color: var(--accent); background: var(--accent-soft); }
th.sortable { cursor: pointer; user-select: none; } th.sortable:hover { color: var(--text); }
.src-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.list-scroll { max-height: 420px; overflow: auto; }
@media (max-width: 1100px) { .gsearch { flex-basis: 120px; } }
@media (max-width: 860px) { .picker { min-width: 0; flex: 1; } .gsearch { display: none; } }
.btn.power { flex: none; width: 36px; height: 36px; min-height: 36px; }
.table th.num { text-align: right; }
.table th.sortable i { font-style: normal; color: var(--accent); }
.picker .trunc { min-width: 0; flex: 1; text-align: left; }
@media (max-width: 860px) { .picker { min-width: 110px; } .top > .btn.ghost:not(.icon) { display: none; } .tab { padding: 8px 9px; } }
.about { max-width: 760px; } .about p { margin: 0; } .about ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.table tr.dragging { opacity: .45; }
.table tr.over td { background: var(--accent-soft); }
.crumbs a.over { color: var(--accent); background: var(--accent-soft); border-radius: 4px; }
.folder-row td { cursor: pointer; } .folder-row:hover td { background: var(--panel-2); }
.table .actions.always .btn { opacity: 1; }

.fmt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.fmt-col { min-width: 0; } .fmt-col h3 { margin: 0 0 8px; }
.fmt-list { display: flex; flex-direction: column; gap: 3px; font-size: 13px; }
@media (max-width: 720px) { .fmt-grid { grid-template-columns: 1fr; } }
.about hr { border: 0; border-top: 1px solid var(--line); width: 100%; margin: 0; }
.about .banner { background: #e8791a; color: #fff; padding: 12px 14px; border-radius: var(--radius-sm); font-weight: 600; }
.plain-link { color: var(--accent); text-decoration: none; } .plain-link:hover { text-decoration: underline; }
pre.license { margin: 0; padding: 12px; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: 12px; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--muted); }

/* ---- theme picker ------------------------------------------------------------ */
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 10px; }
.swatch { display: flex; flex-direction: column; gap: 8px; padding: 8px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--panel-2); color: var(--text); cursor: pointer; text-align: left; transition: border-color .12s; }
.swatch:hover { border-color: var(--line-hi); }
.swatch[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.swatch-prev { position: relative; display: block; height: 52px; border-radius: var(--radius-sm); background: var(--bg); border: 1px solid var(--line); overflow: hidden; }
.sw-panel { position: absolute; left: 0; top: 0; bottom: 0; width: 34%; background: var(--panel); border-right: 1px solid var(--line); }
.sw-accent { position: absolute; right: 10px; bottom: 10px; width: 26px; height: 10px; border-radius: 5px; background: var(--accent); }
.swatch-name { font-size: 13px; font-weight: 600; }
.card.span-all { grid-column: 1 / -1; }

/* ---- accounts matrix --------------------------------------------------------- */
.page.wide { max-width: none; }
.utable-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.utable { min-width: 1260px; }
.urow { display: grid; grid-template-columns: 220px 140px repeat(7, 44px) 12px repeat(8, 44px) 132px; column-gap: 4px; align-items: center; padding: 6px 12px; }
.urow.head { padding-top: 14px; padding-bottom: 0; }
.urow.head2 { align-items: start; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.grp { grid-row: 1; text-align: center; font-size: 11px; letter-spacing: .12em; font-weight: 700; color: var(--muted); border-bottom: 1px solid var(--line-hi); padding-bottom: 6px; }
.grp.b { grid-column: 3 / span 7; } .grp.g { grid-column: 11 / span 8; }
.pcol { display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--text); }
.pcol svg { width: 20px; height: 20px; }
.pcol span { font-size: 10.5px; line-height: 1.15; text-align: center; color: var(--muted); }
.ucard { border-bottom: 1px solid var(--line); } .ucard:last-child { border-bottom: 0; } .ucard.dim { opacity: .7; }
.uname { display: flex; align-items: center; gap: 8px; min-width: 0; }
.uname.sub { grid-column: 1 / span 2; padding-left: 48px; gap: 10px; color: var(--text); }
.uname.sub svg { width: 20px; height: 20px; flex: none; color: var(--accent); }
.uname .t { display: flex; flex-direction: column; min-width: 0; } .uname .t span { font-size: 11.5px; color: var(--muted); }
.avatar { flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--raise); color: var(--accent); display: grid; place-items: center; font-weight: 700; }
.chevbtn { flex: none; width: 36px; height: 36px; border-radius: 8px; border: 0; background: transparent; color: var(--muted); display: grid; place-items: center; cursor: pointer; }
.chevbtn svg { width: 18px; height: 18px; transition: transform .15s; } .chevbtn[aria-expanded="true"] svg { transform: rotate(90deg); }
.urow select { width: 132px; min-height: 36px; }
.pcell { width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; padding: 0; cursor: pointer; border: 1px solid var(--line-hi); background: var(--bg); color: var(--faint); transition: filter .12s; }
.pcell svg { width: 20px; height: 20px; }
.pcell.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.pcell.mix { background: var(--accent-soft); border: 1px dashed var(--accent); color: var(--accent); }
.pcell:hover:not(:disabled) { filter: brightness(1.2); } .pcell:disabled { cursor: default; opacity: .75; }
.ubots { background: var(--row-hover); border-top: 1px solid var(--line-soft); padding: 4px 0 8px; }
.uacts { display: flex; gap: 2px; justify-content: flex-end; }
.ulegend { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; margin-top: 14px; font-size: 13px; color: var(--muted); }
.ulegend span { display: flex; align-items: center; gap: 8px; }
.sw { display: inline-block; width: 22px; height: 22px; border-radius: 6px; border: 1px solid var(--line-hi); background: var(--bg); }
.sw.on { background: var(--accent); border-color: var(--accent); } .sw.mix { background: var(--accent-soft); border: 1px dashed var(--accent); }
.page-head .usearch { width: 240px; margin-left: auto; }
.role-owner { display: inline-flex; align-items: center; gap: 7px; justify-self: start; color: var(--accent); font-size: 13.5px; font-weight: 650; }
.role-owner svg { width: 17px; height: 17px; }
.picker .plat { display: grid; place-items: center; flex: none; color: var(--accent); } .picker .plat svg { width: 18px; height: 18px; }

/* chat access: Discord roles → grade, account link code */
.grades { display: flex; flex-direction: column; max-height: 440px; overflow: auto; }
.grade-row { display: flex; flex-direction: column; gap: 4px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
.grade-row > span { font-size: 13px; font-weight: 600; }
.grade-row select { width: 100%; }
.linkcode { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border: 1px dashed var(--line-hi); border-radius: 10px; background: var(--panel-2); }
.mono.big { font-size: 26px; font-weight: 700; letter-spacing: .22em; color: var(--accent); }
.note.ok { border-color: var(--accent); color: var(--accent); }

/* instance settings: two even columns, one save bar for the whole page */
.settings-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 16px; align-items: start; margin-top: 16px; }
.stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.savebar { position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 16px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); box-shadow: 0 -8px 24px var(--scrim); }
.savebar .error-text { margin: 0; }
.savebar .muted { margin-right: auto; }
@media (max-width: 600px) { .settings-cols, .two { grid-template-columns: minmax(0, 1fr); } }
.mono.key { font-size: 18px; font-weight: 650; letter-spacing: .08em; color: var(--accent); word-break: break-all; }
.backup-codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 12px 14px; border: 1px dashed var(--line-hi); border-radius: 10px; background: var(--panel-2); font-size: 15px; letter-spacing: .05em; }
.helpbox { font-size: 13px; color: var(--muted); display: flex; flex-direction: column; gap: 10px; }
.helpbox b { color: var(--text); }
.helpbox .hs { display: flex; flex-direction: column; gap: 12px; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.helpbox .hs:first-of-type { padding-top: 0; border-top: 0; }
.helpbox .hs h3 { margin: 0; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.helpbox .hi { display: grid; grid-template-columns: 30px 1fr; gap: 12px; align-items: start; }
.helpbox .hi p { margin: 2px 0 0; line-height: 1.45; }
.helpbox .hi-ic { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); }
.helpbox .hi-ic svg { width: 16px; height: 16px; }
.preview { padding: 10px 12px; border-radius: 8px; background: var(--panel-2); border: 1px solid var(--line); font-size: 13.5px; overflow-wrap: anywhere; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chip { padding: 3px 9px; border-radius: 99px; border: 1px solid var(--line-hi); background: var(--panel-2); color: var(--muted); font: 12px var(--mono, monospace); cursor: pointer; }
.chip:hover:not(:disabled) { color: var(--accent); border-color: var(--accent); }

/* soundboard */
.sb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.sound { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 14px; min-height: 92px; text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); color: var(--text); cursor: pointer; transition: border-color .15s, background .15s, transform .08s; }
.sound svg { width: 20px; height: 20px; color: var(--accent); }
.sound span { max-width: 100%; font-weight: 600; }
.sound small { color: var(--faint); margin-top: auto; }
.sound:hover { border-color: var(--accent); background: var(--accent-soft); }
.sound:active { transform: scale(.97); }

/* source picker dialog */
.pick-list { display: flex; flex-direction: column; gap: 4px; width: 100%; min-width: 0; max-height: 320px; overflow-x: hidden; overflow-y: auto; }
dialog:has(.pick-list) { width: min(560px, calc(100vw - 32px)); }
.pick-hint { padding: 10px 4px; }
.pick-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; text-align: left; background: transparent; border: 1px solid transparent; border-radius: var(--radius-sm, 8px); color: var(--text); cursor: pointer; }
.pick-row svg { width: 18px; height: 18px; color: var(--accent); flex: none; }
.pick-row .t { display: flex; flex-direction: column; min-width: 0; }
.pick-row:hover, .pick-row:focus-visible { background: var(--accent-soft); border-color: var(--line); }

/* status badges (instance header) */
:root { --good: #34d399; }
.stat { --fg: var(--muted); --bg: var(--panel-2); --ln: var(--line); display: inline-flex; align-items: center; gap: 9px; min-height: 36px; padding: 0 14px; border-radius: var(--radius-sm); border: 1px solid var(--ln); background: var(--bg); color: var(--fg); font-size: 13px; font-weight: 600; white-space: nowrap; }
.stat::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.stat.plain::before { opacity: .5; }
.stat.good { --fg: var(--good); --bg: color-mix(in srgb, var(--good) 11%, transparent); --ln: color-mix(in srgb, var(--good) 34%, transparent); }
.stat.accent { --fg: var(--accent); --bg: var(--accent-soft); --ln: color-mix(in srgb, var(--accent) 34%, transparent); }
.stat.warn { --fg: var(--warn); --bg: color-mix(in srgb, var(--warn) 11%, transparent); --ln: color-mix(in srgb, var(--warn) 34%, transparent); }
.stat.bad { --fg: var(--danger); --bg: color-mix(in srgb, var(--danger) 11%, transparent); --ln: color-mix(in srgb, var(--danger) 34%, transparent); }
.stat.live::before { animation: stat-pulse 2s ease-out infinite; }
@keyframes stat-pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 55%, transparent); } 70%, 100% { box-shadow: 0 0 0 7px transparent; } }
@media (prefers-reduced-motion: reduce) { .stat.live::before { animation: none; } }

/* instance cards */
.inst { gap: 16px; }
.inst-head { display: flex; align-items: center; gap: 12px; }
.inst-ic { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); color: var(--text); }
.inst-ic svg { width: 20px; height: 20px; }
.inst-title { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.inst-title h2 { margin: 0; font-size: 16px; }
.inst-title .muted { font-size: 12px; }
.inst-status { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.inst-np { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1 1 140px; color: var(--text); }
.inst-np svg { width: 16px; height: 16px; color: var(--accent); flex: none; }
.inst .stat { min-height: 30px; padding: 0 11px; font-size: 12px; }
.inst-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.inst-grid .span-all { grid-column: 1 / -1; }
.inst-actions { display: flex; align-items: center; gap: 8px; margin-top: auto; }
.inst-actions .btn:first-child, .inst-actions .btn.primary { flex: 1; }
@media (max-width: 1400px) { .inst-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1050px) { .inst-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .inst-grid { grid-template-columns: minmax(0, 1fr); } }

/* repeat button: the badge says which track repeat is on */
.progress > span:first-child, .progress > span:last-child { line-height: 1; position: relative; top: -1px; } /* line-height 1: the numbers and LIVE sit on the same axis as the bar */
.transport .btns .btn.once svg { opacity: .55; } /* "once more" is dimmer than "for ever" */
.live-tag::before { position: relative; top: 1px; } /* the labels are lifted 1 px for their digits; the dot goes back onto the bar axis */
