/* ══════════════════════════════════════════════════════
   YouNote — Design System (shadcn/ui dark, zinc palette)
══════════════════════════════════════════════════════ */

/* ── Reset ────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
button, input, select, textarea { font-family: inherit; }

/* ── Tokens ───────────────────────────────────────────── */
:root {
  /* Zinc dark palette */
  --bg:          #09090b;   /* zinc-950 */
  --card:        #18181b;   /* zinc-900 */
  --border:      #27272a;   /* zinc-800 */
  --input-bg:    #09090b;
  --muted:       #27272a;
  --muted-fg:    #71717a;   /* zinc-500 */
  --text:        #fafafa;   /* zinc-50  */
  --text-2:      #a1a1aa;   /* zinc-400 */
  --text-3:      #71717a;   /* zinc-500 */
  --primary:     #fafafa;
  --primary-fg:  #09090b;
  --ring:        #52525b;   /* zinc-600 */
  --success:     #22c55e;
  --error:       #ef4444;
  --radius:      6px;
  --radius-card: 8px;
}

/* ── Base ─────────────────────────────────────────────── */
html { font-size: 14px; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  overflow-x: hidden;
}
a { text-decoration: none; color: inherit; }
svg { display: block; flex-shrink: 0; }

/* ── Layout ───────────────────────────────────────────── */
.container {
  max-width: 700px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ── Header ───────────────────────────────────────────── */
.header {
  height: 52px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(9, 9, 11, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.header-inner {
  display: flex;
  align-items: center;
}
.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #ffffff;
}
.brand-mark {
  width: 20px;
  height: 20px;
  object-fit: contain;
  filter: brightness(0) invert(1);
}
.brand-name {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.25px;
  color: #ffffff;
}

/* ── Main ─────────────────────────────────────────────── */
.main {
  padding: 36px 20px 80px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ── Page heading ─────────────────────────────────────── */
.page-heading { margin-bottom: 4px; }
.page-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
  line-height: 1.2;
  margin-bottom: 5px;
}
.page-subtitle {
  font-size: 13px;
  color: var(--text-3);
}

/* ── Settings row ─────────────────────────────────────── */
.settings-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* ── Tabs ─────────────────────────────────────────────── */
.tabs-list {
  display: flex;
  border-bottom: 1px solid var(--border);
  gap: 0;
  margin-bottom: 2px;
}
.tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 14px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  color: var(--text-3);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
  outline: none;
}
.tab:hover { color: var(--text-2); }
.tab.active { color: var(--text); border-bottom-color: var(--text); }
.tab:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }

/* ── Panel ────────────────────────────────────────────── */
.panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ── Card ─────────────────────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  overflow: hidden;
}
.card-body {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* ── Field ────────────────────────────────────────────── */
.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.field-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
  letter-spacing: 0.1px;
}
.field-hint {
  font-weight: 400;
  color: var(--text-3);
}

/* ── Input ────────────────────────────────────────────── */
.input-group {
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--input-bg);
  transition: border-color 0.15s, box-shadow 0.15s;
  overflow: hidden;
}
.input-group:focus-within {
  border-color: var(--ring);
  box-shadow: 0 0 0 3px rgba(82, 82, 91, 0.2);
}
.input-adornment {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  color: var(--muted-fg);
}
.input-adornment svg { width: 14px; height: 14px; }
.input {
  flex: 1;
  height: 36px;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  padding: 0 6px;
  min-width: 0;
}
.input::placeholder { color: #3f3f46; }
.input-clear {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  margin: 3px;
  background: transparent;
  border: none;
  border-radius: 4px;
  color: var(--text-3);
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
  flex-shrink: 0;
}
.input-clear:hover { color: var(--text-2); background: rgba(255,255,255,0.06); }
.input-clear svg { width: 13px; height: 13px; }

/* ── Select ───────────────────────────────────────────── */
.select-wrap { position: relative; }
.select {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  height: 36px;
  padding: 0 34px 0 11px;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.select:focus {
  border-color: var(--ring);
  box-shadow: 0 0 0 3px rgba(82,82,91,0.2);
}
.select:disabled { opacity: 0.5; cursor: default; }
.select option { background: #1c1c1f; color: var(--text); }
.select-chevron {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--text-3);
  width: 13px;
  height: 13px;
}

/* ── Toggle Group ─────────────────────────────────────── */
.toggle-group {
  display: flex;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 3px;
  gap: 2px;
}
.toggle-item {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 6px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-3);
  cursor: pointer;
  transition: all 0.12s;
  user-select: none;
  white-space: nowrap;
}
.toggle-item input { display: none; }
.toggle-item:hover { color: var(--text-2); }
.toggle-item:has(input:checked) {
  background: var(--card);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0,0,0,0.4), 0 0 0 1px var(--border);
}

/* ── Buttons ──────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all 0.12s;
  white-space: nowrap;
  outline: none;
  text-decoration: none;
}
.btn:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }

.btn-sm  { height: 32px; padding: 0 12px; font-size: 12px; }
.btn-lg  { height: 42px; padding: 0 18px; font-size: 14px; font-weight: 600; }
.w-full  { width: 100%; }

.btn-primary {
  background: var(--primary);
  color: var(--primary-fg);
  border-color: transparent;
}
.btn-primary:hover { background: #e4e4e7; }
.btn-primary:active { background: #d4d4d8; }

.btn-outline {
  background: transparent;
  border-color: var(--border);
  color: var(--text-2);
}
.btn-outline:hover { border-color: #52525b; color: var(--text); background: rgba(255,255,255,0.03); }

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-3);
}
.btn-ghost:hover { background: rgba(255,255,255,0.05); color: var(--text-2); }

/* Spinner on button */
.btn-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(9,9,11,0.3);
  border-top-color: var(--primary-fg);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

/* ── Alert ────────────────────────────────────────────── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid;
  border-radius: var(--radius);
  font-size: 13px;
  line-height: 1.5;
}
.alert-error {
  background: rgba(239,68,68,0.06);
  border-color: rgba(239,68,68,0.2);
  color: #fca5a5;
}
.flex-shrink-0 { flex-shrink: 0; }

/* ── Divider ──────────────────────────────────────────── */
.divider { height: 1px; background: var(--border); }

/* ── Spinner ──────────────────────────────────────────── */
.spinner {
  width: 22px;
  height: 22px;
  border: 2px solid var(--border);
  border-top-color: var(--text-2);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Loading card ─────────────────────────────────────── */
.loading-inner {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 24px 22px;
}
.loading-info { flex: 1; }
.loading-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 10px;
}
.loading-detail {
  margin: -5px 0 10px;
  color: var(--text-3);
  font-size: 11px;
}
.loading-steps {
  display: flex;
  gap: 14px;
}
.step {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-3);
  transition: color 0.3s;
}
.step[data-active="true"] { color: var(--text-2); }
.step[data-done="true"]   { color: #4ade80; }
.step-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}
.step[data-active="true"] .step-dot { animation: blink 1s ease-in-out infinite; }
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: 0.25; } }

/* ── Results toolbar ──────────────────────────────────── */
.results-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  gap: 10px;
  flex-wrap: wrap;
}
.results-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.results-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* ── Dropdown ─────────────────────────────────────────── */
.dropdown-wrap { position: relative; }
.dropdown {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 30;
  background: #1c1c1f;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px;
  min-width: 162px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.6), 0 2px 6px rgba(0,0,0,0.4);
  display: none;
}
.dropdown.open { display: block; animation: drop-in 0.1s ease; }
@keyframes drop-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 7px 10px;
  background: transparent;
  border: none;
  border-radius: 4px;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all 0.1s;
  text-align: left;
  outline: none;
}
.dropdown-item:hover { background: rgba(255,255,255,0.06); color: var(--text); }
.chevron { transition: transform 0.18s; }
.chevron.open { transform: rotate(180deg); }

/* ── Format badges ────────────────────────────────────── */
.fmt-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 18px;
  border-radius: 3px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.4px;
  border: 1px solid;
}
.fmt-md  { background: rgba(139,92,246,0.1);  border-color: rgba(139,92,246,0.35); color: #c4b5fd; }
.fmt-txt { background: rgba(234,179,8,0.08);  border-color: rgba(234,179,8,0.3);   color: #fde047; }
.fmt-pdf { background: rgba(239,68,68,0.08);  border-color: rgba(239,68,68,0.3);   color: #fca5a5; }

/* ── Stat chips ───────────────────────────────────────── */
.stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 11px;
  color: var(--text-3);
}

/* ── Video thumbnail ──────────────────────────────────── */
.video-thumb-wrap { padding: 0 16px 16px; }
.video-thumb-link {
  display: block;
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  max-width: 300px;
}
.video-thumb-img { width: 100%; display: block; }
.video-thumb-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.45);
  opacity: 0;
  transition: opacity 0.2s;
}
.video-thumb-link:hover .video-thumb-overlay { opacity: 1; }

/* ── Notes content ────────────────────────────────────── */
.notes-content {
  padding: 22px;
  font-size: 13.5px;
  line-height: 1.8;
  color: var(--text-2);
}
.notes-content h1,
.notes-content h2 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin: 22px 0 9px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--border);
  letter-spacing: -0.2px;
}
.notes-content h1:first-child,
.notes-content h2:first-child { margin-top: 0; }
.notes-content h3 {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  margin: 16px 0 6px;
}
.notes-content p { margin-bottom: 9px; }
.notes-content ul,
.notes-content ol { padding-left: 18px; margin-bottom: 10px; }
.notes-content li { margin-bottom: 4px; }
.notes-content li::marker { color: var(--text-2); }
.notes-content strong { color: var(--text); font-weight: 600; }
.notes-content em { color: #c4b5fd; font-style: italic; }
.notes-content code {
  font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 12px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: 3px;
  color: #c4b5fd;
}
.notes-content pre {
  background: #0d0d0f;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  overflow-x: auto;
  margin: 12px 0;
}
.notes-content pre code {
  background: none;
  border: none;
  padding: 0;
  color: var(--text-2);
  font-size: 12px;
}
.notes-content blockquote {
  border-left: 2px solid #3f3f46;
  padding: 6px 12px;
  margin: 12px 0;
  color: var(--text-3);
  font-style: italic;
}
.notes-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 18px 0;
}
.notes-content a { color: #a78bfa; text-decoration: underline; text-underline-offset: 2px; }
.markdown-fallback {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: inherit;
  color: inherit;
}

/* ── Drop zone ────────────────────────────────────────── */
.drop-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 28px 20px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
  outline: none;
}
.drop-zone:hover,
.drop-zone.drag-over {
  border-color: #52525b;
  background: rgba(255,255,255,0.02);
}
.drop-zone.loaded {
  border-color: rgba(34,197,94,0.35);
  border-style: solid;
  background: rgba(34,197,94,0.03);
}
.drop-zone:focus-visible { box-shadow: 0 0 0 3px rgba(82,82,91,0.3); }
.drop-icon svg { width: 28px; height: 28px; color: var(--text-3); }
.drop-zone.loaded .drop-icon svg { color: #4ade80; }
.drop-main {
  font-size: 13px;
  color: var(--text-2);
}
.drop-main code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  padding: 1px 5px;
  border-radius: 3px;
  color: var(--text-2);
}
.drop-link { color: var(--text); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.drop-hint { font-size: 11px; color: var(--text-3); font-family: 'JetBrains Mono', monospace; }

/* ── Preview list ─────────────────────────────────────── */
.preview-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-height: 160px;
  overflow-y: auto;
}
.preview-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 11px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
}
.preview-item-name {
  font-size: 12px;
  color: var(--text-2);
  font-family: 'JetBrains Mono', monospace;
}
.preview-item-count {
  font-size: 11px;
  color: var(--text-3);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  padding: 1px 8px;
  border-radius: 100px;
}

/* ── Batch progress ───────────────────────────────────── */
.progress-header { padding: 16px 18px 12px; }
.progress-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.progress-title { font-size: 13px; font-weight: 500; color: var(--text); }
.counter-badge {
  font-size: 11px;
  color: var(--text-3);
  font-family: 'JetBrains Mono', monospace;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  padding: 1px 8px;
  border-radius: 100px;
}
.progress-track {
  height: 2px;
  background: var(--border);
  border-radius: 100px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--text-2);
  border-radius: 100px;
  transition: width 0.35s ease;
}

/* ── Batch list ───────────────────────────────────────── */
.batch-list {
  max-height: 440px;
  overflow-y: auto;
}
.batch-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 18px;
  border-top: 1px solid var(--border);
  transition: background 0.1s;
}
.batch-item:first-child { border-top: none; }
.batch-item:hover { background: rgba(255,255,255,0.015); }
.batch-indicator {
  width: 18px;
  height: 18px;
  min-width: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0;
}
/* Status: pending */
.s-pending .batch-indicator { border: 1.5px solid #3f3f46; }
/* Status: processing */
.s-processing .batch-indicator { border: 1.5px solid var(--text-3); animation: spin 0.8s linear infinite; }
/* Status: done */
.s-done .batch-indicator {
  background: rgba(34,197,94,0.1);
  border: 1.5px solid rgba(34,197,94,0.4);
  color: #4ade80;
}
/* Status: error */
.s-error .batch-indicator {
  background: rgba(239,68,68,0.08);
  border: 1.5px solid rgba(239,68,68,0.3);
  color: #fca5a5;
}
.batch-indicator svg { width: 10px; height: 10px; }
.batch-info { flex: 1; min-width: 0; }
.batch-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
  font-family: 'JetBrains Mono', monospace;
  line-height: 1.3;
}
.s-processing .batch-name { color: var(--text); }
.s-done  .batch-name { color: #4ade80; }
.s-error .batch-name { color: #fca5a5; }
.batch-url {
  font-size: 11px;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
  max-width: 320px;
}
.batch-item-btns {
  display: flex;
  gap: 3px;
  flex-shrink: 0;
}
.mini-dl {
  display: inline-flex;
  align-items: center;
  padding: 3px 7px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-3);
  font-size: 10px;
  font-weight: 700;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all 0.1s;
  outline: none;
}
.mini-dl:hover { border-color: #52525b; color: var(--text-2); }

/* ── Export section ───────────────────────────────────── */
.export-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.export-title { font-size: 14px; font-weight: 600; margin-bottom: 3px; }
.export-sub { font-size: 12px; color: var(--text-3); }
.export-btns { display: flex; gap: 6px; flex-wrap: wrap; }

/* ── Footer ───────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  padding: 18px 0;
}
.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.footer-text { font-size: 12px; color: var(--text-3); }
.footer-text strong { color: var(--text-2); font-weight: 500; }
.footer-attr { font-size: 10px; color: #3f3f46; }
.footer-attr a { color: #3f3f46; text-decoration: none; }
.footer-attr a:hover { color: var(--text-3); }

/* ── Icon sizes ───────────────────────────────────────── */
.icon-xs { width: 11px; height: 11px; }
.icon-sm { width: 14px; height: 14px; }
.icon-md { width: 16px; height: 16px; }

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 560px) {
  .container { padding-inline: 14px; }
  .header { height: 50px; }
  .main {
    padding: 22px 14px calc(52px + env(safe-area-inset-bottom));
    gap: 14px;
  }
  .page-title { font-size: 20px; }
  .page-subtitle { line-height: 1.45; }
  .settings-row { grid-template-columns: 1fr; gap: 10px; }
  .card-body { padding: 16px; gap: 16px; }
  .input, .select { min-height: 44px; font-size: 16px; }
  .input-clear { width: 40px; height: 40px; }
  .btn-lg { min-height: 48px; }
  .btn-sm { min-height: 44px; padding-inline: 13px; }
  .tabs-list { overflow-x: auto; scrollbar-width: none; }
  .tabs-list::-webkit-scrollbar { display: none; }
  .tab { min-height: 44px; flex: 1; justify-content: center; padding-inline: 10px; }
  .toggle-group {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .toggle-item { min-height: 44px; padding: 8px 6px; }
  .loading-inner { align-items: flex-start; padding: 18px 16px; gap: 12px; }
  .loading-steps { flex-direction: column; gap: 5px; }
  .results-toolbar { flex-direction: column; align-items: stretch; padding: 12px; }
  .results-actions { width: 100%; display: grid; grid-template-columns: repeat(3, 1fr); }
  .results-actions .btn { width: 100%; padding-inline: 8px; }
  .dropdown { left: 0; right: auto; min-width: min(190px, calc(100vw - 28px)); }
  .video-thumb-wrap { padding: 0 12px 12px; }
  .video-thumb-link { max-width: none; }
  .notes-content { padding: 18px 16px; font-size: 14px; overflow-wrap: anywhere; }
  .notes-content pre { max-width: 100%; }
  .drop-zone { padding: 24px 14px; }
  .preview-item { gap: 8px; }
  .preview-item-name { overflow: hidden; text-overflow: ellipsis; }
  .batch-item { align-items: flex-start; padding: 12px; }
  .batch-item-btns { flex-direction: column; }
  .mini-dl { min-width: 42px; min-height: 32px; justify-content: center; }
  .export-row { flex-direction: column; align-items: flex-start; }
  .export-btns { width: 100%; }
  .export-btns .btn { flex: 1; min-width: 0; padding-inline: 7px; }
  .batch-url { display: none; }
  .footer { padding-bottom: calc(18px + env(safe-area-inset-bottom)); }
}

@media (max-width: 360px) {
  .results-actions { grid-template-columns: 1fr 1fr; }
  #new-btn { grid-column: 1 / -1; }
  .toggle-item { font-size: 11px; }
  .toggle-item svg { display: none; }
}
