:root {
  color-scheme: light dark;
  --surface: #fcfcfb;
  --raised: #ffffff;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --muted: #898781;
  --line: #e1e0d9;
  --accent: #2a6fd6;
  --accent-ink: #ffffff;
  --accent-soft: #eaf1fc;
  --logo-page: #dce8fb;
  --logo-line: #2a6fd6;
  --shadow: 0 1px 2px rgb(0 0 0 / .04), 0 4px 16px rgb(0 0 0 / .05);
  --good: #1a7f4e;
  --warn: #a35a00;
  --bad: #b3261e;
}
@media (prefers-color-scheme: dark) {
  :root {
    --surface: #1a1a19;
    --raised: #222221;
    --ink: #f0efec;
    --ink-2: #c3c2b7;
    --muted: #898781;
    --line: #2c2c2a;
    --accent: #4b8fe8;
    --accent-ink: #ffffff;
    --accent-soft: #1e2a3a;
    --logo-page: #2b3a52;
    --logo-line: #8fb6f0;
    --shadow: 0 1px 2px rgb(0 0 0 / .3);
    --good: #5cc48e;
    --warn: #e0a24a;
    --bad: #f08a80;
  }
}
* { box-sizing: border-box; }
/* An element hidden by the app stays hidden whatever display its rules set. */
[hidden] { display: none !important; }
body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.wrap { max-width: 760px; margin: 0 auto; padding: 0 16px; }
svg { flex: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.bar { position: sticky; top: 0; z-index: 2; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: saturate(1.4) blur(8px); -webkit-backdrop-filter: saturate(1.4) blur(8px); }
.bar-inner { display: flex; align-items: center; justify-content: space-between; height: 56px; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 19px; letter-spacing: -0.01em; }
.brand .logo { width: 30px; height: 30px; }
.brand.small { font-size: 14px; gap: 6px; color: var(--ink-2); font-weight: 600; }
.brand.small .logo { width: 18px; height: 18px; }
.brand.small #version { font-weight: 400; color: var(--muted); }
.bar-end { display: flex; align-items: center; gap: 12px; }
.lang { display: flex; padding: 2px; border: 1px solid var(--line); border-radius: 8px; background: var(--raised); }
.lang button {
  font: inherit; font-size: 13px; font-weight: 600; padding: 3px 10px; border-radius: 6px;
  border: 0; background: transparent; color: var(--muted); cursor: pointer;
}
.lang button[aria-pressed="true"] { background: var(--ink); color: var(--surface); }
.gh-link { display: inline-flex; color: var(--ink-2); padding: 4px; border-radius: 6px; }
.gh-link:hover { color: var(--ink); }
.gh { width: 22px; height: 22px; }
.intro { padding: 48px 0 8px; }
h1 { font-size: clamp(30px, 6vw, 40px); line-height: 1.1; margin: 0 0 12px; letter-spacing: -0.025em; }
.lead { font-size: 18px; color: var(--ink-2); margin: 0 0 20px; max-width: 34em; }
.features { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.features li { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px 6px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--ink); font-size: 14px; font-weight: 500; }
.features svg { width: 16px; height: 16px; fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
#pick { padding: 28px 0 8px; }
.drop {
  display: grid; justify-items: center; gap: 6px; text-align: center;
  padding: 40px 16px; border: 2px dashed color-mix(in srgb, var(--accent) 35%, var(--line)); border-radius: 16px;
  background: var(--raised); box-shadow: var(--shadow); cursor: pointer; transition: border-color .15s, background .15s;
}
.drop-icon { width: 40px; height: 40px; padding: 8px; border-radius: 12px; background: var(--accent-soft); fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; margin-bottom: 4px; }
.drop:hover, .drop.over, .drop:focus-within { border-color: var(--accent); }
.drop.over { background: color-mix(in srgb, var(--accent) 6%, var(--raised)); }
.drop.busy { pointer-events: none; border-style: solid; }
.drop.busy .drop-icon { animation: bob 1s ease-in-out infinite; }
.progress { display: block; width: min(320px, 80%); height: 6px; margin-top: 14px; border-radius: 999px; background: var(--accent-soft); overflow: hidden; }
.progress-bar { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--accent); transition: width .25s ease; }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop-title { font-size: 18px; font-weight: 600; }
.drop-choose { margin-top: 6px; padding: 8px 18px; border-radius: 8px; background: var(--accent); color: var(--accent-ink); font-weight: 600; font-size: 15px; }
.drop-hint { color: var(--muted); font-size: 14px; max-width: 460px; margin-top: 8px; }
.password { margin-top: 16px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--raised); }
.pw-title { font-weight: 600; margin: 0 0 4px; overflow-wrap: anywhere; }
.pw-hint { color: var(--ink-2); font-size: 14px; margin: 0 0 12px; }
.pw-error { color: var(--bad); font-size: 14px; margin: 0 0 8px; }
.pw-row { display: flex; flex-wrap: wrap; gap: 8px; }
.pw-row input { flex: 1 1 200px; font: inherit; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.pw-row button { font: inherit; padding: 8px 14px; border-radius: 8px; cursor: pointer; border: 1px solid var(--line); background: var(--raised); color: var(--ink); }
.pw-row .primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.status { min-height: 24px; color: var(--ink-2); margin: 12px 0 0; }
.status.error { color: var(--bad); }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.toolbar button {
  display: inline-flex; align-items: center; gap: 8px;
  font: inherit; font-size: 15px; padding: 8px 16px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--line); background: var(--raised); color: var(--ink);
}
.toolbar button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.toolbar button:hover { border-color: var(--muted); }
.toolbar .primary:hover { filter: brightness(1.08); }
#result.over { outline: 2px dashed var(--accent); outline-offset: 8px; border-radius: 12px; }
#result.over iframe { pointer-events: none; }
.toolbar .primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.files-alert { margin: 0 0 16px; }
.files-alert button { width: 100%; text-align: left; font: inherit; font-size: 15px; padding: 10px 14px; border-radius: 12px; cursor: pointer;
  border: 1px solid color-mix(in srgb, var(--warn) 40%, var(--line)); background: color-mix(in srgb, var(--warn) 8%, var(--raised)); color: var(--ink); }
.files-alert button::before { content: "! "; color: var(--warn); font-weight: 700; }
/* The sheet covers a phone's screen and sits at the side of a wider one. */
.sheet { width: 100%; max-width: none; height: 100%; max-height: none; margin: 0; padding: 0; border: 0; background: var(--surface); color: var(--ink); }
.sheet::backdrop { background: rgb(0 0 0 / .35); }
.sheet[open] { display: flex; flex-direction: column; animation: sheet-in .2s ease-out; }
@keyframes sheet-in { from { transform: translateY(24px); opacity: 0; } }
@media (min-width: 720px) {
  .sheet { width: 480px; margin-left: auto; border-left: 1px solid var(--line); }
  @keyframes sheet-in { from { transform: translateX(24px); opacity: 0; } }
}
@media (prefers-reduced-motion: reduce) { .sheet[open] { animation: none; } }
.sheet-head { position: sticky; top: 0; display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--surface); }
.sheet-head h2 { flex: 1; margin: 0; font-size: 18px; }
.sheet .close { width: 40px; height: 40px; border-radius: 999px; border: 1px solid var(--line); background: var(--raised); color: var(--ink); font-size: 16px; cursor: pointer; }
#sheet-lists, .sheet .anon { flex: 1; padding: 8px 16px 24px; overflow-y: auto; }
.sheet h3 { margin: 16px 0 4px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.sheet-hint { margin: 0 0 8px; font-size: 14px; color: var(--ink-2); }
.file-rows { list-style: none; padding: 0; margin: 0 0 8px; }
.file-rows li { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.file-rows .text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.file-rows .when { display: block; }
.file-rows .name, .file-rows .note { display: block; font-size: 13px; color: var(--muted); }
.file-rows .icon { flex: none; width: 1.2em; font-weight: 700; }
.file-rows .ok .icon { color: var(--good); }
.file-rows .warn .icon { color: var(--warn); }
.file-rows .bad .icon { color: var(--bad); }
.file-rows details { width: 100%; }
.file-rows details > summary { cursor: pointer; }
.file-rows details li { padding-left: 0; }
.file-rows .anon-open { flex: none; white-space: nowrap; font-size: 13px; padding: 8px 0 8px 8px; }
.link { padding: 0; border: 0; background: none; font: inherit; font-size: 14px; color: var(--accent); text-decoration: underline; cursor: pointer; }
.added { margin: 0 0 16px; padding: 10px 14px; border-radius: 12px; background: color-mix(in srgb, var(--good) 10%, var(--raised)); color: var(--ink); font-size: 15px; }
.added::before { content: "✓ "; color: var(--good); font-weight: 700; }
.added.none { background: var(--raised); color: var(--ink-2); }
.added.none::before { content: ""; }
.added.fading { opacity: 0; transition: opacity .6s ease; }
.added.going { overflow: hidden; margin-bottom: 0; padding-top: 0; padding-bottom: 0;
  transition: height .25s ease, margin .25s ease, padding .25s ease; }
.misread { margin: 16px 0 0; text-align: center; }
.report-tabs { display: flex; gap: 4px; margin: 0 -16px; padding: 0 16px; overflow-x: auto; scrollbar-width: none; border-top: 1px solid var(--line); }
.report-tabs[hidden] { display: none; }
.report-tabs button { flex: none; font: inherit; font-size: 15px; font-weight: 600; padding: 10px 12px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--ink-2); cursor: pointer; }
.report-tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); }
.report-tabs button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 4px; }
.anon a { color: var(--accent); }
.anon { margin: 0; }
.anon h2 { font-size: 18px; margin: 0 0 8px; overflow-wrap: anywhere; }
.anon p { margin: 0 0 12px; color: var(--ink-2); }
.anon .check { display: flex; gap: 8px; align-items: baseline; margin: 0 0 4px; }
.anon .anon-warning { font-size: 14px; color: var(--warn); }
.anon .anon-error { color: var(--bad); }
.anon pre { max-height: 320px; overflow: auto; margin: 0 0 12px; padding: 12px; font-size: 12px; line-height: 1.4; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); white-space: pre; }
.anon .toolbar { margin: 0; }
.notice { padding: 12px 16px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink-2); }
/* Motion: short, eased, and none for people who ask for less. */
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes bob { 50% { transform: translateY(-3px); } }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.enter { animation: rise .4s cubic-bezier(.2, .7, .2, 1) both; }
.leaving { opacity: 0; transform: translateY(-8px); transition: opacity .18s ease, transform .18s ease; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
#result { position: relative; }
.skeleton { display: grid; gap: 12px; padding: 24px 0; }
.sk { display: block; height: 14px; border-radius: 8px; background: linear-gradient(90deg, var(--line) 25%, var(--raised) 50%, var(--line) 75%); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
.sk-title { width: 55%; height: 28px; }
.sk-line { width: 40%; }
.sk-big { width: 65%; height: 44px; margin-top: 12px; }
.sk-bar { height: 28px; margin: 8px 0; }
.sk-row { height: 20px; }
/* A frame still loading keeps its width but takes no room and is not seen. */
#report.pending { position: absolute; left: 0; top: 0; opacity: 0; pointer-events: none; }
/* The report has its own side padding: let the frame reach the page edges. */
#report { display: block; width: calc(100% + 32px); margin: 0 -16px; border: 0; min-height: 400px; background: var(--surface); }
.foot { padding: 24px 0 40px; color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); margin-top: 24px; }
.foot .disclaimer { margin: 0 0 16px; max-width: 60em; }
.foot-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.foot-links { display: inline-flex; align-items: center; gap: 6px; }
.foot-links a { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); text-decoration: none; }
.foot-links a:hover { color: var(--ink); }
.foot-links .gh { width: 16px; height: 16px; }
