/* The `hidden` attribute only gets `display:none` from the user-agent
   stylesheet, which ANY author-level `display` rule outranks. Several
   components here set display (flex/grid/inline-flex), so without this every
   one of them ignored `hidden` and rendered permanently — the sign-in gate
   showed on top of the very page it was meant to replace. Keep this rule
   first, and keep the !important: it is what makes `hidden` mean hidden. */
[hidden] { display: none !important; }

/* ── migrated from the old index.html inline <style> (fetchkeep-inline-style migrated) ── */

*{box-sizing:border-box}
:root{
  --bg:#f6f7f9;
  --surface:#fff;
  --surface-2:#f8fafc;
  --line:#e5e7eb;
  --text:#111827;
  --muted:#6b7280;
  --muted-2:#9ca3af;
  --accent:#111827;
  --accent-2:#374151;
  --success:#15803d;
  --shadow:0 12px 35px rgba(15,23,42,.06);
  --radius:18px;
}
html{scroll-behavior:smooth}
body{
  margin:0;
  min-height:100vh;
  color:var(--text);
  background:
    radial-gradient(circle at 50% -15%,rgba(17,24,39,.055),transparent 32rem),
    var(--bg);
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  -webkit-font-smoothing:antialiased;
}
button,input,textarea,select{font:inherit}
button{border:0}
.site-header{
  height:70px;
  background:rgba(255,255,255,.88);
  border-bottom:1px solid rgba(229,231,235,.8);
  backdrop-filter:blur(14px);
  position:sticky;
  top:0;
  z-index:50;
}
.header-inner{
  width:min(1120px,calc(100% - 40px));
  height:100%;
  margin:auto;
  display:flex;
  align-items:center;
  justify-content:space-between;
}
.brand{
  color:var(--text);
  text-decoration:none;
  display:flex;
  align-items:center;
  gap:11px;
}
.brand-mark{
  width:38px;height:38px;border-radius:11px;
  display:grid;place-items:center;
  color:#fff;background:#111827;
  box-shadow:0 5px 14px rgba(17,24,39,.18);
}
/* The glyph takes its colour from the tile, so the tile is the only place the
   two-tone pair is defined. Swapping to a light header is one rule, not two. */
.brand-mark svg{width:21px;height:21px;display:block}
.brand strong{display:block;font-size:15px;line-height:1.2}
.brand small{display:block;color:var(--muted);font-size:11px;margin-top:3px}
.header-status{
  font-size:12px;color:var(--muted);
  padding:7px 11px;border:1px solid var(--line);
  border-radius:999px;background:#fff;
}
.page{width:min(1000px,calc(100% - 40px));margin:0 auto;padding:54px 0 40px}
.hero{text-align:center;padding:12px 0 30px}
.eyebrow,.section-kicker{
  color:var(--muted-2);font-size:10px;font-weight:800;
  letter-spacing:.16em;
}
.hero h1{
  margin:10px 0 9px;
  font-size:clamp(30px,5vw,46px);
  letter-spacing:-1.8px;
  line-height:1.05;
}
.hero p{
  margin:0 auto;color:var(--muted);
  max-width:590px;font-size:15px;line-height:1.75;
}
.hero-features{
  display:flex;justify-content:center;gap:18px;flex-wrap:wrap;
  margin-top:18px;color:#4b5563;font-size:12px;
}
.download-card,.settings-card{
  background:var(--surface);
  border:1px solid rgba(229,231,235,.9);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
}
.download-card{padding:24px}
.input-label{display:block;font-size:13px;font-weight:700;margin-bottom:9px}
.url-box{position:relative}
#url{
  width:100%;min-height:116px;resize:vertical;
  display:block;padding:16px 150px 16px 16px;
  border:1px solid #dfe3e8;border-radius:14px;
  outline:0;color:var(--text);background:#fbfcfd;
  line-height:1.6;font-size:14px;
  transition:border-color .18s,box-shadow .18s,background .18s;
}
#url:focus{
  border-color:#9ca3af;background:#fff;
  box-shadow:0 0 0 4px rgba(17,24,39,.055);
}
#url::placeholder{color:#a1a7b0}
.primary-btn{
  position:absolute;right:10px;bottom:10px;
  height:43px;padding:0 14px 0 17px;
  display:flex;align-items:center;gap:12px;
  color:#fff;background:#111827;border-radius:10px;
  font-weight:700;font-size:13px;cursor:pointer;
  box-shadow:0 5px 12px rgba(17,24,39,.14);
  transition:transform .15s,background .15s;
}
.primary-btn:hover{background:#252b35;transform:translateY(-1px)}
.primary-btn:disabled{opacity:.55;transform:none;cursor:not-allowed}
.btn-arrow{font-size:18px;line-height:1}
.form-options{display:flex;align-items:center;gap:16px;margin-top:13px}
.select-wrap{display:flex;align-items:center;gap:8px;color:var(--muted);font-size:12px}
.select-wrap select{
  border:1px solid var(--line);border-radius:8px;
  padding:7px 26px 7px 9px;background:#fff;color:#374151;
  outline:0;
}
.form-tip{margin:0;color:var(--muted-2);font-size:11px}
.info-strip{
  margin:14px 0 42px;
  display:grid;grid-template-columns:repeat(3,1fr);
  background:#fff;border:1px solid var(--line);border-radius:14px;
}
.info-item{
  display:flex;align-items:center;gap:10px;padding:14px 17px;
}
.info-item+ .info-item{border-left:1px solid var(--line)}
.info-icon{
  width:31px;height:31px;display:grid;place-items:center;
  border-radius:9px;background:#f3f4f6;color:#374151;
  font-size:13px;font-weight:800;
}
.info-item b{display:block;font-size:12px}
.info-item small{display:block;color:var(--muted);font-size:10px;margin-top:3px}
.section-block{margin-top:0}
.section-heading,.settings-title{
  display:flex;align-items:end;justify-content:space-between;
  margin-bottom:14px;
}
.section-heading h2,.settings-title h2{
  margin:5px 0 0;font-size:19px;letter-spacing:-.4px;
}
.count-badge,.optional-badge{
  min-width:27px;height:27px;padding:0 9px;
  display:inline-flex;align-items:center;justify-content:center;
  border-radius:999px;background:#fff;border:1px solid var(--line);
  color:var(--muted);font-size:11px;font-weight:700;
}
.empty-state{
  min-height:190px;border:1px dashed #d9dde3;border-radius:16px;
  background:rgba(255,255,255,.6);
  display:flex;flex-direction:column;align-items:center;justify-content:center;
  color:var(--muted);gap:6px;
}
.empty-icon{
  width:42px;height:42px;border-radius:13px;background:#eef0f3;
  display:grid;place-items:center;color:#6b7280;font-size:20px;margin-bottom:5px;
}
.empty-state b{font-size:13px;color:#4b5563}
.empty-state span{font-size:11px;color:#9ca3af}
.job{
  background:#fff;border:1px solid var(--line);
  border-radius:16px;padding:18px;margin-bottom:12px;
  box-shadow:0 6px 20px rgba(15,23,42,.035);
}
.job-title{display:flex;align-items:center;gap:7px;flex-wrap:wrap}
.job-title b{font-size:13px}
.badge{
  display:inline-flex;align-items:center;
  padding:4px 8px;border-radius:999px;
  background:#f3f4f6;color:#596170;
  font-size:10px;font-weight:700;
}
.url{
  color:#8a919c;font-size:11px;word-break:break-all;
  margin:8px 0 14px;line-height:1.5;
}
.gallery{
  display:grid !important;
  grid-template-columns:repeat(auto-fill,200px) !important;
  justify-content:start !important;
  align-items:start !important;
  gap:12px !important;
  margin:15px 0 3px !important;
}
.media-card{
  position:relative;display:flex !important;flex-direction:column !important;
  align-items:center !important;gap:7px !important;
  width:200px !important;min-width:200px !important;max-width:200px !important;
  padding:7px !important;border:1px solid var(--line) !important;
  border-radius:12px !important;background:#fafafa !important;
  cursor:pointer;overflow:hidden !important;
  transition:border-color .16s,box-shadow .16s,transform .16s;
}
.media-card:hover{border-color:#c4c9d0 !important;box-shadow:0 5px 15px rgba(15,23,42,.06);transform:translateY(-1px)}
.media-card:has(.file-check:checked){border-color:#9ca3af !important;background:#fff}
.media-card .file-check{
  position:absolute !important;z-index:10 !important;
  top:9px !important;left:9px !important;
  width:18px !important;height:18px !important;margin:0 !important;
  accent-color:#111827;cursor:pointer;
}
.media-card .media-preview{
  width:180px !important;height:180px !important;
  min-width:180px !important;max-width:180px !important;
  min-height:180px !important;max-height:180px !important;
  flex:0 0 180px !important;
  display:flex !important;align-items:center !important;justify-content:center !important;
  overflow:hidden !important;margin:0 !important;border-radius:8px !important;
  background:#f0f1f3 !important;
}
.media-card .media-preview img,.media-card .media-preview video{
  display:block !important;width:100% !important;height:100% !important;
  min-width:0 !important;min-height:0 !important;
  max-width:100% !important;max-height:100% !important;
  object-fit:contain !important;margin:0 !important;padding:0 !important;
}
.media-card>span:last-child{
  display:block;width:180px;max-width:180px;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
  color:#6b7280;font-size:10px;line-height:1.4;
}
.file-row{
  display:flex;align-items:center;gap:9px;
  padding:11px;border:1px solid var(--line);border-radius:10px;background:#fafafa;
}
.actions{display:flex;flex-wrap:wrap;gap:7px;margin-top:14px}
.actions .button,.actions button{
  height:34px;padding:0 12px;border-radius:8px;
  background:#111827;color:#fff;text-decoration:none;
  display:inline-flex;align-items:center;justify-content:center;
  cursor:pointer;font-size:11px;font-weight:600;
}
.actions .secondary{background:#f3f4f6;color:#4b5563}
.progress{height:5px;background:#eef0f2;border-radius:999px;overflow:hidden;margin:14px 0}
.progress>div{height:100%;width:100%;background:#374151;animation:progress 1.5s infinite linear;transform-origin:left}
@keyframes progress{0%{transform:scaleX(.05)}50%{transform:scaleX(.6)}100%{transform:scaleX(1)}}
pre{
  background:#111827;color:#d1d5db;padding:11px;border-radius:9px;
  overflow-x:auto;font-size:10px;line-height:1.5;margin:10px 0 0;
}
pre.error{background:#fff5f5;color:#b42318;border:1px solid #fee2e2}
.settings-card{margin-top:40px;padding:22px}
.settings-desc{color:var(--muted);font-size:12px;line-height:1.7;margin:0 0 15px}
.settings-desc code{background:#f3f4f6;border-radius:5px;padding:2px 5px;font-size:11px}
.cookie-controls{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.file-picker{
  height:36px;display:inline-flex;align-items:center;
  padding:0 11px;border:1px solid var(--line);border-radius:8px;
  color:#596170;background:#fafafa;font-size:11px;cursor:pointer;
}
.file-picker input{display:none}
.secondary-btn,.text-btn{
  height:36px;border-radius:8px;padding:0 12px;
  font-size:11px;font-weight:600;cursor:pointer;
}
.secondary-btn{background:#111827;color:#fff}
.text-btn{background:transparent;color:#8b919a}
.cookie-msg{min-height:15px;margin:10px 0 0;color:var(--success);font-size:11px}
footer{
  display:flex;justify-content:center;gap:8px;
  padding:28px 0 5px;color:#a0a6ae;font-size:10px;
}
.muted{color:var(--muted)}
@media(max-width:700px){
  .header-inner,.page{width:min(100% - 24px,1000px)}
  .site-header{height:62px}
  .brand-mark{width:34px;height:34px}
  .brand-mark svg{width:19px;height:19px}
  .header-status{font-size:10px;padding:6px 8px;max-width:160px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
  .page{padding:36px 0 28px}
  .hero{padding-bottom:22px}
  .hero h1{letter-spacing:-1px}
  .hero p{font-size:13px}
  .hero-features{gap:10px;font-size:10px}
  .download-card{padding:16px}
  #url{min-height:105px;padding:13px 13px 58px}
  .primary-btn{left:9px;right:9px;bottom:9px;width:calc(100% - 18px)}
  .form-options{align-items:flex-start;flex-direction:column;gap:7px}
  .info-strip{grid-template-columns:1fr;margin-bottom:30px}
  .info-item+ .info-item{border-left:0;border-top:1px solid var(--line)}
  .info-item{padding:11px 13px}
  .gallery{grid-template-columns:repeat(2,156px) !important;gap:8px !important}
  .media-card{width:156px !important;min-width:156px !important;max-width:156px !important;padding:6px !important}
  .media-card .media-preview{
    width:140px !important;height:140px !important;
    min-width:140px !important;max-width:140px !important;
    min-height:140px !important;max-height:140px !important;
    flex-basis:140px !important;
  }
  .media-card>span:last-child{width:140px;max-width:140px}
  .job{padding:14px}
  .settings-card{padding:17px;margin-top:30px}
}
@media(max-width:370px){
  .gallery{grid-template-columns:repeat(2,calc((100vw - 36px)/2)) !important}
  .media-card{width:calc((100vw - 36px)/2) !important;min-width:0 !important;max-width:none !important}
  .media-card .media-preview{
    width:calc((100vw - 52px)/2) !important;
    height:calc((100vw - 52px)/2) !important;
    min-width:0 !important;max-width:none !important;
    min-height:0 !important;max-height:none !important;
  }
  .media-card>span:last-child{width:calc((100vw - 52px)/2);max-width:none}
}


/* v7 UI: supported platform strip */
.supported-platforms{
  width:min(1100px,calc(100% - 32px));
  margin:18px auto 0;
  padding:16px 18px;
  border:1px solid rgba(127,127,127,.16);
  border-radius:18px;
  background:rgba(127,127,127,.055);
}
.supported-title{
  font-size:13px;
  font-weight:700;
  letter-spacing:.02em;
  margin-bottom:11px;
  opacity:.72;
}
.platform-list{
  display:flex;
  flex-wrap:wrap;
  gap:9px;
}
.platform-chip{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:9px 12px;
  border:1px solid rgba(127,127,127,.16);
  border-radius:12px;
  background:rgba(255,255,255,.035);
}
.platform-chip b{font-size:13px}
.platform-chip small{font-size:11px;opacity:.62}
@media (max-width:640px){
  .supported-platforms{width:calc(100% - 24px);margin-top:12px;padding:13px}
  .platform-list{display:grid;grid-template-columns:1fr 1fr}
  .platform-chip{display:flex;flex-direction:column;align-items:flex-start;gap:2px;padding:10px}
}

/* v7.5 UI: quality picker + per-file transcode */
.quality-panel{
  margin-top:13px;padding:13px;
  border:1px solid var(--line);border-radius:12px;background:var(--surface-2);
}
.quality-panel .quality-title{font-size:12px;font-weight:700;margin-bottom:9px}
.quality-panel .quality-note{color:var(--muted);font-size:11px;line-height:1.6;margin:0}
.quality-list{display:flex;flex-direction:column;gap:5px}
.quality-option{
  display:flex;align-items:center;gap:9px;
  padding:8px 10px;border:1px solid transparent;border-radius:9px;
  background:#fff;cursor:pointer;font-size:12px;
}
.quality-option:hover{border-color:var(--line)}
.quality-option:has(input:checked){border-color:#9ca3af;background:#fff}
.quality-option input{accent-color:#111827;margin:0}
.quality-option b{min-width:82px;font-size:12px}
.quality-option small{color:var(--muted);font-size:11px}
.quality-option .quality-size{margin-left:auto;color:var(--muted);font-size:11px}
.quality-warn{color:#b45309}
.media-card .media-name{
  display:block;width:180px;max-width:180px;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
  color:#6b7280;font-size:10px;line-height:1.4;
}
.media-card .transcode{
  width:180px;max-width:180px;height:26px;
  border-radius:7px;background:#f3f4f6;color:#4b5563;
  font-size:10px;font-weight:600;cursor:pointer;
}
.media-card .transcode:hover:not(:disabled){background:#e5e7eb}
.media-card .transcode:disabled{opacity:.6;cursor:default}
.media-card .media-warn{color:#b45309;font-size:10px;line-height:1.4;max-width:180px}
@media(max-width:700px){
  .media-card .media-name,.media-card .transcode,.media-card .media-warn{width:140px;max-width:140px}
  .quality-option b{min-width:64px}
}

/* v7.2 UI: unified status and YouTube cookie card */
.header-status{
  min-height:34px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border:1px solid var(--line);
  border-radius:999px;
  padding:0 14px;
  background:#fff;
  color:#6b7280;
  font-size:11px;
  font-weight:600;
  white-space:nowrap;
}
.header-status.is-ok{color:#166534;border-color:#bbf7d0;background:#f0fdf4}
.youtube-settings-card{margin-top:18px}
.youtube-settings-card .optional-badge{min-width:54px;text-align:center}
@media(max-width:700px){
  .header-status{max-width:190px;overflow:hidden;text-overflow:ellipsis}
}



*{box-sizing:border-box}
:root{
  --bg:#f6f7f9;
  --surface:#fff;
  --surface-2:#f8fafc;
  --line:#e5e7eb;
  --text:#111827;
  --muted:#6b7280;
  --muted-2:#9ca3af;
  --accent:#111827;
  --accent-2:#374151;
  --success:#15803d;
  --shadow:0 12px 35px rgba(15,23,42,.06);
  --radius:18px;
}
html{scroll-behavior:smooth}
body{
  margin:0;
  min-height:100vh;
  color:var(--text);
  background:
    radial-gradient(circle at 50% -15%,rgba(17,24,39,.055),transparent 32rem),
    var(--bg);
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  -webkit-font-smoothing:antialiased;
}
button,input,textarea,select{font:inherit}
button{border:0}
.site-header{
  height:70px;
  background:rgba(255,255,255,.88);
  border-bottom:1px solid rgba(229,231,235,.8);
  backdrop-filter:blur(14px);
  position:sticky;
  top:0;
  z-index:50;
}
.header-inner{
  width:min(1120px,calc(100% - 40px));
  height:100%;
  margin:auto;
  display:flex;
  align-items:center;
  justify-content:space-between;
}
.brand{
  color:var(--text);
  text-decoration:none;
  display:flex;
  align-items:center;
  gap:11px;
}
.brand-mark{
  width:38px;height:38px;border-radius:11px;
  display:grid;place-items:center;
  color:#fff;background:#111827;
  box-shadow:0 5px 14px rgba(17,24,39,.18);
}
/* The glyph takes its colour from the tile, so the tile is the only place the
   two-tone pair is defined. Swapping to a light header is one rule, not two. */
.brand-mark svg{width:21px;height:21px;display:block}
.brand strong{display:block;font-size:15px;line-height:1.2}
.brand small{display:block;color:var(--muted);font-size:11px;margin-top:3px}
.header-status{
  font-size:12px;color:var(--muted);
  padding:7px 11px;border:1px solid var(--line);
  border-radius:999px;background:#fff;
}
.page{width:min(1000px,calc(100% - 40px));margin:0 auto;padding:54px 0 40px}
.hero{text-align:center;padding:12px 0 30px}
.eyebrow,.section-kicker{
  color:var(--muted-2);font-size:10px;font-weight:800;
  letter-spacing:.16em;
}
.hero h1{
  margin:10px 0 9px;
  font-size:clamp(30px,5vw,46px);
  letter-spacing:-1.8px;
  line-height:1.05;
}
.hero p{
  margin:0 auto;color:var(--muted);
  max-width:590px;font-size:15px;line-height:1.75;
}
.hero-features{
  display:flex;justify-content:center;gap:18px;flex-wrap:wrap;
  margin-top:18px;color:#4b5563;font-size:12px;
}
.download-card,.settings-card{
  background:var(--surface);
  border:1px solid rgba(229,231,235,.9);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
}
.download-card{padding:24px}
.input-label{display:block;font-size:13px;font-weight:700;margin-bottom:9px}
.url-box{position:relative}
#url{
  width:100%;min-height:116px;resize:vertical;
  display:block;padding:16px 150px 16px 16px;
  border:1px solid #dfe3e8;border-radius:14px;
  outline:0;color:var(--text);background:#fbfcfd;
  line-height:1.6;font-size:14px;
  transition:border-color .18s,box-shadow .18s,background .18s;
}
#url:focus{
  border-color:#9ca3af;background:#fff;
  box-shadow:0 0 0 4px rgba(17,24,39,.055);
}
#url::placeholder{color:#a1a7b0}
.primary-btn{
  position:absolute;right:10px;bottom:10px;
  height:43px;padding:0 14px 0 17px;
  display:flex;align-items:center;gap:12px;
  color:#fff;background:#111827;border-radius:10px;
  font-weight:700;font-size:13px;cursor:pointer;
  box-shadow:0 5px 12px rgba(17,24,39,.14);
  transition:transform .15s,background .15s;
}
.primary-btn:hover{background:#252b35;transform:translateY(-1px)}
.primary-btn:disabled{opacity:.55;transform:none;cursor:not-allowed}
.btn-arrow{font-size:18px;line-height:1}
.form-options{display:flex;align-items:center;gap:16px;margin-top:13px}
.select-wrap{display:flex;align-items:center;gap:8px;color:var(--muted);font-size:12px}
.select-wrap select{
  border:1px solid var(--line);border-radius:8px;
  padding:7px 26px 7px 9px;background:#fff;color:#374151;
  outline:0;
}
.form-tip{margin:0;color:var(--muted-2);font-size:11px}
.info-strip{
  margin:14px 0 42px;
  display:grid;grid-template-columns:repeat(3,1fr);
  background:#fff;border:1px solid var(--line);border-radius:14px;
}
.info-item{
  display:flex;align-items:center;gap:10px;padding:14px 17px;
}
.info-item+ .info-item{border-left:1px solid var(--line)}
.info-icon{
  width:31px;height:31px;display:grid;place-items:center;
  border-radius:9px;background:#f3f4f6;color:#374151;
  font-size:13px;font-weight:800;
}
.info-item b{display:block;font-size:12px}
.info-item small{display:block;color:var(--muted);font-size:10px;margin-top:3px}
.section-block{margin-top:0}
.section-heading,.settings-title{
  display:flex;align-items:end;justify-content:space-between;
  margin-bottom:14px;
}
.section-heading h2,.settings-title h2{
  margin:5px 0 0;font-size:19px;letter-spacing:-.4px;
}
.count-badge,.optional-badge{
  min-width:27px;height:27px;padding:0 9px;
  display:inline-flex;align-items:center;justify-content:center;
  border-radius:999px;background:#fff;border:1px solid var(--line);
  color:var(--muted);font-size:11px;font-weight:700;
}
.empty-state{
  min-height:190px;border:1px dashed #d9dde3;border-radius:16px;
  background:rgba(255,255,255,.6);
  display:flex;flex-direction:column;align-items:center;justify-content:center;
  color:var(--muted);gap:6px;
}
.empty-icon{
  width:42px;height:42px;border-radius:13px;background:#eef0f3;
  display:grid;place-items:center;color:#6b7280;font-size:20px;margin-bottom:5px;
}
.empty-state b{font-size:13px;color:#4b5563}
.empty-state span{font-size:11px;color:#9ca3af}
.job{
  background:#fff;border:1px solid var(--line);
  border-radius:16px;padding:18px;margin-bottom:12px;
  box-shadow:0 6px 20px rgba(15,23,42,.035);
}
.job-title{display:flex;align-items:center;gap:7px;flex-wrap:wrap}
.job-title b{font-size:13px}
.badge{
  display:inline-flex;align-items:center;
  padding:4px 8px;border-radius:999px;
  background:#f3f4f6;color:#596170;
  font-size:10px;font-weight:700;
}
.url{
  color:#8a919c;font-size:11px;word-break:break-all;
  margin:8px 0 14px;line-height:1.5;
}
.gallery{
  display:grid !important;
  grid-template-columns:repeat(auto-fill,200px) !important;
  justify-content:start !important;
  align-items:start !important;
  gap:12px !important;
  margin:15px 0 3px !important;
}
.media-card{
  position:relative;display:flex !important;flex-direction:column !important;
  align-items:center !important;gap:7px !important;
  width:200px !important;min-width:200px !important;max-width:200px !important;
  padding:7px !important;border:1px solid var(--line) !important;
  border-radius:12px !important;background:#fafafa !important;
  cursor:pointer;overflow:hidden !important;
  transition:border-color .16s,box-shadow .16s,transform .16s;
}
.media-card:hover{border-color:#c4c9d0 !important;box-shadow:0 5px 15px rgba(15,23,42,.06);transform:translateY(-1px)}
.media-card:has(.file-check:checked){border-color:#9ca3af !important;background:#fff}
.media-card .file-check{
  position:absolute !important;z-index:10 !important;
  top:9px !important;left:9px !important;
  width:18px !important;height:18px !important;margin:0 !important;
  accent-color:#111827;cursor:pointer;
}
.media-card .media-preview{
  width:180px !important;height:180px !important;
  min-width:180px !important;max-width:180px !important;
  min-height:180px !important;max-height:180px !important;
  flex:0 0 180px !important;
  display:flex !important;align-items:center !important;justify-content:center !important;
  overflow:hidden !important;margin:0 !important;border-radius:8px !important;
  background:#f0f1f3 !important;
}
.media-card .media-preview img,.media-card .media-preview video{
  display:block !important;width:100% !important;height:100% !important;
  min-width:0 !important;min-height:0 !important;
  max-width:100% !important;max-height:100% !important;
  object-fit:contain !important;margin:0 !important;padding:0 !important;
}
.media-card>span:last-child{
  display:block;width:180px;max-width:180px;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
  color:#6b7280;font-size:10px;line-height:1.4;
}
.file-row{
  display:flex;align-items:center;gap:9px;
  padding:11px;border:1px solid var(--line);border-radius:10px;background:#fafafa;
}
.actions{display:flex;flex-wrap:wrap;gap:7px;margin-top:14px}
.actions .button,.actions button{
  height:34px;padding:0 12px;border-radius:8px;
  background:#111827;color:#fff;text-decoration:none;
  display:inline-flex;align-items:center;justify-content:center;
  cursor:pointer;font-size:11px;font-weight:600;
}
.actions .secondary{background:#f3f4f6;color:#4b5563}
.progress{height:5px;background:#eef0f2;border-radius:999px;overflow:hidden;margin:14px 0}
.progress>div{height:100%;width:100%;background:#374151;animation:progress 1.5s infinite linear;transform-origin:left}
@keyframes progress{0%{transform:scaleX(.05)}50%{transform:scaleX(.6)}100%{transform:scaleX(1)}}
pre{
  background:#111827;color:#d1d5db;padding:11px;border-radius:9px;
  overflow-x:auto;font-size:10px;line-height:1.5;margin:10px 0 0;
}
pre.error{background:#fff5f5;color:#b42318;border:1px solid #fee2e2}
.settings-card{margin-top:40px;padding:22px}
.settings-desc{color:var(--muted);font-size:12px;line-height:1.7;margin:0 0 15px}
.settings-desc code{background:#f3f4f6;border-radius:5px;padding:2px 5px;font-size:11px}
.cookie-controls{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.file-picker{
  height:36px;display:inline-flex;align-items:center;
  padding:0 11px;border:1px solid var(--line);border-radius:8px;
  color:#596170;background:#fafafa;font-size:11px;cursor:pointer;
}
.file-picker input{display:none}
.secondary-btn,.text-btn{
  height:36px;border-radius:8px;padding:0 12px;
  font-size:11px;font-weight:600;cursor:pointer;
}
.secondary-btn{background:#111827;color:#fff}
.text-btn{background:transparent;color:#8b919a}
.cookie-msg{min-height:15px;margin:10px 0 0;color:var(--success);font-size:11px}
footer{
  display:flex;justify-content:center;gap:8px;
  padding:28px 0 5px;color:#a0a6ae;font-size:10px;
}
.muted{color:var(--muted)}
@media(max-width:700px){
  .header-inner,.page{width:min(100% - 24px,1000px)}
  .site-header{height:62px}
  .brand-mark{width:34px;height:34px}
  .brand-mark svg{width:19px;height:19px}
  .header-status{font-size:10px;padding:6px 8px;max-width:160px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
  .page{padding:36px 0 28px}
  .hero{padding-bottom:22px}
  .hero h1{letter-spacing:-1px}
  .hero p{font-size:13px}
  .hero-features{gap:10px;font-size:10px}
  .download-card{padding:16px}
  #url{min-height:105px;padding:13px 13px 58px}
  .primary-btn{left:9px;right:9px;bottom:9px;width:calc(100% - 18px)}
  .form-options{align-items:flex-start;flex-direction:column;gap:7px}
  .info-strip{grid-template-columns:1fr;margin-bottom:30px}
  .info-item+ .info-item{border-left:0;border-top:1px solid var(--line)}
  .info-item{padding:11px 13px}
  .gallery{grid-template-columns:repeat(2,156px) !important;gap:8px !important}
  .media-card{width:156px !important;min-width:156px !important;max-width:156px !important;padding:6px !important}
  .media-card .media-preview{
    width:140px !important;height:140px !important;
    min-width:140px !important;max-width:140px !important;
    min-height:140px !important;max-height:140px !important;
    flex-basis:140px !important;
  }
  .media-card>span:last-child{width:140px;max-width:140px}
  .job{padding:14px}
  .settings-card{padding:17px;margin-top:30px}
}
@media(max-width:370px){
  .gallery{grid-template-columns:repeat(2,calc((100vw - 36px)/2)) !important}
  .media-card{width:calc((100vw - 36px)/2) !important;min-width:0 !important;max-width:none !important}
  .media-card .media-preview{
    width:calc((100vw - 52px)/2) !important;
    height:calc((100vw - 52px)/2) !important;
    min-width:0 !important;max-width:none !important;
    min-height:0 !important;max-height:none !important;
  }
  .media-card>span:last-child{width:calc((100vw - 52px)/2);max-width:none}
}


/* v7 UI: supported platform strip */
.supported-platforms{
  width:min(1100px,calc(100% - 32px));
  margin:18px auto 0;
  padding:16px 18px;
  border:1px solid rgba(127,127,127,.16);
  border-radius:18px;
  background:rgba(127,127,127,.055);
}
.supported-title{
  font-size:13px;
  font-weight:700;
  letter-spacing:.02em;
  margin-bottom:11px;
  opacity:.72;
}
.platform-list{
  display:flex;
  flex-wrap:wrap;
  gap:9px;
}
.platform-chip{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:9px 12px;
  border:1px solid rgba(127,127,127,.16);
  border-radius:12px;
  background:rgba(255,255,255,.035);
}
.platform-chip b{font-size:13px}
.platform-chip small{font-size:11px;opacity:.62}
@media (max-width:640px){
  .supported-platforms{width:calc(100% - 24px);margin-top:12px;padding:13px}
  .platform-list{display:grid;grid-template-columns:1fr 1fr}
  .platform-chip{display:flex;flex-direction:column;align-items:flex-start;gap:2px;padding:10px}
}

/* v7.2 UI: unified status and YouTube cookie card */
.header-status{
  min-height:34px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border:1px solid var(--line);
  border-radius:999px;
  padding:0 14px;
  background:#fff;
  color:#6b7280;
  font-size:11px;
  font-weight:600;
  white-space:nowrap;
}
.header-status.is-ok{color:#166534;border-color:#bbf7d0;background:#f0fdf4}
.youtube-settings-card{margin-top:18px}
.youtube-settings-card .optional-badge{min-width:54px;text-align:center}
@media(max-width:700px){
  .header-status{max-width:190px;overflow:hidden;text-overflow:ellipsis}
}


/* v7.4.4 download-task spacing refinement */
.download-task,
.task-card,
.job-card {
  box-sizing: border-box;
  padding: 24px !important;
  overflow: hidden;
}

.download-task > *,
.task-card > *,
.job-card > * {
  max-width: 100%;
  box-sizing: border-box;
}

.download-task .error,
.download-task .log,
.download-task pre,
.task-card .error,
.task-card .log,
.task-card pre,
.job-card .error,
.job-card .log,
.job-card pre {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-wrap: anywhere;
  word-break: break-word;
  border-radius: 14px;
}

@media (max-width: 640px) {
  .download-task,
  .task-card,
  .job-card {
    padding: 16px !important;
  }
}

/* v7.4.5: actual download task card spacing + media layout */
.job {
  box-sizing: border-box;
  padding: 28px !important;
}
.job > * {
  max-width: 100%;
  box-sizing: border-box;
}
.gallery {
  gap: 16px !important;
  margin-top: 18px !important;
  margin-bottom: 5px !important;
}
.media-card {
  box-sizing: border-box !important;
}
@media (max-width: 700px) {
  .job {
    padding: 18px !important;
  }
}


/* v7.4.7: force the actual rendered job card gutter.
   Target the real DOM node (#jobs > article.job) and use a cache-busting
   stylesheet URL so browsers cannot keep an older CSS copy. */
#jobs > article.job {
  box-sizing: border-box !important;
  width: 100% !important;
  padding: 30px !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

#jobs > article.job > .job-title,
#jobs > article.job > .url,
#jobs > article.job > .progress,
#jobs > article.job > .error,
#jobs > article.job > pre,
#jobs > article.job > .gallery,
#jobs > article.job > .actions {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

#jobs > article.job > .gallery {
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding: 0 !important;
}

#jobs > article.job > .actions {
  margin-left: 0 !important;
  margin-right: 0 !important;
}

@media (max-width: 700px) {
  #jobs > article.job {
    padding: 18px !important;
  }
}


/* v7.5: audio-only results, per-file transcode button, quality picker.
   Appended here (loaded after the inline <style>) so these win. */
.media-card .media-preview audio {
  width: 100% !important;
  height: auto !important;
  max-height: 100% !important;
}
.media-card .media-name {
  display: block;
  width: 180px;
  max-width: 180px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #6b7280;
  font-size: 10px;
  line-height: 1.4;
}
.media-card .media-warn {
  max-width: 180px;
  color: #b45309;
  font-size: 10px;
  line-height: 1.4;
  text-align: center;
}
.media-card .transcode {
  width: 180px;
  max-width: 180px;
  height: 26px;
  border-radius: 7px;
  background: #f3f4f6;
  color: #4b5563;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
}
.media-card .transcode:hover:not(:disabled) { background: #e5e7eb; }
.media-card .transcode:disabled { opacity: .6; cursor: default; }

@media (max-width: 700px) {
  .media-card .media-name,
  .media-card .media-warn,
  .media-card .transcode { width: 140px; max-width: 140px; }
}


/* v7.5.1: unified per-platform cookie card */
.cookie-status {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}
.cookie-chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #9ca3af;
  font-size: 11px;
  font-weight: 600;
}
.cookie-chip.is-on {
  color: #166534;
  border-color: #bbf7d0;
  background: #f0fdf4;
}
.cookie-controls .select-wrap select { height: 36px; }


/* v8.1: queue position hint */
.queue-hint {
  margin: 8px 0 0;
  color: #6b7280;
  font-size: 12px;
}


/* v8.2: sign-in gate, account chip, admin visibility */
.header-right { display: flex; align-items: center; gap: 10px; }
.account { display: flex; align-items: center; gap: 8px; }
.account-name {
  max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: #4b5563; font-size: 12px; font-weight: 600;
}
.account-link, .account-btn {
  height: 30px; padding: 0 11px; border-radius: 999px;
  display: inline-flex; align-items: center;
  border: 1px solid var(--line); background: #fff; color: #4b5563;
  font-size: 11px; font-weight: 600; text-decoration: none; cursor: pointer;
}
.account-link:hover, .account-btn:hover { background: #f3f4f6; }

.login-gate { display: grid; place-items: center; padding: 56px 0 24px; }
.login-card {
  width: min(460px, 100%); padding: 34px; text-align: center;
  background: #fff; border: 1px solid rgba(229, 231, 235, .9);
  border-radius: 18px; box-shadow: 0 12px 35px rgba(15, 23, 42, .06);
}
.login-card h2 { margin: 10px 0 8px; font-size: 22px; letter-spacing: -.6px; }
.login-card p { margin: 0 auto; max-width: 340px; color: var(--muted); font-size: 13px; line-height: 1.75; }
.login-card .login-btn {
  position: static; width: 100%; justify-content: center; margin-top: 20px; height: 46px;
}
.login-error { min-height: 16px; margin-top: 12px !important; color: #b42318 !important; font-size: 11px !important; }

@media (max-width: 700px) {
  .header-right { gap: 6px; }
  .account-name { max-width: 90px; }
  .login-card { padding: 22px; }
}


/* v8.3: watched accounts + push channels */
.text-input {
  height: 36px; min-width: 210px; padding: 0 11px;
  border: 1px solid var(--line); border-radius: 8px;
  background: #fff; color: #374151; outline: 0; font: inherit; font-size: 12px;
}
.text-input:focus { border-color: #9ca3af; }
.event-picker { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 11px; }
.event-picker label {
  display: inline-flex; align-items: center; gap: 6px;
  color: #4b5563; font-size: 12px; cursor: pointer;
}
.event-picker input { accent-color: #111827; margin: 0; }

.subs-list { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.sub-row {
  display: flex; align-items: center; gap: 11px; flex-wrap: wrap;
  padding: 12px; border: 1px solid var(--line); border-radius: 11px;
  background: var(--surface-2);
}
.sub-row.is-off { opacity: .58; }
.sub-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.sub-title { font-size: 13px; font-weight: 700; }
.sub-meta { color: var(--muted); font-size: 11px; line-height: 1.6; word-break: break-word; }
.sub-meta .bad { color: #b42318; }
.sub-meta .warn { color: #b45309; }
.sub-actions { display: flex; gap: 6px; flex-shrink: 0; }
.sub-actions button {
  height: 28px; padding: 0 10px; border-radius: 7px;
  background: #f3f4f6; color: #4b5563;
  font-size: 11px; font-weight: 600; cursor: pointer;
}
.sub-actions button:hover { background: #e5e7eb; }
.sub-actions button.danger:hover { background: #fee2e2; color: #b42318; }
.subs-empty { padding: 16px; text-align: center; color: var(--muted-2); font-size: 12px; }

@media (max-width: 700px) {
  .text-input { min-width: 0; width: 100%; }
  .sub-row { align-items: flex-start; }
}


/* v8.4: plan chip, usage grid, expired-files notice */
.plan-chip {
  display: inline-flex; align-items: center; height: 26px; padding: 0 10px;
  border: 1px solid var(--line); border-radius: 999px; background: #fff;
  color: #6b7280; font-size: 11px; font-weight: 700; white-space: nowrap;
}
.plan-chip.is-paid { color: #92400e; border-color: #fde68a; background: #fffbeb; }

.usage-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px;
}
.usage-cell {
  padding: 12px 14px; border: 1px solid var(--line);
  border-radius: 11px; background: var(--surface-2);
}
.usage-cell b { display: block; font-size: 17px; letter-spacing: -.4px; }
.usage-cell small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }

.upgrade-hint { color: #b45309; }

.expired-note {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 13px; padding: 11px 13px;
  border: 1px dashed #d9dde3; border-radius: 11px;
  color: var(--muted); font-size: 12px; line-height: 1.6;
}
.expired-note .requeue {
  height: 28px; padding: 0 12px; border-radius: 7px;
  background: #111827; color: #fff; font-size: 11px; font-weight: 600; cursor: pointer;
}
.expired-note .requeue:hover { background: #252b35; }

/* ── Language switch ──────────────────────────────────────────────────────
   Two states, no dropdown: the choice is binary and a menu would hide it.

   Lives here rather than in console.css because landing.html mounts the same
   switcher but does not load console.css — there it rendered as bare native
   buttons. style.css is the only sheet all three pages share.
   Kept at the end of the file so the duplicated block above cannot win. */
.lang-switch {
  display: inline-flex;
  align-items: center;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
}
.lang-switch button {
  height: 26px;
  padding: 0 11px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.lang-switch button:hover { color: var(--text); }
.lang-switch button.is-active { background: #111827; color: #fff; }
/* Keyboard users need to see focus; the pill has no other affordance. */
.lang-switch button:focus-visible {
  outline: 2px solid #111827;
  outline-offset: 2px;
}
