:root{
  color-scheme:dark;
  --bg:#202122;--surface:#27292d;--raised:#303339;
  --text:#f5f6f7;--muted:#b7bac0;--line:#42464e;
  --blue:#2161cf;--focus:#a7cbff;
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  color:var(--text);background:var(--bg);font-size:16px;
  scrollbar-color:#626975 var(--bg);
}
*{box-sizing:border-box}
body{margin:0}
::selection{background:#375b8d;color:#fff}
a{color:#a1c5ff;text-underline-offset:4px}
a:hover{color:#fff}
button,input{font:inherit}
button,a,label,summary{-webkit-tap-highlight-color:transparent}
button,summary{cursor:pointer}
a:focus-visible,button:focus-visible,summary:focus-visible{outline:2px solid var(--focus);outline-offset:4px}
header{height:76px;padding:0 40px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid #343639;gap:24px}
.brand{display:flex;align-items:center;gap:12px;color:var(--text);font-size:22px;font-weight:650;text-decoration:none;white-space:nowrap}
.brand img{object-fit:contain}
nav{display:flex;gap:28px}
nav a{display:inline-flex;align-items:center;gap:9px;min-height:44px;color:var(--muted);text-decoration:none;font-size:15px}
main{max-width:808px;margin:0 auto;padding:38px 24px 56px}
h1{text-align:center;font-size:36px;line-height:1.2;letter-spacing:-.025em;margin:0 0 12px;font-weight:650}
.intro{text-align:center;color:var(--muted);font-size:17px;line-height:1.5;margin:0 0 30px}
.icon{width:22px;height:22px;flex:0 0 22px;display:inline-block;vertical-align:middle}
.brand-symbol{filter:invert(1);opacity:.9}

/* Platform choices retain the site's segmented-control language. */
fieldset{border:0;padding:0;margin:0 0 22px;min-width:0}
legend{font-size:16px;font-weight:500;margin-bottom:10px;padding:0}
.os,.segments{display:flex;gap:5px;padding:5px;background:var(--surface);border:1px solid var(--line);border-radius:14px}
.os{margin-bottom:26px}
label{display:flex;position:relative;flex:1;min-width:0;cursor:pointer}
label input{position:absolute;inset:0;width:100%;height:100%;margin:0;opacity:0;z-index:1;cursor:pointer}
label span{display:flex;align-items:center;justify-content:center;gap:10px;text-align:center;padding:12px;min-height:46px;width:100%;border-radius:9px;font-size:16px;line-height:1.35;color:var(--muted);border:1px solid transparent;transition:background .15s,color .15s,border-color .15s}
label:hover span{background:#343941;color:var(--text)}
label input:checked+span{background:#2c425f;color:#eef5ff;border-color:#5b7da7}
label input:focus-visible+span{outline:2px solid var(--focus);outline-offset:2px}
.hint{margin:10px 0 0;color:var(--muted);font-size:13px;line-height:1.6}
#platform-options fieldset[data-step="format"] .segments{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}
#platform-options #processor-help{margin:-10px 0 24px;color:var(--muted)}
#processor-help summary{justify-content:flex-start;padding:6px 0;font-size:13px;gap:12px}
#processor-help p{margin:10px 0 0;max-width:65ch}

/* One primary action, with source and history on a quieter shared baseline. */
.result{padding:24px 24px 10px;text-align:left;border:1px solid var(--line);border-radius:16px;background:var(--surface);margin-top:24px}
.download-row{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:24px}
.result h2{font-size:22px;line-height:1.35;letter-spacing:-.015em;font-weight:600;margin:0 0 7px;overflow-wrap:anywhere}
.result #result-meta{font-size:14px;line-height:1.6;margin:0;color:var(--muted);font-variant-numeric:tabular-nums}
.download-actions{min-width:180px}
.primary,.secondary{display:inline-flex;align-items:center;justify-content:center;gap:10px;text-decoration:none;border:1px solid transparent;line-height:1.35;transition:background .15s,transform .15s}
.primary{width:100%;min-height:48px;padding:11px 18px;border-radius:11px;font-size:16px;font-weight:600;background:var(--blue);color:#fff}
.primary:hover{background:#2a70df;color:#fff}
.primary:active{background:#194da7;transform:translateY(1px)}
.primary[aria-disabled="true"]{opacity:.5;cursor:not-allowed;transform:none}
.download-footer{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-top:20px;padding-top:7px;border-top:1px solid #3b3e44}
.history{display:inline-flex;align-items:center;gap:7px;min-height:44px;font-size:13px;text-decoration:none;color:var(--muted)}
.history:hover{color:var(--text)}
.history .icon{width:15px;height:15px;flex-basis:15px}
.result .note{font-size:13px;line-height:1.6;margin:8px 0 12px;color:var(--muted)}
.result p:empty{display:none}

/* Accessible menu button: native buttons, radio semantics, no OS select chrome. */
.download-source{display:flex;justify-content:flex-end;align-items:center;gap:6px;flex-shrink:0}
.source-label{font-size:12px;color:var(--muted)}
.source-picker{position:relative}
#source-toggle{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:44px;padding:8px 10px;font-size:13px;font-weight:500;color:var(--text);background:transparent;border:0;border-radius:8px;transition:background .15s}
#source-toggle:hover,#source-toggle[aria-expanded="true"]{background:#373b42}
#source-toggle svg{width:14px;height:14px;color:var(--muted);transition:transform .15s}
#source-toggle[aria-expanded="true"] svg{transform:rotate(180deg)}
.source-menu{position:absolute;right:0;top:calc(100% + 6px);z-index:20;width:284px;padding:6px;border-radius:12px;background:var(--raised);box-shadow:0 12px 32px #0006;animation:menu-enter .16s cubic-bezier(.16,1,.3,1)}
.source-menu button{display:grid;grid-template-columns:20px minmax(0,1fr) 16px;align-items:center;gap:12px;width:100%;min-height:64px;padding:10px;border:0;border-radius:8px;background:transparent;color:var(--text);text-align:left}
.source-menu button+button{margin-top:3px}
.source-menu button:hover{background:#3c414a}
.source-menu button[aria-checked="true"]{background:#2b4567;color:#eff6ff}
.source-menu button:focus-visible{outline:2px solid var(--focus);outline-offset:-2px}
.source-menu button[aria-disabled="true"]{opacity:.55;cursor:not-allowed}
.source-icon{width:20px;height:20px}
.source-copy{display:flex;flex-direction:column;gap:4px}
.source-name{font-size:14px;font-weight:550;line-height:1.3}
.source-description{font-size:12px;line-height:1.45;color:#c0c5ce}
[aria-checked="true"] .source-description{color:#c5d8f0}
.source-check{width:16px;height:16px;opacity:0}
[aria-checked="true"] .source-check{opacity:1}
@keyframes menu-enter{from{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}

/* Instructions stay available without competing with the download. */
.help{margin-top:20px}
.help details{border-bottom:1px solid #3a3d42;padding:0 2px}
summary{display:flex;align-items:center;justify-content:space-between;gap:16px;list-style:none;padding:18px 0;line-height:1.4;font-size:15px}
summary::-webkit-details-marker{display:none}
summary::after{content:"";flex:0 0 6px;width:6px;height:6px;border-right:1.5px solid currentColor;border-bottom:1.5px solid currentColor;transform:rotate(45deg);margin-right:4px;transition:transform .15s}
summary:hover{color:#fff}
details[open]>summary::after{transform:rotate(225deg)}
details p,details li{font-size:14px;line-height:1.7;color:var(--muted)}
details p{margin:0 0 16px;max-width:72ch}
details ol{padding-left:22px;margin:0 0 16px}
details li{padding:3px 0}
pre{padding:17px;border-radius:10px;background:#17191c;overflow-x:auto;font-size:13px;line-height:1.7;white-space:pre-wrap;overflow-wrap:anywhere}
code{font-family:ui-monospace,SFMono-Regular,Consolas,monospace}
.secondary{background:#34383e;color:var(--text);min-height:44px;padding:10px 16px;border-radius:9px;font-size:14px;margin-bottom:16px}
.secondary:hover{background:#444b57}
#copy-status{margin-left:12px;font-size:14px;color:var(--muted)}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.skip{position:fixed;top:8px;left:8px;z-index:30;transform:translateY(-150%);background:var(--blue);color:white;padding:12px;border-radius:8px}
.skip:focus{transform:none}
[hidden]{display:none!important}

@media(max-width:640px){
  header{height:72px;padding:0 20px;gap:12px}
  .brand{font-size:19px;gap:8px}.brand img{width:30px;height:30px}
  nav{gap:14px}nav a{font-size:14px}nav a .icon{display:none}
  main{padding:28px 20px 40px}
  h1{font-size:30px}.intro{font-size:16px;margin-bottom:24px}
  .os{display:grid;grid-template-columns:repeat(3,1fr)}
  .os label span{min-height:44px;padding:10px 5px;font-size:15px;gap:7px}
  .os .icon{width:19px;height:19px;flex-basis:19px}
  .segments{flex-direction:column}label span{min-height:48px}
  #platform-options fieldset[data-step="format"] .segments{grid-template-columns:1fr}
  .result{padding:20px 20px 10px}.download-row{grid-template-columns:1fr;gap:18px}
  .result h2{font-size:21px}.download-actions{min-width:0}
  .download-footer{flex-wrap:wrap;gap:0 12px;margin-top:14px}
  .download-source{position:relative}.source-picker{position:static}
}
@media(max-width:520px){
  .download-footer{flex-direction:column;align-items:stretch}
  .download-source{order:-1;justify-content:space-between}
  .source-menu{width:auto;left:0;right:0}
  .history{width:fit-content}
}
@media(max-width:380px){header{padding:0 14px}.brand{font-size:17px}nav{gap:10px}nav a{font-size:12px}main{padding-left:14px;padding-right:14px}}
@media(prefers-reduced-motion:reduce){*,*::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}}
@supports not selector(:focus-visible){label input:focus+span,a:focus,button:focus,summary:focus{outline:2px solid var(--focus);outline-offset:3px}}
