:root {
  --bg: #f3eee3;
  --ink: #1c1916;
  --muted: #5c574e;
  --green: #0d4f3e;
  --green-dark: #08332a;
  --green-soft: #e6f3ee;
  --gold: #b8860b;
  --card: #fffdf8;
  --line: #e2d8c4;
  --ok: #0f6b4c;
  --ok-bg: #e5f6ef;
  --warn: #8a5a00;
  --warn-bg: #fff4d6;
  --fail: #9b1c1c;
  --fail-bg: #fde8e8;
  --shadow: 0 8px 28px rgba(28, 25, 22, 0.08);
  --radius: 16px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Noto Sans Devanagari", "Noto Sans", "Segoe UI", Roboto, system-ui, sans-serif;
  background:
    radial-gradient(1200px 400px at 50% -120px, rgba(184, 134, 11, 0.12), transparent 60%),
    var(--bg);
  color: var(--ink);
  line-height: 1.55;
  font-size: 1.05rem;
}

.wrap { width: min(820px, calc(100% - 32px)); margin: 0 auto; }

.top {
  background: linear-gradient(180deg, var(--green-dark), var(--green));
  color: #f7f1e1;
  padding: 18px 0 20px;
  border-bottom: 4px solid var(--gold);
}
.head-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}
.brand { display: flex; gap: 12px; align-items: center; }
.mark {
  width: 44px; height: 44px; border-radius: 12px;
  display: grid; place-items: center;
  background: #f7f1e1; color: var(--green-dark);
  font-weight: 800; font-size: 1.25rem;
}
.brand-name { font-weight: 800; letter-spacing: 0.02em; }
.brand-sub { font-size: 0.9rem; opacity: 0.85; }
.official-badge {
  margin: 0; text-align: right; font-size: 0.78rem;
  line-height: 1.35; background: rgba(0,0,0,0.18);
  padding: 8px 10px; border-radius: 10px; max-width: 18rem;
}

.hero { padding: 28px 0 8px; }
h1, h2 { line-height: 1.25; margin: 0 0 10px; }
h1 { font-size: clamp(1.6rem, 4vw, 2.15rem); }
h2 { font-size: 1.2rem; }
.hi, .en { display: block; }
.en { font-weight: 500; color: var(--muted); font-size: 0.92em; }
h1 .en { color: #3f3a33; margin-top: 4px; }
.lead { font-size: 1.05rem; margin: 0 0 8px; }
.lead .en { margin-top: 4px; }

.banner {
  border-radius: var(--radius);
  padding: 14px 16px;
  margin: 14px 0;
  box-shadow: var(--shadow);
}
.banner .en { margin-top: 4px; }
.privacy { background: var(--green-soft); border: 1px solid #b7d8cb; }
.warn-scan { background: var(--warn-bg); border: 1px solid #e7c56a; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin: 16px 0 20px;
  box-shadow: var(--shadow);
}

.drop {
  display: block;
  border: 2px dashed #c8b896;
  background: #faf7f0;
  border-radius: 14px;
  padding: 28px 16px;
  text-align: center;
  cursor: pointer;
}
.drop:hover, .drop:focus-within { border-color: var(--green); background: #f4fbf7; }
.drop input { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.drop-icon {
  display: inline-grid; place-items: center;
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--green); color: #fff; font-size: 1.4rem;
  margin-bottom: 10px;
}
.drop-title { font-weight: 800; font-size: 1.1rem; }
.drop-title.en { font-weight: 600; }
.drop-hint { margin-top: 8px; color: var(--muted); font-size: 0.95rem; }
.file-label { margin: 12px 0 0; color: var(--green-dark); font-weight: 600; word-break: break-all; }

.hint { color: var(--muted); font-size: 0.95rem; margin: 0 0 12px; }
.hint .en { margin-top: 2px; }

.preview-frame {
  background: #d7d2c8;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #c9c1b0;
  aspect-ratio: 1024 / 680;
  touch-action: none;
}
.preview-frame canvas, .preview-frame img {
  display: block; width: 100%; height: 100%; object-fit: contain;
  background: #fff; cursor: grab;
}
.preview-frame canvas:active { cursor: grabbing; }
.preview-frame.small { max-width: 420px; }

.toolbar, .mode-row {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin: 14px 0;
}
.btn {
  appearance: none; border: 1px solid var(--line);
  background: #fff; color: var(--ink);
  border-radius: 12px; padding: 10px 14px;
  font: inherit; cursor: pointer;
  min-height: 52px; display: inline-flex; align-items: center; gap: 8px;
}
.btn:hover { border-color: var(--green); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.primary {
  background: var(--green); color: #fff; border-color: var(--green-dark);
  font-weight: 700;
}
.btn.primary:hover { background: var(--green-dark); }
.btn.big { width: 100%; justify-content: center; min-height: 60px; font-size: 1.08rem; }
.btn.primary .en, .btn.primary i { color: #e7f5ef; }
.stack { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.2; }
.stack b { font-weight: 800; }
.stack i { font-style: normal; font-size: 0.82em; color: var(--muted); font-weight: 500; }
.btn.big .stack { align-items: center; }

.mode {
  flex: 1; min-width: 160px;
  border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 12px; display: flex; gap: 10px; align-items: center;
  background: #fff; cursor: pointer; min-height: 52px;
}
.mode:has(input:checked) { border-color: var(--green); background: var(--green-soft); }
.mode input { width: 18px; height: 18px; accent-color: var(--green); }

.zoom-label {
  display: flex; flex-direction: column; gap: 6px;
  margin: 4px 0 12px; font-weight: 600;
}
.zoom-label input { width: 100%; accent-color: var(--green); height: 28px; }

.result-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
@media (min-width: 700px) {
  .result-grid { grid-template-columns: 1.1fr 1fr; align-items: start; }
}
.result-meta { font-weight: 700; font-size: 1.08rem; margin: 0 0 10px; }

.checks { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.checks li {
  border-radius: 12px; padding: 10px 12px;
  background: #f6f3ec; border: 1px solid var(--line);
}
.checks li.pass { background: var(--ok-bg); border-color: #b5e0cd; }
.checks li.warn { background: var(--warn-bg); border-color: #e7c56a; }
.checks li.fail { background: var(--fail-bg); border-color: #f0b4b4; }
.check-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.pill { font-size: 0.78rem; font-weight: 800; letter-spacing: 0.02em; text-transform: uppercase; }
.pass .pill { color: var(--ok); }
.warn .pill { color: var(--warn); }
.fail .pill { color: var(--fail); }
.check-msg { margin: 4px 0 0; font-size: 0.92rem; color: #3f3a33; }
.check-msg .en { margin-top: 2px; }

.steps { margin: 0; padding-left: 1.2rem; display: grid; gap: 12px; }
.steps li .en { margin-top: 2px; }
.fallback, .circular { margin: 16px 0 0; }
.circular a, .steps a, .fallback a { color: var(--green); font-weight: 700; }
.disclaimer p { margin: 0; }
.disclaimer .en { margin-top: 8px; }

.foot {
  padding: 28px 0 40px;
  color: var(--muted); text-align: center; font-size: 0.92rem;
}
.foot p { margin: 0 0 4px; }
.muted { opacity: 0.85; }

@media (max-width: 600px) {
  .head-row { flex-direction: column; align-items: flex-start; }
  .official-badge { text-align: left; max-width: none; }
}
