/* ImageDETECTIVE: one centred column, quiet dark surfaces, colour only where it carries meaning. */
:root {
  --bg: #0c0c0e; --panel: #121214; --raised: #19191c; --border: #29292e;
  --text: #eeeef0; --muted: #909098; --secondary: #bebec5;
  --button-bg: #eeeef0; --button-text: #0c0c0e; --button-hover: #d7d7dc;
  --red: #f87171; --amber: #fbbf24; --orange: #fb923c; --green: #4ade80; --slate: #b4b4bc;
  --swatch-ai: #ef4444; --swatch-real: #86efac; --swatch-weak: #1e3a8a;
  --side-closed: 68px; --side-open: 230px;
  --font: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f8f8f7; --panel: #ffffff; --raised: #edeeec; --border: #dddeda;
  --text: #20221f; --muted: #747770; --secondary: #555a52;
  --button-bg: #20221f; --button-text: #ffffff; --button-hover: #3a3d38;
  --red: #dc2626; --amber: #b45309; --orange: #c2410c; --green: #15803d; --slate: #555a52;
  color-scheme: light;
}
/* the logo: white figure on a transparent background; swapped (black figure) in light mode. Logo images only. */
:root[data-theme="light"] .logo-img { filter: invert(1); }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 16px; line-height: 1.6;
  overflow-x: hidden; }
a { color: inherit; }
button { font: inherit; color: inherit; }
img { max-width: 100%; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; border-radius: 6px; }
.skip-link { position: absolute; left: -9999px; top: 8px; z-index: 50; background: var(--panel); padding: 8px 12px;
  border: 1px solid var(--border); border-radius: 8px; }
.skip-link:focus { left: 80px; }
[hidden] { display: none !important; }

/* ---- sidebar: always partly visible; opening overlays the page ---- */
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--side-closed); z-index: 30; background: var(--panel);
  border-right: 1px solid var(--border); display: flex; flex-direction: column; padding: 14px 10px; overflow: hidden;
  transition: width 200ms ease; }
.sidebar.open { width: var(--side-open); box-shadow: 8px 0 24px rgba(0, 0, 0, 0.18); }
.side-toggle { display: flex; align-items: center; gap: 12px; width: 100%; height: 52px; padding: 0 5px; border: 0;
  background: none; border-radius: 9px; cursor: pointer; text-align: left; }
.side-toggle:hover { background: var(--raised); }
.side-logo { flex: none; width: 36px; height: 40px; display: grid; place-items: center; }
.side-logo img { width: 36px; height: 40px; object-fit: contain; }
.side-brand { font-weight: 600; font-size: 16px; letter-spacing: -0.01em; }
.side-nav { margin-top: 18px; display: flex; flex-direction: column; gap: 4px; }
.side-bottom { margin-top: auto; display: flex; flex-direction: column; gap: 4px; }
.side-item { display: flex; align-items: center; gap: 14px; height: 44px; padding: 0 12px; border-radius: 9px; border: 0;
  background: none; color: var(--secondary); text-decoration: none; cursor: pointer; white-space: nowrap; width: 100%;
  text-align: left; font-size: 15px; }
.side-item:hover { background: var(--raised); color: var(--text); }
.side-item[aria-current="page"] { background: var(--raised); color: var(--text); }
.side-item svg { flex: none; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round; }
.side-item svg.filled { fill: currentColor; stroke: none; }
.side-label { opacity: 0; transition: opacity 120ms ease; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar.open .side-label { opacity: 1; }
.icon-moon { display: none; }
:root[data-theme="light"] .icon-sun { display: none; }
:root[data-theme="light"] .icon-moon { display: block; }
.scrim { position: fixed; inset: 0; z-index: 20; background: transparent; }

/* ---- header and main column ---- */
.shell { margin-left: var(--side-closed); min-height: 100vh; display: flex; flex-direction: column; }
.topbar { height: 86px; padding: 0 48px; display: flex; align-items: center; border-bottom: 1px solid var(--border); }
.brand { display: inline-flex; align-items: center; gap: 13px; text-decoration: none; color: var(--text); }
.brand-logo { width: 42px; height: 46px; display: grid; place-items: center; flex: none; }
.brand-logo img { width: 42px; height: 46px; object-fit: contain; }
.wordmark { font-size: 28px; font-weight: 600; letter-spacing: -0.02em; line-height: 1; }
.main { width: 100%; max-width: 820px; margin: 0 auto; padding: 56px 32px 24px; flex: 1; outline: none; }
@media (min-width: 1600px) { .main { padding-top: 66px; } }

h1, h2, p { margin: 0; }
.tagline { font-size: 29px; font-weight: 500; letter-spacing: -0.015em; line-height: 1.3; }
.intro { margin-top: 14px; font-size: 17px; line-height: 1.8; color: var(--secondary); }
.block { margin-top: 48px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
h2 { font-size: 23px; font-weight: 500; letter-spacing: -0.01em; line-height: 1.35; }
.secondary, .caption { color: var(--muted); font-size: 15px; }
.lead { margin-top: 6px; color: var(--secondary); font-size: 15px; }

/* ---- steps ---- */
.steps { margin-top: 18px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.step { border-top: 1px solid var(--border); padding-top: 12px; }
.step-toggle { display: flex; align-items: center; gap: 10px; width: 100%; padding: 4px 0; border: 0; background: none;
  cursor: pointer; text-align: left; font-size: 15px; }
.step-num { color: var(--muted); font-variant-numeric: tabular-nums; }
.step-title { flex: 1; font-weight: 500; }
.plus { width: 16px; height: 16px; flex: none; fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linecap: round;
  transition: transform 200ms ease; }
.step-toggle[aria-expanded="true"] .plus { transform: rotate(45deg); }
.step-body { margin-top: 8px; font-size: 15px; color: var(--secondary); line-height: 1.6; }

/* ---- upload ---- */
.drop { margin-top: 16px; height: 244px; background: var(--panel); border: 1px dashed var(--border); border-radius: 12px;
  display: grid; place-items: center; cursor: pointer; position: relative; overflow: hidden; }
.drop:hover, .drop.dragging { background: var(--raised); border-color: var(--muted); }
.drop-empty { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 0 20px; text-align: center; }
.drop-empty svg { width: 30px; height: 30px; fill: none; stroke: var(--secondary); stroke-width: 1.6; stroke-linecap: round;
  stroke-linejoin: round; margin-bottom: 8px; }
.drop-title { font-size: 18px; font-weight: 500; }
.drop-sub { color: var(--secondary); font-size: 15px; }
.drop-help { color: var(--muted); font-size: 13px; margin-top: 6px; }
.preview { width: 100%; height: 100%; object-fit: contain; display: block; padding: 10px; }
.file-row { margin-top: 8px; display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 14px;
  color: var(--secondary); }
.file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.link-button { border: 0; background: none; padding: 2px 0; color: var(--text); text-decoration: underline;
  text-underline-offset: 3px; cursor: pointer; font-size: 14px; flex: none; }
.error { margin-top: 10px; font-size: 14px; color: var(--red); }
.primary { margin-top: 12px; width: 100%; height: 58px; border: 0; border-radius: 9px; background: var(--button-bg);
  color: var(--button-text); font-size: 16px; font-weight: 600; display: flex; align-items: center; justify-content: center;
  gap: 10px; cursor: pointer; }
.primary:hover:not(:disabled) { background: var(--button-hover); }
.primary:disabled { opacity: 0.45; cursor: not-allowed; }
.primary[aria-busy="true"] { opacity: 0.8; cursor: progress; }
.primary svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round;
  stroke-linejoin: round; }
.privacy { margin-top: 12px; font-size: 14px; color: var(--muted); line-height: 1.6; }
.divider { margin: 56px 0 0; border: 0; border-top: 1px solid var(--border); }

/* ---- report ---- */
.report { margin-top: 48px; }
.empty { margin-top: 20px; padding: 26px 22px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel); }
.empty-title { font-size: 16px; font-weight: 500; }
.empty-sub { margin-top: 2px; font-size: 15px; color: var(--muted); }
.verdict { margin-top: 20px; padding: 22px; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; }
.verdict-title { font-size: 21px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.3; }
.verdict-reason { margin-top: 8px; font-size: 15px; color: var(--secondary); line-height: 1.6; }
.verdict-context { margin-top: 8px; font-size: 14px; color: var(--muted); }
.meter { margin-top: 16px; height: 6px; border-radius: 3px; background: var(--raised); overflow: hidden; }
.meter > div { height: 100%; border-radius: 3px; background: var(--tone, var(--slate)); }
.meter-label { margin-top: 6px; font-size: 13px; color: var(--muted); }
.tone-red { --tone: var(--red); } .tone-amber { --tone: var(--amber); } .tone-orange { --tone: var(--orange); }
.tone-green { --tone: var(--green); } .tone-slate { --tone: var(--slate); }
.verdict .verdict-title { color: var(--tone, var(--text)); }
.tabs { margin-top: 24px; display: flex; gap: 6px; border-bottom: 1px solid var(--border); }
.tab { border: 0; background: none; padding: 9px 12px; font-size: 15px; color: var(--muted); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { color: var(--text); border-bottom-color: var(--text); }
.viewer { margin-top: 14px; height: 320px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel);
  overflow: hidden; display: grid; place-items: center; }
.viewer img { width: 100%; height: 100%; object-fit: contain; display: block; }
.legend { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 13px; color: var(--secondary); }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.swatch { width: 11px; height: 11px; border-radius: 2px; display: inline-block; }
.swatch-ai { background: var(--swatch-ai); } .swatch-real { background: var(--swatch-real); }
.swatch-weak { background: var(--swatch-weak); }
.note { margin-top: 10px; font-size: 14px; color: var(--muted); line-height: 1.6; }
.details { margin-top: 22px; border-top: 1px solid var(--border); padding-top: 12px; }
.details summary { cursor: pointer; font-size: 15px; font-weight: 500; padding: 4px 0; }
.details-list { margin: 12px 0 0; display: grid; grid-template-columns: minmax(150px, 220px) 1fr; gap: 0; font-size: 14px; }
.details-list dt, .details-list dd { margin: 0; padding: 10px 0; border-bottom: 1px solid var(--border); }
.details-list dt { color: var(--secondary); padding-right: 14px; }
.details-list dd { color: var(--text); line-height: 1.55; }
.state { display: inline-block; font-size: 12px; padding: 0 7px; border-radius: 4px; border: 1px solid var(--border);
  color: var(--muted); margin-right: 8px; white-space: nowrap; }
.state-ran { color: var(--text); }
.state-failed { color: var(--red); border-color: var(--red); }

/* ---- try to fool it ---- */
.field-label { display: block; margin-top: 32px; font-size: 15px; font-weight: 500; }
.field { margin-top: 8px; width: 100%; padding: 12px 14px; border: 1px solid var(--border); border-radius: 9px;
  background: var(--panel); color: var(--text); font: inherit; font-size: 16px; resize: vertical; }
.field:focus-visible { outline: 2px solid var(--text); outline-offset: 1px; }
.field-help { margin-top: 8px; font-size: 14px; color: var(--muted); }
.secondary-button { margin-top: 14px; width: 100%; height: 48px; border: 1px solid var(--border); border-radius: 9px;
  background: var(--panel); font-size: 15px; font-weight: 500; cursor: pointer; }
.secondary-button:hover:not(:disabled) { background: var(--raised); }
.secondary-button:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---- about ---- */
.about h2 { margin-top: 40px; }
.about p, .about li { font-size: 16px; line-height: 1.75; color: var(--secondary); }
.about p { margin-top: 10px; }
.about ul { margin: 10px 0 0; padding-left: 20px; }
.about li + li { margin-top: 4px; }
.about b { color: var(--text); font-weight: 500; }
.callout { margin-top: 20px !important; padding: 16px 18px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--panel); color: var(--text) !important; }
.table-wrap { margin-top: 16px; overflow-x: auto; }
.components { width: 100%; border-collapse: collapse; font-size: 14px; }
.components th, .components td { text-align: left; vertical-align: top; padding: 10px 12px 10px 0;
  border-bottom: 1px solid var(--border); line-height: 1.55; }
.components th { color: var(--muted); font-weight: 500; font-size: 13px; }
.components td:first-child { color: var(--text); min-width: 150px; }
.components td { color: var(--secondary); }

/* ---- footer ---- */
.footer { margin-top: 64px; padding-top: 16px; border-top: 1px solid var(--border); display: flex; flex-wrap: wrap;
  justify-content: space-between; gap: 8px 20px; font-size: 13px; color: var(--muted); }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.footer a { color: var(--secondary); text-decoration: none; }
.footer a:hover { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }

/* ---- phones ---- */
@media (max-width: 650px) {
  :root { --side-closed: 60px; --side-open: 220px; }
  .sidebar { padding: 12px 8px; }
  .side-item { padding: 0 11px; }
  .topbar { height: 70px; padding: 0 20px; }
  .wordmark { font-size: 22px; }
  .brand { gap: 10px; }
  .brand-logo, .brand-logo img { width: 30px; height: 36px; }
  .main { padding: 34px 20px 24px; }
  .tagline { font-size: 25px; }
  .intro { font-size: 16px; }
  .steps { grid-template-columns: 1fr; gap: 0; }
  .step { padding: 10px 0; }
  .caption { display: none; }
  .drop { height: 220px; }
  .viewer { height: 260px; }
  .details-list { grid-template-columns: 1fr; }
  .details-list dt { border-bottom: 0; padding-bottom: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
