/* start page + the map stage shared by login and live (js/pages/start.js), design "V4 Start".
   Owned by the "start" page builder (docs/UI_V4.md). Every class starts with st- (all page CSS files load at once). */

/* ---------- Full-screen map ---------- */
.st-map { position: fixed; inset: 0; z-index: 0; background: #0b0b0b; }
.st-map.leaflet-container { background: #0b0b0b; font-family: var(--font-ui); }
/* No black hairlines between the tiles at a fractional zoom (fitting every place, a flight, a pinch): Chrome drew
   the tile edges a pixel short, and the dark background showed through. A transparent outline keeps each tile's
   edge whole; the tiles are not scaled, so nothing gets blurred. */
:is(.st-map, .pl-map) img.leaflet-tile { outline: 1px solid transparent; }
:is(.st-map, .pl-map) .leaflet-control-attribution {
  background: rgba(0, 0, 0, .6) !important; color: var(--muted-2) !important; font-family: var(--font-ui); font-size: 11px;
}
:is(.st-map, .pl-map) .leaflet-control-attribution a { color: var(--muted) !important; }
:is(.st-map, .pl-map) .leaflet-control-zoom { border: none !important; margin: 0 0 20px 20px !important; }
/* English: the zoom buttons sit in the bottom-right corner (start.js zoomCorner), the 20px on the right */
:root[dir="ltr"] :is(.st-map, .pl-map) .leaflet-control-zoom { margin: 0 20px 20px 0 !important; }
:is(.st-map, .pl-map) .leaflet-control-zoom a {
  width: 44px !important; height: 44px !important; line-height: 44px !important; border-radius: 50% !important;
  background: var(--card) !important; color: var(--text) !important; border: none !important; margin-top: 8px; font-size: 20px !important;
}
:is(.st-map, .pl-map) .leaflet-tooltip.st-tip {
  background: var(--card); color: var(--text); border: none; border-radius: var(--r-pill); padding: 6px 12px;
  font-family: var(--font-ui); font-size: var(--fs-small); box-shadow: none; white-space: nowrap;
}
:is(.st-map, .pl-map) .leaflet-tooltip.st-tip::before { display: none; }
.st-pin { position: relative; width: 28px; height: 28px; }
.st-pin-dot { position: absolute; inset: 0; border-radius: 50%; background: var(--ac); border: 4px solid #000; box-shadow: 0 0 0 2px var(--ac); }
.st-pin-pulse {
  position: absolute; inset: -18px; border-radius: 50%; background: var(--ac); opacity: .35;
  animation: m-pulse 1.8s var(--ease) infinite;
}
.st-comp { width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 3px solid #000; }

/* ---------- Floating panel (desktop: the start side, right in Arabic; phone: bottom sheet 64vh) ---------- */
.st-panel {
  position: fixed; top: 20px; inset-inline-start: 20px; bottom: 20px; width: min(460px, calc(100vw - 40px)); z-index: 500;
  background: var(--card); border-radius: var(--r-shell); padding: 28px; display: flex; flex-direction: column; gap: 18px;
  overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; box-shadow: 0 30px 60px rgba(0, 0, 0, .6);
}
.st-brand { display: flex; align-items: center; gap: 10px; flex: none; }
/* Login / start: the full logo, big and centred above the form (js/pages/start.js mapStage {logo: true}) */
.st-logo { flex: none; display: flex; justify-content: center; height: 140px; }
.st-logo .bf { width: 112px; }
@media (max-width: 700px) { .st-logo { height: 84px; } .st-logo .bf { width: 68px; } }
.st-steppill {
  margin-inline-start: auto; white-space: nowrap; font-size: var(--fs-small); padding: 3px 10px;
  border-radius: var(--r-pill); border: 1px solid var(--raised); color: var(--muted);
}
.st-dots {
  position: fixed; inset-inline-end: calc((100vw - min(460px, calc(100vw - 40px)) - 20px) / 2); bottom: 24px;
  transform: translateX(calc(-50% * var(--flip)));
  z-index: 500; display: flex; gap: 8px; padding: 10px 14px; border-radius: var(--r-pill); background: var(--card);
}
.st-dots span { width: 8px; height: 8px; border-radius: 50%; background: var(--dot-off); transition: width var(--t-tab), background var(--t-tab); }
.st-dots span.on { width: 24px; border-radius: var(--r-pill); background: var(--white); }

.st-step { display: flex; flex-direction: column; gap: 18px; animation: m-rise var(--t-sheet) var(--ease) both; }
.st-intro { display: flex; flex-direction: column; gap: 8px; }
.st-h1 { font-size: 32px; font-weight: 400; line-height: 1.35; }
.st-h2 { font-size: 26px; font-weight: 400; line-height: 1.4; overflow-wrap: anywhere; }
.st-mute { color: var(--muted); font-size: var(--fs-ui); line-height: 1.7; }
.st-tag { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-meta); color: var(--ac); }
.st-tag .ph { font-size: 16px; }
.st-hint { font-size: var(--fs-small); color: var(--muted-2); line-height: 1.6; }

/* Pill field (design .pill) */
.st-linkfield .st-field-ic { font-size: 20px; color: var(--muted-2); flex: none; }
.st-linkfield input { direction: ltr; text-align: right; /* dir-ok: an LTR link field on the Arabic reading side */ }
:root[dir="ltr"] .st-linkfield input { text-align: left; }
.st-linkfield .btn, .st-codefield .btn { flex: none; }

/* Inline error / warning / info line (design .err) */
.st-err {
  display: flex; gap: 8px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-inner);
  background: var(--alert-red-bg); color: var(--bad-text); font-size: var(--fs-meta); line-height: 1.6;
}
.st-err > .ph { font-size: 18px; flex: none; margin-top: 1px; }
.st-err.warn { background: var(--alert-amber-bg); color: var(--alert-amber-text); }
.st-err.info { background: var(--card-2); color: var(--soft); }
.st-err-extra a { color: inherit; font-weight: 500; }

/* "How to copy the link" (design .how) */
.st-how { display: flex; flex-direction: column; border-radius: var(--r-tile-sm); background: var(--card-2); padding: 4px 16px; }
.st-how div {
  display: flex; gap: 12px; align-items: center; padding: 12px 0; font-size: var(--fs-ui); line-height: 1.6;
  color: var(--soft-2); border-bottom: 1px solid var(--divider);
}
.st-how div:last-child { border: none; }
.st-how b { font-family: var(--font-num); font-weight: 500; font-size: 22px; color: var(--ac); width: 22px; flex: none; }

/* Checklist rows (design .load .lrow) */
.st-load { display: flex; flex-direction: column; gap: 12px; }
.st-loadbox { display: flex; flex-direction: column; gap: 12px; }
.st-lrow { display: flex; align-items: center; gap: 12px; font-size: var(--fs-ui); color: var(--muted-2); }
.st-lrow-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.st-lrow-sub { font-size: var(--fs-small); color: var(--muted-2); }
.st-ic {
  width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--raised); flex: none;
  display: grid; place-items: center;
}
.st-ic .ph { font-size: 14px; font-weight: 700; }
.st-lrow.run, .st-lrow.ok, .st-lrow.fail { color: var(--text); }
.st-lrow.run .st-ic { border-color: var(--ac); border-top-color: transparent; animation: m-spin .8s linear infinite; }
.st-lrow.ok .st-ic { background: var(--ac); border-color: var(--ac); color: var(--ink); }
.st-lrow.fail .st-ic { background: var(--bad); border-color: var(--bad); color: var(--ink); }
.st-slow { font-size: var(--fs-small); color: var(--muted-2); line-height: 1.6; }
.st-spin {
  display: inline-block; width: 18px; height: 18px; border-radius: 50%; border: 2px solid currentColor;
  border-top-color: transparent; animation: m-spin .8s linear infinite; flex: none;
}

/* Quota strip (design .quota .q) */
.st-quota { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.st-q { border-radius: 18px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.st-q-sk { background: var(--card-2); min-height: 62px; justify-content: center; }
.st-qt { display: flex; justify-content: space-between; align-items: center; gap: 4px 8px; flex-wrap: wrap; font-size: var(--fs-small); }
.st-qbar { display: block; height: 5px; border-radius: var(--r-pill); background: #E3E3E3; overflow: hidden; }
.st-qbar i { display: block; height: 100%; width: var(--w, 0%); background: #000; border-radius: var(--r-pill); }
.st-qn { font-size: 22px; white-space: nowrap; }
.st-qn .st-qu { font-family: var(--font-ui); font-size: var(--fs-small); font-weight: 400; }
.st-qword { font-size: var(--fs-meta); font-weight: 500; white-space: nowrap; }
.st-qsub { font-size: var(--fs-tiny); color: var(--ink-2); }
.st-qd { display: flex; gap: 3px; }
.st-qd i { flex: 1; height: 5px; border-radius: var(--r-pill); background: #E3E3E3; }
.st-qd i.on { background: #000; }

/* Step 2: chips, tiles, rows, choices, confirm (design #s2) */
.st-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.st-chip {
  display: inline-flex; align-items: center; min-height: 36px; padding: 6px 14px; border-radius: var(--r-pill);
  background: var(--card-2); color: var(--text); font-size: var(--fs-meta); line-height: 1.4;
}
.st-chip.open { background: var(--tag-good); color: var(--good-text); }
.st-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.st-tile {
  border-radius: var(--r-tile-sm); padding: 14px; display: flex; flex-direction: column; justify-content: space-between;
  gap: 12px; min-height: 110px; min-width: 0;
}
.st-tile-label { font-size: var(--fs-meta); line-height: 1.4; }
.st-tile-num { font-size: 36px; }
.st-tile-num.long { font-size: 28px; }
.st-tile-wait { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-ui); font-size: var(--fs-meta); font-weight: 400; }
.st-tile-wait .st-spin { width: 14px; height: 14px; }
.st-rows { display: flex; flex-direction: column; border-radius: var(--r-tile-sm); background: var(--card-2); padding: 2px 16px; }
.st-row {
  display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; font-size: var(--fs-ui);
  border-bottom: 1px solid var(--divider); line-height: 1.6;
}
.st-row:last-child { border: none; }
.st-row > span:first-child { color: var(--muted-2); flex: none; }
.st-row > span:last-child { text-align: left; min-width: 0; overflow-wrap: anywhere; /* dir-ok: the end side (the
   coordinates span is dir=ltr, where `end` would be right); English below */ }
:root[dir="ltr"] .st-row > span:last-child { text-align: right; }
.st-choices { display: flex; flex-direction: column; gap: 14px; }
.st-choice { display: flex; flex-direction: column; gap: 8px; }
.st-choice-label { font-size: var(--fs-ui); }
.st-choice .seg { display: flex; width: 100%; }
.st-choice .seg button { flex: 1; padding: 0 8px; }
.st-confirm { display: flex; flex-direction: column; gap: 10px; padding-top: 4px; }
.st-ask { font-size: 16px; }
.st-btns { display: flex; gap: 8px; }
.st-btns .btn-ac { flex: 1; }
/* English: the longer button words may not fit side by side on a phone: the second button goes under the first and
   both fill their line; side by side, «yes» still takes all the free room (1000 : 1) */
:where(:root[dir="ltr"]) .st-btns { flex-wrap: wrap; }
:where(:root[dir="ltr"]) .st-btns .btn-ac { flex: 1000 1 auto; }
:where(:root[dir="ltr"]) .st-btns .btn:not(.btn-ac) { flex: 1 1 auto; }
.st-human { overflow: hidden; border-radius: var(--r-inner); flex: none; }
.st-blocked { display: flex; flex-direction: column; gap: 10px; }
.st-row-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Account line under step 1 (design .acct) */
.st-acct { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: var(--fs-small); color: var(--muted); }
.st-acct-name { display: inline-flex; align-items: center; gap: 6px; margin-inline-end: auto; }
.st-acct-name .ph { font-size: 16px; color: var(--muted-2); }
.st-acct-link {
  border: none; background: transparent; color: var(--muted-2); font: inherit; font-size: var(--fs-small); cursor: pointer;
  text-decoration: underline; text-underline-offset: 3px; padding: 0;
}
.st-acct-link:hover { color: var(--text); }

@media (max-width: 700px) {
  .st-panel {
    top: auto; inset-inline: 10px; bottom: 10px; width: auto; max-height: 64vh; max-height: 64dvh;
    padding: 22px; border-radius: var(--r-sheet); gap: 16px; padding-bottom: max(22px, env(safe-area-inset-bottom));
  }
  .st-dots { display: none !important; }
  .st-map .leaflet-control-zoom { display: none; }
  .st-h1 { font-size: 26px; }
  .st-h2 { font-size: 22px; }
  .st-tile { padding: 12px; min-height: 100px; }
  .st-tile-num { font-size: 28px; }
  .st-tile-num.long { font-size: 21px; }
  .st-choice .seg button { height: 44px; padding: 0 4px; font-size: var(--fs-small); }
  .st-acct-link { min-height: 44px; display: inline-flex; align-items: center; padding: 0 6px; }
  .st-acct-name { min-height: 44px; }
}
