/* Baraka — tokens
   Layout: sticky navigation, then one wide column per view (max 1180px). The home hero pairs the headline with a live
   map of Algiers; dashboards use a 12-col grid that collapses to one column on phones. */
:root {
  --bg: #F1F5F3;
  --surface: #FFFFFF;
  --surface-2: #F6F9F7;
  --ink: #13221D;
  --muted: #56675F;
  --line: #D9E3DE;
  --accent: #0D6B56;
  --accent-ink: #FFFFFF;
  --accent-soft: #DCEFE8;
  --sun: #B9770E;
  --sun-soft: #FAEED3;
  --crust: #9B4A2E;
  --sky: #2F5D8A;
  --danger: #B0442D;
  --frame: #1B2A25;
  --shadow: 0 24px 48px -28px rgba(13, 50, 40, .35);
  --font-display: "Bricolage Grotesque", "Avenir Next", system-ui, sans-serif;
  --font-body: "Instrument Sans", "Segoe UI", system-ui, sans-serif;
  --font-ar: "Readex Pro", "Geeza Pro", "Noto Sans Arabic", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0D1412; --surface: #141F1B; --surface-2: #19251F; --ink: #E6EFEB; --muted: #9AACA4; --line: #26342F;
    --accent: #3DB394; --accent-ink: #04140F; --accent-soft: #143329; --sun: #E6B04E; --sun-soft: #3A2D14;
    --crust: #D98563; --sky: #7FA9D6; --danger: #E07A62; --frame: #050908; --shadow: 0 24px 48px -28px rgba(0,0,0,.7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0D1412; --surface: #141F1B; --surface-2: #19251F; --ink: #E6EFEB; --muted: #9AACA4; --line: #26342F;
  --accent: #3DB394; --accent-ink: #04140F; --accent-soft: #143329; --sun: #E6B04E; --sun-soft: #3A2D14;
  --crust: #D98563; --sky: #7FA9D6; --danger: #E07A62; --frame: #050908; --shadow: 0 24px 48px -28px rgba(0,0,0,.7);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--font-body); -webkit-font-smoothing: antialiased; }
html[lang="ar"] body { font-family: var(--font-ar); }
html[lang="ar"] :is(h1, h2, h3, .display, .kpi b, .price b, .brand-name) { font-family: var(--font-ar); letter-spacing: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }
img, svg { max-width: 100%; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3 { font-family: var(--font-display); margin: 0; line-height: 1.12; text-wrap: balance; letter-spacing: -0.02em; }
p { margin: 0; }
.num, td, .kpi b { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.tiny { font-size: 12.5px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
[hidden] { display: none !important; }

.wrap { max-width: 1180px; margin: 0 auto; padding-inline: max(20px, env(safe-area-inset-left, 0px)); }

/* Navigation */
.nav { position: sticky; top: 0; z-index: 1000; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.nav .wrap { display: flex; align-items: center; gap: 20px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); flex: none; }
.logo { width: 36px; height: 36px; border-radius: 11px; background: var(--accent); display: grid; place-items: center; }
.brand-name { font-family: var(--font-display); font-weight: 800; font-size: 21px; letter-spacing: -0.02em; }
.links { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; flex: 1; }
.links a { text-decoration: none; color: var(--muted); font-weight: 600; font-size: 14.5px; padding: 8px 12px; border-radius: 10px; white-space: nowrap; }
.links a:hover { color: var(--ink); background: var(--surface-2); }
.links a[aria-current="page"] { color: var(--ink); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.tools { display: flex; gap: 8px; flex: none; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 12px; padding: 10px 16px; font-weight: 650; font-size: 15px; text-decoration: none; line-height: 1.2; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.06); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--surface); }
.btn-sm { padding: 7px 12px; font-size: 13.5px; border-radius: 10px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

main { padding-block: 32px 80px; }
.view { display: flex; flex-direction: column; gap: 72px; }
.section { display: flex; flex-direction: column; gap: 20px; }
.section-head { display: flex; flex-direction: column; gap: 8px; max-width: 720px; }
.section-head h2 { font-size: clamp(26px, 3.4vw, 36px); }
.section-head p { color: var(--muted); font-size: 17px; }
.kicker { font-size: 14px; font-weight: 650; color: var(--accent); }

/* Home hero */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 40px; align-items: center; padding-top: 8px; }
.hero h1 { font-size: clamp(36px, 5.2vw, 62px); font-weight: 800; letter-spacing: -0.035em; }
html[lang="ar"] .hero h1 { line-height: 1.3; }
.hero .lead { font-size: 19px; color: var(--muted); max-width: 54ch; margin-top: 18px; }
.hero .ctas { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.tonight { display: flex; flex-wrap: wrap; gap: 24px; margin-top: 30px; padding-top: 20px; border-top: 1px solid var(--line); }
.tonight div { display: flex; flex-direction: column; }
.tonight b { font-family: var(--font-display); font-size: 28px; line-height: 1.1; }
html[lang="ar"] .tonight b { font-family: var(--font-ar); }
.tonight span { font-size: 13.5px; color: var(--muted); }
.mapcard { position: relative; border-radius: 26px; overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow); background: var(--surface); }
.mapcard .map { height: 520px; }
.clock { position: absolute; z-index: 500; top: 14px; right: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.clock b { font-family: var(--font-mono); font-size: 22px; }
.clock span { font-size: 12.5px; color: var(--muted); }
.map { width: 100%; background: var(--surface-2); }
.leaflet-container { font: inherit; background: var(--surface-2); }
.osm-tiles { filter: saturate(.55) contrast(.95); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .osm-tiles { filter: invert(1) hue-rotate(180deg) saturate(.4) brightness(.85) contrast(.9); } }
:root[data-theme="dark"] .osm-tiles { filter: invert(1) hue-rotate(180deg) saturate(.4) brightness(.85) contrast(.9); }
.pin { width: 30px; height: 30px; border-radius: 50% 50% 50% 4px; transform: rotate(-45deg); display: grid; place-items: center; border: 2px solid #fff; box-shadow: 0 4px 10px rgba(0,0,0,.3); }
.pin span { transform: rotate(45deg); color: #fff; font: 700 12px/1 var(--font-body); }
.pin.pin-off { opacity: .8; }
.leaflet-popup-content-wrapper { border-radius: 14px; background: var(--surface); color: var(--ink); }
.leaflet-popup-tip { background: var(--surface); }
.leaflet-popup-content { margin: 12px 14px; font-size: 14px; line-height: 1.45; }
.leaflet-popup-content b { font-size: 15px; }
html[lang="ar"] .leaflet-popup-content { direction: rtl; text-align: right; font-family: var(--font-ar); }

/* Facts */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 28px 32px; }
.fact { display: flex; flex-direction: column; gap: 8px; padding-top: 14px; border-top: 3px solid var(--accent); }
.fact:nth-child(3n+2) { border-color: var(--sun); }
.fact:nth-child(3n) { border-color: var(--crust); }
.fact b { font-family: var(--font-display); font-size: clamp(30px, 3.6vw, 40px); line-height: 1.05; letter-spacing: -0.02em; }
html[lang="ar"] .fact b { font-family: var(--font-ar); }
.fact p { color: var(--ink); }
.fact cite { font-style: normal; font-size: 12.5px; color: var(--muted); }
.fact cite a { color: var(--muted); }

.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; counter-reset: s; }
.step { padding: 22px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; counter-increment: s; }
.step::before { content: counter(s); width: 32px; height: 32px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 800; }
.step h3 { font-size: 20px; }
.step p { color: var(--muted); }

.audience { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
.audience h3 { font-size: 20px; margin-bottom: 8px; }
.audience ul { margin: 0; padding-inline-start: 18px; color: var(--muted); display: flex; flex-direction: column; gap: 6px; }

.band { background: var(--accent); color: var(--accent-ink); border-radius: 28px; padding: 40px; display: grid; grid-template-columns: minmax(0, 1.4fr) auto; gap: 24px; align-items: center; }
.band h2 { font-size: clamp(24px, 3vw, 34px); }
.band p { opacity: .85; margin-top: 8px; }
.band .btn { background: var(--accent-ink); color: var(--accent); }

/* Dashboard primitives */
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 20px; }
.span-12 { grid-column: span 12; } .span-8 { grid-column: span 8; } .span-7 { grid-column: span 7; } .span-6 { grid-column: span 6; } .span-5 { grid-column: span 5; } .span-4 { grid-column: span 4; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 22px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.panel-head h3 { font-size: 18px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; }
.kpi span { font-size: 13.5px; color: var(--muted); }
.kpi b { font-family: var(--font-display); font-size: 28px; line-height: 1.1; letter-spacing: -0.02em; }
.kpi small { font-size: 12.5px; color: var(--accent); font-weight: 600; }
.kpi.hl { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.kpi.hl span, .kpi.hl small { color: var(--accent-ink); opacity: .85; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart text { fill: var(--muted); font-size: 11px; font-family: var(--font-body); }
html[lang="ar"] .chart text { font-family: var(--font-ar); }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-inline-end: 6px; vertical-align: -1px; }
.tbl-wrap { overflow-x: auto; margin-inline: -4px; }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
th, td { text-align: start; padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12.5px; color: var(--muted); font-weight: 650; white-space: nowrap; }
th button { all: unset; cursor: pointer; }
th button:focus-visible { outline: 2px solid var(--accent); }
td.r, th.r { text-align: end; }
tbody tr:hover { background: var(--surface-2); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-inline-end: 8px; }
.bar { height: 6px; border-radius: 6px; background: var(--surface-2); overflow: hidden; min-width: 60px; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 6px; }
.pill { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--sun-soft); color: var(--sun); white-space: nowrap; }
.pill.ok { background: var(--accent-soft); color: var(--accent); }
.pill.off { background: var(--surface-2); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }
.pill.bad { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.note { background: var(--sun-soft); border-radius: 16px; padding: 14px 18px; font-size: 14.5px; }
.note b { font-weight: 700; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13.5px; font-weight: 650; }
.field input, .field select { border: 1px solid var(--line); background: var(--surface-2); border-radius: 12px; padding: 10px 12px; width: 100%; min-width: 0; }
.form { display: flex; flex-direction: column; gap: 12px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.code-entry { display: flex; gap: 8px; }
.code-entry input { flex: 1; min-width: 0; font-family: var(--font-mono); font-size: 22px; letter-spacing: .3em; text-align: center; border: 1px solid var(--line); background: var(--surface-2); border-radius: 14px; padding: 10px; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; direction: ltr; flex: none; }
.stepper button { border: 0; background: var(--surface-2); width: 34px; height: 34px; font-size: 18px; font-weight: 600; }
.stepper span { min-width: 34px; text-align: center; font-weight: 700; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.list-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.list-row:last-child { border-bottom: 0; }
.stars { color: var(--sun); letter-spacing: 1px; }

/* Phone demo */
.app-stage { display: flex; flex-wrap: wrap; gap: 48px; justify-content: center; align-items: flex-start; }
.phone { width: min(390px, 100%); height: 800px; border: 10px solid var(--frame); border-radius: 46px; background: var(--surface); display: flex; flex-direction: column; overflow: hidden; position: relative; box-shadow: var(--shadow); flex: none; }
.notch { height: 28px; flex: none; display: flex; justify-content: center; background: var(--surface); }
.notch span { width: 110px; height: 22px; background: var(--frame); border-radius: 0 0 14px 14px; }
.screen { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 4px 18px 24px; scrollbar-width: thin; position: relative; }
.screen.flush { padding: 0; }
.tabbar { flex: none; display: grid; grid-template-columns: repeat(5, 1fr); border-top: 1px solid var(--line); background: var(--surface); padding: 6px 6px 14px; }
.tabbar button { position: relative; border: 0; background: none; padding: 8px 2px; font-size: 11.5px; font-weight: 650; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 3px; border-radius: 10px; }
.tabbar button[aria-current="true"] { color: var(--accent); }
.tabbar svg { width: 22px; height: 22px; }
.toast { position: absolute; left: 14px; right: 14px; bottom: 86px; background: var(--ink); color: var(--bg); padding: 12px 14px; border-radius: 14px; font-size: 14px; font-weight: 550; transform: translateY(16px); opacity: 0; transition: .25s ease; pointer-events: none; z-index: 900; }
.toast.show { transform: none; opacity: 1; }
.app-head { display: flex; flex-direction: column; gap: 2px; padding: 8px 0 12px; }
.app-head h1 { font-size: 25px; }
.loc { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); }
.seg { display: grid; grid-template-columns: 1fr 1fr; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 3px; margin-bottom: 12px; }
.seg button { border: 0; background: none; padding: 7px; border-radius: 9px; font-weight: 650; font-size: 13.5px; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin: 0 -18px 12px; padding-inline: 18px; scrollbar-width: none; }
.chip { flex: none; border: 1px solid var(--line); background: var(--surface); padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 650; color: var(--muted); }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.banner { background: var(--accent-soft); border-radius: 18px; padding: 14px 16px; display: flex; gap: 12px; align-items: center; margin-bottom: 14px; font-size: 14px; }
.banner strong { font-family: var(--font-display); font-size: 30px; color: var(--accent); line-height: 1; }
.cards { display: flex; flex-direction: column; gap: 10px; }
.card { display: grid; grid-template-columns: 60px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 11px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); text-align: start; width: 100%; }
button.card:hover { border-color: var(--accent); }
.card.soldout { opacity: .55; }
.tile { width: 60px; height: 60px; border-radius: 14px; display: grid; place-items: center; font: 800 21px var(--font-display); color: #fff; position: relative; overflow: hidden; }
html[lang="ar"] .tile { font-family: var(--font-ar); }
.tile::after, .hero-tile::after { content: ""; position: absolute; inset: 0; background-image: radial-gradient(circle at 0 0, rgba(255,255,255,.17) 30%, transparent 31%), radial-gradient(circle at 100% 100%, rgba(255,255,255,.17) 30%, transparent 31%); background-size: 16px 16px; }
.tile span, .hero-tile > * { position: relative; z-index: 1; }
.card-main { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.card-title { font-weight: 700; font-size: 15px; line-height: 1.25; }
.card-sub { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-meta { font-size: 12px; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.price { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.price s { font-size: 12px; color: var(--muted); }
.price b { font-family: var(--font-display); font-size: 18px; color: var(--accent); white-space: nowrap; }
.back { border: 0; background: var(--surface-2); width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; margin: 8px 0 12px; }
[dir="rtl"] .back svg { transform: scaleX(-1); }
.hero-tile { height: 150px; border-radius: 22px; display: flex; align-items: flex-end; justify-content: space-between; padding: 16px; color: #fff; position: relative; overflow: hidden; }
.hero-tile .big { font: 800 42px/1 var(--font-display); opacity: .92; }
html[lang="ar"] .hero-tile .big { font-family: var(--font-ar); }
.hero-tile .kind { background: rgba(0,0,0,.25); padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 650; }
.blk { display: flex; flex-direction: column; gap: 8px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.blk:last-of-type { border-bottom: 0; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: 12.5px; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); }
.label { font-size: 13px; font-weight: 650; color: var(--muted); }
.pay { display: flex; flex-direction: column; gap: 8px; }
.pay label { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; font-size: 14px; cursor: pointer; }
.pay label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.pay input { accent-color: var(--accent); }
.cta { width: 100%; border: 0; background: var(--accent); color: var(--accent-ink); font-weight: 700; padding: 14px; border-radius: 16px; font-size: 16px; }
.cta:disabled { opacity: .45; cursor: not-allowed; }
.cta.ghost { background: var(--surface-2); color: var(--ink); border: 1px solid var(--line); }
.sticky-cta { position: sticky; bottom: -24px; background: linear-gradient(transparent, var(--surface) 30%); padding: 18px 0 4px; }
.code-box { text-align: center; padding: 22px 16px; border-radius: 22px; background: var(--accent-soft); display: flex; flex-direction: column; gap: 6px; align-items: center; margin: 8px 0 12px; }
.code-box .code { font: 700 48px var(--font-mono); letter-spacing: .18em; color: var(--accent); direction: ltr; }
.success { width: 56px; height: 56px; border-radius: 50%; background: var(--accent); display: grid; place-items: center; margin: 16px auto 8px; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.stat { background: var(--surface-2); border: 1px solid var(--line); border-radius: 16px; padding: 12px; display: flex; flex-direction: column; gap: 2px; }
.stat b { font: 700 22px/1.15 var(--font-display); }
html[lang="ar"] .stat b { font-family: var(--font-ar); }
.stat span { font-size: 12px; color: var(--muted); }
.stat.hl { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.stat.hl span { color: var(--accent-ink); opacity: .85; }
.phone-map { height: 100%; min-height: 560px; }
.empty { text-align: center; padding: 32px 8px; color: var(--muted); display: flex; flex-direction: column; gap: 12px; align-items: center; }
.guide { width: min(360px, 100%); display: flex; flex-direction: column; gap: 16px; padding-top: 24px; }
.guide h2 { font-size: 30px; }
.guide p { color: var(--muted); }
.guide ol { margin: 0; padding-inline-start: 20px; display: flex; flex-direction: column; gap: 8px; }
.guide .note b { font-family: var(--font-mono); }
html[lang="ar"] .guide .note b { font-family: var(--font-ar); }
.switch { display: flex; align-items: center; gap: 10px; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 14.5px; }
.switch input { accent-color: var(--accent); width: 20px; height: 20px; }

/* Investors */
.sim { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 32px; }
.slider { display: flex; flex-direction: column; gap: 6px; }
.slider label { font-weight: 600; font-size: 14.5px; }
.slider output { font-family: var(--font-mono); font-weight: 700; color: var(--accent); white-space: nowrap; }
.slider input { width: 100%; accent-color: var(--accent); }
.sim-out { display: flex; flex-direction: column; gap: 12px; }
.sim-out .line { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); padding-bottom: 10px; font-size: 14.5px; }
.sim-out .line b { font-family: var(--font-mono); white-space: nowrap; }
.total { background: var(--accent); color: var(--accent-ink); border-radius: 16px; padding: 16px 18px; display: flex; flex-direction: column; gap: 2px; }
.total b { font: 800 34px/1.1 var(--font-display); }
html[lang="ar"] .total b { font-family: var(--font-ar); }
.total span { font-size: 13.5px; opacity: .85; }
.road { display: flex; flex-direction: column; }
.road-item { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 24px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.road-item .when { color: var(--accent); font-weight: 700; font-size: 14.5px; }
.road-item h3 { font-size: 19px; margin-bottom: 4px; }
.road-item p { color: var(--muted); }
.funds { display: flex; height: 18px; border-radius: 9px; overflow: hidden; }
.sources ol { margin: 0; padding-inline-start: 22px; display: flex; flex-direction: column; gap: 12px; }
.sources li { padding-inline-start: 4px; }
.sources a { word-break: break-word; }
.method { max-width: 760px; display: flex; flex-direction: column; gap: 10px; color: var(--muted); }
.method b { color: var(--ink); }

footer { border-top: 1px solid var(--line); padding-block: 28px; color: var(--muted); font-size: 14px; }
footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }

@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; }
  .mapcard .map { height: 420px; }
  .span-8, .span-7, .span-6, .span-5, .span-4 { grid-column: span 12; }
  .sim, .split { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .nav .wrap { flex-wrap: wrap; gap: 6px 12px; padding-block: 10px 6px; }
  .links { order: 3; flex-basis: 100%; margin-inline: -8px; }
  .tools { margin-inline-start: auto; }
  .steps, .audience { grid-template-columns: 1fr; }
  .band { grid-template-columns: 1fr; padding: 28px; }
  .road-item { grid-template-columns: 1fr; gap: 4px; }
  .view { gap: 56px; }
  .panel { padding: 18px; }
}
@media (max-width: 460px) {
  .phone { border-width: 6px; border-radius: 34px; height: 740px; }
  .mapcard .map { height: 360px; }
  .grid2 { grid-template-columns: 1fr; }
}

/* ---- product photos ---- */
img.thumb, img.line-img, img.strip-img, img.row-img, img.pick-img, img.mos-img, img.credit-img, img.hp-main, img.pop-img { display: block; object-fit: cover; background: var(--surface-2); max-width: 100%; }
.card { grid-template-columns: 76px minmax(0, 1fr) auto; }
.thumb-wrap { width: 76px; height: 76px; border-radius: 14px; overflow: hidden; display: block; }
img.thumb { width: 100%; height: 100%; }
.hero-photo { position: relative; height: 210px; border-radius: 22px; overflow: hidden; margin-top: 4px; }
img.hp-main { width: 100%; height: 100%; }
.hero-photo .kind { position: absolute; inset-inline-start: 12px; bottom: 12px; background: rgba(10,20,16,.72); color: #fff; padding: 5px 11px; border-radius: 999px; font-size: 12px; font-weight: 650; }
.hero-photo .kind.off { inset-inline-start: auto; inset-inline-end: 12px; background: var(--danger); }
.strip { display: flex; gap: 6px; overflow-x: auto; padding: 8px 0 2px; scrollbar-width: none; }
img.strip-img { width: 64px; height: 48px; border-radius: 10px; flex: none; }
.lines { display: flex; flex-direction: column; margin: 6px 0 4px; }
.line { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 7px 0; border-bottom: 1px dashed var(--line); }
img.line-img { width: 44px; height: 44px; border-radius: 10px; }
.line-main { display: flex; flex-direction: column; min-width: 0; font-size: 14px; }
.line-q { color: var(--muted); font-size: 13px; }
.line-t { font-weight: 650; font-size: 13.5px; min-width: 64px; text-align: end; }
.line-sum { display: flex; justify-content: space-between; align-items: baseline; font-size: 14px; padding: 3px 0; }
.line-sum s { color: var(--muted); }
.line-sum.big b { font-size: 22px; color: var(--accent); }
.line-sum .save { color: var(--accent); }
.list-row.has-img { grid-template-columns: 56px minmax(0, 1fr) auto; }
img.row-img { width: 56px; height: 56px; border-radius: 12px; }
.leaflet-popup-content img.pop-img { width: 100%; height: 96px; border-radius: 8px; margin-bottom: 6px; }

/* merchant product picker */
.picker { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.pick { display: grid; grid-template-columns: 48px minmax(0, 1fr); grid-template-rows: auto auto; gap: 4px 10px; align-items: center; padding: 8px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.pick.on { border-color: var(--accent); background: var(--accent-soft); }
img.pick-img { width: 48px; height: 48px; border-radius: 10px; grid-row: span 2; }
.pick-main { display: flex; flex-direction: column; min-width: 0; font-size: 13.5px; }
.stepper.sm button { width: 28px; height: 28px; font-size: 16px; }
.stepper.sm span { min-width: 26px; font-size: 14px; }
.pick .stepper { justify-self: start; }

/* home basket showcase */
.baskets { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.basket { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 20px; overflow: hidden; background: var(--surface); color: inherit; text-decoration: none; transition: border-color .15s; }
.basket:hover { border-color: var(--accent); }
.basket:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.mosaic { display: grid; gap: 2px; height: 180px; overflow: hidden; grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr 1fr; }
.mosaic img.mos-img { width: 100%; height: 100%; min-height: 0; }
.mosaic img.mos-img:first-child { grid-row: span 3; }
.mosaic.n1 { grid-template-columns: 1fr; }
.mosaic.n2 { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr; }
.mosaic.n2 img.mos-img:first-child { grid-row: auto; }
.mosaic.n3 { grid-template-rows: 1fr 1fr; }
.mosaic.n3 img.mos-img:first-child { grid-row: span 2; }
.basket-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.basket-name { font-size: 17px; }
.basket ul { list-style: none; margin: 4px 0; padding: 0; display: flex; flex-direction: column; gap: 3px; font-size: 13.5px; color: var(--muted); }
.basket li { display: flex; justify-content: space-between; gap: 8px; }
.basket-foot { margin-top: auto; display: flex; align-items: baseline; gap: 10px; padding-top: 8px; border-top: 1px solid var(--line); }
.basket-foot s { color: var(--muted); font-size: 14px; }
.basket-foot b { font-size: 22px; color: var(--accent); }
.basket-foot .pill { margin-inline-start: auto; }

/* FAQ */
.faq { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 24px; }
.faq details { border-bottom: 1px solid var(--line); padding: 12px 0; }
.faq summary { font-weight: 650; font-size: 16.5px; cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent); font-size: 20px; line-height: 1; }
.faq details[open] summary::after { content: "−"; }
.faq p { color: var(--muted); margin: 8px 0 0; max-width: 60ch; }

/* credits */
.credits h3 { margin-bottom: 4px; }
.credit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin-top: 12px; }
.credit-grid a { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 10px; align-items: center; color: inherit; text-decoration: none; font-size: 13.5px; }
.credit-grid a:hover b { color: var(--accent); }
img.credit-img { width: 56px; height: 42px; border-radius: 8px; }

@media (max-width: 980px) { .baskets { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .faq { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .baskets, .picker { grid-template-columns: 1fr; } }


/* ---- v5: per-product selling, cart, phone chrome ---- */
.notch { display: none; }
.statusbar { flex: none; height: 34px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 0 22px; font: 650 13.5px var(--font-body); color: var(--ink); background: var(--surface); }
.statusbar .island { width: 96px; height: 24px; border-radius: 14px; background: var(--frame); }
.statusbar .sb-icons { justify-self: end; display: flex; gap: 6px; align-items: center; }
.search { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--surface-2); border-radius: 14px; padding: 0 12px; margin-bottom: 12px; }
.search:focus-within { border-color: var(--accent); }
.search svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.search input { flex: 1; min-width: 0; border: 0; background: none; padding: 11px 0; font: inherit; font-size: 15px; color: var(--ink); outline: none; }
.seg.seg3 { grid-template-columns: repeat(3, 1fr); }
.sorts { display: flex; gap: 6px; margin: -4px 0 12px; flex-wrap: wrap; }
.chip.sm { padding: 4px 10px; font-size: 12px; }
.pill.sky { background: color-mix(in srgb, var(--sky) 14%, transparent); color: var(--sky); }
.card-meta .pill { font-size: 11px; }
.res-count { margin: 0 0 8px; }
.warn { color: var(--danger); font-weight: 650; }
.acc { color: var(--accent); }
.ell { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.pgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.pcard { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--surface); display: flex; flex-direction: column; transition: border-color .15s; }
.pcard.in { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.pcard-img { position: relative; border: 0; padding: 0; background: none; display: block; aspect-ratio: 4 / 3; }
img.pimg { width: 100%; height: 100%; display: block; object-fit: cover; }
.pcard-img .off { position: absolute; top: 8px; inset-inline-start: 8px; background: var(--accent); color: var(--accent-ink); font-size: 11.5px; font-weight: 750; padding: 3px 8px; border-radius: 999px; }
.pcard-body { padding: 9px 10px 10px; display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.pname { font-size: 14px; line-height: 1.2; }
.pprice { display: flex; align-items: baseline; gap: 6px; }
.pprice b { font: 700 17px var(--font-display); color: var(--accent); }
.pprice s { font-size: 12px; color: var(--muted); }
.prow { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: auto; padding-top: 4px; }
.add { border: 0; background: var(--accent); color: var(--accent-ink); font-weight: 750; border-radius: 10px; min-width: 32px; height: 30px; padding: 0 10px; font-size: 14px; white-space: nowrap; }
.add:hover { filter: brightness(1.08); }
.stepper.sm { border-color: var(--accent); }

.facts-row { display: flex; gap: 12px; flex-wrap: wrap; font-size: 13.5px; color: var(--muted); }
.uline { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px; border: 1px solid var(--line); border-radius: 14px; margin-top: 6px; }
.uline.in { border-color: var(--accent); background: var(--accent-soft); }
.lines .line .stepper { justify-self: end; }

.cartbar { position: absolute; left: 12px; right: 12px; bottom: 78px; z-index: 800; display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; border: 0; background: var(--ink); color: var(--bg); border-radius: 16px; padding: 10px 14px; text-align: start; box-shadow: 0 12px 28px -12px rgba(0,0,0,.5); }
.cb-n { background: var(--accent); color: var(--accent-ink); border-radius: 10px; min-width: 28px; height: 28px; display: grid; place-items: center; font-weight: 750; }
.cb-t { display: flex; flex-direction: column; font-weight: 700; font-size: 14px; line-height: 1.2; }
.cb-t small { font-weight: 500; opacity: .7; font-size: 11.5px; }
.cartbar b { font: 700 17px var(--font-display); }
.screen.has-bar { padding-bottom: 84px; }
.badge { position: absolute; top: 2px; inset-inline-end: 50%; transform: translateX(16px); background: var(--danger); color: #fff; font-size: 10px; font-weight: 750; min-width: 17px; height: 17px; border-radius: 9px; display: grid; place-items: center; padding: 0 4px; }
[dir="rtl"] .badge { transform: translateX(-16px); }

.cgroup { border: 1px solid var(--line); border-radius: 16px; padding: 10px 12px; margin-bottom: 10px; }
.cg-head { display: flex; flex-direction: column; gap: 1px; padding-bottom: 4px; border-bottom: 1px solid var(--line); }
.link { border: 0; background: none; padding: 0; color: inherit; text-align: start; font: inherit; cursor: pointer; }
.link:hover b, button.row.link:hover span:first-child { color: var(--accent); }
button.row.link { width: 100%; }
img.empty-img { width: 120px; height: 90px; border-radius: 16px; object-fit: cover; opacity: .9; }
.ticket { border: 1px dashed var(--accent); border-radius: 18px; padding: 12px 14px; margin-bottom: 10px; display: flex; flex-direction: column; gap: 6px; }
.ticket .code-box { margin: 4px 0; }
.code-box.sm { padding: 12px; }
.code-box.sm .code { font-size: 34px; }
.ways { display: grid; gap: 10px; }
.ways > div { border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; display: flex; flex-direction: column; gap: 3px; }
.ways span { color: var(--muted); font-size: 14px; }
.picker.p3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.inline { display: flex; align-items: center; gap: 8px; }
.inline select { border: 1px solid var(--line); border-radius: 10px; padding: 6px 8px; background: var(--surface); color: var(--ink); font: inherit; }
.cline { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; grid-template-areas: "img main total" "img q total"; gap: 4px 10px; align-items: center; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.cline img.line-img { grid-area: img; width: 48px; height: 48px; align-self: start; }
.cline .line-main { grid-area: main; }
.cline .line-t { grid-area: total; align-self: start; padding-top: 2px; }
.cline-q { grid-area: q; }
@media (max-width: 980px) { .picker.p3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .picker.p3 { grid-template-columns: 1fr; } }
@media (max-width: 380px) { .pgrid { gap: 8px; } .add { padding: 0 8px; } }

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .toast { transition: none; } }
