/* Transkrip — UI. Satu aksen (teal), netral slate, sidebar navy. */
:root {
  --bg: #f3f5f8;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --fg: #141b2b;
  --fg-2: #344054;
  --muted: #667085;
  --line: #e4e8ee;
  --line-2: #eef1f5;

  --side: #121a2b;
  --side-2: #1a2438;
  --side-fg: #9aa6bb;
  --side-fg-strong: #ffffff;

  --accent: #0f766e;
  --accent-hover: #0c5f58;
  --accent-soft: #e7f5f3;
  --accent-ring: rgba(15, 118, 110, 0.25);

  --ok: #067647;   --ok-soft: #ecfdf3;
  --err: #b42318;  --err-soft: #fef3f2;
  --info: #175cd3; --info-soft: #eff6ff;
  --warn: #b54708; --warn-soft: #fffaeb;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 1px 3px rgba(16, 24, 40, 0.06);
  --shadow-lg: 0 12px 32px -12px rgba(16, 24, 40, 0.18);
  --side-w: 264px;

  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;
  font-family: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto,
    "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.icon { width: 18px; height: 18px; flex: none; }
.icon-sm { width: 16px; height: 16px; flex: none; }
.num { font-variant-numeric: tabular-nums; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Kerangka ---------- */
.app { display: grid; grid-template-columns: var(--side-w) 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: var(--side); color: var(--side-fg);
  display: flex; flex-direction: column; padding: var(--s5) var(--s4);
}
.brand { display: flex; align-items: center; gap: var(--s3); padding: 0 var(--s2) var(--s5); color: var(--side-fg-strong); }
.brand:hover { color: var(--side-fg-strong); }
.brand-mark {
  width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(140deg, #14b8a6, #0f766e); color: #fff;
  box-shadow: 0 6px 16px -6px rgba(20, 184, 166, 0.6);
}
.brand-text { font-size: 1.15rem; font-weight: 700; letter-spacing: -0.02em; }
.nav { flex: 1; }
.nav-heading { margin: var(--s4) var(--s2) var(--s2); font-size: 0.7rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: #6b778c; }
.nav-item {
  display: flex; align-items: center; gap: var(--s3); padding: 9px var(--s3);
  border-radius: var(--radius-sm); color: var(--side-fg); font-size: 0.93rem;
  transition: background 0.15s, color 0.15s;
}
.nav-item:hover { background: var(--side-2); color: var(--side-fg-strong); }
.nav-item.active { background: var(--side-2); color: var(--side-fg-strong); box-shadow: inset 3px 0 0 #14b8a6; }
.nav-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-count { font-size: 0.72rem; padding: 1px 8px; border-radius: 999px; background: rgba(255,255,255,0.08); color: var(--side-fg); }
.nav-item.active .nav-count { background: rgba(20, 184, 166, 0.2); color: #5eead4; }
.nav-empty { padding: var(--s2) var(--s3); font-size: 0.85rem; color: #6b778c; }
.sidebar-foot { margin-top: var(--s5); padding: var(--s4); border-radius: var(--radius); background: var(--side-2); font-size: 0.82rem; }
.engine-line { display: flex; align-items: center; gap: var(--s2); color: var(--side-fg-strong); font-weight: 600; }
.engine-sub { margin-top: 2px; color: var(--side-fg); overflow-wrap: anywhere; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #14b8a6; box-shadow: 0 0 0 3px rgba(20,184,166,0.2); flex: none; }
.dot.off { background: #6b778c; box-shadow: none; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: var(--s4);
  height: 68px; padding: 0 var(--s6); background: rgba(255,255,255,0.85);
  backdrop-filter: saturate(180%) blur(12px); border-bottom: 1px solid var(--line);
}
.menu-btn { display: none; }
.search {
  display: flex; align-items: center; gap: var(--s2); width: min(440px, 100%);
  height: 40px; padding: 0 var(--s3); border-radius: 10px; background: var(--surface-2);
  border: 1px solid var(--line); color: var(--muted); cursor: text;
}
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring); background: #fff; }
.search input { border: 0; background: transparent; outline: none; flex: 1; min-width: 0; font: inherit; color: var(--fg); height: 100%; padding: 0; }
.search kbd { font-family: inherit; font-size: 0.7rem; font-weight: 600; line-height: 1; padding: 3px 6px; border-radius: 5px; border: 1px solid var(--line); color: var(--muted); background: #fff; }
.topbar-note { margin-left: auto; display: flex; align-items: center; gap: var(--s2); font-size: 0.82rem; color: var(--muted); white-space: nowrap; }

.page { width: 100%; max-width: 1240px; margin: 0 auto; padding: var(--s6) var(--s6) var(--s7); outline: none; }
.page-enter { animation: rise 0.35s ease-out both; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- Tipografi & kepala halaman ---------- */
.crumb { display: inline-flex; align-items: center; gap: var(--s1); font-size: 0.85rem; color: var(--muted); margin-bottom: var(--s3); }
.crumb:hover { color: var(--accent); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s5); flex-wrap: wrap; margin-bottom: var(--s5); }
.eyebrow { margin: 0 0 var(--s1); font-size: 0.75rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
h1 { margin: 0; font-size: clamp(1.6rem, 1.2rem + 1.2vw, 2rem); line-height: 1.15; letter-spacing: -0.025em; font-weight: 700; }
h2 { margin: 0; font-size: 1rem; font-weight: 650; letter-spacing: -0.01em; }
.sub { margin: var(--s2) 0 0; color: var(--muted); max-width: 60ch; }
.title-row { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.meta { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s3); }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px;
  border-radius: 999px; background: var(--surface); border: 1px solid var(--line);
  font-size: 0.8rem; color: var(--fg-2); white-space: nowrap;
}
.chip .icon-sm { color: var(--muted); }
.chip.cloud { background: var(--info-soft); border-color: #d1e3ff; color: var(--info); }
.chip.cloud .icon-sm { color: var(--info); }
.chip.local { background: var(--accent-soft); border-color: #c7ebe5; color: var(--accent); }
.chip.local .icon-sm { color: var(--accent); }

/* ---------- Tombol & input ---------- */
button, .btn {
  font: inherit; font-size: 0.9rem; font-weight: 550; display: inline-flex; align-items: center; justify-content: center;
  gap: var(--s2); height: 40px; padding: 0 var(--s4); border-radius: 10px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--fg-2);
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.15s, box-shadow 0.15s;
  white-space: nowrap;
}
button:hover:not(:disabled), .btn:hover { border-color: #cfd5de; background: var(--surface-2); color: var(--fg); }
button:active:not(:disabled), .btn:active { transform: translateY(1px); }
button:disabled { opacity: 0.55; cursor: not-allowed; }
.primary { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 6px 16px -8px rgba(15,118,110,0.7); }
.primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.ghost { background: transparent; border-color: transparent; }
.danger { color: var(--err); }
.danger:hover:not(:disabled) { color: var(--err); background: var(--err-soft); border-color: #fecdca; }
.small { height: 34px; padding: 0 var(--s3); font-size: 0.85rem; }
.icon-btn { width: 36px; height: 36px; padding: 0; border-radius: 9px; border-color: transparent; background: transparent; color: var(--muted); }
.icon-btn:hover:not(:disabled) { background: var(--surface-2); border-color: var(--line); color: var(--fg); }
.icon-btn.danger:hover:not(:disabled) { color: var(--err); background: var(--err-soft); border-color: #fecdca; }
.btn-group { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface); }
.btn-group .btn { border: 0; border-radius: 0; height: 38px; }
.btn-group .btn + .btn { border-left: 1px solid var(--line); }

input, select, textarea {
  font: inherit; font-size: 0.92rem; color: var(--fg); background: var(--surface);
  border: 1px solid var(--line); border-radius: 10px; padding: 0 var(--s3); height: 42px; width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s;
}
textarea { padding: var(--s3); height: auto; min-height: 96px; resize: vertical; line-height: 1.55; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring); }
select:disabled, input:disabled { background: var(--surface-2); color: var(--muted); }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 44px; }
.pw-wrap .icon-btn { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); }
.field label { display: block; font-size: 0.8rem; font-weight: 550; color: var(--fg-2); margin-bottom: 6px; }
.hint { font-size: 0.8rem; color: var(--muted); margin: var(--s2) 0 0; }

.switch { display: inline-flex; align-items: center; gap: var(--s3); cursor: pointer; font-size: 0.9rem; color: var(--fg-2); user-select: none; }
.switch input { appearance: none; width: 38px; height: 22px; padding: 0; border-radius: 999px; background: #d0d5dd; border: 0; position: relative; cursor: pointer; flex: none; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,0.2); transition: transform 0.2s; }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { transform: translateX(16px); }
.check { display: flex; align-items: flex-start; gap: var(--s3); cursor: pointer; font-size: 0.88rem; color: var(--fg-2); }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--accent); flex: none; padding: 0; }

/* ---------- Kartu ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: var(--s4) var(--s5); border-bottom: 1px solid var(--line-2); }
.card-head .sub { margin: 2px 0 0; font-size: 0.82rem; }
.card-body { padding: var(--s5); }
.stack { display: grid; gap: var(--s5); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: var(--s4); margin-bottom: var(--s5); }
.stat { padding: var(--s5); display: flex; align-items: center; gap: var(--s4); }
.stat-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }
.stat-icon.blue { background: var(--info-soft); color: var(--info); }
.stat-icon.green { background: var(--ok-soft); color: var(--ok); }
.stat-icon.amber { background: var(--warn-soft); color: var(--warn); }
.stat-label { font-size: 0.8rem; color: var(--muted); }
.stat-value { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; font-variant-numeric: tabular-nums; }

/* ---------- Daftar project ---------- */
.create { display: flex; gap: var(--s2); width: min(460px, 100%); }
.create input { flex: 1; }
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--s4); }
.project-card {
  display: flex; flex-direction: column; gap: var(--s4); padding: var(--s5); color: var(--fg);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.project-card:hover { color: var(--fg); transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: #cfe9e5; }
.project-card .tile { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.project-name { font-weight: 650; font-size: 1.02rem; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.project-foot { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 0.82rem; margin-top: auto; }
.project-foot .go { color: var(--accent); transition: transform 0.2s; }
.project-card:hover .go { transform: translateX(3px); }
.section-title { display: flex; align-items: baseline; gap: var(--s2); margin: var(--s6) 0 var(--s3); }
.section-title .count { color: var(--muted); font-size: 0.85rem; }

.empty { text-align: center; padding: var(--s7) var(--s5); color: var(--muted); }
.empty .tile { width: 56px; height: 56px; margin: 0 auto var(--s3); border-radius: 16px; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.empty strong { display: block; color: var(--fg); font-weight: 650; margin-bottom: var(--s1); }

/* ---------- Unggah ---------- */
.dropzone {
  position: relative; display: flex; align-items: center; gap: var(--s4); padding: var(--s5); border-radius: var(--radius);
  border: 1.5px dashed #c9d1dc; background: var(--surface-2); cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.dropzone:hover, .dropzone.drag { border-color: var(--accent); background: var(--accent-soft); }
.dropzone .tile { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; background: #fff; color: var(--accent); border: 1px solid var(--line); flex: none; }
.dropzone.drag .tile { transform: scale(1.06); }
.dz-title { font-weight: 600; color: var(--fg); }
.dz-sub { font-size: 0.83rem; color: var(--muted); }
.dropzone input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: var(--s4); align-items: end; }
.upload-foot { display: flex; align-items: center; gap: var(--s4); flex-wrap: wrap; margin-top: var(--s5); }
.consent { display: flex; gap: var(--s3); padding: var(--s4); border-radius: var(--radius-sm); background: var(--info-soft); border: 1px solid #d1e3ff; margin-top: var(--s4); }
.consent .icon { color: var(--info); margin-top: 2px; }
.bar { height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; }
.bar > span { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, #14b8a6, var(--accent)); transition: width 0.4s ease; }
.bar.indeterminate > span { width: 40%; animation: slide 1.3s ease-in-out infinite; }
@keyframes slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(250%); } }
.upload-progress { flex: 1; min-width: 160px; display: grid; gap: 6px; font-size: 0.82rem; color: var(--muted); }

/* ---------- Tabel rekaman ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th { text-align: left; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); background: var(--surface-2); padding: var(--s3) var(--s5); border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: var(--s4) var(--s5); border-bottom: 1px solid var(--line-2); vertical-align: middle; }
tbody tr { transition: background 0.15s; }
tbody tr:hover { background: #fafbfc; }
tbody tr:last-child td { border-bottom: 0; }
.rec-title { display: flex; align-items: center; gap: var(--s3); min-width: 220px; }
.rec-title .tile { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); flex: none; }
.rec-name { font-weight: 600; color: var(--fg); }
a.rec-name:hover { color: var(--accent); }
.rec-file { font-size: 0.78rem; color: var(--muted); max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-cell { min-width: 190px; }
.status-cell .bar { margin-top: var(--s2); max-width: 200px; }
.err-text { font-size: 0.78rem; color: var(--err); margin-top: 6px; max-width: 300px; }
.actions { display: flex; gap: 2px; justify-content: flex-end; }

.pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 0.78rem; font-weight: 600; white-space: nowrap; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.pill.done { background: var(--ok-soft); color: var(--ok); border-color: #abefc6; }
.pill.failed { background: var(--err-soft); color: var(--err); border-color: #fecdca; }
.pill.active { background: var(--info-soft); color: var(--info); border-color: #d1e3ff; }
.pill.active::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.25; } }

/* ---------- Halaman rekaman ---------- */
.rec-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: var(--s5); align-items: start; }
.rec-aside { display: grid; gap: var(--s5); position: sticky; top: 92px; max-height: calc(100vh - 108px); overflow-y: auto; align-content: start; overscroll-behavior: contain; scrollbar-width: thin; }
.player { position: sticky; top: 68px; z-index: 5; padding: var(--s4) var(--s5); background: rgba(255,255,255,0.92); backdrop-filter: blur(10px); border-radius: var(--radius) var(--radius) 0 0; border-bottom: 1px solid var(--line-2); }
.player video { width: 100%; max-height: 300px; border-radius: 10px; background: #000; display: block; }
.player audio { width: 100%; display: block; }
.player-tools { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); margin-top: var(--s3); flex-wrap: wrap; }
.match-count { font-size: 0.82rem; color: var(--muted); }

.transcript { padding: var(--s3) var(--s3) var(--s4); }
.seg {
  display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: var(--s3);
  padding: var(--s3) var(--s3); border-radius: 10px; position: relative;
  transition: background 0.25s, opacity 0.35s;
}
.seg:hover { background: #fafbfc; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 0.85rem; letter-spacing: 0.02em; }
.seg-head { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; margin-bottom: 2px; }
.seg-who { font-weight: 650; font-size: 0.88rem; }
.seg-time { height: 22px; padding: 0 8px; border-radius: 6px; border: 0; background: var(--surface-2); color: var(--muted); font-size: 0.75rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.seg-time:hover:not(:disabled) { background: var(--accent-soft); color: var(--accent); border: 0; }
.seg-text { color: var(--fg-2); white-space: pre-wrap; overflow-wrap: anywhere; cursor: text; border-radius: 6px; }
.seg-text:hover { background: rgba(15,118,110,0.04); }
.seg-text.edited::after { content: "  · diedit"; color: var(--muted); font-size: 0.75rem; }
mark { background: #fef0c7; color: inherit; border-radius: 3px; padding: 0 1px; }

/* Momen khas: mode fokus saat diputar — ucapan aktif menyala, sisanya meredup */
.transcript.playing .seg { opacity: 0.45; }
.transcript.playing .seg.active, .transcript .seg:hover { opacity: 1; }
.seg.active { background: linear-gradient(90deg, var(--accent-soft), rgba(231,245,243,0.35)); }
.seg.active::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 3px; background: var(--accent); }
.seg.active .seg-text { color: var(--fg); }

.speaker-row { display: grid; grid-template-columns: 32px 1fr; gap: var(--s3); align-items: center; }
.speaker-row + .speaker-row { margin-top: var(--s3); }
.speaker-row .avatar { width: 32px; height: 32px; font-size: 0.78rem; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: var(--s2) var(--s4); font-size: 0.85rem; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; color: var(--fg-2); overflow-wrap: anywhere; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; font: inherit; font-size: 0.9rem; color: var(--fg-2); }

.notice { display: flex; gap: var(--s3); padding: var(--s4); border-radius: var(--radius); background: var(--err-soft); border: 1px solid #fecdca; color: var(--err); }
.notice.warn { background: var(--warn-soft); border-color: #fedf89; color: var(--warn); }

.toast {
  position: fixed; right: var(--s5); bottom: var(--s5); z-index: 50; display: flex; align-items: center; gap: var(--s3);
  background: var(--side); color: #fff; padding: var(--s3) var(--s4); border-radius: 12px; max-width: min(420px, calc(100vw - 32px));
  box-shadow: var(--shadow-lg); animation: rise 0.25s ease-out both; font-size: 0.9rem;
}

.skeleton { border-radius: 10px; background: linear-gradient(90deg, #eceff3 25%, #f5f7f9 50%, #eceff3 75%); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Responsif ---------- */
@media (max-width: 1100px) {
  .rec-layout { grid-template-columns: 1fr; }
  .rec-aside { position: static; max-height: none; overflow: visible; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
}
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: var(--side-w); z-index: 40; transform: translateX(-100%); transition: transform 0.25s ease; }
  body.nav-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
  .scrim { position: fixed; inset: 0; z-index: 30; background: rgba(15, 23, 42, 0.45); }
  .menu-btn { display: inline-flex; }
  .topbar { padding: 0 var(--s4); gap: var(--s3); }
  .topbar-note { display: none; }
  .page { padding: var(--s5) var(--s4) var(--s6); }
  .search kbd { display: none; }
}
@media (max-width: 640px) {
  .stats { grid-template-columns: 1fr 1fr; gap: var(--s3); }
  .stat { padding: var(--s4); gap: var(--s3); }
  .stat-icon { width: 36px; height: 36px; }
  .stat-value { font-size: 1.2rem; }
  .card-body, .card-head { padding: var(--s4); }
  .create { width: 100%; }
  .dropzone { padding: var(--s4); }
  thead { display: none; }
  table, tbody, tr, td { display: block; width: 100%; }
  tbody tr { padding: var(--s3) var(--s4); border-bottom: 1px solid var(--line-2); }
  td { padding: var(--s1) 0; border: 0; }
  td[data-label]::before { content: attr(data-label); display: inline-block; width: 84px; color: var(--muted); font-size: 0.78rem; }
  .actions { justify-content: flex-start; margin-top: var(--s2); }
  .rec-title { min-width: 0; }
  .seg { grid-template-columns: 1fr; }
  .seg .avatar { display: none; }
  .player { top: 68px; padding: var(--s3); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* ---------- Akun, login, dialog, halaman admin ---------- */
.account { display: flex; align-items: center; gap: var(--s2); margin-top: var(--s3); padding: var(--s3); border-radius: var(--radius); background: var(--side-2); }
.account-link { display: flex; align-items: center; gap: var(--s3); min-width: 0; flex: 1; color: var(--side-fg); }
.account-link:hover { color: var(--side-fg-strong); }
.account-text { min-width: 0; }
.account-name { color: var(--side-fg-strong); font-weight: 600; font-size: 0.88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-role { font-size: 0.75rem; }
.account .icon-btn { color: var(--side-fg); }
.account .icon-btn:hover:not(:disabled) { background: rgba(255,255,255,0.08); border-color: transparent; color: #fff; }
.avatar.sm { width: 34px; height: 34px; font-size: 0.8rem; flex: none; }

body.auth-screen .sidebar, body.auth-screen .topbar, body.auth-screen .scrim { display: none !important; }
body.auth-screen .app { grid-template-columns: 1fr; }
body.auth-screen .page { max-width: none; padding: 0; min-height: 100vh; display: grid; place-items: center; }
.auth-wrap { width: min(420px, 100% - 32px); padding: var(--s6) 0; }
.auth-brand { display: flex; align-items: center; gap: var(--s3); justify-content: center; margin-bottom: var(--s5); font-size: 1.3rem; font-weight: 700; letter-spacing: -0.02em; }
.auth-brand .brand-mark { width: 44px; height: 44px; border-radius: 12px; }
.auth-card { padding: var(--s6); }
.auth-card h1 { font-size: 1.4rem; margin-bottom: var(--s1); }
.auth-card .sub { margin-bottom: var(--s5); }
.auth-card .field + .field { margin-top: var(--s4); }
.auth-card .primary { width: 100%; margin-top: var(--s5); }
.form-error { color: var(--err); font-size: 0.85rem; min-height: 1.2em; margin-top: var(--s3); }
.auth-foot { text-align: center; margin-top: var(--s4); font-size: 0.8rem; color: var(--muted); }

dialog.dialog { border: 0; border-radius: var(--radius); padding: 0; width: min(480px, calc(100vw - 32px)); box-shadow: var(--shadow-lg); color: var(--fg); background: var(--surface); }
dialog.dialog::backdrop { background: rgba(15, 23, 42, 0.5); }
.dialog form { display: grid; gap: var(--s4); padding: var(--s5); }
.dialog h2 { font-size: 1.1rem; }
.dialog p { margin: 0; color: var(--fg-2); font-size: 0.92rem; }
.dialog-actions { display: flex; justify-content: flex-end; gap: var(--s2); margin-top: var(--s2); }
.secret { display: flex; gap: var(--s2); align-items: center; padding: var(--s3); border-radius: var(--radius-sm); background: var(--surface-2); border: 1px dashed #c9d1dc; }
.secret code { flex: 1; font-size: 1rem; letter-spacing: 0.02em; overflow-wrap: anywhere; user-select: all; }

.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--s3); align-items: end; padding: var(--s4) var(--s5); border-bottom: 1px solid var(--line-2); }
.tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--line); margin-bottom: var(--s4); }
.tab { height: 34px; border: 0; background: transparent; border-radius: 8px; padding: 0 var(--s4); color: var(--muted); }
.tab[aria-selected="true"] { background: #fff; color: var(--fg); box-shadow: var(--shadow); }
.pill.muted { background: var(--surface-2); color: var(--muted); }
.pill.warn { background: var(--warn-soft); color: var(--warn); border-color: #fedf89; }
.user-cell { display: flex; align-items: center; gap: var(--s3); min-width: 200px; }
.user-sub { font-size: 0.78rem; color: var(--muted); }
.quota-bar { margin-top: 6px; max-width: 120px; }
tr.detail td { background: var(--surface-2); padding: var(--s4) var(--s5); }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s4); }
.detail-grid pre { margin: 0; padding: var(--s3); border-radius: var(--radius-sm); background: #fff; border: 1px solid var(--line); font-size: 0.8rem; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 260px; overflow: auto; }
.detail-grid h3 { margin: 0 0 var(--s1); font-size: 0.75rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.log-summary { max-width: 420px; overflow-wrap: anywhere; }
.narrow { max-width: 640px; }
.hint-list { margin: var(--s2) 0 0; padding-left: var(--s5); color: var(--muted); font-size: 0.82rem; }
.session-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: var(--s3) 0; border-bottom: 1px solid var(--line-2); }
.session-row:last-child { border-bottom: 0; }
@media (max-width: 640px) { .detail-grid { grid-template-columns: 1fr; } .filters { padding: var(--s4); } }
.primary.danger-fill { background: var(--err); border-color: var(--err); box-shadow: none; }
.primary.danger-fill:hover:not(:disabled) { background: #912018; border-color: #912018; }

.summary { font-size: 0.92rem; color: var(--fg-2); line-height: 1.55; }
.summary h4 { margin: var(--s4) 0 var(--s1); font-size: 0.78rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--accent); }
.summary h4:first-child { margin-top: 0; }
.summary p { margin: 0 0 var(--s2); }
.summary ul { margin: 0 0 var(--s2); padding-left: 1.1rem; display: grid; gap: 4px; }

.member-list { display: grid; gap: var(--s3); }
.member-row { display: grid; grid-template-columns: 36px 1fr auto auto; gap: var(--s3); align-items: center; }
.member-row .avatar { width: 36px; height: 36px; font-size: 0.8rem; background: var(--accent); }
.member-info { display: grid; min-width: 0; }
.member-info strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.live-bar { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; }
.live-timer { font-size: 1.5rem; font-weight: 650; letter-spacing: 0.02em; }
.live-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--err); box-shadow: 0 0 0 0 rgba(217, 45, 32, 0.5); animation: live-pulse 1.4s infinite; }
.live-dot.paused { background: var(--muted); animation: none; }
.live-meter { flex: 1; min-width: 120px; max-width: 280px; }
.live-meter > span { transition: width 0.08s linear; }
.live-actions { display: flex; gap: var(--s2); flex-wrap: wrap; margin: var(--s4) 0; }
.live-box { max-height: 340px; overflow-y: auto; padding: var(--s4); border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); display: grid; gap: var(--s2); align-content: start; }
.live-line { margin: 0; font-size: 0.92rem; color: var(--fg-2); }
.live-time { color: var(--muted); font-size: 0.78rem; margin-right: var(--s2); }
@keyframes live-pulse { 70% { box-shadow: 0 0 0 10px rgba(217, 45, 32, 0); } 100% { box-shadow: 0 0 0 0 rgba(217, 45, 32, 0); } }
