/* Rasidum — orange & black, light & dark */
:root { --or: #F57C00; --or2: #FFB74D; --or-soft: #FFF3E0; --red: #E53935; --green: #2E7D32; --green-soft: #E8F5E9;
  --yellow: #F9A825; --r: 18px; --shadow: 0 1px 2px rgba(0,0,0,.05), 0 4px 14px rgba(0,0,0,.06); }
body.light { --bg: #F4F4F2; --panel: #F4F4F2; --card: #FFFFFF; --tx: #141414; --mut: #6b6b6b; --line: #E8E6E2; --head: #111; --chip: #F1EFEB; }
body.dark  { --bg: #0c0c0c; --panel: #121212; --card: #1c1c1c; --tx: #f3f3f3; --mut: #9b9b9b; --line: #2a2a2a; --head: #000; --chip: #262626; --or-soft: #2b1c0b; --green-soft: #12261a; }
* { box-sizing: border-box; }
html, body, #app { margin: 0; height: 100%; }
body { font-family: Vazirmatn, system-ui, sans-serif; background: var(--bg); color: var(--tx); font-size: 14.5px; line-height: 1.55; -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
h2 { margin: 0; font-size: 21px; font-weight: 800; }
h3 { margin: 0; font-size: 17px; }
.muted { color: var(--mut); }
.small { font-size: 13px; }
.center { text-align: center; }
.ltr { direction: ltr; unicode-bidi: embed; }

/* Icons */
.ico { width: 18px; height: 18px; flex: none; vertical-align: -3px; }
.ico.big { width: 28px; height: 28px; }
.ico.huge { width: 54px; height: 54px; color: var(--or); opacity: .8; }
[dir=rtl] .ico.flip { transform: scaleX(-1); }

/* Buttons & fields */
.btn { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 0; border-radius: 14px;
  padding: 10px 16px; background: var(--or); color: #111; font-weight: 700; transition: transform .12s, filter .12s, background .2s; }
.btn:hover { filter: brightness(1.05); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .6; }
.btn.full { width: 100%; margin-top: 16px; }
.btn.big { padding: 14px 18px; font-size: 16px; border-radius: 16px; }
.btn.ghost { background: var(--card); border: 1px solid var(--line); color: var(--tx); font-weight: 500; }
.btn.danger { background: transparent; border: 1px solid var(--red); color: var(--red); font-weight: 500; }
.btn.sm { padding: 8px 12px; font-size: 13.5px; border-radius: 12px; }
.link { background: none; border: 0; color: var(--or); padding: 14px 0 0; width: 100%; font-weight: 600; }
.err { color: var(--red); font-size: 13px; min-height: 18px; margin-top: 8px; }
label { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--mut); margin: 14px 0 6px; }
input[type=text], input[type=password], input[type=date], select, textarea {
  width: 100%; border: 1.5px solid var(--line); background: var(--card); border-radius: 14px; padding: 11px 13px; outline: none; transition: border-color .2s; }
input:focus, select:focus, textarea:focus { border-color: var(--or); }
textarea { min-height: 110px; direction: ltr; text-align: left; font-family: ui-monospace, monospace; font-size: 13px; }
input[type=range] { width: 100%; accent-color: var(--or); }
.field { position: relative; }
.field .ico { position: absolute; top: 50%; transform: translateY(-50%); inset-inline-start: 13px; color: var(--mut); }
.field input { padding-inline-start: 40px; }
.seg, .langs { display: flex; gap: 6px; background: var(--chip); padding: 4px; border-radius: 14px; }
.seg button, .langs button { flex: 1; border: 0; background: transparent; border-radius: 10px; padding: 8px 4px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; color: var(--mut); transition: background .2s; }
.seg button.on, .langs button.on { background: var(--or); color: #111; font-weight: 700; }
.langs.dark { background: rgba(255,255,255,.08); }
.langs.dark button { color: #ddd; }
.langs.dark button.on { color: #111; }

/* Auth */
.auth { min-height: 100%; display: flex; flex-direction: column; align-items: center; background: var(--head); padding: 20px 16px 32px; }
.auth .hero { color: #fff; width: 100%; max-width: 420px; text-align: center; padding: 6px 4px 22px; }
.auth .hero .langs { max-width: 280px; margin: 0 auto 22px; }
.biglogo { width: 76px; height: 76px; filter: drop-shadow(0 6px 20px rgba(245,124,0,.45)); animation: pop .6s ease-out; }
.auth h1 { margin: 8px 0 2px; font-size: 34px; font-weight: 800; }
.auth .hero p { margin: 0 0 16px; color: #cfcfcf; }
.feats { list-style: none; padding: 0; margin: 0 auto; text-align: start; display: grid; gap: 10px; max-width: 360px; }
.feats li { display: flex; gap: 10px; align-items: center; color: #e8e8e8; font-size: 14px; }
.feats .ico { color: var(--or); width: 22px; height: 22px; background: rgba(245,124,0,.14); padding: 6px; border-radius: 10px; box-sizing: content-box; }
.auth .box { width: 100%; max-width: 420px; background: var(--card); border-radius: 24px; padding: 8px 22px 22px; box-shadow: 0 10px 40px rgba(0,0,0,.4); }
@keyframes pop { from { transform: scale(.7); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* Shell */
.shell { display: grid; grid-template-rows: 58px 1fr; height: 100%; }
header { background: var(--head); color: #fff; display: flex; align-items: center; gap: 8px; padding: 0 10px 0 14px; z-index: 1001; }
header img { width: 34px; height: 34px; }
header .title { font-weight: 800; font-size: 20px; flex: 1; }
.iconbtn { position: relative; background: none; border: 0; color: inherit; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; transition: background .2s; }
.iconbtn:hover { background: rgba(127,127,127,.15); }
.iconbtn .ico { width: 22px; height: 22px; }
.iconbtn.sm { width: 32px; height: 32px; }
.iconbtn.sm .ico { width: 16px; height: 16px; }
.badge { position: absolute; top: 4px; inset-inline-end: 3px; background: var(--red); color: #fff; font-size: 11px; min-width: 18px; height: 18px; border-radius: 9px; display: grid; place-items: center; padding: 0 4px; font-weight: 700; }
.body { display: grid; grid-template-columns: 400px 1fr; min-height: 0; }
.panel { background: var(--panel); border-inline-end: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.grab { display: none; }
.tabs { display: flex; padding: 10px 12px 6px; gap: 6px; }
.tabs button { flex: 1; border: 0; background: none; padding: 9px 0; border-radius: 14px; color: var(--mut); position: relative; display: flex; align-items: center; justify-content: center; gap: 6px; transition: background .2s, color .2s; }
.tabs button.on { background: var(--card); color: var(--tx); font-weight: 700; box-shadow: var(--shadow); }
.tabs button.on .ico { color: var(--or); }
.tabs .badge { top: 0; }
.scroll { overflow-y: auto; padding: 8px 14px 24px; flex: 1; }
.greet { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 6px 2px 14px; }
.greet .muted { font-size: 13px; }

/* Cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; margin-bottom: 10px; box-shadow: var(--shadow); animation: rise .3s ease-out both; }
.list .card:nth-child(2) { animation-delay: .04s; } .list .card:nth-child(3) { animation-delay: .08s; } .list .card:nth-child(4) { animation-delay: .12s; }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
.member { display: flex; align-items: center; gap: 12px; }
.card.member { cursor: pointer; transition: border-color .2s, transform .15s; }
.card.member:hover { border-color: var(--or); }
.card.member:active { transform: scale(.99); }
.member .info { flex: 1; min-width: 0; }
.nm { font-weight: 700; font-size: 16px; }
.nm.big { font-size: 21px; }
.sub { color: var(--mut); font-size: 13px; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.sub .ico { width: 15px; height: 15px; }
.sub .dot { margin: 0 2px; }
.chev { color: var(--mut); }
.chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; padding: 3px 9px; border-radius: 99px; background: var(--chip); color: var(--tx); }
.chip .ico { width: 13px; height: 13px; }
.chip.warn { background: #FFE0B2; color: #7a3d00; }
.chip.bad { background: #FFCDD2; color: #8a1010; }
.chip.live { background: var(--red); color: #fff; animation: blink 1.6s infinite; }
@keyframes blink { 50% { opacity: .65; } }

/* Avatars with status ring */
.avatar { --c: var(--or); position: relative; width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--c); color: #fff; font-weight: 800; font-size: 20px; box-shadow: 0 0 0 3px var(--card), 0 0 0 5.5px var(--ring, var(--line)); }
.avatar.lg { width: 64px; height: 64px; font-size: 26px; }
.ring-fresh { --ring: #43A047; } .ring-aging { --ring: var(--or2); } .ring-old, .ring-none { --ring: var(--line); }
.ring-sos { --ring: var(--red); animation: sosring 1s infinite; }
@keyframes sosring { 50% { box-shadow: 0 0 0 3px var(--card), 0 0 0 9px rgba(229,57,53,.4); } }
.mbadge { position: absolute; bottom: -4px; inset-inline-end: -4px; width: 22px; height: 22px; border-radius: 50%; background: var(--card); color: var(--tx); display: grid; place-items: center; box-shadow: var(--shadow); }
.mbadge .ico { width: 14px; height: 14px; }

/* Tip of the day */
.tip { display: flex; gap: 12px; align-items: flex-start; background: linear-gradient(135deg, #1a1a1a, #2b2b2b); color: #fff; border-radius: var(--r); padding: 14px; margin-bottom: 14px; animation: rise .35s ease-out both; }
.tipicon { width: 40px; height: 40px; border-radius: 12px; background: var(--or); color: #111; display: grid; place-items: center; flex: none; }
.tipicon .ico { width: 22px; height: 22px; }
.tipbody { flex: 1; }
.tiphead { font-size: 12px; color: var(--or2); font-weight: 700; letter-spacing: .3px; }
.tiptext { font-size: 14.5px; margin: 2px 0 6px; }
.tiptext.fade { animation: rise .3s ease-out; }
.tipnext { background: none; border: 0; color: var(--or2); padding: 0; font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 2px; }
.tip .iconbtn { color: #aaa; }

/* Empty states */
.empty-state { text-align: center; padding: 18px 10px 8px; }
.empty-state .illu { width: 200px; color: var(--tx); animation: pop .5s ease-out; }
.empty-state h3 { margin: 6px 0 2px; }
.empty-state.small { padding: 30px 16px; }
.steps { list-style: none; padding: 0; margin: 14px auto 18px; display: grid; gap: 8px; max-width: 320px; text-align: start; }
.steps li { display: flex; gap: 10px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 9px 12px; }
.steps b { width: 26px; height: 26px; border-radius: 50%; background: var(--or); color: #111; display: grid; place-items: center; flex: none; }
.footer-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }

/* Detail */
.hero-card { margin-top: 10px; }
.hero-card .muted.small { margin-top: 10px; display: flex; gap: 4px; align-items: center; }
.livebtn { background: #111; color: #fff; }
body.dark .livebtn { background: #fff; color: #111; }
.livebtn.on { background: var(--red) !important; color: #fff !important; }
.livestat { display: flex; gap: 8px; align-items: center; justify-content: center; font-size: 13px; color: var(--mut); margin-top: 8px; min-height: 18px; text-align: center; flex-wrap: wrap; }
.livestat .ico { width: 15px; height: 15px; }
.pulse { width: 10px; height: 10px; border-radius: 50%; background: var(--or); display: inline-block; position: relative; flex: none; }
.pulse::after { content: ''; position: absolute; inset: -5px; border-radius: 50%; border: 2px solid currentColor; color: var(--or); animation: ping 1.4s infinite; }
.pulse.red { background: var(--red); } .pulse.red::after { color: var(--red); }
@keyframes ping { from { transform: scale(.6); opacity: 1; } to { transform: scale(1.6); opacity: 0; } }
.spinner { width: 14px; height: 14px; border: 2px solid var(--line); border-top-color: var(--or); border-radius: 50%; animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.actions3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 4px; }
.action { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 6px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  color: var(--tx); text-decoration: none; font-size: 13px; font-weight: 600; box-shadow: var(--shadow); transition: transform .12s, border-color .2s; }
.action .ico { width: 26px; height: 26px; color: var(--or); background: var(--or-soft); padding: 9px; border-radius: 14px; box-sizing: content-box; }
.action:hover { border-color: var(--or); }
.action:active { transform: scale(.96); }
.action.disabled { opacity: .45; pointer-events: none; }
.shake .ico { animation: shake .6s; }
@keyframes shake { 20%, 60% { transform: rotate(-14deg); } 40%, 80% { transform: rotate(14deg); } }
#ringstat { margin: 4px 0 10px; min-height: 16px; }
.cardhead { display: flex; align-items: center; gap: 8px; }
.cardhead b { flex: 1; }
.cardhead .ico { color: var(--or); }
.cardhead input { width: auto; padding: 6px 10px; font-size: 13px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.stat { background: var(--chip); border-radius: 14px; padding: 10px 8px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.stat .ico { color: var(--or); }
.stat b { font-size: 17px; }
.stat span { font-size: 11.5px; color: var(--mut); }
.stats > .muted { grid-column: 1 / -1; text-align: center; padding: 6px; }
#replaywrap { margin-top: 12px; }
#replaytxt { display: flex; gap: 6px; align-items: center; justify-content: center; }
.minor { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.paircard { text-align: center; }
.paircard .ico.big { color: var(--or); display: block; margin: 0 auto 6px; }
.code { font-size: 40px; font-weight: 800; letter-spacing: 8px; text-align: center; direction: ltr; color: var(--or); margin: 6px 0 12px;
  background: var(--or-soft); border-radius: 16px; padding: 6px 0; }

/* Places & alerts */
.picon, .aicon { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; flex: none; }
.picon .ico, .aicon .ico { width: 22px; height: 22px; }
.picon.home { background: var(--or-soft); color: var(--or); }
.picon.school { background: #E3F2FD; color: #1565C0; }
.picon.other { background: #F3E5F5; color: #7B1FA2; }
body.dark .picon.school { background: #0d2238; } body.dark .picon.other { background: #26132b; }
.card.form .muted { display: flex; gap: 6px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.card.alert { display: flex; gap: 12px; align-items: center; }
.card.alert.seen { opacity: .78; }
.card.alert.sos { border-color: var(--red); }
.aicon.good { background: var(--green-soft); color: var(--green); }
.aicon.mid { background: var(--or-soft); color: var(--or); }
.aicon.bad { background: var(--red); color: #fff; }
.aicon.warn { background: #FFF8E1; color: var(--yellow); }
.aicon.grey { background: var(--chip); color: var(--mut); }

/* Map */
.mapwrap { position: relative; min-height: 0; }
#map { height: 100%; width: 100%; z-index: 1; background: #1b1b1b; }
body.dark .streets-tiles { filter: invert(1) hue-rotate(180deg) brightness(.9) contrast(.9); }
.leaflet-container { font-family: Vazirmatn, sans-serif; }
.mapctl { position: absolute; top: 12px; inset-inline-end: 12px; z-index: 1000; display: flex; flex-direction: column; gap: 8px; }
[dir=rtl] .mapctl { inset-inline-end: auto; left: 12px; }
[dir=ltr] .mapctl { right: 12px; }
.mapctl button { display: flex; align-items: center; gap: 6px; border: 0; background: var(--card); color: var(--tx); border-radius: 14px; padding: 9px 11px; box-shadow: 0 2px 10px rgba(0,0,0,.25); font-size: 13px; font-weight: 600; }
.mapctl button .ico { color: var(--or); }
.mapctl button:active { transform: scale(.96); }
.hint { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 1000; background: #111; color: #fff; padding: 9px 16px; border-radius: 99px; font-size: 13px; display: flex; gap: 6px; align-items: center; max-width: 90%; box-shadow: 0 4px 16px rgba(0,0,0,.3); }
.hint .ico { color: var(--or); }

/* Place names on satellite */
.plabel-wrap { background: none; border: 0; }
.plabel { transform: translate(-50%, -50%); white-space: nowrap; color: #fff; font-size: 12px; font-weight: 600; pointer-events: none;
  text-shadow: 0 0 3px #000, 0 0 6px rgba(0,0,0,.9), 0 1px 2px #000; }
.plabel.big { font-size: 14.5px; font-weight: 800; letter-spacing: .2px; }
.plabel.hosp { display: flex; align-items: center; gap: 4px; color: #fff; font-size: 11.5px; }
.plabel.hosp .ico { width: 16px; height: 16px; color: #fff; background: var(--red); border-radius: 5px; padding: 1px; box-sizing: content-box; }

/* Member pins */
.pinwrap { position: relative; width: 44px; height: 44px; }
.pin { position: absolute; inset: 0; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 800; font-family: Vazirmatn, sans-serif;
  border: 3px solid #fff; box-shadow: 0 3px 10px rgba(0,0,0,.45); font-size: 18px; }
.pin.stale { filter: grayscale(.6); opacity: .75; }
.pin.sos { animation: pulse 1s infinite; }
.pin.livepin { box-shadow: 0 0 0 5px rgba(229,57,53,.4), 0 3px 10px rgba(0,0,0,.45); }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(229,57,53,.8); } 50% { box-shadow: 0 0 0 16px rgba(229,57,53,0); } }
.pinname { position: absolute; top: 46px; left: 50%; transform: translateX(-50%); white-space: nowrap; background: rgba(0,0,0,.75); color: #fff; font-size: 11.5px; font-weight: 700; padding: 1px 8px; border-radius: 99px; }
.arrow { position: absolute; inset: -15px; pointer-events: none; }
.arrow::before { content: ''; position: absolute; top: 0; left: 50%; transform: translateX(-50%); border: 8px solid transparent; border-bottom: 12px solid var(--or); border-top: 0; filter: drop-shadow(0 1px 2px rgba(0,0,0,.6)); }
.placepin { width: 34px; height: 34px; border-radius: 12px; display: grid; place-items: center; background: #fff; color: var(--or); box-shadow: 0 2px 8px rgba(0,0,0,.35); border: 2px solid var(--or); }
.placepin.school { color: #1565C0; border-color: #1565C0; }
.placepin.other { color: #7B1FA2; border-color: #7B1FA2; }
.placepin .ico { width: 18px; height: 18px; }

/* SOS alarm bar */
#sosbar { position: absolute; top: 12px; left: 12px; right: 12px; z-index: 1100; background: var(--red); color: #fff; border-radius: 18px; padding: 12px;
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap; box-shadow: 0 8px 30px rgba(229,57,53,.55); animation: sosflash 1s infinite; }
.sosicon { width: 42px; height: 42px; border-radius: 50%; background: #fff; color: var(--red); display: grid; place-items: center; flex: none; animation: pop .4s; }
.sosicon .ico { width: 26px; height: 26px; }
#sosbar .sostext { flex: 1; min-width: 150px; font-weight: 800; font-size: 16px; }
#sosbar small { display: block; font-weight: 400; font-size: 12px; opacity: .9; }
#sosbar .btn { background: #fff; color: var(--red); }
#sosbar .btn.ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.6); }
@keyframes sosflash { 50% { background: #B71C1C; } }

/* Modal & toast */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 2000; display: flex; align-items: center; justify-content: center; padding: 16px; animation: fadein .2s; }
.modal .box { background: var(--card); border-radius: 24px; padding: 22px; width: 100%; max-width: 440px; max-height: 90vh; overflow-y: auto; animation: rise .25s ease-out; }
.mhead { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.mhead .ico { color: var(--or); }
.modal .actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; flex-wrap: wrap; }
@keyframes fadein { from { opacity: 0; } }
#toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: #111; color: #fff; padding: 11px 18px; border-radius: 16px; z-index: 3000;
  font-size: 14px; display: flex; gap: 8px; align-items: center; box-shadow: 0 8px 24px rgba(0,0,0,.3); animation: rise .25s ease-out; max-width: 92vw; }
#toast .ico { color: var(--or); }

/* Phone layout: map on top, panel as a bottom sheet */
@media (max-width: 760px) {
  .body { grid-template-columns: 1fr; grid-template-rows: 46vh 1fr; }
  .panel { order: 2; border: 0; border-radius: 24px 24px 0 0; margin-top: -22px; z-index: 2; box-shadow: 0 -6px 20px rgba(0,0,0,.18); }
  .grab { display: block; width: 42px; height: 5px; border-radius: 3px; background: var(--line); margin: 8px auto 0; }
  .mapwrap { order: 1; }
  .tabs span:not(.badge) { font-size: 13.5px; }
  .mapctl button span { display: none; }
  #sosbar { top: 8px; left: 8px; right: 8px; }
}

/* ───────── v3: Uber / Find-My-Kids style map ───────── */
#map { background: #e9e5dc; }
body.on-sat #map, body.on-night #map { background: #1b1b1b; }
.leaflet-control-attribution { font-size: 10px; background: rgba(255,255,255,.7) !important; border-radius: 8px 0 0 0; }

/* map style picker */
.stylepop { position: absolute; top: 0; display: flex; gap: 8px; background: var(--card); padding: 8px; border-radius: 18px; box-shadow: 0 6px 24px rgba(0,0,0,.25); animation: pop .18s ease-out; }
[dir=ltr] .stylepop { right: calc(100% + 8px); }   /* controls on the right → menu opens to the left */
[dir=rtl] .stylepop { left: calc(100% + 8px); }    /* controls on the left → menu opens to the right */
.mapctl { position: absolute; }
.stylepop .sty { flex-direction: column; gap: 4px; padding: 6px; box-shadow: none; background: transparent; font-size: 12px; min-width: 72px; }
.stylepop .thumb { width: 64px; height: 48px; border-radius: 12px; display: grid; place-items: center; font-size: 24px; border: 2px solid transparent; }
.sty.clean .thumb { background: linear-gradient(135deg, #f3f3f1 0 45%, #d9dde2 45% 55%, #f3f3f1 55%); }
.sty.night .thumb { background: linear-gradient(135deg, #222 0 45%, #3a3f4a 45% 55%, #222 55%); }
.sty.sat .thumb { background: linear-gradient(135deg, #6b7b4b, #a59a74 50%, #5d6a3f); }
.sty.on .thumb { border-color: var(--or); }
.sty.on { color: var(--or); }

/* family member pin: avatar bubble + pointer */
.mpin { position: relative; width: 60px; height: 74px; font-family: Vazirmatn, sans-serif; }
.mpin .bubble { position: absolute; left: 6px; top: 4px; width: 48px; height: 48px; border-radius: 50%; background: #fff;
  border: 3.5px solid var(--c); display: grid; place-items: center; box-shadow: 0 6px 16px rgba(0,0,0,.35); z-index: 3;
  transition: transform .25s; }
.mpin .bubble span { font-size: 26px; line-height: 1; color: var(--c); font-weight: 800; }
.mpin:hover .bubble { transform: scale(1.08); }
.mpin .tail { position: absolute; left: 50%; top: 49px; width: 14px; height: 14px; background: var(--c); transform: translateX(-50%) rotate(45deg);
  border-radius: 0 0 4px 0; z-index: 2; box-shadow: 3px 3px 6px rgba(0,0,0,.2); }
.mpin::after { content: ''; position: absolute; left: 50%; top: 62px; width: 18px; height: 6px; transform: translateX(-50%); border-radius: 50%; background: rgba(0,0,0,.28); filter: blur(1px); }
.mpin .mo { position: absolute; top: -4px; inset-inline-end: -6px; z-index: 4; width: 26px; height: 26px; border-radius: 50%; background: #fff;
  display: grid; place-items: center; font-size: 15px; font-style: normal; box-shadow: 0 2px 6px rgba(0,0,0,.3); animation: bob 1.2s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-3px); } }
.mpin .bat { position: absolute; top: -2px; inset-inline-start: -10px; z-index: 4; font-style: normal; font-size: 10px; font-weight: 700; background: #fff; color: #222;
  padding: 1px 5px 1px 3px; border-radius: 99px; box-shadow: 0 2px 6px rgba(0,0,0,.25); white-space: nowrap; }
.mpin .bat.low { background: var(--red); color: #fff; animation: blink 1.2s infinite; }
.mpin .tag { position: absolute; top: 72px; left: 50%; transform: translateX(-50%); white-space: nowrap; background: #111; color: #fff;
  padding: 3px 10px; border-radius: 99px; font-size: 11.5px; display: flex; gap: 6px; align-items: center; box-shadow: 0 3px 10px rgba(0,0,0,.3); z-index: 3; }
.mpin .tag span { color: #FFB74D; font-weight: 600; }
.mpin.stale .bubble { filter: grayscale(.7); opacity: .8; }
.mpin.stale .tag span { color: #bbb; }
/* radar pulse when live / SOS */
.mpin .radar { position: absolute; left: 30px; top: 28px; width: 50px; height: 50px; margin: -25px 0 0 -25px; border-radius: 50%;
  background: radial-gradient(circle, rgba(245,124,0,.45), rgba(245,124,0,0) 70%); animation: radar 2s ease-out infinite; z-index: 1; }
.mpin .radar.r2 { animation-delay: 1s; }
.mpin.sos .radar { background: radial-gradient(circle, rgba(229,57,53,.6), rgba(229,57,53,0) 70%); animation-duration: 1.2s; }
.mpin.sos .bubble { border-color: var(--red); animation: sosring 1s infinite; }
@keyframes radar { from { transform: scale(.6); opacity: 1; } to { transform: scale(3.4); opacity: 0; } }
/* direction beam when moving */
.mpin .beam { position: absolute; left: 30px; top: 28px; width: 0; height: 0; z-index: 0; }
.mpin .beam::before { content: ''; position: absolute; left: -26px; top: -62px; width: 52px; height: 62px;
  background: linear-gradient(to top, rgba(245,124,0,.55), rgba(245,124,0,0)); clip-path: polygon(50% 100%, 0 0, 100% 0); border-radius: 50% 50% 0 0; }

/* places as emoji badges */
.placepin { position: relative; width: 44px; height: 44px; border-radius: 16px; background: #fff; border: 3px solid var(--pc);
  display: grid; place-items: center; box-shadow: 0 4px 12px rgba(0,0,0,.3); transform: rotate(-6deg); transition: transform .2s; }
.placepin:hover { transform: rotate(0) scale(1.08); }
.placepin span { font-size: 22px; transform: rotate(6deg); }
.placepin .pname { position: absolute; top: 46px; left: 50%; transform: translateX(-50%) rotate(6deg); font-style: normal; white-space: nowrap;
  background: var(--pc); color: #fff; font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 99px; box-shadow: 0 2px 6px rgba(0,0,0,.25); }
.picon { background: color-mix(in srgb, var(--pc, #F57C00) 14%, transparent) !important; font-size: 24px; }
.typegrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 6px; }
.typegrid button { border: 1.5px solid var(--line); background: var(--card); border-radius: 14px; padding: 8px 4px; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 12.5px; color: var(--tx); transition: transform .12s; }
.typegrid button span { font-size: 22px; }
.typegrid button.on { border-color: var(--or); background: var(--or-soft); font-weight: 700; }
.typegrid button:active { transform: scale(.95); }

/* route */
.routeflag { font-size: 24px; filter: drop-shadow(0 2px 3px rgba(0,0,0,.4)); }

/* hospital labels on satellite */
.plabel.hosp .e { font-size: 14px; background: #fff; border-radius: 6px; padding: 0 2px; }

/* emoji avatars in lists + picker */
.avatar.emo { background: #fff; box-shadow: 0 0 0 3px var(--c), 0 0 0 6px var(--card), 0 0 0 8.5px var(--ring, var(--line)); }
.avatar.emo span { font-size: 28px; }
.avatar.lg.emo span { font-size: 36px; }
.emogrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 12px; }
.emogrid button { font-size: 30px; padding: 10px 0; border-radius: 16px; border: 2px solid var(--line); background: var(--card); transition: transform .12s; }
.emogrid button:hover { transform: scale(1.08); border-color: var(--or); }
.emogrid button.on { border-color: var(--or); background: var(--or-soft); }
.bigemo { font-size: 34px; }

/* forgot password */
.link.small { font-size: 13.5px; padding-top: 6px; font-weight: 500; }
.link.muted { color: var(--mut); }
.okmsg { display: flex; gap: 8px; align-items: flex-start; background: var(--green-soft); color: var(--green); border-radius: 12px; padding: 10px 12px; margin-top: 14px; font-size: 13.5px; }
.codein { font-size: 26px !important; letter-spacing: 10px; text-align: center !important; font-weight: 800; }

/* fallback raster styling when MapLibre can't run */
.osm-clean { filter: saturate(.45) brightness(1.04) contrast(.95); }
.osm-night { filter: invert(1) hue-rotate(180deg) brightness(.85) contrast(.9) saturate(.5); }
.leaflet-gl-layer { z-index: 1; }

/* loading screen while the app starts */
.splash { min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; background: #111; }
.splash img { width: 84px; height: 84px; animation: pop .6s ease-out, breathe 1.6s ease-in-out .6s infinite; }
.splash .spin { width: 26px; height: 26px; border: 3px solid #333; border-top-color: #F57C00; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes breathe { 50% { transform: scale(1.06); } }

/* place names drawn by the browser (correct Dari/Pashto) — dark on Clean, light on Night/Satellite */
.plabel { color: #3a3a3a; text-shadow: 0 0 2px #fff, 0 0 4px #fff, 0 0 6px #fff; font-weight: 600; }
.plabel.big { color: #222; }
.plabel.city { font-size: 22px; font-weight: 800; color: #111; letter-spacing: .3px; }
body.on-sat .plabel, body.on-night .plabel { color: #fff; text-shadow: 0 0 3px #000, 0 0 6px rgba(0,0,0,.9), 0 1px 2px #000; }
body.on-night .plabel { color: #e8e8e8; }
.plabel.hosp { color: #b71c1c; }
body.on-sat .plabel.hosp, body.on-night .plabel.hosp { color: #fff; }

/* connect another phone via the web page */
.webjoin { margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--line); }
.qr { width: 190px; height: 190px; margin: 10px auto; background: #fff; border-radius: 16px; padding: 6px; box-shadow: var(--shadow); }
.qr svg { width: 100%; height: 100%; display: block; }
.joinlink { display: block; font-size: 12.5px; color: var(--or); word-break: break-all; }

/* ── Safety settings ── */
.secbox { border: 1.5px solid var(--line, #e5e5e5); border-radius: 18px; padding: 14px; margin: 16px 0 8px; }
.secbox > b { display: flex; align-items: center; gap: 8px; font-size: 16px; }
.secbox > b svg { width: 20px; height: 20px; }
.btnrow { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
label.check { display: flex; align-items: center; gap: 10px; cursor: pointer; margin-top: 14px; }
label.check input { width: 20px; height: 20px; accent-color: #F57C00; flex: none; }
.warnbox { background: #FFF3E0; color: #8a4a00; border-radius: 14px; padding: 10px 12px; font-size: 14px; margin: 8px 0; }
.dark .warnbox { background: #3a2a14; color: #ffcf99; }

/* ── Child asks to stop sharing / disconnect ── */
.reqcard { border: 2px solid #F57C00; background: #FFF3E0; }
.dark .reqcard { background: #3a2a14; }
.reqcard .btnrow .btn { flex: 1; }

/* ── Settings sections ── */
details.secbox > summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; }
details.secbox > summary::-webkit-details-marker { display: none; }
details.secbox > summary::after { content: '▾'; color: #999; }
details.secbox[open] > summary::after { content: '▴'; }
details.secbox { margin: 10px 0; }

/* ── Daily dashboard ── */
.dash h4 { margin: 16px 0 6px; font-size: 15px; }
.dstats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 8px; }
.dstat { background: var(--soft, #f4f4f2); border-radius: 14px; padding: 10px 6px; text-align: center; display: flex; flex-direction: column; gap: 2px; }
.dark .dstat { background: #2a2a2a; }
.dstat span { font-size: 20px; } .dstat b { font-size: 16px; } .dstat small { font-size: 11px; color: #888; }
.nowat { margin-top: 12px; font-size: 14px; }
.stop { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid rgba(0,0,0,.06); }
.stop .se { font-size: 22px; width: 30px; text-align: center; flex: none; }
.appbar { display: grid; grid-template-columns: 1fr 1.2fr auto; gap: 8px; align-items: center; padding: 5px 0; font-size: 14px; }
.appbar span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.appbar i { display: block; height: 8px; border-radius: 4px; background: rgba(0,0,0,.07); overflow: hidden; }
.appbar i em { display: block; height: 100%; background: #F57C00; border-radius: 4px; }
.appbar b { font-size: 13px; }

/* ── Lost phone ── */
.lostcard.on { border: 2px solid #E53935; background: #FFEBEE; }
.dark .lostcard.on { background: #3a1616; }
.lostcard .btnrow .btn { flex: 1; }
.smscodes { font-family: ui-monospace, monospace; font-size: 15px; background: rgba(0,0,0,.05); border-radius: 12px; padding: 10px 12px; line-height: 1.8; }
textarea { width: 100%; box-sizing: border-box; border: 1.5px solid #ddd; border-radius: 12px; padding: 10px; font: inherit; }

/* ── Photos ── */
.avatar img.face, .mpin .bubble img.face { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
/* ── Sponsor card (parents only) ── */
.adcard { display: flex; gap: 12px; align-items: center; background: var(--card, #fff); border: 1px dashed rgba(0,0,0,.15); border-radius: 18px;
  padding: 10px 12px; margin: 10px 0; color: inherit; text-decoration: none; }
.adcard img { width: 76px; height: 56px; object-fit: cover; border-radius: 12px; flex: none; }
.adcard div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.adcard small { font-size: 11px; color: #999; text-transform: uppercase; letter-spacing: .04em; }
.adcard span { font-size: 13px; color: #777; }

/* Launch-readiness accessibility and visual refinements */
:focus-visible { outline: 3px solid #167c80; outline-offset: 3px; }
button, .btn, .iconbtn { min-height: 44px; }
.password-toggle { display:block; margin-inline-start:auto; background:none; border:0; color:var(--tx); text-decoration:underline; font-size:13px; }
.auth { background: radial-gradient(ellipse at 50% 0%, #30302a, #111 65%); }
.auth .box { border:1px solid var(--line); box-shadow:0 16px 50px #0003; }
.auth-privacy { text-align:center; font-size:12px; margin:18px 0 0; }
.auth-privacy a { color:var(--mut); text-underline-offset:3px; }
body.light .link { color:#a84b00; }
@media (min-width:960px) { .auth { flex-direction:row; justify-content:center; gap:72px; padding:48px; } .auth .hero { text-align:start; } .auth .hero .langs { margin-inline:0; } .feats { margin-inline:0; } }
@media (prefers-reduced-motion:reduce) { *, *::before, *::after { animation-duration:.01ms !important; transition-duration:.01ms !important; scroll-behavior:auto !important; } }

.connection-banner { position:fixed; z-index:10000; inset-inline:12px; top:env(safe-area-inset-top, 0px); padding:12px 16px; background:#fff3cd; color:#593b00; border:1px solid #bb8b32; border-radius:12px; text-align:center; box-shadow:var(--shadow); }
.offline-state #app { padding-top:72px; }

/* 0.14 end-to-end encryption screens */
.authwrap { min-height:100vh; display:flex; align-items:center; justify-content:center; padding:24px; }
.e2ebox { max-width:520px; width:100%; }
.safety { font-size:40px; font-weight:800; letter-spacing:6px; text-align:center; padding:18px; margin:12px 0; border-radius:16px; background:#111; color:#FFB74D; font-variant-numeric:tabular-nums; }
.reckey { font-family:ui-monospace, Menlo, Consolas, monospace; font-size:20px; font-weight:700; line-height:1.6; text-align:center; padding:16px; margin:10px 0; border:2px dashed #F57C00; border-radius:14px; word-spacing:6px; user-select:all; }
.note.warn { background:#fff3cd; color:#593b00; border-radius:12px; padding:10px 12px; }
.chk { display:flex; gap:10px; align-items:center; margin:14px 0; font-weight:600; }
.chk input { width:22px; height:22px; }
.devrow { display:flex; gap:12px; align-items:center; padding:10px 0; border-bottom:1px solid rgba(0,0,0,.08); }
.devrow > span { font-size:26px; } .devrow .info { flex:1; }
.devrow .tag { background:#111; color:#fff; border-radius:999px; padding:2px 8px; font-size:12px; }
/* 0.14.1 picture check */
.pics, .picrow, #pics { direction:ltr; unicode-bidi:isolate; }
.pics { font-size:46px; text-align:center; letter-spacing:10px; padding:14px 6px; margin:12px 0 4px; border-radius:18px; background:#FFF8EE; border:2px solid #F57C00; line-height:1.2; }
.picrows { display:grid; gap:10px; margin:12px 0; }
.picrow { font-size:36px; letter-spacing:8px; padding:12px 6px; border-radius:16px; border:2px solid rgba(0,0,0,.12); background:#fff; cursor:pointer; }
.picrow:hover:not(:disabled) { border-color:#F57C00; background:#FFF8EE; }
.picrow.wrong { border-color:#E53935; background:#FFEBEE; }
.picrow:disabled { opacity:.55; cursor:default; }

/* 0.14.2 pair card: QR first, the code only as a fallback */
.paircard .pairtitle { display:block; font-size:19px; margin-bottom:4px; }
.qr.big { width:250px; height:250px; }
.codealt { margin-top:14px; padding-top:12px; border-top:1px dashed var(--line); }
.codealt .code { font-size:28px; }

/* 0.14.6 code-only connecting */
.steps2 { text-align:start; margin:8px 0 6px; padding-inline-start:22px; line-height:1.7; }
.code.big { font-size:44px; letter-spacing:8px; direction:ltr; margin:10px 0 4px; }
.codein { font-size:30px; text-align:center; letter-spacing:6px; width:100%; padding:12px; border-radius:14px; border:2px solid var(--line); margin:6px 0; }

/* ───────── 0.15: menu, language, sharing, map messages, responsive ───────── */
header { position: relative; }
.hsel { flex: none; width: auto; min-width: 0; background: rgba(255,255,255,.1); color: #fff; border: 1px solid rgba(255,255,255,.18); border-radius: 12px; height: 36px; padding: 0 8px; font: inherit; font-size: 13.5px; max-width: 46vw; }
.hsel option { color: #111; background: #fff; }
.hmenu { position: absolute; top: 54px; inset-inline-end: 8px; background: var(--card); color: var(--tx); border-radius: 16px; box-shadow: 0 12px 32px rgba(0,0,0,.28); padding: 6px; min-width: 230px; z-index: 3000; display: grid; animation: pop .15s ease-out; }
.hmenu button, .hmenu a { display: flex; gap: 10px; align-items: center; background: none; border: 0; color: inherit; text-decoration: none; font: inherit; padding: 12px; border-radius: 12px; text-align: start; min-height: 46px; }
.hmenu button:hover, .hmenu a:hover { background: rgba(127,127,127,.12); }
.hmenu .ico { width: 20px; height: 20px; }
.hmenu .danger { color: var(--red); }
.mapmsg { position: absolute; z-index: 900; bottom: 16px; left: 50%; transform: translateX(-50%); background: var(--card); color: var(--tx); border-radius: 16px; padding: 10px 14px; box-shadow: 0 6px 20px rgba(0,0,0,.22); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: center; max-width: calc(100% - 24px); font-size: 14px; }
.spin { display: inline-block; width: 16px; height: 16px; border: 2.5px solid rgba(127,127,127,.3); border-top-color: var(--or); border-radius: 50%; animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.pairwait { display: flex; gap: 8px; align-items: center; justify-content: center; margin: 6px 0 2px; color: var(--mut, #777); font-size: 14px; }
.dstat .na { font-size: 11.5px; font-weight: 600; opacity: .7; }
.btnrow, .actions3, .chips { flex-wrap: wrap; }
.card, .modal .box, .paircard { overflow-wrap: anywhere; }
button, .btn { min-height: 40px; }

/* tablets */
@media (min-width: 761px) and (max-width: 1100px) { .body { grid-template-columns: 360px 1fr; } }
/* phones */
@media (max-width: 760px) {
  .shell { grid-template-rows: 54px 1fr; }
  header { gap: 6px; padding: 0 6px 0 10px; }
  header img { width: 30px; height: 30px; }
  header .title { font-size: 18px; }
  .hmenu { top: 50px; }
  .modal { align-items: flex-end; padding: 0; }
  .modal .box { border-radius: 24px 24px 0 0; max-width: none; max-height: 88vh; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); }
  .code.big { font-size: 38px; letter-spacing: 6px; }
}
@media (max-width: 420px) {
  header .title { display: none; }
  .hsel { font-size: 12.5px; padding: 0 4px; height: 34px; }
  #hshare { max-width: 38vw; }
  .iconbtn { width: 38px; height: 38px; }
  .dstats { grid-template-columns: repeat(2, 1fr) !important; }
}

/* ═════════ 0.16 Warm & friendly redesign ═════════
   Cream background, white rounded cards, burnt-orange buttons with white text (5:1 contrast),
   one colour per child. Dark mode keeps its own colours. */
:root { --or: #E86A00; --orb: #C2410C; --or2: #FDBA74; --or-soft: #FFE3C4; --green: #1F7A4D; --green-soft: #E3F4EA; --r: 22px; }
body.light { --bg: #FFF6EC; --panel: #FFF6EC; --card: #FFFFFF; --tx: #2B1D10; --mut: #6E5A47; --line: #F1E4D3; --head: #FFF6EC; --chip: #FFF0DF;
  --shadow: 0 1px 2px rgba(120,64,10,.05), 0 8px 24px rgba(120,64,10,.08); }
body.dark { --orb: #E86A00; }

/* buttons */
.btn { background: var(--orb); color: #fff; border-radius: 16px; font-weight: 800; box-shadow: 0 4px 12px rgba(194,65,12,.18); }
.btn.big { border-radius: 20px; }
.btn.ghost, .btn.danger { box-shadow: none; }
body.light .btn.ghost { border-color: #E2D3C1; }
.seg button.on, .langs button.on, .steps b { background: var(--orb); color: #fff; }
body.light .link { color: var(--orb); }
input[type=text], input[type=password], input[type=date], select, textarea { border-radius: 16px; }
body.light input[type=text], body.light input[type=password], body.light input[type=date], body.light select { border-color: #E2D3C1; }

/* header: light and calm */
body.light header { background: var(--head); color: var(--tx); border-bottom: 1px solid var(--line); }
body.light .hsel { background: #F6E7D4; color: var(--tx); border-color: transparent; font-weight: 700; }
header .title { font-weight: 900; }
body.light .badge { box-shadow: 0 0 0 2px var(--head); }

/* side panel & tabs */
body.light .panel { border-color: var(--line); }
.tabs { background: transparent; }
body.light .tabs button.on { color: var(--orb); }
.greet h2 { font-size: 23px; font-weight: 900; }
.fpill { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 7px 12px; font-weight: 800; font-size: 13px; white-space: nowrap; flex: none; }
.fpill .ico { width: 16px; height: 16px; }
.fpill.ok { background: var(--green-soft); color: var(--green); }
.fpill.mid { background: var(--or-soft); color: #9A3412; }
.fpill.bad { background: var(--red); color: #fff; animation: blink 1.4s infinite; }

/* family cards: each child has a colour */
.card { border-radius: var(--r); }
body.light .card { border-color: transparent; }
.card.member { --c: var(--or); padding: 14px 16px; border-inline-start: 6px solid var(--c) !important; }
.card.member:hover { border-color: transparent; box-shadow: 0 10px 28px rgba(120,64,10,.14); }
.avatar { width: 54px; height: 54px; font-size: 22px; }
.nm { font-size: 17.5px; font-weight: 800; }
.addrow { width: 100%; min-height: 58px; margin-top: 4px; border-radius: var(--r); border: 2px dashed #D9C3A9; background: transparent; color: var(--tx);
  font-weight: 800; font-size: 15.5px; display: flex; align-items: center; justify-content: center; gap: 8px; transition: background .2s, border-color .2s; }
.addrow:hover { background: var(--or-soft); border-color: var(--or); }
.addrow .ico { color: var(--orb); width: 20px; height: 20px; }
body.dark .addrow { border-color: #4a3a2a; }

/* tip: soft orange instead of black */
body.light .tip { background: var(--or-soft); color: var(--tx); }
body.light .tipicon { background: var(--orb); color: #fff; }
body.light .tiphead, body.light .tipnext { color: #9A3412; }
body.light .tip .iconbtn { color: #9A3412; }

/* actions */
.action { border-radius: var(--r); }
body.light .action { border-color: transparent; }
body.light .livebtn { background: var(--tx); color: #fff; }

/* connect a child's phone */
.paircard { padding: 18px; }
.paircard .pairtitle { font-size: 20px; font-weight: 900; }
.steps2 { list-style: none; padding: 0; margin: 14px 0; display: grid; gap: 12px; counter-reset: st; }
.steps2 li { display: flex; align-items: center; gap: 12px; counter-increment: st; text-align: start; line-height: 1.5; font-weight: 600; }
.steps2 li i { position: relative; width: 44px; height: 44px; flex: none; border-radius: 16px; background: var(--or-soft); color: var(--orb); display: grid; place-items: center; }
.steps2 li i .ico { width: 20px; height: 20px; }
.steps2 li i::after { content: counter(st); position: absolute; top: -6px; inset-inline-end: -6px; width: 20px; height: 20px; border-radius: 50%; background: var(--orb); color: #fff;
  font-size: 12px; font-weight: 900; font-style: normal; display: grid; place-items: center; }
.codebox { background: var(--or-soft); border-radius: var(--r); padding: 14px 10px 10px; margin: 6px 0 10px; }
.codebox small { display: block; color: #9A3412; font-weight: 800; font-size: 13px; }
.codebox .code.big { background: none; color: #9A3412; font-size: 50px; font-weight: 900; letter-spacing: 10px; margin: 0; padding: 0; }
body.dark .codebox { background: #2b1c0b; } body.dark .codebox .code.big, body.dark .codebox small { color: var(--or2); }
.pairwait { font-weight: 700; color: var(--tx); }

/* modals, toast, hint */
.modal .box { border-radius: 26px; }
body.light #toast, body.light .hint { background: var(--tx); }
body.light .safety { background: var(--or-soft); color: #9A3412; }

/* sign-in screen: warm, light */
body.light .auth { background: radial-gradient(ellipse at 50% 0%, #FFE3C4, #FFF6EC 60%); }
body.light .auth .hero { color: var(--tx); }
body.light .auth .hero p { color: var(--mut); }
body.light .feats li { color: var(--tx); }
body.light .feats .ico { color: var(--orb); background: var(--or-soft); }
body.light .langs.dark { background: #F6E7D4; }
body.light .langs.dark button { color: var(--mut); }
body.light .langs.dark button.on { color: #fff; }
body.light .auth .box { box-shadow: 0 16px 50px rgba(120,64,10,.12); border-color: transparent; }
.splash { background: #FFF6EC; }
.splash .spin { border-color: #F6E7D4; border-top-color: var(--orb); }

/* map labels */
body.light .mpin .tag { background: var(--tx); }

@media (max-width: 760px) {
  body.light .panel { box-shadow: 0 -8px 24px rgba(120,64,10,.14); }
  .codebox .code.big { font-size: 42px; letter-spacing: 7px; }
}
/* 0.16.1: logo + name always fit (English "Rasidum" is wider than «رسیدم») */
header img { flex: none; }
header .title { white-space: nowrap; overflow: hidden; text-overflow: clip; min-width: 0; }
@media (min-width: 421px) and (max-width: 560px) { header .title { font-size: 16px; } }
/* 0.16.4 Activity: 2 × 2 tiles that always fit — icon, value, label */
.dstats { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 8px; }
.dstat { flex-direction: row; align-items: center; gap: 10px; text-align: start; padding: 10px; border-radius: 16px; background: var(--chip); min-width: 0; }
body.dark .dstat { background: #2a2a2a; }
.dstat i { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex: none; color: #fff; background: var(--orb); }
.dstat i .ico { width: 18px; height: 18px; }
.dstat.c1 i { background: #1F7A4D; } .dstat.c2 i { background: #2F6FB0; } .dstat.c3 i { background: #7C4DBA; } .dstat.c4 i { background: #C2410C; } .dstat.low i { background: var(--red); }
.dstat div { min-width: 0; display: flex; flex-direction: column; }
.dstat b { font-size: 17px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dstat small { font-size: 12px; color: var(--mut); line-height: 1.35; }
.dstat .na { font-size: inherit; font-weight: 500; opacity: .85; }
.dstat span { font-size: inherit; }
.cardhead > .ico { color: var(--orb); }
.h4i, .nowat { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.h4i .ico, .nowat .ico { color: var(--orb); width: 17px; height: 17px; }

/* ═════════ 0.16.6 Today: places · walks · steps this week · where now ═════════ */
.today { margin-bottom: 14px; }
.todayh { font-size: 20px; font-weight: 900; margin: 2px 2px 10px; }
.tcard { background: var(--chip); border-radius: 20px; padding: 14px; color: var(--tx); border: 0; text-align: start; font: inherit; min-width: 0; }
body.dark .tcard { background: #222; }
.trow2 { display: grid; grid-template-columns: 1.55fr 1fr; gap: 10px; margin-bottom: 10px; }
.tplaces { display: flex; flex-direction: column; gap: 10px; cursor: pointer; }
.thead { display: flex; align-items: center; gap: 8px; }
.thead > .ico { width: 22px; height: 22px; color: var(--orb); }
.thead b { flex: 1; font-size: 19px; font-weight: 900; }
.tgo { width: 30px; height: 30px; border-radius: 10px; background: var(--card); display: grid; place-items: center; flex: none; }
.tgo .ico { width: 16px; height: 16px; }
.trow { display: flex; align-items: center; gap: 8px; min-width: 0; }
.trow span { flex: 1; min-width: 0; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trow small { color: var(--mut); flex: none; }
.tpi, .tnowi { --pc: #2F6FB0; width: 30px; height: 30px; border-radius: 10px; background: var(--pc); color: #fff; display: grid; place-items: center; flex: none; position: relative; }
.tpi .ico { width: 17px; height: 17px; }
.twalk { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 4px; }
.twalk b { font-size: 18px; font-weight: 900; }
.twalk small, .twait { color: var(--mut); font-size: 13.5px; line-height: 1.35; }
.twait { color: var(--tx); font-weight: 700; font-size: 15px; }
.tbig .ico { width: 30px; height: 30px; color: var(--orb); }
.tsteps { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.9fr); gap: 12px; align-items: end; margin-bottom: 10px; }
.tavg { display: flex; flex-direction: column; gap: 2px; align-self: stretch; justify-content: center; }
.tavg b { font-size: 30px; font-weight: 900; line-height: 1.1; }
.tavg span { font-weight: 700; font-size: 14px; line-height: 1.3; }
.tavg small { color: var(--mut); font-size: 12.5px; margin-top: 6px; }
.tchart { position: relative; height: 130px; display: flex; flex-direction: column; }
.tgrid { position: absolute; inset: 0 0 22px 0; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.tgrid span { border-top: 1px solid var(--line); font-size: 10px; color: var(--mut); text-align: end; line-height: 1; padding-top: 1px; }
[dir=rtl] .tgrid span { text-align: start; }
.tbars { position: relative; flex: 1; display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; align-items: end; }
.tbar { height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; min-width: 0; }
.tbar i { width: 100%; max-width: 26px; border-radius: 7px 7px 3px 3px; background: #F6C99B; display: block; }
.tbar.now i { background: var(--orb); }
.tbar small { height: 18px; font-size: 10.5px; color: var(--mut); white-space: nowrap; overflow: hidden; max-width: 100%; }
.tbar.now small { color: var(--tx); font-weight: 800; }
.tnow { display: flex; flex-direction: column; gap: 12px; }
.tnowtop { display: flex; align-items: center; gap: 12px; min-width: 0; }
.tnowtop > div { min-width: 0; display: flex; flex-direction: column; }
.tnowtop b { font-size: 18px; font-weight: 900; line-height: 1.25; }
.tnowtop small { color: var(--mut); font-size: 14px; }
.tnowi { width: 50px; height: 50px; border-radius: 16px; }
.tnowi > .ico { width: 26px; height: 26px; }
.tnowi em { position: absolute; top: -6px; inset-inline-end: -6px; width: 22px; height: 22px; border-radius: 50%; background: var(--or); color: #fff; display: grid; place-items: center; box-shadow: 0 0 0 2px var(--chip); }
.tnowi em .ico { width: 12px; height: 12px; }
.tnotif { display: flex; align-items: center; gap: 10px; margin: 0; padding: 12px 14px; border-radius: 16px; background: #FFE3C4; color: #9A3412; font-weight: 800; font-size: 14.5px; cursor: pointer; }
.tnotif.on { background: var(--green-soft); color: var(--green); }
body.dark .tnotif { background: #3a2410; color: #FDBA74; } body.dark .tnotif.on { background: #12261a; color: #6fd39a; }
.tnotif > .ico { width: 20px; height: 20px; flex: none; }
.tnotif span { flex: 1; }
.tnotif input { position: absolute; opacity: 0; pointer-events: none; }
.tsw { width: 46px; height: 26px; border-radius: 99px; background: rgba(154,52,18,.25); position: relative; flex: none; transition: background .2s; }
.tsw::after { content: ''; position: absolute; top: 3px; inset-inline-start: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.tnotif.on .tsw { background: var(--green); }
.tnotif.on .tsw::after { transform: translateX(20px); }
[dir=rtl] .tnotif.on .tsw::after { transform: translateX(-20px); }
.tnotif input:focus-visible + .tsw { outline: 3px solid #167c80; outline-offset: 2px; }
@media (max-width: 380px) { .trow2 { grid-template-columns: 1fr; } .tsteps { grid-template-columns: 1fr; } }
/* chart v2: bars and day names in separate rows so they always line up */
.tchart { height: auto; display: grid; grid-template-rows: auto 104px auto; gap: 4px; }
.tmax { font-size: 10.5px; color: var(--mut); text-align: end; }
.tplot { position: relative; }
.tlines { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; }
.tlines i { display: block; border-top: 1px dashed var(--line); }
.tlines i:last-child { border-top: 1.5px solid #E2D3C1; }
.tbars { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; align-items: end; }
.tbar { height: 100%; display: flex; align-items: flex-end; justify-content: center; }
.tbar i { max-width: 22px; }
.tdays { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.tdays small { text-align: center; font-size: 11px; color: var(--mut); white-space: nowrap; overflow: hidden; }
.tdays small.now { color: var(--tx); font-weight: 800; }
.tbars { grid-template-rows: 100%; align-items: stretch; }
.tbar { flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; gap: 0; }
.tbar i { width: 100%; flex: none; }

/* ═════════ 0.17 Welcome + intro slides ═════════ */
.welcome { min-height: 100%; max-width: 480px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 14px 20px calc(20px + env(safe-area-inset-bottom)); background: var(--bg); }
.wtop { width: 100%; display: flex; justify-content: flex-end; }
.welcome .langs { width: auto; }
.wbrand { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.wbrand img { width: 34px; height: 34px; }
.wbrand b { font-size: 24px; font-weight: 900; }
.welcome h1 { font-size: 30px; line-height: 1.2; font-weight: 900; margin: 14px 0 6px; }
.wsub { color: var(--mut); font-size: 16px; margin: 0 0 6px; max-width: 360px; }
.wart { width: 100%; max-width: 400px; flex: 1; display: flex; align-items: center; }
.wart svg { width: 100%; height: auto; display: block; border-radius: 24px; }
.wact { width: 100%; max-width: 400px; }
.wact .btn { margin-top: 10px; }
.whave { margin: 14px 0 0; font-size: 15px; }
.link.inline { display: inline; width: auto; padding: 0; font-weight: 800; color: var(--orb); font-size: inherit; min-height: 0; }

.slides { min-height: 100%; display: flex; align-items: center; justify-content: center; padding: 14px; background: #3a2c20; }
.scard { position: relative; width: 100%; max-width: 440px; background: var(--card); border-radius: 30px; padding: 26px 22px calc(20px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; text-align: center; animation: rise .25s ease-out; }
.sx { position: absolute; top: 14px; inset-inline-end: 14px; width: 46px; height: 46px; border-radius: 16px; border: 1.5px solid var(--line); background: var(--card); display: grid; place-items: center; color: var(--tx); }
.sx .ico { width: 22px; height: 22px; }
.scard h2 { font-size: 26px; font-weight: 900; line-height: 1.25; margin: 34px 8px 8px; }
.scard > p { color: var(--mut); font-size: 16px; margin: 0 6px 12px; }
.sart { position: relative; border-radius: 22px; overflow: hidden; }
.sart svg { width: 100%; height: auto; display: block; }
.snote { position: absolute; top: 10px; inset-inline: 14px; display: flex; align-items: center; gap: 12px; background: #fff; border-radius: 18px; padding: 10px 14px;
  box-shadow: 0 6px 20px rgba(120,64,10,.12); text-align: start; color: var(--tx); }
.snote > .ico { width: 40px; height: 40px; padding: 9px; border-radius: 50%; background: var(--green); color: #fff; flex: none; box-sizing: border-box; }
.snote div { display: flex; flex-direction: column; } .snote b { font-size: 16px; } .snote small { color: var(--mut); }
.sdots { display: flex; justify-content: center; gap: 7px; margin: 16px 0 6px; }
.sdots i { width: 9px; height: 9px; border-radius: 99px; background: var(--line); transition: width .2s; }
.sdots i.on { width: 32px; background: var(--tx); }
.btn.sdark { background: var(--tx); color: #fff; }
body.dark .btn.sdark { background: var(--orb); }
@media (max-height: 700px) { .welcome h1 { font-size: 25px; } .scard h2 { font-size: 22px; margin-top: 26px; } }

.sart:has(+ .sdots) .snote > .ico { }
.snote.sos > .ico { background: var(--red); } .snote.walk > .ico { background: var(--orb); }

/* ═════════ 0.18 Family setup ═════════ */
.ob .scard { text-align: start; }
.ob .scard.obstart { padding-top: 28px; }
.obh { font-size: 26px; font-weight: 900; line-height: 1.25; margin: 6px 0 8px; }
.obp { color: var(--mut); font-size: 16px; margin: 0 0 16px; line-height: 1.5; }
.obart { margin: -6px -6px 14px; } .obart svg { border-radius: 20px; }
.oblabel { font-weight: 800; font-size: 15px; margin: 4px 0 6px; display: block; }
.ob input[type=text] { width: 100%; min-height: 54px; font-size: 17px; border-radius: 16px; margin-bottom: 8px; box-sizing: border-box; }
.ob .btn.big { margin-top: 10px; }
.ob .btn:disabled { opacity: .45; }
.ob .link { margin-top: 10px; font-weight: 800; color: var(--tx); text-align: center; }
.btn.obgrey { background: var(--chip); color: var(--tx); box-shadow: none; }
.obroles { display: flex; flex-direction: column; gap: 10px; margin: 8px 0 6px; max-height: 52vh; overflow: auto; }
.obroles button { min-height: 58px; text-align: start; padding: 0 18px; border-radius: 18px; border: 2px solid var(--line); background: var(--card); color: var(--tx); font: inherit; font-weight: 800; font-size: 17px; }
.obroles button.on { border-color: var(--orb); background: #FFF0DF; }
body.dark .obroles button.on { background: #3a2410; }
.obnotes { display: flex; flex-direction: column; gap: 10px; margin: 10px 0 8px; padding: 12px; border-radius: 24px; background: #FFF0DF; }
body.dark .obnotes { background: #2a1d10; }
.obnote { display: flex; gap: 12px; align-items: flex-start; background: var(--card); border-radius: 18px; padding: 12px 14px; box-shadow: 0 4px 14px rgba(120,64,10,.08); }
.obnote .obav { flex: none; width: 44px; height: 44px; } .obnote .obav svg { display: block; }
.obnote div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.obnote b { font-size: 16px; } .obnote span { color: var(--mut); font-size: 14.5px; line-height: 1.45; }
.obnote.bad b { color: var(--red); }
.obtip { background: var(--chip); border-radius: 18px; padding: 14px 16px; font-size: 15.5px; line-height: 1.5; }
.obtip b { display: block; font-size: 19px; font-weight: 900; margin-top: 2px; }
.obhomecard { padding-top: 0 !important; overflow: hidden; }
.obmap { position: relative; height: 290px; margin: 0 -22px 14px; }
#obmap { position: absolute; inset: 0; z-index: 0; }
.obpin { position: absolute; z-index: 500; left: 50%; top: 50%; transform: translate(-50%, -100%); pointer-events: none; display: flex; flex-direction: column; align-items: center; }
.obpin svg { width: 64px; height: 64px; border-radius: 50%; padding: 6px; border: 4px solid #fff; box-shadow: 0 6px 16px rgba(0,0,0,.25); background: #fff; }
.obpin i { width: 0; height: 0; border: 8px solid transparent; border-top-color: #fff; margin-top: -2px; }
.obbubble { position: absolute; z-index: 500; top: 14px; inset-inline: 16px; background: #fff; color: #2B1D10; border-radius: 18px; padding: 12px 16px; font-weight: 800; font-size: 15px; box-shadow: 0 6px 18px rgba(0,0,0,.14); }
.obme { position: absolute; z-index: 500; bottom: 14px; inset-inline-end: 14px; width: 46px; height: 46px; border-radius: 16px; border: 0; background: #fff; color: #2B1D10; display: grid; place-items: center; box-shadow: 0 4px 12px rgba(0,0,0,.18); }
.obme .ico { width: 20px; height: 20px; }
.obsearch input { margin-bottom: 6px; }
#obres { display: flex; flex-direction: column; gap: 6px; max-height: 180px; overflow: auto; }
#obres button { display: flex; gap: 8px; align-items: flex-start; text-align: start; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); color: var(--tx); font: inherit; font-size: 14px; }
#obres button .ico { flex: none; width: 18px; height: 18px; color: var(--orb); margin-top: 2px; }
.obenv { width: 84px; height: 84px; border-radius: 28px; background: #FFE3C4; color: var(--orb); display: grid; place-items: center; margin: 6px auto 10px; }
.obenv .ico { width: 40px; height: 40px; }
.obcode { text-align: center; border-radius: 24px; padding: 18px 12px; background: var(--card); border: 1.5px solid var(--line); box-shadow: 0 8px 24px rgba(120,64,10,.08); margin: 6px 0 4px; }
.obcode small { display: block; color: var(--orb); font-weight: 900; font-size: 16px; }
.obcode b { display: block; font-size: 52px; font-weight: 900; letter-spacing: 6px; color: #9A3412; margin: 4px 0; }
.obcode span { color: var(--mut); font-size: 14.5px; }
.ob .btn .ico { width: 20px; height: 20px; }

/* 0.19 Email, phone, password and codes are always typed left-to-right (also in Dari / Pashto), so nothing gets mixed up */
input[type=password], input[type=email], input[type=tel], input[inputmode=numeric], input[inputmode=email], input[inputmode=tel],
input.ltr, #auth-login, #auth-password, #semail, #snum { direction: ltr !important; text-align: left !important; unicode-bidi: plaintext; }
input.codein, input.code { text-align: center !important; }
input[type=password]::placeholder, input.ltr::placeholder, #auth-login::placeholder { direction: ltr; text-align: left; }

/* ═════════ 0.19 Circles ═════════ */
.ico.down { transform: rotate(90deg); }
.circlebar { width: 100%; display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 8px 12px; margin: 0 0 12px; border-radius: 18px;
  border: 1.5px solid var(--line); background: var(--card); color: var(--tx); font: inherit; text-align: start; box-shadow: var(--shadow); }
.circlebar > span, .crow > span { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.circlebar b, .crow b { font-size: 16px; font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.circlebar small, .crow small { color: var(--mut); font-size: 12.5px; }
.circlebar > .ico { width: 18px; height: 18px; flex: none; color: var(--mut); }
.cdot { --cc: var(--orb); width: 38px; height: 38px; border-radius: 13px; background: var(--cc); color: #fff; display: grid; place-items: center; flex: none; }
.cdot .ico { width: 20px; height: 20px; }
.clist { display: flex; flex-direction: column; gap: 8px; margin: 10px 0 14px; max-height: 50vh; overflow: auto; }
.crow { display: flex; align-items: center; gap: 10px; min-height: 58px; padding: 8px 10px; border-radius: 16px; border: 1.5px solid var(--line); background: var(--card); color: var(--tx); font: inherit; text-align: start; }
.crow.on { border-color: var(--orb); background: #FFF0DF; } body.dark .crow.on { background: #3a2410; }
.crow > .ico { width: 20px; height: 20px; color: var(--orb); flex: none; }
.cedit { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; color: var(--mut); }
.cedit:hover { background: var(--chip); } .cedit .ico { width: 18px; height: 18px; }
.cswatch { display: flex; gap: 10px; flex-wrap: wrap; margin: 4px 0 8px; }
.cswatch button { width: 38px; height: 38px; border-radius: 50%; border: 3px solid var(--card); background: var(--cc); box-shadow: 0 0 0 1.5px var(--line); }
.cswatch button.on { box-shadow: 0 0 0 3px var(--tx); }
.cpeople { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin: 4px 0 6px; max-height: 40vh; overflow: auto; }
.cperson { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 14px; border: 1.5px solid var(--line); cursor: pointer; margin: 0; min-width: 0; }
.cperson input { width: 20px; height: 20px; flex: none; margin: 0; accent-color: var(--orb); }
.cperson .avatar { width: 34px; height: 34px; font-size: 16px; flex: none; }
.cperson span { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 700; }
.cperson:has(input:checked) { border-color: var(--orb); background: #FFF0DF; } body.dark .cperson:has(input:checked) { background: #3a2410; }

/* 0.19 layout review fixes (tests/layout-audit.py) */
.langs button { min-height: 40px; min-width: 40px; }
.link.inline { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; min-width: 44px; padding: 6px 6px; }
#tipx { min-width: 40px; }
header .hsel { min-height: 40px; }
header #hshare { flex: 0 1 auto; min-width: 0; max-width: 44vw; text-overflow: ellipsis; }
@media (max-width: 380px) { header { gap: 4px; padding-inline: 8px; } header #hshare { max-width: 38vw; font-size: 12.5px; } header .iconbtn { min-width: 40px; width: 40px; } }
.avatar img.f3d, .emogrid img.f3d { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; display: block; }
.emogrid button img.f3d { width: 34px; height: 34px; border-radius: 10px; }
.iline { display: flex; align-items: flex-start; gap: 6px; } .iline .ico { width: 16px; height: 16px; flex: none; margin-top: 2px; color: var(--orb); }
.chip .ico { width: 14px; height: 14px; }
.secbox summary b { display: inline-flex; align-items: center; gap: 8px; } .secbox summary b .ico { width: 18px; height: 18px; color: var(--orb); }
.pairtitle { display: flex; align-items: center; gap: 8px; } .pairtitle .ico { width: 20px; height: 20px; color: var(--orb); flex: none; }
.mapmsg > .ico { width: 18px; height: 18px; color: #C2410C; }

/* ── 0.20 Invite (Life360 style) ── */
.invite { display: flex; flex-direction: column; align-items: stretch; gap: 10px; margin: 10px 0; text-align: center; }
.invite .invlabel { color: var(--mut); font-weight: 600; }
.invite .invcode { font-size: clamp(30px, 10vw, 44px); font-weight: 800; letter-spacing: .08em; color: var(--tx);
  background: var(--or-soft); border: 2px dashed var(--or2); border-radius: 18px; padding: 10px 8px; font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; user-select: all; }
.invite .invvalid { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 0; font-size: 14px; color: var(--mut); }
.invite .invvalid svg { width: 16px; height: 16px; flex: none; }
.invways { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.invways button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 64px; padding: 8px 2px;
  border: 1px solid var(--line); background: var(--card); border-radius: 14px; font: inherit; font-size: 12px; color: var(--tx); cursor: pointer; min-width: 0; }
.invways button span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.invways button svg { width: 22px; height: 22px; color: var(--or); }
.invways button:active { transform: scale(.96); }

.qrbig { background: #fff; border-radius: 16px; padding: 10px; margin: 8px auto; width: min(260px, 70vw); }
.qrbig svg { width: 100%; height: auto; display: block; }

/* ── 0.20 Date of birth ── */
.dob { display: grid; grid-template-columns: 1fr 1.6fr 1.3fr; gap: 8px; margin-bottom: 4px; }
.dob select { min-height: 46px; min-width: 0; width: 100%; padding-inline: 8px; }
.dobhint { font-size: 13px; color: var(--mut); min-height: 18px; margin-bottom: 8px; }
.dobrow { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.dobrow span { font-weight: 600; }
.dobedit { margin-bottom: 10px; }
/* an LTR field (email / phone / password) inside a right-to-left page: keep the room for the icon on the icon's side */
[dir=rtl] .field input[dir=ltr], [dir=rtl] .field input.ltr { padding-left: 14px; padding-right: 40px; }
[dir=ltr] .field input[dir=ltr], [dir=ltr] .field input.ltr { padding-left: 40px; padding-right: 14px; }
/* invite buttons: 5 in a row when there is room, else 3 + 2 */
.invite { container-type: inline-size; }
@container (max-width: 400px) {
  .invways { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .invways button:nth-child(-n+3) { grid-column: span 2; }
  .invways button:nth-child(n+4) { grid-column: span 3; flex-direction: row; min-height: 48px; gap: 8px; }
}
/* ── 0.20.2 daughter / son choice ── */
.glabel { margin-top: 12px; }
.gpick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 6px 0 10px; }
.gpick button { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px 10px; min-height: 120px; border-radius: 18px;
  border: 2px solid var(--line); background: var(--card); color: var(--tx); font: inherit; font-weight: 700; font-size: 16px; cursor: pointer; }
.gpick button img { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; background: var(--or-soft); }
.gpick button.on { border-color: var(--or); background: var(--or-soft); box-shadow: 0 0 0 3px color-mix(in srgb, var(--or) 25%, transparent); }
.gpick button:focus-visible { outline: 3px solid var(--or); outline-offset: 2px; }
/* ── 0.21 screenshots allowed for a while ── */
.shotbtns { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
.shotbtns .btn { min-height: 44px; justify-content: center; }
.shoton { display: flex; align-items: center; gap: 8px; margin: 6px 0; font-weight: 700; color: var(--green); }
.shoton svg { flex: none; }
/* bell number sits beside the bell, not on top of it */
.iconbtn .badge { top: -1px; inset-inline-end: -3px; height: 20px; min-width: 20px; border-radius: 10px; border: 2px solid var(--bg, #FFF6EC); box-sizing: border-box; font-size: 10.5px; line-height: 1; }
/* Phones: the sign-in form comes right under the logo (it was below the feature list); the features go under the form */
@media (max-width: 959px) {
  .auth .hero { display: contents; }
  .auth .hero .langs { order: 0; width: 100%; max-width: 280px; margin: 0 auto 10px; }
  .auth .biglogo { order: 0; width: 52px; height: 52px; }
  .auth h1 { order: 0; font-size: 26px; margin: 2px 0 0; text-align: center; }
  .auth .hero p { order: 0; text-align: center; margin: 0 0 14px; font-size: 14px; max-width: 420px; }
  .auth .box { order: 1; }
  .auth .feats { order: 2; margin-top: 22px; width: 100%; max-width: 380px; padding: 0 6px; }
}
