/* Yetkaz: white, green accent, mobile-first. System fonts (CSP allows only same-origin). */
:root {
  --green: #0b8f5a; --green-dark: #077347; --green-soft: #e4f5ec; --yellow: #ffcc00;
  --ink: #111417; --ink-2: #4a5159; --ink-3: #8a9199; --line: #e6e8eb; --bg: #f4f5f7; --card: #ffffff;
  --red: #d7263d; --blue: #1a73e8; --radius: 14px; --shadow: 0 6px 24px rgba(17, 20, 23, .10);
  --sheet-w: 420px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 15px/1.45 -apple-system, "Segoe UI", Roboto, Inter, "Helvetica Neue", Arial, sans-serif; color: var(--ink); background: var(--bg); -webkit-tap-highlight-color: transparent; }
a { color: var(--green); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
h1, h2, h3 { margin: 0 0 8px; line-height: 1.2; }
h1 { font-size: 22px; } h2 { font-size: 18px; } h3 { font-size: 15px; }
p { margin: 0 0 8px; }
.muted { color: var(--ink-2); } .small { font-size: 13px; } .tiny { font-size: 12px; color: var(--ink-3); }
.row { display: flex; gap: 10px; align-items: center; }
.row.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.right { text-align: right; }
.sr { position: absolute; left: -9999px; }

/* top bar */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: #fff; border-bottom: 1px solid var(--line); flex-wrap: nowrap; }
.nav a, .nav button { white-space: nowrap; }
@media (max-width: 560px) { .top { padding: 8px 12px; gap: 6px; } .nav a, .nav button { padding: 6px 7px; font-size: 13px; } .nav .hide-sm { display: none; } .brand { font-size: 16px; } }
.brand { display: flex; align-items: center; gap: 8px; color: var(--ink); font-weight: 700; font-size: 18px; }
.brand .mark { width: 30px; height: 30px; border-radius: 9px; background: var(--green); display: grid; place-items: center; color: #fff; }
.brand .mark svg { width: 18px; height: 18px; }
.brand small { font-weight: 400; color: var(--ink-3); font-size: 12px; display: none; }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a, .nav button { padding: 7px 10px; border-radius: 10px; background: none; border: 0; color: var(--ink-2); font-weight: 500; }
.nav a[aria-current], .nav a:hover, .nav button:hover { background: var(--green-soft); color: var(--green-dark); }
.langs { display: flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.langs button { border: 0; background: #fff; padding: 6px 9px; font-size: 12px; font-weight: 600; color: var(--ink-3); }
.langs button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.ava { width: 32px; height: 32px; border-radius: 50%; background: var(--green-soft); color: var(--green-dark); display: grid; place-items: center; font-weight: 700; font-size: 13px; border: 0; }
@media (min-width: 720px) { .brand small { display: inline; } }

/* layout: map + sheet */
body.has-map { display: flex; flex-direction: column; height: 100dvh; }
.layout { position: relative; flex: 1; min-height: 0; overflow: hidden; }
.layout #map { position: absolute; inset: 0; }
#map { background: #e9ecef; z-index: 0; } /* own stacking context: Leaflet panes (z 400+) stay under the sheet */
.sheet { position: absolute; left: 0; right: 0; bottom: 0; z-index: 10; max-height: 72%; overflow: auto; background: #fff; border-radius: 18px 18px 0 0; box-shadow: 0 -6px 30px rgba(0,0,0,.15); padding: 10px 16px 20px; }
.sheet::before { content: ""; display: block; width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: 0 auto 10px; }
.map-tools { position: absolute; right: 12px; top: 12px; z-index: 5; display: flex; flex-direction: column; gap: 8px; }
.map-btn { width: 42px; height: 42px; border-radius: 12px; border: 0; background: #fff; box-shadow: var(--shadow); display: grid; place-items: center; }
.map-btn svg { width: 20px; height: 20px; }
.center-pin { position: absolute; left: 50%; top: 50%; z-index: 6; transform: translate(-50%, -100%); pointer-events: none; }
.pick-bar { position: absolute; left: 12px; right: 12px; top: 12px; z-index: 7; background: #fff; border-radius: 12px; padding: 10px 12px; box-shadow: var(--shadow); display: flex; gap: 10px; align-items: center; }
@media (min-width: 900px) {
  .layout { display: block; }
  .sheet { left: 16px; right: auto; top: 16px; bottom: 16px; width: var(--sheet-w); max-height: none; border-radius: var(--radius); box-shadow: var(--shadow); padding-top: 16px; }
  .sheet::before { display: none; }
  .pick-bar { left: calc(var(--sheet-w) + 32px); right: 16px; }
}

/* pins on the map */
.pin { width: 30px; height: 40px; position: relative; }
.pin span { position: absolute; left: 0; top: 0; width: 30px; height: 30px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); box-shadow: 0 3px 8px rgba(0,0,0,.3); font-size: 0; }
.pin-from span { background: var(--green); } .pin-to span { background: var(--ink); } .pin-pick span { background: var(--blue); }
.pin::after { position: absolute; left: 0; top: 5px; width: 30px; text-align: center; color: #fff; font-weight: 700; font-size: 14px; }
.pin-from::after { content: "A"; } .pin-to::after { content: "B"; } .pin-pick::after { content: "+"; font-size: 18px; top: 3px; }
.pin-courier { width: 34px; height: 34px; border-radius: 50%; background: #fff; border: 3px solid var(--blue); display: grid; place-items: center; font-size: 17px; box-shadow: 0 3px 10px rgba(0,0,0,.25); }
.leaflet-container { font: inherit; }
.leaflet-control-attribution { font-size: 10px; }

/* forms */
label { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 4px; }
.field { display: block; width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; outline: 0; }
.field:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(11,143,90,.15); }
textarea.field { resize: vertical; min-height: 60px; }
.addr { position: relative; }
.addr .field { padding-left: 40px; }
.addr .tag { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 12px; font-weight: 700; }
.addr.a .tag { background: var(--green); } .addr.b .tag { background: var(--ink); }
.addr .pick { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: var(--green-soft); color: var(--green-dark); border-radius: 8px; padding: 5px 8px; font-size: 12px; font-weight: 600; }
.suggest { position: absolute; left: 0; right: 0; top: 100%; z-index: 30; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); margin-top: 4px; overflow: hidden; max-height: 240px; overflow-y: auto; }
.suggest button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.suggest button:last-child { border-bottom: 0; }
.suggest button:hover, .suggest button:focus { background: var(--green-soft); }
.suggest small { display: block; color: var(--ink-3); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 18px; border-radius: 12px; border: 0; font-weight: 600; background: var(--green); color: #fff; }
.btn:hover { background: var(--green-dark); } .btn:disabled { opacity: .5; cursor: default; }
.btn.block { width: 100%; } .btn.ghost { background: var(--bg); color: var(--ink); } .btn.ghost:hover { background: var(--line); }
.btn.danger { background: #fdeaed; color: var(--red); } .btn.danger:hover { background: #f9d3d9; }
.btn.yellow { background: var(--yellow); color: var(--ink); } .btn.yellow:hover { background: #f2c200; }
.btn.sm { padding: 8px 12px; font-size: 13px; border-radius: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 8px 12px; text-align: left; flex: 1 1 calc(50% - 8px); }
.chip b { display: block; } .chip small { color: var(--ink-3); font-size: 12px; }
.chip[aria-pressed="true"] { border-color: var(--green); background: var(--green-soft); }
.chip:disabled { opacity: .45; cursor: default; }
.veh { display: flex; align-items: center; gap: 12px; width: 100%; border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 10px 12px; text-align: left; }
.veh .ico { font-size: 26px; width: 36px; text-align: center; }
.veh b { display: block; } .veh small { color: var(--ink-3); font-size: 12px; }
.veh .price { margin-left: auto; font-weight: 700; white-space: nowrap; }
.veh[aria-pressed="true"] { border-color: var(--green); background: var(--green-soft); }
.veh:disabled { opacity: .45; cursor: default; }
.switch { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; color: var(--ink); }
.switch input { width: 18px; height: 18px; accent-color: var(--green); }
.seg { display: flex; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.seg button { flex: 1; border: 0; background: #fff; padding: 10px; font-weight: 500; }
.seg button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.msg { color: var(--red); font-size: 13px; min-height: 1.2em; margin: 4px 0; }
.ok { color: var(--green-dark); }
.total { display: flex; justify-content: space-between; align-items: baseline; padding: 12px 0; border-top: 1px solid var(--line); margin-top: 6px; }
.total b { font-size: 22px; }
.steps { display: flex; gap: 6px; margin: 0 0 12px; }
.steps i { flex: 1; height: 4px; border-radius: 2px; background: var(--line); }
.steps i.on { background: var(--green); }

/* status / tracking */
.status-card { border-radius: var(--radius); padding: 14px; background: var(--green-soft); margin-bottom: 12px; }
.status-card.cancelled { background: #fdeaed; } .status-card.delivered { background: #e8f0fe; }
.status-card h2 { font-size: 18px; }
.pulse { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--green); margin-right: 6px; animation: pulse 1.4s infinite; vertical-align: middle; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(11,143,90,.5); } 70% { box-shadow: 0 0 0 10px rgba(11,143,90,0); } 100% { box-shadow: 0 0 0 0 rgba(11,143,90,0); } }
.courier-card { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); }
.courier-card .ava { width: 42px; height: 42px; font-size: 18px; }
.addr-list { list-style: none; padding: 0; margin: 10px 0; }
.addr-list li { display: flex; gap: 10px; padding: 6px 0; }
.addr-list .dot { width: 22px; height: 22px; border-radius: 50%; flex: none; display: grid; place-items: center; color: #fff; font-size: 12px; font-weight: 700; }
.addr-list .dot.a { background: var(--green); } .addr-list .dot.b { background: var(--ink); }
.timeline { list-style: none; padding: 0; margin: 10px 0; }
.timeline li { display: flex; gap: 10px; font-size: 13px; padding: 3px 0; color: var(--ink-2); }
.timeline li time { color: var(--ink-3); width: 44px; flex: none; }
.stars { display: flex; gap: 6px; }
.stars button { border: 0; background: none; font-size: 28px; color: #d8dbe0; padding: 0; }
.stars button[aria-pressed="true"] { color: var(--yellow); }
.list { list-style: none; padding: 0; margin: 0; }
.list li { padding: 12px 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.list .st { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 8px; background: var(--bg); }
.st.searching { background: #fff4cc; } .st.assigned, .st.at_pickup, .st.picked_up { background: var(--green-soft); color: var(--green-dark); }
.st.delivered { background: #e8f0fe; color: var(--blue); } .st.cancelled { background: #fdeaed; color: var(--red); }
.clickable { cursor: pointer; } .clickable:hover { background: var(--bg); }

/* dialogs */
dialog.dialog { border: 0; border-radius: var(--radius); padding: 20px; width: min(92vw, 400px); box-shadow: var(--shadow); }
dialog.dialog::backdrop { background: rgba(17,20,23,.45); }
.dialog-close { position: absolute; right: 8px; top: 8px; margin: 0; }
.dialog-close button { border: 0; background: none; font-size: 22px; color: var(--ink-3); width: 32px; height: 32px; }
.code-input { letter-spacing: .4em; font-size: 22px; text-align: center; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 100; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 14px; box-shadow: var(--shadow); }

/* simple pages (courier / track / admin / 404) */
.page { max-width: 720px; margin: 0 auto; padding: 16px; }
.card { background: var(--card); border-radius: var(--radius); padding: 16px; box-shadow: 0 1px 3px rgba(0,0,0,.06); margin-bottom: 12px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.kpi { background: var(--bg); border-radius: 12px; padding: 10px 12px; }
.kpi b { display: block; font-size: 20px; } .kpi span { font-size: 12px; color: var(--ink-3); }
.page-404 { display: grid; place-items: center; height: 100vh; } .code404 { font-size: 64px; font-weight: 800; margin: 0; }
.online-toggle { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--radius); background: var(--ink); color: #fff; }
.online-toggle.on { background: var(--green); }
.online-toggle input { width: 22px; height: 22px; accent-color: #fff; }
.feed-item { padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 10px; background: #fff; }
.feed-item .price { font-size: 20px; font-weight: 700; }
.feed-item.offered { border-color: var(--yellow); background: #fffbe6; }
.offer-tag { display: inline-block; font-size: 12px; font-weight: 700; color: #7a5a00; background: var(--yellow); border-radius: 8px; padding: 2px 8px; margin-bottom: 6px; }

.map-box { height: 220px; border-radius: var(--radius); margin-bottom: 10px; overflow: hidden; }
.map-box.tall { height: 280px; }
.upper { text-transform: uppercase; }
@media (max-width: 560px) { .langs button { padding: 5px 6px; font-size: 11px; } .btn.sm { padding: 7px 10px; } }
.auto-w { width: auto; }
