/* Apărăm: matte black, white text, red primary buttons (spec: #101010, #CF1F32, #FFFFFF). System fonts only: the
   app is anonymous and loads nothing from other sites. Touch targets of 48px and more. */
:root {
  --bg: #101010; --card: #181818; --line: #3a3a3a; --line-2: #555; --fg: #ffffff; --muted: #b9b9b9; --red: #cf1f32; --red-2: #a91828;
  --ok: #3fbf6a; --warn: #f0b429; --focus: #ffffff;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--fg); }
body { font: 17px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; -webkit-font-smoothing: antialiased; min-height: 100dvh; }
button, input, select, textarea { font: inherit; color: inherit; }
.ic { width: 24px; height: 24px; flex: none; }
.wrap { max-width: 520px; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column; padding: max(12px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left)); }

/* header */
.top { display: flex; align-items: center; gap: 10px; min-height: 48px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; letter-spacing: -.01em; color: var(--fg); text-decoration: none; background: none; border: 0; padding: 0; cursor: pointer; }
.brand img { width: 34px; height: 34px; }
.pill { margin-left: auto; border: 1.5px solid var(--fg); border-radius: 8px; padding: 2px 8px; font-size: 12px; font-weight: 800; letter-spacing: .06em; }
.back { display: inline-grid; place-items: center; width: 48px; height: 48px; margin: 4px 0 0 -12px; border: 0; background: none; border-radius: 12px; cursor: pointer; }

/* text */
h1 { font-size: clamp(32px, 9vw, 42px); line-height: 1.05; letter-spacing: -.02em; font-weight: 850; margin: 18px 0 14px; text-wrap: balance; }
h2 { font-size: 22px; font-weight: 800; margin: 18px 0 8px; }
.lead { font-size: 19px; color: var(--fg); margin: 0 0 18px; }
.muted { color: var(--muted); }
.fine { font-size: 14.5px; color: var(--muted); }
.center { text-align: center; }
b, strong { font-weight: 800; }

/* the stack of choices */
.stack { display: grid; gap: 12px; }
.opt { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 56px; padding: 12px 16px; border-radius: 14px; border: 2px solid var(--fg); background: transparent; text-align: left; font-weight: 700; font-size: 18px; cursor: pointer; }
.opt .t { flex: 1; min-width: 0; }
.opt .t small { display: block; font-weight: 500; font-size: 14.5px; color: var(--muted); }
.opt.big { min-height: 76px; }
.opt.red, .opt[aria-pressed="true"] { background: var(--red); border-color: var(--red); }
.opt[aria-pressed="true"] .t small { color: #ffe3e6; }
.radio { width: 24px; height: 24px; border-radius: 50%; border: 2px solid currentColor; flex: none; display: grid; place-items: center; }
.opt[aria-pressed="true"] .radio::after { content: ""; width: 12px; height: 12px; border-radius: 50%; background: #fff; }
.check { width: 24px; height: 24px; border-radius: 6px; border: 2px solid currentColor; flex: none; display: grid; place-items: center; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row > * { flex: 1 1 0; min-width: 0; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { min-height: 48px; padding: 8px 14px; border-radius: 12px; border: 2px solid var(--fg); background: transparent; font-weight: 700; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--red); border-color: var(--red); }

/* buttons */
.btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 60px; padding: 12px 18px; border-radius: 14px; border: 2px solid var(--red); background: var(--red); font-weight: 800; font-size: 20px; cursor: pointer; text-decoration: none; color: #fff; }
.btn.ghost { background: transparent; border-color: var(--fg); font-size: 18px; }
.btn.small { min-height: 48px; font-size: 16px; }
.btn:disabled { opacity: .45; cursor: default; }
.btn:active:not(:disabled), .opt:active, .chip:active { transform: scale(.985); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.foot { margin-top: auto; padding-top: 22px; display: grid; gap: 12px; position: sticky; bottom: 0; background: linear-gradient(transparent, var(--bg) 18px); padding-bottom: 4px; }

/* fields */
label.field { display: grid; gap: 8px; font-weight: 800; }
.input { width: 100%; min-height: 56px; padding: 12px 16px; border-radius: 14px; border: 2px solid var(--fg); background: transparent; font-size: 18px; }
textarea.input { min-height: 140px; resize: vertical; }
select.input { appearance: none; background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none' stroke='white' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center; padding-right: 44px; }
select.input option { background: #181818; }
.input::placeholder { color: #8a8a8a; }
.hint { display: flex; gap: 8px; align-items: flex-start; font-size: 15px; color: var(--muted); font-weight: 500; }
.hint .ic { width: 20px; height: 20px; margin-top: 1px; }

/* cards */
.card { border: 2px solid var(--line); border-radius: 16px; padding: 16px; background: var(--card); }
.card.warn { border-color: var(--warn); }
.card.red { border-color: var(--red); }
.card h3 { margin: 0 0 6px; font-size: 18px; }
.card ul { margin: 6px 0 0; padding-left: 20px; }
.card li { margin: 4px 0; }
.demo { border: 2px dashed var(--line-2); border-radius: 14px; padding: 12px 14px; font-size: 15px; color: var(--muted); }
.demo b { color: var(--fg); }

/* summary */
.sum { display: grid; border-top: 1px solid var(--line); }
.sum > div { display: flex; gap: 14px; align-items: flex-start; padding: 14px 2px; border-bottom: 1px solid var(--line); font-weight: 700; font-size: 17.5px; }
.sum > div span { min-width: 0; overflow-wrap: anywhere; }
.sum small { display: block; color: var(--muted); font-weight: 500; font-size: 14px; }

/* the code */
.done-ic { width: 96px; height: 96px; margin: 28px auto 8px; color: var(--red); }
.done-ic .ic { width: 96px; height: 96px; stroke-width: 1.6; }
.code { font: 800 clamp(30px, 10vw, 40px)/1 ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: .06em; text-align: center; padding: 22px 10px; border: 2px solid var(--fg); border-radius: 16px; user-select: all; }

/* status */
.status { display: flex; gap: 14px; align-items: center; }
.status .ic { width: 40px; height: 40px; color: var(--ok); }
.status b { font-size: 24px; }
.thread { display: grid; gap: 10px; }
.msg { padding: 12px 14px; border-radius: 14px; max-width: 88%; }
.msg.op { background: #262626; border: 1px solid var(--line-2); }
.msg.rep { background: var(--red); margin-left: auto; }
.msg small { display: block; font-size: 12.5px; opacity: .8; margin-top: 4px; }

/* map */
.map { height: 46dvh; min-height: 260px; border-radius: 16px; overflow: hidden; border: 2px solid var(--line-2); background: #222; }
.leaflet-container { background: #1b1b1b; font: inherit; }
/* OpenStreetMap tiles, darkened to the app (production: a tile service under contract) */
.leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.85) contrast(.9) saturate(.6); }
.leaflet-control-attribution { font-size: 10px; }

/* sheet (the 112 demo, messages) */
.sheet-bg { position: fixed; inset: 0; background: rgba(0,0,0,.7); display: grid; align-items: end; z-index: 1000; }
.sheet { background: #171717; border-top: 2px solid var(--line-2); border-radius: 22px 22px 0 0; padding: 22px max(18px, env(safe-area-inset-left)) max(22px, env(safe-area-inset-bottom)); max-width: 520px; width: 100%; margin: 0 auto; display: grid; gap: 14px; }
.sheet h2 { margin: 0; }
.toast { position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); transform: translateX(-50%); background: #fff; color: #111; font-weight: 700; padding: 12px 18px; border-radius: 12px; z-index: 2000; max-width: calc(100% - 32px); box-shadow: 0 8px 30px rgba(0,0,0,.5); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.progress { height: 4px; background: var(--line); border-radius: 4px; overflow: hidden; margin-top: 6px; }
.progress i { display: block; height: 100%; background: var(--red); }

h1:focus { outline: none; } /* focused on each screen so screen readers announce it; no ring needed */

/* quick exit (top right), a text button inside a hint */
.exit { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 4px 10px; margin-left: 8px; border-radius: 10px; border: 1.5px solid var(--line-2); background: transparent; font-weight: 700; font-size: 14px; cursor: pointer; }
.exit .ic { width: 18px; height: 18px; }
.link { background: none; border: 0; padding: 0; color: var(--fg); font-weight: 800; text-decoration: underline; cursor: pointer; font-size: inherit; }
[hidden] { display: none !important; }
