:root {
  --bg: #f5f6f8;
  --card: #ffffff;
  --ink: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --accent: #111827;
  --accent-2: #f59e0b;
  --good: #047857;
  --good-bg: #ecfdf5;
  --bad: #b91c1c;
  --bad-bg: #fef2f2;
  --warn: #92400e;
  --warn-bg: #fffbeb;
  --info-bg: #eff6ff;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(17, 24, 39, .06), 0 4px 14px rgba(17, 24, 39, .05);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { background: var(--bg); color: var(--ink); line-height: 1.5; font-size: 16px; }
a { color: #1d4ed8; }
a:hover { color: #1e3a8a; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .88em; background: #f3f4f6; padding: .1em .35em; border-radius: 5px; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .6rem; }
h1 { font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.2rem); letter-spacing: -.01em; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1rem; }
.h-small { font-size: .95rem; margin-top: 1rem; }

.topbar { display: flex; align-items: center; justify-content: space-between; padding: .8rem 1.25rem; background: var(--accent); color: #fff; }
.topbar a { color: #fff; text-decoration: none; }
.topbar nav { display: flex; gap: 1rem; align-items: center; }
.topbar .link { color: #d1d5db; text-decoration: none; }
.topbar .link:hover, .topbar nav a:hover { color: #fff; text-decoration: underline; }
.brand { display: inline-flex; gap: .55rem; align-items: center; font-weight: 700; letter-spacing: -.01em; }
.brand.big { font-size: 1.4rem; margin-bottom: .4rem; }
.logo { display: inline-grid; place-items: center; width: 1.8em; height: 1.8em; border-radius: 8px; background: var(--accent-2); color: var(--accent); font-weight: 800; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 1.5rem 1.25rem 3rem; }
.footer { text-align: center; color: var(--muted); font-size: .85rem; padding: 0 1rem 2rem; }
.footer a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.footer a:hover { color: var(--ink, #111); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.25rem 1.4rem; margin: 0 0 1.25rem; }
.card.narrow { max-width: 640px; margin-inline: auto; }
.card.subtle { background: #fafafa; box-shadow: none; }
details.card > summary { cursor: pointer; font-weight: 600; }
details.card[open] > summary { margin-bottom: .9rem; }

.hero { margin: .5rem 0 1.25rem; }
.lead { color: #374151; max-width: 760px; font-size: 1.05rem; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.inline { display: inline; }

.stack > * + * { margin-top: .9rem; }
.grid { display: grid; gap: 1.25rem; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: .9rem; }

.field { display: flex; flex-direction: column; gap: .35rem; border: 0; padding: 0; margin: 0; min-width: 0; }
label, legend { font-weight: 600; font-size: .95rem; }
.hint { margin: 0; color: var(--muted); font-size: .85rem; }
input[type=url], input[type=text], input[type=password], input[type=number], input:not([type]), textarea, select {
  width: 100%; font: inherit; padding: .65rem .75rem; border: 1px solid #d1d5db; border-radius: 10px; background: #fff; color: var(--ink);
}
input:focus, textarea:focus, select:focus { outline: 3px solid rgba(245, 158, 11, .35); border-color: var(--accent-2); }
input[type=file] { font: inherit; padding: .5rem; border: 1px dashed #cbd5e1; border-radius: 10px; background: #f8fafc; }
input[type=file]::file-selector-button { font: inherit; font-weight: 600; padding: .45rem .85rem; margin-right: .75rem; border: 1px solid #d1d5db; border-radius: 8px; background: #fff; color: var(--ink); cursor: pointer; }
input[type=file]::file-selector-button:hover { background: #f3f4f6; }
textarea { resize: vertical; }

.or { display: flex; align-items: center; gap: .75rem; color: var(--muted); font-size: .85rem; text-transform: none; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip { display: inline-flex; align-items: center; gap: .45rem; padding: .45rem .8rem; border: 1px solid #d1d5db; border-radius: 999px; background: #fff; font-weight: 500; cursor: pointer; }
.chip:has(input:checked) { border-color: var(--accent); background: #111827; color: #fff; }
.chip input { accent-color: var(--accent-2); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; font: inherit; font-weight: 600; padding: .6rem 1rem; border-radius: 10px;
  border: 1px solid #d1d5db; background: #fff; color: var(--ink); text-decoration: none; cursor: pointer; }
.btn:hover { background: #f3f4f6; color: var(--ink); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: #1f2937; color: #fff; }
.btn.big { padding: .85rem 1.4rem; font-size: 1.05rem; }
.btn[disabled], .btn.busy { opacity: .6; pointer-events: none; }
.small-btn { padding: .4rem .75rem; font-size: .9rem; }
button.link { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; text-decoration: underline; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; }

.alert { padding: .75rem 1rem; border-radius: 10px; margin: 0 0 1rem; border: 1px solid transparent; }
.alert.error { background: var(--bad-bg); border-color: #fecaca; color: var(--bad); }
.alert.warn { background: var(--warn-bg); border-color: #fde68a; color: var(--warn); }
.warn-text { color: var(--warn); }
.good-text { color: var(--good); }
.bad-text { color: var(--bad); }

.thumbs { display: flex; flex-wrap: wrap; gap: .4rem; }
.thumbs img { width: 64px; height: 48px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }
.thumb-file { display: inline-flex; align-items: center; width: 64px; height: 48px; padding: 0 .3rem; overflow: hidden; font-size: .65rem; color: var(--muted); background: #f9fafb; border-radius: 6px; border: 1px solid var(--line); word-break: break-all; }

.recent { list-style: none; margin: 0; padding: 0; }
.recent li + li { border-top: 1px solid var(--line); }
.recent a { display: grid; grid-template-columns: auto 1fr auto auto; gap: .75rem; align-items: center; padding: .6rem 0; color: var(--ink); text-decoration: none; }
.recent a:hover .rl { text-decoration: underline; }
.rm { font-weight: 700; }
.status { font-size: .75rem; padding: .15rem .5rem; border-radius: 999px; background: #e5e7eb; }
.s-done { background: var(--good-bg); color: var(--good); }
.s-error { background: var(--bad-bg); color: var(--bad); }
.s-running, .s-queued { background: var(--info-bg); color: #1d4ed8; }

.how li + li { margin-top: .4rem; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: .5rem .55rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .82rem; color: var(--muted); font-weight: 600; }
.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.models { margin-top: 1rem; font-size: .92rem; }
.table-wrap { overflow-x: auto; }
.listings td.t-title { min-width: 300px; }
.listings a { font-weight: 600; text-decoration: none; }
.listings a:hover { text-decoration: underline; }

.login-card { max-width: 420px; margin: 8vh auto; }
body.login { background: radial-gradient(1200px 600px at 50% -10%, #fde68a 0%, var(--bg) 55%); }

.progress-card { text-align: center; }
.spinner { width: 46px; height: 46px; border-radius: 50%; border: 4px solid #e5e7eb; border-top-color: var(--accent-2); margin: 1.5rem auto 1rem; animation: spin 0.9s linear infinite; }
.small-spinner { width: 28px; height: 28px; border-width: 3px; margin: .5rem 0; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } }
.current { font-weight: 600; }
.steps { text-align: left; max-width: 520px; margin: 1rem auto 0; padding-left: 1.2rem; color: #374151; }
.steps li + li { margin-top: .25rem; }

.result-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 1.25rem; }
.kicker { text-transform: uppercase; letter-spacing: .06em; font-size: .75rem; color: var(--muted); margin: 0 0 .25rem; }
.specline { color: #374151; margin: 0 0 .25rem; }
.head-actions { display: flex; flex-wrap: wrap; gap: .5rem; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1rem 1.2rem; display: flex; flex-direction: column; gap: .2rem; }
.kpi.main { background: var(--accent); color: #fff; border-color: var(--accent); }
.kpi.main .label, .kpi.main .sub { color: #d1d5db; }
.kpi .label { font-size: .82rem; color: var(--muted); font-weight: 600; }
.kpi .value { font-size: 1.55rem; font-weight: 800; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.kpi .sub { font-size: .85rem; color: var(--muted); }
.tier { font-size: 1.25rem !important; line-height: calc(1.55rem * 1.5); }
.tier-exact { color: var(--good); }
.tier-nauw { color: #1d4ed8; }
.tier-ruim { color: var(--warn); }

.verdict { border-left: 6px solid #9ca3af; }
.verdict.v-good { border-left-color: var(--good); }
.verdict.v-bad { border-left-color: var(--bad); }
.verdict.v-neutral { border-left-color: #1d4ed8; }
.verdict-head { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; }
.verdict-head h2 { margin: 0; }
.verdict ul { margin: .75rem 0; padding-left: 1.2rem; }
.badge { display: inline-block; font-size: .78rem; font-weight: 700; padding: .25rem .6rem; border-radius: 999px; background: #f3f4f6; text-transform: uppercase; letter-spacing: .04em; }
.v-good .badge { background: var(--good-bg); color: var(--good); }
.v-bad .badge { background: var(--bad-bg); color: var(--bad); }
.v-neutral .badge { background: var(--info-bg); color: #1d4ed8; }

.cheap-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; }
.cheap { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; background: #fff; }
.cheap img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: #f3f4f6; }
.cheap-body { padding: .9rem 1rem 1rem; display: flex; flex-direction: column; gap: .2rem; flex: 1; }
.cheap-body h3 { font-size: .98rem; margin: .2rem 0; }
.cheap-body p { margin: 0; }
.cheap-body .btn { margin-top: auto; align-self: flex-start; }
.rank { font-size: .78rem; font-weight: 700; color: var(--muted); }
.price { font-size: 1.4rem; font-weight: 800; font-variant-numeric: tabular-nums; }

.lvl { display: inline-block; font-size: .74rem; font-weight: 700; padding: .1rem .45rem; border-radius: 6px; background: #f3f4f6; }
.lvl-exact { background: var(--good-bg); color: var(--good); }
.lvl-nauw { background: var(--info-bg); color: #1d4ed8; }
.lvl-ruim { background: var(--warn-bg); color: var(--warn); }
.lvl-zwak { background: #f3f4f6; color: var(--muted); }

.spec { display: grid; grid-template-columns: 9.5rem 1fr; gap: .4rem .9rem; margin: 0; }
.spec dt { color: var(--muted); font-size: .9rem; }
.spec dd { margin: 0; }
.checks { font-size: .9rem; }
.ok { color: var(--good); font-weight: 800; }
.nok { color: var(--bad); font-weight: 800; }
.sources { padding-left: 1.1rem; margin: 0; }
.sources li + li { margin-top: .35rem; }

@media (max-width: 640px) {
  .wrap { padding: 1rem .85rem 2.5rem; }
  .card { padding: 1rem; }
  .spec { grid-template-columns: 1fr; }
  .spec dt { margin-top: .4rem; }
  .recent a { grid-template-columns: auto 1fr auto; }
  .recent .rd { display: none; }
}
