:root {
  --bg: #F3F4F1;
  --surface: #FFFFFF;
  --ink: #17201C;
  --muted: #55605A;
  --line: #DDE1DC;
  --field: #C9CFC8;
  --soft: #EEF1ED;
  --accent: #1E6B55;
  --accent-ink: #164F3F;
  --accent-soft: #DCEFE7;
  --warn-soft: #FCEBD9;
  --warn-ink: #8A3E06;
  --warn-line: #E39A5A;
  --danger: #A12C1F;
  --radius: 14px;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body {
  font-family: Manrope, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.4;
  -webkit-tap-highlight-color: transparent;
}
main { max-width: 520px; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column; }
h1, h2, p { margin: 0; }
button, input, select { font: inherit; color: inherit; }
a { color: var(--accent); }

.screen { flex: 1; display: flex; flex-direction: column; padding: calc(env(safe-area-inset-top) + 16px) 16px 0; gap: 16px; }
.screen.center { justify-content: center; }
.bar { display: flex; align-items: center; gap: 8px; }
.bar h1 { font-size: 18px; font-weight: 800; }
.bar .sub { font-size: 13px; color: var(--muted); }
.grow { flex: 1; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 17px; }
.hello h1 { font-size: 26px; font-weight: 800; letter-spacing: -0.5px; }

.icon-btn {
  width: 44px; height: 44px; border-radius: 22px; border: 1px solid var(--line);
  background: var(--surface); display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.icon-btn.plain { border: none; background: transparent; }

.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 18px; border-radius: 12px; border: none;
  font-weight: 700; font-size: 16px; cursor: pointer; text-decoration: none; width: 100%;
}
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:disabled { background: #9DB8AE; }
.btn.secondary { background: var(--surface); color: var(--ink); border: 1px solid var(--field); min-height: 46px; font-weight: 600; }
.btn.link { background: none; color: var(--accent); min-height: 44px; }

.hero {
  display: flex; align-items: center; gap: 14px; padding: 18px; border-radius: var(--radius);
  background: var(--accent); color: #fff; border: none; width: 100%; text-align: left; cursor: pointer;
}
.hero .ic { width: 48px; height: 48px; border-radius: 12px; background: #2A7F67; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.hero b { display: block; font-size: 18px; }
.hero span { font-size: 13px; color: #D5EAE2; }

.section-title { font-size: 13px; font-weight: 700; letter-spacing: 0.6px; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.stat { padding: 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.stat b { display: block; font-size: 24px; font-weight: 800; }
.stat span { font-size: 13px; color: var(--muted); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.list .item { display: flex; align-items: center; gap: 12px; padding: 12px; }
.list .item + .item { border-top: 1px solid #E8EBE7; }
.item .t { font-size: 15px; font-weight: 700; }
.item .d { font-size: 13px; color: var(--muted); }

.tag { font-size: 12px; font-weight: 700; padding: 4px 8px; border-radius: 6px; white-space: nowrap; }
.tag.ok { background: var(--accent-soft); color: var(--accent-ink); }
.tag.warn { background: var(--warn-soft); color: var(--warn-ink); }
.tag.gray { background: var(--soft); color: var(--muted); }

.photos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.photo { position: relative; aspect-ratio: 3 / 4; border-radius: 12px; overflow: hidden; background: #E3E7E2; }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo .x {
  position: absolute; top: 6px; right: 6px; width: 36px; height: 36px; border-radius: 18px;
  border: none; background: rgba(23, 32, 28, 0.72); color: #fff; display: flex; align-items: center; justify-content: center;
}
.shoot {
  aspect-ratio: 3 / 4; border-radius: 12px; border: 2px dashed #9AA49E; background: transparent;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  font-weight: 700; color: var(--muted); cursor: pointer;
}
.shoot input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.strip { display: flex; gap: 8px; overflow-x: auto; }
.strip img { width: 84px; height: 112px; object-fit: cover; border-radius: 10px; flex-shrink: 0; }

.notice { display: flex; gap: 10px; padding: 10px 12px; border-radius: 10px; font-size: 14px; font-weight: 600; align-items: flex-start; }
.notice svg { flex-shrink: 0; margin-top: 1px; }
.notice.ok { background: var(--accent-soft); color: var(--accent-ink); }
.notice.warn { background: var(--warn-soft); color: var(--warn-ink); }
.notice.info { background: var(--surface); border: 1px solid var(--line); color: var(--muted); font-weight: 500; }
.notice.err { background: #F8E1DE; color: var(--danger); }

.form { padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
label.f { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 700; color: var(--muted); }
label.f input, label.f select {
  height: 48px; padding: 0 12px; border: 1px solid var(--field); border-radius: 10px;
  font-size: 17px; font-weight: 700; color: var(--ink); background: var(--surface); width: 100%;
}
label.f input.big { font-size: 20px; }
label.f.unsure input { border: 2px solid var(--warn-line); background: #FFF7EF; }
label.f.unsure::after { content: "Patikrink – Claude abejoja"; color: var(--warn-ink); font-weight: 600; }
label.f input:focus, label.f select:focus { outline: 3px solid #9CD3C0; outline-offset: 0; }
details summary { cursor: pointer; font-weight: 700; color: var(--accent); min-height: 44px; display: flex; align-items: center; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 13px; font-weight: 600; padding: 5px 10px; border-radius: 20px; background: var(--soft); }

.choice { display: flex; flex-direction: column; gap: 8px; }
.choice label { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1px solid var(--field); border-radius: 12px; background: var(--surface); font-size: 15px; }
.choice input { width: 20px; height: 20px; accent-color: var(--accent); margin-top: 2px; }

.footer { position: sticky; bottom: 0; margin: 0 -16px; padding: 12px 16px calc(env(safe-area-inset-bottom) + 16px); background: var(--surface); border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; margin-top: auto; }
.spacer { height: 4px; }

.pin { display: flex; flex-direction: column; gap: 16px; padding: 24px 8px; }
.pin input { height: 64px; text-align: center; font-size: 32px; letter-spacing: 12px; border-radius: 14px; border: 1px solid var(--field); font-weight: 800; }

.spinner { width: 56px; height: 56px; border-radius: 50%; border: 5px solid var(--accent-soft); border-top-color: var(--accent); animation: spin 0.9s linear infinite; margin: 0 auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.big-check { width: 72px; height: 72px; border-radius: 36px; background: var(--accent-soft); display: flex; align-items: center; justify-content: center; margin: 0 auto; }

#toast {
  position: fixed; left: 16px; right: 16px; bottom: calc(env(safe-area-inset-bottom) + 96px);
  max-width: 488px; margin: 0 auto; padding: 12px 14px; border-radius: 12px;
  background: var(--ink); color: #fff; font-weight: 600; font-size: 14px; z-index: 10;
}

@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } }
