/* eMAR citizen app, styled after the eMAR UI mockups (FSA brand palette, Tajawal).
   Green = success, amber = warnings, red = emergencies and errors; every state also has a word or icon. */
:root {
  --navy: #1f3a68; --navy-2: #24447a; --navy-dark: #14294f; --btn: #2f5089; --ink: #1d2738; --muted: #5d6a7c;
  --line: #dbe3ee; --bg: #ffffff; --soft: #e9f1fa; --soft-2: #f3f7fc; --blue: #2f5089; --sky: #6aa1d6;
  --green: #1d7a4b; --green-bg: #e3f3ea; --tick: #2f9e5b; --amber: #7a4b00; --amber-bg: #fdf1dc;
  --red: #a8271d; --red-bg: #fbe8e8; --plate: #f6cd1d;
  --sans: Tajawal, "Segoe UI", Tahoma, sans-serif;
  color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: #e3e9f1; }
body { overscroll-behavior-y: contain; }
body.busy { cursor: progress; }
body.busy .actions .btn.primary { opacity: .6; pointer-events: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
:focus-visible { outline: 3px solid #7aa2d6; outline-offset: 2px; }
#app { min-height: 100vh; display: flex; flex-direction: column; max-width: 560px; margin: 0 auto; background: var(--bg); box-shadow: 0 0 40px rgba(20,41,79,.08); }
[dir="rtl"] svg.dir { transform: scaleX(-1); }

/* demo strip and tools (not part of the product design) */
.tools { display: flex; justify-content: space-between; align-items: center; gap: 8px; background: var(--navy-dark); color: #c9d6ea; font-size: 12px; padding: 4px 12px; padding-top: max(4px, env(safe-area-inset-top)); }
.demo-tag { background: #f6cd1d; color: #3d3000; border-radius: 999px; padding: 1px 8px; font-weight: 700; }
.tool-btns { display: flex; align-items: center; gap: 4px; }
.tool-btns > button { width: 32px; height: 28px; display: grid; place-items: center; color: #c9d6ea; border-radius: 8px; }
.tool-btns svg { width: 18px; height: 18px; }
.chip-btn { display: inline-flex !important; width: auto !important; align-items: center; gap: 4px; background: rgba(255,255,255,.14); color: #fff !important; border-radius: 999px !important; padding: 2px 10px; font-size: 12px; max-width: 140px; white-space: nowrap; overflow: hidden; }

/* header (mockup: navy, back, FSA mark, title, ROP emblem, language pill, step bar) */
.top { background: var(--navy); color: #fff; padding: 12px 16px 30px; }
.top .bar { display: flex; align-items: center; gap: 8px; }
@media (max-width: 400px) { .mark { width: 32px !important; height: 32px !important; } .brand b { font-size: 15.5px !important; } .lang { padding: 3px 9px !important; font-size: 13px !important; } .back-btn { width: 36px !important; height: 36px !important; } .home .hero h1 { font-size: 29px !important; } }
.back-btn { width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,.12); color: #fff; display: grid; place-items: center; flex: none; }
.mark { width: 38px; height: 38px; border-radius: 50%; flex: none; background: #fff; box-shadow: 0 0 0 2px rgba(255,255,255,.18); }
.mark.rop { width: 40px; height: 40px; }
.brand { flex: 1; min-width: 0; line-height: 1.25; }
.brand b { display: block; font-size: 17px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand small { display: block; font-size: 12.5px; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lang { border: 1.5px solid rgba(255,255,255,.6); border-radius: 999px; padding: 4px 12px; font-size: 14px; color: #fff; font-weight: 700; flex: none; }
.steprow { display: flex; justify-content: space-between; margin-top: 14px; font-size: 14px; opacity: .92; }
.segs { display: flex; gap: 6px; margin-top: 8px; }
.segs i { flex: 1; height: 5px; border-radius: 3px; background: rgba(255,255,255,.22); }
.segs i.on { background: var(--sky); }

.banner { padding: 10px 16px; font-size: 14px; }
.banner.warn { background: var(--amber-bg); color: var(--amber); }
.sms { position: relative; z-index: 3; display: flex; gap: 10px; align-items: center; text-align: start; margin: -18px 12px 8px; padding: 10px 14px; background: #1b2433; color: #fff; border-radius: 16px; box-shadow: 0 6px 20px rgba(0,0,0,.18); font-size: 14px; animation: drop .3s ease-out; width: calc(100% - 24px); }
.sms bdi { font-size: 18px; font-weight: 800; letter-spacing: .12em; }
@keyframes drop { from { transform: translateY(-12px); opacity: 0; } }
.toast { position: fixed; inset-inline: 12px; bottom: calc(130px + env(safe-area-inset-bottom)); z-index: 30; max-width: 536px; margin: 0 auto; padding: 12px 16px; border-radius: 14px; background: var(--ink); color: #fff; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.toast.error { background: var(--red); } .toast.warn { background: var(--amber); }

/* white sheet over the header */
.screen { flex: 1; position: relative; z-index: 2; background: var(--bg); border-radius: 26px 26px 0 0; margin-top: -22px; padding: 22px 20px 20px; }
.screen h1 { font-size: 25px; line-height: 1.25; margin: 4px 0 10px; color: var(--navy-dark); font-weight: 800; }
.screen h2 { font-size: 17px; margin: 22px 0 10px; color: var(--navy-dark); display: flex; justify-content: space-between; align-items: center; gap: 8px; font-weight: 700; }
.screen p { margin: 8px 0; }
.lead { font-size: 18px; }
.lead-muted { color: var(--muted); font-size: 17px; }
.muted { color: var(--muted); } .small { font-size: 14px; }
.loading { padding: 60px 0; text-align: center; color: var(--muted); font-size: 30px; letter-spacing: .3em; }
.loading.boot { padding-top: 40vh; }
.iso { unicode-bidi: isolate; direction: ltr; font-variant-numeric: tabular-nums; }
.center { text-align: center; }
.center .card, .center .note { text-align: start; }

/* Omani plate: number on white, Arabic letters on yellow */
.plate { display: inline-flex; align-items: stretch; border: 2.5px solid #111; border-radius: 7px; overflow: hidden; font-weight: 800; direction: ltr; unicode-bidi: isolate; white-space: nowrap; vertical-align: middle; line-height: 1.5; background: #fff; }
.plate b { padding: 0 8px; color: #111; letter-spacing: .02em; }
.plate span { background: var(--plate); color: #111; padding: 0 8px; }

/* bottom actions and partnership footer */
.actions { position: sticky; bottom: 0; z-index: 4; display: flex; flex-direction: column; gap: 10px; padding: 14px 20px 8px; padding-bottom: max(8px, env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid var(--line); }
.partner { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }
.partner img { width: 20px; height: 20px; border-radius: 50%; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 56px; border-radius: 16px; padding: 12px 18px; font-weight: 700; font-size: 18px; text-decoration: none; width: 100%; text-align: center; }
.btn.primary { background: var(--btn); color: #fff; box-shadow: 0 8px 18px rgba(47,80,137,.25); }
.btn.secondary { background: #fff; color: var(--btn); border: 2px solid var(--btn); }
.btn.danger { background: #c0392b; color: #fff; }
.btn.demo { background: #fff7d1; color: #5e4a00; border: 1.5px dashed #d8b84b; min-height: 46px; font-size: 15px; box-shadow: none; }
.btn.small { min-height: 44px; font-size: 15px; width: auto; padding: 8px 16px; border-radius: 12px; }
.btn:disabled, .btn[disabled] { opacity: .45; box-shadow: none; }
.link { color: var(--blue); font-weight: 700; padding: 8px 4px; min-height: 40px; text-align: center; text-decoration: underline; text-underline-offset: 4px; font-size: 16px; }
.link.tiny { font-size: 13px; min-height: 32px; padding: 4px; }
.row-btns { display: flex; gap: 10px; flex-wrap: wrap; margin: 12px 0; }
.row-btns .btn { flex: 1; }
.demo-actions { display: grid; gap: 8px; margin: 14px 0; }

/* notes: light panels with an icon at the start */
.note { position: relative; border-radius: 16px; padding: 14px 16px; padding-inline-start: 48px; margin: 12px 0; background: var(--soft); color: var(--navy-dark); }
.note::before { content: ""; position: absolute; inset-inline-start: 16px; top: 15px; width: 22px; height: 22px; background: currentColor; -webkit-mask: var(--ic) center / contain no-repeat; mask: var(--ic) center / contain no-repeat;
  --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9.5'/%3E%3Cpath d='M12 11v6M12 7.5v.5'/%3E%3C/svg%3E"); }
.note.ok { background: var(--green-bg); color: var(--green);
  --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9.5'/%3E%3Cpath d='M7.5 12.5l3 3 6-6.5'/%3E%3C/svg%3E"); }
.note.warn { background: var(--amber-bg); color: var(--amber);
  --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linejoin='round' stroke-linecap='round'%3E%3Cpath d='M12 3l10 18H2z'/%3E%3Cpath d='M12 10v5M12 18v.2'/%3E%3C/svg%3E"); }
.note.error { background: var(--red-bg); color: var(--red);
  --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9.5'/%3E%3Cpath d='M12 7v6M12 16.5v.3'/%3E%3C/svg%3E"); }
.note:has(> svg:first-child)::before { display: none; }
.note > svg:first-child { position: absolute; inset-inline-start: 16px; top: 15px; width: 22px; height: 22px; }
.note .btn { margin-top: 8px; }
.card { display: flex; flex-direction: column; gap: 4px; background: #fff; border: 1.5px solid var(--line); border-radius: 18px; padding: 16px; margin: 12px 0; text-align: start; width: 100%; color: inherit; text-decoration: none; }
.card.row { flex-direction: row; align-items: center; gap: 10px; font-weight: 700; }
.card.row.on { border-color: var(--btn); }
.danger-row { color: var(--red); }
.card.resume { border-color: #9fb7d6; background: var(--soft-2); }
.card.resume b { color: var(--navy-dark); font-size: 17px; }
.card small, .card span { color: var(--muted); font-size: 14.5px; }
.card.next { background: var(--soft); border-color: transparent; }
.badge { display: inline-block; background: var(--green-bg); color: var(--green); border-radius: 999px; padding: 4px 10px; font-size: 13px; font-weight: 700; }
.badge.amber { background: var(--amber-bg); color: var(--amber); }
.tag { color: var(--red); }
.big-icon { width: 80px; height: 80px; border-radius: 50%; display: grid; place-items: center; margin: 18px 0 8px; }
.big-icon svg { width: 40px; height: 40px; }
.big-icon.green { background: var(--green-bg); color: var(--tick); }
.big-icon.red { background: var(--red-bg); color: var(--red); }
.big-icon.amber { background: var(--amber-bg); color: var(--amber); }
.emergency h1 { color: var(--red); }
.reasons li { margin: 4px 0; font-weight: 700; }

/* home (C-01): hero continues the navy header, with the two marks and the FSA stripes */
.top.home-top { padding-bottom: 0; }
.home.screen { margin-top: 0; border-radius: 0; padding-top: 0; }
.home .hero { margin: 0 -20px 18px; padding: 26px 24px 34px; color: #fff; border-radius: 0 0 30px 30px; position: relative; overflow: hidden;
  background: repeating-linear-gradient(90deg, rgba(255,255,255,.07) 0 9px, transparent 9px 22px) right 0 top 0 / 46% 70% no-repeat, linear-gradient(180deg, var(--navy) 0%, #2d538f 100%); }
.hero-logos { display: flex; align-items: center; gap: 22px; }
.hero-logos img { width: 92px; height: 92px; border-radius: 50%; background: #fff; }
.hero-logos img.rop { width: 98px; height: 98px; }
.hero-logos i { width: 2px; height: 64px; background: rgba(255,255,255,.3); }
.home .hero h1 { color: #fff; font-size: 34px; margin: 22px 0 8px; }
.home .hero p { font-size: 18px; opacity: .9; margin: 0; }
.icon-card { flex-direction: row; align-items: center; gap: 14px; }
.icon-card .ic { width: 56px; height: 56px; flex: none; border-radius: 50%; background: var(--soft); color: var(--navy); display: grid; place-items: center; }
.icon-card b { display: block; font-size: 17px; color: var(--ink); }
.home-steps { list-style: none; padding: 0; margin: 18px 0; display: grid; gap: 16px; }
.home-steps li { display: flex; gap: 14px; align-items: center; font-size: 17px; }
.home-steps i { width: 36px; height: 36px; flex: none; border-radius: 50%; background: var(--soft); color: var(--navy); font-style: normal; font-weight: 800; display: grid; place-items: center; }
.hurt { display: flex; gap: 12px; align-items: center; background: var(--red-bg); color: var(--red); border-radius: 16px; padding: 16px; text-decoration: none; font-size: 17px; margin: 16px 0; }
.demo-card { background: #fffcef; border: 1.5px dashed #e3c96b; }
.demo-card label { font-size: 14px; color: var(--muted); }

/* forms */
label { display: block; margin: 12px 0; font-weight: 700; color: var(--navy-dark); }
input:not([type=checkbox]):not([type=radio]), select, textarea { display: block; width: 100%; margin-top: 8px; min-height: 54px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 14px; background: #fff; font-size: 17px; font-weight: 400; color: var(--ink); }
input:focus, select:focus, textarea:focus { border-color: var(--btn); outline: none; box-shadow: 0 0 0 3px rgba(47,80,137,.15); }
textarea { min-height: 76px; resize: vertical; }
.otp { font-size: 30px !important; letter-spacing: .5em; text-align: center; font-weight: 800 !important; }
.check, .radio { display: flex; gap: 14px; align-items: center; padding: 16px; background: #fff; border: 1.5px solid var(--line); border-radius: 16px; margin: 12px 0; font-weight: 400; color: var(--ink); font-size: 17px; }
.check input, .radio input { width: 26px; height: 26px; margin: 0; flex: none; accent-color: var(--btn); }
.check.danger:has(input:checked) { border-color: #c0392b; background: var(--red-bg); }
.check:has(input:checked), .radio:has(input:checked) { border-color: var(--btn); }
.check.locked { background: var(--amber-bg); border-color: #f2d9a9; }
.radio.big span { display: flex; flex-direction: column; } .radio.big small { color: var(--muted); font-weight: 400; }
.radio.off { opacity: .55; }
.checks { margin-top: 6px; }
.seg { border: 0; padding: 0; margin: 18px 0; display: flex; gap: 10px; flex-wrap: wrap; }
.seg legend { font-weight: 700; margin-bottom: 10px; color: var(--navy-dark); font-size: 17px; width: 100%; }
.seg label { margin: 0; } .seg input { position: absolute; opacity: 0; }
.seg span { display: block; text-align: center; padding: 10px 24px; border: 1.5px solid var(--line); border-radius: 999px; font-weight: 500; background: #fff; color: var(--ink); }
.seg input:checked + span { background: var(--navy); color: #fff; border-color: var(--navy); }
.plate-form .row { display: flex; gap: 8px; } .plate-form .row input { flex: 2; } .plate-form .row select { flex: 1.3; }
.inline-form { background: var(--soft-2); border-radius: 16px; padding: 4px 14px 14px; border: 1.5px solid var(--line); }

/* photos (C-08): chips, 3-column tiles, one gallery button */
.chips { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin: 14px 0; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--soft); color: var(--navy); border-radius: 999px; padding: 5px 14px; font-weight: 700; font-size: 14.5px; }
.chip svg { width: 18px; height: 18px; }
.chip.grey { background: #eef1f5; color: var(--muted); }
.chip.ok { background: var(--green-bg); color: var(--green); }
.slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 12px 0; }
.slot { position: relative; aspect-ratio: 1; border-radius: 18px; border: 2px dashed #a9bcd6; background: var(--soft-2); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--navy); font-weight: 700; font-size: 13.5px; text-align: center; padding: 8px; overflow: hidden; }
.slot svg { width: 30px; height: 30px; }
.slot.has { border: 0; color: #fff; }
.slot.has img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.slot.has::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(31,58,104,.15), rgba(31,58,104,.75)); }
.slot.has span { position: absolute; bottom: 10px; inset-inline: 6px; z-index: 1; }
.slot .tick { position: absolute; top: 8px; inset-inline-end: 8px; z-index: 1; width: 26px; height: 26px; border-radius: 50%; background: var(--tick); color: #fff; display: grid; place-items: center; }
.slot .tick svg { width: 16px; height: 16px; }
.slots.two { grid-template-columns: repeat(2, 1fr); }
.slot-wrap { position: relative; min-width: 0; }
.slot-wrap .slot { width: 100%; }
.slots.two .slot { aspect-ratio: 1.45; }
.mini-gal { position: absolute; top: 6px; inset-inline-start: 6px; z-index: 2; width: 34px; height: 34px; border-radius: 50%; background: #fff; color: var(--navy); display: grid; place-items: center; box-shadow: 0 1px 4px rgba(0,0,0,.18); }
.mini-gal svg { width: 18px; height: 18px; }
.slot .tile-state { position: absolute; top: 46px; inset-inline-start: 8px; z-index: 1; font-style: normal; font-size: 12px; background: var(--soft); color: var(--blue); border-radius: 999px; padding: 2px 8px; animation: pulse 1.2s infinite; }
.screen h2 + .slots { margin-top: 4px; }
.gallery-btn { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; min-height: 56px; border-radius: 16px; background: var(--soft); color: var(--navy); font-weight: 700; font-size: 18px; margin-top: 4px; }
.progress { font-weight: 700; color: var(--navy-dark); }

/* cards scan: tile per card, read values fill the fields below it */
.card-tile .tile-btns { display: flex; gap: 6px; }
.card-tile .tile-btns .soft-btn { padding: 8px 10px; }
.card-tile .tile-btns svg { width: 20px; height: 20px; }
.card-tile > div:nth-child(2) { display: flex; flex-direction: column; min-width: 0; }
.card-thumb { width: 64px; height: 42px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.card-tile em.bad { color: var(--amber); }
.card-tile em.reading { color: var(--blue); animation: pulse 1.2s infinite; }
.card-tile { margin-top: 16px; }
.fields { display: flex; flex-wrap: wrap; gap: 0 12px; padding: 4px 4px 8px; border-inline-start: 3px solid var(--soft); margin: 4px 0 8px 6px; padding-inline-start: 12px; }
.fields > label { flex: 1 1 100%; margin: 10px 0 0; font-size: 14.5px; min-width: 0; }
.fields input, .fields select, .plate-row input, .plate-row select { width: 100%; min-width: 0; max-width: 100%; }
.plate-row label { min-width: 0; }
#app { overflow-x: hidden; }
.fields > label.half { flex: 1 1 calc(50% - 12px); }
.fields input, .fields select { min-height: 48px !important; font-size: 16px !important; margin-top: 4px !important; }
.fields label.low input, .fields label.low select { border-color: #e0a100; background: var(--amber-bg); }
.fields label small, .low-note { display: block; color: var(--amber); font-weight: 500; font-size: 13px; }
.fields .hint { flex: 1 1 100%; margin-top: 6px; font-size: 13px; }
.plate-row { display: flex; gap: 8px; flex: 1 1 100%; }
.plate-row label { margin: 10px 0 0; font-size: 14.5px; flex: 1; }
.plate-row label:first-child { flex: 1.6; }
.plate-frame { position: absolute; inset: 0; margin: auto; width: 86%; aspect-ratio: 3.2; border: 3px solid #f6cd1d; border-radius: 10px; box-shadow: 0 0 0 100vmax rgba(0,0,0,.45); }
.cam-bottom { flex-direction: column; gap: 10px; }
.cam-bottom p { margin: 0; font-size: 14px; opacity: .9; }
.tiles { display: grid; gap: 12px; margin: 14px 0; }
.card-tile { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px; background: #fff; border: 1.5px solid var(--line); border-radius: 18px; padding: 16px; color: var(--navy-dark); }
.card-tile > svg { width: 44px; height: 44px; padding: 8px; border-radius: 12px; background: var(--soft); color: var(--navy); }
.card-tile em { font-style: normal; font-weight: 700; color: var(--muted); }
.card-tile em.up { color: var(--green); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; background: #fff; border-radius: 18px; padding: 16px; border: 1.5px solid var(--line); margin: 0; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; font-weight: 700; }
.kv dd.low small { display: block; color: var(--amber); font-weight: 500; background: var(--amber-bg); border-radius: 8px; padding: 2px 8px; margin-top: 6px; }
.checklist { list-style: none; padding: 0; margin: 8px 0; }
.checklist li { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; background: #fff; border-radius: 14px; margin: 8px 0; border: 1.5px solid var(--line); }
.checklist li.ok { color: var(--green); } .checklist li.warn { color: var(--amber); background: var(--amber-bg); border-color: transparent; } .checklist li.bad { color: var(--red); background: var(--red-bg); border-color: transparent; }
.checklist svg { flex: none; margin-top: 2px; }

/* join (C-06) */
.join-chip { display: flex; align-items: center; gap: 8px; width: 100%; padding: 9px 14px; border-radius: 999px; background: var(--soft-2); border: 1.5px solid var(--line); color: var(--navy); font-size: 14px; font-weight: 700; margin-bottom: 8px; }
.join-chip.ok { background: var(--green-bg); color: var(--green); border-color: transparent; }
.join-chip.info { background: var(--soft); }
.tabs { display: flex; background: #e8eef6; border-radius: 16px; padding: 4px; margin: 12px 0; }
.tabs button { flex: 1; padding: 10px; border-radius: 12px; font-weight: 700; color: var(--muted); min-height: 46px; }
.tabs button.on { background: #fff; color: var(--navy-dark); box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.qr-box { text-align: center; background: #fff; border-radius: 20px; padding: 22px 16px 16px; border: 1.5px solid var(--line); }
.qr { width: 220px; height: 220px; margin: 0 auto; } .qr svg { width: 100%; height: 100%; }
.code { font-size: 32px; font-weight: 800; letter-spacing: .18em; margin: 12px 0 0; color: var(--navy-dark); }
.waiting { background: var(--soft); color: var(--navy); border-radius: 14px; padding: 12px; margin: 14px 0 0; animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .55; } }
.scan-box { background: #fff; border-radius: 20px; padding: 16px; border: 1.5px solid var(--line); }
.explain { color: var(--muted); font-size: 14.5px; padding-inline-start: 20px; }
.alt { display: flex; flex-direction: column; align-items: flex-start; margin-top: 6px; }
.alt .link { text-align: start; }
.alt .inline-form { width: 100%; }

/* stage B */
.pics { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.pic { display: flex; flex-direction: column; align-items: center; gap: 6px; background: #fff; border: 2px solid var(--line); border-radius: 18px; padding: 12px; font-weight: 700; font-size: 14px; min-height: 124px; color: var(--navy-dark); }
.pic.on { border-color: var(--btn); background: var(--soft); }
.dmg { display: flex; align-items: center; gap: 16px; }
.dmg .zone { cursor: pointer; }
.dmg .zone path { fill: rgba(47,80,137,.07); stroke: #9fb7d6; stroke-width: 1.5; stroke-dasharray: 4 3; }
.dmg .zone text { font-size: 10px; fill: var(--muted); font-weight: 700; pointer-events: none; }
.dmg .zone.on path { fill: rgba(192,57,43,.3); stroke: #c0392b; stroke-dasharray: none; }
.dmg .zone.on text { fill: var(--red); }
.dmg .zone:nth-of-type(3) text, .dmg .zone:nth-of-type(4) text { writing-mode: vertical-rl; }
.dmg span { font-weight: 700; color: var(--red); }
.options { display: grid; gap: 12px; margin: 14px 0; }
.option { text-align: start; padding: 18px; border-radius: 16px; background: #fff; border: 2px solid var(--line); font-weight: 700; font-size: 17px; min-height: 60px; color: var(--ink); }
.option.on { border-color: var(--btn); background: var(--soft); color: var(--navy-dark); }
.rv { background: #fff; border: 1.5px solid var(--line); border-radius: 18px; padding: 4px 16px 12px; margin: 12px 0; }
.rv h2 { margin-top: 12px; }
.party { display: flex; flex-direction: column; gap: 3px; padding: 10px 0; border-top: 1px solid var(--line); }
.party:first-of-type { border-top: 0; }
.party span { color: var(--muted); font-size: 15px; }
.party.mine b { color: var(--navy-dark); }
.thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.thumbs img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; }
.decl { background: var(--soft-2); border: 1.5px solid var(--line); border-radius: 18px; padding: 4px 16px; margin: 14px 0; }
.map { width: 100%; height: 200px; border: 0; border-radius: 16px; margin-top: 10px; }
.steps { list-style: none; padding: 0; counter-reset: s; }
.steps li { display: flex; gap: 12px; align-items: center; padding: 12px 14px; background: #fff; border-radius: 14px; margin: 8px 0; border: 1.5px solid var(--line); counter-increment: s; }
.steps li::before { content: counter(s); width: 32px; height: 32px; border-radius: 50%; background: var(--soft); color: var(--navy); display: grid; place-items: center; font-weight: 800; flex: none; }
.steps li.done { color: var(--green); } .steps li.done::before { content: "✓"; background: var(--green-bg); color: var(--green); }
.steps li svg { display: none; }
.timeline { list-style: none; padding: 0; border-inline-start: 3px solid var(--line); margin: 14px 8px; }
.timeline li { position: relative; padding: 4px 0 16px; padding-inline-start: 18px; }
.timeline li::before { content: ""; position: absolute; inset-inline-start: -10px; top: 8px; width: 17px; height: 17px; border-radius: 50%; background: var(--btn); border: 3px solid #fff; }
.timeline time { display: block; font-size: 13px; color: var(--muted); }
.status { font-weight: 800; color: var(--navy-dark); font-size: 18px; } .status.amber { color: var(--amber); }
.card.query { border-color: #f2d9a9; background: var(--amber-bg); }
.bring li { margin: 4px 0; }
details { background: #fff; border-radius: 16px; border: 1.5px solid var(--line); padding: 14px 16px; margin: 10px 0; }
summary { font-weight: 700; cursor: pointer; color: var(--navy-dark); }
.report { position: relative; }
.report .badge { position: absolute; inset-inline-end: 12px; top: 12px; }

/* C-12 report issued */
.badge-icon { width: 120px; height: 120px; border-radius: 50%; background: var(--green-bg); color: var(--tick); display: grid; place-items: center; margin: 18px auto 14px; }
.badge-icon svg { width: 62px; height: 62px; }
.report-no { color: var(--blue); font-weight: 800; font-size: 20px; margin: 0 !important; }
.pdf-card { flex-direction: row; gap: 16px; align-items: center; }
.vqr { width: 108px; height: 108px; flex: none; } .vqr svg { width: 100%; height: 100%; }
.pdf-card b { color: var(--ink); font-size: 17px; }
.pdf-btns { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.soft-btn { display: inline-flex; align-items: center; gap: 8px; background: var(--soft); color: var(--navy); border-radius: 14px; padding: 10px 14px; font-weight: 700; }
.next-step b { color: var(--navy); font-size: 17px; }
.next-step p { color: var(--ink); margin: 6px 0 0; }

/* camera overlay */
.cam { position: fixed; inset: 0; z-index: 50; background: #000; color: #fff; display: flex; flex-direction: column; }
.cam-top { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; padding-top: max(14px, env(safe-area-inset-top)); }
.cam-x { color: #fff; font-size: 22px; width: 44px; height: 44px; }
.cam-view { flex: 1; position: relative; overflow: hidden; }
.cam-view video { width: 100%; height: 100%; object-fit: cover; }
.card-frame { position: absolute; inset: 0; margin: auto; width: 90%; aspect-ratio: 1.586; border: 3px solid #fff; border-radius: 14px; box-shadow: 0 0 0 100vmax rgba(0,0,0,.45); }
.qr-frame { position: absolute; inset: 0; margin: auto; width: 64%; aspect-ratio: 1; border: 3px solid #fff; border-radius: 18px; box-shadow: 0 0 0 100vmax rgba(0,0,0,.4); }
.cam-bottom { padding: 18px; padding-bottom: max(18px, env(safe-area-inset-bottom)); display: flex; justify-content: center; text-align: center; min-height: 110px; align-items: center; }
.shutter { width: 74px; height: 74px; border-radius: 50%; background: #fff; border: 6px solid rgba(255,255,255,.4); background-clip: padding-box; }
.shutter:active { transform: scale(.94); }
