/* That's Not Mine — YouTube Downloader visual theme.
   Loaded AFTER the app's existing style.css; no conversion logic is changed. */
:root {
  color-scheme: light;
  --bg: #f5f8fc;
  --panel: #ffffff;
  --border: #d7e2ea;
  --text: #182637;
  --muted: #526477;
  --accent: #136c58;
  --accent-dark: #0e5848;
  --glow: #d8ebef;
  --soft-2: #f0f8f7;
  --button-bg: #ffffff;
  --input-bg: #ffffff;
  --progress-bg: #e4ecee;
  --progress-active: #b47611;
  --danger: #b52d44;
  --success: #136c58;
  /* Map the original downloader's CSS custom properties onto the shared theme. */
  --ink: var(--text);
  --line: var(--border);
  --soft: var(--soft-2);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101827;
  --panel: #192437;
  --border: #324157;
  --text: #f4f7fb;
  --muted: #aebdd0;
  --accent: #8ae5c5;
  --accent-dark: #b7f6df;
  --glow: #23354b;
  --soft-2: #203046;
  --button-bg: #192437;
  --input-bg: #141f30;
  --progress-bg: #2d3d51;
  --progress-active: #e9a94f;
  --danger: #ff9fac;
  --success: #8ae5c5;
  --ink: var(--text);
  --line: var(--border);
  --soft: var(--soft-2);
}
*, *::before, *::after { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
html, body {
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
body {
  min-height: 100vh;
  margin: 0;
  padding: 0 20px 80px;
  line-height: 1.55;
  background: radial-gradient(ellipse at 85% 2%, var(--glow) 0, transparent 45%), var(--bg);
}
.page { width: min(1100px, 100%); margin: 0 auto; }
.page-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 28px 0 62px;
}
.home-link, .theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 42px;
  padding: 9px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  background: var(--button-bg);
  font: inherit;
  font-size: .88rem;
  font-weight: 650;
  line-height: 1.35;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
.home-link:hover, .theme-toggle:hover { border-color: var(--accent); background: var(--soft-2); }
.theme-toggle svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.theme-toggle .sun, [data-theme="light"] .theme-toggle .moon { display: none; }
[data-theme="light"] .theme-toggle .sun { display: block; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
.hero { text-align: left; padding: 0; }
.eyebrow {
  margin: 0 0 14px;
  color: var(--accent);
  font-size: .75rem;
  font-weight: 750;
  letter-spacing: .15em;
  text-transform: uppercase;
}
h1 {
  max-width: 900px;
  margin: 0;
  color: var(--text);
  font-size: clamp(2.5rem, 6vw, 4.4rem);
  font-weight: 800;
  line-height: 1.06;
  letter-spacing: -.055em;
}
.subtitle { margin: 18px 0 0; color: var(--muted); font-size: 1.12rem; }
.converter { width: 100%; margin: 50px 0 0; }
.url-toolbar, .video-panel, .settings-panel-main, .progress-panel, .footer-bar {
  border: 1px solid var(--border);
  border-radius: 19px;
  background: var(--panel);
  overflow: hidden;
}
.url-toolbar { min-height: 64px; }
.url-icon {
  width: 60px;
  flex: 0 0 60px;
  background: var(--soft-2);
  border-right: 1px solid var(--border);
  color: var(--accent);
}
.url-input { min-height: 62px; color: var(--text); background: var(--input-bg); }
.url-input::placeholder { color: var(--muted); opacity: .8; }
.fetch-button {
  min-width: 148px;
  color: var(--accent);
  border-left: 1px solid var(--border);
  background: var(--soft-2);
  font-weight: 700;
}
.fetch-button:hover:not(:disabled) { background: var(--soft-2); filter: brightness(.97); }
[data-theme="dark"] .fetch-button:hover:not(:disabled) { filter: brightness(1.12); }
.video-panel { margin-top: 16px; }
.empty-state { min-height: 145px; color: var(--muted); }
.video-info { min-height: 145px; padding: 16px 20px; }
.thumbnail-wrap { border-radius: 12px; background: var(--soft-2); }
.video-title { color: var(--text); }
.video-submeta { color: var(--muted); }
.settings-panel-main { margin-top: 16px; padding: 15px 18px; }
.settings-grid-main { gap: 16px; }
.setting-block, .cookie-option { color: var(--muted); }
.setting-select-main {
  min-height: 38px;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  background-color: var(--input-bg);
  /* Keep the original two-chevron background-image and select functionality. */
}
.cookie-option input { accent-color: var(--accent); }
.progress-panel { margin-top: 16px; padding: 18px 20px; }
.progress-track { height: 10px; border-radius: 999px; background: var(--progress-bg); }
.progress-fill { border-radius: inherit; background: var(--progress-active); }
.progress-fill.complete { background: var(--success); }
.progress-fill.error { background: var(--danger); }
.progress-percent, .progress-meta { color: var(--muted); }
.footer-bar { margin-top: 16px; min-height: 68px; background: var(--panel); }
.count { color: var(--text); }
.convert-button { color: #ffffff; background: #136c58; font-weight: 750; }
.convert-button:hover:not(:disabled) { background: #0e5848; }
[data-theme="dark"] .convert-button { color: #101827; background: #8ae5c5; }
[data-theme="dark"] .convert-button:hover:not(:disabled) { background: #b7f6df; }
#status { color: var(--muted); }
#status.success { color: var(--success); }
#status.error { color: var(--danger); }
.details-button { color: var(--accent); }
pre { border-radius: 12px; background: #111827; color: #e5e7eb; }
.runtime-info { color: var(--muted); }
/* Honor hidden attributes used by the existing downloader script. */
[hidden] { display: none !important; }
@media (max-width: 760px) {
  .page-nav { padding: 20px 0 45px; }
  .converter { margin-top: 34px; }
  .settings-grid-main { align-items: center; }
  .cookie-option { margin-left: 0; }
}
@media (max-width: 560px) {
  body { padding: 0 12px 60px; }
  .page-nav { gap: 8px; padding: 16px 0 34px; }
  .home-link, .theme-toggle { font-size: .75rem; padding: 8px 10px; min-height: 42px; }
  .theme-toggle svg { width: 16px; height: 16px; }
  .url-toolbar { flex-wrap: wrap; }
  .url-icon { width: 46px; flex-basis: 46px; min-height: 48px; }
  .url-input { min-height: 48px; width: calc(100% - 46px); }
  .fetch-button { flex-basis: 100%; min-height: 46px; border-left: 0; border-top: 1px solid var(--border); }
  .video-info { align-items: flex-start; }
  .setting-block { width: 100%; justify-content: space-between; }
  .cookie-option { width: 100%; }
  .footer-bar { min-height: 68px; }
  .count { padding: 0 12px; font-size: 14px; }
  .convert-button { min-width: 116px; padding: 0 12px; font-size: 17px; }
}
@media (prefers-reduced-motion: reduce) { .progress-fill { transition: none; } }
