button, [role="button"], select, summary, input:not([type="checkbox"], [type="radio"]), textarea { min-height: 2rem; }

:root {
  color-scheme: light dark;
  --bg: #f2f6fa;
  --bg-2: #e4ecf4;
  --surface: #ffffff;
  --surface-2: #f2f7fa;
  --ink: #0a1e33;
  --ink-2: #3e5871;
  --ink-3: #7188a0;
  --line: #d5e0ea;
  --accent: #0b63c4;
  --accent-strong: #084e9c;
  --accent-soft: #e2edfa;
  --good: #0e9f6e;
  --good-soft: #e0f4ec;
  --warn: #b45309;
  --warn-soft: #fbedd8;
  --bad: #c22727;
  --bad-soft: #fbe3e3;
  --info: #0b63c4;
  --info-soft: #e2edfa;
  --shadow: 0 22px 46px -18px rgba(10, 37, 64, .30);
  --radius: 16px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #060d18;
    --bg-2: #081426;
    --surface: #0c1b30;
    --surface-2: #10233c;
    --ink: #e9f1f9;
    --ink-2: #a9bed4;
    --ink-3: #7e97b1;
    --line: #1e3a56;
    --accent: #4da3f5;
    --accent-strong: #7fbdf8;
    --accent-soft: #0f2c4d;
    --good: #3ecf97;
    --good-soft: #0e2e25;
    --warn: #f0a832;
    --warn-soft: #3a2a0e;
    --bad: #f26d6d;
    --bad-soft: #3d1717;
    --info: #6db1f2;
    --info-soft: #12293f;
    --shadow: 0 22px 46px -18px rgba(0, 0, 0, .65);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
.mono { font-family: "IBM Plex Mono", ui-monospace, monospace; direction: ltr; unicode-bidi: embed; }

.wrap { max-width: 1060px; margin: 0 auto; padding: 0 20px 72px; }

/* ---------- top band ---------- */
.topband {
  background:
    radial-gradient(760px 320px at 85% -60px, rgba(47,206,166,.22), transparent 60%),
    radial-gradient(620px 300px at 8% -80px, rgba(77,163,245,.28), transparent 55%),
    linear-gradient(165deg, #0d2e52 0%, #0a2540 55%, #071a30 100%);
  border-bottom: 1px solid #123252;
  padding: 46px 20px 0;
  color: #eaf2fa;
}
.topband-in { max-width: 1060px; margin: 0 auto; }
.brandrow { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.brandmark {
  width: 42px; height: 42px; border-radius: 11px; flex: none;
  background: var(--accent); color: #fff;
  display: grid; place-items: center;
}
.brandmark svg { width: 24px; height: 24px; }
.brandname { font-weight: 800; font-size: 1.3rem; letter-spacing: .2px; }
.brandname .tld { color: var(--accent); }
.brandtag { color: var(--ink-2); font-size: .92rem; margin-inline-start: auto; text-align: end; }
@media (max-width: 560px) { .brandtag { display: none; } }

h1 {
  font-size: clamp(1.9rem, 5.2vw, 3rem);
  font-weight: 800; line-height: 1.2; margin: 0 0 12px; max-width: 22ch; letter-spacing: -0.02em;
}
h1 .hl { color: var(--accent); }
.lede { color: var(--ink-2); font-size: 1.08rem; max-width: 62ch; margin: 0 0 28px; }
.lede b { color: var(--ink); }

/* ---------- checker card ---------- */
.checker {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 18px; box-shadow: var(--shadow);
  padding: 22px; margin-bottom: -46px; position: relative; z-index: 2;
}
.checker label { font-weight: 800; font-size: .98rem; display: block; margin-bottom: 10px; }
.inputrow { display: flex; gap: 10px; }
.inputrow input {
  flex: 1; min-width: 0;
  font-family: "IBM Plex Mono", monospace; direction: ltr; text-align: left;
  font-size: 1rem; padding: 13px 16px;
  border: 1.5px solid var(--line); border-radius: 12px;
  background: var(--surface-2); color: var(--ink);
}
.inputrow input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.btn-check {
  flex: none; border: 0; cursor: pointer;
  background: var(--accent); color: #fff;
  font-family: inherit; font-weight: 800; font-size: 1.05rem;
  padding: 13px 30px; border-radius: 12px; min-height: 48px;
  transition: background .15s ease, transform .1s ease;
}
.btn-check:hover { background: var(--accent-strong); }
.btn-check:active { transform: scale(.98); }
@media (max-width: 560px) {
  .inputrow { flex-direction: column; }
  .btn-check { width: 100%; }
}
.toolrow { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 14px; }
.toolrow .note { color: var(--ink-3); font-size: .88rem; margin-inline-start: auto; }
.btn-ghost {
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
  font-family: inherit; font-weight: 700; font-size: .9rem;
  padding: 8px 14px; border-radius: 9px; cursor: pointer; min-height: 38px;
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.examples { margin-top: 16px; padding-top: 16px; border-top: 1px dashed var(--line); }
.examples p { margin: 0 0 10px; font-size: .9rem; color: var(--ink-2); font-weight: 700; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font-family: "IBM Plex Mono", monospace; direction: ltr; font-size: .8rem;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-2);
  padding: 8px 12px; border-radius: 999px; cursor: pointer; min-height: 36px;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.err { display: none; margin-top: 12px; color: var(--bad); font-weight: 700; font-size: .95rem; }
.err.show { display: block; }

main { padding-top: 78px; }
section { margin-top: 54px; }
h2 { font-size: 1.55rem; font-weight: 800; margin: 0 0 8px; letter-spacing: -0.01em; }
.sub { color: var(--ink-2); margin: 0 0 22px; max-width: 66ch; }

/* ---------- result ---------- */
#result { display: none; }
#result.show { display: block; }
.result-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 18px; box-shadow: var(--shadow); overflow: hidden;
}
.result-head {
  display: grid; grid-template-columns: 210px 1fr; gap: 8px 28px;
  padding: 26px 28px 8px; align-items: center;
}
@media (max-width: 640px) { .result-head { grid-template-columns: 1fr; justify-items: center; text-align: center; } }
.gauge-box { text-align: center; }
.gauge-box svg { width: 190px; max-width: 60vw; height: auto; display: block; margin: 0 auto; }
.gauge-score { font-size: 2.5rem; font-weight: 800; line-height: 1; margin-top: -52px; }
.gauge-cap { color: var(--ink-3); font-size: .85rem; margin-top: 4px; }
.verdict { font-size: 1.7rem; font-weight: 800; margin: 0 0 6px; }
.verdict.good { color: var(--good); } .verdict.warn { color: var(--warn); }
.verdict.bad { color: var(--bad); } .verdict.info { color: var(--info); }
.verdict-desc { color: var(--ink-2); margin: 0 0 14px; max-width: 52ch; }
.checked-url {
  font-size: .88rem; word-break: break-all; background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; text-align: left;
}
.result-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; align-items: center; }
@media (max-width: 640px) { .result-actions { justify-content: center; } }

.anatomy { padding: 18px 28px 4px; }
.anatomy h2, .checks h2 { font-size: 1.05rem; font-weight: 800; margin: 0 0 12px; font-family: inherit; letter-spacing: normal; }
.anatomy-grid { display: flex; flex-wrap: wrap; gap: 8px; direction: ltr; }
.part {
  border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px;
  background: var(--surface-2); min-width: 0;
}
.part .k { display: block; font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); direction: ltr; text-align: left; font-family: "Manrope", sans-serif; }
.part .v { font-family: "IBM Plex Mono", monospace; font-size: .88rem; word-break: break-all; }
.part.domain { border-color: var(--accent); background: var(--accent-soft); }

.checks { padding: 18px 28px 26px; }
.check {
  display: flex; gap: 12px; padding: 12px 14px; border-radius: 12px;
  border: 1px solid var(--line); margin-bottom: 8px; background: var(--surface);
  align-items: flex-start;
}
.check .ic { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; margin-top: 2px; }
.check .ic svg { width: 15px; height: 15px; }
.check.good .ic { background: var(--good-soft); color: var(--good); }
.check.warn .ic { background: var(--warn-soft); color: var(--warn); }
.check.bad  .ic { background: var(--bad-soft);  color: var(--bad); }
.check .t { font-weight: 800; font-size: .98rem; }
.check .d { color: var(--ink-2); font-size: .92rem; }
.check .pts { margin-inline-start: auto; flex: none; font-weight: 800; font-size: .85rem; color: var(--ink-3); }
.check.bad .pts { color: var(--bad); } .check.warn .pts { color: var(--warn); }

/* ---------- batch ---------- */
.batch-card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 22px; box-shadow: var(--shadow); }
.batch-card textarea {
  width: 100%; min-height: 120px; resize: vertical;
  font-family: "IBM Plex Mono", monospace; direction: ltr; text-align: left; font-size: .92rem;
  border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px;
  background: var(--surface-2); color: var(--ink);
}
.batch-card textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.batch-list { margin-top: 16px; display: grid; gap: 8px; }
.brow {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  border: 1px solid var(--line); background: var(--surface-2); border-radius: 12px;
  padding: 10px 14px; cursor: pointer; font-family: inherit; color: var(--ink); min-height: 48px;
}
.brow:hover { border-color: var(--accent); }
.brow .u { font-family: "IBM Plex Mono", monospace; direction: ltr; font-size: .85rem; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
.pill { flex: none; font-weight: 800; font-size: .82rem; padding: 4px 12px; border-radius: 999px; }
.pill.good { background: var(--good-soft); color: var(--good); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad  { background: var(--bad-soft);  color: var(--bad); }
.pill.info { background: var(--info-soft); color: var(--info); }

/* ---------- education ---------- */
.flags { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.flag {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px;
}
.flag .fic { width: 38px; height: 38px; border-radius: 10px; background: var(--bad-soft); color: var(--bad); display: grid; place-items: center; margin-bottom: 12px; }
.flag .fic svg { width: 20px; height: 20px; }
.flag h3 { margin: 0 0 6px; font-size: 1.02rem; font-weight: 800; }
.flag p { margin: 0; color: var(--ink-2); font-size: .93rem; }
.flag p .mono { font-size: .85em; }

.how { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; counter-reset: step; }
.step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.step .n {
  width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: #fff;
  font-weight: 800; display: grid; place-items: center; margin-bottom: 12px; font-size: .95rem;
}
.step h3 { margin: 0 0 6px; font-size: 1.02rem; font-weight: 800; }
.step p { margin: 0; color: var(--ink-2); font-size: .93rem; }

.limit-note {
  margin-top: 54px; border: 1px solid var(--line); border-inline-start: 4px solid var(--warn);
  background: var(--surface); border-radius: 12px; padding: 16px 20px; color: var(--ink-2); font-size: .95rem;
}
.limit-note b { color: var(--ink); }

footer { margin-top: 46px; padding-top: 22px; border-top: 1px solid var(--line); color: var(--ink-3); font-size: .9rem; display: flex; flex-wrap: wrap; gap: 8px 22px; }
footer .mono { font-size: .85rem; }
.session-stat { font-weight: 700; color: var(--ink-2); margin-inline-start: auto; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

/* ---------- Premium redesign layer (security blue / teal-safe / dark header) ---------- */
h1, h2, .brandname, .verdict, .gauge-score { font-family: "Sora", "Manrope", sans-serif; }
h1 { letter-spacing: -0.02em; }
.topband .brandmark {
  background: linear-gradient(135deg, #0e9f6e, #0b63c4);
  box-shadow: 0 12px 26px -10px rgba(14, 159, 110, .65);
}
.topband .brandname { color: #ffffff; }
.topband .brandname .tld { color: #2fcea6; }
.topband .brandtag { color: #a9c3dc; }
.topband h1 { color: #ffffff; }
.topband h1 .hl { color: #2fcea6; }
.topband .lede { color: #c3d5e8; }
.topband .lede b { color: #ffffff; }
.checker { border-radius: 20px; }
.btn-check {
  background: linear-gradient(135deg, #0e9f6e, #0b7a55);
  box-shadow: 0 14px 28px -12px rgba(14, 159, 110, .8);
}
.btn-check:hover { background: linear-gradient(135deg, #0b7a55, #095c3d); }
.btn-ghost { border-radius: 10px; transition: border-color .15s ease, color .15s ease, transform .15s ease; }
.btn-ghost:hover { transform: translateY(-1px); }
.chip { transition: border-color .15s ease, color .15s ease, transform .15s ease; }
.chip:hover { transform: translateY(-1px); }
.result-card, .flag-card, .step { transition: transform .16s ease, box-shadow .16s ease; }
.check.info .ic { background: var(--info-soft); color: var(--info); }
footer { border-top: 1px solid var(--line); }

/* ---------- v3: accessibility ---------- */
.skip-link {
  position: absolute; inset-inline-start: -9999px; top: 0; z-index: 100;
  background: var(--accent); color: #fff; font-weight: 700;
  padding: 10px 18px; border-radius: 0 0 10px 0; text-decoration: none;
}
.skip-link:focus { inset-inline-start: 0; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.batch-card label { font-weight: 800; font-size: .98rem; display: block; margin-bottom: 10px; }

/* ---------- v3: classes converted from inline styles (visually identical) ---------- */
.gauge-arc { transition: stroke-dashoffset .8s ease, stroke .3s ease; }
.copy-note { color: var(--accent); font-weight: 700; }
.btn-batch { padding: 10px 24px; font-size: 1rem; }
.batch-note-text { color: var(--ink-3); font-size: .88rem; margin: 12px 0 0; }
.privacy-p { margin: 0 0 10px; }
.privacy-p-last { margin: 0; }
.footer-nav { display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; padding: 14px 0 4px; font-size: .92rem; }

/* ---------- v3: guides section (homepage) ---------- */
.flag .guide-more { color: var(--accent); font-weight: 700; text-decoration: none; }
.flag .guide-more:hover { text-decoration: underline; }
.guides-all { margin-top: 18px; }
.guides-all a { color: var(--accent); font-weight: 700; }

/* ===== master upgrade additions ===== */
.scan-meta{color:var(--ink-3);font-size:.85rem;margin:6px 0 0}
.history-item{display:flex;justify-content:space-between;gap:12px;align-items:baseline;text-align:start;width:100%}
.history-meta{color:var(--ink-3);font-size:.82rem;flex:none}
.consent-bar{position:fixed;inset-inline:12px;bottom:12px;z-index:60;background:var(--surface);color:var(--ink);border:1px solid var(--line);border-radius:14px;box-shadow:0 12px 32px rgba(4,24,48,.25);padding:14px 16px;display:flex;gap:14px;align-items:center;max-width:760px;margin:0 auto}
.consent-bar p{margin:0;font-size:.9rem;color:var(--ink-2)}
.consent-bar a{color:var(--accent)}
.consent-btn{flex:none;background:var(--accent);color:#fff;border:0;border-radius:10px;padding:10px 18px;font-weight:700;cursor:pointer;min-height:2.4rem}
@media (max-width:560px){.consent-bar{flex-direction:column;align-items:stretch}.history-item{flex-direction:column;gap:2px}}

/* ===== v5: explicit theme choice (overrides OS default) ===== */
:root[data-theme="dark"] {
  --bg: #060d18; --bg-2: #081426; --surface: #0c1b30; --surface-2: #10233c;
  --ink: #e9f1f9; --ink-2: #a9bed4; --ink-3: #7e97b1; --line: #1e3a56;
  --accent: #4da3f5; --accent-strong: #7fbdf8; --accent-soft: #0f2c4d;
  --good: #3ecf97; --good-soft: #0e2e25; --warn: #f0a832; --warn-soft: #3a2a0e;
  --bad: #f26d6d; --bad-soft: #3d1717; --info: #6db1f2; --info-soft: #12293f;
  --shadow: 0 22px 46px -18px rgba(0, 0, 0, .65);
}
:root[data-theme="light"] {
  --bg: #f2f6fa; --bg-2: #e4ecf4; --surface: #ffffff; --surface-2: #f2f7fa;
  --ink: #0a1e33; --ink-2: #3e5871; --ink-3: #7188a0; --line: #d5e0ea;
  --accent: #0b63c4; --accent-strong: #084e9c; --accent-soft: #e2edfa;
  --good: #0e9f6e; --good-soft: #e0f4ec; --warn: #b45309; --warn-soft: #fbedd8;
  --bad: #c22727; --bad-soft: #fbe3e3; --info: #0b63c4; --info-soft: #e2edfa;
}
/* per-flag example line */
.check .ex { color: var(--ink-3); font-size: .86rem; margin-top: 4px; }
/* header controls: language switcher + theme toggle */
.head-controls { display: flex; gap: 10px; align-items: center; margin-inline-start: auto; }
.lang-switch { display: flex; gap: 4px; }
.lang-switch a { color: var(--ink-2); text-decoration: none; font-weight: 700; font-size: .85rem; padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px; }
.lang-switch a[aria-current="true"] { background: var(--accent); color: #fff; border-color: var(--accent); }
.theme-toggle { background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 999px; width: 2.4rem; height: 2.4rem; font-size: 1.05rem; cursor: pointer; line-height: 1; }
.brandrow { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* ===== v6: scanner deck (multi-tool platform) ===== */
.deck { margin-top: 26px; }
.tool-rail {
  display: grid; grid-template-columns: repeat(9, 1fr); gap: 8px; margin-bottom: 14px;
}
.tool-tab {
  display: flex; flex-direction: column; align-items: flex-start; gap: 7px;
  padding: 12px 12px 11px; border: 1px solid var(--line); border-radius: 14px;
  background: var(--surface); color: var(--ink-2); cursor: pointer; text-align: start;
  font: inherit; transition: border-color .15s, color .15s, background .15s;
  min-height: 5.2rem;
}
.tool-tab .tnum { font-family: "IBM Plex Mono", monospace; font-size: .68rem; letter-spacing: .12em; color: var(--ink-3); }
.tool-tab .tname { font-weight: 800; font-size: .92rem; line-height: 1.15; color: var(--ink); }
.tool-tab .tic { width: 20px; height: 20px; color: var(--ink-3); }
.tool-tab:hover { border-color: var(--accent); }
.tool-tab:hover .tic { color: var(--accent); }
.tool-tab.active { background: var(--accent-soft); border-color: var(--accent); }
.tool-tab.active .tic { color: var(--accent); }
.tool-tab.active .tnum { color: var(--accent); }
@media (max-width: 900px) {
  .tool-rail { grid-template-columns: repeat(3, 1fr); }
  .tool-tab { min-height: 4.4rem; }
}
.tool-panel { animation: lpfade .18s ease-out; }
@keyframes lpfade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.tool-intro { color: var(--ink-2); max-width: 68ch; margin: 0 0 16px; }
.tool-intro b { color: var(--ink); }
.dropzone {
  border: 1.5px dashed var(--line); border-radius: 14px; background: var(--surface-2);
  padding: 20px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start;
}
.dropzone .dz-title { font-weight: 800; color: var(--ink); }
.dropzone .dz-note { color: var(--ink-3); font-size: .9rem; }
.file-input { font: inherit; color: var(--ink-2); max-width: 100%; }
.file-input::file-selector-button {
  font: inherit; font-weight: 700; cursor: pointer; margin-inline-end: 10px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  border-radius: 10px; padding: 9px 14px;
}
.tool-checks { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.tr-banner { border-radius: 14px; padding: 16px 18px; margin-top: 16px; border: 1px solid var(--line); background: var(--surface); }
.tr-banner.bad { background: var(--bad-soft); border-color: var(--bad); }
.tr-banner.warn { background: var(--warn-soft); border-color: var(--warn); }
.tr-banner.good { background: var(--good-soft); border-color: var(--good); }
.tr-banner.info { background: var(--info-soft); border-color: var(--info); }
.tr-verdict { font-family: Sora, Manrope, sans-serif; font-weight: 800; font-size: 1.18rem; margin: 0 0 6px; color: var(--ink); }
.tr-desc { margin: 0; color: var(--ink-2); }
.tr-note { color: var(--ink-2); margin-top: 12px; }
.tr-meta { color: var(--ink-3); font-size: .85rem; margin-top: 12px; font-family: "IBM Plex Mono", monospace; }
.tr-error {
  margin-top: 14px; border: 1px solid var(--bad); background: var(--bad-soft); color: var(--ink);
  border-radius: 12px; padding: 12px 14px; font-weight: 600;
}
.src-box { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); padding: 14px 16px; margin-top: 14px; }
.src-box h3 { margin: 0 0 10px; font-size: .95rem; }
.src-row { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 7px 0; border-top: 1px dashed var(--line); }
.src-row:first-of-type { border-top: 0; }
.src-name { color: var(--ink-2); font-weight: 600; }
.src-tag { font-family: "IBM Plex Mono", monospace; font-size: .78rem; font-weight: 600; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line); }
.src-tag.bad { color: var(--bad); border-color: var(--bad); }
.src-tag.good { color: var(--good); border-color: var(--good); }
.src-tag.warn { color: var(--warn); border-color: var(--warn); }
.src-tag.info { color: var(--info); border-color: var(--info); }
.hash-val { overflow-wrap: anywhere; text-align: end; }
.qr-dest { border: 1px solid var(--warn); background: var(--warn-soft); border-radius: 14px; padding: 14px 16px; margin-top: 14px; }
.qr-dest-label { display: block; font-weight: 800; margin-bottom: 6px; }
.qr-dest-url { overflow-wrap: anywhere; font-size: 1.02rem; }
.qr-raw { white-space: pre-wrap; overflow-wrap: anywhere; font-family: "IBM Plex Mono", monospace; font-size: .88rem; margin: 0; }
#qrVideo { width: 100%; max-width: 480px; border-radius: 14px; border: 1px solid var(--line); margin-top: 12px; background: #000; }
.img-preview img { max-width: 260px; max-height: 200px; border-radius: 12px; border: 1px solid var(--line); margin-top: 14px; }
.tool-h { margin: 20px 0 8px; font-size: 1.02rem; }
.found-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 12px; padding: 9px 12px; margin-top: 8px; background: var(--surface); }
.found-row .mono { overflow-wrap: anywhere; }
.limits-box { border-inline-start: 3px solid var(--warn); background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); border-inline-end: 1px solid var(--line); border-radius: 10px; padding: 13px 16px; margin-top: 16px; color: var(--ink-2); }
.limits-box b { color: var(--ink); }
.hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }
.rep-form { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.rep-form label { font-weight: 700; font-size: .92rem; }
.rep-form input, .rep-form select, .rep-form textarea {
  font: inherit; padding: 11px 13px; border: 1.5px solid var(--line); border-radius: 12px;
  background: var(--surface-2); color: var(--ink); width: 100%;
}
.rep-form textarea { min-height: 4.5rem; resize: vertical; }

/* ===== v7: responsive/mobile repair (Phase 1, CSS-only) =====
   Base fixes below are broken-at-all-widths or overflow-safety fixes;
   phone-specific sizing lives in the max-width media queries so the
   desktop design is visually unchanged. */
/* Worker B (Problem 2): file-scanner hashing progress — brand styling only */
.hash-progress { width: 100%; height: 10px; accent-color: var(--accent); }

body { overflow-x: clip; }
img, video, svg { max-width: 100%; }
/* flex text columns must be allowed to shrink, or long URLs/details force overflow */
.check > div { min-width: 0; }
.check .t, .check .d, .check .ex { overflow-wrap: break-word; }
.verdict { overflow-wrap: break-word; }
.scan-meta { overflow-wrap: break-word; }
.tr-meta { overflow-wrap: anywhere; }
.src-row { flex-wrap: wrap; row-gap: 2px; }
.src-row .mono { min-width: 0; overflow-wrap: anywhere; }
.found-row .mono { min-width: 0; }
.tool-tab { min-width: 0; }
.tool-tab .tname { overflow-wrap: break-word; }
.history-item .mono { min-width: 0; overflow-wrap: anywhere; }

@media (max-width: 640px) {
  /* tap targets ≥44px (was: global min-height 2rem=32px, btn-ghost 38px,
     chip 36px, lang links ~31px, theme toggle 38.4px, consent btn 38.4px) */
  button, [role="button"], select, summary { min-height: 44px; }
  .btn-ghost { min-height: 44px; }
  .chip { min-height: 44px; }
  .lang-switch a { padding: 11px 12px; }
  .theme-toggle { width: 2.75rem; height: 2.75rem; }
  .consent-btn { min-height: 44px; }
  .footer-nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 4px; }
  .file-input::file-selector-button { min-height: 44px; }
  /* iOS Safari focus-zoom: form text must be ≥16px (batch textarea was .92rem) */
  .batch-card textarea, .rep-form input, .rep-form select, .rep-form textarea { font-size: 16px; }
  /* tighter side padding so cards/results are not cramped at 360–430px */
  .wrap { padding: 0 16px 56px; }
  .topband { padding: 34px 16px 0; }
  .checker, .batch-card { padding: 18px 16px; }
  .result-head { padding: 22px 18px 4px; }
  .anatomy { padding: 16px 18px 2px; }
  .checks { padding: 16px 18px 20px; }
  .consent-bar { bottom: max(12px, env(safe-area-inset-bottom)); }
}
@media (max-width: 380px) {
  .tool-rail { gap: 6px; }
  .tool-tab { padding: 10px 9px; }
  .tool-tab .tname { font-size: .86rem; }
}

/* ===== v7: sidebar navigation (CSS built Phase 1; markup lands Phase 2) =====
   Full markup + JS contract: ~/workspace/projects/linkpreve-repair/html-changes-needed.md
   State lives ONLY in DOM classes — no localStorage/sessionStorage keys:
     html.lp-js            set by JS at init; gates the mobile off-canvas state
                           (without JS the sidebar renders as a static block —
                           navigation stays reachable)
     body.lp-has-sidebar   pages that include the sidebar markup
     body.lp-drawer-open   mobile/tablet drawer open; also locks body scroll
     body.lp-sb-collapsed  desktop icon-only sidebar
   The same block exists in legal.css for the legal/guides pages. */
:root { --lp-sb-w: 264px; --lp-sb-w-collapsed: 76px; }
.lp-topbar {
  position: sticky; top: 0; z-index: 60;
  display: flex; align-items: center; gap: 10px;
  min-height: 56px; padding: 8px 16px;
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.lp-menu-btn {
  flex: none; width: 44px; height: 44px; min-height: 44px;
  display: grid; place-items: center;
  background: transparent; color: var(--ink);
  border: 1px solid var(--line); border-radius: 10px; cursor: pointer;
}
.lp-menu-btn svg { width: 22px; height: 22px; }
.lp-topbar-brand { font-weight: 800; font-size: 1.1rem; color: var(--ink); text-decoration: none; white-space: nowrap; }
.lp-topbar .head-controls { margin-inline-start: auto; }
.lp-sidebar {
  background: var(--surface); color: var(--ink);
  border-inline-end: 1px solid var(--line);
  padding: 14px 12px 20px; overflow-y: auto; overscroll-behavior: contain;
}
.lp-sidebar-head { display: flex; align-items: center; gap: 10px; padding: 2px 6px 14px; }
.lp-sidebar-brand { font-weight: 800; font-size: 1.15rem; color: var(--ink); text-decoration: none; }
.lp-sidebar-close {
  margin-inline-start: auto; flex: none; width: 44px; height: 44px; min-height: 44px;
  display: none; place-items: center;
  background: transparent; color: var(--ink);
  border: 1px solid var(--line); border-radius: 10px; cursor: pointer;
}
.lp-sidebar-close svg { width: 20px; height: 20px; }
.lp-nav { display: flex; flex-direction: column; gap: 2px; }
.lp-nav-group { margin-top: 18px; }
.lp-nav-group:first-child { margin-top: 0; }
.lp-nav-title {
  margin: 0 9px 6px; font-size: .72rem; font-weight: 800;
  letter-spacing: .09em; text-transform: uppercase; color: var(--ink-3);
}
.lp-nav-item {
  display: flex; align-items: center; gap: 12px;
  min-height: 48px; padding: 10px 12px; border-radius: 10px;
  border-inline-start: 3px solid transparent;
  color: var(--ink-2); text-decoration: none; font-weight: 700; font-size: .95rem;
}
.lp-nav-item svg { flex: none; width: 20px; height: 20px; color: var(--ink-3); }
.lp-nav-item:hover { background: var(--surface-2); color: var(--ink); }
.lp-nav-item[aria-current="page"], .lp-nav-item.active {
  background: var(--accent-soft); color: var(--accent); border-inline-start-color: var(--accent);
}
.lp-nav-item[aria-current="page"] svg, .lp-nav-item.active svg { color: var(--accent); }
.lp-nav-label { min-width: 0; overflow-wrap: break-word; }
.lp-backdrop {
  position: fixed; inset: 0; z-index: 85; background: rgba(4, 20, 40, .55);
  opacity: 0; pointer-events: none; transition: opacity .2s ease;
}
/* Desktop ≥1024px: persistent sidebar; page content shifts by its width */
@media (min-width: 1024px) {
  body.lp-has-sidebar .lp-sidebar {
    position: fixed; inset-inline-start: 0; top: 0; bottom: 0; z-index: 80;
    width: var(--lp-sb-w); height: 100dvh;
  }
  body.lp-has-sidebar .lp-topbar,
  body.lp-has-sidebar .topband-in,
  body.lp-has-sidebar .wrap { margin-inline-start: var(--lp-sb-w); }
  body.lp-has-sidebar .lp-topbar-brand { display: none; } /* brand lives in the sidebar */
  body.lp-sb-collapsed .lp-sidebar { width: var(--lp-sb-w-collapsed); }
  body.lp-sb-collapsed .lp-topbar,
  body.lp-sb-collapsed .topband-in,
  body.lp-sb-collapsed .wrap { margin-inline-start: var(--lp-sb-w-collapsed); }
  body.lp-sb-collapsed .lp-nav-label,
  body.lp-sb-collapsed .lp-nav-title,
  body.lp-sb-collapsed .lp-sidebar-brand { display: none; }
  body.lp-sb-collapsed .lp-nav-item { justify-content: center; padding-inline: 6px; }
  body.lp-sb-collapsed .lp-sidebar-head { justify-content: center; }
  .lp-backdrop { display: none; }
}
/* <1024px: off-canvas drawer (only when JS is active — see html.lp-js) */
@media (max-width: 1023.98px) {
  html.lp-js .lp-sidebar {
    position: fixed; inset-inline-start: 0; top: 0; bottom: 0; z-index: 90;
    width: min(84vw, 300px); height: 100dvh;
    transform: translateX(-105%); visibility: hidden;
    transition: transform .24s ease, visibility 0s linear .24s;
    box-shadow: var(--shadow);
  }
  html[dir="rtl"].lp-js .lp-sidebar { transform: translateX(105%); }
  html.lp-js body.lp-drawer-open .lp-sidebar {
    transform: none; visibility: visible; transition: transform .24s ease;
  }
  html.lp-js .lp-sidebar-close { display: grid; }
  body.lp-drawer-open { overflow: hidden; }
  body.lp-drawer-open .lp-backdrop { opacity: 1; pointer-events: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .lp-sidebar, .lp-backdrop { transition: none !important; }
}

/* Mobile-fit (2026-12-03): at <=480px the topbar row (menu button + brand +
   language pills + theme toggle) exceeded the bar's content box by ~9px and
   pushed the theme toggle past the right edge (scrollWidth 369 @360px).
   Trim horizontal padding/gaps and pill inline padding; tap-target heights
   (>=44px) are unchanged. */
@media (max-width: 480px) {
  .lp-topbar { padding-inline: 10px; gap: 8px; }
  .lp-topbar .head-controls { gap: 8px; }
  .lp-topbar .lang-switch a { padding-left: 8px; padding-right: 8px; }
}
