/* =========================================================
   Tona Voice — design tokens
   Calm neutral surfaces, one confident blue.
   4px spacing grid · 1px borders for structure · shadows only
   for things that float (player, menus, dialogs).
   ========================================================= */
:root {
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  --mono: "JetBrains Mono", "SF Mono", "Cascadia Mono", Consolas, monospace;
  --r-sm: 6px;
  --r: 8px;
  --r-lg: 12px;
  --r-xl: 16px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --ok: #12a150;
  --warn: #d97706;
  --bad: #dc2626;
}

[data-theme="light"] {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --surface-2: #f3f5f8;
  --surface-3: #eceff4;
  --hover: #f3f5f8;
  --border: #e6e9ef;
  --border-2: #d6dbe4;
  --text: #0d1321;
  --text-2: #4a5468;
  --text-3: #8a93a6;
  --blue: #2563eb;
  --blue-h: #1d4ed8;
  --blue-ink: #1d4ed8;
  --blue-50: #eff5ff;
  --blue-100: #dbe7fe;
  --blue-200: #bfd4fd;
  --blue-300: #93b4fb;
  --mark: #fde68a;
  --mark-cur: #f59e0b;
  --float: 0 1px 2px rgba(13, 19, 33, .04), 0 8px 24px -6px rgba(13, 19, 33, .10), 0 0 0 1px rgba(13, 19, 33, .05);
  --pop: 0 12px 32px -8px rgba(13, 19, 33, .18), 0 0 0 1px rgba(13, 19, 33, .06);
}

[data-theme="dark"] {
  --bg: #0b0e14;
  --surface: #12161e;
  --surface-2: #181d27;
  --surface-3: #1f2531;
  --hover: #1a1f2a;
  --border: #222936;
  --border-2: #2e3646;
  --text: #e8ecf3;
  --text-2: #a9b2c3;
  --text-3: #6d7689;
  --blue: #4b83ff;
  --blue-h: #6b98ff;
  --blue-ink: #8fb0ff;
  --blue-50: rgba(75, 131, 255, .10);
  --blue-100: rgba(75, 131, 255, .18);
  --blue-200: rgba(75, 131, 255, .30);
  --blue-300: rgba(75, 131, 255, .55);
  --mark: rgba(245, 158, 11, .28);
  --mark-cur: #f59e0b;
  --float: 0 0 0 1px var(--border), 0 12px 32px -8px rgba(0, 0, 0, .6);
  --pop: 0 0 0 1px var(--border-2), 0 16px 40px -10px rgba(0, 0, 0, .7);
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; display: flex; flex-direction: column; font-family: var(--font); font-size: 14px; line-height: 1.5;
  color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  overflow: hidden; font-feature-settings: "cv11", "ss01";
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--blue-200); }
.hidden { display: none !important; }
* { scrollbar-width: thin; scrollbar-color: var(--border-2) transparent; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 4px; }
.i { display: inline-flex; width: 16px; height: 16px; flex: none; }
.i svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.i.sm { width: 14px; height: 14px; }
kbd { font-family: var(--mono); font-size: 11px; line-height: 1; padding: 3px 5px; border-radius: 4px; color: var(--text-3); background: var(--surface-2); border: 1px solid var(--border); }

/* ---------- top navigation ---------- */
.topnav {
  position: relative; z-index: 20; flex: none; height: 56px; display: flex; align-items: center; gap: 32px; padding: 0 24px;
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.logo { display: flex; align-items: center; gap: 9px; }
.logo-mark { width: 28px; height: 28px; flex: none; }
.logo-mark rect { fill: var(--blue); }
.logo-mark path { fill: none; stroke: #fff; stroke-width: 2.8; stroke-linecap: round; stroke-linejoin: round; }
.logo-word { font-size: 16px; font-weight: 400; letter-spacing: -.01em; color: var(--text-2); white-space: nowrap; }
.logo-word b { font-weight: 700; color: var(--text); }
.nav { display: flex; align-self: stretch; }
.nav a { display: flex; align-items: center; font-size: 13.5px; font-weight: 500; color: var(--text-2); box-shadow: inset 0 -2px 0 transparent; transition: color .15s, box-shadow .15s; }
.nav a:hover { color: var(--text); }
.nav a.on { color: var(--text); box-shadow: inset 0 -2px 0 var(--blue); }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.nav-right .btn { margin-left: 8px; }
.engine-note { font-size: 12.5px; color: var(--text-3); margin-right: 8px; }
.engine-note.bad { color: var(--bad); }

/* ---------- controls ---------- */
.icon-btn { width: 32px; height: 32px; display: inline-grid; place-items: center; border-radius: var(--r-sm); color: var(--text-2); transition: background .15s, color .15s; }
.icon-btn:hover { background: var(--hover); color: var(--text); }
.icon-btn.bordered { border: 1px solid var(--border-2); background: var(--surface); }
.icon-btn.xs { width: 24px; height: 24px; border-radius: 5px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 14px;
  font-size: 13.5px; font-weight: 500; white-space: nowrap; border-radius: var(--r);
  color: var(--text); background: var(--surface); box-shadow: inset 0 0 0 1px var(--border-2), 0 1px 1px rgba(13, 19, 33, .04);
  transition: background .15s, box-shadow .15s, transform .08s;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(.5px); }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn .i { width: 15px; height: 15px; color: var(--text-2); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 13px; }
.btn.primary { background: var(--blue); color: #fff; box-shadow: 0 1px 2px rgba(37, 99, 235, .3), inset 0 1px 0 rgba(255, 255, 255, .12); }
.btn.primary .i { color: #fff; }
.btn.primary:hover { background: var(--blue-h); }
.btn.danger-solid { background: var(--bad); color: #fff; box-shadow: none; }
.link-btn { font-size: 13px; font-weight: 500; color: var(--blue-ink); transition: color .15s; }
.link-btn:hover { color: var(--blue-h); text-decoration: underline; text-underline-offset: 3px; }
.link-btn.danger { color: var(--bad); }
.link-btn.muted { color: var(--text-3); }
.link-btn.muted:hover { color: var(--text); }

.search {
  display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 8px 0 10px; border-radius: var(--r);
  background: var(--surface); box-shadow: inset 0 0 0 1px var(--border-2); color: var(--text-3); transition: box-shadow .15s;
}
.search:focus-within { box-shadow: inset 0 0 0 1px var(--blue), 0 0 0 3px var(--blue-100); }
.search input { border: 0; outline: 0; background: none; font-size: 13.5px; color: var(--text); width: 210px; }
.search input::placeholder { color: var(--text-3); }
.search.sm { height: 30px; }
.search.sm input { width: 130px; font-size: 13px; }
.t-count { font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }

.seg-filter { display: inline-flex; padding: 3px; border-radius: var(--r); background: var(--surface-3); }
.seg-filter button { height: 28px; padding: 0 12px; border-radius: 6px; font-size: 13px; font-weight: 500; color: var(--text-2); transition: all .15s; }
.seg-filter button:hover { color: var(--text); }
.seg-filter button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(13, 19, 33, .08), 0 0 0 1px var(--border); }

.select-wrap { position: relative; }
.select-wrap::after { content: ""; position: absolute; right: 12px; top: 50%; width: 6px; height: 6px; border-right: 1.5px solid var(--text-3); border-bottom: 1.5px solid var(--text-3); transform: translateY(-70%) rotate(45deg); pointer-events: none; }
.select-wrap select { appearance: none; width: 100%; height: 34px; padding: 0 32px 0 11px; border: 0; border-radius: var(--r); background: var(--surface); box-shadow: inset 0 0 0 1px var(--border-2); font-size: 13.5px; outline: none; cursor: pointer; }
.select-wrap select:focus { box-shadow: inset 0 0 0 1px var(--blue), 0 0 0 3px var(--blue-100); }
.select-wrap.compact select { height: 30px; font-size: 12.5px; padding: 0 26px 0 10px; }
.select-wrap.compact::after { right: 10px; }

.toggle { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); cursor: pointer; white-space: nowrap; user-select: none; }
.toggle input { display: none; }
.toggle span { position: relative; width: 28px; height: 16px; border-radius: 16px; background: var(--border-2); transition: background .15s; }
.toggle span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: #fff; transition: transform .15s var(--ease); box-shadow: 0 1px 2px rgba(0, 0, 0, .2); }
.toggle input:checked + span { background: var(--blue); }
.toggle input:checked + span::after { transform: translateX(12px); }

/* ---------- views ---------- */
.view { flex: 1; min-height: 0; }

/* ---------- library ---------- */
.view-home { overflow-y: auto; padding: 0 0 56px; }
.lib-head { position: relative; overflow: hidden; background: var(--surface); border-bottom: 1px solid var(--border); }
.lib-head canvas { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 150px; pointer-events: none; }
.lib-head-in { position: relative; max-width: 1200px; margin: 0 auto; padding: 44px 32px 118px; display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.lib-head h1 { margin: 0; font-size: 28px; line-height: 1.2; font-weight: 650; letter-spacing: -.02em; }
.lib-stats { margin: 8px 0 0; font-size: 13.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.list-tools { display: flex; align-items: center; gap: 12px; }

.grid { max-width: 1200px; margin: 0 auto; padding: 24px 32px 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.card {
  position: relative; display: flex; flex-direction: column; min-height: 200px; padding: 18px 18px 14px; border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--border); transition: border-color .15s, box-shadow .2s, transform .2s var(--ease);
}
a.card:hover { border-color: var(--border-2); box-shadow: 0 10px 28px -14px rgba(13, 19, 33, .22); transform: translateY(-1px); }
.jc-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 22px; margin-bottom: 10px; }
.jc-dur { font-size: 12.5px; font-weight: 500; color: var(--text-3); font-variant-numeric: tabular-nums; }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 12px; font-weight: 500; font-variant-numeric: tabular-nums; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.running, .pill.correcting, .pill.uploading { color: var(--blue-ink); background: var(--blue-50); }
.pill.queued, .pill.pending { color: var(--warn); background: rgba(217, 119, 6, .09); }
.pill.failed, .pill.error { color: var(--bad); background: rgba(220, 38, 38, .08); }
.pill.cancelled { color: var(--text-3); background: var(--surface-2); }
.jc-del { opacity: 0; transition: opacity .15s; }
.card:hover .jc-del, .jc-del:focus-visible { opacity: 1; }
.card h3 { margin: 0; font-size: 15.5px; font-weight: 600; line-height: 1.4; letter-spacing: -.005em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jc-preview { margin: 6px 0 0; font-size: 13px; line-height: 1.65; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em; }
.jc-preview.dim { color: var(--text-3); }
.jc-wave { display: flex; align-items: center; gap: 2px; height: 36px; margin: auto 0 0; padding-top: 14px; }
.jc-wave i { flex: 1; min-width: 1px; border-radius: 2px; background: var(--blue-300); transition: background .2s; }
.jc-wave i.on { background: var(--blue); }
.jc-wave i.off { background: var(--surface-3); }
a.card:hover .jc-wave i:not(.off) { background: var(--blue); }
.jc-foot { display: flex; justify-content: space-between; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.jc-bar { height: 4px; border-radius: 4px; background: var(--surface-3); overflow: hidden; margin-top: auto; }
.jc-bar i { display: block; height: 100%; background: var(--blue); transition: width .3s; }

.upload-tile {
  align-items: center; justify-content: center; text-align: center; gap: 4px; cursor: pointer;
  border: 1.5px dashed var(--border-2); background: transparent; transition: border-color .15s, background .15s;
}
.upload-tile:hover, .upload-tile:focus-visible { border-color: var(--blue); background: var(--blue-50); }
.ut-icon { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; margin-bottom: 10px; color: var(--blue); background: var(--blue-50); transition: background .15s, color .15s; }
.upload-tile:hover .ut-icon { background: var(--blue); color: #fff; }
.ut-icon .i { width: 20px; height: 20px; }
.upload-tile b { font-size: 14.5px; font-weight: 600; }
.upload-tile small { font-size: 12.5px; color: var(--text-3); line-height: 1.6; }
.grid.empty .upload-tile { grid-column: 1 / -1; min-height: 260px; }
.no-match { grid-column: 1 / -1; padding: 40px 0; text-align: center; color: var(--text-3); }

.drop-overlay { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; background: rgba(247, 248, 250, .82); backdrop-filter: blur(4px); }
[data-theme="dark"] .drop-overlay { background: rgba(11, 14, 20, .82); }
.drop-panel { width: min(520px, 90vw); padding-bottom: 28px; border: 1.5px dashed var(--blue); border-radius: var(--r-xl); background: var(--surface); text-align: center; overflow: hidden; box-shadow: var(--pop); }
.drop-panel canvas { display: block; width: 100%; height: 140px; }
.drop-panel p { margin: 0; font-size: 16px; font-weight: 600; }
.drop-panel small { display: block; margin-top: 4px; color: var(--text-3); }

/* ---------- job ---------- */
.view-job { display: flex; flex-direction: column; }
.job-main { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 0; max-width: 1480px; width: 100%; margin: 0 auto; }
.doc-col { min-height: 0; display: flex; flex-direction: column; }
.doc-head { flex: none; padding: 20px 40px 0; }
.back { display: inline-flex; align-items: center; gap: 2px; font-size: 13px; font-weight: 500; color: var(--text-3); margin-left: -3px; transition: color .15s; }
.back:hover { color: var(--text); }
.job-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 10px; }
.job-title {
  flex: 1; min-width: 0; border: 0; outline: 0; background: none; padding: 2px 8px; margin-left: -8px; border-radius: var(--r-sm);
  font-size: 26px; font-weight: 650; letter-spacing: -.02em; text-overflow: ellipsis; transition: background .15s, box-shadow .15s;
}
.job-title:hover { background: var(--surface-2); }
.job-title:focus { background: var(--surface); box-shadow: inset 0 0 0 1px var(--blue), 0 0 0 3px var(--blue-100); }
.job-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 6px; font-size: 12.5px; color: var(--text-2); background: var(--surface-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.chip.blue { color: var(--blue-ink); background: var(--blue-50); }

.notice { flex: none; margin: 16px 40px 0; padding: 12px 14px; border-radius: var(--r); background: var(--blue-50); color: var(--blue-ink); font-size: 13px; font-variant-numeric: tabular-nums; }
.notice.bad { background: rgba(220, 38, 38, .07); color: var(--bad); }
.notice-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.status-bar { height: 4px; margin-top: 10px; border-radius: 4px; background: var(--blue-100); overflow: hidden; }
.status-bar i { display: block; height: 100%; width: 0; border-radius: 4px; background: var(--blue); transition: width .8s var(--ease); }
.status-bar.indeterminate i { width: 25% !important; animation: indet 1.4s ease-in-out infinite; }
@keyframes indet { from { margin-left: -25%; } to { margin-left: 100%; } }

.menu-wrap { position: relative; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 180px; padding: 4px; border-radius: 10px; background: var(--surface); box-shadow: var(--pop); opacity: 0; transform: translateY(-4px); pointer-events: none; transition: opacity .12s, transform .12s var(--ease); }
.menu.open { opacity: 1; transform: none; pointer-events: auto; }
.menu button { width: 100%; display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 6px; font-size: 13.5px; text-align: left; white-space: nowrap; }
.menu button:hover { background: var(--hover); }
.menu button em { margin-left: auto; font-style: normal; font-family: var(--mono); font-size: 11.5px; color: var(--text-3); }
.menu button.danger { color: var(--bad); }
.menu button:disabled { opacity: .4; pointer-events: none; }

.doc-tools { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 20px 40px 0; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.corr-note { min-width: 0; flex: 1; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--text-3); }
.corr-note .lead { display: inline-flex; align-items: center; gap: 7px; color: var(--text-2); font-weight: 500; }
.corr-note .lead::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); }
.corr-note .lead.done::before { background: var(--ok); }
.corr-note .lead.busy::before { background: var(--blue); animation: pulse 1.2s ease-in-out infinite; }
.corr-note .lead.bad { color: var(--bad); }
.corr-note .lead.bad::before { background: var(--bad); }
@keyframes pulse { 50% { opacity: .3; } }
.video-box { flex: none; margin: 16px 40px 0; background: #000; display: flex; justify-content: center; border-radius: var(--r-lg); overflow: hidden; }
.video-box video { max-width: 100%; max-height: 300px; display: block; }

.segments { position: relative; flex: 1; overflow-y: auto; padding: 8px 40px 40px; scroll-behavior: smooth; }
.para { display: grid; grid-template-columns: 76px minmax(0, 720px); gap: 12px; padding: 14px 0 6px; }
.p-time { align-self: start; justify-self: start; margin-top: 4px; padding: 2px 6px; margin-left: -6px; border-radius: 5px; font-size: 12px; font-weight: 500; color: var(--text-3); font-variant-numeric: tabular-nums; transition: color .15s, background .15s; }
.p-time:hover { color: var(--blue-ink); background: var(--blue-50); }
.para.active .p-time { color: var(--blue-ink); }
.para p { margin: 0; font-size: 15.5px; line-height: 1.95; color: var(--text); letter-spacing: .01em; }
.s { cursor: pointer; border-radius: 4px; padding: 2px 0; transition: background .15s, color .15s; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.s:hover { background: var(--surface-3); }
.s.active { background: var(--blue-100); color: var(--blue-ink); }
.s .fix { background: var(--blue-50); box-shadow: inset 0 -1.5px 0 var(--blue); border-radius: 2px; }
.s .fix-old { color: var(--bad); text-decoration: line-through; text-decoration-thickness: 1.5px; }
.s mark { background: var(--mark); color: inherit; border-radius: 2px; }
.s mark.cur { background: var(--mark-cur); color: #111; }
.seg-empty { padding: 56px 0; color: var(--text-3); }
.skeleton { padding: 14px 0; display: flex; flex-direction: column; gap: 22px; }
.sk-row { display: grid; grid-template-columns: 76px 1fr; gap: 12px; }
.sk-lines { display: flex; flex-direction: column; gap: 10px; }
.sk { height: 11px; border-radius: 6px; background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: sk 1.4s linear infinite; }
@keyframes sk { to { background-position: -200% 0; } }

/* side panel */
.side { min-height: 0; padding: 20px 24px 16px 0; display: flex; }
.side-card { flex: 1; min-height: 0; display: flex; flex-direction: column; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--border); overflow: hidden; }
.tabs { flex: none; display: flex; gap: 2px; margin: 12px 12px 0; padding: 3px; border-radius: var(--r); background: var(--surface-2); overflow-x: auto; scrollbar-width: none; }
.tabs button { flex: 1; height: 30px; padding: 0 10px; border-radius: 6px; font-size: 13px; font-weight: 500; color: var(--text-2); white-space: nowrap; transition: all .15s; }
.tabs button:hover { color: var(--text); }
.tabs button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(13, 19, 33, .08), 0 0 0 1px var(--border); }
.ins-body { flex: 1; overflow-y: auto; padding: 18px 20px 24px; }
.ins-empty { padding: 4px 0; }
.ins-empty h4 { margin: 0 0 6px; font-size: 15px; font-weight: 600; }
.ins-empty p { margin: 0 0 16px; color: var(--text-2); font-size: 13.5px; line-height: 1.7; }
.ins-empty .row-btns { display: flex; gap: 8px; align-items: center; }
.ins-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--border); font-size: 12.5px; color: var(--text-3); }
.ins-meta .warn { color: var(--warn); }
.ins-meta .grp { display: flex; gap: 14px; align-items: center; }
.pending { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-3); margin-bottom: 12px; }
.pending::before { content: ""; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--blue-100); border-top-color: var(--blue); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.ai-err { padding: 10px 12px; border-radius: var(--r); font-size: 13px; color: var(--bad); background: rgba(220, 38, 38, .07); margin-bottom: 12px; word-break: break-word; }

.md { font-size: 14px; line-height: 1.8; color: var(--text); word-wrap: break-word; }
.md > :first-child { margin-top: 0; }
.md h1, .md h2, .md h3, .md h4 { font-size: 14.5px; font-weight: 650; margin: 1.4em 0 .35em; line-height: 1.5; }
.md p { margin: .45em 0; color: var(--text-2); }
.md ul, .md ol { margin: .4em 0; padding-left: 1.3em; color: var(--text-2); }
.md li { margin: .3em 0; }
.md li::marker { color: var(--text-3); }
.md li.task { list-style: none; margin-left: -1.3em; display: flex; gap: 8px; }
.md li.task input { margin-top: .5em; accent-color: var(--blue); }
.md strong { font-weight: 600; color: var(--text); }
.md blockquote { margin: .8em 0; padding: 2px 12px; border-left: 2px solid var(--border-2); color: var(--text-2); }
.md hr { border: 0; border-top: 1px solid var(--border); margin: 1.2em 0; }
.md pre { padding: 10px 12px; border-radius: var(--r); background: var(--surface-2); overflow-x: auto; font-size: 12.5px; }
.md code { font-family: var(--mono); font-size: .88em; padding: 1px 4px; border-radius: 4px; background: var(--surface-2); }
.md pre code { padding: 0; background: none; }
.md table { border-collapse: collapse; width: 100%; margin: .8em 0; font-size: 13px; }
.md th, .md td { border: 1px solid var(--border); padding: 6px 9px; text-align: left; }
.md th { background: var(--surface-2); font-weight: 600; }
.ts-link { display: inline-flex; align-items: center; height: 20px; padding: 0 6px; margin: 0 2px; border-radius: 5px; vertical-align: 1px; font-size: 11.5px; font-weight: 500; color: var(--blue-ink); background: var(--blue-50); font-variant-numeric: tabular-nums; transition: background .15s, color .15s; }
.ts-link:hover { background: var(--blue); color: #fff; }
.caret::after { content: ""; display: inline-block; width: 2px; height: 1em; margin-left: 2px; vertical-align: -2px; background: var(--blue); animation: caret 1s steps(2) infinite; }
@keyframes caret { 50% { opacity: 0; } }

.qa-item { padding: 16px 0; border-bottom: 1px solid var(--border); }
.qa-item:first-of-type { padding-top: 0; }
.qa-item:last-child { border-bottom: 0; }
.qa-q { display: inline-block; margin: 0 0 10px; padding: 7px 12px; border-radius: 10px 10px 10px 3px; background: var(--surface-3); font-weight: 500; line-height: 1.55; }
.qa-time { margin-top: 6px; font-size: 12px; color: var(--text-3); }
.suggest { display: flex; flex-direction: column; gap: 8px; }
.suggest button { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border-radius: var(--r); font-size: 13.5px; text-align: left; color: var(--text); background: var(--surface-2); transition: background .15s; }
.suggest button::after { content: "↗"; color: var(--text-3); }
.suggest button:hover { background: var(--blue-50); color: var(--blue-ink); }
.suggest button:hover::after { color: var(--blue); }
.qa-bar { flex: none; display: flex; align-items: flex-end; gap: 8px; margin: 0 12px 12px; padding: 6px 6px 6px 12px; border-radius: 10px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--border-2); transition: box-shadow .15s; }
.qa-bar:focus-within { box-shadow: inset 0 0 0 1px var(--blue), 0 0 0 3px var(--blue-100); }
.qa-bar textarea { flex: 1; min-height: 30px; max-height: 140px; padding: 5px 0; border: 0; background: none; outline: none; resize: none; font-size: 13.5px; line-height: 1.5; }
.send-btn { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: 7px; background: var(--blue); color: #fff; transition: background .15s; }
.send-btn:hover { background: var(--blue-h); }
.send-btn .i { width: 15px; height: 15px; }

/* ---------- floating player ---------- */
.player {
  flex: none; position: relative; margin: 0 24px 16px; border-radius: var(--r-xl); background: var(--surface); box-shadow: var(--float); overflow: hidden;
  max-width: 1432px; width: calc(100% - 48px); align-self: center;
}
.player-wave { display: block; width: 100%; height: 78px; cursor: pointer; }
.player-row { display: flex; align-items: center; gap: 16px; padding: 0 20px 14px; }
.play-btn { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--blue); color: #fff; box-shadow: 0 2px 6px -1px rgba(37, 99, 235, .45); transition: background .15s, transform .1s; }
.play-btn:hover { background: var(--blue-h); }
.play-btn:active { transform: scale(.96); }
.play-btn .i { width: 15px; height: 15px; }
.play-btn .i svg { fill: currentColor; stroke: none; }
.player-time { flex: none; display: flex; gap: 5px; font-size: 13px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.player-time b { font-weight: 600; color: var(--text); }
.timeline { position: relative; flex: 1; min-width: 0; height: 34px; cursor: pointer; }
.timeline canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.tl-hover { position: absolute; bottom: calc(100% + 6px); transform: translateX(-50%); padding: 2px 7px; border-radius: 5px; font-size: 12px; font-weight: 500; font-variant-numeric: tabular-nums; background: var(--text); color: var(--surface); opacity: 0; pointer-events: none; white-space: nowrap; transition: opacity .12s; }
.timeline:hover .tl-hover { opacity: 1; }

/* ---------- modal / forms ---------- */
.modal { width: min(540px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0; border: 0; border-radius: var(--r-xl); background: var(--surface); color: var(--text); box-shadow: var(--pop); }
.modal.small { width: min(400px, calc(100vw - 32px)); }
.modal[open] { animation: modalIn .2s var(--ease); }
.modal::backdrop { background: rgba(13, 19, 33, .32); backdrop-filter: blur(2px); }
@keyframes modalIn { from { opacity: 0; transform: translateY(6px) scale(.985); } }
.modal-inner { display: flex; flex-direction: column; max-height: calc(100vh - 48px); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 6px 24px; }
.modal-head h2 { margin: 0; font-size: 17px; font-weight: 650; letter-spacing: -.01em; }
.modal-body { padding: 12px 24px 4px; overflow-y: auto; }
.modal-foot { display: flex; align-items: center; gap: 8px; padding: 16px 24px 20px; }
.foot-note { font-size: 12.5px; color: var(--text-3); }
.spacer { flex: 1; }
.sec { margin: 0 0 4px; font-size: 14px; font-weight: 600; }
.hint { margin: 0 0 16px; font-size: 12.5px; color: var(--text-3); line-height: 1.6; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; min-width: 0; }
.field > span { font-size: 13px; font-weight: 500; color: var(--text-2); }
.field em { font-style: normal; font-weight: 400; font-size: 12px; color: var(--text-3); margin-left: 6px; }
.field input:not([type="range"]), .field textarea, .input-group { width: 100%; border: 0; border-radius: var(--r); background: var(--surface); box-shadow: inset 0 0 0 1px var(--border-2); outline: none; padding: 7px 11px; font-size: 13.5px; transition: box-shadow .15s; }
.field input:not([type="range"]) { height: 34px; }
.field textarea { resize: vertical; line-height: 1.6; }
.field input:focus, .field textarea:focus, .input-group:focus-within { box-shadow: inset 0 0 0 1px var(--blue), 0 0 0 3px var(--blue-100); }
.input-group { display: flex; align-items: center; gap: 6px; padding: 0 10px 0 0; height: 34px; }
.input-group input { box-shadow: none !important; height: 32px !important; min-width: 0; flex: 1; }
.input-group .link-btn { flex: none; white-space: nowrap; }
.field input[type="range"] { accent-color: var(--blue); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.check-row { display: flex; gap: 10px; align-items: flex-start; margin: 2px 0 16px; padding: 12px 14px; border-radius: var(--r); background: var(--surface-2); cursor: pointer; font-size: 13.5px; font-weight: 500; }
.check-row input { margin-top: 3px; accent-color: var(--blue); width: 15px; height: 15px; }
.check-row em { display: block; font-style: normal; font-weight: 400; font-size: 12.5px; color: var(--text-3); margin-top: 2px; }
.adv { margin-bottom: 14px; }
.adv summary { cursor: pointer; font-size: 13px; font-weight: 500; color: var(--text-2); margin-bottom: 12px; }
.file-list { list-style: none; margin: 0 0 18px; padding: 4px; border-radius: var(--r); background: var(--surface-2); max-height: 180px; overflow-y: auto; }
.file-list li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 10px; font-size: 13.5px; border-radius: 6px; }
.file-list li + li { border-top: 1px solid var(--border); border-radius: 0; }
.file-list li span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.file-list li span:last-child { color: var(--text-3); font-variant-numeric: tabular-nums; flex: none; }
.test-result { padding: 9px 12px; border-radius: var(--r); font-size: 13px; margin-bottom: 14px; word-break: break-word; }
.test-result.ok { color: var(--ok); background: rgba(18, 161, 80, .08); }
.test-result.bad { color: var(--bad); background: rgba(220, 38, 38, .07); }
.test-result.pending { color: var(--text-2); background: var(--surface-2); }
.confirm { padding-top: 24px; }
.confirm h3 { margin: 0 0 8px; font-size: 16px; font-weight: 650; }
.confirm p { margin: 0; color: var(--text-2); font-size: 13.5px; line-height: 1.65; }
.terms { width: 100%; border-collapse: collapse; font-size: 13.5px; margin-bottom: 16px; }
.terms th { text-align: left; font-weight: 500; color: var(--text-3); font-size: 12.5px; padding: 8px; border-bottom: 1px solid var(--border); }
.terms td { padding: 10px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.terms td:first-child { font-weight: 600; }
.terms s { color: var(--text-3); }

.toasts { position: fixed; z-index: 100; bottom: 140px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast { padding: 9px 16px; border-radius: 10px; font-size: 13.5px; font-weight: 500; color: #fff; background: #111827; box-shadow: 0 8px 24px -6px rgba(0, 0, 0, .35); animation: toastIn .22s var(--ease); }
[data-theme="dark"] .toast { background: #f3f4f6; color: #111827; }
.toast.bad { background: var(--bad); color: #fff; }
@keyframes toastIn { from { opacity: 0; transform: translateY(6px); } }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .job-main { grid-template-columns: 1fr; overflow-y: auto; }
  .doc-col { min-height: 70vh; }
  .side { padding: 0 24px 16px; min-height: 520px; }
}
@media (max-width: 760px) {
  .topnav { padding: 0 14px; gap: 14px; }
  .nav, .engine-note, .search kbd { display: none; }
  .lib-head-in { padding: 24px 16px 104px; }
  .grid { padding: 16px 16px 0; grid-template-columns: 1fr; }
  .search input { width: 120px; }
  .doc-head, .doc-tools, .notice, .video-box { margin-left: 16px; margin-right: 16px; padding-left: 0; padding-right: 0; }
  .segments { padding: 8px 16px 32px; }
  .para { grid-template-columns: 1fr; gap: 0; }
  .job-head { flex-direction: column; align-items: stretch; }
  .job-title { font-size: 22px; }
  .player { margin: 0 8px 8px; width: calc(100% - 16px); }
  .player-row { padding: 0 12px 12px; gap: 10px; }
  .player-row .toggle, .player-time span { display: none; }
  .field-row { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* =========================================================
   Accounts, chat, admin
   ========================================================= */
body.booting .view, body.booting .topnav { visibility: hidden; }
.admin-only { display: none !important; }
body.is-admin .admin-only { display: flex !important; }
.view-job.readonly .owner-only { display: none !important; }
.view-job.readonly .job-title { pointer-events: none; }

/* nav additions */
.nav { gap: 24px; }
.nav a { position: relative; gap: 6px; }
.nav-badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; display: inline-grid; place-items: center; font-size: 11px; font-weight: 600; color: #fff; background: var(--bad); font-variant-numeric: tabular-nums; }
.avatar-btn { margin-left: 6px; border-radius: 50%; }
.avatar-btn:focus-visible { outline-offset: 1px; }
.avatar { width: 32px; height: 32px; flex: none; display: inline-grid; place-items: center; border-radius: 50%; color: #fff; font-size: 13px; font-weight: 600; letter-spacing: .02em; user-select: none; }
.avatar.sm { width: 28px; height: 28px; font-size: 12px; }
.avatar.lg { width: 40px; height: 40px; font-size: 15px; }
.user-menu { min-width: 200px; }
.um-head { padding: 8px 10px 10px; margin-bottom: 4px; border-bottom: 1px solid var(--border); }
.um-head b { display: block; font-size: 14px; font-weight: 600; }
.um-head small { font-size: 12.5px; color: var(--text-3); }

/* ---------- auth ---------- */
.view-auth { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(420px, 1fr); min-height: 100vh; }
.view-auth.hidden { display: none; }
.auth-brand { position: relative; overflow: hidden; background: var(--surface); border-right: 1px solid var(--border); display: flex; align-items: center; }
.auth-brand canvas { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 70%; pointer-events: auto; }
.auth-brand-in { position: relative; padding: 0 9%; max-width: 640px; margin-top: -14vh; }
.logo-lg .logo-mark { width: 40px; height: 40px; }
.logo-lg .logo-word { font-size: 22px; }
.auth-brand h1 { margin: 44px 0 16px; font-size: clamp(34px, 4vw, 52px); line-height: 1.15; font-weight: 700; letter-spacing: -.03em; }
.auth-brand p { margin: 0; max-width: 440px; font-size: 15px; line-height: 1.8; color: var(--text-2); }
.auth-form-col { display: grid; place-items: center; padding: 40px 24px; background: var(--bg); }
.auth-card { width: min(380px, 100%); }
.auth-card h2 { margin: 0; font-size: 26px; font-weight: 650; letter-spacing: -.02em; }
.auth-sub { margin: 6px 0 28px; color: var(--text-3); }
.view-auth:not(.is-register) .reg-only { display: none; }
.auth-note { margin: -12px 0 20px; padding: 10px 12px; border-radius: var(--r); font-size: 13px; line-height: 1.6; color: var(--blue-ink); background: var(--blue-50); }
.auth-err { margin: -4px 0 14px; padding: 9px 12px; border-radius: var(--r); font-size: 13px; color: var(--bad); background: rgba(220, 38, 38, .07); }
.btn.block { width: 100%; height: 40px; font-size: 14.5px; }
.auth-switch { margin: 18px 0 0; text-align: center; font-size: 13.5px; color: var(--text-3); }
.auth-switch a { color: var(--blue-ink); font-weight: 500; }
.auth-switch a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- chat ---------- */
.view-chat { display: grid; grid-template-columns: 340px minmax(0, 1fr); min-height: 0; max-width: 1440px; width: 100%; margin: 0 auto; }
.view-chat.hidden { display: none; }
.conv-col { min-height: 0; display: flex; flex-direction: column; border-right: 1px solid var(--border); background: var(--surface); }
.conv-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 16px 12px 20px; }
.conv-head h2 { margin: 0; font-size: 20px; font-weight: 650; letter-spacing: -.01em; }
.conv-search { margin: 0 16px 10px; }
.conv-search input { width: 100%; }
.conv-list { flex: 1; overflow-y: auto; padding: 0 8px 12px; }
.conv { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 10px; transition: background .12s; }
.conv:hover { background: var(--hover); }
.conv.on { background: var(--blue-50); }
.conv .avatar { width: 40px; height: 40px; font-size: 15px; }
.conv-body { flex: 1; min-width: 0; }
.conv-top, .conv-bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.conv-top b { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-top time { flex: none; font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.conv-bottom { margin-top: 2px; }
.conv-last { font-size: 13px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.unread { flex: none; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; display: grid; place-items: center; font-size: 11px; font-weight: 600; color: #fff; background: var(--blue); font-variant-numeric: tabular-nums; }
.conv-empty { padding: 40px 20px; text-align: center; color: var(--text-3); font-size: 13px; line-height: 1.8; }

.thread-col { min-height: 0; display: flex; flex-direction: column; background: var(--bg); }
.thread-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px; }
.te-mark { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; margin-bottom: 18px; color: var(--blue); background: var(--blue-50); }
.te-mark .i { width: 24px; height: 24px; }
.thread-empty h3 { margin: 0 0 6px; font-size: 17px; font-weight: 600; }
.thread-empty p { margin: 0 0 20px; max-width: 320px; color: var(--text-3); line-height: 1.7; }
.thread-head { flex: none; display: flex; align-items: center; gap: 12px; height: 64px; padding: 0 24px; background: var(--surface); border-bottom: 1px solid var(--border); }
.thread-head b { display: block; font-size: 15px; font-weight: 600; }
.thread-head small { font-size: 12.5px; color: var(--text-3); }
.thread-back { display: none; margin-left: -8px; }
.thread { flex: 1; overflow-y: auto; padding: 20px 24px 12px; display: flex; flex-direction: column; }
.thread-loading, .thread-hello { margin: auto; text-align: center; color: var(--text-3); line-height: 1.8; }
.load-more { align-self: center; margin-bottom: 12px; }
.day-sep { display: flex; justify-content: center; margin: 14px 0 10px; }
.day-sep span { padding: 2px 10px; border-radius: 10px; font-size: 12px; color: var(--text-3); background: var(--surface-3); }
.msg { display: flex; gap: 10px; align-items: flex-start; margin-top: 12px; max-width: 78%; }
.msg.grouped { margin-top: 3px; }
.msg.mine { align-self: flex-end; flex-direction: row-reverse; }
.msg-av { width: 32px; flex: none; }
.msg-col { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.msg.mine .msg-col { align-items: flex-end; }
.msg time { font-size: 11.5px; color: var(--text-3); opacity: 0; transition: opacity .15s; font-variant-numeric: tabular-nums; }
.msg:hover time { opacity: 1; }
.bubble { padding: 9px 13px; border-radius: 16px 16px 16px 5px; font-size: 14px; line-height: 1.6; background: var(--surface); box-shadow: 0 0 0 1px var(--border); word-break: break-word; white-space: normal; }
.msg.mine .bubble { border-radius: 16px 16px 5px 16px; color: #fff; background: var(--blue); box-shadow: none; }
.msg.mine .bubble a { color: #fff; text-decoration: underline; }
.bubble a { color: var(--blue-ink); }
.share-card {
  width: 320px; max-width: 100%; display: flex; flex-direction: column; gap: 6px; padding: 14px 16px 12px; border-radius: 14px; text-align: left;
  background: var(--surface); box-shadow: 0 0 0 1px var(--border), 0 4px 14px -8px rgba(13, 19, 33, .2); transition: box-shadow .15s, transform .15s var(--ease);
}
.share-card:hover { box-shadow: 0 0 0 1px var(--border-2), 0 10px 24px -10px rgba(13, 19, 33, .28); transform: translateY(-1px); }
.share-card.gone { opacity: .6; }
.sc-kind { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; color: var(--blue-ink); }
.share-card b { font-size: 15px; font-weight: 600; line-height: 1.4; }
.sc-wave { display: flex; align-items: center; gap: 2px; height: 28px; }
.sc-wave i { flex: 1; min-width: 1px; border-radius: 2px; background: var(--blue-300); }
.share-card:hover .sc-wave i { background: var(--blue); }
.sc-text { font-size: 13px; line-height: 1.6; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sc-text.clamp { -webkit-line-clamp: 3; }
.sc-foot { display: flex; justify-content: space-between; margin-top: 4px; padding-top: 8px; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.share-card:hover .sc-foot span:last-child { color: var(--blue-ink); }
.composer { flex: none; display: flex; align-items: flex-end; gap: 10px; margin: 0 24px 20px; padding: 8px 8px 8px 8px; border-radius: 14px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--border-2); transition: box-shadow .15s; }
.composer:focus-within { box-shadow: inset 0 0 0 1px var(--blue), 0 0 0 3px var(--blue-100); }
.composer textarea { flex: 1; min-height: 34px; max-height: 160px; padding: 7px 2px; border: 0; background: none; outline: none; resize: none; font-size: 14px; line-height: 1.5; }
.composer .icon-btn.bordered { width: 34px; height: 34px; border-color: transparent; background: var(--surface-2); }
.send-btn.lg { width: 34px; height: 34px; border-radius: 9px; }

/* pick lists (share / new chat) */
.share-sec { margin-bottom: 18px; }
.field-label { font-size: 13px; font-weight: 500; color: var(--text-2); margin-bottom: 8px; }
.search.block { width: 100%; margin-bottom: 8px; }
.search.block input { width: 100%; }
.pick-list { display: flex; flex-direction: column; gap: 2px; max-height: 210px; overflow-y: auto; }
.pick-label { margin: 2px 4px 4px; font-size: 12px; color: var(--text-3); }
.pick-empty { margin: 0; padding: 14px 4px; font-size: 13px; color: var(--text-3); }
.pick { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; text-align: left; transition: background .12s; }
.pick:hover { background: var(--hover); }
.pick.on { background: var(--blue-50); }
.pick > span:not(.avatar):not(.i):not(.pr-wave) { flex: 1; min-width: 0; }
.pick b { display: block; font-size: 13.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pick small { font-size: 12px; color: var(--text-3); }
.pick-check { color: var(--blue); opacity: 0; }
.pick.on .pick-check { opacity: 1; }
.pr-wave { width: 64px; flex: none; display: flex; align-items: center; gap: 1px; height: 22px; }
.pr-wave i { flex: 1; border-radius: 1px; background: var(--blue-300); }
.what-list { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.what { position: relative; display: flex; align-items: flex-start; gap: 8px; padding: 10px 38px 10px 12px; border-radius: 10px; text-align: left; box-shadow: inset 0 0 0 1px var(--border); transition: box-shadow .12s, background .12s; }
.what .i { margin-top: 2px; color: var(--text-3); }
.what b { display: block; font-size: 13.5px; font-weight: 500; }
.what small { font-size: 12px; color: var(--text-3); line-height: 1.5; }
.what:hover:not(:disabled) { box-shadow: inset 0 0 0 1px var(--border-2); }
.what.on { background: var(--blue-50); box-shadow: inset 0 0 0 1.5px var(--blue); }
.what.on .i { color: var(--blue); }
.what:disabled { opacity: .5; cursor: not-allowed; }
.what:first-child { grid-column: 1 / -1; }
.what-box { position: absolute; top: 11px; right: 12px; width: 16px; height: 16px; display: grid; place-items: center; border-radius: 4px; box-shadow: inset 0 0 0 1.5px var(--border-2); color: #fff; transition: background .12s, box-shadow .12s; }
.what-box .i { width: 12px; height: 12px; opacity: 0; }
.what.on .what-box { background: var(--blue); box-shadow: none; }
.what.on .what-box .i { opacity: 1; }
.what .what-box .i, .what.on .what-box .i { margin: 0; color: #fff; }
.pr-wave i { min-width: 1px; }
.modal.wide { width: min(760px, calc(100vw - 32px)); }
.modal-sub { margin: 4px 0 0; font-size: 12.5px; color: var(--text-3); }
.ts-link.static { cursor: default; }
.ts-link.static:hover { background: var(--blue-50); color: var(--blue-ink); }

/* ---------- admin ---------- */
.view-admin { overflow-y: auto; }
.admin-in { max-width: 1080px; margin: 0 auto; padding: 36px 32px 56px; }
.page-title h1 { margin: 0; font-size: 26px; font-weight: 650; letter-spacing: -.02em; }
.page-title p { margin: 6px 0 24px; color: var(--text-3); }
.panel { margin-bottom: 20px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--border); overflow: hidden; }
.panel-head { display: flex; align-items: baseline; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.panel-head h3 { margin: 0; font-size: 15px; font-weight: 600; }
.panel-sub { font-size: 12.5px; color: var(--text-3); }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px 20px; }
.setting-row + .setting-row { border-top: 1px solid var(--border); }
.setting-row b { display: block; font-size: 14px; font-weight: 500; }
.setting-row small { font-size: 12.5px; color: var(--text-3); }
.setting-row .toggle span { width: 36px; height: 20px; }
.setting-row .toggle span::after { width: 16px; height: 16px; }
.setting-row .toggle input:checked + span::after { transform: translateX(16px); }
.ur { display: grid; grid-template-columns: minmax(0, 1.6fr) 130px 110px 130px 120px minmax(220px, auto); align-items: center; gap: 12px; padding: 12px 20px; font-size: 13px; color: var(--text-2); }
.ur + .ur { border-top: 1px solid var(--border); }
.ur.head { padding-top: 10px; padding-bottom: 10px; font-size: 12.5px; color: var(--text-3); background: var(--surface-2); }
.ur.off { opacity: .6; }
.u-cell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.u-cell b { display: block; font-size: 13.5px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.u-cell small { font-size: 12px; color: var(--text-3); }
.u-acts { display: flex; justify-content: flex-end; gap: 14px; white-space: nowrap; }
.tag { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 5px; font-style: normal; font-size: 11.5px; font-weight: 500; color: var(--text-2); background: var(--surface-3); }
.tag.blue { color: var(--blue-ink); background: var(--blue-50); }
.tag.red { color: var(--bad); background: rgba(220, 38, 38, .08); }
.num { font-variant-numeric: tabular-nums; }

@media (max-width: 1100px) {
  .ur { grid-template-columns: minmax(0, 1fr) 110px minmax(200px, auto); }
  .ur > :nth-child(3), .ur > :nth-child(4), .ur > :nth-child(5) { display: none; }
}
@media (max-width: 860px) {
  .view-auth { grid-template-columns: 1fr; }
  .auth-brand { min-height: 260px; border-right: 0; border-bottom: 1px solid var(--border); }
  .auth-brand-in { margin-top: 0; padding: 32px 24px 96px; }
  .auth-brand h1 { margin-top: 24px; font-size: 32px; }
  .auth-brand p { display: none; }
  .view-chat { grid-template-columns: 1fr; }
  .view-chat .thread-col { display: none; }
  .view-chat.has-thread .conv-col { display: none; }
  .view-chat.has-thread .thread-col { display: flex; }
  .thread-back { display: inline-grid; }
  .thread { padding: 16px 12px 8px; }
  .composer { margin: 0 10px 10px; }
  .msg { max-width: 92%; }
  .what-list { grid-template-columns: 1fr; }
  .admin-in { padding: 24px 16px 40px; }
  .u-acts { flex-wrap: wrap; justify-content: flex-start; gap: 10px; }
  .ur { grid-template-columns: 1fr; }
  .ur.head { display: none; }
}
