:root {
  --navy: #0f2a44;
  --navy-2: #1b3d5e;
  --accent: #f2a900;
  --accent-ink: #3a2a00;
  --bg: #f3f5f8;
  --card: #ffffff;
  --ink: #1d2733;
  --muted: #5b6673;
  --line: #dde2e8;
  --ok: #1f8a4c;
  --err: #b42318;
  --ai: #8a5a00;
  --ai-bg: #fff6dd;
  --radius: 14px;
  --tap: 48px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--bg);
}
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 8px;
  padding: calc(env(safe-area-inset-top) + 10px) 14px 10px;
  background: var(--navy); color: #fff;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand strong { display: block; font-size: 17px; line-height: 1.1; }
.brand span { display: block; font-size: 12px; opacity: .75; }
.back { width: 40px; height: 40px; border: 0; border-radius: 10px; background: var(--navy-2); color: #fff; display: grid; place-items: center; cursor: pointer; }
.back svg { width: 22px; height: 22px; }

main { max-width: 640px; margin: 0 auto; padding: 18px 14px calc(env(safe-area-inset-bottom) + 40px); }
h1 { font-size: 24px; line-height: 1.2; margin: 6px 0 6px; color: var(--navy); }
.lead { margin: 0 0 14px; color: var(--muted); }
.hint { margin: -6px 0 14px; font-size: 15px; color: var(--muted); }
.small { font-size: 14px; color: var(--muted); margin: 0 0 12px; }
.section-title { font-size: 16px; margin: 22px 0 10px; color: var(--navy); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
.card-title { font-size: 17px; margin: 0 0 12px; color: var(--navy); }

textarea, input[type=text], input[type=number], input[type=email], input[type=tel], input:not([type]), select {
  width: 100%; min-height: var(--tap);
  font: inherit; color: var(--ink);
  padding: 11px 12px;
  border: 1.5px solid #c5ccd5; border-radius: 10px; background: #fff;
}
textarea { resize: vertical; }
textarea:focus, input:focus, select:focus { outline: 3px solid rgba(242,169,0,.45); border-color: var(--navy-2); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap); padding: 0 18px;
  font: inherit; font-weight: 600;
  border: 0; border-radius: 12px; cursor: pointer;
}
.btn svg { width: 20px; height: 20px; }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.secondary { background: #e8edf3; color: var(--navy); }
.btn.big { width: 100%; min-height: 56px; font-size: 18px; }
.btn:disabled { opacity: .6; cursor: progress; }

.search-actions { display: flex; justify-content: flex-end; margin-top: 10px; }
.status { margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: #eef2f7; color: var(--navy); font-size: 15px; }
.status.warn { background: var(--ai-bg); color: var(--ai); }

.results { list-style: none; margin: 10px 0 0; padding: 0; }
.results li + li { margin-top: 8px; }
.result-btn, .pt-btn {
  width: 100%; min-height: var(--tap); text-align: left;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 14px; font: inherit; color: var(--ink);
  background: #f7f9fb; border: 1.5px solid var(--line); border-radius: 12px; cursor: pointer;
}
.result-btn::after, .pt-btn::after { content: "›"; font-size: 24px; color: var(--muted); line-height: 1; }

.categories details { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 10px; overflow: hidden; }
.categories summary { list-style: none; cursor: pointer; padding: 15px 16px; font-weight: 600; color: var(--navy); display: flex; justify-content: space-between; align-items: center; min-height: var(--tap); }
.categories summary::-webkit-details-marker { display: none; }
.categories summary::after { content: "+"; font-size: 22px; color: var(--muted); }
.categories details[open] > summary::after { content: "−"; }
.subcat { padding: 0 16px 14px; }
.subcat h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 6px 0 8px; }
.subcat .pt-btn + .pt-btn { margin-top: 8px; }

.other-card { width: 100%; text-align: left; cursor: pointer; font: inherit; display: block; margin-top: 18px; }
.other-card strong { display: block; color: var(--navy); }
.other-card span { color: var(--muted); font-size: 15px; }

.banner { padding: 12px 14px; border-radius: 12px; background: var(--ai-bg); color: var(--ai); font-size: 15px; margin-bottom: 10px; }
.banner button { margin-top: 6px; background: none; border: 0; padding: 0; color: var(--navy); font: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; }

.field { margin-bottom: 18px; }
.field:last-child { margin-bottom: 0; }
.field > label, .field > .label { display: block; font-weight: 600; margin-bottom: 6px; }
.field .help { font-size: 14px; color: var(--muted); margin: -2px 0 8px; }
.field .example { font-size: 13px; color: var(--muted); margin-top: 5px; }
.opt { font-weight: 400; font-size: 13px; color: var(--muted); }
.ai-badge { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--ai-bg); color: var(--ai); vertical-align: middle; }
.field.ai-filled input, .field.ai-filled .chips { box-shadow: 0 0 0 3px var(--ai-bg); border-radius: 10px; }

.unit-wrap { position: relative; }
.unit-wrap input { padding-right: 72px; }
.unit-wrap .unit { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 15px; pointer-events: none; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 44px; padding: 8px 14px;
  font: inherit; font-size: 15px; color: var(--ink);
  background: #fff; border: 1.5px solid #c5ccd5; border-radius: 999px; cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }

.more { padding: 0; }
.more summary { list-style: none; cursor: pointer; padding: 16px; display: flex; flex-direction: column; min-height: var(--tap); }
.more summary::-webkit-details-marker { display: none; }
.more summary span { font-weight: 600; font-size: 17px; color: var(--navy); }
.more summary span::after { content: " +"; color: var(--muted); }
.more[open] summary span::after { content: " −"; }
.more summary small { color: var(--muted); font-size: 14px; }
.more > div { padding: 0 16px 16px; }

.photo-zone { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; }
.thumb { position: relative; width: 92px; height: 92px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: #eef1f5; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .remove { position: absolute; top: 4px; right: 4px; width: 28px; height: 28px; border-radius: 50%; border: 0; background: rgba(15,42,68,.85); color: #fff; font-size: 18px; line-height: 1; cursor: pointer; }
.add-photo {
  width: 92px; height: 92px; border-radius: 10px; border: 2px dashed #b5bec9; background: #f7f9fb;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  font: inherit; font-size: 13px; color: var(--navy); cursor: pointer;
}
.add-photo svg { width: 26px; height: 26px; }
.ai-read { margin-top: 10px; }
.ai-read .btn { min-height: 44px; font-size: 15px; }
.ai-read .status { margin-top: 8px; }

.stepper { display: flex; gap: 8px; max-width: 220px; }
.stepper input { text-align: center; }
.step { width: var(--tap); min-width: var(--tap); border: 1.5px solid #c5ccd5; background: #fff; border-radius: 10px; font-size: 22px; cursor: pointer; color: var(--navy); }

.check { display: flex; align-items: center; gap: 10px; font-size: 15px; margin: 4px 0 14px; min-height: 44px; }
.check input { width: 22px; height: 22px; }
.turnstile { margin: 6px 0 10px; min-height: 0; }
.privacy a { color: var(--navy); }

.error { padding: 12px 14px; border-radius: 12px; background: #fdecea; color: var(--err); margin-bottom: 12px; font-size: 15px; }

.done { text-align: center; padding: 30px 18px; }
.tick { width: 64px; height: 64px; margin: 0 auto 12px; border-radius: 50%; background: #e3f4ea; color: var(--ok); display: grid; place-items: center; }
.tick svg { width: 34px; height: 34px; }
.ref { font-size: 18px; }

.spinner { width: 18px; height: 18px; border: 2.5px solid currentColor; border-right-color: transparent; border-radius: 50%; display: inline-block; vertical-align: -3px; margin-right: 8px; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2s; } }
