:root {
  color-scheme: dark;
  --bg: #1b1d25;
  --panel: #242630;
  --input: #1e2029;
  --line: #3a3d4b;
  --text: #e9e9ef;
  --muted: #a9acba;
  /* Matches the primary shades in flashcart-guides/extra.css. */
  --red: #b23456;
  --red-light: #c64f6e;
  --red-dark: #902a46;
  --link: #ef9bb2;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, select, textarea { font: inherit; }
button, summary, select { cursor: pointer; }
button, a, input, summary, select, textarea { -webkit-tap-highlight-color: transparent; }
button:disabled { opacity: .4; cursor: default; }
a { color: var(--link); text-underline-offset: 3px; }
a:hover { color: #ffc0d2; }
button:focus-visible, a:focus-visible, summary:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, pre:focus-visible { outline: 2px solid var(--red-light); outline-offset: 4px; }
[hidden] { display: none !important; }
.topbar { max-width: 1000px; margin: auto; padding: 25px 26px 22px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); }
.topbar h1 { display: flex; align-items: center; gap: 11px; margin: 0; font-size: 23px; font-weight: 650; letter-spacing: -.5px; }
.topbar img { display: block; }
.topbar > a { font-size: 13px; text-decoration: none; }
main { max-width: 1000px; margin: 0 auto; padding: 29px 26px 32px; }
.workspace { display: grid; grid-template-columns: 1fr 1fr; grid-template-areas: "note mascot" "settings result"; gap: 0 32px; align-items: start; }
.wifi-note { grid-area: note; align-self: end; margin: 0 0 20px; max-width: 420px; color: var(--muted); font-size: 13px; line-height: 1.75; }
.settings { grid-area: settings; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 24px; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 2px 0 17px; margin: 0; font-size: 14px; cursor: pointer; }
.toggle-row input { appearance: none; flex-shrink: 0; width: 36px; height: 21px; border: 0; border-radius: 30px; background: #515563; position: relative; cursor: pointer; margin: 0; }
.toggle-row input::before { content: ''; position: absolute; top: 3px; left: 3px; width: 15px; height: 15px; border-radius: 50%; background: #fff; transition: transform .12s; }
.toggle-row input:checked { background: var(--red); }
.toggle-row input:checked::before { transform: translateX(15px); }
fieldset { border: 0; margin: 0; padding: 0 0 17px; }
label:not(.toggle-row):not(.check-row) { display: block; margin: 17px 0 7px; font-size: 13px; font-weight: 550; }
input:not([type=checkbox]):not([type=file]), select, textarea { display: block; width: 100%; min-width: 0; border: 1px solid #474b5b; border-radius: 6px; padding: 10px 11px; color: var(--text); background: var(--input); font-size: 13px; }
input::placeholder { color: #8c91a3; opacity: 1; }
textarea { resize: vertical; font-family: ui-monospace, Consolas, monospace; font-size: 11px; line-height: 1.65; overflow-wrap: anywhere; }
input[type=file] { max-width: 100%; font-size: 11px; }
input[type=file]::file-selector-button { border: 1px solid #565b6d; border-radius: 5px; color: var(--text); background: #353946; padding: 7px 9px; margin-right: 8px; cursor: pointer; }
input[type=checkbox] { accent-color: var(--red); }
.check-row { display: flex; align-items: center; gap: 7px; font-size: 12px; margin: 15px 0 0; }
.hint, small { display: block; color: var(--muted); font-size: 12px; line-height: 1.65; margin: 9px 0 0; }
.advanced { border-top: 1px solid var(--line); }
summary { color: var(--muted); font-size: 13px; line-height: 1.5; }
summary::marker { color: var(--red-light); font-size: 11px; }
summary:hover { color: var(--text); }
.advanced > summary { padding: 17px 0 0; }
.advanced-content { padding: 7px 0 0; }
.advanced-content > .hint:first-child { margin-top: 7px; }
.advanced-content small { font-size: 11px; }
.text-button { background: none; border: 0; padding: 7px 0; color: var(--link); font-size: 12px; text-decoration: underline; text-underline-offset: 3px; }
.advanced-content .text-button { margin-top: 6px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 6px; padding: 10px 18px; font-size: 13px; font-weight: 600; transition: background .12s, border-color .12s; }
.primary { width: 100%; margin-top: 23px; padding: 13px 18px; background: var(--red); color: #fff; }
.primary:hover { background: var(--red-light); }
.primary:active { background: var(--red-dark); }
.secondary { background: #303440; border-color: #505567; color: var(--text); min-width: 76px; }
.secondary:hover:enabled { background: #3e3543; border-color: var(--red-light); }
.error { background: #492735; border: 1px solid #9a4d64; color: #ffd3df; font-size: 12px; line-height: 1.65; border-radius: 6px; padding: 10px 12px; margin: 17px 0 0; }
.mascot-perch { grid-area: mascot; align-self: end; position: relative; height: 119px; pointer-events: none; }
.ryuuko { display: block; position: absolute; left: 50%; bottom: -13px; transform: translateX(-50%); width: 250px; height: auto; z-index: 2; }
.result { grid-area: result; position: relative; }
.result-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 19px; }
h2 { font-size: 16px; font-weight: 600; margin: 0; }
.state { font-size: 11px; color: var(--muted); }
.state.ready { color: #df8da4; }
.qr-stage { background: #fff; border: 8px solid #fff; border-radius: 8px; min-height: 304px; display: flex; align-items: center; justify-content: center; padding: 7px; color-scheme: light; }
#qr-image { width: 100%; max-width: 320px; }
#qr-image:empty { display: none; }
.qr-stage svg { display: block; width: 100%; height: auto; }
#qr-placeholder { color: #5b5d69; font-size: 14px; line-height: 1.7; text-align: center; margin: 0; }
.download-row { display: flex; justify-content: center; flex-wrap: wrap; gap: 9px; margin: 20px 0 0; }
.payload-details { margin-top: 20px; }
.payload-details > summary { font-size: 12px; }
pre { font-family: ui-monospace, Consolas, monospace; font-size: 10px; line-height: 1.8; background: var(--input); border: 1px solid var(--line); padding: 12px; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 260px; overflow: auto; border-radius: 6px; }
#copy-status:empty { display: none; }
.instructions { margin: 28px 0 0; border: 1px solid var(--line); border-radius: 9px; background: #21232c; }
.instructions > h2 { padding: 16px 19px; color: var(--text); font-size: 16px; }
.instructions-content { padding: 0 21px 19px; color: #c7cad5; font-size: 13px; line-height: 1.8; }
.instructions-content ol { margin: 1px 0 18px; padding-left: 21px; }
.instructions-content li { padding-left: 3px; margin-bottom: 9px; }
.instructions-content p { margin: 12px 0 0; }
.instructions-content strong { color: var(--text); font-weight: 600; }
.instructions-content .removal-note { color: #f2b7c8; border-left: 2px solid var(--red); padding-left: 12px; }
.instructions-content .removal-note strong { color: inherit; }
footer { max-width: 948px; margin: auto; padding: 20px 0 30px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 20px; font-size: 11px; color: #999eae; }
footer > div { display: flex; gap: 22px; }
footer a { color: var(--muted); text-decoration: none; }
.noscript { position: fixed; bottom: 16px; left: 16px; right: 16px; padding: 18px; border: 1px solid var(--red); background: var(--panel); }
.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; }
@media (max-width: 1000px) { footer { margin: 0 26px; } }
@media (max-width: 700px) {
  .topbar { padding: 21px 20px; }
  .topbar h1 { font-size: 21px; }
  main { padding: 24px 20px 28px; }
  .workspace { grid-template-columns: 1fr; grid-template-areas: "note" "settings" "mascot" "result"; gap: 0; }
  .wifi-note { max-width: none; margin-bottom: 18px; }
  .card { padding: 22px; }
  .mascot-perch { height: 153px; }
  .ryuuko { width: 250px; }
  .result-heading { margin-bottom: 17px; }
  #qr-image { max-width: 320px; }
  .qr-stage { min-height: 280px; }
  footer { margin: 0 20px; flex-wrap: wrap; gap: 16px; }
  footer > div { gap: 20px; flex-wrap: wrap; }
}
@media (max-width: 360px) {
  main { padding-left: 14px; padding-right: 14px; }
  .card { padding: 18px; }
  .qr-stage { min-height: 238px; padding: 2px; }
  .secondary { min-width: 64px; padding: 10px 14px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
