:root {
  --bg: #0f0f0f;
  --card: #272727;
  --card-hover: #3f3f3f;
  --text: #fff;
  --text-secondary: #aaa;
  --border: #303030;
  --accent: #ff0000;
  --success: #4ade80;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: Roboto, "Segoe UI", -apple-system, Arial, sans-serif;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }

/* Header */
.header {
  position: fixed; top: 0; left: 0; right: 0; height: 56px;
  background: var(--bg);
  display: flex; align-items: center; padding: 0 16px; z-index: 100;
  border-bottom: 1px solid transparent;
}
.header-left { display: flex; align-items: center; gap: 16px; width: 240px; }
.menu-btn { color: var(--text); }
.logo {
  display: flex; align-items: center; gap: 4px;
  font-size: 20px; font-weight: 700; letter-spacing: -1px;
}
.logo-mark {
  width: 32px; height: 22px; background: var(--accent);
  border-radius: 6px; display: flex; align-items: center; justify-content: center;
}
.logo-play {
  width: 0; height: 0;
  border-top: 9px solid #fff;
  border-left: 5px solid transparent; border-right: 5px solid transparent;
  margin-top: 2px;
}

.header-center { flex: 1; display: flex; justify-content: center; padding: 0 40px; }
.search-container { display: flex; max-width: 640px; width: 100%; }
.search-box {
  flex: 1; display: flex; align-items: center;
  background: #121212; border: 1px solid var(--border);
  border-radius: 40px 0 0 40px; padding: 0 16px; height: 40px;
}
.search-box input {
  flex: 1; background: none; border: none; color: var(--text);
  font-size: 16px; outline: none;
}
.search-btn {
  width: 64px; height: 40px; background: #222;
  border: 1px solid var(--border); border-left: none;
  border-radius: 0 40px 40px 0;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  color: var(--text);
}
.search-btn:hover { background: #303030; }

.header-right {
  display: flex; align-items: center; gap: 8px;
  width: 225px; justify-content: flex-end;
}
.icon-btn {
  width: 40px; height: 40px; display: flex;
  align-items: center; justify-content: center;
  border-radius: 50%; cursor: pointer; border: none; background: none;
  color: var(--text);
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.1); }
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, #8e44ad, #3498db);
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 14px; cursor: pointer;
}

/* Sidebar */
.sidebar {
  position: fixed; top: 56px; left: 0;
  width: 240px; height: calc(100vh - 56px);
  overflow-y: auto; padding: 12px 0; background: var(--bg);
}
.sidebar-section { padding: 12px 0; border-bottom: 1px solid var(--border); }
.sidebar-section:last-child { border-bottom: none; }
.sidebar-item {
  display: flex; align-items: center; gap: 24px; height: 40px;
  font-size: 14px; cursor: pointer; border-radius: 10px;
  margin: 0 12px; padding: 0 12px; color: var(--text);
}
.sidebar-item:hover { background: var(--card); }
.sidebar-item.active { background: var(--card); font-weight: 500; }
.sidebar-item .icon {
  width: 24px; height: 24px; display: flex;
  align-items: center; justify-content: center; flex-shrink: 0;
}
.sidebar-heading {
  font-size: 16px; font-weight: 500;
  padding: 8px 24px; color: var(--text);
}
.sub-item {
  display: flex; align-items: center; gap: 12px;
  height: 40px; cursor: pointer;
  margin: 0 12px; padding: 0 12px;
  border-radius: 10px; color: var(--text);
  font-size: 14px; text-decoration: none;
}
.sub-item:hover { background: var(--card); }
.sub-item.active { background: var(--card); font-weight: 500; }
.sub-item .sub-avatar {
  width: 24px; height: 24px; border-radius: 50%;
  flex-shrink: 0; overflow: hidden;
  background: linear-gradient(135deg, #555, #333);
}
.sub-item .sub-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sub-item .sub-name {
  flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Main */
.main { margin-left: 240px; margin-top: 56px; padding: 24px; min-height: calc(100vh - 56px); }

/* Loading */
.loading {
  display: flex; align-items: center; justify-content: center;
  min-height: 50vh;
}
.spinner {
  width: 48px; height: 48px;
  border: 3px solid var(--card); border-top-color: var(--accent);
  border-radius: 50%; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Sign-in state */
.signin-card {
  max-width: 480px; margin: 80px auto; padding: 40px;
  background: var(--card); border-radius: 16px; text-align: center;
}
.signin-card h1 { font-size: 28px; margin-bottom: 12px; }
.signin-card p { color: var(--text-secondary); margin-bottom: 24px; line-height: 1.5; }
.signin-btn {
  display: inline-flex; align-items: center; gap: 12px;
  background: #fff; color: #3c4043;
  padding: 12px 24px; border-radius: 8px; border: none;
  font-size: 16px; font-weight: 500; cursor: pointer;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}
.signin-btn:hover { background: #f8f9fa; }

/* View headers */
.view-heading {
  font-size: 24px; font-weight: 600; margin-bottom: 20px;
}

/* Grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 40px 16px;
}
.video-card { cursor: pointer; }
.thumbnail {
  position: relative; width: 100%; aspect-ratio: 16/9;
  background: var(--card); border-radius: 12px; overflow: hidden;
}
.thumbnail img { width: 100%; height: 100%; object-fit: cover; display: block; }
.runtime {
  position: absolute; bottom: 8px; right: 8px;
  background: rgba(0,0,0,0.85); color: #fff;
  font-size: 12px; font-weight: 500; padding: 3px 4px; border-radius: 4px;
}
.shortened-badge {
  position: absolute; top: 8px; left: 8px;
  background: rgba(204,0,0,0.95); color: #fff;
  font-size: 11px; font-weight: 700; padding: 3px 6px;
  border-radius: 4px; letter-spacing: 0.5px;
}
.video-meta { display: flex; gap: 12px; margin-top: 12px; }
.channel-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  flex-shrink: 0; overflow: hidden;
  background: linear-gradient(135deg, #555, #333);
}
.channel-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.video-info { flex: 1; min-width: 0; }
.video-title {
  font-size: 14px; font-weight: 500; line-height: 20px;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
  margin-bottom: 4px;
}
.video-channel { font-size: 12px; color: var(--text-secondary); margin-bottom: 2px; }
.video-stats { font-size: 12px; color: var(--text-secondary); }

/* Card shorten button overlay */
.shorten-btn {
  position: absolute; bottom: 8px; left: 8px; right: 8px;
  padding: 10px; background: rgba(255,255,255,0.95); color: #000;
  border: none; border-radius: 8px; font-weight: 600; font-size: 13px;
  cursor: pointer; opacity: 0; transition: opacity 0.15s;
}
.video-card:hover .shorten-btn { opacity: 1; }
.shorten-btn:hover { background: #fff; }

/* Watch page */
.watch-wrap {
  display: grid; grid-template-columns: minmax(0, 1fr) 420px;
  gap: 24px; padding: 0 0 40px 0; max-width: 1600px; margin: 0 auto;
}
.player-wrap {
  width: 100%; aspect-ratio: 16/9; background: #000;
  border-radius: 12px; overflow: hidden; position: relative;
}
.player-wrap iframe, .player-wrap video {
  width: 100%; height: 100%; border: none;
}
.title { font-size: 20px; font-weight: 600; line-height: 28px; margin: 16px 0 12px 0; }
.meta-row {
  display: flex; align-items: center; gap: 16px;
  padding: 12px 0; border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.channel-row {
  display: flex; align-items: center; gap: 12px;
  flex: 1; min-width: 250px;
}
.channel-avatar-lg {
  width: 40px; height: 40px; border-radius: 50%; overflow: hidden;
  background: linear-gradient(135deg, #555, #333);
}
.channel-avatar-lg img { width: 100%; height: 100%; object-fit: cover; display: block; }
.channel-name { font-size: 15px; font-weight: 600; }
.channel-subs { font-size: 12px; color: var(--text-secondary); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.action-btn {
  background: var(--card); color: #fff; border: 1px solid transparent;
  padding: 0 16px; height: 36px; border-radius: 18px;
  font-size: 14px; font-weight: 500; cursor: pointer;
  display: flex; align-items: center; gap: 8px;
  transition: background 0.15s, border-color 0.15s, transform 0.08s;
}
.action-btn:hover { background: var(--card-hover); }
.action-btn:active { transform: scale(0.97); }
.action-btn.liked { background: var(--card-hover); }

.action-btn.ab-nav {
  background: rgba(96, 165, 250, 0.14); color: #bfdbfe;
  border-color: rgba(96, 165, 250, 0.22);
}
.action-btn.ab-nav:hover { background: rgba(96, 165, 250, 0.22); color: #dbeafe; }

.action-btn.ab-heart {
  background: rgba(244, 114, 182, 0.14); color: #fbcfe8;
  border-color: rgba(244, 114, 182, 0.22);
}
.action-btn.ab-heart:hover { background: rgba(244, 114, 182, 0.22); color: #fce7f3; }
.action-btn.ab-heart.liked { background: rgba(244, 114, 182, 0.3); color: #fff; }

.action-btn.ab-link {
  background: rgba(167, 139, 250, 0.14); color: #ddd6fe;
  border-color: rgba(167, 139, 250, 0.22);
}
.action-btn.ab-link:hover { background: rgba(167, 139, 250, 0.22); color: #ede9fe; }

.shortened-stat {
  background: #121212;
  border: 1px solid var(--border); border-radius: 12px;
  padding: 12px; margin: 16px 0;
  display: flex; justify-content: space-between; align-items: stretch;
  flex-wrap: wrap; gap: 10px;
}
.stat-block {
  flex: 1; min-width: 140px;
  padding: 12px 16px; border-radius: 10px;
  border: 1px solid transparent;
}
.stat-block .label {
  font-size: 11px; color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: 0.5px;
}
.stat-block .value { font-size: 18px; font-weight: 600; margin-top: 2px; }
.stat-arrow { font-size: 20px; color: var(--text-secondary); align-self: center; }

.sb-original {
  background: rgba(148, 163, 184, 0.1);
  border-color: rgba(148, 163, 184, 0.18);
}
.sb-original .label { color: #cbd5e1; }

.sb-shortened {
  background: rgba(251, 191, 36, 0.1);
  border-color: rgba(251, 191, 36, 0.2);
}
.sb-shortened .label { color: #fde68a; }

.sb-saved {
  background: rgba(74, 222, 128, 0.12);
  border-color: rgba(74, 222, 128, 0.22);
}
.sb-saved .label { color: #bbf7d0; }
.savings { color: var(--success); font-weight: 600; }

.desc-box {
  background: var(--card); border-radius: 12px;
  padding: 12px; margin-top: 12px;
  font-size: 14px; line-height: 20px;
}
.desc-header { font-weight: 600; margin-bottom: 8px; }
.topic-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.tag {
  background: var(--card-hover); color: #fff;
  padding: 4px 10px; border-radius: 8px; font-size: 13px;
}

/* Up next */
.up-next h3 { font-size: 16px; font-weight: 600; margin-bottom: 12px; padding: 0 8px; }
.mini-card {
  display: flex; gap: 8px; padding: 8px;
  border-radius: 12px; cursor: pointer; margin-bottom: 4px;
}
.mini-card:hover { background: var(--card); }
.mini-thumb {
  width: 168px; aspect-ratio: 16/9; border-radius: 8px;
  overflow: hidden; flex-shrink: 0; position: relative;
  background: var(--card);
}
.mini-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mini-runtime {
  position: absolute; bottom: 4px; right: 4px;
  background: rgba(0,0,0,0.85); color: #fff;
  font-size: 11px; padding: 2px 4px; border-radius: 3px;
}
.mini-shortened {
  position: absolute; top: 4px; left: 4px;
  background: rgba(204,0,0,0.95); color: #fff;
  font-size: 9px; font-weight: 700; padding: 2px 4px;
  border-radius: 3px; letter-spacing: 0.5px;
}
.mini-info { flex: 1; min-width: 0; }
.mini-title {
  font-size: 14px; font-weight: 500; line-height: 18px;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 4px;
}
.mini-channel { font-size: 12px; color: var(--text-secondary); }
.mini-stats { font-size: 12px; color: var(--text-secondary); }

/* Jobs table */
.jobs-list { display: flex; flex-direction: column; gap: 8px; }
.job-wrap {
  background: var(--card); border-radius: 10px; overflow: hidden;
}
.job-wrap:hover { background: var(--card-hover); }
.job-row {
  display: grid; grid-template-columns: 120px 1fr 110px;
  gap: 14px; padding: 10px 12px; align-items: center;
  font-size: 14px;
}
.job-thumb {
  width: 120px; height: 68px; border-radius: 8px; overflow: hidden;
  background: #0a0a0a; flex-shrink: 0;
}
.job-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.job-main { min-width: 0; }
.job-title {
  font-weight: 500; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.job-sub {
  color: var(--text-secondary); font-size: 12px; margin-top: 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.job-err {
  color: #ef4444; font-size: 12px; margin-top: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  cursor: help;
}
.job-progress {
  height: 3px; background: rgba(255,255,255,0.08);
  margin: 0 16px 8px 16px; border-radius: 2px; overflow: hidden;
}
.job-progress-fill {
  height: 100%; background: var(--accent);
  transition: width 0.4s ease;
}
.job-status {
  text-transform: uppercase; font-size: 11px;
  letter-spacing: 0.5px; font-weight: 600;
}
.job-status.queued { color: #facc15; }
.job-status.running { color: #60a5fa; }
.job-status.completed { color: var(--success); }
.job-status.failed { color: #ef4444; }

/* Empty state */
.empty {
  text-align: center; padding: 60px 20px;
  color: var(--text-secondary);
}
.empty h2 { color: var(--text); margin-bottom: 8px; }

/* Modal */
.modal {
  background: var(--card); color: var(--text);
  border: 1px solid var(--border); border-radius: 16px;
  padding: 24px; min-width: 400px; max-width: 520px;
}
.modal::backdrop { background: rgba(0,0,0,0.6); }
.modal h2 { margin-bottom: 16px; font-size: 20px; }
.modal label {
  display: block; font-size: 12px; color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: 0.5px; margin-top: 12px; margin-bottom: 4px;
}
.modal input {
  width: 100%; padding: 10px 12px;
  background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
  color: var(--text); font-size: 14px; outline: none;
}
.modal input:focus { border-color: var(--accent); }
.modal-actions {
  display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px;
}
.btn-primary, .btn-secondary {
  padding: 10px 20px; border: none; border-radius: 20px;
  font-size: 14px; font-weight: 600; cursor: pointer;
}
.btn-primary { background: #fff; color: #000; }
.btn-primary:hover { background: #e5e5e5; }
.btn-secondary { background: var(--card-hover); color: #fff; }
.btn-secondary:hover { background: #555; }

/* Length picker */
.length-picker-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center; z-index: 300;
  padding: 20px;
  animation: lp-fade 0.18s ease-out;
}
@keyframes lp-fade { from { opacity: 0; } to { opacity: 1; } }
.length-picker {
  background: #1c1c1e; border: 1px solid rgba(255,255,255,0.08);
  border-radius: 22px; padding: 32px; width: 100%; max-width: 460px;
  box-shadow: 0 24px 72px rgba(0,0,0,0.6);
  animation: lp-rise 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes lp-rise { from { transform: translateY(12px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.lp-header { text-align: center; margin-bottom: 24px; }
.lp-title { font-size: 22px; font-weight: 600; letter-spacing: -0.3px; }
.lp-subtitle {
  font-size: 14px; color: var(--text-secondary);
  margin-top: 6px; line-height: 1.4;
}

.length-options {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 18px;
}
.length-options button {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; padding: 16px 0;
  background: rgba(255,255,255,0.06); color: #fff;
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 14px; cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.08s;
}
.length-options button:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.12);
}
.length-options button:active { transform: scale(0.97); }
.length-options button.lp-selected,
.lp-apply.lp-selected {
  background: var(--success); color: #001b08;
  border-color: transparent;
  animation: lp-pulse 0.28s ease-out;
}
.length-options button.lp-selected .lp-num,
.length-options button.lp-selected .lp-unit { color: #001b08; }
@keyframes lp-pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.04); }
  100% { transform: scale(1); }
}
.length-picker-overlay.lp-leaving { animation: lp-fade-out 0.18s ease-in forwards; }
@keyframes lp-fade-out { from { opacity: 1; } to { opacity: 0; } }
.length-options .lp-primary {
  background: var(--accent); border-color: transparent;
}
.length-options .lp-primary:hover { background: #e60000; }
.lp-num { font-size: 22px; font-weight: 600; letter-spacing: -0.3px; }
.lp-unit { font-size: 12px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; }
.length-options .lp-primary .lp-unit { color: rgba(255,255,255,0.8); }

.length-custom {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 8px 8px 16px;
  background: rgba(255,255,255,0.04);
  border-radius: 14px; border: 1px solid rgba(255,255,255,0.06);
  margin-bottom: 8px;
}
.length-custom input {
  flex: 1; background: none; border: none; outline: none;
  color: #fff; font-size: 16px; font-weight: 500;
  padding: 10px 0; min-width: 0;
  font-variant-numeric: tabular-nums;
}
.length-custom input::-webkit-inner-spin-button,
.length-custom input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.lp-suffix {
  font-size: 13px; color: var(--text-secondary); text-transform: uppercase;
  letter-spacing: 0.5px; margin-right: 6px;
}
.lp-apply {
  background: #fff; color: #000; border: none;
  padding: 10px 18px; border-radius: 10px;
  font-size: 14px; font-weight: 600; cursor: pointer;
  transition: background 0.15s;
}
.lp-apply:hover { background: #e5e5e5; }

.length-cancel {
  width: 100%; margin-top: 8px; padding: 12px;
  background: none; color: var(--text-secondary);
  border: none; cursor: pointer; font-size: 14px; font-weight: 500;
  border-radius: 10px; transition: color 0.15s;
}
.length-cancel:hover { color: #fff; }

@media (max-width: 520px) {
  .length-picker { padding: 24px 20px; border-radius: 18px; }
  .lp-title { font-size: 20px; }
  .lp-num { font-size: 20px; }
  .length-options { gap: 8px; }
  .length-options button { padding: 14px 0; border-radius: 12px; }
}

/* Toast */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--card); color: var(--text);
  padding: 12px 20px; border-radius: 24px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  font-size: 14px; z-index: 200; border: 1px solid var(--border);
}

/* Analytics dashboard */
.an-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:16px;margin-bottom:24px}
.an-card{background:var(--card);border:1px solid var(--border);border-radius:12px;padding:20px}
.an-card h3{font-size:14px;font-weight:600;margin-bottom:16px;color:var(--text-secondary)}
.an-stat{text-align:center}
.an-stat-value{font-size:32px;font-weight:700;color:var(--text);margin-bottom:4px}
.an-stat-label{font-size:12px;color:var(--text-secondary)}
.an-row{display:grid;grid-template-columns:1fr 1fr;gap:16px;margin-bottom:24px}
.an-chart{display:flex;align-items:flex-end;gap:6px;height:120px;padding-top:8px}
.an-bar-col{display:flex;flex-direction:column;align-items:center;flex:1;height:100%}
.an-bar{width:100%;background:var(--accent);border-radius:3px 3px 0 0;min-height:2px;margin-top:auto;transition:height 0.3s}
.an-bar-label{font-size:10px;color:var(--text-secondary);margin-top:4px}
.an-table{width:100%;border-collapse:collapse;font-size:13px}
.an-table th{text-align:left;color:var(--text-secondary);font-weight:500;padding:6px 8px;border-bottom:1px solid var(--border)}
.an-table td{padding:6px 8px;border-bottom:1px solid rgba(255,255,255,0.04)}
.an-summary{font-size:13px;color:var(--text-secondary);line-height:1.8}

/* Mobile bottom nav */
.mobile-nav {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0; height: 56px;
  background: var(--bg); border-top: 1px solid var(--border);
  z-index: 99;
  justify-content: space-around; align-items: center;
}
.mnav-item {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  color: var(--text-secondary); font-size: 10px; padding: 6px 16px;
  text-decoration: none; transition: color 0.15s;
}
.mnav-item.active { color: var(--text); }
.mnav-item svg { width: 22px; height: 22px; }

/* Tablet */
@media (max-width: 1100px) {
  .watch-wrap { grid-template-columns: 1fr; }
  .mini-thumb { width: 120px; }
}

/* Mobile */
@media (max-width: 900px) {
  .sidebar { display: none; }
  .main { margin-left: 0; padding: 16px; padding-bottom: 72px; }
  .header-left { width: auto; }
  .header-right { width: auto; }
  .search-container { display: none; }
  .grid { grid-template-columns: 1fr; gap: 24px; }

  /* Bottom nav for mobile */
  .mobile-nav {
    display: flex !important;
  }

  /* Watch view mobile */
  .watch-wrap { gap: 16px; }
  .player-wrap { border-radius: 0; margin: 0 -16px; }
  .meta-row { flex-direction: column; gap: 12px; }
  .actions { justify-content: flex-start; overflow-x: auto; flex-wrap: nowrap; gap: 6px; -webkit-overflow-scrolling: touch; }
  .action-btn { font-size: 12px; padding: 6px 12px; white-space: nowrap; flex-shrink: 0; }
  .shortened-stat { flex-direction: column; gap: 8px; padding: 12px; }
  .stat-arrow { display: none; }
  .stat-block { min-width: unset; padding: 8px 12px; }
  .stat-block .value { font-size: 16px; }

  /* Segment progress bar — larger tap targets */
  #segmentProgress { height: 10px !important; gap: 4px !important; margin-top: 8px !important; }

  /* Job cards */
  .job-row { gap: 10px; }
  .job-thumb { width: 80px; min-height: 45px; border-radius: 6px; }
  .job-title { font-size: 13px; }
  .job-sub { font-size: 11px; }
  .job-status { font-size: 11px; padding: 2px 8px; }

  /* Video cards */
  .video-card .thumbnail { border-radius: 0; margin: 0 -16px; }
  .video-meta { padding: 0; }
  .video-title { font-size: 14px; }

  /* Signin */
  .signin-card { padding: 24px 20px; }
  .signin-card h1 { font-size: 22px; }

  /* View heading */
  .view-heading { font-size: 20px; }

  /* Test log mobile */
  .tl-header { flex-direction: column; gap: 8px; }
  .tl-thumb { width: 100%; min-width: unset; }

  /* Up next sidebar on mobile — horizontal scroll */
  .up-next { max-height: none; }
  .mini-card { flex-direction: row; gap: 10px; }
  .mini-thumb { width: 100px; min-width: 100px; height: 56px; }
  .mini-info { min-width: 0; }
  .mini-title { font-size: 13px; }
}

/* Small phones */
@media (max-width: 400px) {
  .header { padding: 0 8px; height: 48px; }
  .main { padding: 12px; padding-bottom: 64px; }
  .logo span { font-size: 18px; }
  .length-options { grid-template-columns: 1fr 1fr; }
  .desc-box { padding: 12px; }
}
