/* מסוף הסיירת — עמודה אחת, אגודל אחד. כל מה שחשוב בהישג יד בתחתית המסך. */
body.terminal { background: var(--ground); }
.shell { max-width: 560px; margin: 0 auto; min-height: 100%; display: flex; flex-direction: column; background: var(--ground); position: relative; }
@media (min-width: 700px) { .shell { box-shadow: 0 0 0 1px var(--line); } }

/* ---------- כניסה ---------- */
.login { min-height: 100%; display: flex; flex-direction: column; }
.login-top { background: var(--bar); color: var(--on-bar); padding-block: 40px 34px; padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); text-align: center; display: flex; flex-direction: column; gap: 6px; align-items: center; }
.brand-mark { width: 56px; height: 56px; }
.brand-name { font-family: var(--font-display); font-weight: 900; font-size: 38px; line-height: 1.05; }
.brand-sub { color: var(--on-bar-muted); font-size: 14px; }
.login-body { padding-block: 22px 32px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); display: flex; flex-direction: column; gap: 18px; }
.step-title { text-align: center; font-size: 17px; font-weight: 800; }
.group-pick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.group-btn { min-height: 64px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface); text-align: right; padding: 10px 14px; display: flex; flex-direction: column; gap: 2px; }
.group-btn b { font-size: 16px; }
.group-btn span { font-size: 12px; color: var(--muted); }
.group-btn[aria-pressed="true"] { border: 2px solid var(--ink); padding: 9px 13px; }
.pin-dots { display: flex; justify-content: center; gap: 14px; direction: ltr; }
.pin-dots i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--ink); }
.pin-dots i.on { background: var(--ink); }
.keypad { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; direction: ltr; }
.key { min-height: 58px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface); font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.key:active { background: var(--surface-2); }
.key-muted { background: transparent; font-size: 15px; color: var(--muted); }
.err { color: var(--red); text-align: center; font-weight: 600; min-height: 22px; }
.demo-note { text-align: center; font-size: 13px; color: var(--muted); }

/* ---------- כותרת ---------- */
.top { background: var(--bar); color: var(--on-bar); padding-block: 14px 18px; padding-left: max(18px, env(safe-area-inset-left, 0px)); padding-right: max(18px, env(safe-area-inset-right, 0px)); display: flex; flex-direction: column; gap: 12px; position: relative; }
.top-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; color: var(--on-bar-muted); }
.top-row b { color: var(--on-bar); font-weight: 700; }
.chip-dark { background: var(--bar-2); color: var(--on-bar); padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.chip-dark.warn { background: #6B3A0C; color: #FFE2B0; }
.hero { text-align: center; display: flex; flex-direction: column; gap: 0; }
.hero small { color: var(--on-bar-muted); font-size: 13px; }
.hero .money { font-family: var(--font-display); font-weight: 900; font-size: 50px; line-height: 1.1; letter-spacing: -.5px; }
.hero .sub { color: var(--coin); font-size: 13px; font-weight: 600; }
.stats3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); text-align: center; font-size: 12px; color: var(--on-bar-muted); }
.stats3 b { display: block; color: var(--on-bar); font-size: 17px; font-variant-numeric: tabular-nums; }
.sync { position: absolute; inset-inline-start: 18px; top: 14px; }

/* ---------- תוכן ---------- */
.main { flex: 1; padding-block: 16px 110px; padding-left: max(14px, env(safe-area-inset-left, 0px)); padding-right: max(14px, env(safe-area-inset-right, 0px)); display: flex; flex-direction: column; gap: 14px; }
.sec-title { text-align: center; font-size: 13px; font-weight: 700; color: var(--muted); letter-spacing: .02em; }
.coach { display: flex; gap: 10px; align-items: flex-start; background: var(--surface); border-radius: var(--r-md); padding: 12px 14px; font-size: 14px; border: 1px solid var(--line); }
.coach svg { flex: none; margin-top: 2px; color: var(--gold-text); }
.notice { background: var(--gold-soft); color: var(--ink); border-radius: var(--r-md); padding: 12px 14px; font-size: 14px; display: flex; flex-direction: column; gap: 4px; }
.notice b { color: var(--gold-text); }

.next { background: var(--surface); border-radius: var(--r-lg); padding: 16px; display: flex; flex-direction: column; gap: 12px; box-shadow: var(--shadow); }
.next-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.next-addr { font-size: 22px; font-weight: 800; line-height: 1.25; }
.next-meta { color: var(--muted); font-size: 14px; }
.history { background: var(--surface-2); border-radius: var(--r-sm); padding: 9px 12px; font-size: 13px; color: var(--muted); display: flex; flex-direction: column; gap: 2px; }
.history b { color: var(--ink); }
.row2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.big-go { min-height: 56px; font-size: 17px; }

.stops { display: flex; flex-direction: column; gap: 8px; }
.stop { display: flex; align-items: center; gap: 12px; background: var(--surface); border-radius: var(--r-md); padding: 10px 12px; border: 1px solid transparent; width: 100%; text-align: right; }
.stop .n { width: 30px; height: 30px; flex: none; border-radius: 50%; background: var(--surface-2); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stop .t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.stop .t b { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stop .t span { font-size: 12px; color: var(--muted); }
.stop .v { font-size: 13px; font-weight: 800; color: var(--gold-text); letter-spacing: 1px; }
.stop.muted { opacity: .7; }
details.fold { background: transparent; }
details.fold summary { list-style: none; cursor: pointer; text-align: center; font-size: 13px; font-weight: 700; color: var(--muted); padding: 10px; min-height: 44px; }
details.fold summary::-webkit-details-marker { display: none; }
details.fold[open] summary { color: var(--ink); }

.empty { text-align: center; padding: 30px 16px; color: var(--muted); display: flex; flex-direction: column; gap: 8px; align-items: center; }
.empty .display { font-size: 28px; color: var(--ink); }

/* ---------- סרגל לשוניות ---------- */
.tabs { position: fixed; bottom: 0; inset-inline: 0; margin: 0 auto; max-width: 560px; background: var(--surface); border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding-bottom: env(safe-area-inset-bottom, 0px); padding-left: env(safe-area-inset-left, 0px); padding-right: env(safe-area-inset-right, 0px); z-index: 20; }
.tab { min-height: 62px; border: 0; background: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 12px; font-weight: 600; color: var(--muted); position: relative; }
.tab svg { width: 22px; height: 22px; }
.tab[aria-current="page"] { color: var(--ink); font-weight: 800; }
.tab[aria-current="page"]::before { content: ""; position: absolute; top: 0; width: 28px; height: 3px; border-radius: 0 0 3px 3px; background: var(--coin); }
.badge { position: absolute; top: 8px; inset-inline-end: calc(50% - 22px); background: var(--red); color: #fff; font-size: 11px; font-weight: 800; min-width: 18px; height: 18px; border-radius: 9px; display: flex; align-items: center; justify-content: center; padding: 0 5px; }

/* ---------- הודעות ---------- */
.msg { background: var(--surface); border-radius: var(--r-md); padding: 14px; display: flex; flex-direction: column; gap: 8px; border: 1px solid var(--line); }
.msg.unread { border: 2px solid var(--ink); padding: 13px; }
.msg.urgent.unread { border-color: var(--red); }
.msg-head { display: flex; justify-content: space-between; gap: 8px; align-items: center; font-size: 12px; color: var(--muted); }
.msg p { margin: 0; font-size: 16px; line-height: 1.55; }
.alert-over { position: fixed; inset: 0; background: rgba(9, 15, 21, .72); z-index: 60; display: flex; align-items: flex-end; justify-content: center; padding: 16px; padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
.alert-card { background: var(--surface); border-radius: var(--r-lg); padding: 22px 18px; max-width: 520px; width: 100%; display: flex; flex-direction: column; gap: 14px; text-align: center; animation: toastIn .3s ease; }
.alert-card h2 { font-family: var(--font-display); font-size: 26px; }
.alert-card p { margin: 0; font-size: 17px; line-height: 1.55; }

/* ---------- קופה ---------- */
.till { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.till div { background: var(--surface); border-radius: var(--r-md); padding: 12px 8px; text-align: center; display: flex; flex-direction: column; gap: 2px; }
.till span { font-size: 12px; color: var(--muted); }
.till b { font-size: 20px; font-variant-numeric: tabular-nums; }
.ledger { background: var(--surface); border-radius: var(--r-md); }
.led { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-top: 1px solid var(--line); }
.led:first-child { border-top: 0; }
.led .t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.led .t b { font-size: 14px; font-weight: 600; }
.led .t span { font-size: 12px; color: var(--muted); }
.led .amt { font-weight: 800; font-variant-numeric: tabular-nums; }
.led.void .amt { text-decoration: line-through; color: var(--muted); }

/* ---------- אתגרים ---------- */
.ladder { background: var(--surface); border-radius: var(--r-lg); padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.rung { display: flex; align-items: center; gap: 12px; }
.coin { width: 34px; height: 34px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; border: 2px solid var(--line); color: var(--muted); background: var(--surface); }
.rung.got .coin { background: var(--coin); border-color: var(--coin); color: #1B1405; }
.rung .t { flex: 1; display: flex; flex-direction: column; }
.rung .t span { font-size: 12px; color: var(--muted); }
.board { background: var(--surface); border-radius: var(--r-lg); overflow: hidden; }
.brow { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-top: 1px solid var(--line); }
.brow:first-child { border-top: 0; }
.brow.me { background: var(--gold-soft); }
.brow .pos { width: 24px; text-align: center; font-weight: 800; color: var(--muted); }
.brow .nm { flex: 1; font-weight: 600; }
.brow .nm span { display: block; font-size: 12px; color: var(--muted); font-weight: 400; }
.challenge { background: var(--bar); color: var(--on-bar); border-radius: var(--r-lg); padding: 16px; display: flex; flex-direction: column; gap: 8px; text-align: center; }
.challenge p { margin: 0; font-size: 16px; line-height: 1.5; }
.challenge .clock { color: var(--coin); font-weight: 800; font-variant-numeric: tabular-nums; }
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.kpis div { background: var(--surface); border-radius: var(--r-md); padding: 12px; text-align: center; }
.kpis span { display: block; font-size: 12px; color: var(--muted); }
.kpis b { font-size: 20px; font-variant-numeric: tabular-nums; }

/* ---------- גיליון קבלת תרומה ---------- */
.sheet { position: fixed; inset: 0; z-index: 50; background: var(--ground); display: flex; flex-direction: column; overflow-y: auto; }
.sheet.anim { animation: sheetIn .22s ease; }
@keyframes sheetIn { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet-in { max-width: 560px; width: 100%; margin: 0 auto; flex: 1; display: flex; flex-direction: column; }
.sheet-top { background: var(--bar); color: var(--on-bar); padding-block: 12px 16px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); display: flex; flex-direction: column; gap: 4px; text-align: center; }
.sheet-top .bar { display: flex; justify-content: space-between; align-items: center; }
.link-light { background: none; border: 0; color: var(--on-bar-muted); font-size: 14px; min-height: 40px; padding: 0 4px; }
.sheet-top h2 { font-size: 21px; font-weight: 800; }
.sheet-top .fam { color: var(--coin); font-size: 13px; font-weight: 600; }
.sheet-body { padding-block: 14px 24px; padding-left: max(14px, env(safe-area-inset-left, 0px)); padding-right: max(14px, env(safe-area-inset-right, 0px)); display: flex; flex-direction: column; gap: 12px; flex: 1; }
.seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; background: var(--surface-2); border: 1px solid var(--line); padding: 4px; border-radius: 14px; }
.seg button { min-height: 46px; border: 0; border-radius: 11px; background: transparent; font-weight: 700; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--surface); }
.amount { background: var(--surface); border-radius: var(--r-lg); padding: 14px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.amount > span:first-child { font-size: 13px; color: var(--muted); }
.amount .money { font-family: var(--font-display); font-weight: 900; font-size: 56px; line-height: 1.1; }
.presets { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.preset { min-height: 50px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface); font-weight: 800; font-size: 16px; font-variant-numeric: tabular-nums; position: relative; }
.preset[aria-pressed="true"] { border: 2px solid var(--ink); }
.preset small { position: absolute; top: -8px; inset-inline: 0; margin: 0 auto; width: max-content; background: var(--gold-soft); color: var(--gold-text); font-size: 10px; font-weight: 800; padding: 0 6px; border-radius: 6px; }
.opts { background: var(--surface); border-radius: var(--r-md); display: flex; flex-direction: column; }
.opt { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; min-height: 52px; border-top: 1px solid var(--line); font-size: 14px; }
.opt:first-child { border-top: 0; }
.opt select, .opt input[type="text"], .opt input[type="tel"] { min-height: 40px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface-2); padding: 0 10px; max-width: 58%; }
.opt input[type="checkbox"] { width: 24px; height: 24px; accent-color: var(--ink); }
.outcomes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.outcomes .btn { font-size: 12px; padding: 0 4px; min-height: 48px; color: var(--muted); background: transparent; }
.cta { min-height: 60px; font-size: 18px; border-radius: 14px; }

.proc { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; text-align: center; padding: 40px 20px; }
.proc .display { font-size: 30px; }
.tapcard { width: 132px; height: 90px; border-radius: 12px; border: 3px solid var(--ink); position: relative; animation: tap 1.4s ease-in-out infinite; }
.tapcard::after { content: ""; position: absolute; top: 18px; inset-inline-start: 14px; width: 26px; height: 20px; border-radius: 4px; background: var(--coin); }
@keyframes tap { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(14px); } }
.okmark { width: 92px; height: 92px; border-radius: 50%; background: var(--green); display: flex; align-items: center; justify-content: center; animation: pop .35s cubic-bezier(.2, 1.4, .4, 1); }
.okmark svg { width: 48px; height: 48px; color: #fff; }
@keyframes pop { from { transform: scale(.4); } to { transform: none; } }

/* חגיגת אבן דרך */
.celebrate { position: fixed; inset: 0; z-index: 70; display: flex; align-items: center; justify-content: center; background: rgba(9, 15, 21, .78); padding: 20px; }
.celebrate .card { background: var(--bar); color: var(--on-bar); border-radius: 22px; padding: 30px 22px; text-align: center; max-width: 420px; width: 100%; display: flex; flex-direction: column; gap: 10px; align-items: center; position: relative; overflow: hidden; }
.celebrate .display { font-size: 34px; color: var(--coin); }
.celebrate canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

/* ---------- ניווט פנימי ---------- */
.navv { position: fixed; inset: 0; z-index: 45; background: var(--ground); display: grid; grid-template-rows: auto 1fr auto; max-width: 900px; margin: 0 auto; }
.nav-top { background: var(--bar); color: var(--on-bar); padding-block: 8px 12px; padding-left: max(14px, env(safe-area-inset-left, 0px)); padding-right: max(14px, env(safe-area-inset-right, 0px)); padding-top: calc(8px + env(safe-area-inset-top, 0px)); display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; position: relative; }
.nav-top .link-light { position: absolute; inset-inline-start: 10px; top: calc(6px + env(safe-area-inset-top, 0px)); }
.nav-to { display: flex; flex-direction: column; padding-top: 30px; }
.nav-to b { font-size: 19px; }
.nav-to span { font-size: 13px; color: var(--coin); }
.nav-map { position: relative; min-height: 220px; overflow: hidden; }
.nav-map .maplibregl-ctrl-attrib { font-size: 10px; }
.nav-panel { background: var(--surface); border-top: 1px solid var(--line); border-radius: 18px 18px 0 0; margin-top: -14px; position: relative; z-index: 2; padding-block: 14px calc(14px + env(safe-area-inset-bottom, 0px)); padding-left: max(14px, env(safe-area-inset-left, 0px)); padding-right: max(14px, env(safe-area-inset-right, 0px)); display: flex; flex-direction: column; gap: 10px; max-height: 58vh; overflow-y: auto; box-shadow: 0 -8px 24px -18px rgba(9,15,21,.6); }
.nav-instr { display: flex; align-items: center; gap: 14px; }
.nav-instr.arrived .nav-ico { background: var(--green); }
.nav-ico { width: 58px; height: 58px; flex: none; border-radius: 16px; background: var(--ink); color: var(--surface); display: flex; align-items: center; justify-content: center; transition: transform .4s ease; }
.nav-ico svg { width: 34px; height: 34px; }
.nav-txt { display: flex; flex-direction: column; min-width: 0; }
.nav-txt b { font-size: 20px; font-weight: 800; line-height: 1.25; }
.nav-txt span { font-size: 14px; color: var(--muted); }
.nav-meta { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 18px; font-size: 14px; color: var(--muted); }
.nav-meta b { color: var(--ink); font-variant-numeric: tabular-nums; }
.nav-tools { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.nav-note { margin: 0; text-align: center; font-size: 12.5px; color: var(--muted); }
.nav-steps { margin: 0; padding: 0 22px 0 0; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.nav-steps li { display: flex; justify-content: space-between; gap: 10px; }
.nav-steps li span { color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
@media (min-width: 900px) { .navv { box-shadow: 0 0 0 1px var(--line); } }

/* חלונות קטנים */
.modal-card { text-align: right; max-height: calc(100vh - 32px); overflow-y: auto; }
.modal-card h2 { text-align: center; font-size: 22px; }
.modal-old { margin: 0; font-size: 13px; color: var(--muted); background: var(--surface-2); border-radius: var(--r-sm); padding: 8px 10px; white-space: pre-line; max-height: 120px; overflow-y: auto; }
.photo-prev { width: 100%; max-height: 260px; object-fit: contain; border-radius: var(--r-md); background: var(--surface-2); }
.photo-pick { cursor: pointer; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.chip { min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-weight: 600; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.outcomes-2 { display: flex; margin-top: -4px; }
.outcomes-2 .btn { flex: 1 1 0; }
#modal .alert-over { z-index: 65; align-items: center; }
.modal-card.still { animation: none; }
