/* Always dark, coloured after the fotocheck.nl logo (teal + navy). */
:root {
  color-scheme: dark;
  --bg: #05070b;
  --card: #0c1017;
  --text: #e8edf3;
  --muted: #93a0b2;
  --line: #1b2330;
  --accent: #22c3d6;
  --accent-2: #1f5fa8;
  --accent-text: #03141a;
  --accent-soft: #0b2a32;
  --error: #ff7b80;
  --error-soft: #3a1d20;
  --note-soft: #2e2a18;
  --warn: #f0c560;
  --ok: #5fd38a;
  --ok-soft: #12291b;
  --radius: 14px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background:
    radial-gradient(1100px 520px at 50% -140px, rgba(34, 195, 214, .13), transparent 70%),
    radial-gradient(800px 600px at 100% 100%, rgba(31, 95, 168, .08), transparent 70%),
    var(--bg);
  background-attachment: fixed;
  min-height: 100vh;
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }

.wrap { max-width: 760px; margin: 0 auto; padding: 28px 16px 32px; }
.head { margin-bottom: 24px; }
h1 { font-size: 30px; line-height: 1.2; margin: 0 0 6px; letter-spacing: -0.01em; }
.sub { color: var(--muted); margin: 0; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
}

/* Upload */
.drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; text-align: center;
  min-height: 220px; padding: 24px;
  border: 2px dashed var(--line); border-radius: 10px;
  cursor: pointer; transition: border-color .15s, background .15s;
}
.drop:hover, .drop:focus-within, .drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop-icon { width: 40px; height: 40px; fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; margin-bottom: 6px; }
.drop-title { font-weight: 600; font-size: 18px; }
.drop-hint { color: var(--muted); font-size: 14px; }

.options { display: flex; align-items: center; gap: 12px; margin-top: 16px; }
.opt-label { color: var(--muted); font-size: 14px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; padding: 4px 16px; border-radius: 999px; cursor: pointer; font-weight: 600; font-size: 14px; color: var(--muted); }
.seg input:checked + span { background: var(--accent); color: var(--accent-text); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.error { margin: 14px 0 0; padding: 10px 12px; border-radius: 8px; background: var(--error-soft); color: var(--error); font-size: 14px; }
.note { margin: 8px 0 0; padding: 10px 12px; border-radius: 8px; background: var(--note-soft); font-size: 14px; }

/* Working */
.work { display: flex; gap: 16px; align-items: center; }
.work-thumb { width: 88px; height: 88px; object-fit: cover; border-radius: 10px; background: var(--line); flex: none; }
.work-body { flex: 1; min-width: 0; }
.work-status { margin: 0 0 10px; font-weight: 600; }
.work-hint { margin: 10px 0 0; color: var(--muted); font-size: 14px; }
.bar { height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; width: 0; background: var(--accent); border-radius: 999px; transition: width .4s ease; }
.bar-fill.indeterminate { width: 30%; animation: slide 1.2s ease-in-out infinite; }
@keyframes slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(340%); } }

/* Compare */
.compare { position: relative; border-radius: 10px; overflow: hidden; background: var(--line); user-select: none; touch-action: pan-y; }
.compare img { display: block; width: 100%; height: auto; }
.before-clip { position: absolute; inset: 0; width: 50%; overflow: hidden; }
.before-clip img { width: auto; height: 100%; max-width: none; image-rendering: auto; }
.handle { position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; background: #fff; transform: translateX(-1px); pointer-events: none; box-shadow: 0 0 6px rgba(0,0,0,.4); }
.handle span { position: absolute; top: 50%; left: 50%; width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 50%; background: #fff; box-shadow: 0 1px 6px rgba(0,0,0,.35); }
.handle span::before { content: "‹ ›"; position: absolute; inset: 0; display: grid; place-items: center; color: #333; font-weight: 700; font-size: 14px; letter-spacing: 2px; }
.slider { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: ew-resize; margin: 0; }
.tag { position: absolute; top: 10px; padding: 2px 8px; border-radius: 6px; background: rgba(0,0,0,.55); color: #fff; font-size: 12px; font-weight: 600; pointer-events: none; }
.tag-l { left: 10px; }
.tag-r { right: 10px; }

.done-info { margin: 14px 0 0; color: var(--muted); font-size: 14px; }
.actions { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 20px; border-radius: 10px; border: 1px solid var(--line);
  background: transparent; color: var(--text); font: inherit; font-weight: 600;
  text-decoration: none; cursor: pointer;
}
.btn:hover { border-color: var(--muted); }
.btn.primary {
  background: linear-gradient(180deg, #33d3e4 0%, #1fb3c8 50%, #1a8fb0 100%);
  border-color: rgba(255,255,255,.12); color: var(--accent-text);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 4px 14px rgba(34,195,214,.18);
}
.btn.primary:hover { filter: brightness(1.08); }

/* Logo + glossy menu */
.site-head { display: flex; flex-direction: column; align-items: center; gap: 18px; margin-bottom: 32px; }
.logo {
  display: block;
  font: 900 52px/1 "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  letter-spacing: .08em; margin-right: -.08em; /* letter-spacing adds space after the last letter too */
  text-decoration: none;
  color: #fff;
  background: linear-gradient(180deg, #ffffff 0%, #c9f6fc 45%, #22c3d6 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 14px rgba(34, 195, 214, .25));
}
.nav {
  position: relative;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 4px;
  padding: 6px; border-radius: 999px;
  background: linear-gradient(180deg, rgba(255,255,255,.09), rgba(255,255,255,.02) 55%, rgba(255,255,255,.04));
  border: 1px solid rgba(255,255,255,.10);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.14),
    inset 0 -1px 0 rgba(0,0,0,.4),
    0 10px 30px rgba(0,0,0,.45),
    0 0 0 1px rgba(34,195,214,.06);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
}
.nav a {
  position: relative; overflow: hidden;
  padding: 8px 16px; border-radius: 999px;
  color: var(--muted); text-decoration: none; font-weight: 600; font-size: 14px; white-space: nowrap;
  transition: color .15s, background .15s;
}
.nav a:hover { color: var(--text); background: rgba(255,255,255,.06); }
.nav a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.nav a[aria-current="page"] {
  color: #fff;
  background: linear-gradient(180deg, #2fd0e2 0%, #1a9fb8 45%, #1f5fa8 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.45), inset 0 -2px 6px rgba(0,0,0,.25), 0 0 16px rgba(34,195,214,.35);
  text-shadow: 0 1px 1px rgba(0,0,0,.35);
}
/* the gloss: a soft white sheen over the top half of the active item */
.nav a[aria-current="page"]::before {
  content: ""; position: absolute; left: 6%; right: 6%; top: 1px; height: 50%;
  border-radius: 999px 999px 40% 40%;
  background: linear-gradient(180deg, rgba(255,255,255,.42), rgba(255,255,255,.05));
  pointer-events: none;
}

/* Reverse search */
.drop-icon circle { fill: none; }
.search-head { display: flex; gap: 16px; align-items: center; margin-bottom: 16px; }
.search-head .work-status { margin-bottom: 8px; }
.engines { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.engine { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.engine-text { display: flex; flex-direction: column; min-width: 0; }
.engine-name { font-weight: 600; }
.engine-desc { color: var(--muted); font-size: 14px; }
.engine-action { flex: none; }
.engine-fail { color: var(--error); font-size: 14px; font-weight: 600; cursor: help; }
.btn.small { padding: 6px 14px; font-size: 14px; border-radius: 8px; }
.spinner { display: inline-block; width: 20px; height: 20px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Reverse search results */
.res-block { margin-bottom: 24px; }
.res-title { font-size: 16px; margin: 0 0 10px; }
.res-count { color: var(--muted); font-weight: 400; font-size: 14px; }
.engines-title { margin-top: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 4px 12px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); text-decoration: none; font-size: 14px; font-weight: 600; }
.chip:hover { filter: brightness(1.05); text-decoration: underline; }
.sites { list-style: none; margin: 0 0 10px; padding: 0; border-top: 1px solid var(--line); }
.site { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.site-thumb { flex: none; width: 72px; height: 72px; border-radius: 8px; overflow: hidden; background: var(--line); }
.site-thumb img, .sim img { display: block; width: 100%; height: 100%; object-fit: cover; }
img.broken { visibility: hidden; }
.site-body { min-width: 0; flex: 1; }
.site-title { font-weight: 600; color: var(--text); text-decoration: none; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.site-title:hover { color: var(--accent); text-decoration: underline; }
.site-desc { margin: 2px 0 0; color: var(--muted); font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.site-meta { margin: 4px 0 0; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.src { margin-left: 8px; padding: 1px 6px; border-radius: 4px; border: 1px solid var(--line); font-size: 11px; font-weight: 600; }
.similar { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 6px; }
.sim { display: block; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: var(--line); }
.sim:hover img { opacity: .85; }

/* Echt of nep? */
.verdict { padding: 14px 16px; border-radius: 10px; margin-bottom: 20px; background: var(--bg); border: 1px solid var(--line); }
.verdict.ai { background: var(--error-soft); border-color: transparent; }
.verdict.edit { background: var(--note-soft); border-color: transparent; }
.verdict-title { margin: 0; font-weight: 700; font-size: 18px; }
.verdict.ai .verdict-title { color: var(--error); }
.verdict.edit .verdict-title { color: var(--warn); }
.verdict-text { margin: 4px 0 0; font-size: 14px; color: var(--muted); }
.signals { list-style: none; margin: 0 0 24px; padding: 0; border-top: 1px solid var(--line); }
.signal { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.signal-tag { flex: none; width: 76px; text-align: center; padding: 2px 0; border-radius: 6px; font-size: 12px; font-weight: 700; background: var(--bg); color: var(--muted); }
.signal.ai .signal-tag { background: var(--error-soft); color: var(--error); }
.signal.edit .signal-tag { background: var(--note-soft); color: var(--warn); }
.signal-title { margin: 0; font-weight: 600; }
.signal-detail { margin: 2px 0 0; color: var(--muted); overflow-wrap: anywhere; }
.ela-switch { margin-bottom: 10px; }
.ela-view { border-radius: 10px; overflow: hidden; background: var(--line); margin-bottom: 6px; }
.ela-view img { display: block; width: 100%; height: auto; }

/* Achtergrond weg */
.stage { border-radius: 10px; overflow: hidden; display: flex; justify-content: center; }
.stage img { display: block; max-width: 100%; max-height: 70vh; height: auto; }
.checker {
  background-color: #fff;
  background-image: conic-gradient(#d9dce1 25%, transparent 0 50%, #d9dce1 0 75%, transparent 0);
  background-size: 20px 20px;
}
.options input[type="color"] { width: 40px; height: 30px; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: none; cursor: pointer; }
.options { flex-wrap: wrap; }

/* Vervagen */
.found { margin: 0 0 14px; font-weight: 600; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; }
.brush-size { display: inline-flex; align-items: center; gap: 8px; }
.brush-size input { width: 120px; accent-color: var(--accent); }
.tool-hint { margin: 8px 0 12px; }
.canvas-wrap { border-radius: 10px; overflow: hidden; background: var(--line); line-height: 0; }
#view { display: block; width: 100%; height: auto; touch-action: none; }

/* Metadata */
.meta-file { min-width: 0; }
.meta-name { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.meta-info { margin: 2px 0 8px; color: var(--muted); font-size: 14px; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; }
.badge.warn { background: var(--note-soft); color: var(--warn); }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.gps { margin: 0 0 16px; padding: 14px 16px; border-radius: 10px; background: var(--error-soft); }
.gps-title { margin: 0; font-weight: 600; color: var(--error); }
.gps-coords { margin: 4px 0 10px; font-variant-numeric: tabular-nums; }
.gps-links { display: flex; gap: 8px; flex-wrap: wrap; }
.gps-links .btn { background: var(--card); }
.warnings { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 8px; }
.warnings:empty { display: none; }
.warnings li { padding: 10px 12px; border-radius: 8px; background: var(--note-soft); font-size: 14px; }
.summary { display: grid; grid-template-columns: max-content 1fr; gap: 0 16px; margin: 0 0 12px; border-top: 1px solid var(--line); }
.summary dt, .summary dd { margin: 0; padding: 9px 0; border-bottom: 1px solid var(--line); }
.summary dt { color: var(--muted); font-size: 14px; display: flex; align-items: center; gap: 6px; }
.summary dd { overflow-wrap: anywhere; }
.risk { width: 8px; height: 8px; border-radius: 50%; background: var(--error); flex: none; }
.group { border-bottom: 1px solid var(--line); }
.group summary { padding: 10px 0; cursor: pointer; font-weight: 600; font-size: 14px; }
.group table { width: 100%; border-collapse: collapse; font-size: 13px; margin-bottom: 10px; table-layout: fixed; }
.group td { padding: 5px 0; border-top: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
.group td:first-child { width: 40%; padding-right: 12px; color: var(--muted); }
.clean { margin-top: 16px; padding: 14px 16px; border-radius: 10px; background: var(--ok-soft); }
.clean-title { margin: 0; font-weight: 600; color: var(--ok); }
.clean-info { margin: 4px 0 0; font-size: 14px; }
.clean .actions { margin-top: 12px; }
.btn:disabled { opacity: .6; cursor: wait; }

/* Share */
.check { display: flex; gap: 10px; align-items: flex-start; margin-top: 14px; font-size: 14px; cursor: pointer; }
.check input { margin-top: 3px; accent-color: var(--accent); width: 16px; height: 16px; flex: none; }
.check-hint { color: var(--muted); }
.link-label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.link-box { display: flex; gap: 8px; }
.link-box input {
  flex: 1; min-width: 0; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--bg); color: var(--text); font: inherit; font-size: 15px;
}
.link-box input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.owner { margin-top: 16px; border-top: 1px solid var(--line); }
.owner .link-box { margin-bottom: 12px; }
.owner .work-hint { margin: 0 0 10px; }
.shared-link { display: block; }
.shared { display: block; max-width: 100%; height: auto; max-height: 75vh; margin: 0 auto; border-radius: 10px; background: var(--line); object-fit: contain; }
.owner-box { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.owner-box .work-hint { margin: 0 0 10px; }
.btn.danger { color: var(--error); border-color: var(--error); }
.btn.danger:hover { background: var(--error-soft); }
.gone h1 { font-size: 24px; }
.gone .sub { margin-bottom: 4px; }
.foot a { color: var(--muted); }

.foot { margin-top: 20px; text-align: center; color: var(--muted); font-size: 13px; }

@media (max-width: 520px) {
  .wrap { padding-top: 18px; }
  .logo { font-size: 36px; }
  .nav { border-radius: 18px; }
  .nav a { padding: 7px 12px; font-size: 13px; }
  h1 { font-size: 24px; }
  .drop { min-height: 180px; }
  .work-thumb { width: 64px; height: 64px; }
  .summary { grid-template-columns: 1fr; }
  .summary dt { padding-bottom: 0; border-bottom: 0; }
  .summary dd { padding-top: 2px; }
}

/* Doneren (alleen zichtbaar als UPSCALE_DONATE_URL is ingesteld) */
.nav a.nav-donate { color: #ff8fa8; }
.nav a.nav-donate:hover { color: #ffb3c4; background: rgba(255,107,138,.10); }
.donate {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  margin-top: 20px; padding: 16px 18px; border-radius: var(--radius);
  background: var(--card); border: 1px solid var(--line);
}
.donate-text { flex: 1 1 260px; margin: 0; font-size: 14px; color: var(--muted); }
.donate-text strong { color: var(--text); }
.btn.donate-btn { flex: none; color: #ff8fa8; border-color: rgba(255,143,168,.45); }
.btn.donate-btn:hover { background: rgba(255,107,138,.10); border-color: #ff8fa8; }
@media (max-width: 520px) { .btn.donate-btn { width: 100%; } }
