:root {
  --bg: #f3f5f9;
  --panel: #ffffff;
  --ink: #0f1b2d;
  --ink-2: #44526a;
  --ink-3: #7a879c;
  --line: #e1e6ee;
  --primary: #1446a0;
  --primary-2: #0d327a;
  --primary-soft: #e8eefb;
  --green: #128a4a;
  --green-soft: #e3f4ea;
  --amber: #b97409;
  --amber-soft: #fbf0dc;
  --red: #c2352b;
  --red-soft: #fbe6e4;
  --ref: #1e78d6;
  --test: #dc3c28;
  --radius: 16px;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--sans); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
button, input { font: inherit; }
button { cursor: pointer; }
a { color: var(--primary); }

.top {
  background: linear-gradient(135deg, #0b1f45 0%, #14398a 60%, #1b55b8 100%);
  color: #fff; padding: 44px 16px 92px; position: relative; overflow: hidden;
}
.top::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(rgba(255,255,255,.09) 1px, transparent 1px);
  background-size: 22px 22px; mask-image: linear-gradient(180deg, #000, transparent);
}
.top .in { max-width: 1080px; margin: 0 auto; position: relative; z-index: 1; }
.eyebrow { font-family: var(--mono); font-size: 12.5px; letter-spacing: .14em; text-transform: uppercase; opacity: .75; }
.top h1 { font-size: clamp(30px, 5vw, 46px); font-weight: 600; margin: 10px 0 12px; letter-spacing: -.02em; line-height: 1.1; }
.top p { max-width: 640px; color: rgba(255,255,255,.82); font-size: 17px; line-height: 1.55; margin: 0; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.tag { font-family: var(--mono); font-size: 12.5px; padding: 6px 11px; border-radius: 99px; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2); }
.tag a { color: #fff; text-decoration: none; }

.wrap { max-width: 1080px; margin: -60px auto 0; padding: 0 16px 60px; position: relative; z-index: 2; }

.pads { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 10px 30px rgba(15,27,45,.06); }
.pad { padding: 18px; }
.pad-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.pad-title { display: flex; align-items: center; gap: 10px; }
.pad-title .dot { width: 12px; height: 12px; border-radius: 50%; }
.pad-title h2 { font-size: 17px; font-weight: 600; margin: 0; }
.pad-title small { display: block; color: var(--ink-3); font-size: 13px; font-weight: 400; margin-top: 2px; }

.tabs { display: inline-flex; background: var(--bg); border-radius: 10px; padding: 3px; }
.tabs button { border: 0; background: transparent; padding: 6px 12px; border-radius: 8px; font-size: 13.5px; font-weight: 500; color: var(--ink-2); }
.tabs button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(15,27,45,.12); }

.surface {
  position: relative; height: 230px; border-radius: 12px; overflow: hidden;
  border: 1.5px dashed #c9d2df; background: #fff;
}
.surface canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }
.surface .baseline { position: absolute; left: 8%; right: 8%; bottom: 52px; border-bottom: 1px solid #dfe5ee; pointer-events: none; }
.surface .hint { position: absolute; left: 0; right: 0; bottom: 22px; text-align: center; font-size: 13px; color: var(--ink-3); pointer-events: none; }
.surface.filled .hint { display: none; }
.upload { position: absolute; inset: 0; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: var(--ink-2); font-size: 14px; text-align: center; padding: 16px; cursor: pointer; }
.upload img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.upload .ic { width: 44px; height: 44px; border-radius: 12px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; font-size: 22px; }
.mode-upload canvas, .mode-upload .baseline, .mode-upload .hint { display: none; }
.mode-upload .upload { display: flex; }
.upload.has-img { padding: 8px; background: #fafbfd; }
.dragover { border-color: var(--primary); background: var(--primary-soft); }

.pad-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; gap: 8px; }
.pad-foot .meta { font-size: 12.5px; color: var(--ink-3); }

.btn {
  border: 0; border-radius: 12px; padding: 13px 22px; font-weight: 600; font-size: 15px;
  background: var(--primary); color: #fff; box-shadow: 0 6px 18px rgba(20,70,160,.25);
  transition: background .15s, transform .1s;
}
.btn:hover { background: var(--primary-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--ink-2); box-shadow: none; padding: 7px 10px; font-weight: 500; font-size: 13.5px; }
.btn.ghost:hover { background: var(--bg); color: var(--ink); }

.action { display: flex; flex-direction: column; align-items: center; gap: 10px; margin: 24px 0 8px; }
.action .btn { padding: 15px 34px; font-size: 16px; min-width: 260px; }
.action .note { font-size: 13px; color: var(--ink-3); }
.err { color: var(--red); font-size: 14px; min-height: 20px; }

.spinner { width: 18px; height: 18px; border: 2.5px solid rgba(255,255,255,.45); border-top-color: #fff; border-radius: 50%; display: inline-block; vertical-align: -3px; margin-right: 8px; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg) } }

/* ---------- sonuc ---------- */
#result { display: none; margin-top: 18px; }
#result.show { display: block; animation: rise .4s ease; }
@keyframes rise { from { opacity: 0; transform: translateY(10px) } to { opacity: 1; transform: none } }

.summary { display: grid; grid-template-columns: 300px 1fr; gap: 0; }
.gauge-box { padding: 26px 20px 22px; border-right: 1px solid var(--line); text-align: center; }
.gauge { width: 240px; max-width: 100%; display: block; margin: 0 auto; }
.score-num { font-size: 52px; font-weight: 600; letter-spacing: -.03em; line-height: 1; margin-top: -58px; }
.score-num small { font-size: 18px; color: var(--ink-3); font-weight: 500; }
.verdict { display: inline-block; margin-top: 18px; padding: 8px 14px; border-radius: 10px; font-weight: 600; font-size: 15px; }
.verdict.same { background: var(--green-soft); color: var(--green); }
.verdict.suspect { background: var(--amber-soft); color: var(--amber); }
.verdict.different { background: var(--red-soft); color: var(--red); }
.legend { display: flex; justify-content: center; gap: 12px; margin-top: 14px; font-size: 12px; color: var(--ink-3); flex-wrap: wrap; }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; vertical-align: 0; }

.metrics { padding: 22px 24px; }
.metrics h3, .section h3 { font-size: 15px; font-weight: 600; margin: 0 0 14px; }
#img-overlay { max-width: 720px; margin: 0 auto; }
.metric { display: grid; grid-template-columns: 230px 1fr 52px; gap: 12px; align-items: center; padding: 7px 0; }
.metric .lbl { font-size: 14px; font-weight: 500; }
.metric .lbl small { display: block; color: var(--ink-3); font-weight: 400; font-size: 12px; margin-top: 1px; }
.metric .track { height: 9px; background: var(--bg); border-radius: 99px; overflow: hidden; }
.metric .fill { height: 100%; width: 0; border-radius: 99px; background: var(--primary); transition: width .9s cubic-bezier(.2,.8,.2,1); }
.metric .val { font-family: var(--mono); font-size: 13.5px; text-align: right; color: var(--ink-2); }
.details { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 8px 18px; font-family: var(--mono); font-size: 12.5px; color: var(--ink-3); }
.details b { color: var(--ink); font-weight: 500; }

.visuals { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 18px; }
.section { padding: 18px; }
.section p.cap { font-size: 13px; color: var(--ink-3); margin: -6px 0 12px; line-height: 1.5; }
.section img { width: 100%; display: block; border-radius: 10px; border: 1px solid var(--line); background: #fff; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pair figure { margin: 0; }
.pair figcaption { font-size: 12px; color: var(--ink-3); margin-top: 6px; text-align: center; }
.wide { grid-column: 1 / -1; }
.key { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2); margin-top: 10px; }
.key i { display: inline-block; width: 12px; height: 4px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }

.how { margin-top: 18px; padding: 22px 24px; }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; counter-reset: s; }
.step { padding: 14px; border-radius: 12px; background: var(--bg); font-size: 13.5px; line-height: 1.5; color: var(--ink-2); }
.step b { display: block; color: var(--ink); margin-bottom: 4px; font-size: 14px; }
.step b::before { counter-increment: s; content: counter(s); display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--primary); color: #fff; font-size: 12px; margin-right: 8px; }
.how-foot { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 16px; }
.disclaimer { font-size: 13px; color: var(--ink-3); line-height: 1.55; max-width: 720px; }
.code-link { text-decoration: none; display: inline-flex; align-items: center; gap: 8px; }

footer { text-align: center; color: var(--ink-3); font-size: 12.5px; margin-top: 30px; }

@media (max-width: 860px) {
  .pads, .visuals, .summary { grid-template-columns: 1fr; }
  .gauge-box { border-right: 0; border-bottom: 1px solid var(--line); }
  .steps { grid-template-columns: 1fr 1fr; }
  .metric { grid-template-columns: 1fr 52px; }
  .metric .track { grid-column: 1 / -1; grid-row: 2; }
}
@media (max-width: 480px) {
  .steps { grid-template-columns: 1fr; }
  .action .btn { min-width: 0; width: 100%; }
  .pad-head { flex-wrap: wrap; }
}
