:root {
  --bg: #07090d;
  --surface: #0d1117;
  --surface-2: #121821;
  --surface-3: #18212b;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.15);
  --text: #f4f7f8;
  --muted: #7f8b99;
  --muted-2: #aab4be;
  --accent: #6ee7b7;
  --accent-strong: #34d399;
  --accent-soft: rgba(52, 211, 153, 0.12);
  --blue: #60a5fa;
  --warn: #f5c451;
  --danger: #ff6b76;
  --radius: 16px;
  --radius-sm: 11px;
  --font: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font-family: var(--font); }
body { overflow: hidden; }
button, input, select { font: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible, .dropzone:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.ambient { position: fixed; border-radius: 999px; filter: blur(100px); opacity: .11; pointer-events: none; }
.ambient-one { width: 430px; height: 430px; background: #11b981; top: -260px; left: 10%; }
.ambient-two { width: 360px; height: 360px; background: #6257d8; bottom: -280px; right: 18%; }

.app {
  position: relative;
  z-index: 1;
  width: min(1600px, 100%);
  height: 100dvh;
  margin: 0 auto;
  padding: 18px 22px 22px;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 18px;
}
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 54px; }
.brand-block, .brand-row, .top-actions, .health-pill, .rtsp-bar,
.stage-meta, .live-cluster, .transport, .transport-group, .signal-strip,
.panel-head, .gap-input, .dropzone { display: flex; align-items: center; }
.brand-block { gap: 12px; }
.brand-mark {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  padding: 9px;
  border: 1px solid rgba(110, 231, 183, .28);
  border-radius: 11px;
  background: linear-gradient(145deg, rgba(110, 231, 183, .14), rgba(110, 231, 183, .03));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08);
}
.brand-mark span { width: 3px; border-radius: 3px; background: var(--accent); }
.brand-mark span:nth-child(1) { height: 9px; opacity: .55; }
.brand-mark span:nth-child(2) { height: 18px; }
.brand-mark span:nth-child(3) { height: 13px; opacity: .75; }
.brand-row { gap: 8px; }
.brand { color: var(--text); font-size: 15px; font-weight: 700; letter-spacing: -.02em; }
.environment { padding: 2px 6px; border: 1px solid var(--line); border-radius: 5px; color: var(--muted); font: 500 8px/1.4 var(--mono); letter-spacing: .12em; }
h1 { margin: 2px 0 0; color: var(--muted); font-size: 11px; font-weight: 500; }

.top-actions { gap: 12px; min-width: 0; }
.health-pill { gap: 8px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted-2); font-size: 11px; white-space: nowrap; }
.health-dot, .meta-dot {
  width: 6px;
  height: 6px;
  display: inline-block;
  border-radius: 50%;
  background: var(--accent-strong);
  box-shadow: 0 0 0 4px rgba(52, 211, 153, .09);
}
.rtsp-bar {
  min-width: 360px;
  max-width: 520px;
  gap: 8px;
  padding: 5px 5px 5px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(13, 17, 23, .78);
}
.rtsp-copy { flex: 1; min-width: 0; display: grid; gap: 2px; }
.rtsp-label, .eyebrow, .signal-label { color: var(--muted); font: 500 8px/1.2 var(--mono); letter-spacing: .14em; }
.rtsp-bar input { width: 100%; min-width: 0; padding: 0; border: 0; outline: 0; background: transparent; color: var(--muted-2); font: 400 10px/1.4 var(--mono); }

.workspace { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(340px, .72fr); gap: 16px; min-height: 0; }
.stage, .side { min-width: 0; min-height: 0; }
.stage { display: grid; grid-template-rows: auto 1fr auto; gap: 12px; }
.side { display: flex; flex-direction: column; gap: 12px; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; min-height: 38px; }
.section-heading h2, .panel-head h2 { margin: 4px 0 0; font-size: 17px; line-height: 1.1; font-weight: 600; letter-spacing: -.03em; }
.stage-meta { gap: 16px; color: var(--muted); font-size: 10px; }
.stage-meta span { display: flex; align-items: center; gap: 7px; }

.preview-wrap {
  position: relative;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background: #020304;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.03);
  isolation: isolate;
}
.preview-wrap::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(255,255,255,.025); pointer-events: none; }
#preview { width: 100%; height: 100%; object-fit: contain; background: #030405; pointer-events: none; }
.screen-grid {
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: .16;
  background-image: linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 36px 36px;
}
.state-layer {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: radial-gradient(circle at center, rgba(21,28,35,.62), rgba(2,3,4,.92));
  color: var(--muted-2);
  font-size: 13px;
  pointer-events: none;
  transition: opacity .2s ease;
}
.state-layer.hidden { opacity: 0; }
.state-hint { color: #59636e; font-size: 11px; }
.state-symbol { width: 42px; height: 42px; margin-bottom: 7px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 50%; background: rgba(255,255,255,.025); }
.state-symbol span { width: 8px; height: 8px; border-radius: 50%; background: #4c5661; box-shadow: 0 0 0 7px rgba(255,255,255,.025); }
.gap-count { color: var(--text); font: 500 32px/1 var(--mono); letter-spacing: -.04em; }
.gap-count.hidden, .hidden { display: none !important; }

.chrome {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 3;
  display: flex;
  opacity: 0;
  pointer-events: none;
  transform: translateY(3px);
  transition: opacity .18s ease, transform .18s ease;
}
.preview-wrap:hover .chrome, .preview-wrap.show-chrome .chrome,
.preview-wrap.is-idle .chrome, .preview-wrap.is-gap .chrome, .preview-wrap.is-paused .chrome {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}
.top-chrome { top: 0; align-items: center; justify-content: space-between; gap: 12px; padding: 17px 18px 42px; background: linear-gradient(to bottom, rgba(0,0,0,.83), transparent); }
.live-cluster { gap: 7px; }
.now-title { max-width: 55%; overflow: hidden; color: rgba(255,255,255,.9); font-size: 12px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; text-shadow: 0 1px 4px #000; }
.badge, .live-tag {
  flex-shrink: 0;
  padding: 5px 8px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 6px;
  background: rgba(5,7,10,.72);
  font: 500 9px/1 var(--mono);
  letter-spacing: .09em;
  text-transform: uppercase;
  backdrop-filter: blur(12px);
}
.badge.idle { color: var(--muted-2); }
.badge.playing { color: #04130d; border-color: var(--accent); background: var(--accent); }
.badge.paused { color: var(--warn); border-color: rgba(245,196,81,.4); }
.badge.gap { color: var(--blue); border-color: rgba(96,165,250,.45); }
.live-tag { color: var(--accent); border-color: rgba(110,231,183,.35); }
.live-tag.off { color: var(--muted); border-color: rgba(255,255,255,.12); }

.bottom-chrome { bottom: 0; flex-direction: column; gap: 13px; padding: 46px 18px 17px; background: linear-gradient(to top, rgba(0,0,0,.94), rgba(0,0,0,.52) 60%, transparent); }
.timeline { display: grid; grid-template-columns: 38px 1fr 38px; gap: 9px; align-items: center; user-select: none; }
.timeline .time { color: rgba(255,255,255,.65); font: 400 9px/1 var(--mono); }
.timeline .time:last-child { text-align: right; }
.timeline .bar { position: relative; height: 3px; border-radius: 999px; background: rgba(255,255,255,.18); }
.timeline .fill { width: 0; height: 100%; border-radius: inherit; background: var(--accent); box-shadow: 0 0 10px rgba(110,231,183,.4); }
.timeline .thumb { position: absolute; top: 50%; left: 0; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; border: 2px solid #fff; border-radius: 50%; background: var(--accent); }
.transport { justify-content: space-between; gap: 12px; }
.transport-group { gap: 6px; }
.transport-right { margin-left: auto; }
.play-icon { font-size: 9px; }
.stop-icon { width: 7px; height: 7px; border-radius: 1px; background: currentColor; }

.signal-strip { min-height: 54px; gap: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: rgba(13,17,23,.74); }
.signal-item { min-width: 132px; padding: 0 17px; display: grid; gap: 5px; border-right: 1px solid var(--line); }
.signal-item strong { font-size: 11px; font-weight: 500; }
.signal-grow { flex: 1; }
.signal-bars { height: 26px; padding: 0 17px; display: flex; align-items: flex-end; gap: 3px; }
.signal-bars i { width: 3px; border-radius: 2px; background: var(--accent); opacity: .8; animation: signal 1.3s ease-in-out infinite alternate; }
.signal-bars i:nth-child(1) { height: 7px; animation-delay: -.7s; }
.signal-bars i:nth-child(2) { height: 15px; animation-delay: -.2s; }
.signal-bars i:nth-child(3) { height: 10px; animation-delay: -.9s; }
.signal-bars i:nth-child(4) { height: 21px; animation-delay: -.4s; }
.signal-bars i:nth-child(5) { height: 13px; animation-delay: -.6s; }
.signal-bars i:nth-child(6) { height: 5px; animation-delay: -.1s; }
@keyframes signal { to { transform: scaleY(.45); opacity: .25; } }

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(13,17,23,.86);
  box-shadow: 0 18px 50px rgba(0,0,0,.18), inset 0 1px 0 rgba(255,255,255,.025);
  backdrop-filter: blur(18px);
}
.settings-panel { flex: 0 0 auto; padding: 15px; }
.lists-panel { flex: 1 1 auto; min-height: 0; padding: 15px; display: flex; flex-direction: column; gap: 12px; }
.panel-head { justify-content: space-between; gap: 12px; padding-bottom: 12px; }
.panel-icon { color: var(--muted); font: 20px/1 var(--mono); }
.library-head { padding-bottom: 2px; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.setting-row:last-child { padding-bottom: 0; }
.setting-label { min-width: 0; display: grid; gap: 3px; }
.setting-label span { font-size: 12px; font-weight: 500; }
.setting-label small { color: var(--muted); font-size: 9px; }
.gap-input { gap: 5px; flex-shrink: 0; }
.gap-input input, .gap-input select { height: 32px; border: 1px solid var(--line); border-radius: 8px; background: #090c11; color: var(--text); font-size: 10px; }
.gap-input input { width: 54px; padding: 0 8px; font-family: var(--mono); }
.gap-input select { padding: 0 7px; color: var(--muted-2); }
.switch { position: relative; width: 40px; height: 23px; flex-shrink: 0; cursor: pointer; }
.switch input { width: 0; height: 0; opacity: 0; }
.slider { position: absolute; inset: 0; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface-3); transition: .2s ease; }
.slider::before { content: ""; position: absolute; top: 3px; left: 3px; width: 15px; height: 15px; border-radius: 50%; background: #77828d; transition: .2s ease; }
.switch input:checked + .slider { border-color: rgba(52,211,153,.5); background: var(--accent-soft); }
.switch input:checked + .slider::before { transform: translateX(17px); background: var(--accent); box-shadow: 0 0 8px rgba(110,231,183,.35); }

.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: #090c11; }
.tab { min-height: 33px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-size: 10px; font-weight: 500; cursor: pointer; transition: .15s ease; }
.tab:hover { color: var(--text); }
.tab.active { background: var(--surface-3); color: var(--text); box-shadow: inset 0 1px 0 rgba(255,255,255,.05); }
.tab-count { margin-left: 5px; padding: 1px 6px; border-radius: 999px; background: rgba(255,255,255,.07); color: var(--muted-2); font: 500 9px/1.5 var(--mono); }
.tab.active .tab-count { background: var(--accent-soft); color: var(--accent); }
.tab-pane { display: none; flex: 1; min-height: 0; flex-direction: column; gap: 8px; }
.tab-pane.active { display: flex; }

.dropzone {
  min-height: 60px;
  gap: 10px;
  padding: 10px 12px;
  border: 1px dashed rgba(255,255,255,.15);
  border-radius: var(--radius-sm);
  background: linear-gradient(100deg, rgba(110,231,183,.035), transparent);
  cursor: pointer;
  transition: .16s ease;
}
.dropzone:hover, .dropzone.dragover { border-color: rgba(110,231,183,.7); background: var(--accent-soft); }
.dz-icon { width: 32px; height: 32px; flex: 0 0 auto; display: grid; place-items: center; border: 1px solid rgba(110,231,183,.22); border-radius: 9px; background: rgba(110,231,183,.08); color: var(--accent); font-size: 18px; }
.dz-copy { min-width: 0; display: grid; gap: 2px; }
.dz-title { font-size: 11px; font-weight: 600; }
.dz-sub { overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }

.upload-queue {
  position: fixed;
  right: 22px;
  bottom: 72px;
  z-index: 45;
  width: min(380px, calc(100vw - 32px));
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(110,231,183,.35);
  border-radius: 12px;
  background: #121820;
  box-shadow: 0 16px 40px rgba(0,0,0,.45);
}
.upload-queue.hidden { display: none !important; }
.dropzone.is-uploading {
  border-color: rgba(110,231,183,.7);
  background: var(--accent-soft);
  pointer-events: none;
}
.dropzone.is-uploading .dz-title::after { content: " · đang tải…"; color: var(--accent); }
.upload-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.upload-title { display: block; font-size: 11px; font-weight: 600; }
.upload-sub { display: block; margin-top: 2px; color: var(--muted); font: 400 9px/1.3 var(--mono); }
.upload-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; max-height: 180px; overflow: auto; }
.upload-item { display: grid; gap: 6px; padding: 7px 8px; border: 1px solid transparent; border-radius: 8px; background: rgba(0,0,0,.22); }
.upload-item.status-done { border-color: rgba(110,231,183,.28); }
.upload-item.status-error, .upload-item.status-cancelled { border-color: rgba(255,107,118,.35); }
.upload-item-top { display: flex; align-items: center; gap: 8px; }
.upload-item-body { min-width: 0; flex: 1; }
.upload-item-name { overflow: hidden; font-size: 10px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.upload-item-meta { margin-top: 2px; color: var(--muted); font: 400 8px/1.2 var(--mono); }
.upload-item.status-error .upload-item-meta,
.upload-item.status-cancelled .upload-item-meta { color: #ff8d96; }
.upload-bar {
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
}
.upload-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #34d399, #6ee7b7);
  transition: width .12s ease;
}
.upload-item.status-error .upload-bar span,
.upload-item.status-cancelled .upload-bar span { background: #ff6b76; }
.playlist-note { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,.018); color: var(--muted); font-size: 9px; }
.playlist-note span { margin-right: 5px; color: var(--accent); }

.list { list-style: none; margin: 0; padding: 0 2px 0 0; display: flex; flex: 1; min-height: 0; flex-direction: column; gap: 6px; overflow: auto; scrollbar-width: thin; scrollbar-color: #29313b transparent; }
.item { display: grid; grid-template-columns: 32px minmax(0,1fr) auto; gap: 9px; align-items: center; min-height: 51px; padding: 7px 8px; border: 1px solid transparent; border-radius: 10px; background: rgba(255,255,255,.025); transition: .15s ease; }
.item:hover { border-color: var(--line); background: rgba(255,255,255,.045); }
.item.active { border-color: rgba(110,231,183,.42); background: rgba(52,211,153,.07); }
.item.next { border-color: rgba(96,165,250,.36); }
.item.clickable { cursor: pointer; }
.item-index { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; background: #090c11; color: var(--muted); font: 500 9px/1 var(--mono); }
.item.active .item-index { background: var(--accent); color: #04130d; }
.item-body { min-width: 0; }
.item-title { overflow: hidden; color: #dce2e7; font-size: 10px; font-weight: 500; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.item-meta { margin-top: 3px; color: var(--muted); font: 400 8px/1.2 var(--mono); }
.playing-label { color: var(--accent); }
.next-label { color: var(--blue); }
.item-actions { display: flex; gap: 3px; justify-content: flex-end; }
.item-actions .btn { min-width: 27px; padding: 0 7px; }
.empty { margin-top: 4px; padding: 25px 10px; border: 1px dashed var(--line); border-radius: 10px; color: var(--muted); font-size: 10px; text-align: center; }

.btn {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, transform .1s ease, opacity .15s ease;
}
.btn:hover:not(:disabled) { border-color: rgba(255,255,255,.25); background: var(--surface-3); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .3; cursor: not-allowed; }
.btn-primary { border-color: var(--accent); background: var(--accent); color: #05140e; box-shadow: 0 7px 22px rgba(52,211,153,.13); }
.btn-primary:hover:not(:disabled) { border-color: #90f4cd; background: #7decc0; }
.btn-soft { background: rgba(255,255,255,.035); }
.btn-ghost { background: transparent; color: var(--muted-2); }
.btn-ghost:hover:not(:disabled) { background: rgba(255,255,255,.05); color: var(--text); }
.btn-danger { border-color: rgba(255,107,118,.18); background: rgba(255,107,118,.06); color: var(--danger); }
.btn-danger:hover:not(:disabled) { border-color: rgba(255,107,118,.45); background: rgba(255,107,118,.11); }
.btn-stop { min-width: 64px; border-color: rgba(255,107,118,.25); background: rgba(255,107,118,.1); color: #ff8992; }
.btn-icon { width: 34px; padding: 0; color: var(--muted-2); font-family: var(--mono); }
.btn-start { min-width: 108px; }
.btn-sm { min-height: 30px; padding: 0 9px; font-size: 9px; }
.btn-block { width: 100%; }
.btn-copy { min-height: 34px; padding: 0 10px; border-color: transparent; }

body.viewer-open { overflow: hidden; }
.viewer { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 24px; }
.viewer-backdrop { position: absolute; inset: 0; background: rgba(1,3,5,.82); backdrop-filter: blur(10px); animation: viewer-fade .16s ease-out; }
.viewer-card {
  position: relative;
  z-index: 1;
  width: min(920px, 94vw);
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 17px;
  background: #0b0f14;
  box-shadow: 0 35px 100px rgba(0,0,0,.62);
  animation: viewer-rise .2s ease-out;
}
.viewer-head { min-height: 68px; padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); }
.viewer-head h2 { margin: 4px 0 0; font-size: 16px; font-weight: 600; }
.viewer-close { flex: 0 0 auto; color: var(--muted-2); font-size: 22px; font-weight: 400; }
.viewer-screen { width: 100%; aspect-ratio: 16 / 9; display: grid; place-items: center; background: #000; }
#libraryPreview { width: 100%; height: 100%; object-fit: contain; background: #000; }
.viewer-footer { min-height: 58px; padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.viewer-footer strong { min-width: 0; overflow: hidden; font-size: 13px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.viewer-footer span { flex: 0 0 auto; color: var(--muted-2); font: 400 10px/1.4 var(--mono); }
@keyframes viewer-fade { from { opacity: 0; } }
@keyframes viewer-rise { from { opacity: 0; transform: translateY(10px) scale(.985); } }

.toast { position: fixed; right: 22px; bottom: 22px; z-index: 50; max-width: 360px; padding: 11px 14px; border: 1px solid rgba(110,231,183,.28); border-radius: 10px; background: #121820; color: var(--text); box-shadow: var(--shadow); font-size: 11px; }
.toast.error { border-color: rgba(255,107,118,.48); }

/* Readability pass */
.environment { font-size: 9px; letter-spacing: .1em; }
h1 { color: var(--muted-2); font-size: 12px; }
.health-pill { font-size: 12px; }
.rtsp-label, .eyebrow, .signal-label { color: var(--muted-2); font-size: 9px; letter-spacing: .11em; }
.rtsp-bar input { color: #c8d0d7; font-size: 11px; }
.stage-meta { color: var(--muted-2); font-size: 11px; }
.state-hint { color: var(--muted); font-size: 12px; }
.badge, .live-tag { font-size: 10px; }
.now-title { color: rgba(255,255,255,.94); font-size: 13px; font-weight: 600; }
.timeline .time { color: rgba(255,255,255,.76); font-size: 10px; }
.signal-item strong { font-size: 12px; font-weight: 600; }
.setting-label span { font-size: 13px; font-weight: 600; }
.setting-label small { color: var(--muted-2); font-size: 10px; line-height: 1.4; }
.gap-input input, .gap-input select { height: 34px; font-size: 12px; }
.tab { min-height: 36px; color: var(--muted-2); font-size: 12px; font-weight: 600; }
.tab-count { font-size: 10px; }
.dropzone { min-height: 76px; }
.dz-title { font-size: 13px; }
.dz-sub { color: var(--muted-2); font-size: 10px; line-height: 1.4; }
.playlist-note { color: var(--muted-2); font-size: 10px; line-height: 1.4; }
.item-index { color: var(--muted-2); font-size: 10px; }
.item-title { color: #eef2f5; font-size: 12px; line-height: 1.4; }
.item-meta { color: var(--muted-2); font-size: 9px; line-height: 1.3; }
.empty, .btn, .toast { font-size: 12px; }
.btn-sm { min-height: 32px; font-size: 11px; }

@media (max-width: 1080px) {
  body { overflow: auto; }
  .app { height: auto; min-height: 100dvh; }
  .workspace { grid-template-columns: 1fr; }
  .preview-wrap { min-height: min(58vw, 560px); }
  .lists-panel { min-height: 430px; }
  .side { display: grid; grid-template-columns: minmax(310px,.7fr) 1fr; }
}
@media (max-width: 760px) {
  .app { padding: 14px; gap: 14px; }
  .topbar { align-items: flex-start; }
  .top-actions { width: 100%; }
  .health-pill { display: none; }
  .rtsp-bar { min-width: 0; flex: 1; }
  .side { display: flex; }
  .preview-wrap { min-height: 54vw; border-radius: 14px; }
  .signal-item { min-width: 0; flex: 1; padding: 0 10px; }
  .signal-item:nth-child(3), .signal-bars { display: none; }
}
@media (max-width: 540px) {
  .topbar { flex-direction: column; }
  .top-actions { width: 100%; }
  .brand-mark { width: 34px; height: 34px; }
  .section-heading { align-items: center; }
  .stage-meta span:last-child { display: none; }
  .preview-wrap { min-height: 62vw; }
  .bottom-chrome { padding: 32px 10px 10px; }
  .top-chrome { padding: 10px 10px 28px; }
  .transport { align-items: flex-end; }
  .transport-group { flex-wrap: wrap; }
  .transport-right { flex-direction: column; align-items: stretch; }
  .btn-start { min-width: 92px; }
  .setting-row { align-items: flex-start; flex-direction: column; }
  .gap-input { width: 100%; }
  .gap-input input, .gap-input select { flex: 1; }
  .item { grid-template-columns: 30px minmax(0,1fr); }
  .item-actions { grid-column: 2; justify-content: flex-start; }
  .viewer { padding: 10px; }
  .viewer-card { width: 100%; border-radius: 13px; }
  .viewer-footer { align-items: flex-start; flex-direction: column; gap: 5px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
