/* Collaborative Forest Governance · Transcript Review — forest theme */

:root {
  --bg: #f3f1ea;
  --surface: #fffefa;
  --surface-2: #eeebe0;
  --border: #dcd7c6;
  --text: #1d2a21;
  --muted: #5c695e;
  --accent: #2e6b46;
  --accent-hover: #245839;
  --accent-soft: #e2eee3;
  --on-accent: #ffffff;
  --forest-deep: #163826;
  --forest-mid: #2e6b46;
  --moss: #7d9b3f;
  --bark: #8a6a45;
  --tree-near: rgba(46, 107, 70, .16);
  --tree-far: rgba(46, 107, 70, .08);
  --active: #eef4e1;
  --active-edge: #7d9b3f;
  --danger: #b0402c;
  --ins-bg: #dcefdc;
  --ins-text: #1e5532;
  --del-bg: #f6e0da;
  --del-text: #8c2f1f;

  --note: #8a5a14;
  --note-bg: #f6ead2;
  --context: #2c6384;
  --context-bg: #e0ecf2;
  --unclear: #b0402c;
  --unclear-bg: #f7e2dc;
  --translation: #2e6b46;
  --translation-bg: #e0eee2;

  --sp0: #2e6b46; --sp1: #a4512e; --sp2: #2c6384; --sp3: #7a4f8a; --sp4: #8a6d12; --sp5: #2a7c78;

  --radius: 10px;
  --shadow: 0 1px 2px rgba(22, 56, 38, .06), 0 8px 28px rgba(22, 56, 38, .10);
  --shadow-sm: 0 1px 2px rgba(22, 56, 38, .08);
  --font-ui: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --bar-h: 60px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #101712; --surface: #172019; --surface-2: #1f2a22; --border: #2c3a30;
    --text: #e5ebe3; --muted: #9caa9e; --accent: #79c08f; --accent-hover: #8fd0a3; --accent-soft: #1e3326;
    --on-accent: #0d1a12; --forest-deep: #0c1f14; --forest-mid: #1d4a30; --moss: #a6c463; --bark: #c49a6a;
    --tree-near: rgba(121, 192, 143, .12); --tree-far: rgba(121, 192, 143, .06);
    --active: #1d2a1b; --active-edge: #a6c463; --danger: #f0907c;
    --ins-bg: #1b3a26; --ins-text: #a9e3b9; --del-bg: #44221b; --del-text: #f8b4a5;
    --note: #e8b866; --note-bg: #3a2c14; --context: #8cc3e3; --context-bg: #17303d;
    --unclear: #f0907c; --unclear-bg: #45221b; --translation: #79c08f; --translation-bg: #183223;
    --sp0: #79c08f; --sp1: #f0a07c; --sp2: #8cc3e3; --sp3: #cfa3df; --sp4: #e5c45c; --sp5: #6fd0c8;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 28px rgba(0, 0, 0, .45);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--font-ui);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
h1, h2 { font-family: var(--font-display); font-weight: 600; letter-spacing: -.01em; }
h2 { font-size: 20px; margin: 0; }
h3 { font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 10px; font-weight: 600; }
.hint { color: var(--muted); font-size: 13px; margin: 0; }
.error { color: var(--danger); font-size: 14px; }
.spacer { flex: 1; }
[hidden] { display: none !important; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* buttons & inputs */
.btn {
  font: inherit; font-size: 14px; font-weight: 500;
  padding: 7px 14px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 8px;
  transition: background .15s, border-color .15s, box-shadow .15s;
}
.btn:hover:not(:disabled) { background: var(--surface-2); border-color: color-mix(in srgb, var(--border) 60%, var(--accent)); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); box-shadow: var(--shadow-sm); }
.btn.primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.danger { color: var(--danger); }
.btn.small { padding: 4px 10px; font-size: 13px; border-radius: 7px; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover:not(:disabled) { color: var(--text); }
.btn.loading { pointer-events: none; opacity: .85; }
.btn.loading::before {
  content: ""; width: 13px; height: 13px; border-radius: 50%; flex: none;
  border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite;
}
select, input[type="search"], input[type="password"], input:not([type]), textarea {
  font: inherit; font-size: 14px; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 7px 10px;
  transition: border-color .15s, box-shadow .15s;
}
select:focus, input:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { width: 100%; resize: vertical; }
input[type="checkbox"] { accent-color: var(--accent); }

/* ------------------------------------------------------------ brand bar --- */
.brandbar {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 10px 24px; background: var(--surface);
  border-bottom: 1px solid var(--border); position: relative;
}
.brandbar::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px;
  background: linear-gradient(90deg, var(--forest-deep), var(--forest-mid) 45%, var(--moss) 80%, var(--bark));
}
.brand-left { display: flex; align-items: center; gap: 14px; text-decoration: none; color: inherit; min-width: 0; }
.logo-wrap { display: flex; align-items: center; border-radius: 8px; flex: none; }
.logo { height: 34px; width: auto; display: block; }
.brand-divider { width: 1px; align-self: stretch; background: var(--border); margin: 4px 0; flex: none; }
.brand-project {
  font-family: var(--font-display); font-size: 18px; font-weight: 600; color: var(--forest-mid);
  line-height: 1.2; letter-spacing: -.01em;
}
.brand-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.brand-app {
  display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px; color: var(--text);
  padding: 5px 12px 5px 9px; border-radius: 999px; background: var(--accent-soft);
}
.brand-app svg { width: 16px; height: 16px; color: var(--accent); flex: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo-wrap { background: #fffefa; padding: 4px 8px; }
  :root:not([data-theme="light"]) .brand-project { color: var(--accent); }
}

/* -------------------------------------------------------------- loaders --- */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes sway { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(6deg); } }

.spinner {
  width: 44px; height: 44px; position: relative; display: grid; place-items: center;
}
.spinner::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  border: 3px solid var(--accent-soft); border-top-color: var(--accent); border-right-color: var(--moss);
  animation: spin .9s linear infinite;
}
.spinner svg { width: 18px; height: 18px; color: var(--accent); animation: sway 1.8s ease-in-out infinite; transform-origin: 50% 90%; }
.spinner.sm { width: 16px; height: 16px; }
.spinner.sm::before { border-width: 2px; }

.loader {
  position: fixed; inset: 0; z-index: 70; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 14px;
  background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(2px);
  transition: opacity .25s ease;
}
.loader.done { opacity: 0; pointer-events: none; }
.loader-text { color: var(--muted); font-size: 14px; }
.loader .error { max-width: 420px; text-align: center; }

.skeleton {
  display: block; border-radius: 6px; height: 12px;
  background: linear-gradient(90deg, var(--surface-2) 25%, color-mix(in srgb, var(--surface-2) 40%, var(--surface)) 50%, var(--surface-2) 75%);
  background-size: 200% 100%; animation: shimmer 1.4s linear infinite;
}

/* ------------------------------------------------------------ editor bar --- */
.topbar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 24px; background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 20;
}
.back {
  color: var(--muted); text-decoration: none; font-size: 14px; white-space: nowrap;
  padding: 5px 10px 5px 6px; border-radius: 7px; display: inline-flex; align-items: center; gap: 4px;
}
.back:hover { color: var(--accent); background: var(--accent-soft); }
.title-block { min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.interview-title {
  font-family: var(--font-display); font-weight: 600; font-size: 17px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.title-block .hint { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.version-info { display: flex; gap: 6px; }
.badge { font-size: 12px; font-weight: 500; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.badge.dirty { background: var(--note-bg); color: var(--note); }
.menu { position: relative; }
.menu-list {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 30;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 4px; min-width: 230px;
}
.menu-list a { display: block; padding: 8px 10px; border-radius: 6px; cursor: pointer; color: var(--text); }
.menu-list a:hover { background: var(--accent-soft); }

.banner {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 9px 24px;
  background: var(--note-bg); color: var(--note); border-bottom: 1px solid var(--border);
}

/* layout */
.layout { flex: 1; display: grid; grid-template-columns: minmax(300px, 370px) 1fr; min-height: 0; }
.side {
  border-right: 1px solid var(--border); padding: 18px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 14px;
  max-height: calc(100vh - var(--bar-h)); position: sticky; top: var(--bar-h); align-self: start;
}
.player-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px;
  box-shadow: var(--shadow-sm);
}
video { width: 100%; border-radius: 8px; background: #000; display: block; aspect-ratio: 16 / 9; margin-bottom: 8px; }
.player-card.audio-only video, .player-card.no-video video { display: none; }
.player-controls { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
#playBtn { min-width: 74px; justify-content: center; }
.clock { white-space: nowrap; font-variant-numeric: tabular-nums; font-size: 13px; color: var(--muted); margin-left: auto; }
#seekBar { width: 100%; margin: 10px 0 6px; accent-color: var(--accent); }
.player-options { display: flex; gap: 14px; font-size: 13px; color: var(--muted); align-items: center; flex-wrap: wrap; }
.player-options label { display: flex; align-items: center; gap: 5px; }
.media-status { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); margin-left: auto; }
.panel {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px;
  box-shadow: var(--shadow-sm);
}
.progress { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
#reviewBar { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--moss)); transition: width .3s; }
.stats { font-size: 13px; color: var(--muted); margin-top: 10px; display: grid; grid-template-columns: 1fr auto; gap: 3px 8px; }
.stats b { color: var(--text); font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.speaker-row { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.speaker-row input { flex: 1; min-width: 0; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--spc); }
.keys { display: grid; grid-template-columns: auto 1fr; gap: 5px 10px; font-size: 13px; margin: 0; }
.keys dt { font-family: ui-monospace, monospace; font-size: 11.5px; color: var(--muted); }
.keys dd { margin: 0; }

/* transcript */
.transcript-wrap { min-width: 0; display: flex; flex-direction: column; }
.toolbar {
  display: flex; gap: 8px; align-items: center; padding: 10px 28px;
  border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--bg) 94%, transparent);
  backdrop-filter: blur(6px);
  position: sticky; top: var(--bar-h); z-index: 10;
}
.toolbar input[type="search"] { flex: 1; max-width: 420px; }
.transcript { padding: 12px 28px 40vh; max-width: 1000px; }

.seg {
  display: flex; flex-direction: column; gap: 4px;
  padding: 12px 14px; border-radius: var(--radius); position: relative;
  border-left: 3px solid transparent; transition: background .15s;
}
.seg + .seg { margin-top: 2px; }
.seg:hover { background: var(--surface); }
.seg.active { background: var(--active); border-left-color: var(--active-edge); }
.seg.active::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 2px;
  width: calc(var(--p, 0) * 100%); background: var(--active-edge); border-radius: 2px;
}
.ts {
  font: 12px/1.4 ui-monospace, monospace; color: var(--muted);
  background: none; border: 0; padding: 2px 5px; margin-left: -5px; border-radius: 5px; cursor: pointer;
}
.ts:hover { background: var(--accent-soft); color: var(--accent); }
.seg-head { display: flex; align-items: center; gap: 8px; min-height: 24px; }
.speaker-select {
  font-size: 13px; font-weight: 600; color: var(--spc);
  border: 0; background: transparent; padding: 0 2px; margin-left: -2px; cursor: pointer; box-shadow: none;
}
.flags { display: flex; gap: 6px; font-size: 11px; }
.flag { padding: 1px 7px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.flag.unsaved { background: var(--note-bg); color: var(--note); }
.seg-actions { margin-left: auto; display: flex; gap: 2px; opacity: 0; transition: opacity .12s; }
.seg:hover .seg-actions, .seg:focus-within .seg-actions, .seg.active .seg-actions { opacity: 1; }
.icon-btn {
  font: inherit; font-size: 12px; color: var(--muted); background: none; border: 1px solid transparent;
  padding: 2px 8px; border-radius: 6px; cursor: pointer;
}
.icon-btn:hover { border-color: var(--border); background: var(--surface); color: var(--accent); }
.review-box { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); cursor: pointer; }
.seg.reviewed .review-box { color: var(--translation); font-weight: 500; }

.seg-text {
  font-size: 16px; line-height: 1.75; outline: none;
  border-radius: 6px; padding: 2px 6px; margin: 0 -6px; white-space: pre-wrap; word-wrap: break-word;
}
.seg-text:focus { background: var(--surface); box-shadow: 0 0 0 3px var(--accent-soft), 0 0 0 1px var(--accent); }
.seg-text mark { background: color-mix(in srgb, var(--moss) 45%, transparent); color: inherit; border-radius: 2px; }

/* inline note chips — rendered as [ ... ] in the line */
.note {
  --nc: var(--note); --nb: var(--note-bg);
  display: inline; color: var(--nc); background: var(--nb);
  border-radius: 5px; padding: 1px 4px; margin: 0 2px; cursor: pointer;
  font-size: 14px; font-style: italic; user-select: none;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.note:hover, .note.editing { outline: 1px solid var(--nc); }
.note .br { font-style: normal; font-weight: 600; }
.note .kind { font-style: normal; font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; }
.note.k-context { --nc: var(--context); --nb: var(--context-bg); }
.note.k-unclear { --nc: var(--unclear); --nb: var(--unclear-bg); }
.note.k-translation { --nc: var(--translation); --nb: var(--translation-bg); }

.seg-diff {
  font-size: 14px; color: var(--muted); border-left: 2px solid var(--border);
  padding-left: 10px; margin-top: 4px;
}

/* diff marks */
ins { background: var(--ins-bg); color: var(--ins-text); text-decoration: none; border-radius: 3px; }
del { background: var(--del-bg); color: var(--del-text); border-radius: 3px; }

/* popover */
.pop {
  position: absolute; z-index: 40; width: 340px; max-width: calc(100vw - 32px);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 12px; display: flex; flex-direction: column; gap: 8px;
}
.pop-row { display: flex; align-items: center; gap: 8px; }

/* dialogs */
dialog {
  border: 1px solid var(--border); border-radius: 14px; padding: 0; background: var(--surface); color: var(--text);
  box-shadow: var(--shadow); width: min(460px, calc(100vw - 32px));
}
dialog.wide { width: min(900px, calc(100vw - 32px)); max-height: calc(100vh - 64px); }
dialog::backdrop { background: rgba(16, 32, 22, .45); backdrop-filter: blur(2px); }
.dialog-body { padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.dialog-body label { display: flex; flex-direction: column; gap: 5px; font-size: 14px; font-weight: 500; }

/* history drawer */
.drawer {
  position: fixed; right: 0; top: 0; bottom: 0; width: min(440px, 100vw); z-index: 50;
  background: var(--surface); border-left: 1px solid var(--border); box-shadow: var(--shadow);
  display: flex; flex-direction: column;
}
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.compare-row { display: flex; align-items: center; gap: 6px; padding: 12px 18px; border-bottom: 1px solid var(--border); font-size: 14px; flex-wrap: wrap; }
.version-list { list-style: none; margin: 0; padding: 10px; overflow-y: auto; flex: 1; }
.version-list li { padding: 12px; border-radius: var(--radius); border: 1px solid transparent; }
.version-list li + li { margin-top: 4px; }
.version-list li.current { border-color: color-mix(in srgb, var(--accent) 50%, transparent); background: var(--accent-soft); }
.version-list .list-loading { display: flex; justify-content: center; padding: 40px 0; }
.v-head { display: flex; gap: 8px; align-items: baseline; }
.v-num { font-weight: 650; color: var(--accent); }
.v-msg { margin: 2px 0; }
.v-meta { font-size: 12px; color: var(--muted); }
.v-actions { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }

.compare-body { overflow-y: auto; max-height: calc(100vh - 160px); }
.cmp-item { padding: 12px 0; border-top: 1px solid var(--border); }
.cmp-item:first-child { border-top: 0; }
.cmp-head { font-size: 13px; color: var(--muted); display: flex; gap: 10px; margin-bottom: 4px; }
.cmp-head .ts { padding: 0; margin: 0; }
.cmp-text { font-size: 15px; line-height: 1.7; }
.cmp-sub { font-size: 13px; margin-top: 4px; }

.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 80;
  background: var(--forest-deep); color: #f3f1ea; padding: 10px 18px; border-radius: 10px; font-size: 14px;
  box-shadow: var(--shadow);
}

@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .side { position: sticky; top: 0; max-height: none; border-right: 0; border-bottom: 1px solid var(--border); padding: 10px 16px; z-index: 15; background: var(--bg); }
  .side .panel { display: none; }
  .toolbar { position: static; padding: 10px 16px; }
  .transcript { padding: 8px 12px 40vh; }
  .seg-head { flex-wrap: wrap; }
  .seg-actions { opacity: 1; margin-left: 0; order: 5; }
  .title-block { flex: 1 1 60%; }
  .topbar { position: static; padding: 10px 16px; }
}

/* ---------------------------------------------------------- tree line --- */
.treeline { position: absolute; left: 0; right: 0; bottom: 0; pointer-events: none; }
.treeline::before, .treeline::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0;
  -webkit-mask: url(forest.svg) repeat-x left bottom / auto 100%;
  mask: url(forest.svg) repeat-x left bottom / auto 100%;
}
.treeline::before { height: 100%; background: var(--tree-far); -webkit-mask-position: 37% bottom; mask-position: 37% bottom; }
.treeline::after { height: 72%; background: var(--tree-near); }

/* ---------------------------------------------------------------- login --- */
.login-page {
  align-items: center; justify-content: center; padding: 24px 16px 140px; position: relative; overflow-x: hidden;
  background: #163826 url(login-bg.svg) center bottom / cover no-repeat;
}
.login-card {
  position: relative; z-index: 1;
  width: min(420px, 100%); background: var(--surface); border-radius: 16px;
  padding: 32px 32px 28px; display: flex; flex-direction: column; gap: 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .35);
}
.login-card .logo-wrap { align-self: flex-start; }
.login-card .logo { height: 44px; }
.login-eyebrow {
  font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--moss); margin: 6px 0 0;
}
.login-card h1 { font-size: 30px; margin: -8px 0 0; line-height: 1.15; color: var(--text); }
.login-card .lead { color: var(--muted); margin: 0; font-size: 14.5px; }
.login-card label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 500; }
.login-card input { padding: 10px 12px; font-size: 15px; }
.login-card .btn.primary { justify-content: center; padding: 11px 16px; font-size: 15px; }
.login-card .error { margin: 0; }
.login-rule { height: 1px; background: var(--border); margin: 2px 0; }
.login-foot { position: relative; z-index: 1; margin-top: 20px; color: rgba(243, 241, 234, .75); font-size: 13px; text-align: center; }

/* ---------------------------------------------------------- home screen --- */
.home-hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, var(--surface) 0%, var(--bg) 100%); }
.home-hero .treeline { height: 120px; }
.home-hero-inner { position: relative; max-width: 1180px; margin: 0 auto; padding: 34px 24px 46px; }
.home-hero h1 { font-size: 34px; margin: 0 0 6px; color: var(--text); }
.home-hero .lead { color: var(--muted); margin: 0; max-width: 640px; }
.stat-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 24px; max-width: 860px; }
.stat {
  background: color-mix(in srgb, var(--surface) 88%, transparent); border: 1px solid var(--border); border-radius: 12px;
  padding: 12px 16px; backdrop-filter: blur(4px); box-shadow: var(--shadow-sm);
}
.stat-value { font-family: var(--font-display); font-size: 28px; font-weight: 600; line-height: 1.1; color: var(--accent); font-variant-numeric: tabular-nums; }
.stat-label { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.stat .skeleton { height: 28px; width: 50%; }

.home-main { width: 100%; max-width: 1180px; margin: 0 auto; padding: 24px 24px 64px; }
.home-toolbar { display: flex; gap: 8px; margin: 0 0 14px; flex-wrap: wrap; align-items: center; }
.home-toolbar input[type="search"] { flex: 1; min-width: 200px; max-width: 420px; }
.storage-note { margin-left: auto; font-size: 12px; color: var(--muted); max-width: 40ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.iv-table { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow-sm); }
.iv-row {
  display: grid; grid-template-columns: minmax(220px, 2.2fr) 1fr .8fr 1.6fr .5fr 1.6fr;
  gap: 16px; align-items: center; padding: 16px 20px;
  color: inherit; text-decoration: none; border-top: 1px solid var(--border);
  transition: background .12s;
}
#rows .iv-row:hover { background: var(--active); }
#rows .iv-row:hover .iv-title b { color: var(--accent); }
.iv-header { border-top: 0; padding-top: 11px; padding-bottom: 11px; font-size: 11.5px; color: var(--muted); font-weight: 600;
  text-transform: uppercase; letter-spacing: .06em; background: var(--surface-2); }
.iv-title, .iv-progress, .iv-version { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.iv-title b { font-family: var(--font-display); font-weight: 600; font-size: 16.5px; transition: color .12s; }
.iv-version .msg { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.iv-progress .progress { display: block; }
.iv-progress .progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--moss)); }
.pill { font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.pill.s-progress { background: var(--note-bg); color: var(--note); }
.pill.s-done { background: var(--translation-bg); color: var(--translation); }
.warn { color: var(--unclear); }
.iv-row.skel { pointer-events: none; }
.iv-row.skel .skeleton + .skeleton { margin-top: 8px; }
.empty { padding: 40px 24px; text-align: center; color: var(--muted); }
.empty pre { display: inline-block; text-align: left; background: var(--surface-2); padding: 8px 12px; border-radius: 8px; color: var(--text); }

@media (max-width: 860px) {
  .brandbar { padding: 10px 16px; gap: 10px; }
  .logo { height: 28px; }
  .brand-project { font-size: 15px; }
  .home-hero-inner { padding: 24px 16px 40px; }
  .home-hero h1 { font-size: 28px; }
  .stat-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-main { padding: 20px 16px 48px; }
  .iv-header { display: none; }
  .iv-row { grid-template-columns: 1fr 1fr; gap: 8px 12px; }
  .iv-title, .iv-progress, .iv-version { grid-column: 1 / -1; }
  .iv-row [data-label]::before { content: attr(data-label) " "; color: var(--muted); font-size: 12px; }
  .iv-progress::before, .iv-version::before { display: none; }
  .num { text-align: left; }
  .storage-note { display: none; }
}
@media (max-width: 560px) {
  .brand-divider { display: none; }
  .brand-left { flex-direction: column; align-items: flex-start; gap: 4px; }
  .brand-app { font-size: 13px; padding: 4px 10px 4px 8px; }
  .login-card { padding: 26px 22px 22px; }
  .login-card h1 { font-size: 26px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition: none !important; }
}
.player-options #rateSelect { padding: 3px 6px; font-size: 13px; }
