:root {
  --bg: var(--tg-theme-secondary-bg-color, #f2f3f5);
  --card: var(--tg-theme-bg-color, #ffffff);
  --text: var(--tg-theme-text-color, #15171a);
  --hint: var(--tg-theme-hint-color, #8a9099);
  --link: var(--tg-theme-link-color, #2481cc);
  --accent: #FFC72C;          /* taksi sarig'i */
  --accent-text: #1a1a1a;
  --green: #22a45d;
  --red: #e5484d;
  --blue: #2f80ed;
  --line: color-mix(in srgb, var(--hint) 20%, transparent);
  --soft: color-mix(in srgb, var(--hint) 10%, var(--card));
  --r: 18px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.35 -apple-system, system-ui, "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: var(--link); text-decoration: none; }

/* ---- Ekran tuzilishi ---- */
#screen { min-height: 100vh; }
.bar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 8px; min-height: 56px;
  padding: 8px 12px; background: var(--bg); }
.bar h1 { flex: 1; margin: 0; font-size: 19px; font-weight: 700; }
.back { width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--card); font-size: 20px; }
.steps { display: flex; gap: 4px; padding: 0 16px 6px; }
.steps i { flex: 1; height: 4px; border-radius: 4px; background: var(--line); }
.steps i.on { background: var(--accent); }
.body { padding: 4px 16px 120px; max-width: 560px; margin: 0 auto; }
.q { font-size: 26px; font-weight: 800; margin: 10px 0 18px; line-height: 1.2; }
.foot { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(to top, var(--bg) 70%, transparent); }
.foot .inner { max-width: 560px; margin: 0 auto; }
.loading { display: flex; justify-content: center; padding-top: 40vh; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent);
  animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Tugmalar ---- */
.btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 54px; border: 0;
  border-radius: 16px; font-size: 17px; font-weight: 700; background: var(--soft); }
.btn.primary { background: var(--accent); color: var(--accent-text); }
.btn.green { background: var(--green); color: #fff; }
.btn.blue { background: var(--blue); color: #fff; }
.btn.danger { background: transparent; color: var(--red); font-weight: 600; min-height: 46px; }
.btn.sm { min-height: 44px; font-size: 15px; border-radius: 12px; }
.btn:disabled { opacity: .5; }
.gap { height: 10px; }

/* ---- Bosh ekran ---- */
.hello { padding: 18px 16px 6px; }
.hello small { color: var(--hint); font-size: 15px; }
.hello b { display: block; font-size: 26px; font-weight: 800; margin-top: 2px; }
.mode { display: flex; background: var(--card); border-radius: 14px; padding: 4px; margin: 10px 16px 0; }
.mode button { flex: 1; border: 0; background: none; padding: 10px; border-radius: 10px; font-weight: 600; color: var(--hint); }
.mode button.on { background: var(--accent); color: var(--accent-text); }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 14px 16px; }
.tile { position: relative; text-align: left; border: 0; border-radius: var(--r); background: var(--card); padding: 16px;
  min-height: 128px; display: flex; flex-direction: column; justify-content: space-between; }
.tile .ic { font-size: 34px; line-height: 1; }
.tile b { font-size: 17px; display: block; }
.tile small { color: var(--hint); font-size: 13px; }
.tile.big { grid-column: span 2; min-height: 108px; background: var(--accent); color: var(--accent-text);
  flex-direction: row; align-items: center; }
.tile.big small { color: #0009; }
.tile.big .ic { font-size: 46px; }
.tile .num { position: absolute; top: 12px; right: 12px; min-width: 26px; height: 26px; padding: 0 8px; border-radius: 13px;
  background: var(--accent); color: var(--accent-text); font-size: 14px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.tile.big .num { background: #1a1a1a; color: var(--accent); }
.sec { padding: 6px 16px 0; font-size: 14px; font-weight: 700; color: var(--hint); text-transform: uppercase; letter-spacing: .4px; }

/* ---- Ro'yxat qatorlari (yo'nalish va h.k.) ---- */
.list { background: var(--card); border-radius: var(--r); overflow: hidden; }
.item { display: flex; align-items: center; gap: 14px; width: 100%; border: 0; background: none; text-align: left;
  padding: 16px; border-bottom: 1px solid var(--line); min-height: 64px; }
.item:last-child { border-bottom: 0; }
.item .ic { font-size: 26px; width: 34px; text-align: center; }
.item .t { flex: 1; }
.item .t b { display: block; font-size: 18px; }
.item .t small { color: var(--hint); font-size: 14px; }
.item .p { font-weight: 800; font-size: 16px; white-space: nowrap; }
.item .p small { display: block; color: var(--hint); font-weight: 400; font-size: 12px; text-align: right; }
.item.on { background: color-mix(in srgb, var(--accent) 22%, var(--card)); }

/* ---- Katta tanlov tugmalari ---- */
.grid { display: grid; gap: 10px; }
.g4 { grid-template-columns: repeat(4, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.opt { border: 2px solid transparent; background: var(--card); border-radius: 16px; padding: 14px 6px; font-size: 17px;
  font-weight: 700; text-align: center; }
.opt small { display: block; font-size: 12px; font-weight: 500; color: var(--hint); margin-top: 2px; }
.opt.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 22%, var(--card)); }
.opt.huge { font-size: 30px; padding: 22px 0; }
.opt.wide { width: 100%; display: flex; align-items: center; gap: 12px; text-align: left; padding: 18px; font-size: 18px; }
.opt.wide .ic { font-size: 28px; }
.opt.wide small { display: block; text-align: left; }
.seg { display: flex; background: var(--card); border-radius: 14px; padding: 4px; margin-bottom: 14px; }
.seg button { flex: 1; border: 0; background: none; padding: 11px 4px; border-radius: 10px; font-weight: 600; font-size: 15px; }
.seg button.on { background: var(--accent); color: var(--accent-text); }
.hint { color: var(--hint); font-size: 14px; margin: 10px 2px; }
input, textarea { width: 100%; border: 2px solid transparent; background: var(--card); color: var(--text); border-radius: 14px;
  padding: 15px; font-size: 17px; font-family: inherit; outline: none; }
input:focus { border-color: var(--accent); }

/* ---- "Bilet" kartasi ---- */
.ticket { background: var(--card); border-radius: var(--r); padding: 18px; margin-bottom: 12px; }
.ticket.tap { cursor: pointer; }
.trow { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.route { font-size: 21px; font-weight: 800; line-height: 1.2; }
.route .arr { color: var(--accent); filter: brightness(.85); }
.meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: 15px; }
.meta span { display: inline-flex; align-items: center; gap: 5px; }
.addr { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); font-size: 15px; display: grid; gap: 8px; }
.addr div { display: flex; gap: 10px; }
.addr .dot { flex: 0 0 10px; height: 10px; border-radius: 50%; margin-top: 6px; background: var(--green); }
.addr .dot.to { background: var(--red); }
.price { font-size: 22px; font-weight: 800; white-space: nowrap; text-align: right; }
.price small { font-size: 13px; font-weight: 500; color: var(--hint); display: block; text-align: right; }
.pill { display: inline-block; padding: 5px 11px; border-radius: 20px; font-size: 13px; font-weight: 700; white-space: nowrap;
  background: var(--soft); color: var(--hint); }
.pill.new, .pill.published { background: color-mix(in srgb, var(--accent) 30%, var(--card)); color: #8a6200; }
.pill.taken { background: color-mix(in srgb, var(--blue) 18%, var(--card)); color: var(--blue); }
.pill.done { background: color-mix(in srgb, var(--green) 18%, var(--card)); color: var(--green); }
.pill.cancelled, .pill.expired { background: color-mix(in srgb, var(--red) 14%, var(--card)); color: var(--red); }
.pill.dist { background: var(--accent); color: var(--accent-text); }
.seats { letter-spacing: 2px; }
.small { color: var(--hint); font-size: 13px; }
.addlink { display: block; width: 100%; border: 2px dashed var(--line); background: none; border-radius: 14px; padding: 14px;
  font-weight: 600; color: var(--hint); margin-top: 10px; }

/* ---- Holat ekrani ---- */
.status { text-align: center; padding: 18px 10px 22px; }
.status .big { font-size: 24px; font-weight: 800; margin-top: 14px; }
.status p { color: var(--hint); margin: 6px 0 0; }
.radar { position: relative; width: 110px; height: 110px; margin: 0 auto; }
.radar::before, .radar::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--accent);
  opacity: .35; animation: pulse 2s ease-out infinite; }
.radar::after { animation-delay: 1s; }
.radar span { position: absolute; inset: 25px; border-radius: 50%; background: var(--accent); display: flex;
  align-items: center; justify-content: center; font-size: 30px; z-index: 1; }
@keyframes pulse { from { transform: scale(.5); opacity: .6; } to { transform: scale(1.3); opacity: 0; } }
.okic { width: 96px; height: 96px; margin: 0 auto; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 44px; background: color-mix(in srgb, var(--green) 18%, var(--card)); }
.driver { display: flex; gap: 14px; align-items: center; }
.ava { flex: 0 0 54px; height: 54px; border-radius: 50%; background: var(--accent); color: var(--accent-text);
  display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 800; }
.driver b { font-size: 18px; display: block; }
.car { display: inline-block; margin-top: 4px; padding: 3px 8px; border-radius: 8px; background: var(--soft); font-size: 14px; font-weight: 600; }
.code { font-size: 34px; font-weight: 800; letter-spacing: 8px; text-align: center; margin: 6px 0; }
.stars { display: flex; justify-content: center; gap: 6px; }
.stars button { border: 0; background: none; font-size: 36px; padding: 0; filter: grayscale(1); opacity: .5; }
.stars button.on { filter: none; opacity: 1; }
.empty { text-align: center; padding: 50px 20px; color: var(--hint); }
.empty .e { font-size: 54px; margin-bottom: 10px; }
.chiprow { display: flex; gap: 8px; overflow-x: auto; padding: 2px 16px 12px; margin: 0 -16px; scrollbar-width: none; }
.chiprow::-webkit-scrollbar { display: none; }
.chip { flex: 0 0 auto; border: 0; background: var(--card); border-radius: 20px; padding: 9px 16px; font-weight: 600; font-size: 15px; }
.chip.on { background: var(--accent); color: var(--accent-text); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }

/* ---- Xarita oynalari ---- */
.overlay { position: fixed; inset: 0; z-index: 100; background: var(--bg); }
.hidden { display: none !important; }
#pmap, #vmap { position: absolute; inset: 0; }
#ppin { position: absolute; left: 50%; top: 50%; z-index: 1000; pointer-events: none; transform: translate(-50%, -100%); }
.pin { width: 30px; height: 30px; border-radius: 50% 50% 50% 0; background: var(--accent); border: 3px solid #1a1a1a;
  transform: rotate(-45deg); box-shadow: 0 4px 10px #0004; }
.mbtn { border: 0; background: #fff; color: #1a1a1a; box-shadow: 0 2px 10px #0003; border-radius: 14px; font-size: 20px;
  width: 50px; height: 50px; flex: 0 0 50px; }
#ptop { position: absolute; top: 12px; left: 12px; right: 12px; z-index: 1001; display: flex; gap: 8px; }
#ptop input { background: #fff; color: #222; box-shadow: 0 2px 10px #0003; padding: 13px; }
#pres { position: absolute; top: 72px; left: 12px; right: 12px; z-index: 1001; background: #fff; color: #222;
  border-radius: 14px; box-shadow: 0 2px 10px #0003; max-height: 45%; overflow: auto; }
#pres div { padding: 13px 14px; border-bottom: 1px solid #eee; font-size: 15px; }
.round { position: absolute; right: 12px; z-index: 1001; border-radius: 50%; }
#player { bottom: 232px; } #pme { bottom: 172px; font-size: 26px; }
#pbottom { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1001; background: var(--card); border-radius: 22px 22px 0 0;
  padding: 16px 16px calc(14px + env(safe-area-inset-bottom, 0px)); box-shadow: 0 -4px 20px #0002; }
.psub { color: var(--hint); font-size: 13px; }
#paddr { font-size: 17px; font-weight: 700; min-height: 24px; margin: 2px 0 12px; }
#vtop { position: absolute; top: 12px; left: 12px; right: 12px; z-index: 1001; display: flex; gap: 10px; align-items: center; }
#vtitle { background: #fff; color: #222; padding: 13px 14px; border-radius: 14px; box-shadow: 0 2px 10px #0003; font-weight: 600; flex: 1; }
.leaflet-popup-content { font-size: 15px; line-height: 1.4; min-width: 200px; }
.leaflet-popup-content .btn { margin-top: 10px; min-height: 44px; }

/* ---- Pastki oyna va xabar ---- */
#sheet { position: fixed; inset: 0; z-index: 150; }
.sheet-bg { position: absolute; inset: 0; background: #0006; }
.sheet-box { position: absolute; left: 0; right: 0; bottom: 0; background: var(--bg); border-radius: 24px 24px 0 0;
  padding: 22px 16px calc(16px + env(safe-area-inset-bottom, 0px)); max-width: 560px; margin: 0 auto; animation: up .2s ease-out; }
.sheet-box h3 { margin: 0 0 14px; font-size: 21px; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
#toast { position: fixed; left: 16px; right: 16px; top: calc(14px + env(safe-area-inset-top, 0px)); z-index: 300; max-width: 528px;
  margin: 0 auto; background: #1f2227; color: #fff; padding: 14px 16px; border-radius: 14px; font-size: 15px; font-weight: 600;
  box-shadow: 0 6px 20px #0004; animation: up .2s ease-out; }

/* ---- APK: kirish ekrani ---- */
.login { min-height: 100vh; display: flex; flex-direction: column; align-items: center; text-align: center; padding: 0 24px; }
.login .logo { margin-top: 14vh; width: 110px; height: 110px; border-radius: 30px; background: var(--accent); font-size: 60px;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 10px 30px color-mix(in srgb, var(--accent) 45%, transparent); }
.login h1 { font-size: 30px; font-weight: 800; margin: 22px 0 6px; }
.login p { color: var(--hint); margin: 0; max-width: 320px; }
.lbox { width: 100%; max-width: 400px; margin-top: auto; padding-bottom: 20px; }
.links { text-align: center; padding: 18px 16px calc(18px + env(safe-area-inset-bottom, 0px)); font-size: 14px; color: var(--hint); }

/* ---- v3: bosh ekran qo'shimchalari ---- */
.hello { display: flex; align-items: center; justify-content: space-between; }
.gear { width: 46px; height: 46px; border: 0; border-radius: 50%; background: var(--card); font-size: 22px; }
.tile.wide { grid-column: span 2; min-height: 0; flex-direction: row; align-items: center; gap: 14px; padding: 14px 16px; }
.tile.wide .ic { font-size: 28px; } .tile.wide > div { flex: 1; } .tile .p { color: var(--hint); font-size: 22px; }
.quick { display: grid; gap: 8px; padding: 8px 16px 0; }
.qbtn { display: flex; align-items: center; gap: 12px; border: 0; background: var(--card); border-radius: 16px; padding: 14px 16px; text-align: left; }
.qbtn span { font-size: 22px; } .qbtn b { flex: 1; font-size: 17px; } .qbtn small { color: var(--hint); font-size: 13px; }
.banner { display: flex; align-items: center; gap: 12px; margin: 0 16px 12px; padding: 14px 16px; border-radius: 18px; background: var(--card); cursor: pointer; }
.banner .bi { font-size: 28px; } .banner b { display: block; font-size: 16px; } .banner small { color: var(--hint); font-size: 13px; }
.banner .go { color: var(--link); font-weight: 700; font-size: 14px; white-space: nowrap; }
.banner.live { background: color-mix(in srgb, var(--green) 14%, var(--card)); cursor: default; }
.bar2 { height: 6px; border-radius: 6px; background: var(--line); margin-top: 8px; overflow: hidden; }
.bar2 i { display: block; height: 100%; background: var(--accent); border-radius: 6px; }
.switchrow { display: flex; align-items: center; gap: 12px; margin: 12px 16px 0; padding: 14px 16px; border-radius: 18px; background: var(--card); cursor: pointer; }
.switchrow .bi { font-size: 24px; } .switchrow b { display: block; font-size: 16px; } .switchrow small { color: var(--hint); font-size: 13px; }
.switch { flex: 0 0 52px; height: 30px; border-radius: 15px; background: var(--line); position: relative; transition: .2s; }
.switch i { position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px #0003; transition: .2s; }
.switch.on { background: var(--green); } .switch.on i { left: 25px; }
.today { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 10px 16px 0; }
.today > div { background: var(--card); border-radius: 18px; padding: 14px 16px; }
.today small { color: var(--hint); font-size: 13px; display: block; } .today b { font-size: 20px; }
.disp { display: block; margin: 4px 16px 0; padding: 14px 16px; border-radius: 16px; background: var(--card); color: var(--text); text-align: center; font-size: 15px; }
.xbtn { border: 0; background: var(--soft); width: 36px; height: 36px; border-radius: 50%; color: var(--hint); font-size: 15px; }
.list .item small { display: block; }
label.btn { cursor: pointer; }
.photo { display: block; width: 100%; max-height: 260px; object-fit: cover; border-radius: 16px; margin-bottom: 4px; }
.photo.sm { max-height: 140px; margin-top: 12px; }
.hint.warn { background: color-mix(in srgb, var(--accent) 16%, var(--card)); border-radius: 14px; padding: 12px 14px; color: var(--text); font-size: 13px; }

/* ---- Holat chizig'i ---- */
.timeline { padding: 14px 18px; }
.tl { display: flex; align-items: center; gap: 12px; position: relative; padding: 7px 0; color: var(--hint); font-size: 15px; }
.tl i { flex: 0 0 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line); background: var(--card); z-index: 1; }
.tl:not(:last-child)::after { content: ""; position: absolute; left: 6px; top: 24px; bottom: -7px; width: 2px; background: var(--line); }
.tl.ok { color: var(--text); } .tl.ok i { background: var(--green); border-color: var(--green); }
.tl.ok:not(:last-child)::after { background: var(--green); }
.tl.cur { color: var(--text); font-weight: 700; } .tl.cur i { border-color: var(--accent); background: var(--accent); animation: blink 1.4s infinite; }
@keyframes blink { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 35%, transparent); } }
.okic.pulse { animation: blink 1.4s infinite; }

/* ---- Jonli xarita ---- */
.lmapbox { background: var(--card); border-radius: var(--r); overflow: hidden; margin-bottom: 12px; }
#lmap { height: 230px; }
.lmapinfo { padding: 10px 14px; font-size: 14px; color: var(--hint); }
.caric { font-size: 30px; line-height: 36px; text-align: center; filter: drop-shadow(0 2px 3px #0005); }

/* ---- Katta shriftga chidamlilik (telefon sozlamasida shrift kattalashtirilganda) ---- */
.trow { flex-wrap: wrap; row-gap: 6px; }
.trow > .route { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.trow > .pill { flex-shrink: 0; margin-left: auto; }
.trow > .price { margin-left: auto; }
.trow > .meta { flex: 1 1 auto; min-width: 0; }
.qbtn b { min-width: 0; overflow-wrap: anywhere; }
.tile b, .tile small { overflow-wrap: anywhere; }
.hello > div { min-width: 0; } .hello b { overflow-wrap: anywhere; }
.btn { text-align: center; line-height: 1.2; padding: 8px 12px; }
