/* ============================================================
   Metro Line — application styles
   ============================================================ */

@font-face {
  font-family: "Vazirmatn";
  src: url("../assets/Vazirmatn-Regular.woff2") format("woff2");
  font-weight: 100 500;
  font-display: swap;
}
@font-face {
  font-family: "Vazirmatn";
  src: url("../assets/Vazirmatn-Bold.woff2") format("woff2");
  font-weight: 600 900;
  font-display: swap;
}

:root {
  --background: 42 42% 94.5%;
  --foreground: 40 12% 14%;
  --card: 44 60% 98.2%;
  --card-foreground: 40 12% 16%;
  --popover: 44 58% 98.6%;
  --popover-foreground: 40 12% 15%;
  --primary: 38 92% 50%;
  --primary-foreground: 222 22% 7%;
  --secondary: 42 28% 84%;
  --secondary-foreground: 40 12% 16%;
  --muted: 42 34% 90.5%;
  --muted-foreground: 40 8% 37%;
  --accent: 42 46% 88%;
  --accent-foreground: 40 10% 16%;
  --destructive: 0 72.22% 50.59%;
  --destructive-foreground: 0 0% 98%;
  --border: 40 26% 82%;
  --input: 40 26% 82%;
  --ring: 38 92% 50%;
  --radius: 1rem;
  --bg-grad-bot: rgba(244, 237, 222, 1);
  --bg-grad-top: rgba(244, 237, 222, 0.78);
  --font-default: "Vazirmatn";
  --glass: rgba(255,255,255,0.7);
  --glass-border: rgba(0,0,0,0.06);
}

.dark {
  --background: 222 22% 7%;
  --foreground: 42 18% 96%;
  --muted: 222 16% 14%;
  --muted-foreground: 220 9% 58%;
  --popover: 222 18% 11%;
  --popover-foreground: 42 15% 96%;
  --card: 222 18% 11%;
  --card-foreground: 42 15% 96%;
  --border: 222 14% 16%;
  --input: 222 14% 18%;
  --primary: 38 92% 50%;
  --primary-foreground: 222 22% 7%;
  --secondary: 222 16% 14%;
  --secondary-foreground: 42 15% 94%;
  --accent: 222 16% 18%;
  --accent-foreground: 42 15% 94%;
  --destructive: 0 72% 51%;
  --destructive-foreground: 0 0% 98%;
  --ring: 38 92% 50%;
  --bg-grad-bot: rgba(13, 17, 23, 1);
  --bg-grad-top: rgba(13, 17, 23, 0.85);
  --glass: rgba(22, 28, 42, 0.65);
  --glass-border: rgba(255,255,255,0.08);
}

* { box-sizing: border-box; }
html { color-scheme: light; }
html.dark { color-scheme: dark; }

body {
  margin: 0;
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  font-family: var(--font-default), system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select { font-family: inherit; }
h1, h2, h3, h4, p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

/* ---------- ابزارهای پایه (معادل کلاس‌های Tailwind اصلی) ---------- */
.container {
  width: 100%;
  max-width: 1536px;
  margin: 0 auto;
  padding: 0 1rem;
}
.text-muted { color: hsl(var(--muted-foreground)); }
.border-t { border-top: 1px solid hsl(var(--border) / 0.4); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: calc(var(--radius) - 4px);
  border: 1px solid transparent;
  background: transparent;
  color: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  height: 2.5rem;
  padding: 0 1rem;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}
.btn:hover { background: hsl(var(--accent)); color: hsl(var(--accent-foreground)); }
.btn-icon { width: 2.5rem; padding: 0; }
.btn-outline { border-color: hsl(var(--input)); background: hsl(var(--background)); }
.btn-primary {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  font-weight: 600;
}
.btn-primary:hover { background: hsl(var(--primary) / 0.9); color: hsl(var(--primary-foreground)); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-ghost-sm { height: 2.25rem; width: 2.25rem; padding: 0; }

.card {
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  background: hsl(var(--card));
  color: hsl(var(--card-foreground));
}
.shadow-xl { box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1); }

/* تم روشن: کارت‌ها باید از پس‌زمینهٔ کرمی جدا دیده شوند */
html:not(.dark) .card,
html:not(.dark) .line-acc,
html:not(.dark) .station-row,
html:not(.dark) .opt,
html:not(.dark) .sheet-panel,
html:not(.dark) .st-card,
html:not(.dark) .faq-item {
  box-shadow: 0 1px 1.5px hsl(38 30% 55% / .13), 0 12px 26px -20px hsl(38 40% 32% / .55);
}
html:not(.dark) .bottom-nav { box-shadow: 0 -6px 22px -18px hsl(38 40% 32% / .6); }
html:not(.dark) body { background-color: hsl(var(--background)); }

.label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}
.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid transparent;
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.125rem 0.625rem;
}

/* ---------- هدر ---------- */
header.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  width: 100%;
  border-bottom: 1px solid hsl(var(--border) / 0.4);
  background: hsl(var(--background) / 0.95);
  backdrop-filter: blur(8px);
}
.header-inner {
  height: 3.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.header-inner > * { flex: 1; }
.header-center { display: flex; justify-content: center; }
.header-end { display: flex; justify-content: flex-end; }
.logo { height: 1.25rem; color: hsl(var(--primary)); display: block; }
.logo-lg { height: 4rem; color: inherit; }

/* ---------- منوی همبرگری ---------- */
.drawer {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
}
.drawer.open { display: block; }
.drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgb(0 0 0 / 0.5);
  backdrop-filter: blur(2px);
}
.drawer-panel {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: min(20rem, 88vw);
  background: hsl(var(--card));
  border-left: 1px solid hsl(var(--border));
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  animation: slideInR 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}
html[dir="ltr"] .drawer-panel {
  right: auto;
  left: 0;
  border-left: 0;
  border-right: 1px solid hsl(var(--border));
  animation-name: slideInL;
}
@keyframes slideInR { from { transform: translateX(100%); } to { transform: none; } }
@keyframes slideInL { from { transform: translateX(-100%); } to { transform: none; } }
.drawer-link { text-align: start; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.75rem; }
.drawer-title { font-size: 0.75rem; color: hsl(var(--muted-foreground)); margin-bottom: 0.5rem; }
.drawer-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.75rem;
  border-radius: calc(var(--radius) - 4px);
  font-size: 0.95rem;
}
.drawer-link:hover, .drawer-link.active { background: hsl(var(--accent)); }
.drawer-link svg { width: 1.1rem; height: 1.1rem; }
.drawer-brand-footer {
  display: grid;
  justify-items: center;
  gap: 0.08rem;
  margin-top: auto;
  padding-top: 0.75rem;
  color: hsl(var(--muted-foreground));
  font-size: 0.75rem;
}
.drawer-brand-footer__url { font-size: 0.7rem; letter-spacing: 0.04em; unicode-bidi: isolate; }

/* ---------- هیرو / خانه ---------- */
.hero {
  min-height: calc(100vh - 7.5rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  background-image: linear-gradient(to bottom, var(--bg-grad-top), var(--bg-grad-bot)), url("../assets/back.png");
  background-size: cover, cover;
  background-position: center, center;
  background-repeat: no-repeat, no-repeat;
}
.hero-grid {
  margin: 0 auto;
  max-width: 72rem;
  width: 100%;
  padding: 2rem 0.375rem;
  text-align: center;
}
@media (min-width: 1024px) {
  .hero-grid { display: flex; flex-direction: row-reverse; align-items: center; justify-content: center; gap: 2.5rem; text-align: start; }
}
.hero-tagline {
  margin: 1.25rem auto 0;
  max-width: 350px;
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
  white-space: pre-line;
}
.hero-badges { margin-top: 1.25rem; display: flex; gap: 0.5rem; justify-content: center; flex-wrap: wrap; }
.scroll-hint { margin-bottom: 0.75rem; text-align: center; }
.scroll-hint svg { width: 2rem; height: 2rem; color: hsl(var(--border)); }

/* ---------- فرم مسیریابی ---------- */
.route-card {
  width: calc(100vw - 20px);
  max-width: 350px;
  margin: 1.75rem auto 0;
  padding: 1.5rem;
  text-align: start;
}
@media (min-width: 1024px) { .route-card { margin: 0; } }
.field { margin-bottom: 0.75rem; }
.field-row { display: flex; gap: 0.5rem; }

.combo { position: relative; flex: 1; }
.combo-trigger {
  width: 100%;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0 1rem;
  border: 1px solid hsl(var(--input));
  border-radius: calc(var(--radius) - 4px);
  background: hsl(var(--background));
  color: hsl(var(--muted-foreground));
  font-size: 0.875rem;
  font-weight: 500;
}
.combo-trigger.has-value { color: hsl(var(--foreground)); }
.combo-trigger > span.inner { display: flex; align-items: center; gap: 0.5rem; overflow: hidden; }
.combo-trigger .pin { width: 1rem; height: 1rem; opacity: 0.8; flex: none; }
.combo-trigger .chev { width: 1rem; height: 1rem; opacity: 0.5; flex: none; }
.combo-pop {
  position: absolute;
  z-index: 80;
  inset-inline: 0;
  margin-top: 0.25rem;
  background: hsl(var(--popover));
  color: hsl(var(--popover-foreground));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  box-shadow: 0 10px 40px rgb(0 0 0 / 0.3);
  overflow: hidden;
  display: none;
}
.combo-pop.open { display: block; }
.combo-search {
  width: 100%;
  border: 0;
  border-bottom: 1px solid hsl(var(--border));
  background: transparent;
  color: inherit;
  padding: 0.7rem 0.8rem;
  font-size: 0.9rem;
  outline: none;
}
.combo-list { max-height: 15rem; overflow-y: auto; padding: 0.25rem; }
.combo-item {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 0.6rem;
  border-radius: calc(var(--radius) - 6px);
  font-size: 0.875rem;
  cursor: pointer;
}
.combo-item:hover, .combo-item[aria-selected="true"] { background: hsl(var(--accent)); color: hsl(var(--accent-foreground)); }
.combo-item .en { color: hsl(var(--muted-foreground)); font-size: 0.75rem; }
.combo-empty { padding: 0.75rem; font-size: 0.8rem; color: hsl(var(--muted-foreground)); text-align: center; }

.collapsible-head { display: flex; align-items: center; justify-content: space-between; }
.collapsible-head h4 { font-size: 0.875rem; font-weight: 700; }
.collapsible-body { display: none; padding-top: 0.5rem; }
.collapsible-body.open { display: block; }

.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.35rem 0; }
.switch-row .txt { font-size: 0.85rem; }
.switch {
  position: relative;
  box-sizing: border-box;
  width: 44px;
  height: 26px;
  border-radius: 999px;
  border: 1px solid hsl(var(--input));
  background: hsl(var(--muted));
  padding: 0;
  flex: none;
  transition: background-color 0.15s;
}
.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  inset-inline-start: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: hsl(var(--foreground));
  transition: transform 0.15s;
}
.switch[aria-checked="true"] { background: hsl(var(--primary)); }
.switch[aria-checked="true"]::after { transform: translateX(18px); background: hsl(var(--primary-foreground)); }
html[dir="rtl"] .switch[aria-checked="true"]::after { transform: translateX(-18px); }

select.input, input.input {
  width: 100%;
  height: 2.5rem;
  padding: 0 0.75rem;
  border: 1px solid hsl(var(--input));
  border-radius: calc(var(--radius) - 4px);
  background: hsl(var(--background));
  color: inherit;
  font-size: 0.875rem;
  outline: none;
}
select.input:focus, input.input:focus { box-shadow: 0 0 0 2px hsl(var(--ring) / 0.5); }
.error-text { color: hsl(var(--destructive)); font-size: 0.78rem; margin-top: 0.3rem; }

/* ---------- سوالات متداول ---------- */
.section-wrap { width: 100%; padding: 1rem 1rem; }
@media (min-width: 640px) { .section-wrap { padding-inline: 5rem; } }
.section-title { font-size: 1.875rem; font-weight: 700; color: hsl(var(--border)); }
@media (min-width: 640px) { .section-title { font-size: 2.25rem; } }
.accordion { width: 100%; border: 1px solid hsl(var(--border)); border-radius: var(--radius); background: hsl(var(--card)); text-align: start; }
.acc-item { border-bottom: 1px solid hsl(var(--border)); padding: 0 1rem; }
.acc-item:last-child { border-bottom: 0; }
.acc-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  background: none;
  border: 0;
  color: inherit;
  padding: 1rem 0;
  font-size: 1rem;
  font-weight: 500;
  text-align: start;
}
.acc-trigger:hover { text-decoration: underline; }
.acc-trigger svg { width: 1rem; height: 1rem; transition: transform 0.2s; flex: none; }
.acc-item.open .acc-trigger svg { transform: rotate(180deg); }
.acc-body { display: none; padding-bottom: 1rem; font-size: 0.95rem; }
.acc-item.open .acc-body { display: block; }

/* ---------- تغییرات ---------- */
.changelog { padding: 1rem; font-size: 1.125rem; }
.changelog li { display: flex; justify-content: space-between; gap: 2.5rem; }
.changelog .date { color: hsl(var(--muted-foreground)); white-space: nowrap; min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.changelog li { min-width: 0; }
html[dir="ltr"] .changelog .date { font-size: .76rem; }

/* ---------- نوار پایین موبایل (مطابق مارک‌آپ اصلی) ---------- */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  min-height: 4rem;
  border-top: 1px solid hsl(var(--border) / 0.4);
  background: hsl(var(--background));
}
.bn-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  max-width: 32rem;
  margin-inline: auto;
  padding: 0.5rem 0;
}
.bn-item {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-inline: 1.25rem;
  color: hsl(var(--foreground));
}
.bn-pill {
  display: flex;
  height: 1.75rem;
  width: 3.5rem;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  padding: 0.25rem 0;
}
.bn-item:hover .bn-pill { background: hsl(var(--muted)); }
.bn-item.active .bn-pill { background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); }
.bn-item svg { width: 1.25rem; height: 1.25rem; }
.bn-label { margin-top: 0.25rem; font-size: 0.75rem; line-height: 1rem; white-space: nowrap; }
.bn-item.active .bn-label { font-weight: 700; }
html.dark .bn-item.active .bn-label { color: hsl(var(--primary)); }
body { padding-bottom: 5.25rem; }

/* ---------- صفحه نتیجه ---------- */
.page { max-width: 56rem; margin: 0 auto; padding: 1.25rem 1rem 3rem; }
.page-title { font-size: 1.4rem; font-weight: 700; }

.summary-card { padding: 1.25rem; margin-bottom: 1rem; }
.summary-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.summary-route { font-size: 1.1rem; font-weight: 700; }
.summary-metrics { display: flex; gap: 1.5rem; margin-top: 1rem; flex-wrap: wrap; }
.metric { min-width: 6rem; }
.metric .k { font-size: 0.75rem; color: hsl(var(--muted-foreground)); }
.metric .v { font-size: 1.35rem; font-weight: 700; }
.metric .v small { font-size: 0.8rem; font-weight: 500; color: hsl(var(--muted-foreground)); }
.wait-badge {
  display: inline-flex; align-items: center; gap: 0.35rem;
  border: 1px solid hsl(var(--border)); border-radius: 999px;
  padding: 0.15rem 0.6rem; font-size: 0.75rem; color: hsl(var(--muted-foreground));
}

.leg { padding: 1rem 1.25rem; margin-bottom: 0.75rem; }
.leg-head { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.line-chip {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 2.4rem; height: 2.4rem; padding: 0 0.5rem;
  border-radius: 0.6rem; font-weight: 700; color: #fff;
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1);
}
.line-chip.sm { min-width: 1.6rem; height: 1.6rem; border-radius: 0.45rem; font-size: 0.75rem; }
.towards { font-size: 0.85rem; color: hsl(var(--muted-foreground)); }
.hint {
  margin-top: 0.6rem; padding: 0.55rem 0.75rem;
  border-inline-start: 3px solid hsl(var(--primary));
  background: hsl(var(--muted) / 0.6);
  border-radius: 0.4rem; font-size: 0.85rem;
}
.stations { margin-top: 0.75rem; }
.station-line { display: flex; align-items: center; gap: 0.6rem; padding: 0.18rem 0; font-size: 0.9rem; }
.station-line .dot { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: currentColor; opacity: 0.5; flex: none; }
.station-line .dot.hollow { background: transparent; border: 2px solid currentColor; opacity: 0.9; width: 0.55rem; height: 0.55rem; }
.station-line .t { margin-inline-start: auto; font-variant-numeric: tabular-nums; color: hsl(var(--muted-foreground)); font-size: 0.8rem; }
.alert {
  border: 1px solid hsl(var(--destructive) / 0.5);
  background: hsl(var(--destructive) / 0.1);
  color: hsl(var(--foreground));
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}
.alert strong { display: block; margin-bottom: 0.25rem; }
.actions { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 1rem; }

/* رنگ‌های خطوط — مطابق CSS اصلی */
.l1, .l1w { background-color: rgb(220 38 38); }
.l2 { background-color: rgb(67 56 202); }
.l3 { background-color: rgb(2 132 199); }
.l4, .l4s { background-color: rgb(234 179 8); }
.l5, .l5w { background-color: rgb(22 163 74); }
.l6 { background-color: rgb(236 72 153); }
.l7 { background-color: rgb(162 28 175); }
.l1-text, .l1w-text { color: rgb(185 28 28); }
.dark .l1-text, .dark .l1w-text { color: rgb(252 165 165); }
.l2-text { color: rgb(67 56 202); } .dark .l2-text { color: rgb(165 180 252); }
.l3-text { color: rgb(3 105 161); } .dark .l3-text { color: rgb(186 230 253); }
.l4-text, .l4s-text { color: rgb(161 98 7); } .dark .l4-text, .dark .l4s-text { color: rgb(254 249 236); }
.l5-text, .l5w-text { color: rgb(21 128 61); } .dark .l5-text, .dark .l5w-text { color: rgb(134 239 172); }
.l6-text { color: rgb(190 24 93); } .dark .l6-text { color: rgb(249 168 212); }
.l7-text { color: rgb(162 28 175); } .dark .l7-text { color: rgb(240 171 252); }

/* ---------- لیست خطوط ---------- */
.line-card { margin-bottom: 0.85rem; overflow: hidden; }
.line-card-head {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.85rem 1rem;
}
.line-card-head .title { font-weight: 700; }
.line-card-head .desc { font-size: 0.78rem; color: hsl(var(--muted-foreground)); }
.line-card-body { padding: 0.5rem 1rem 1rem; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.station-pill {
  display: inline-flex; align-items: center; gap: 0.35rem;
  font-size: 0.8rem; padding: 0.25rem 0.6rem;
  border: 1px solid hsl(var(--border)); border-radius: 999px;
}
.station-pill:hover { background: hsl(var(--accent)); }
.station-pill.transfer { border-color: hsl(var(--primary) / 0.6); font-weight: 600; }

/* ---------- جزئیات ایستگاه ---------- */
.detail-grid { display: grid; gap: 1rem; }
@media (min-width: 768px) { .detail-grid { grid-template-columns: 1.2fr 1fr; } }
.kv { display: flex; gap: 0.5rem; font-size: 0.9rem; padding: 0.3rem 0; }
.kv .k { color: hsl(var(--muted-foreground)); min-width: 5rem; }
.facilities li { display: flex; align-items: center; gap: 0.5rem; font-size: 0.88rem; padding: 0.2rem 0; }
.time-grid { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.time-pill { font-size: 0.75rem; padding: 0.15rem 0.5rem; border-radius: 0.4rem; background: hsl(var(--muted)); font-variant-numeric: tabular-nums; }

/* ---------- نقشه شماتیک (canvas) ---------- */
.map-shell { position: relative; height: calc(100vh - 7rem); overflow: hidden; background: hsl(var(--background)); }
#mapCanvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
#mapCanvas.dragging { cursor: grabbing; }
.map-tools { position: absolute; top: 0.75rem; inset-inline-start: 0.75rem; display: flex; flex-direction: column; gap: 0.35rem; }
.map-tools button {
  width: 2rem; height: 2rem; border-radius: 0.4rem;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--card) / 0.9); color: inherit; font-size: 1.1rem; line-height: 1;
}

/* ---------- نقشه ایستگاه‌ها ---------- */
/* ---------- نقشه ایستگاه‌ها (/stations-map) ---------- */
.smap-wrap { position: relative; height: calc(100dvh - 7.5rem); width: 100%; overflow: hidden;
  background: hsl(var(--muted)); }
#stationsMap { position: absolute; inset: 0; width: 100%; background: hsl(var(--muted)); z-index: 0; }
.smap-wrap .leaflet-container { background: hsl(var(--muted)); font-family: inherit; }
/* پن‌ها LTR باشند تا لِی‌آوتِ Leaflet درست بماند؛ متنِ برچسب‌ها جداگانه RTL/LTR می‌شود */
.smap-wrap .leaflet-pane { direction: ltr; }
.smap-wrap .leaflet-control-attribution { font-size: 0.55rem; background: hsl(var(--background) / 0.7); color: hsl(var(--muted-foreground)); }
.smap-wrap .leaflet-bottom.leaflet-right { bottom: 0; }
.smap-wrap .leaflet-control-attribution a { color: hsl(var(--muted-foreground)); }

.smap-legend {
  position: absolute; z-index: 500; bottom: 1.35rem; left: 0.5rem; right: 0.5rem;
  display: flex; gap: 0.28rem; justify-content: center;
  padding: 0.32rem; border-radius: 0.8rem;
  overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
  background: hsl(var(--background) / 0.85); backdrop-filter: blur(10px);
  border: 1px solid hsl(var(--border) / 0.6); box-shadow: 0 8px 24px #00000033;
}
.smap-legend::-webkit-scrollbar { display: none; }
.smap-chip {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 0.22rem; cursor: pointer;
  padding: 0.24rem 0.46rem; border-radius: 999px; font-size: 0.7rem; font-weight: 800;
  border: 1px solid hsl(var(--border)); background: hsl(var(--card));
  color: hsl(var(--muted-foreground)); font-family: inherit;
  transition: transform 0.16s cubic-bezier(.22,1,.36,1), opacity 0.16s, background 0.16s, color 0.16s;
  -webkit-tap-highlight-color: transparent;
}
.smap-chip i { width: 0.62rem; height: 0.62rem; border-radius: 999px; background: var(--lc); display: block;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--lc) 25%, transparent); transition: box-shadow 0.16s; }
.smap-chip.on { color: hsl(var(--foreground)); }
.smap-chip.on i { box-shadow: 0 0 0 3px color-mix(in srgb, var(--lc) 30%, transparent); }
.smap-chip:not(.on) { opacity: 0.42; }
.smap-chip:not(.on) i { background: hsl(var(--muted-foreground)); }
.smap-chip:active { transform: scale(0.94); }

/* کلیدهای بالای نقشه (نام ایستگاه‌ها / قطارهای زنده) */
.smap-tools {
  position: absolute; z-index: 500; top: 0.7rem; right: 0.6rem;
  display: flex; flex-direction: column; gap: 0.35rem; align-items: stretch;
}
.smap-tool {
  display: inline-flex; align-items: center; gap: 0.35rem; cursor: pointer;
  padding: 0.34rem 0.6rem; border-radius: 0.7rem; font-family: inherit;
  font-size: 0.7rem; font-weight: 700; white-space: nowrap;
  color: hsl(var(--muted-foreground)); background: hsl(var(--background) / 0.86);
  border: 1px solid hsl(var(--border) / 0.7); backdrop-filter: blur(10px);
  box-shadow: 0 4px 14px #00000026;
  transition: transform 0.16s cubic-bezier(.22,1,.36,1), color 0.16s, background 0.16s, border-color 0.16s;
  -webkit-tap-highlight-color: transparent;
}
.smap-tool svg { width: 0.95rem; height: 0.95rem; }
.smap-tool.on { color: #10151c; background: hsl(var(--primary)); border-color: hsl(var(--primary)); }
.smap-tool:active { transform: scale(0.95); }

/* نشانگر زندهٔ قطارها */
.smap-live {
  position: absolute; z-index: 500; top: 0.7rem; left: 3.2rem;
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.3rem 0.55rem; border-radius: 999px;
  font-size: 0.68rem; font-weight: 700; color: hsl(var(--foreground));
  background: hsl(var(--background) / 0.86); border: 1px solid hsl(var(--border) / 0.7);
  backdrop-filter: blur(10px); box-shadow: 0 4px 14px #00000026;
  animation: aFadeIn 0.25s ease-out both;
}
.smap-live[hidden] { display: none; }
.smap-live b { color: hsl(var(--primary)); font-variant-numeric: tabular-nums; }
.smap-live span { color: hsl(var(--muted-foreground)); }
.smap-live.idle b { color: hsl(var(--muted-foreground)); }
.smap-live.idle { border-color: hsl(var(--border)); }

/* آیکون قطار روی نقشه */
.train-marker { background: none; border: 0; transition: transform 0.18s linear; will-change: transform; }
.smap-wrap.panning .train-marker { transition: none; }
.train-pin {
  position: relative; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 999px;
  background:
    radial-gradient(circle at 32% 26%, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0) 62%),
    var(--lc);
  box-shadow: 0 0 0 2px #fff, 0 3px 10px rgba(0, 0, 0, 0.45), inset 0 0 0 1px rgba(255, 255, 255, 0.28);
  transform: translateZ(0);
}
.train-pin::before {
  content: ""; position: absolute; inset: -5px; border-radius: 999px;
  background: color-mix(in srgb, var(--lc) 22%, transparent);
  z-index: -1;
}
/* قطار در ایستگاه: مارکر به حلقهٔ توخالی تبدیل می‌شود تا نقطهٔ ایستگاه زیرش پنهان نشود */
.train-pin.at-station {
  background: transparent;
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--lc), 0 2px 8px rgba(0, 0, 0, .28);
  transform: scale(1.06);
}
/* فلش جهت روی حلقه می‌نشیند تا هم جهت معلوم باشد هم نقطهٔ مشکی ایستگاه وسطش دیده شود */
.train-pin.at-station .train-arrow {
  width: 11px; height: 11px; stroke-width: 3.2; stroke: #16202c;
  filter: drop-shadow(0 0 1.2px #fff) drop-shadow(0 0 1.2px #fff);
}
.train-pin.at-station .train-dir .train-arrow { transform: translateY(-9px); }
/* هالهٔ نرم قرمز چشمک‌زن: نشانهٔ «قطار متوقف است» */
.train-pin.at-station::after {
  content: ""; position: absolute; inset: -7px; border-radius: 999px;
  border: 2px solid #ef4444; pointer-events: none;
  animation: stopPulse 1.7s ease-out infinite;
}
@keyframes stopPulse {
  0%   { transform: scale(.82); opacity: 0; }
  35%  { opacity: .75; }
  100% { transform: scale(1.28); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .train-pin.at-station::after { animation: none; opacity: .55; transform: scale(1.05); }
}
.train-dir { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.train-pin .pin-core { display: none; }
.train-pin.at-station .pin-core {
  display: block; position: absolute; width: 7px; height: 7px; border-radius: 999px;
  background: #000; box-shadow: 0 0 0 1.6px #fff;
}
.train-pin.at-station .train-arrow { opacity: 0; }
.train-pin.at-station::before { background: transparent; }
.train-pin.express.at-station { box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px #f97316, 0 2px 8px rgba(0, 0, 0, .3); }
.train-pin.express {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px #f97316, 0 3px 12px rgba(0, 0, 0, 0.45);
}
.train-pin.express::after {
  content: ""; position: absolute; inset: -8px; border-radius: 999px;
  border: 2px dashed #f97316; animation: expressSpin 6s linear infinite;
  pointer-events: none;
}
@keyframes expressSpin { to { transform: rotate(360deg); } }
.popup-chip.express { background: #f97316 !important; color: #fff !important; }

.train-arrow {
  width: 12px; height: 12px; stroke: #fff; stroke-width: 2.9; fill: none;
  stroke-linecap: round; stroke-linejoin: round;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.35));
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

/* برچسب نام ایستگاه روی نقشه */
.leaflet-tooltip.smap-label {
  background: hsl(var(--card)); color: hsl(var(--card-foreground));
  border: 1px solid hsl(var(--border)); border-radius: 0.45rem;
  padding: 0.08rem 0.32rem; font-size: 0.62rem; font-weight: 750; direction: rtl;
  box-shadow: 0 2px 8px #00000035; white-space: nowrap; pointer-events: none;
}
.leaflet-tooltip.smap-label::before { display: none; }

/* چیپ‌های خط داخل پاپ‌آپ */
.popup-chips { display: flex; gap: 0.25rem; margin-top: 0.3rem; }
.popup-chip { display: inline-block; min-width: 1.15rem; height: 1.15rem; border-radius: 0.3rem;
  color: #fff; font-size: 0.68rem; font-weight: 800; text-align: center; line-height: 1.15rem; }
.leaflet-container { font-family: inherit; }
html[dir="ltr"] .leaflet-tooltip.smap-label { direction: ltr; }
.leaflet-popup-content { direction: rtl; text-align: right; }
html[dir="ltr"] .leaflet-popup-content { direction: ltr; text-align: left; }
.popup-title { font-weight: 700; }
.popup-en { font-size: 0.75rem; color: #666; }
.popup-link { display: inline-block; margin-top: 0.35rem; color: #0b6; font-size: 0.8rem; }

/* ---------- اسپینر ---------- */
.spinner-wrap { display: flex; justify-content: center; padding: 4rem 0; }
.spinner {
  width: 2.2rem; height: 2.2rem; border-radius: 50%;
  border: 3px solid hsl(var(--border));
  border-top-color: hsl(var(--primary));
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- توست ---------- */
.toast-wrap { position: fixed; bottom: 5.5rem; inset-inline: 0; display: flex; flex-direction: column; align-items: center; gap: 0.4rem; z-index: 200; pointer-events: none; }
.toast {
  background: hsl(var(--card)); border: 1px solid hsl(var(--border));
  border-radius: var(--radius); padding: 0.6rem 1rem; font-size: 0.85rem;
  box-shadow: 0 10px 30px rgb(0 0 0 / 0.3); animation: toastIn 0.2s ease;
}
.toast.err { border-color: hsl(var(--destructive)); }
@keyframes toastIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- کمکی ---------- */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.hero-logo { height: 4rem; color: hsl(var(--foreground)); }

/* آیکون تم */
html.dark #themeBtn .icon-sun { display: none; }
html.dark #themeBtn .icon-moon { display: block !important; }
html:not(.dark) #themeBtn .icon-moon { display: none; }


/* ============================================================
   ابزارک‌های کوچک (معادل کلاس‌های Tailwind استفاده‌شده در صفحات خطوط)
   ============================================================ */
.mx-auto { margin-inline: auto; }
.max-w-3xl { max-width: 48rem; }
.p-4 { padding: 1rem; }
.w-full { width: 100%; }
.space-y-4 > * + * { margin-top: 1rem; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-row { flex-direction: row; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: .25rem; }
.gap-2 { gap: .5rem; }
.gap-4 { gap: 1rem; }
.self-stretch { align-self: stretch; }
.shrink-0 { flex-shrink: 0; }
.h-4 { height: 1rem; } .w-4 { width: 1rem; }
.h-6 { height: 1.5rem; } .w-6 { width: 1.5rem; }
.text-center { text-align: center; }
.text-start { text-align: start; }
.font-bold { font-weight: 700; }
.metro { font-family: var(--font-default); }
.persian-digit { font-feature-settings: "ss01"; }

/* ---------- صفحهٔ خطوط (/stations) — آکاردئون تابلوها ---------- */
.line-acc {
  border: 0;
  border-radius: calc(var(--radius) + .15rem);
  background: hsl(var(--card));
  overflow: hidden;
  box-shadow: 0 1px 2px hsl(38 30% 55% / .10), 0 16px 34px -28px hsl(38 40% 32% / .6);
}
.dark .line-acc { box-shadow: 0 10px 26px -22px #000; }
.line-acc-head {
  appearance: none; border: 0; width: 100%; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .8rem 1rem; border-radius: 0;
  color: #fff; text-align: start; font-family: inherit; font-weight: 800; line-height: 1.4;
  transition: filter .18s ease;
}
.line-acc-head:active { filter: brightness(.94); }
.line-acc-title { display: block; font-size: 1rem; font-weight: 800; }
.line-acc-desc { display: block; font-size: .72rem; font-weight: 400; opacity: .8; }
@media (min-width: 640px) {
  .line-acc-title { font-size: 1.25rem; }
  .line-acc-desc { font-size: .8rem; }
}
.line-acc-chev { transition: transform .2s ease; }
.line-acc.open .line-acc-chev { transform: rotate(180deg); }
/* بدنهٔ بازشونده: انیمیشن نرم با grid-template-rows (بدون پرش ارتفاع) */
.line-acc-body {
  display: grid; grid-template-rows: 0fr;
  transition: grid-template-rows .3s cubic-bezier(.22, 1, .36, 1);
  background: hsl(var(--card));
}
.line-acc-body > .line-acc-inner { overflow: hidden; min-height: 0; padding: 0; }
.line-acc.open .line-acc-body { grid-template-rows: 1fr; }

.station-row {
  display: flex; align-items: center; justify-content: space-between; gap: .6rem;
  border-radius: 0;
  background: transparent;
  padding: .72rem 1rem;
  margin: 0;
  border-bottom: 1px solid hsl(var(--border) / .55);
  transition: background-color .16s ease, transform .16s ease;
}
.station-row > svg { color: hsl(var(--muted-foreground) / .7); width: .9rem; height: .9rem; }
.station-row:last-child { border-bottom: 0; }
.station-row:hover { background: hsl(var(--muted) / .55); }
.station-row:active { background: hsl(var(--muted) / .8); }
.station-name { font-size: .875rem; font-weight: 600; }
@media (min-width: 640px) { .station-name { font-size: 1rem; } }
.station-en { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; opacity: .9; }
.dark .station-en { font-weight: 300; opacity: .6; }

/* تابلوهای تیره‌تر صفحهٔ فهرست خطوط */
.board.l1, .board.l1w { background-color: rgb(153 27 27); }
.board.l2 { background-color: rgb(55 48 163); }
.board.l3 { background-color: rgb(2 132 199); }
.board.l4, .board.l4s { background-color: rgb(202 138 4); }
.board.l5, .board.l5w { background-color: rgb(22 101 52); }
.board.l6 { background-color: rgb(190 24 93); }
.board.l7 { background-color: rgb(162 28 175); }

/* ---------- صفحهٔ ایستگاه (/stations/l1/28) ---------- */
.station-hero {
  width: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .25rem;
  border-radius: var(--radius); padding: 1.25rem 1rem; color: #fff; text-align: center;
}
.station-hero-line { font-size: 1.25rem; font-weight: 900; }
.station-hero-en { font-size: .68rem; letter-spacing: .16em; text-transform: uppercase; font-weight: 500; }
@media (min-width: 768px) {
  .station-hero-line { font-size: 1.5rem; }
  .station-hero-en { font-size: .85rem; }
}
.tabbar { display: flex; width: 100%; gap: .25rem; border-radius: var(--radius); background: hsl(var(--muted)); padding: .25rem; }
.tab {
  flex: 1 1 0; min-width: 0; border: 0; cursor: pointer; font-family: inherit;
  background: transparent; color: hsl(var(--muted-foreground));
  border-radius: calc(var(--radius) - 4px); padding: .5rem .3rem;
  font-size: .7rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: background .15s ease, color .15s ease;
}
@media (min-width: 640px) { .tab { font-size: .8rem; } }
.tab.on { color: #fff; }
.section-head { font-size: .95rem; font-weight: 700; color: hsl(var(--primary)); text-align: start; margin: 0 0 .6rem; }
.time-list { max-height: none; }  /* مطابق اصل: فهرست کامل، بدون اسکرول داخلی */
.time-list .time-row:first-child { padding-top: .25rem; }
.time-row { display: flex; align-items: center; justify-content: center; gap: .45rem; font-size: 1rem; font-weight: 700; font-variant-numeric: tabular-nums; padding: .05rem 0; }
.time-row .t { min-width: 3.6rem; text-align: center; }
.time-row.express .t { color: #ea580c; }
html.dark .time-row.express .t { color: #fb923c; }
.ex-badge {
  display: inline-flex; align-items: center; gap: .2rem; font-size: .62rem; font-weight: 800;
  padding: .1rem .42rem; border-radius: 999px; background: #f973161a; color: #ea580c;
  border: 1px solid #f9731655; white-space: nowrap;
}
html.dark .ex-badge { background: #f9731626; color: #fdba74; border-color: #f9731666; }
.ex-badge svg, .time-legend svg { width: .7rem; height: .7rem; }
.time-legend { display: flex; align-items: center; justify-content: center; gap: .3rem; font-size: .68rem; color: hsl(var(--muted-foreground)); margin-bottom: .5rem; }
.time-legend svg { color: #ea580c; }
.time-sep { height: 1px; background: hsl(var(--border)); margin: .5rem 0; }
.facility-box {
  display: flex; flex-wrap: wrap; gap: .3rem;
  max-height: 9rem; overflow: auto; margin-top: .25rem;
  border: 1px solid hsl(var(--border)); border-radius: calc(var(--radius) - 4px); padding: .5rem;
}
.facility-chip { font-size: .75rem; background: hsl(var(--muted)); border-radius: 9999px; padding: .1rem .6rem; }
.transfer-badge {
  display: inline-flex; align-items: center; gap: .25rem;
  border-radius: calc(var(--radius) - 4px); background: rgb(21 128 61 / .3);
  padding: .25rem .75rem; font-size: .72rem; font-weight: 700; color: rgb(20 83 45);
}
.dark .transfer-badge { color: rgb(34 197 94); }
.station-map { height: 18rem; width: 100%; border-radius: .5rem; border: 1px solid hsl(var(--border)); background: hsl(var(--muted)); }

.station-card { padding: 1rem; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .5rem; }
.station-title { font-size: 1.05rem; font-weight: 700; }
.station-en-plain { text-transform: none; letter-spacing: 0; font-size: .8rem; }

/* ============================================================
   انیمیشن‌ها — نرم و کوتاه (احترام به prefers-reduced-motion)
   ============================================================ */
@keyframes aFadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes aFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes aPop { 0% { opacity: 0; transform: scale(0.92); } 60% { transform: scale(1.01); } 100% { opacity: 1; transform: none; } }
@keyframes aSlideDown { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@keyframes aPulseRing { 0% { box-shadow: 0 0 0 0 hsl(var(--primary) / 0.45); } 70% { box-shadow: 0 0 0 12px hsl(var(--primary) / 0); } 100% { box-shadow: 0 0 0 0 hsl(var(--primary) / 0); } }
@keyframes aShimmer { from { background-position: -220px 0; } to { background-position: 220px 0; } }
@keyframes aSpinSlow { to { transform: rotate(360deg); } }

/* ورود صفحه */
.page-enter { animation: aFadeUp 0.34s cubic-bezier(0.22, 1, 0.36, 1) both; }
/* ورود پله‌ای فهرست‌ها: هر آیتم با --i تاخیر می‌گیرد */
.stagger > * { animation: aFadeUp 0.34s cubic-bezier(0.22, 1, 0.36, 1) both; animation-delay: calc(var(--i, 0) * 30ms); }
.stagger-fast > * { animation: aFadeUp 0.26s cubic-bezier(0.22, 1, 0.36, 1) both; animation-delay: calc(var(--i, 0) * 16ms); }

/* کارت‌ها و دکمه‌ها */
.card, .line-acc, .station-row, .bottom-nav a, .drawer-link, .combo-trigger, .btn, .tab, .bn-pill {
  transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease,
              transform 0.18s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.18s ease;
}
.btn:active, .combo-trigger:active, .tab:active, .bn-item:active .bn-pill { transform: scale(0.97); }
.station-row:active { transform: scale(0.995); }
.btn svg, .combo-trigger svg { transition: transform 0.22s ease; }
.btn:hover svg { transform: none; }
.btn-outline:hover { box-shadow: 0 4px 14px rgb(0 0 0 / 0.08); }
.switch { transition: background-color 0.2s ease; }
.switch::after { transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1); }

/* آکاردئون با ارتفاع نرم */
.acc-body, .collapsible-body { overflow: hidden; transition: max-height 0.3s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.24s ease; }
.collapsible-body { max-height: 0; opacity: 0; }
.collapsible-body.open { max-height: 24rem; opacity: 1; }

/* منوی کشویی داخل کمبوباکس */
.combo-pop { opacity: 0; transform: translateY(-6px) scale(0.985); transform-origin: top center; transition: opacity 0.18s ease, transform 0.22s cubic-bezier(0.22, 1, 0.36, 1); }
.combo-pop.open { opacity: 1; transform: none; }
.combo-item { animation: aFadeUp 0.24s cubic-bezier(0.22, 1, 0.36, 1) both; animation-delay: calc(var(--i, 0) * 14ms); }
.combo-group { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.04em; color: hsl(var(--muted-foreground)); padding: 0.4rem 0.6rem 0.2rem; display: flex; align-items: center; gap: 0.35rem; animation: aFadeIn 0.3s ease both; }
.combo-group svg { width: 0.85rem; height: 0.85rem; }

/* آیکون «بازگشت» در RTL باید به راست اشاره کند */
[dir="rtl"] .icon-back { transform: scaleX(-1); }
[dir="rtl"] .icon-forward { transform: scaleX(-1); }

/* اسکلت بارگذاری */
.skeleton { background: linear-gradient(90deg, hsl(var(--muted)) 0%, hsl(var(--accent)) 40%, hsl(var(--muted)) 80%); background-size: 220px 100%; animation: aShimmer 1.2s linear infinite; border-radius: 6px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ---------- رنگ‌های ملایم خط (نوار عمودی تایم‌لاین) ---------- */
.l1-line, .l1w-line { background-color: #dc26264d; }
.l2-line { background-color: #4338ca4d; }
.l3-line { background-color: #0284c74d; }
.l4-line, .l4s-line { background-color: #eab3084d; }
.l5-line, .l5w-line { background-color: #16a34a4d; }
.l6-line { background-color: #ec48994d; }
.l7-line { background-color: #a21caf4d; }

/* ============================================================
   صفحهٔ نتیجهٔ مسیریابی — بازسازی از روی مارک‌آپ اصلی
   ============================================================ */
.path-page { max-width: 48rem; margin-inline: auto; padding: 1rem; display: flex; flex-direction: column; gap: 1rem; }
.path-topbar { display: flex; flex-direction: row; align-items: center; justify-content: space-between; gap: 0.5rem; }
.dur-label { margin-top: 1.25rem; text-align: center; font-size: 0.875rem; color: hsl(var(--muted-foreground)); animation: aFadeUp 0.32s ease both; }
.dur-value { margin: 0.125rem auto 0; padding-inline: 0.75rem; text-align: center; font-size: 1.5rem; font-weight: 700; animation: aPop 0.42s cubic-bezier(0.22, 1, 0.36, 1) both 0.06s; }
html.dark .dur-value { color: hsl(var(--primary)); }
.wait-chip {
  margin-inline: auto; margin-top: 0.5rem; display: flex; width: fit-content; flex-wrap: wrap;
  align-items: center; justify-content: center; gap: 0.375rem; padding: 0.25rem 0.5rem;
  border: 1px solid rgb(22 163 74); border-radius: calc(var(--radius) - 2px);
  font-weight: 600; font-size: 0.9rem; color: rgb(22 163 74); box-shadow: 0 1px 2px rgb(0 0 0 / 0.05);
  animation: aFadeUp 0.34s ease both 0.12s;
}
html.dark .wait-chip { border-color: rgb(74 222 128); color: rgb(74 222 128); }
.wait-chip svg { width: 1rem; height: 1rem; }
.wait-chip.live { animation: aPulseRing 2s ease-out infinite; }
.meta-row { margin: 0.75rem auto 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0.375rem; font-size: 0.875rem; color: hsl(var(--muted-foreground)); text-align: center; }
.meta-row b { color: hsl(var(--foreground)); }

.path-tabs { display: flex; width: 100%; gap: 0.25rem; border-radius: var(--radius); background: hsl(var(--muted)); padding: 0.25rem; }
.path-tabs .tab { flex: 1 1 0; }

/* تایم‌لاین */
.leg-head {
  display: flex; flex-direction: row; align-items: flex-start; gap: 0.5rem;
  margin-block: 1rem 0.25rem; padding: 0.5rem 0.75rem 0.5rem 0;
  border-radius: 0.75rem; color: #fff; font-weight: 800;
  animation: aFadeUp 0.34s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.leg-hex { width: 1.5rem; height: 1.5rem; flex: none; margin-inline: 1rem 0.5rem; margin-top: auto; margin-bottom: auto; }
.leg-head .leg-num { font-size: 1rem; line-height: 1.5; }
.leg-head .leg-en { font-size: 0.75rem; font-weight: 700; opacity: 0.9; }
@media (min-width: 640px) {
  .leg-hex { width: 2rem; height: 2rem; }
  .leg-head .leg-num { font-size: 1.25rem; }
  .leg-head .leg-en { font-size: 0.875rem; }
}
.leg-list { position: relative; margin-bottom: 1.25rem; padding: 0; list-style: none; }
.leg-list::before {
  content: ""; position: absolute; z-index: -1; inset-block: 0; inset-inline-start: 0;
  width: 0.25rem; margin-inline-start: 14px; margin-block: 1.25rem; border-radius: 999px;
}
.station-li { display: flex; border-radius: 1rem; padding-block: 0.25rem; animation: aFadeUp 0.3s cubic-bezier(0.22, 1, 0.36, 1) both; animation-delay: calc(var(--i, 0) * 26ms); }
.station-dot-cell { display: flex; align-items: center; justify-content: center; width: 2rem; min-width: 2rem; height: 2rem; flex: none; background: hsl(var(--background)); }
.station-dot { display: block; }
.station-dot { width: 1rem; height: 1rem; border-radius: 999px; flex: none; }
.station-dot.hollow { background: hsl(var(--background)) !important; border: 3px solid currentColor; }
.leg-list .station-row {
  display: flex; width: 100%; align-self: stretch; align-items: center; justify-content: space-between;
  margin-inline-start: 0.5rem; border-radius: 0.5rem; background: hsl(var(--muted) / 0.3); padding: 0.5rem 1rem;
  border-bottom: 0;
}
.station-row .nm { font-size: 1rem; font-weight: 600; }
.station-row .en { font-size: 0.625rem; font-weight: 400; text-transform: uppercase; letter-spacing: 0.1em; opacity: 0.6; }
@media (min-width: 640px) { .station-row .nm { font-size: 1.25rem; } .station-row .en { font-size: 0.7rem; } }
.station-row .tm { margin-inline: 0.25rem 1.25rem; font-size: 0.875rem; font-weight: 600; color: hsl(var(--muted-foreground)); font-variant-numeric: tabular-nums; }
.station-row .dest-tag { font-size: 0.7rem; font-weight: 700; color: hsl(var(--primary)); }

/* راهنما */
.hint-wrap { display: flex; flex-direction: column; gap: 0.25rem; }
.hint-item { display: flex; gap: 0.6rem; align-items: flex-start; padding: 0.6rem 0.25rem; font-size: 0.95rem; line-height: 1.9; animation: aFadeUp 0.3s ease both; animation-delay: calc(var(--i, 0) * 40ms); }
.hint-item svg { width: 1.35rem; height: 1.35rem; flex: none; margin-top: 0.25rem; }
.hint-sep { height: 1px; border-top: 1px dashed hsl(var(--muted-foreground) / 0.6); margin-block: 0.15rem; }
.hint-sep.warn { border-top-color: hsl(var(--destructive) / 0.7); }

/* بنر پایان سرویس */
.service-banner {
  display: flex; gap: 0.6rem; align-items: flex-start;
  margin-top: 0.5rem; padding: 0.8rem 0.9rem; border-radius: 0.9rem;
  border: 1px solid hsl(var(--destructive) / 0.45);
  background: hsl(var(--destructive) / 0.09);
  color: hsl(var(--foreground)); animation: aFadeUp 0.35s ease both;
}
.service-banner svg { width: 1.25rem; height: 1.25rem; flex: none; margin-top: 0.15rem; color: hsl(var(--destructive)); }
.service-banner b { display: block; font-size: 0.92rem; margin-bottom: 0.15rem; color: hsl(var(--destructive)); }
.service-banner span { font-size: 0.78rem; line-height: 1.9; color: hsl(var(--muted-foreground)); }
.dur-value.est, html.dark .dur-value.est { color: hsl(var(--muted-foreground)); }

/* خطای مسیر */
.path-error-title { margin: 2rem auto 0; padding-inline: 0.75rem; text-align: center; font-size: 1.5rem; font-weight: 700; color: hsl(var(--destructive)); animation: aPop 0.4s ease both; }

/* شیت اشتراک‌گذاری */
.sheet { position: fixed; inset: 0; z-index: 210; display: none; }
.sheet.open { display: block; }
.sheet-backdrop { position: absolute; inset: 0; background: rgb(0 0 0 / 0.6); animation: aFadeIn 0.2s ease both; }
.sheet-panel {
  position: absolute; inset-inline: 0; bottom: 0; display: flex; flex-direction: column;
  border-top-left-radius: 10px; border-top-right-radius: 10px; border: 1px solid hsl(var(--border));
  background: hsl(var(--background)); padding-bottom: env(safe-area-inset-bottom);
  animation: sheetUp 0.3s cubic-bezier(0.32, 0.72, 0, 1) both;
}
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: none; } }
.sheet-grip { margin: 1rem auto 0; height: 0.5rem; width: 100px; border-radius: 999px; background: hsl(var(--muted)); }
.sheet-body { padding: 1rem; margin: 0.25rem; background: hsl(var(--background)); max-width: 48rem; width: 100%; margin-inline: auto; }
.sheet-title { margin-bottom: 1rem; font-size: 1.125rem; font-weight: 900; color: hsl(var(--primary)); }
.sheet-actions { display: flex; flex-direction: row; align-items: center; justify-content: center; gap: 0.5rem; }
.sheet-btn {
  flex: 1 1 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.45rem;
  min-height: 5.6rem; padding: 0.8rem 0.4rem; border: 1px solid hsl(var(--border));
  border-radius: 1rem; background: hsl(var(--card)); font-family: inherit; font-size: 0.7rem;
  font-weight: 600; line-height: 1.5; text-align: center; color: hsl(var(--foreground));
  transition: transform 0.18s cubic-bezier(.22,1,.36,1), background 0.18s ease, border-color 0.18s ease;
  -webkit-tap-highlight-color: transparent;
}
.sheet-btn:hover { background: hsl(var(--accent)); border-color: hsl(var(--primary) / 0.4); }
.sheet-btn:active { transform: scale(0.96); }
.sheet-btn svg {
  width: 1.45rem; height: 1.45rem; padding: 0.55rem; box-sizing: content-box;
  border-radius: 999px; background: hsl(var(--primary) / 0.14); color: hsl(var(--primary));
}
.sheet-actions { display: flex; gap: 0.5rem; align-items: stretch; }

/* پیشنهاد نصب PWA به شکل آیکون کوچک و قابل ردکردن */
.install-nudge {
  position: fixed; inset-inline-start: max(14px, env(safe-area-inset-left));
  bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 130;
  display: grid; width: 42px; height: 42px; place-items: center;
  border: 1px solid hsl(var(--border)); border-radius: 50%;
  background: hsl(var(--card)); box-shadow: 0 8px 20px rgb(0 0 0 / 0.22);
  animation: aFadeUp 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.install-nudge-action {
  display: grid; width: 36px; height: 36px; place-items: center;
  border: 0; border-radius: 50%; background: hsl(var(--primary));
  color: hsl(var(--foreground)); cursor: pointer;
}
.install-nudge-action svg { width: 20px; height: 20px; }
.install-nudge-dismiss {
  position: absolute; inset-block-start: -5px; inset-inline-end: -5px;
  display: grid; width: 19px; height: 19px; place-items: center;
  padding: 0; border: 1px solid hsl(var(--border)); border-radius: 50%;
  background: hsl(var(--card)); color: hsl(var(--muted-foreground)); cursor: pointer;
  box-shadow: 0 2px 6px rgb(0 0 0 / 0.18);
}
.install-nudge-dismiss svg { width: 12px; height: 12px; }
@media (max-width: 480px) {
  .install-nudge { width: 40px; height: 40px; }
  .install-nudge-action { width: 34px; height: 34px; }
}
[data-install-option][hidden] { display: none !important; }

/* مودال راهنمای نصب iOS */
.modal { position: fixed; inset: 0; z-index: 220; display: none; place-items: center; padding: 1rem; }
.modal.open { display: grid; }
.modal-backdrop { position: absolute; inset: 0; background: rgb(0 0 0 / 0.6); animation: aFadeIn 0.2s ease both; }
.modal-card { position: relative; width: 100%; max-width: 21rem; border-radius: var(--radius); border: 1px solid hsl(var(--border)); background: hsl(var(--card)); padding: 1rem; animation: aPop 0.28s cubic-bezier(0.22, 1, 0.36, 1) both; }
.modal-card h3 { font-size: 1rem; font-weight: 800; margin-bottom: 0.45rem; }
.modal-card p { font-size: 0.82rem; line-height: 1.85; color: hsl(var(--muted-foreground)); }

/* دکمهٔ زبان */
#langBtn .lang-code { font-size: 0.7rem; font-weight: 800; letter-spacing: 0.02em; }

/* خط تایم‌لاین هر خط */
.lc-l1, .lc-l1w { --leg-line: #dc26264d; }
.lc-l2 { --leg-line: #4338ca4d; }
.lc-l3 { --leg-line: #0284c74d; }
.lc-l4, .lc-l4s { --leg-line: #eab3084d; }
.lc-l5, .lc-l5w { --leg-line: #16a34a4d; }
.lc-l6 { --leg-line: #ec48994d; }
.lc-l7 { --leg-line: #a21caf4d; }
.leg-list::before { background-color: var(--leg-line, hsl(var(--primary) / 0.3)); }

/* آکاردئون تابلوهای خطوط: ارتفاع نرم */
.line-acc-body {
  display: grid; grid-template-rows: 0fr; opacity: 0;
  padding: 0; border-top: 0;
  transition: grid-template-rows 0.32s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.26s ease;
}
.line-acc.open .line-acc-body { grid-template-rows: 1fr; opacity: 1; }
.line-acc-inner { overflow: hidden; min-height: 0; }
/* ردیف ایستگاه‌ها داخل تابلو: صاف، با خط جداکنندهٔ نازک (متریال) */
.line-acc .station-row {
  border-radius: 0; background: transparent; margin: 0;
  padding: .72rem 1rem; border-bottom: 1px solid hsl(var(--border) / .5);
}
.line-acc .station-row:last-child { border-bottom: 0; }
.line-acc .station-row:hover { background: hsl(var(--muted) / .5); }
.line-acc .station-row:active { transform: none; background: hsl(var(--muted) / .75); }
.line-acc-head .line-acc-chev { transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1); }
.line-acc:active { transform: scale(0.998); }

/* دکمهٔ زبان در هدر */
#langBtn { position: relative; }
#langBtn .lang-code {
  position: absolute; inset-inline-end: 0.2rem; bottom: 0.15rem;
  font-size: 0.5rem; font-weight: 800; opacity: 0.75; letter-spacing: 0.02em;
}
#locateBtn.busy { animation: aPulseRing 1.4s ease-out infinite; }
.chev-ico { transition: transform 0.26s cubic-bezier(0.22, 1, 0.36, 1); }
.badge { animation: aPop 0.4s cubic-bezier(0.22, 1, 0.36, 1) both; }

/* ---------- رنگ تب فعال (خط جاری) ---------- */
.tab.on.l1, .tab.on.l1w { background-color: rgb(220 38 38); color: #fff; }
.tab.on.l2 { background-color: rgb(67 56 202); color: #fff; }
.tab.on.l3 { background-color: rgb(2 132 199); color: #fff; }
.tab.on.l4, .tab.on.l4s { background-color: rgb(234 179 8); color: #fff; }
.tab.on.l5, .tab.on.l5w { background-color: rgb(22 163 74); color: #fff; }
.tab.on.l6 { background-color: rgb(236 72 153); color: #fff; }
.tab.on.l7 { background-color: rgb(162 28 175); color: #fff; }

/* سرِ هر خط در تایم‌لاین: آیکون راست، متن چسبیده به آن */
.leg-head { justify-content: flex-start; text-align: start; }
.leg-head > div { flex: 1 1 auto; min-width: 0; }
.leg-head .leg-num, .leg-head .leg-en { display: block; }

/* دکمهٔ زبان: آیکون + کد زبان زیر آن */
.lang-btn { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; }
.lang-btn svg { width: 1.05rem; height: 1.05rem; }
.lang-btn .lang-code { position: static; font-size: 0.5rem; line-height: 0.6rem; font-weight: 800; opacity: 0.8; letter-spacing: 0.02em; }
#langBtn .lang-code { position: static; inset-inline-end: auto; bottom: auto; }

/* ابزارهای نقشه */
.map-tools button { display: grid; place-items: center; }
.map-tools button svg { width: 1.05rem; height: 1.05rem; }
.map-tools button:hover { color: hsl(var(--primary)); }
.time-row { animation: aFadeIn 0.3s ease both; animation-delay: calc(var(--i, 0) * 12ms); }
.bn-item.active .bn-pill { animation: aPop 0.3s cubic-bezier(0.22, 1, 0.36, 1) both; }

/* ============================================================
   راند ۵ — دکمهٔ قطار زنده در خانه، حالت دنبال‌کردن قطار، پاپ‌آپ
   ============================================================ */
.home-live-sec { padding-block: 1.25rem 2.5rem; }
.home-live-btn {
  position: relative; display: flex; align-items: center; gap: .8rem; width: 100%;
  padding: .95rem 1rem; border-radius: calc(var(--radius) + 4px);
  border: 1px solid hsl(var(--border)); background: hsl(var(--card));
  box-shadow: 0 8px 24px -14px rgb(0 0 0 / .35); cursor: pointer; text-align: start;
  overflow: hidden; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  font-family: inherit; color: hsl(var(--foreground));
}
.home-live-btn:hover { transform: translateY(-2px); box-shadow: 0 14px 30px -16px rgb(0 0 0 / .45); border-color: #16a34a66; }
.home-live-btn:active { transform: scale(.99); }
.home-live-btn.busy { opacity: .75; pointer-events: none; }
.hlb-ico {
  display: grid; place-items: center; flex: 0 0 auto; width: 2.6rem; height: 2.6rem; border-radius: 999px;
  background: linear-gradient(135deg, #16a34a, #0d9488); color: #fff;
}
.hlb-ico svg { width: 1.15rem; height: 1.15rem; }
.hlb-txt { display: flex; flex-direction: column; gap: .12rem; min-width: 0; }
.hlb-txt b { font-size: .92rem; font-weight: 800; }
.hlb-txt small { font-size: .7rem; color: hsl(var(--muted-foreground)); line-height: 1.45; }
.hlb-go { margin-inline-start: auto; color: hsl(var(--muted-foreground)); display: grid; place-items: center; }
.hlb-go svg { width: 1.05rem; height: 1.05rem; }
.hlb-pulse {
  position: absolute; inset-inline-start: 1.63rem; top: 50%; width: 2.6rem; height: 2.6rem;
  transform: translateY(-50%); border-radius: 999px; border: 2px solid #16a34a;
  animation: hlbPulse 2.2s ease-out infinite; pointer-events: none;
}
@keyframes hlbPulse {
  0% { opacity: .5; transform: translateY(-50%) scale(1); }
  70%, 100% { opacity: 0; transform: translateY(-50%) scale(1.6); }
}
@media (prefers-reduced-motion: reduce) { .hlb-pulse { display: none; } }

/* راهنمای حالت دنبال‌کردن قطار */
.smap-track-hint {
  position: absolute; inset-inline: 0; top: 4.2rem; margin-inline: auto; width: max-content; max-width: 90%;
  display: flex; align-items: center; gap: .4rem; z-index: 620;
  padding: .4rem .8rem; border-radius: 999px; font-size: .72rem; font-weight: 700; color: #fff;
  background: rgb(15 23 42 / .86); backdrop-filter: blur(6px);
  box-shadow: 0 8px 20px -12px rgb(0 0 0 / .6); pointer-events: none;
}
.smap-track-hint[hidden] { display: none; }
.smap-track-hint .dot {
  width: .5rem; height: .5rem; border-radius: 999px; background: #22c55e; flex: 0 0 auto;
  animation: trackDot 1.2s ease-in-out infinite;
}
@keyframes trackDot { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
.smap-wrap.tracking #stationsMap { cursor: not-allowed; }
.smap-wrap.tracking .train-marker { cursor: pointer; }

/* پاپ‌آپ قطار: ایستگاه بعدی */
.leaflet-popup-content .popup-next {
  display: flex; flex-direction: column; gap: .1rem; margin-top: .35rem;
  padding: .35rem .5rem; border-radius: calc(var(--radius) - 6px);
  background: #16a34a14; border: 1px solid #16a34a33; font-size: .72rem; line-height: 1.5;
}
.leaflet-popup-content .popup-next b { font-size: .74rem; font-weight: 800; }
.leaflet-popup-content .popup-next .t { font-variant-numeric: tabular-nums; font-weight: 700; }
.leaflet-popup-content .popup-next .s { color: hsl(var(--muted-foreground)); }
.leaflet-popup-content .popup-track { margin-top: .3rem; font-size: .66rem; color: #15803d; font-weight: 700; }
html.dark .leaflet-popup-content .popup-track { color: #4ade80; }

/* پاپ‌آپ: پایان مسیر قطار */
.leaflet-popup-content .popup-next.ended { background: #64748b14; border-color: #64748b44; text-align: center; }


/* ============================================================
   صفحهٔ ایستگاه — چیدمان مطابق اصل (آدرس بالا، امکانات، برنامهٔ اسکرولی)
   ============================================================ */
.station-page { padding-bottom: 5.5rem; }
.st-hero {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .25rem; padding: 1.15rem 1rem; border-radius: calc(var(--radius) - 2px); color: #fff; text-align: center;
  box-shadow: 0 10px 24px -18px #00000080;
}
.st-hero-name { font-size: 1.45rem; font-weight: 900; line-height: 1.35; }
.st-hero-en { font-size: .68rem; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; opacity: .92; }
.st-hero-line {
  position: absolute; inset-inline-start: .6rem; top: .6rem; font-size: .62rem; font-weight: 800;
  padding: .12rem .5rem; border-radius: 999px; background: #ffffff26; backdrop-filter: blur(4px);
}
.st-transfer { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.st-transfer-lbl { display: inline-flex; align-items: center; gap: .3rem; font-size: .74rem; font-weight: 800; color: hsl(var(--muted-foreground)); }
.st-transfer-lbl svg { width: .9rem; height: .9rem; }
.st-transfer-chip {
  display: inline-flex; align-items: center; gap: .35rem; padding: .3rem .7rem; border-radius: 999px;
  font-size: .78rem; font-weight: 800; text-decoration: none; color: #fff;
  box-shadow: 0 6px 14px -10px #00000099; transition: transform .16s ease, filter .16s ease;
}
.st-transfer-chip:hover { transform: translateY(-1px); filter: brightness(1.06); }
.st-transfer-chip i { width: .5rem; height: .5rem; border-radius: 999px; background: #ffffffcc; display: block; }
.st-transfer-chip b { font-weight: 600; font-size: .7rem; opacity: .9; }

.st-card {
  display: flex; flex-direction: column; gap: .65rem; padding: 1rem;
  border: 1px solid hsl(var(--border)); border-radius: var(--radius); background: hsl(var(--card));
}
.st-addr { display: flex; align-items: flex-start; gap: .4rem; font-size: .82rem; line-height: 1.75; }
.st-addr .ai { width: 1.1rem; height: 1.1rem; flex: 0 0 auto; color: hsl(var(--primary)); margin-top: .18rem; }
.st-sep { height: 1px; background: hsl(var(--border)); }
.st-block { display: flex; flex-direction: column; gap: .5rem; }
.st-label { font-size: .84rem; font-weight: 800; color: hsl(var(--primary)); }
html.dark .st-label { color: #fbbf24; }
.st-fac {
  display: flex; flex-wrap: wrap; gap: .28rem .3rem; max-height: 9rem; overflow: auto;
  border: 1px solid hsl(var(--border)); border-radius: calc(var(--radius) - 5px); padding: .45rem;
}
.st-fac-chip {
  display: inline-flex; align-items: center; gap: .25rem; padding: .18rem .55rem; border-radius: calc(var(--radius) - 7px);
  font-size: .7rem; font-weight: 700; background: rgb(21 128 61 / .28); color: rgb(20 83 45);
}
html.dark .st-fac-chip { background: rgb(22 163 74 / .16); color: #4ade80; }
.st-fac-chip .ci { width: .8rem; height: .8rem; flex: 0 0 auto; }

.st-toggles { display: flex; flex-direction: column; gap: .45rem; }
.seg {
  display: flex; gap: .15rem; width: 100%; padding: .2rem; border-radius: calc(var(--radius) - 4px);
  background: hsl(var(--muted)); border: 1px solid hsl(var(--border));
}
.seg-btn {
  flex: 1 1 0; min-width: 0; padding: .38rem .4rem; border: 0; border-radius: calc(var(--radius) - 8px);
  background: transparent; color: hsl(var(--muted-foreground)); font-family: inherit;
  font-size: .72rem; font-weight: 700; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: background .16s ease, color .16s ease, box-shadow .16s ease;
}
.seg-btn.on { box-shadow: 0 2px 8px -6px #00000099; }
#dayTabs .seg-btn { font-size: .68rem; padding: .38rem .25rem; letter-spacing: -.01em; }
.seg-btn.on.primary { background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); }
.seg-btn.on.lc, #dirTabs .seg-btn.on { background: var(--lc, hsl(var(--primary))); color: #fff; }
.seg-btn:active { transform: scale(.985); }

.st-scroll {
  height: 18rem; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  border: 1px solid hsl(var(--border)); border-radius: calc(var(--radius) - 4px); padding: .3rem .5rem;
  scrollbar-width: thin;
}
.st-scroll::-webkit-scrollbar { width: 6px; }
.st-scroll::-webkit-scrollbar-thumb { background: hsl(var(--border)); border-radius: 999px; }
.st-scroll .time-row { padding: .32rem 0; }
.st-scroll .time-sep { margin: .32rem 0; }

/* ============================================================
   صفحهٔ مسیریابی — بلوک «مدت زمان سفر» و «پایان سرویس» مطابق اصل
   ============================================================ */
.end-title { margin: 2rem 0 0; text-align: center; font-size: 1.5rem; font-weight: 800; color: #dc2626; }
html.dark .end-title { color: #f87171; }
.end-sep { height: 1px; margin: .9rem 0 .6rem; background: hsl(var(--border)); }
.end-sep.soft { margin: .9rem auto .6rem; width: 60%; opacity: .7; }
.end-note {
  display: flex; flex-wrap: wrap; justify-content: center; gap: .1rem .4rem; text-align: center;
  font-size: .86rem; color: hsl(var(--muted-foreground)); line-height: 1.9;
}
.wait-pill {
  display: flex; align-items: center; justify-content: center; width: fit-content; max-width: 100%;
  margin: 0 auto; padding: .28rem .7rem; border-radius: calc(var(--radius) - 3px);
  border: 1px solid #16a34a; color: #16a34a; font-weight: 700; font-size: .82rem;
  box-shadow: 0 2px 10px -8px #000000cc; background: transparent;
}
html.dark .wait-pill { border-color: #4ade80; color: #4ade80; }
.wp-main { display: inline-flex; align-items: center; gap: .35rem; }
.wp-main[hidden], .wp-retry-button[hidden] { display: none; }
.wait-pill.is-expired { border: 0; padding: 0; box-shadow: none; background: transparent; color: inherit; }
.wp-retry-button { display: inline-flex; min-height: 2rem; height: 2rem; align-items: center; gap: .35rem; padding: .25rem .7rem; font-size: .76rem; line-height: 1; }
.wp-ico { width: 1.05rem; height: 1.05rem; flex: 0 0 auto; }
.wp-retry-button .wp-ico { width: 1rem; height: 1rem; }
.wp-count { font-variant-numeric: tabular-nums; font-size: .9rem; font-weight: 800; letter-spacing: .02em; }
.wp-lbl { font-weight: 600; }
.prev-train { margin: .7rem auto 0; display: flex; flex-wrap: wrap; justify-content: center; gap: .25rem; font-size: .82rem; color: hsl(var(--muted-foreground)); }
.prev-train b { font-weight: 800; color: hsl(var(--primary)); font-variant-numeric: tabular-nums; }
.near-alert {
  display: flex; align-items: flex-start; gap: .5rem; margin: .8rem auto 0; max-width: 34rem;
  padding: .6rem .7rem; border-radius: calc(var(--radius) - 4px);
  border: 1px solid hsl(var(--border)); background: hsl(var(--muted) / .55);
}
.near-alert .na-ico { width: 1rem; height: 1rem; flex: 0 0 auto; color: hsl(var(--primary)); margin-top: .15rem; }
.near-alert b { display: block; font-size: .82rem; }
.near-alert span { display: block; font-size: .74rem; color: hsl(var(--muted-foreground)); line-height: 1.8; }

/* ============================================================
   کارت بالای صفحهٔ مسیر — مبدا/مقصد + مدت زمان
   ============================================================ */
.path-card {
  margin-top: .2rem; padding: 1rem .9rem 1.1rem;
  border: 1px solid hsl(var(--border)); border-radius: var(--radius);
  background: hsl(var(--card)); color: hsl(var(--card-foreground));
  box-shadow: 0 1px 1.5px hsl(38 30% 55% / .10), 0 14px 30px -24px hsl(38 40% 32% / .55);
}
.dark .path-card { box-shadow: 0 10px 30px -22px #000; }
.pc-route { display: flex; align-items: center; gap: .5rem; }
.pc-stop { display: flex; align-items: center; gap: .4rem; min-width: 0; flex: 1 1 0; }
.pc-stop.end { flex-direction: row-reverse; text-align: end; }
.pc-nm { font-size: .86rem; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc-dot {
  width: .55rem; height: .55rem; border-radius: 999px; flex: 0 0 auto;
  background: hsl(var(--primary)); box-shadow: 0 0 0 3px hsl(var(--primary) / .18);
}
.pc-dot.start { background: hsl(var(--muted-foreground)); box-shadow: 0 0 0 3px hsl(var(--muted-foreground) / .15); }
.pc-arrow { color: hsl(var(--muted-foreground)); display: inline-flex; flex: 0 0 auto; }
/* فلش از مبدا به مقصد: در RTL رو به چپ، در LTR رو به راست */
.pc-arrow .pc-ico { width: 1rem; height: 1rem; transform: none; }
html[dir="ltr"] .pc-arrow .pc-ico { transform: rotate(180deg); }
.pc-sep { height: 1px; margin: .8rem -.9rem .6rem; background: hsl(var(--border)); }
.path-card .dur-label { margin-top: .1rem; }
.path-card .near-alert, .path-card .wait-pill { margin-top: .55rem; }

/* ============================================================
   اسکرول‌بار مدرن (متریال‌وار) — سمت استاندارد هر جهت
   ============================================================ */
/* فایرفاکس */
@supports (-moz-appearance: none) {
  * { scrollbar-width: thin; scrollbar-color: hsl(var(--muted-foreground) / .38) transparent; }
}
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: hsl(var(--muted-foreground) / .32);
  border-radius: 999px;
  border: 2.5px solid transparent;
  background-clip: padding-box;
  transition: background-color .18s ease;
}
::-webkit-scrollbar-thumb:hover { background: hsl(var(--primary) / .75); background-clip: padding-box; }
::-webkit-scrollbar-thumb:active { background: hsl(var(--primary)); background-clip: padding-box; }
::-webkit-scrollbar-corner { background: transparent; }
html:not(.dark) .st-scroll,
html:not(.dark) .combo-list,
html:not(.dark) .time-list { scrollbar-color: hsl(var(--primary) / .45) transparent; }

.scroll-smooth, .st-scroll, .combo-list, .drawer-panel, .line-acc-inner, .hint-wrap { scroll-behavior: smooth; }
.st-scroll::-webkit-scrollbar { width: 10px; }


/* ============================================================
   پاپ‌آپ قطار — فشرده و بدون لرزش (هیچ اطلاعاتی حذف نشده)
   ============================================================ */
.leaflet-popup.popup-train { margin-bottom: .2rem; }
.popup-train .leaflet-popup-content-wrapper {
  border-radius: .7rem; padding: 0; background: hsl(var(--popover));
  box-shadow: 0 10px 26px -14px rgb(0 0 0 / .55), 0 0 0 1px hsl(var(--border) / .7);
  will-change: transform;
}
.popup-train .leaflet-popup-content {
  margin: .42rem .5rem .45rem; width: 11.2rem !important; line-height: 1.45;
  color: hsl(var(--popover-foreground));
}
.popup-train .leaflet-popup-content .popup-next,
.popup-train .leaflet-popup-content .popup-next b,
.popup-train .leaflet-popup-content .popup-next .t { color: hsl(var(--popover-foreground)); }
.popup-train .leaflet-popup-content .popup-next .s { color: hsl(var(--muted-foreground)); }
.popup-train .leaflet-popup-content .popup-next .sec-num { color: hsl(var(--primary)); }
.popup-train .leaflet-popup-tip { background: hsl(var(--popover)); }
.popup-train .leaflet-popup-close-button { display: none; }

.popup-train .popup-title {
  display: flex; align-items: center; gap: .25rem;
  font-size: .72rem; font-weight: 800; margin: 0 0 .12rem;
}
.popup-train .popup-chip {
  font-size: .6rem; padding: .02rem .28rem; border-radius: .3rem; font-weight: 800;
}
.popup-train .popup-en {
  font-size: .66rem; color: hsl(var(--muted-foreground)); font-weight: 600;
  /* هیچ متنی حذف نمی‌شود: تا دو خط می‌شکند و فقط از خط سوم به بعد بریده می‌شود */
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  white-space: normal; overflow: hidden;
}
.popup-train .popup-next {
  margin-top: .28rem; padding: .26rem .38rem; gap: 0; font-size: .66rem; line-height: 1.45;
}
.popup-train .popup-next b.pp-nx {
  font-size: .68rem; font-weight: 800; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  white-space: normal; overflow: hidden;
}
.popup-train .popup-next .t { font-size: .64rem; font-weight: 700; }
.popup-train .popup-next .s { font-size: .62rem; display: flex; align-items: center; gap: .18rem; }
.popup-train .sec-num {
  font-variant-numeric: tabular-nums; font-weight: 800;
  min-width: 1.35em; display: inline-block; text-align: center;   /* عرض ثابت ⇒ بدون جابه‌جایی */
}
.popup-train .popup-next.ended b { font-size: .68rem; }

/* فاصلهٔ تایم‌لاین: بدون گپ اضافه قبل از تابلوهای بعدی */
.leg-list { margin-bottom: .15rem; }
.leg-head { margin-block: .65rem .2rem; }

/* فاصلهٔ واقعی بین لِگ‌های مسیر (بدون گپ اضافه) */
.path-page .leg { padding: 0; margin-bottom: .3rem; }
.path-page .leg-list { margin-bottom: 0; }
.path-page .leg-head { margin-block: .55rem .2rem; }

/* ============================================================
   جست‌وجو — صفحهٔ خطوط
   ============================================================ */
.stl-search {
  position: relative; display: flex; align-items: center; gap: .45rem;
  margin-bottom: .9rem; padding: .55rem .7rem;
  border-radius: calc(var(--radius) - 2px); border: 1px solid hsl(var(--border));
  background: hsl(var(--card));
}
.stl-search .sl-ico { width: 1rem; height: 1rem; color: hsl(var(--muted-foreground)); flex: 0 0 auto; }
.stl-input {
  flex: 1 1 auto; min-width: 0; border: 0; background: transparent; outline: none;
  font-family: inherit; font-size: .86rem; color: hsl(var(--foreground));
}
.stl-input::placeholder { color: hsl(var(--muted-foreground) / .8); }
.stl-input::-webkit-search-cancel-button { display: none; }
.stl-clear {
  flex: 0 0 auto; display: inline-grid; place-items: center; width: 1.4rem; height: 1.4rem;
  border: 0; border-radius: 999px; background: hsl(var(--muted)); color: hsl(var(--muted-foreground));
  cursor: pointer;
}
.stl-clear svg { width: .8rem; height: .8rem; }
.stl-results { display: flex; flex-direction: column; gap: .35rem; }
.stl-results[hidden] { display: none; }
.stl-row {
  display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  padding: .68rem .85rem; border-radius: calc(var(--radius) - 3px);
  background: hsl(var(--card)); border: 1px solid hsl(var(--border) / .7);
  color: hsl(var(--foreground)); text-decoration: none;
}
.stl-row:active { transform: scale(.996); }
.stl-nm { font-size: .88rem; font-weight: 700; }
.stl-nums { display: inline-flex; gap: .22rem; flex: 0 0 auto; }
.stl-nums i, .ss-nums i {
  display: inline-grid; place-items: center; min-width: 1.25rem; height: 1.25rem;
  padding: 0 .25rem; border-radius: .35rem; background: var(--lc); color: #fff;
  font-style: normal; font-size: .62rem; font-weight: 800;
}
.stl-empty, .ss-empty { padding: 1rem; text-align: center; font-size: .82rem; color: hsl(var(--muted-foreground)); }

/* ============================================================
   جست‌وجو روی نقشه
   ============================================================ */
.smap-search {
  position: absolute; z-index: 620; top: .7rem; left: .6rem; right: auto; width: min(17rem, calc(100% - 9.5rem));
  padding: .45rem .5rem; border-radius: .8rem;
  background: hsl(var(--background) / .95); border: 1px solid hsl(var(--border));
  box-shadow: 0 10px 26px -14px #00000099; backdrop-filter: blur(10px);
  display: flex; flex-wrap: wrap; align-items: center; gap: .35rem;
}
.smap-search[hidden] { display: none; }
.smap-search .ss-ico { width: .95rem; height: .95rem; color: hsl(var(--muted-foreground)); }
.smap-search input {
  flex: 1 1 6rem; min-width: 0; border: 0; background: transparent; outline: none;
  font-family: inherit; font-size: .8rem; color: hsl(var(--foreground));
}
.smap-search input::-webkit-search-cancel-button { display: none; }
.ss-close {
  display: inline-grid; place-items: center; width: 1.2rem; height: 1.2rem; border: 0;
  border-radius: 999px; background: hsl(var(--muted)); color: hsl(var(--muted-foreground)); cursor: pointer;
}
.ss-close svg { width: .7rem; height: .7rem; }
.smap-search-list {
  flex: 1 0 100%; max-height: 11rem; overflow-y: auto; display: flex; flex-direction: column; gap: .2rem;
  margin-top: .1rem;
}
.ss-row {
  display: flex; align-items: center; justify-content: space-between; gap: .4rem; width: 100%;
  padding: .4rem .45rem; border: 0; border-radius: .5rem; background: transparent;
  font-family: inherit; font-size: .78rem; color: hsl(var(--foreground)); text-align: start; cursor: pointer;
}
.ss-row:hover, .ss-row:active { background: hsl(var(--muted)); }
.ss-nm { font-weight: 700; }
.ss-nums { display: inline-flex; gap: .2rem; flex: 0 0 auto; }

/* حلقهٔ تأکید ایستگاه انتخاب‌شده از جست‌وجو */
.leaflet-interactive.ss-hit { animation: ssHit 1.3s ease-out 2; }
@keyframes ssHit {
  0%, 100% { stroke: #ffffff; stroke-width: 1.3; }
  50% { stroke: #16a34a; stroke-width: 4; }
}

/* ============================================================
   پاپ‌آپ قطار زنده — نسخه روشن و مدرن (بدون فلش)
   درخواست: روشن، خواناتر، بدون تغییری در اطلاعات، حذف فلش زیر پاپ‌آپ
   ============================================================ */
.leaflet-popup.popup-train { margin-bottom: 14px !important; }
.leaflet-popup.popup-train .leaflet-popup-tip,
.leaflet-popup.popup-train .leaflet-popup-tip-container {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}
.popup-train .leaflet-popup-content-wrapper,
html.dark .popup-train .leaflet-popup-content-wrapper,
html:not(.dark) .popup-train .leaflet-popup-content-wrapper {
  background: #ffffff !important;
  background-color: #ffffff !important;
  color: #0f172a !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 16px !important;
  padding: 0 !important;
  box-shadow: 0 16px 32px -12px rgba(15, 23, 42, 0.18), 0 6px 16px -4px rgba(15, 23, 42, 0.12), 0 0 0 1px rgba(226, 232, 240, 0.8) !important;
  overflow: hidden !important;
  will-change: transform;
  backdrop-filter: none !important;
}
.popup-train .leaflet-popup-content,
html.dark .popup-train .leaflet-popup-content {
  margin: 0 !important;
  width: 300px !important;
  max-width: min(84vw, 300px) !important;
  line-height: 1.5 !important;
  color: #0f172a !important;
}
.popup-train .leaflet-popup-close-button { display: none !important; }

/* کارت داخلی */
.pp-card {
  padding: 10px 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #ffffff;
  color: #0f172a;
  text-align: start;
  direction: rtl;
}
html[dir="ltr"] .pp-card { direction: ltr; }

/* هدر: آیکن + عنوان + چیپ خط + اکسپرس */
.pp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.pp-head-main {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}
.pp-ico {
  width: 30px; height: 30px;
  border-radius: 999px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  display: grid; place-items: center;
  font-size: 14px; line-height: 1;
  flex: none;
}
.pp-title {
  font-size: 13px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.pp-chips {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: none;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.popup-train .popup-chip {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  line-height: 1;
  letter-spacing: 0;
  box-shadow: 0 1px 2px rgba(15,23,42,0.08);
  border: 1px solid rgba(255,255,255,0.7);
}
.popup-train .popup-chip.express {
  background: #f97316 !important;
  color: #fff !important;
  border-color: #fed7aa !important;
  font-size: 10px;
  padding: 0 7px;
  gap: 3px;
}

/* ردیف مسیر: مبدا · مقصد/توقف */
.pp-route {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 9px;
  border-radius: 999px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #334155;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.5;
  min-width: 0;
  overflow: hidden;
}
.pp-route .pp-pin {
  width: 16px; height: 16px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #e2e8f0;
  display: grid; place-items: center;
  flex: none;
  color: #64748b;
}
.pp-route .pp-pin svg { width: 10px; height: 10px; }
.pp-route-text {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 700;
  color: #0f172a;
}
.pp-route-text span.sep {
  font-weight: 600;
  color: #94a3b8;
  margin: 0 3px;
}
.pp-route small {
  color: #64748b;
  font-weight: 600;
  font-size: 10px;
  white-space: nowrap;
}

/* باکس ایستگاه بعدی — مهم‌ترین اطلاعات با تاکید بصری */
.popup-train .popup-next {
  display: flex !important;
  flex-direction: row !important;
  align-items: flex-start !important;
  gap: 10px !important;
  margin: 0 !important;
  padding: 10px 10px !important;
  border-radius: 12px !important;
  background: #f0fdf4 !important;
  border: 1px solid #bbf7d0 !important;
  font-size: 12px !important;
  line-height: 1.45 !important;
  color: #0f172a !important;
  text-align: start !important;
}
.popup-train .popup-next.ended {
  background: #f8fafc !important;
  border-color: #e2e8f0 !important;
  justify-content: center !important;
  align-items: center !important;
  text-align: center !important;
  padding: 10px 12px !important;
}
.popup-train .popup-next.ended b {
  color: #475569 !important;
  font-size: 12px !important;
}
.pp-next-ico {
  width: 32px; height: 32px;
  border-radius: 999px;
  background: #16a34a;
  color: #fff;
  display: grid; place-items: center;
  flex: none;
  box-shadow: 0 2px 8px rgba(22,163,74,0.3);
  margin-top: 1px;
}
.pp-next-ico svg { width: 16px; height: 16px; }
.pp-next-body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.pp-next-label {
  font-size: 10px;
  font-weight: 800;
  color: #15803d;
  letter-spacing: 0.04em;
  line-height: 1;
  display: flex;
  align-items: center;
  gap: 4px;
}
.pp-next-label::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 999px;
  background: #22c55e;
  display: inline-block;
  box-shadow: 0 0 0 4px rgba(34,197,94,0.15);
  animation: ppPulse 1.6s ease-in-out infinite;
}
@keyframes ppPulse { 0%,100%{opacity:1} 50%{opacity:0.45} }
@media (prefers-reduced-motion: reduce) { .pp-next-label::before { animation: none; } }

.popup-train .popup-next b.pp-nx {
  font-size: 13px !important;
  font-weight: 800 !important;
  color: #0f172a !important;
  line-height: 1.35 !important;
  display: block !important;
  overflow: visible !important;
  -webkit-line-clamp: unset !important;
  white-space: normal !important;
}
.popup-train .popup-next .t {
  font-size: 11px !important;
  font-weight: 700 !important;
  color: #334155 !important;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.popup-train .popup-next .t svg { width: 12px; height: 12px; color: #64748b; }
.popup-train .popup-next .s {
  font-size: 11px !important;
  color: #475569 !important;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}
.popup-train .sec-num {
  display: inline-grid !important;
  place-items: center;
  min-width: 30px !important;
  height: 20px;
  padding: 0 7px;
  border-radius: 999px;
  background: #ffffff !important;
  border: 1px solid #bbf7d0 !important;
  color: #15803d !important;
  font-variant-numeric: tabular-nums;
  font-weight: 800 !important;
  font-size: 11px !important;
  line-height: 1;
  box-shadow: 0 1px 2px rgba(15,23,42,0.05);
  letter-spacing: -0.02em;
}
.pp-meta-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 1px;
}
.pp-dot {
  width: 3px; height: 3px;
  border-radius: 999px;
  background: #cbd5e1;
  flex: none;
}

/* حالت دارک: پاپ‌آپ همچنان روشن می‌ماند — فقط سایه کمی بیشتر */
html.dark .popup-train .leaflet-popup-content-wrapper {
  box-shadow: 0 20px 40px -14px rgba(0,0,0,0.35), 0 8px 18px -6px rgba(0,0,0,0.25), 0 0 0 1px rgba(226,232,240,0.9) !important;
}

/* فاصله تایم‌لاین قبلاً کم بود — برای پاپ‌آپ جدید فاصله مناسب */
.leaflet-popup.popup-train { filter: drop-shadow(0 1px 0 rgba(226,232,240,0.9)); }


/* ============================================================
   PREMIUM DARK METRO — بازطراحی کامل ظاهری (بدون تغییر عملکرد)
   الهام از تابلوهای واقعی مترو، نه وب‌سایت مرجع
   - دارک پرمیوم: سرمه‌ای عمیق + شیشه مات + طلایی گرم
   - رنگ خطوط (قرمز/آبی/...) دست نخورده — هویت مترو
   ============================================================ */

/* بک‌گراند پریمیوم — گرادیانت عمیق + گرید مترویی نامحسوس */
html.dark body {
  background: radial-gradient(ellipse 900px 600px at 50% -10%, rgba(251, 191, 36, 0.06), transparent 60%),
              radial-gradient(ellipse 700px 500px at 85% 30%, rgba(56, 189, 248, 0.04), transparent 60%),
              linear-gradient(180deg, hsl(222 22% 7%) 0%, hsl(222 22% 6%) 100%);
  background-attachment: fixed;
}
html.dark body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  opacity: 0.025;
  background-image:
    linear-gradient(rgba(255,255,255,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.06) 1px, transparent 1px);
  background-size: 32px 32px;
}
html:not(.dark) body {
  background: radial-gradient(ellipse 900px 500px at 50% -10%, rgba(251,191,36,0.07), transparent 60%),
              hsl(var(--background));
}

/* هدر پریمیوم — شیشه مشکی مات مثل تابلو سکو */
header.site-header {
  background: rgba(13, 17, 23, 0.82) !important;
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid rgba(255,255,255,0.06) !important;
  box-shadow: 0 1px 0 rgba(255,255,255,0.04) inset, 0 8px 24px -16px rgba(0,0,0,0.6);
  height: 56px;
}
html:not(.dark) header.site-header {
  background: rgba(255,253,248,0.85) !important;
  backdrop-filter: blur(12px);
  border-bottom-color: hsl(var(--border) / 0.6) !important;
}
.header-inner { height: 56px !important; }
.logo {
  height: 22px !important;
  color: hsl(var(--foreground)) !important;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.3));
  letter-spacing: -0.02em;
}
html.dark .logo { color: #fff !important; }
#menuBtn, #themeBtn, #langBtn {
  width: 40px !important; height: 40px !important;
  border-radius: 12px !important;
  background: rgba(255,255,255,0.06) !important;
  border: 1px solid rgba(255,255,255,0.08) !important;
  backdrop-filter: blur(8px);
  transition: all 0.2s cubic-bezier(0.22,1,0.36,1) !important;
}
html:not(.dark) #menuBtn, html:not(.dark) #themeBtn, html:not(.dark) #langBtn {
  background: hsl(var(--muted)) !important;
  border-color: hsl(var(--border)) !important;
}
#menuBtn:hover, #themeBtn:hover, #langBtn:hover {
  background: rgba(255,255,255,0.1) !important;
  border-color: rgba(251,191,36,0.3) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.lang-btn { gap: 2px !important; }
.lang-btn .lang-code { font-size: 9px !important; font-weight: 800 !important; opacity: 0.9 !important; }

/* دراور پریمیوم */
.drawer-panel {
  background: rgba(17, 23, 35, 0.96) !important;
  backdrop-filter: blur(24px) saturate(150%);
  border-left: 1px solid rgba(255,255,255,0.08) !important;
  box-shadow: -16px 0 48px rgba(0,0,0,0.5);
  padding: 20px !important;
}
html:not(.dark) .drawer-panel { background: hsl(var(--card)) !important; }
.drawer-link {
  border-radius: 14px !important;
  padding: 14px 16px !important;
  font-weight: 600 !important;
  font-size: 14px !important;
  transition: all 0.2s ease !important;
  border: 1px solid transparent;
}
.drawer-link:hover {
  background: rgba(255,255,255,0.06) !important;
  border-color: rgba(255,255,255,0.06) !important;
  transform: translateX(2px);
}
html[dir="rtl"] .drawer-link:hover { transform: translateX(-2px); }
.drawer-link.active {
  background: linear-gradient(135deg, rgba(251,191,36,0.15), rgba(245,158,11,0.1)) !important;
  border-color: rgba(251,191,36,0.25) !important;
  color: hsl(var(--primary)) !important;
}

/* هیرو — زمینه شماتیک مترویی (بدون عکس قدیمی) + ریسپانسیو */
.hero {
  min-height: calc(100dvh - 56px) !important;
  background:
    radial-gradient(ellipse 900px 500px at 50% 8%, rgba(251,191,36,0.10), transparent 62%),
    radial-gradient(ellipse 680px 380px at 12% 48%, rgba(2,132,199,0.07), transparent 60%),
    radial-gradient(ellipse 640px 360px at 88% 38%, rgba(220,38,38,0.06), transparent 60%),
    linear-gradient(180deg, #0f131a 0%, #0d1117 52%, #0b0f15 100%) !important;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 600px 300px at 50% 100%, rgba(0,0,0,0.45), transparent 70%),
    linear-gradient(0deg, rgba(0,0,0,0.22), transparent 45%);
  pointer-events: none;
  z-index: 0;
}
html:not(.dark) .hero {
  background:
    radial-gradient(ellipse 900px 500px at 50% 8%, rgba(251,191,36,0.13), transparent 62%),
    linear-gradient(180deg, #fdf8ee 0%, #f4ede2 100%) !important;
}
html:not(.dark) .hero::before {
  background:
    linear-gradient(0deg, rgba(244,237,222,0.55), transparent 50%);
}
@media (max-width: 768px) {
  .hero { min-height: calc(100dvh - 56px) !important; }
  .hero-grid { padding: 20px 14px 12px !important; }
}
.hero-grid { position: relative; z-index: 1; padding: 32px 16px !important; }
@media (min-width: 1024px) { .hero-grid { padding: 48px 24px !important; gap: 48px !important; } }
.hero-logo-wrap { filter: drop-shadow(0 4px 12px rgba(0,0,0,0.3)); }
.hero-logo { height: 52px !important; color: #fff !important; filter: drop-shadow(0 2px 8px rgba(0,0,0,0.4)); }
html:not(.dark) .hero-logo { color: hsl(var(--foreground)) !important; }
.hero-tagline {
  margin-top: 20px !important;
  max-width: 420px !important;
  font-size: 14px !important;
  line-height: 1.8 !important;
  color: rgba(255,255,255,0.75) !important;
  font-weight: 400;
}
html:not(.dark) .hero-tagline { color: hsl(var(--muted-foreground)) !important; }
.hero-badges { display: none !important; }
.badge { display: none !important; }
/* حذف scroll-hint طبق درخواست — دیگر چیزی برای اسکرول نیست */
.scroll-hint { display: none !important; }

/* قطارهای شماتیک — زیرساخت جدید: خطوط پیوسته شبیه نقشه لایو */
.hero-anim {
  position: absolute;
  inset: 0;
  z-index: 0;
  isolation: isolate;
  contain: paint;
  pointer-events: none;
  overflow: hidden;
  opacity: 1;
}
.hero-anim svg {
  width: 100%;
  height: 100%;
  display: block;
  position: absolute;
  inset: 0;
  opacity: 0.42;
}
html:not(.dark) .hero-anim svg { opacity: 0.22; }
.hero-anim .metro-line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
  opacity: 0.95;
}
.hero-anim .metro-line.bg {
  stroke-width: 8;
  opacity: 0.08;
}
.hero-anim .station-dot {
  fill: white;
  stroke: rgba(0,0,0,0.35);
  stroke-width: 0.8;
}
.hero-svg-mobile { display: none; }
.hero-svg-desktop { display: block; }
@media (max-width: 768px) {
  .hero-svg-desktop { display: none !important; }
  .hero-svg-mobile { display: block !important; }
  .hero-anim svg { opacity: 0.58; }
  html:not(.dark) .hero-anim svg { opacity: 0.32; }
  .hero-anim .metro-line { stroke-width: 3.4; }
  .hero-anim .metro-line.bg { stroke-width: 9; opacity: 0.10; }
  .hero-anim .station-dot circle { r: 3.6; }
}
@media (max-width: 480px) {
  .hero-anim svg { opacity: 0.62; }
  .hero-anim .metro-line { stroke-width: 3.6; }
}

.hero-copyright {
  position: relative;
  z-index: 1;
  text-align: center;
  font-size: 11px;
  font-weight: 500;
  color: rgba(255,255,255,0.42);
  padding: 14px 16px 84px;
  margin-top: auto;
  letter-spacing: 0.02em;
}
html:not(.dark) .hero-copyright { color: rgba(0,0,0,0.42); }
@media (prefers-reduced-motion: reduce) {
  .hero-anim { display: none !important; }
}
@media (max-width: 768px) {
  .hero-anim svg { width: 180%; left: -40%; opacity: 0.22; }
  html:not(.dark) .hero-anim svg { opacity: 0.13; }
}
/* کارت مسیریابی پریمیوم — شیشه تیره با حاشیه طلایی */
.route-card {
  width: calc(100vw - 32px) !important;
  max-width: 400px !important;
  margin: 24px auto 0 !important;
  padding: 24px !important;
  background: rgba(22, 28, 42, 0.84) !important;
  backdrop-filter: blur(8px) saturate(125%) !important;
  -webkit-backdrop-filter: blur(8px) saturate(125%) !important;
  border: 1px solid rgba(255,255,255,0.08) !important;
  border-radius: 20px !important;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.06) inset,
    0 16px 40px -12px rgba(0,0,0,0.6),
    0 0 0 1px rgba(255,255,255,0.04),
    0 0 32px rgba(251,191,36,0.04) !important;
  position: relative;
  overflow: visible;
}
html:not(.dark) .route-card {
  background: hsl(var(--card)) !important;
  backdrop-filter: none !important;
  border-color: hsl(var(--border)) !important;
  box-shadow: 0 8px 32px -12px rgba(0,0,0,0.12) !important;
}
.route-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(251,191,36,0.3), transparent);
}
@media (min-width: 1024px) { .route-card { margin: 0 !important; } }
.route-card .label {
  font-size: 12px !important;
  font-weight: 700 !important;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.7) !important;
  margin-bottom: 8px !important;
}
html:not(.dark) .route-card .label { color: hsl(var(--muted-foreground)) !important; }

/* کمبوباکس پریمیوم */
.combo-trigger {
  height: 48px !important;
  background: rgba(255,255,255,0.05) !important;
  border: 1px solid rgba(255,255,255,0.08) !important;
  border-radius: 14px !important;
  color: rgba(255,255,255,0.6) !important;
  font-weight: 500 !important;
  transition: all 0.2s cubic-bezier(0.22,1,0.36,1) !important;
  backdrop-filter: blur(8px);
}
html:not(.dark) .combo-trigger {
  background: hsl(var(--background)) !important;
  border-color: hsl(var(--border)) !important;
  color: hsl(var(--muted-foreground)) !important;
}
.combo-trigger:hover {
  background: rgba(255,255,255,0.08) !important;
  border-color: rgba(255,255,255,0.12) !important;
  transform: translateY(-1px);
}
.combo-trigger.has-value {
  background: rgba(255,255,255,0.08) !important;
  border-color: rgba(251,191,36,0.25) !important;
  color: #fff !important;
  box-shadow: 0 0 0 3px rgba(251,191,36,0.08), 0 2px 8px rgba(0,0,0,0.15) !important;
}
html:not(.dark) .combo-trigger.has-value {
  background: hsl(var(--background)) !important;
  color: hsl(var(--foreground)) !important;
  border-color: hsl(var(--primary) / 0.4) !important;
}
.combo-trigger .pin { opacity: 0.7 !important; }
.combo-trigger.has-value .pin { color: hsl(var(--primary)) !important; opacity: 1 !important; }
.combo-pop {
  background: rgba(22, 28, 42, 0.96) !important;
  backdrop-filter: blur(20px) !important;
  border: 1px solid rgba(255,255,255,0.08) !important;
  border-radius: 16px !important;
  box-shadow: 0 16px 40px -8px rgba(0,0,0,0.5) !important;
  overflow: hidden;
  margin-top: 8px !important;
}
html:not(.dark) .combo-pop {
  background: hsl(var(--popover)) !important;
  border-color: hsl(var(--border)) !important;
}
.combo-search {
  background: rgba(255,255,255,0.04) !important;
  border-bottom: 1px solid rgba(255,255,255,0.06) !important;
  color: #fff !important;
  padding: 14px 16px !important;
  font-size: 14px !important;
}
html:not(.dark) .combo-search { background: transparent !important; color: inherit !important; }
.combo-item { border-radius: 9px !important; padding: 7px 10px !important; font-size: 0.82rem !important; line-height: 1.45 !important; transition: all 0.15s !important; }
.combo-item:hover, .combo-item[aria-selected="true"] {
  background: rgba(251,191,36,0.12) !important;
  color: #fff !important;
}
html:not(.dark) .combo-item:hover { background: hsl(var(--accent)) !important; color: inherit !important; }

/* دکمه لوکیت */
#locateBtn {
  width: 48px !important; height: 48px !important;
  border-radius: 14px !important;
  background: rgba(255,255,255,0.06) !important;
  border: 1px solid rgba(255,255,255,0.08) !important;
  backdrop-filter: blur(8px);
}
#locateBtn:hover {
  background: rgba(251,191,36,0.15) !important;
  border-color: rgba(251,191,36,0.3) !important;
  color: hsl(var(--primary)) !important;
}

/* تنظیمات */
.collapsible-head h4 { font-size: 13px !important; font-weight: 700 !important; letter-spacing: 0.02em; }
.collapsible-body { background: rgba(255,255,255,0.03); border-radius: 14px; padding: 12px; margin-top: 8px; border: 1px solid rgba(255,255,255,0.05); }
html:not(.dark) .collapsible-body { background: hsl(var(--muted) / 0.5); border-color: hsl(var(--border)); }
.switch-row { padding: 8px 0 !important; }
.switch {
  width: 44px !important; height: 26px !important;
  background: rgba(255,255,255,0.1) !important;
  border: 1px solid rgba(255,255,255,0.1) !important;
}
.switch[aria-checked="true"] { background: hsl(var(--primary)) !important; border-color: hsl(var(--primary)) !important; box-shadow: 0 0 12px rgba(251,191,36,0.3); }

/* سلکت و اینپوت تایم */
select.input, input.input {
  height: 44px !important;
  background: rgba(255,255,255,0.05) !important;
  border: 1px solid rgba(255,255,255,0.08) !important;
  border-radius: 12px !important;
  color: #fff !important;
  backdrop-filter: blur(8px);
}
html:not(.dark) select.input, html:not(.dark) input.input {
  background: hsl(var(--background)) !important;
  color: inherit !important;
  border-color: hsl(var(--border)) !important;
}
select.input:focus, input.input:focus {
  border-color: hsl(var(--primary) / 0.5) !important;
  box-shadow: 0 0 0 3px hsl(var(--primary) / 0.1) !important;
}

/* دکمه اصلی پریمیوم — گرادیانت طلایی */
.btn-primary {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%) !important;
  color: #0d1117 !important;
  font-weight: 700 !important;
  font-size: 14px !important;
  height: 48px !important;
  border-radius: 14px !important;
  border: none !important;
  box-shadow: 0 4px 16px rgba(251,191,36,0.3), 0 1px 0 rgba(255,255,255,0.3) inset !important;
  letter-spacing: 0.02em;
  transition: all 0.2s cubic-bezier(0.22,1,0.36,1) !important;
}
.btn-primary:hover {
  background: linear-gradient(135deg, #fcd34d 0%, #fbbf24 100%) !important;
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(251,191,36,0.35), 0 1px 0 rgba(255,255,255,0.4) inset !important;
}
.btn-primary:active { transform: translateY(0) scale(0.98); }

/* کارت‌های عمومی پریمیوم */
.card {
  background: var(--glass) !important;
  backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border) !important;
  border-radius: 16px !important;
  box-shadow: 0 8px 32px -12px rgba(0,0,0,0.4) !important;
}
html.dark .card {
  background: rgba(22,28,42,0.6) !important;
  backdrop-filter: blur(16px);
  box-shadow: 0 8px 32px -12px rgba(0,0,0,0.5) !important;
}
html:not(.dark) .card {
  background: hsl(var(--card)) !important;
  backdrop-filter: none !important;
}

/* سکشن‌ها */
.section-wrap { padding: 24px 16px !important; }
@media (min-width: 640px) { .section-wrap { padding-inline: 24px !important; } }
.section-title {
  font-size: 20px !important;
  font-weight: 800 !important;
  letter-spacing: -0.02em;
  color: hsl(var(--foreground)) !important;
  position: relative;
  padding-bottom: 12px;
}
.section-title::after {
  content: "";
  position: absolute;
  bottom: 0; right: 0;
  width: 40px; height: 3px;
  background: hsl(var(--primary));
  border-radius: 999px;
}
html[dir="ltr"] .section-title::after { right: auto; left: 0; }

/* آکاردئون پریمیوم */
.accordion {
  border: 1px solid var(--glass-border) !important;
  border-radius: 16px !important;
  overflow: hidden;
  background: var(--glass) !important;
  backdrop-filter: blur(12px);
}
html.dark .accordion { background: rgba(22,28,42,0.5) !important; }
.acc-item { border-bottom: 1px solid rgba(255,255,255,0.06) !important; padding: 0 16px !important; }
html:not(.dark) .acc-item { border-color: hsl(var(--border)) !important; }
.acc-trigger { padding: 16px 0 !important; font-weight: 600 !important; font-size: 14px !important; }
.acc-trigger:hover { text-decoration: none !important; color: hsl(var(--primary)) !important; }

/* چنجلاگ */
.changelog {
  border-radius: 16px !important;
  padding: 20px !important;
  background: rgba(22,28,42,0.5) !important;
  border: 1px solid rgba(255,255,255,0.06) !important;
}
html:not(.dark) .changelog { background: hsl(var(--card)) !important; border-color: hsl(var(--border)) !important; }

/* نوار پایین پریمیوم — فلوتینگ داک */
.bottom-nav {
  position: fixed !important;
  bottom: 12px !important;
  left: 50% !important;
  right: auto !important;
  transform: translateX(-50%);
  width: min(380px, calc(100% - 24px)) !important;
  height: 64px !important;
  min-height: 0 !important;
  background: rgba(13, 17, 23, 0.85) !important;
  backdrop-filter: blur(28px) saturate(150%) !important;
  -webkit-backdrop-filter: blur(28px) saturate(150%) !important;
  border: 1px solid rgba(255,255,255,0.08) !important;
  border-radius: 999px !important;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4), 0 1px 0 rgba(255,255,255,0.06) inset !important;
  padding: 0 6px !important;
  top: auto !important;
}
html:not(.dark) .bottom-nav {
  background: rgba(255,255,255,0.9) !important;
  border-color: hsl(var(--border)) !important;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12) !important;
}
.bn-grid {
  display: flex !important;
  grid-template-columns: unset !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  height: 100%;
  align-items: center;
  gap: 2px;
}
.bn-item {
  flex: 1;
  height: 100%;
  padding: 0 !important;
  flex-direction: column !important;
  justify-content: center !important;
  border-radius: 999px;
  transition: all 0.2s cubic-bezier(0.22,1,0.36,1) !important;
  position: relative;
}
.bn-pill {
  width: 36px !important; height: 28px !important;
  border-radius: 999px !important;
  transition: all 0.2s !important;
  background: transparent !important;
  position: relative !important;
}
.bn-item.active .bn-pill {
  background: hsl(var(--primary)) !important;
  color: #0d1117 !important;
  box-shadow: 0 2px 8px rgba(251,191,36,0.3) !important;
}
.bn-item.active .bn-label { color: hsl(var(--primary)) !important; font-weight: 700 !important; }
html:not(.dark) .bn-item.active .bn-label { color: hsl(var(--primary)) !important; }
.bn-label { font-size: 10px !important; font-weight: 500 !important; margin-top: 2px !important; opacity: 0.8; }
.bn-item.active .bn-label { opacity: 1 !important; }
body { padding-bottom: 88px !important; }

/* صفحه مسیر پریمیوم */
.path-page { padding: 16px !important; gap: 16px !important; }
.path-card {
  background: rgba(22,28,42,0.7) !important;
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.08) !important;
  border-radius: 20px !important;
  box-shadow: 0 12px 32px -12px rgba(0,0,0,0.5) !important;
  overflow: hidden;
  position: relative;
}
html:not(.dark) .path-card { background: hsl(var(--card)) !important; }
.path-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, #dc2626, #4338ca, #0284c7, #eab308, #16a34a);
  opacity: 0.8;
}
.pc-nm { font-weight: 800 !important; letter-spacing: -0.01em; }
.dur-label { color: rgba(255,255,255,0.6) !important; font-size: 11px !important; letter-spacing: 0.06em; text-transform: uppercase; font-weight: 600 !important; }
html:not(.dark) .dur-label { color: hsl(var(--muted-foreground)) !important; }
.dur-value { font-size: 28px !important; font-weight: 800 !important; letter-spacing: -0.02em; }
.path-tabs { background: rgba(255,255,255,0.06) !important; border: 1px solid rgba(255,255,255,0.06) !important; border-radius: 14px !important; padding: 4px !important; backdrop-filter: blur(8px); }
html:not(.dark) .path-tabs { background: hsl(var(--muted)) !important; }
.path-tabs .tab { border-radius: 10px !important; font-weight: 600 !important; }
.leg-head {
  border-radius: 14px !important;
  padding: 12px 16px 12px 0 !important;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2) !important;
  position: relative;
  overflow: hidden;
}
.leg-head::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}
.leg-head:hover::after { opacity: 1; }
.station-li .station-dot { box-shadow: 0 0 0 3px rgba(255,255,255,0.1); }
.leg-list .station-row {
  background: rgba(255,255,255,0.04) !important;
  border: 1px solid rgba(255,255,255,0.06) !important;
  border-radius: 12px !important;
  backdrop-filter: blur(8px);
  transition: all 0.2s !important;
}
html:not(.dark) .leg-list .station-row { background: hsl(var(--muted) / 0.3) !important; border-color: hsl(var(--border)) !important; }
.leg-list .station-row:hover { transform: translateX(2px); border-color: rgba(255,255,255,0.1) !important; }
html[dir="rtl"] .leg-list .station-row:hover { transform: translateX(-2px); }

/* خطوط — بردها دست نخورده، کارت‌ها پریمیوم */
.line-acc {
  border-radius: 16px !important;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.06) !important;
  background: rgba(22,28,42,0.5) !important;
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 24px -12px rgba(0,0,0,0.4) !important;
}
html:not(.dark) .line-acc { background: hsl(var(--card)) !important; border-color: hsl(var(--border)) !important; }
.line-acc-head { border-radius: 0 !important; position: relative; overflow: hidden; }
.line-acc-head::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 0%, rgba(255,255,255,0.06) 100%);
  opacity: 0;
  transition: opacity 0.3s;
}
.line-acc-head:hover::after { opacity: 1; }
.line-acc .station-row {
  background: transparent !important;
  border-bottom: 1px solid rgba(255,255,255,0.04) !important;
  transition: all 0.15s !important;
}
html:not(.dark) .line-acc .station-row { border-color: hsl(var(--border) / 0.5) !important; }
.line-acc .station-row:hover { background: rgba(255,255,255,0.04) !important; padding-inline-start: 20px !important; }

/* ایستگاه پریمیوم */
.station-page { padding-bottom: 88px !important; }
.st-hero {
  border-radius: 20px !important;
  box-shadow: 0 12px 32px -8px rgba(0,0,0,0.4) !important;
  position: relative;
  overflow: hidden;
  padding: 24px !important;
}
.st-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.08), transparent 50%);
  pointer-events: none;
}
.st-card {
  background: rgba(22,28,42,0.6) !important;
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.06) !important;
  border-radius: 16px !important;
  box-shadow: 0 8px 32px -12px rgba(0,0,0,0.4) !important;
}
html:not(.dark) .st-card { background: hsl(var(--card)) !important; }
.seg {
  background: rgba(255,255,255,0.04) !important;
  border: 1px solid rgba(255,255,255,0.06) !important;
  border-radius: 12px !important;
  padding: 3px !important;
  backdrop-filter: blur(8px);
}
html:not(.dark) .seg { background: hsl(var(--muted)) !important; border-color: hsl(var(--border)) !important; }
.seg-btn { border-radius: 9px !important; font-weight: 600 !important; }
.seg-btn.on.primary { background: hsl(var(--primary)) !important; color: #0d1117 !important; box-shadow: 0 2px 8px rgba(251,191,36,0.25) !important; }
.st-scroll {
  background: rgba(255,255,255,0.02) !important;
  border: 1px solid rgba(255,255,255,0.06) !important;
  border-radius: 14px !important;
}
html:not(.dark) .st-scroll { background: hsl(var(--background)) !important; border-color: hsl(var(--border)) !important; }

/* نقشه پریمیوم */
.smap-wrap {
  border-radius: 0 !important;
  overflow: hidden;
  background: #0d1117 !important;
}
.smap-legend {
  background: rgba(13,17,23,0.85) !important;
  backdrop-filter: blur(20px) !important;
  border: 1px solid rgba(255,255,255,0.08) !important;
  border-radius: 16px !important;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4) !important;
  bottom: 16px !important;
  padding: 6px !important;
}
.smap-chip {
  background: rgba(255,255,255,0.06) !important;
  border: 1px solid rgba(255,255,255,0.08) !important;
  color: rgba(255,255,255,0.7) !important;
  backdrop-filter: blur(8px);
}
.smap-chip.on {
  background: rgba(255,255,255,0.12) !important;
  border-color: rgba(255,255,255,0.15) !important;
  color: #fff !important;
}
.smap-tools { gap: 8px !important; }
.smap-tool {
  background: rgba(13,17,23,0.85) !important;
  backdrop-filter: blur(16px) !important;
  border: 1px solid rgba(255,255,255,0.08) !important;
  border-radius: 12px !important;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3) !important;
  color: rgba(255,255,255,0.8) !important;
}
.smap-tool.on {
  background: hsl(var(--primary)) !important;
  color: #0d1117 !important;
  border-color: hsl(var(--primary)) !important;
}
.smap-live {
  background: rgba(13,17,23,0.9) !important;
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.08) !important;
  border-radius: 999px !important;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3) !important;
  color: #fff !important;
}
.smap-search {
  background: rgba(13,17,23,0.9) !important;
  backdrop-filter: blur(16px) !important;
  border: 1px solid rgba(255,255,255,0.08) !important;
  border-radius: 14px !important;
}

/* پاپ‌آپ قطار — قبلا روشن کردیم، حالا هماهنگ با پرمیوم */
.popup-train .leaflet-popup-content-wrapper {
  box-shadow: 0 16px 40px rgba(0,0,0,0.5) !important;
  border: 1px solid rgba(255,255,255,0.08) !important;
}

/* جستجوی خطوط */
.stl-search {
  background: rgba(22,28,42,0.6) !important;
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.06) !important;
  border-radius: 14px !important;
}
html:not(.dark) .stl-search { background: hsl(var(--card)) !important; }
.stl-row {
  background: rgba(255,255,255,0.04) !important;
  border: 1px solid rgba(255,255,255,0.06) !important;
  border-radius: 12px !important;
}
html:not(.dark) .stl-row { background: hsl(var(--card)) !important; border-color: hsl(var(--border)) !important; }

/* توست پریمیوم */
.toast {
  background: rgba(22,28,42,0.9) !important;
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.08) !important;
  border-radius: 12px !important;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4) !important;
  color: #fff !important;
}

/* اسکرول‌بار پریمیوم */
::-webkit-scrollbar-thumb {
  background: rgba(251,191,36,0.2) !important;
  border: 2px solid transparent !important;
  background-clip: padding-box !important;
}
::-webkit-scrollbar-thumb:hover { background: rgba(251,191,36,0.35) !important; background-clip: padding-box !important; }

/* نقشه شماتیک */
.map-shell { background: #0d1117 !important; }
.map-tools button {
  background: rgba(13,17,23,0.85) !important;
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.08) !important;
  border-radius: 10px !important;
  color: #fff !important;
  width: 36px !important; height: 36px !important;
}
.map-tools button:hover { border-color: hsl(var(--primary) / 0.5) !important; color: hsl(var(--primary)) !important; }

/* دکمه لایو هوم پریمیوم */
.home-live-btn {
  background: rgba(22,28,42,0.6) !important;
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.06) !important;
  border-radius: 16px !important;
  box-shadow: 0 8px 32px -12px rgba(0,0,0,0.5) !important;
}
.home-live-btn:hover { border-color: rgba(22,163,74,0.3) !important; transform: translateY(-2px); box-shadow: 0 12px 32px -12px rgba(0,0,0,0.6) !important; }

/* انیمیشن‌های پریمیوم */
@keyframes premiumGlow {
  0%,100% { box-shadow: 0 0 12px rgba(251,191,36,0.2); }
  50% { box-shadow: 0 0 20px rgba(251,191,36,0.3); }
}
.btn-primary { animation: none; }
.btn-primary:hover { animation: premiumGlow 2s ease-in-out infinite; }


/* ============================================================
   TABLO های واقعی مترو — ایستگاه‌ها (مثل عکس زرد) + مسیریابی (مثل عکس قرمز)
   الهام مستقیم از تابلوهای آویز ایستگاه: حاشیه مشکی ضخیم، آویز فلزی، دو زبانه
   ============================================================ */

/* گرید کارت‌ها — هر ایستگاه یه تابلو آویز */
.station-signs-grid {
  display: grid !important;
  grid-template-columns: 1fr;
  gap: 8px !important;
  padding: 8px 4px 10px !important;
}
@media (min-width: 520px) { .station-signs-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 860px) { .station-signs-grid { gap: 10px !important; } }

/* خود تابلو */
.station-sign {
  position: relative;
  display: flex !important;
  flex-direction: column !important;
  text-decoration: none !important;
  background: #0a0a0a;
  border: 1.4px solid #0a0a0a !important;
  border-radius: 10px !important;
  overflow: hidden !important;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.08) inset,
    0 8px 20px -8px rgba(0,0,0,0.55),
    0 2px 6px rgba(0,0,0,0.35) !important;
  min-height: 92px;
  isolation: isolate;
  transform-origin: center top;
  animation: signIn 0.42s cubic-bezier(0.22,1,0.36,1) both;
  animation-delay: calc(var(--i, 0) * 32ms);
  transition: transform 0.22s cubic-bezier(0.22,1,0.36,1), box-shadow 0.22s, filter 0.2s !important;
}
@keyframes signIn {
  from { opacity: 0; transform: translateY(10px) rotate(-0.6deg) scale(0.98); }
  to   { opacity: 1; transform: none; }
}
.station-sign:hover {
  transform: translateY(-3px) rotate(0.2deg) !important;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.1) inset,
    0 14px 28px -10px rgba(0,0,0,0.65),
    0 4px 10px rgba(0,0,0,0.4) !important;
  filter: brightness(1.02);
}
.station-sign:active { transform: translateY(-1px) scale(0.99) !important; }

/* آویز فلزی بالا — دوتا بست مثل عکس */
.sign-hangers {
  position: absolute;
  top: -9px; left: 50%;
  transform: translateX(-50%);
  display: flex; gap: 36px;
  z-index: 3;
  pointer-events: none;
}
.sign-hangers i {
  display: block;
  width: 12px; height: 12px;
  background: linear-gradient(180deg, #9ca3af, #6b7280);
  border: 2px solid #1f2937;
  border-radius: 3px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.4);
  position: relative;
}
.sign-hangers i::after {
  content: "";
  position: absolute;
  top: calc(100% + 2px); left: 50%;
  transform: translateX(-50%);
  width: 2px; height: 9px;
  background: linear-gradient(180deg, #6b7280, #374151);
  border-radius: 999px;
}

/* بدنه تابلو — رنگ خط */
.sign-body {
  flex: 1 1 auto;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 16px 10px 12px !important;
  min-height: 64px;
  position: relative;
}
.station-sign.sign-dark .sign-body { background: var(--lc, #dc2626) !important; }
.station-sign.sign-yellow .sign-body { background: #facc15 !important; }
.station-sign.sign-dark .sign-body::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.08), transparent 45%);
  pointer-events: none;
}
.sign-name-fa {
  font-size: 18px !important;
  font-weight: 900 !important;
  line-height: 1.25 !important;
  letter-spacing: -0.015em;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.station-sign.sign-dark .sign-name-fa { color: #fff !important; text-shadow: 0 1px 2px rgba(0,0,0,0.28); }
.station-sign.sign-yellow .sign-name-fa { color: #0a0a0a !important; }
.sign-name-en {
  font-size: 9.5px !important;
  font-weight: 700 !important;
  letter-spacing: 0.09em !important;
  text-transform: uppercase !important;
  margin-top: 3px !important;
  opacity: 1 !important;
  line-height: 1.3;
}
.station-sign.sign-dark .sign-name-en { color: rgba(255,255,255,0.88) !important; }
.station-sign.sign-yellow .sign-name-en { color: rgba(0,0,0,0.72) !important; }
.transfer-badge-mini {
  display: inline-grid; place-items: center;
  width: 18px; height: 18px;
  background: #0a0a0a; color: #fff;
  border-radius: 999px;
  font-size: 10px; line-height: 1;
  border: 1.5px solid rgba(255,255,255,0.85);
  flex: none;
}
.station-sign.sign-yellow .transfer-badge-mini { background: #0a0a0a; border-color: #0a0a0a; }

/* نوار مشکی پایین — Line / خط */
.sign-footer {
  display: flex !important;
  align-items: center; justify-content: space-between;
  gap: 8px;
  background: #0a0a0a !important;
  color: #f1f5f9 !important;
  padding: 7px 10px !important;
  font-size: 10px !important;
  font-weight: 700 !important;
  border-top: 3px solid #000 !important;
  letter-spacing: 0.02em;
  line-height: 1;
}
.sign-footer-en, .sign-footer-fa {
  white-space: nowrap;
  font-size: 10px !important;
  letter-spacing: 0.04em;
}
.sign-footer-dot {
  width: 6px; height: 6px;
  background: var(--lc);
  border-radius: 999px;
  flex: none;
  box-shadow: 0 0 0 3px rgba(255,255,255,0.08);
}

/* آکاردئون داخلی — پس‌زمینه تونلی تیره برای اینکه تابلوها بدرخشند */
.line-acc-inner.station-signs-grid {
  background:
    radial-gradient(ellipse 600px 200px at 50% 0%, rgba(255,255,255,0.04), transparent 70%),
    linear-gradient(180deg, rgba(0,0,0,0.12), rgba(0,0,0,0.04)) !important;
  border-top: 1px solid rgba(255,255,255,0.06);
}

/* هیرو ایستگاه — تابلو بزرگ آویز (مثل عکس زرد بزرگ) */
.station-sign-hero {
  position: relative;
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  justify-content: stretch !important;
  text-align: center;
  border: 1.4px solid #0a0a0a !important;
  border-radius: 14px !important;
  overflow: hidden !important;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.08) inset,
    0 14px 32px -12px rgba(0,0,0,0.6),
    0 4px 12px rgba(0,0,0,0.4) !important;
  min-height: 132px;
  isolation: isolate;
  animation: signIn 0.5s cubic-bezier(0.22,1,0.36,1) both;
  padding: 0 !important;
}
.station-sign-hero .sign-hangers { top: -10px; gap: 48px; }
.station-sign-hero .sign-hangers i { width: 14px; height: 14px; }
.hero-sign-body {
  flex: 1 1 auto;
  display: grid; place-items: center;
  padding: 22px 14px 16px !important;
  position: relative;
}
.station-sign-hero.hero-yellow .hero-sign-body { background: #facc15 !important; }
.station-sign-hero.hero-dark .hero-sign-body { background: var(--lc, #dc2626) !important; }
.station-sign-hero .hero-sign-body::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.09), transparent 55%);
  pointer-events: none;
}
.hero-sign-name {
  font-size: 26px !important;
  font-weight: 900 !important;
  line-height: 1.2 !important;
  letter-spacing: -0.02em;
  position: relative; z-index: 1;
}
.station-sign-hero.hero-dark .hero-sign-name { color: #fff !important; text-shadow: 0 1px 3px rgba(0,0,0,0.3); }
.station-sign-hero.hero-yellow .hero-sign-name { color: #0a0a0a !important; }
.hero-sign-en {
  font-size: 11px !important;
  font-weight: 700 !important;
  letter-spacing: 0.12em !important;
  text-transform: uppercase !important;
  margin-top: 4px !important;
  position: relative; z-index: 1;
}
.station-sign-hero.hero-dark .hero-sign-en { color: rgba(255,255,255,0.88) !important; }
.station-sign-hero.hero-yellow .hero-sign-en { color: rgba(0,0,0,0.68) !important; }
.hero-sign-footer {
  display: flex !important;
  align-items: center; justify-content: space-between; gap: 10px;
  background: #0a0a0a !important;
  color: #e5e7eb !important;
  padding: 10px 12px !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  border-top: 4px solid #000 !important;
  letter-spacing: 0.02em;
}
.hero-sign-footer span { white-space: nowrap; }
.hero-line-dot { width: 10px; height: 10px; border-radius: 999px; flex: none; box-shadow: 0 0 0 3px rgba(255,255,255,0.12); }

/* تابلو مسیریابی — حالت آویز قرمز (مثل عکس قرمز) */
.leg-head {
  position: relative !important;
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  background: var(--lc, #dc2626) !important;
  border: 1.4px solid #0a0a0a !important;
  border-radius: 10px !important;
  padding: 14px 14px 14px 14px !important;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.12) inset,
    0 8px 22px -10px rgba(0,0,0,0.6),
    0 3px 8px rgba(0,0,0,0.35) !important;
  overflow: hidden !important;
  min-height: 64px;
  animation: signIn 0.38s cubic-bezier(0.22,1,0.36,1) both;
  animation-delay: calc(var(--i, 0) * 40ms);
}
.leg-head::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.10), transparent 55%);
  pointer-events: none;
}
.leg-head { --sign-text: #fff !important; }
.leg-head .leg-num, .leg-head .leg-en { color: #fff !important; text-shadow: 0 1px 2px rgba(0,0,0,0.28); }
.leg-head .leg-en { opacity: 0.92 !important; }
/* آویزهای کوچک بالای تابلو مسیریابی */
.leg-head::after {
  content: "";
  position: absolute;
  top: -7px; left: 18px; right: 18px;
  height: 6px;
  background: linear-gradient(90deg, #6b7280 0 12px, transparent 12px  calc(100% - 12px), #6b7280  calc(100% - 12px) 100%);
  opacity: 0.0;
}
.leg-hex {
  width: 30px !important; height: 30px !important;
  flex: none !important;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  display: grid !important; place-items: center;
  backdrop-filter: none !important;
  box-shadow: none !important;
  margin: 0 !important;
  overflow: visible !important;
}
.leg-hex polygon { fill: #fff !important; filter: drop-shadow(0 1px 1px rgba(0,0,0,0.3)); }

/* استپر ایستگاه‌ها زیر تابلو — ریل مترو */
.leg-list { padding-top: 6px !important; }
.leg-list::before {
  background: repeating-linear-gradient(180deg, var(--leg-line, #e5e7eb) 0 8px, transparent 8px 14px) !important;
  width: 4px !important;
  margin-inline-start: 15px !important;
  opacity: 0.9;
}
.station-dot {
  border: 2px solid #fff !important;
  box-shadow: 0 0 0 3px var(--lc, #999), 0 2px 6px rgba(0,0,0,0.25) !important;
  width: 12px !important; height: 12px !important;
}
.station-dot.hollow {
  background: #0a0a0a !important;
  border-color: #fff !important;
  box-shadow: 0 0 0 3px var(--lc, #999) !important;
}
.station-dot-cell { background: transparent !important; }

/* آیکن‌های مدرن‌تر — کمی ضخیم‌تر و گردتر */
.btn svg, .combo-trigger svg, .smap-tool svg, .map-tools button svg {
  stroke-width: 2.2 !important;
}

/* کمی جادوی اضافی: اسکرول که می‌کنی تابلوها آرام تکان می‌خورند */
@media (prefers-reduced-motion: no-preference) {
  .station-sign { will-change: transform; }
}


/* ============================================================
   PATCH — بهینه‌سازی و رفع باگ‌های گزارش‌شده
   ============================================================ */

/* 1) حذف آویز فلزی بالا */
.sign-hangers, .station-sign-hero .sign-hangers { display: none !important; }

/* 2) تم دارک: تابلوها با حاشیه روشن — نازک ۱٫۴px */
html.dark .station-sign {
  border-color: rgba(255,255,255,0.96) !important;
  box-shadow:
    0 0 0 0.5px rgba(255,255,255,0.20),
    0 6px 16px -8px rgba(0,0,0,0.55) !important;
}
html.dark .station-sign-hero {
  border-color: rgba(255,255,255,0.96) !important;
  box-shadow:
    0 0 0 0.5px rgba(255,255,255,0.18),
    0 12px 28px -12px rgba(0,0,0,0.55) !important;
}
html.dark .leg-head {
  border-color: rgba(255,255,255,0.92) !important;
}
/* در دارک، سایه تابلوها کمی روشن‌تر تا از بک‌گراند جدا شن */
html.dark .station-sign.sign-dark { box-shadow: 0 0 0 1px rgba(255,255,255,0.10), 0 8px 20px -8px rgba(0,0,0,0.6) !important; }

/* 3) حذف گپ/هاله سفید زیر کارت اصلی خطوط وقتی باز میشه */
.line-acc-inner, .line-acc-inner.station-signs-grid {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}
.line-acc-body { background: transparent !important; }
.line-acc.open .line-acc-body { background: transparent !important; }
/* خود آکاردئون هم هاله داشت — حذف */
.line-acc { background: transparent !important; border: none !important; box-shadow: none !important; }
.line-acc .line-acc-inner.station-signs-grid { background: transparent !important; }

/* 4) رنگ کارت‌های اصلی خطوط = همون رنگ تابلوها (بهتره گفتی) — قبلا تیره‌تر بود */
.board.l1, .board.l1w { background: #dc2626 !important; }
.board.l2 { background: #4338ca !important; }
.board.l3 { background: #0284c7 !important; }
.board.l4, .board.l4s { background: #eab308 !important; }
.board.l5, .board.l5w { background: #16a34a !important; }
.board.l6 { background: #ec4899 !important; }
.board.l7 { background: #a21caf !important; }
/* متن روی زرد مشکی، بقیه سفید */
.board.l4, .board.l4s { color: #0a0a0a !important; }
.board.l4 .line-acc-title, .board.l4s .line-acc-title,
.board.l4 .line-acc-desc, .board.l4s .line-acc-desc { color: #0a0a0a !important; }
.board.l1, .board.l1w, .board.l2, .board.l3, .board.l5, .board.l5w, .board.l6, .board.l7 { color: #fff !important; }

/* 5) بازطراحی کارت اصلی خطوط — پرمیوم و خلاقانه‌تر */
.line-acc-head {
  border-radius: 16px !important;
  padding: 16px 16px !important;
  min-height: 72px;
  border: 1px solid rgba(255,255,255,0.08) !important;
  box-shadow: 0 6px 18px -8px rgba(0,0,0,0.45) !important;
  gap: 14px !important;
  text-align: start;
  position: relative;
  overflow: hidden;
}
.line-acc-head::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.10), transparent 60%);
  opacity: 0;
  transition: opacity 0.25s;
  pointer-events: none;
}
.line-acc-head:hover::before { opacity: 1; }
.line-acc-head::after { display: none !important; } /* حذف گرادیانت قبلی */
html:not(.dark) .line-acc-head { border-color: rgba(0,0,0,0.06) !important; }
.line-acc.open .line-acc-head { border-radius: 16px 16px 0 0 !important; }
@media (min-width: 640px) { .line-acc-head { min-height: 78px; padding: 18px 18px !important; } }
/* نشان خط: دایره بزرگ با شماره */
.line-acc-head .line-badge {
  width: 44px; height: 44px;
  border-radius: 14px;
  background: rgba(0,0,0,0.18);
  border: 2px solid rgba(255,255,255,0.25);
  display: grid; place-items: center;
  font-weight: 900; font-size: 18px;
  flex: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.25), 0 2px 8px rgba(0,0,0,0.15);
  backdrop-filter: blur(4px);
}
.board.l4 .line-badge, .board.l4s .line-badge {
  background: rgba(0,0,0,0.08);
  border-color: rgba(0,0,0,0.12);
  color: #0a0a0a;
}
.line-acc-title { font-size: 15px !important; font-weight: 800 !important; letter-spacing: -0.01em; }
@media (min-width: 640px) { .line-acc-title { font-size: 16px !important; } }
.line-acc-desc { font-size: 11px !important; opacity: 0.88 !important; margin-top: 2px; display: block; }
.line-acc-chev {
  width: 34px !important; height: 34px !important;
  background: rgba(0,0,0,0.12) !important;
  border: 1px solid rgba(255,255,255,0.15) !important;
  border-radius: 10px !important;
  display: grid !important; place-items: center;
  transition: all 0.25s cubic-bezier(0.22,1,0.36,1) !important;
}
.board.l4 .line-acc-chev { background: rgba(0,0,0,0.06) !important; border-color: rgba(0,0,0,0.08) !important; }
.line-acc.open .line-acc-chev { transform: rotate(180deg) !important; background: rgba(255,255,255,0.18) !important; }

/* 6) بهینه‌سازی پرفورمنس — برای گوشی‌های ضعیف‌تر */
.station-sign {
  will-change: transform;
  backface-visibility: hidden;
  -webkit-font-smoothing: antialiased;
}
/* سایه‌ها سبک‌تر برای موبایل ضعیف */
@media (max-width: 480px) {
  .station-sign { box-shadow: 0 4px 12px -4px rgba(0,0,0,0.4) !important; min-height: 84px; }
  html.dark .station-sign { box-shadow: 0 0 0 1px rgba(255,255,255,0.12), 0 4px 12px -4px rgba(0,0,0,0.5) !important; }
  .station-sign:hover { transform: translateY(-2px) !important; }
}
/* اگر کاربر reduce motion خواست، انیمیشن‌ها خاموش */
@media (prefers-reduced-motion: reduce) {
  .station-sign { animation: none !important; transition: none !important; }
  .station-sign:hover { transform: none !important; }
}
/* کمبو پاپ‌آپ: فقط ~۴ ایستگاه نمایش، بقیه اسکرول — درخواست کاربر */
.combo-pop { max-height: 16.5rem !important; }
.combo-list { max-height: 11.2rem !important; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; overflow-y: auto !important; }
/* کارت مسیریابی دیگه overflow hidden نداره تا لیست کامل دیده شه */
.route-card-wrap { overflow: visible !important; }
.hero-grid { overflow: visible !important; }
.hero { overflow: visible !important; }

/* 7) تم دارک — ایستگاه‌ها بهتر دیده شن با کمی درخشش */
html.dark .sign-body { filter: saturate(1.05) brightness(1.02); }
html.dark .sign-footer { background: #080808 !important; }

/* فوتر لایو دات — بعدا با JS فعال میشه */
.bn-item .live-dot {
  position: absolute;
  top: 6px; right: 10px;
  width: 7px; height: 7px;
  background: #22c55e;
  border: 2px solid rgba(13,17,23,0.9);
  border-radius: 999px;
  box-shadow: 0 0 0 3px rgba(34,197,94,0.18);
  opacity: 0;
  transform: scale(0.6);
  transition: all 0.3s;
  pointer-events: none;
}
.bn-item .live-dot.on {
  opacity: 1;
  transform: scale(1);
  animation: livePulse 1.6s ease-in-out infinite;
}
@keyframes livePulse {
  0%,100% { box-shadow: 0 0 0 3px rgba(34,197,94,0.18); }
  50% { box-shadow: 0 0 0 6px rgba(34,197,94,0.08); }
}

/* بوتوم نو ۵ تایی — درباره اضافه شد */
.bottom-nav.five .bn-grid { gap: 0px !important; grid-template-columns: repeat(5,1fr) !important; }
.bottom-nav.five .bn-item .bn-label { font-size: 9px !important; }
@media (max-width: 360px) { .bottom-nav.five .bn-label { font-size: 7px !important; } }
.bottom-nav.six .bn-grid { gap: 0 !important; grid-template-columns: repeat(6, minmax(0, 1fr)) !important; }
.bottom-nav.six .bn-item { min-width: 0; padding-inline: 0; }
.bottom-nav.six .bn-item .bn-pill { width: 2.7rem; height: 1.6rem; }
.bottom-nav.six .bn-item .bn-label { max-width: 100%; font-size: 8px !important; }
.bottom-nav.six .bn-item svg { width: 18px; height: 18px; }
@media (max-width: 360px) { .bottom-nav.six .bn-label { font-size: 8px !important; } }


/* درباره — کارت‌های تمیز و هماهنگ با تم جاری */
.about-hero {
  color: hsl(var(--card-foreground));
  background: linear-gradient(135deg, hsl(var(--card)), hsl(var(--muted) / 0.72));
  border: 1px solid hsl(var(--border));
  border-radius: 16px;
  padding: 24px 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}
.about-hero::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, #dc2626, #4338ca, #0284c7, #eab308, #16a34a, #ec4899, #a21caf);
}
.about-logo { margin-bottom: 12px; }
.about-logo .hero-wordmark { font-size: clamp(1.75rem, 6vw, 2.5rem); }
html:not(.dark) .about-logo .hero-wordmark .word-hl { color: hsl(38 80% 34%); text-shadow: none; }
.about-intro { color: hsl(var(--muted-foreground)); font-size: 13px; line-height: 1.8; max-width: 520px; margin: 0 auto; }
.about-intro p { margin: 0; }
.about-version { display: inline-block; margin-top: 10px; background: hsl(var(--muted) / 0.72); border: 1px solid hsl(var(--border)); color: hsl(var(--muted-foreground)); padding: 4px 10px; border-radius: 999px; font-size: 11px; }
.about-card { padding: 18px !important; }
.about-card h3 { font-size: 14px; font-weight: 800; margin-bottom: 10px; color: hsl(var(--foreground)); }
.about-list { display: flex; flex-direction: column; gap: 10px; }
.about-list li { display: flex; align-items: center; gap: 8px; font-size: 13px; background: hsl(var(--muted) / 0.5); padding: 10px 12px; border-radius: 10px; border: 1px solid hsl(var(--border) / 0.5); }
html.dark .about-list li { background: rgba(255,255,255,0.04); border-color: rgba(255,255,255,0.06); }
.ab-ico { width: 18px; height: 18px; color: hsl(var(--primary)); flex: none; }
.about-socials { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.about-socials a { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; background: hsl(var(--muted)); border: 1px solid hsl(var(--border)); border-radius: 10px; font-size: 12px; font-weight: 600; }
html.dark .about-socials a { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.08); color: #fff; }
.about-copy { margin-top: 14px; font-size: 12px; color: hsl(var(--muted-foreground)); line-height: 1.7; border-top: 1px dashed hsl(var(--border)); padding-top: 12px; }
.about-page { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
.about-donate-bar {
  position: fixed;
  left: 50%;
  bottom: calc(84px + env(safe-area-inset-bottom));
  z-index: 90;
  width: max-content;
  max-width: calc(100vw - 24px);
  transform: translateX(-50%);
}
.about-donate-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: max-content;
  max-width: 100%;
  padding: 12px 18px;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 16px;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #111827;
  font-size: .88rem;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
  box-shadow: 0 10px 28px rgba(251,191,36,.38), 0 2px 10px rgba(0,0,0,.14);
  transition: transform .15s, box-shadow .15s;
}
.about-donate-btn:hover { transform: translateY(-1px); box-shadow: 0 14px 32px rgba(251,191,36,.48); }
.about-donate-btn:active { transform: translateY(0); }
.about-donate-btn svg { width: 1.1rem; height: 1.1rem; flex: none; }

/* === مترو لاین — لوگو === */
.header-logo-text {
  font-family: "Vazirmatn", system-ui, sans-serif;
  font-weight: 900; font-size: 1.35rem; letter-spacing: -0.03em;
  color: hsl(var(--foreground)); text-decoration: none; white-space: nowrap;
  display: inline-flex; align-items: baseline; gap: 2px;
  line-height: 1; padding: 4px 12px; border-radius: 10px;
  background: linear-gradient(135deg, rgba(251,191,36,0.14), rgba(251,191,36,0.04));
  border: 1px solid rgba(251,191,36,0.18);
}
.header-logo-text .hl { color: hsl(45 100% 52%); }
.hero-wordmark {
  font-family: "Vazirmatn", system-ui, sans-serif;
  font-weight: 900; font-size: clamp(2.2rem, 8vw, 3.2rem);
  line-height: 1; letter-spacing: -0.03em;
  display: inline-flex; flex-direction: column; align-items: center; gap: 0.22rem;
  padding: 0.15em 0.3em;
}
.hero-wordmark .word-brand {
  display: inline-flex; flex-direction: row; align-items: baseline; gap: 0.14em;
  white-space: nowrap;
}
.hero-wordmark .word-main { color: #fff; }
.hero-wordmark .word-hl { color: #fbbf24; text-shadow: 0 1px 10px rgba(251,191,36,0.28); }
.hero-wordmark .word-sub {
  font-size: 0.62rem; font-weight: 600; letter-spacing: 0.13em;
  color: rgba(255,255,255,0.5); text-transform: lowercase;
}
html:not(.dark) .hero-wordmark .word-main { color: hsl(var(--foreground)); }
html:not(.dark) .hero-wordmark .word-sub { color: hsl(var(--muted-foreground)); }

/* === ریسپانسیو کامل === */
.hero {
  min-height: auto;
}
.hero-grid {
  display: grid; grid-template-columns: 1fr; gap: 1.4rem; place-items: center;
  max-width: 720px; margin: 0 auto; padding: 20px 16px 12px !important; width: 100%; box-sizing: border-box;
}
.route-card-wrap { width: 100%; max-width: 380px; display: flex; justify-content: center; }
.route-card { width: 100%; max-width: 380px; margin: 0 auto; box-sizing: border-box; }
.hero-tagline { max-width: 420px; margin-left: auto; margin-right: auto; text-align: center; }
@media (min-width: 768px) {
  .hero-grid { max-width: 680px; gap: 1.8rem; padding: 28px 20px 16px !important; }
}
@media (min-width: 1024px) {
  .hero-grid {
    grid-template-columns: minmax(320px, 1.05fr) minmax(340px, 0.95fr);
    max-width: 1080px; gap: 2.2rem; align-items: center; padding: 36px 24px 20px !important;
  }
  .hero-grid > div:first-child { order: 2; }
  .hero-grid > div:first-child .lg-start { justify-content: flex-start !important; }
  .hero-grid > div:first-child .hero-tagline { margin-left: 0; margin-right: 0; text-align: start; }
  .hero-grid > div:last-child { order: 1; }
}
@media (min-width: 1280px) {
  .hero-grid { max-width: 1180px; gap: 3rem; padding: 44px 24px 24px !important; }
}
@media (max-width: 380px) {
  .route-card { padding: 1.1rem; }
  .hero-wordmark { font-size: clamp(1.8rem, 7vw, 2.4rem); }
}

/* کانتینرهای عمومی ریسپانسیو */
.container, .mx-auto.max-w-3xl { width: 100%; max-width: min(48rem, 92vw); box-sizing: border-box; }
@media (min-width: 640px) { .mx-auto.max-w-3xl { max-width: 40rem; } }
@media (min-width: 768px) { .mx-auto.max-w-3xl { max-width: 46rem; } }
@media (min-width: 1024px) { .mx-auto.max-w-3xl { max-width: 52rem; } }

/* === قفل تک‌صفحه‌ای === */
html[data-route="/"], html[data-route="/stations-map"], html[data-route="/map"] {
  overflow: hidden; height: 100dvh; overscroll-behavior: none;
}
html[data-route="/"] body, html[data-route="/stations-map"] body, html[data-route="/map"] body {
  overflow: hidden; height: 100dvh; overscroll-behavior: none;
}
html[data-route="/"] #app, html[data-route="/stations-map"] #app, html[data-route="/map"] #app {
  height: calc(100dvh - 3.5rem - 4rem); overflow: hidden; display: flex; flex-direction: column;
}
html[data-route="/"] .hero, html[data-route="/stations-map"] .smap-wrap, html[data-route="/map"] .map-shell { flex: 1; min-height: 0; height: 100%; }
html[data-route="/path"] body { overflow: auto; }
@media (max-width: 768px) {
  html[data-route="/"] #app, html[data-route="/stations-map"] #app, html[data-route="/map"] #app {
    height: calc(100dvh - 3.5rem - 4rem); overflow: hidden;
  }
}

/* === بهبودهای UX: دنبال‌کردن قطار و نمایش موبایل === */
@media (max-width: 640px) {
  header.site-header .header-inner.container {
    max-width: 100% !important;
    padding-inline: 4px !important;
  }
  #menuBtn, #themeBtn {
    width: 36px !important;
    height: 36px !important;
    border-radius: 10px !important;
  }
  #langBtn {
    width: 44px !important;
    height: 36px !important;
    padding-inline: 4px !important;
    border-radius: 10px !important;
  }
  #menuBtn svg, #themeBtn svg, #langBtn svg {
    width: 18px !important;
    height: 18px !important;
  }
  .lang-btn .lang-code { font-size: 8px !important; }

  html[data-route="/"] #app {
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
  }
  html[data-route="/"] .hero {
    flex: 0 0 auto !important;
    height: auto !important;
    min-height: 100% !important;
    align-items: stretch;
    justify-content: flex-start;
    overflow: visible !important;
  }
  html[data-route="/"] .hero-grid {
    grid-template-columns: 1fr;
    gap: 0.6rem;
    max-width: 100%;
    padding: 10px 10px 8px !important;
  }
  html[data-route="/"] .hero-grid > .page-enter {
    display: flex;
    justify-content: center;
  }
  html[data-route="/"] .hero-logo { height: 40px !important; }
  html[data-route="/"] .route-card-wrap { max-width: 420px; margin-inline: auto; }
  html[data-route="/"] .route-card {
    width: 100% !important;
    max-width: 420px !important;
    margin: 0 auto !important;
    padding: 14px !important;
    border-radius: 16px !important;
  }
  html[data-route="/"] .route-card .field { margin-bottom: 8px !important; }
  html[data-route="/"] .route-card .label {
    margin-bottom: 4px !important;
    font-size: 11px !important;
  }
  html[data-route="/"] .route-card .combo-trigger {
    height: 42px !important;
    border-radius: 11px !important;
  }
  html[data-route="/"] .route-card #locateBtn {
    width: 42px !important;
    height: 42px !important;
    border-radius: 11px !important;
  }
  html[data-route="/"] .route-card .collapsible-body { padding: 8px !important; margin-top: 6px !important; }
  html[data-route="/"] .route-card .collapsible-body.open {
    max-height: min(44dvh, 18rem) !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
  }
  html[data-route="/"] .route-card .switch-row { padding: 4px 0 !important; }
  html[data-route="/"] .route-card .input { min-height: 38px; padding: 8px 10px !important; }
  html[data-route="/"] .route-card [type="submit"] { height: 40px !important; }
  html[data-route="/"] .hero-copyright {
    padding: 10px 10px 16px !important;
    font-size: 10px;
    line-height: 1.5;
  }

  .stations-page {
    width: 100% !important;
    max-width: 100% !important;
    padding: 10px 8px 18px !important;
  }
  .stations-page #stlLines { gap: 0.65rem !important; }
  .stations-page .line-acc-head {
    min-height: 64px;
    padding: 10px 11px !important;
    gap: 10px !important;
    border-radius: 13px !important;
  }
  .stations-page .line-acc.open .line-acc-head { border-radius: 13px 13px 0 0 !important; }
  .stations-page .line-acc-inner.station-signs-grid {
    gap: 6px !important;
    padding: 6px 0 8px !important;
  }
  .stations-page .station-sign {
    min-height: 76px;
    border-radius: 8px !important;
  }
}

/* اندازهٔ ثابتِ شمارنده و حذف لایهٔ ترکیب اضافی روی پاپ‌آپ؛ موقع تعقیب آرام‌تر می‌ماند. */
.leaflet-popup.popup-train { filter: none !important; }
.popup-train .leaflet-popup-content-wrapper { will-change: auto !important; }
.popup-train .sec-num {
  width: 44px !important;
  min-width: 44px !important;
  flex: 0 0 44px;
  white-space: nowrap;
}

/* === اصلاحات موبایل: فرم، هدر، فاصلهٔ خطوط و جداسازی حمایت === */
@media (max-width: 640px) {
  header.site-header .header-inner.container {
    width: 100% !important;
    max-width: none !important;
    padding-inline: 1px !important;
    box-sizing: border-box;
  }
  .header-inner > div:first-child { display: flex; justify-content: flex-start; }
  .header-inner > div:first-child, .header-center, .header-end { min-width: 0; }
  .header-end { justify-content: flex-end; gap: 2px !important; }
  #menuBtn, #themeBtn {
    width: 32px !important;
    height: 32px !important;
    padding: 0 !important;
    border-radius: 8px !important;
  }
  #langBtn {
    width: 40px !important;
    height: 32px !important;
    padding-inline: 2px !important;
    border-radius: 8px !important;
    gap: 1px !important;
  }
  #menuBtn svg, #themeBtn svg, #langBtn svg {
    width: 16px !important;
    height: 16px !important;
  }
  .lang-btn .lang-code { font-size: 7px !important; }

  html[data-route="/"] .hero-grid {
    gap: .35rem !important;
    padding: 6px 4px 4px !important;
  }
  html[data-route="/"] .hero-wordmark {
    font-size: clamp(1.45rem, 6vw, 1.8rem) !important;
  }
  html[data-route="/"] .route-card-wrap {
    width: 100% !important;
    max-width: 360px !important;
  }
  html[data-route="/"] .route-card {
    width: 100% !important;
    max-width: 360px !important;
    padding: 10px !important;
    margin: 0 auto !important;
    border-radius: 14px !important;
  }
  html[data-route="/"] .route-card .field { margin-bottom: 6px !important; }
  html[data-route="/"] .route-card .label {
    margin-bottom: 3px !important;
    font-size: 10px !important;
  }
  html[data-route="/"] .route-card .field-row {
    align-items: flex-start;
    gap: 6px;
  }
  html[data-route="/"] .route-card .combo { min-width: 0; }
  html[data-route="/"] .route-card .combo-trigger {
    height: 38px !important;
    padding-inline: 10px !important;
    border-radius: 10px !important;
  }
  html[data-route="/"] .route-card #locateBtn {
    width: 38px !important;
    height: 38px !important;
    border-radius: 10px !important;
  }
  /* Keep the mobile list in document flow so it pushes the copyright down instead of covering it. */
  html[data-route="/"] .route-card .combo-pop {
    position: static !important;
    inset: auto !important;
    z-index: auto !important;
    width: 100%;
    max-height: min(36dvh, 230px) !important;
    margin: 5px 0 0 !important;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 5px 16px rgb(0 0 0 / .16);
  }
  html[data-route="/"] .route-card .combo-pop.open {
    display: flex !important;
    flex-direction: column;
    opacity: 1 !important;
    transform: none !important;
  }
  html[data-route="/"] .route-card .combo-search {
    flex: none;
    min-height: 42px;
    padding: 8px 10px !important;
    font-size: 16px !important; /* prevents iOS from zooming the page when search is tapped */
  }
  html[data-route="/"] .route-card .combo-list {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }
  html[data-route="/"] .route-card .combo-item {
    min-height: 34px;
    padding: 7px 9px !important;
    font-size: .82rem !important;
  }
  html[data-route="/"] .route-card .collapsible-head h4 { font-size: .8rem !important; }
  html[data-route="/"] .route-card .collapsible-body { padding: 6px !important; margin-top: 4px !important; }
  html[data-route="/"] .route-card .collapsible-body.open {
    max-height: none !important;
    overflow: visible !important;
  }
  html[data-route="/"] .route-card .input {
    min-height: 36px !important;
    padding: 6px 9px !important;
  }
  html[data-route="/"] .route-card [type="submit"] {
    height: 36px !important;
    margin-top: 3px !important;
  }
  html[data-route="/"] .hero-copyright {
    margin-top: 0 !important;
    padding: 8px 6px 12px !important;
  }

  .stations-page {
    width: 100% !important;
    max-width: none !important;
    margin-inline: 0 !important;
    padding: 8px 3px 18px !important;
  }
  .stations-page #stlLines > * + * { margin-top: 7px !important; }
  .stations-page .line-acc {
    width: 100%;
    margin: 0 !important;
    border-radius: 10px !important;
  }
  .stations-page .line-acc-head {
    min-height: 56px !important;
    padding: 8px 7px !important;
    gap: 8px !important;
  }
  .stations-page .line-acc.open .line-acc-head { border-radius: 10px 10px 0 0 !important; }
  .stations-page .line-acc-head .line-badge {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    font-size: 15px;
  }
  .stations-page .line-acc-chev { width: 28px !important; height: 28px !important; }
  .stations-page .line-acc-inner.station-signs-grid {
    gap: 4px !important;
    padding: 4px 1px 6px !important;
  }
  .stations-page .station-sign {
    min-height: 68px;
    border-radius: 7px !important;
  }
}

/* The home copyright stays visible just above the floating bottom navigation. */
html[data-route="/"] .hero-copyright {
  position: fixed !important;
  left: 0;
  right: 0;
  bottom: 84px;
  z-index: 90;
  margin: 0 !important;
  padding: 2px 12px !important;
  color: rgba(255, 255, 255, .78);
  font-size: 10px;
  line-height: 1.4;
  text-align: center;
  pointer-events: none;
}
html:not(.dark)[data-route="/"] .hero-copyright { color: rgba(35, 30, 20, .76); }

/* Keep the home wordmark stable on first render; the route content still loads asynchronously. */
html[data-route="/"] .hero-grid > .page-enter { animation: none; }

/* On phones the header already carries the brand, so let the animated map show through. */
@media (max-width: 640px) {
  html[data-route="/"] .hero-grid > .page-enter { display: none !important; }
  html[data-route="/"] .hero-grid { padding-bottom: 112px !important; }
  html[data-route="/"] .route-card {
    background: rgba(22, 28, 42, .46) !important;
    backdrop-filter: blur(8px) saturate(135%) !important;
    -webkit-backdrop-filter: blur(8px) saturate(135%) !important;
    border-color: rgba(255, 255, 255, .16) !important;
  }
  html:not(.dark)[data-route="/"] .route-card {
    background: rgba(253, 248, 238, .7) !important;
    backdrop-filter: blur(8px) saturate(120%) !important;
    -webkit-backdrop-filter: blur(8px) saturate(120%) !important;
    border-color: rgba(98, 79, 45, .2) !important;
  }
}

/* Static, low-contrast Metro Line wordmark: no panel, image, or animation. */
.hero-brand-watermark {
  display: none;
  position: absolute;
  z-index: 0;
  top: 50%;
  left: 50%;
  place-items: center;
  width: min(100vw, 1100px);
  height: auto;
  aspect-ratio: 1000 / 420;
  overflow: hidden;
  transform: translate(-50%, -50%);
  pointer-events: none;
  user-select: none;
}
.hero-brand-watermark__route {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  opacity: .2;
}
.hero-brand-watermark__route path {
  fill: none;
  stroke: url(#heroWatermarkRoute);
  stroke-width: 7;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: .36;
}
.hero-brand-watermark__route circle { fill: hsl(var(--primary) / .55); }
.hero-brand-watermark__copy {
  position: relative;
  display: grid;
  justify-items: center;
  gap: .3rem;
  transform: translateY(-4%);
}
.hero-brand-watermark__name {
  display: flex;
  flex-direction: row;
  unicode-bidi: isolate;
  align-items: baseline;
  gap: .09em;
  white-space: nowrap;
  font-size: clamp(3.2rem, 14vw, 9rem);
  line-height: .95;
  font-weight: 950;
  letter-spacing: -.065em;
}
.hero-brand-watermark__name span:first-child {
  color: hsl(var(--foreground) / .065);
  text-shadow: 0 0 38px hsl(var(--primary) / .1);
}
.hero-brand-watermark__name span:last-child {
  color: hsl(var(--primary) / .14);
  text-shadow: 0 0 34px hsl(var(--primary) / .12);
}
.hero-brand-watermark__url {
  color: hsl(var(--foreground) / .2);
  font-size: clamp(.62rem, 1.35vw, .88rem);
  font-weight: 750;
  letter-spacing: .3em;
  line-height: 1.5;
}
@media (max-width: 768px) {
  .hero-brand-watermark { display: grid; }
}
@media (max-width: 640px) {
  .hero-brand-watermark__name { font-size: clamp(3.3rem, 16vw, 6.2rem); }
  .hero-brand-watermark__url { font-size: .66rem; letter-spacing: .24em; }
  .hero-brand-watermark__route { opacity: .16; }
}

/* Simple community news feed and moderation panel. */
.community-page.page { width: min(100% - 28px, 1160px); max-width: 1160px; margin: 0 auto; padding: 30px 0 76px; text-align: start; }
@media (min-width: 901px) {
  .citizen-page.community-page.page { box-sizing: border-box; width: min(calc(100% - 48px), 1160px); margin-inline: auto; }
  .citizen-page .community-heading, .citizen-page .citizen-layout { width: min(100%, 1080px); margin-inline: auto; }
}
.community-heading { display: flex; align-items: center; gap: 14px; margin: 0 0 22px; }
.community-heading-icon { display: grid; flex: 0 0 52px; width: 52px; height: 52px; place-items: center; border-radius: 16px; color: #fff; background: linear-gradient(135deg, hsl(var(--primary)), #ea580c); box-shadow: 0 8px 25px rgba(234,88,12,.22); }
.community-heading-icon svg { width: 25px; height: 25px; }
.community-heading h1 { margin: 0; font-size: clamp(1.25rem, 2.8vw, 1.7rem); font-weight: 900; }
.community-heading p { margin: 4px 0 0; color: hsl(var(--muted-foreground)); font-size: .88rem; line-height: 1.7; }
.community-section-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 14px; font-size: 1.02rem; font-weight: 850; }
.community-section-title > span { display: inline-flex; align-items: center; gap: 8px; }
.community-section-title svg { width: 19px; height: 19px; color: hsl(var(--primary)); }
.citizen-layout { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(300px, .75fr); align-items: start; gap: 22px; }
.citizen-feed-section { min-width: 0; }
.citizen-form-card { position: sticky; top: 78px; padding: 20px; }
.citizen-page.is-composing .community-heading,
.citizen-page.is-composing .citizen-feed-section { display: none; }
.citizen-page.is-composing .citizen-layout { grid-template-columns: minmax(0, 1fr); }
.citizen-page.is-composing .citizen-form-card { position: static; top: auto; order: 0; width: min(100%, 760px); margin: 0 auto; }
.community-form { display: grid; gap: 13px; }
.community-field { display: grid; gap: 6px; color: hsl(var(--foreground)); font-size: .84rem; font-weight: 700; }
.community-field small, .community-form-hint { color: hsl(var(--muted-foreground)); font-size: .75rem; line-height: 1.7; font-weight: 450; }
.community-form-hint { margin: -6px 0 14px; }
.community-form .input { width: 100%; min-width: 0; }
.community-form textarea { resize: vertical; min-height: 120px; line-height: 1.8; }
.community-file-input { padding: 9px 10px !important; height: auto !important; }
.community-file-input::file-selector-button { margin-inline-end: 9px; padding: 6px 10px; border: 1px solid hsl(var(--border)); border-radius: 8px; background: hsl(var(--muted)); color: hsl(var(--foreground)); font: inherit; font-size: .76rem; font-weight: 700; cursor: pointer; }
.community-file-count.error { color: hsl(var(--destructive)); }
.community-video-clear { justify-self: start; min-height: 32px; padding-inline: 8px; color: hsl(var(--muted-foreground)); font-size: .73rem; }
.community-video-clear svg { width: 14px; height: 14px; }
.community-media-uploader { display: grid; gap: 12px; padding: 13px; border: 1px solid hsl(var(--border)); border-radius: 14px; background: hsl(var(--muted) / .22); }
.community-media-field > span { display: inline-flex; align-items: center; gap: 7px; }
.community-media-field > span svg { width: 17px; height: 17px; color: hsl(var(--primary)); }
.community-local-video-wrap { overflow: hidden; border: 1px solid hsl(var(--border)); border-radius: 12px; background: #080a0e; }
.community-local-video-wrap video { display: block; width: 100%; max-height: 260px; aspect-ratio: 16 / 9; background: #080a0e; object-fit: contain; }
.community-voice-panel { display: grid; gap: 10px; padding: 12px; border: 1px solid hsl(var(--border)); border-radius: 12px; background: hsl(var(--card)); }
.community-voice-heading { display: flex; align-items: flex-start; gap: 9px; }
.community-voice-heading > div { display: grid; gap: 2px; min-width: 0; }
.community-voice-heading strong { font-size: .83rem; font-weight: 800; }
.community-voice-heading small { color: hsl(var(--muted-foreground)); font-size: .72rem; font-weight: 450; line-height: 1.7; }
.community-voice-icon { display: grid; flex: 0 0 32px; width: 32px; height: 32px; place-items: center; border-radius: 10px; background: hsl(var(--primary) / .1); color: hsl(var(--primary)); }
.community-voice-icon svg { width: 17px; height: 17px; }
.community-voice-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.community-voice-controls .btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 37px; padding-inline: 11px; font-size: .76rem; }
.community-voice-controls .btn svg { width: 16px; height: 16px; }
.community-voice-clear { flex: 0 0 34px; width: 34px; height: 34px; min-height: 34px !important; padding: 0 !important; }
.community-voice-timer { margin-inline-start: auto; padding: 5px 9px; border: 1px solid hsl(var(--border)); border-radius: 9px; background: hsl(var(--muted) / .5); color: hsl(var(--foreground)); direction: ltr; font-size: .72rem; font-variant-numeric: tabular-nums; unicode-bidi: isolate; }
.community-voice-preview { display: block; width: 100%; min-height: 38px; accent-color: hsl(var(--primary)); }
.community-voice-panel .community-form-status { min-height: 0; margin: 0; font-size: .74rem; }
.community-voice-panel .community-form-status.is-success { color: #15803d; }
.community-voice-panel .community-form-status.is-error { color: hsl(var(--destructive)); }
html.dark .community-voice-panel .community-form-status.is-success { color: #4ade80; }
html.dark .community-voice-panel .community-form-status.is-error { color: #f87171; }
.community-honeypot { position: absolute !important; width: 1px !important; height: 1px !important; overflow: hidden !important; clip-path: inset(50%) !important; white-space: nowrap !important; }
.community-captcha { display: grid; gap: 8px; padding: 12px; border: 1px solid hsl(var(--border)); border-radius: 13px; background: hsl(var(--muted) / .28); text-align: start; }
.community-captcha-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 9px; }
.community-captcha-heading strong { font-size: .82rem; font-weight: 800; }
.community-captcha-heading .btn { display: inline-flex; align-items: center; gap: 5px; min-height: 31px; height: 31px; padding: 4px 7px; font-size: .68rem; white-space: nowrap; }
.community-captcha-heading .btn svg { width: 14px; height: 14px; }
.community-captcha-heading .community-captcha-refresh { width: auto; min-width: 0; max-width: 100%; }
.community-captcha-heading .community-captcha-refresh:disabled { opacity: .55; cursor: wait; }
.community-captcha-question { display: flex; align-items: center; justify-content: flex-start; min-height: 2.45rem; margin: 0; padding: .4rem .7rem; border: 1px solid hsl(var(--border)); border-radius: 10px; background: hsl(var(--card) / .62); color: hsl(var(--primary)); font-size: 1.05rem; font-weight: 850; font-variant-numeric: tabular-nums; text-align: start; }
.community-captcha-answer { max-width: 230px; }
.community-captcha-answer .input { max-width: 180px; text-align: center; direction: ltr; }
.community-captcha-hint { color: hsl(var(--muted-foreground)); font-size: .72rem; line-height: 1.6; }
.community-submit { width: 100%; min-height: 44px; }
.community-form-status, .community-status { min-height: 1.3em; color: hsl(var(--muted-foreground)); font-size: .8rem; line-height: 1.6; }
.community-form-status:not(:empty), .community-status:not(:empty) { margin-top: 3px; }
.community-form-status.is-uploading { display: flex; align-items: center; gap: 8px; color: hsl(var(--primary)); font-weight: 750; }
.community-form-status.is-uploading::before { display: inline-block; flex: 0 0 14px; width: 14px; height: 14px; border: 2px solid hsl(var(--primary) / .25); border-top-color: hsl(var(--primary)); border-radius: 50%; animation: communitySpin .8s linear infinite; content: ''; }
.community-search { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.community-search .input { flex: 1 1 180px; min-width: 0; }
.community-search .btn { min-height: 40px; }
.community-post-list { display: grid; gap: 12px; }

.community-post.community-post-compact { padding: 13px 15px; }
.community-post-compact .community-post-meta { gap: 7px; margin-bottom: 6px; font-size: .69rem; }
.community-post-preview { display: grid; grid-template-columns: minmax(0, 1fr) 112px; align-items: center; gap: 13px; color: inherit; text-decoration: none; }
.community-preview-copy { display: grid; min-width: 0; gap: 3px; }
.community-post-preview h3 { display: -webkit-box; margin: 0; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 1; font-size: .96rem; }
.community-post-excerpt { display: -webkit-box; max-height: 3.15em; overflow: hidden; color: hsl(var(--muted-foreground)); font-size: .79rem; line-height: 1.58; overflow-wrap: anywhere; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.community-post-attachments { display: flex; align-items: center; gap: 5px; min-height: 21px; margin-top: 3px; }
.community-post-attachment-icon { display: inline-flex; width: 22px; height: 22px; align-items: center; justify-content: center; border: 1px solid hsl(var(--border)); border-radius: 7px; background: hsl(var(--muted) / .6); color: hsl(var(--muted-foreground)); }
.community-post-attachment-icon > span { display: inline-flex; }
.community-post-attachment-icon svg { width: 14px; height: 14px; }
.community-post-thumb { display: block; width: 112px; height: 78px; border-radius: 11px; background: hsl(var(--muted)); object-fit: cover; }
.community-read-more { display: inline-flex; align-items: center; gap: 4px; margin-top: 2px; color: hsl(var(--primary)); font-size: .71rem; font-weight: 800; }
.community-read-more svg { width: 14px; height: 14px; }
.community-post-stats { display: flex; justify-content: space-between; gap: 8px; margin-top: 8px; color: hsl(var(--muted-foreground)); font-size: .68rem; }
.community-post-stats > span { display: inline-flex; align-items: center; gap: 5px; }
.community-post-views svg { width: 14px; height: 14px; }
.community-detail-content { width: min(100%, 850px); margin: 14px auto 0; }
.citizen-back-link { display: inline-flex; align-items: center; gap: 7px; min-height: 38px; text-decoration: none; }
.citizen-back-link svg { width: 17px; height: 17px; }
.citizen-detail-content { width: min(100%, 850px); margin: 8px auto 0; }
.community-post.community-post-full { padding: clamp(17px, 4vw, 28px); }
.community-post.community-post-full h3 { font-size: clamp(1.2rem, 3vw, 1.7rem); }
.community-post-full .community-post-body { color: hsl(var(--foreground) / .9); font-size: .96rem; line-height: 2; }
.community-post-full .community-post-stats { padding-top: 12px; border-top: 1px solid hsl(var(--border)); font-size: .76rem; }
.news-unread { position: relative; display: inline-block; flex: 0 0 9px; width: 9px; height: 9px; margin-inline-start: 4px; border-radius: 50%; background: #ef4444; box-shadow: 0 0 0 0 rgba(239,68,68,.58); animation: newsUnreadPulse 1.2s ease-out infinite; vertical-align: middle; }
.news-unread[hidden] { display: none !important; }
@keyframes newsUnreadPulse { 0% { box-shadow: 0 0 0 0 rgba(239,68,68,.58); } 70%, 100% { box-shadow: 0 0 0 8px rgba(239,68,68,0); } }
.drawer-link .news-unread { margin-inline-start: auto; }
@media (max-width: 680px) { .community-post-preview { grid-template-columns: minmax(0, 1fr) 92px; gap: 9px; } .community-post-thumb { width: 92px; height: 70px; } .community-post.community-post-compact { padding: 11px 12px; } }
.community-post { position: relative; min-width: 0; padding: 18px; overflow: hidden; border: 1px solid hsl(var(--border)); border-radius: 17px; background: hsl(var(--card)); color: hsl(var(--card-foreground)); box-shadow: 0 5px 18px rgba(15,23,42,.055); transition: border-color .18s, transform .18s, box-shadow .18s; }
.community-post:hover { transform: translateY(-1px); border-color: hsl(var(--primary) / .35); box-shadow: 0 10px 28px rgba(15,23,42,.09); }
.community-post.is-pinned { border-color: rgba(245,158,11,.62); background: linear-gradient(110deg, rgba(245,158,11,.1), transparent 48%), hsl(var(--card)); box-shadow: 0 7px 24px rgba(245,158,11,.12); }
.community-post.is-pinned::before { position: absolute; inset-block: 0; inset-inline-start: 0; width: 4px; background: #f59e0b; content: ''; }
.community-post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 9px; color: hsl(var(--muted-foreground)); font-size: .75rem; }
.community-post-meta time { margin-inline-start: auto; font-variant-numeric: tabular-nums; }
.community-author { font-weight: 750; }
.community-pin-badge { display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px; border-radius: 999px; color: #854d0e; background: rgba(251,191,36,.24); font-weight: 850; }
html.dark .community-pin-badge { color: #fde68a; }
.community-pin-badge svg { width: 13px; height: 13px; }
.community-post h3 { margin: 0 0 8px; font-size: 1.04rem; line-height: 1.55; font-weight: 850; overflow-wrap: anywhere; }
.community-post-body { color: hsl(var(--muted-foreground)); font-size: .88rem; line-height: 1.9; white-space: normal; overflow-wrap: anywhere; }
.community-images { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; margin-top: 13px; }
.community-images a { display: block; overflow: hidden; aspect-ratio: 4 / 3; border-radius: 12px; background: hsl(var(--muted)); }
.community-images img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .2s; }
.community-images a:hover img { transform: scale(1.035); }
.community-post-media { display: grid; gap: 13px; margin-top: 14px; }
.community-post-media-item { min-width: 0; margin: 0; }
.community-post-media-item video { display: block; width: 100%; max-height: 520px; border-radius: 13px; background: #080a0e; object-fit: contain; }
.community-post-audio-item audio { display: block; width: 100%; min-height: 42px; accent-color: hsl(var(--primary)); }
.community-post-media-item figcaption { margin-top: 5px; color: hsl(var(--muted-foreground)); font-size: .72rem; font-weight: 700; }
.admin-page .community-admin-post:not(.is-expanded) .community-post-media { display: none; }
html.dark .community-post-media-item video,
html.dark .community-local-video-wrap video { color-scheme: dark; }
.community-post-foot { display: flex; justify-content: flex-end; margin-top: 12px; padding-top: 10px; border-top: 1px solid hsl(var(--border) / .7); }
.community-report-link { display: inline-flex; align-items: center; gap: 6px; padding: 5px 0; border: 0; background: transparent; color: hsl(var(--muted-foreground)); font: inherit; font-size: .76rem; cursor: pointer; }
.community-report-link:hover { color: hsl(var(--destructive)); }
.community-report-link svg { width: 15px; height: 15px; }
.community-empty { padding: 24px 16px; border: 1px dashed hsl(var(--border)); border-radius: 14px; color: hsl(var(--muted-foreground)); text-align: center; font-size: .87rem; }
.community-loading { display: grid; min-height: 90px; place-items: center; }
.community-spinner { width: 25px; height: 25px; border: 3px solid hsl(var(--border)); border-top-color: hsl(var(--primary)); border-radius: 50%; animation: communitySpin .8s linear infinite; }
@keyframes communitySpin { to { transform: rotate(360deg); } }
.community-pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; margin: 18px 0 0; }
.community-pagination[hidden] { display: none; }
.community-page-button { display: inline-flex; align-items: center; justify-content: center; min-width: 38px; height: 38px; padding: 0 10px; border: 1px solid hsl(var(--border)); border-radius: 10px; background: hsl(var(--card)); color: hsl(var(--foreground)); font: inherit; font-size: .8rem; cursor: pointer; }
.community-page-button:hover:not(:disabled), .community-page-button.active { border-color: hsl(var(--primary)); color: hsl(var(--primary-foreground)); background: hsl(var(--primary)); }
.community-page-button:disabled { opacity: .45; cursor: default; }
.community-page-count, .community-page-ellipsis { color: hsl(var(--muted-foreground)); font-size: .74rem; padding-inline: 3px; }
.community-modal[hidden], [hidden] { display: none !important; }
.community-modal { position: fixed; z-index: 1200; inset: 0; display: grid; place-items: center; padding: 18px; }
.community-modal-backdrop { position: absolute; inset: 0; background: rgba(2,6,23,.68); backdrop-filter: blur(3px); }
.community-modal-card { position: relative; width: min(100%, 470px); max-height: min(90vh, 720px); overflow: auto; padding: 22px; }
.community-modal-card h2 { margin: 0 34px 16px 0; font-size: 1.1rem; }
.community-modal-close { position: absolute; inset-block-start: 13px; inset-inline-end: 13px; display: grid; width: 34px; height: 34px; place-items: center; border: 1px solid hsl(var(--border)); border-radius: 10px; background: transparent; color: hsl(var(--foreground)); cursor: pointer; }
.community-modal-close svg { width: 17px; height: 17px; }
.community-modal-actions { display: flex; justify-content: flex-end; gap: 8px; }

.admin-page { max-width: 1100px !important; }
.admin-login-card { width: min(100%, 480px); margin: 18px auto; padding: 22px; }
.admin-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 15px; border: 1px solid hsl(var(--border)); border-radius: 15px; background: hsl(var(--card)); }
.admin-toolbar > div { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.admin-secure-pill { display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; border-radius: 999px; color: #15803d; background: rgba(34,197,94,.1); font-size: .7rem; font-weight: 750; }
.admin-secure-pill svg { width: 14px; height: 14px; }
.admin-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 17px; padding: 6px; border: 1px solid hsl(var(--border)); border-radius: 13px; background: hsl(var(--muted) / .45); }
.admin-tabs button { display: inline-flex; align-items: center; gap: 7px; min-height: 38px; padding: 0 13px; border: 0; border-radius: 9px; background: transparent; color: hsl(var(--muted-foreground)); font: inherit; font-size: .8rem; font-weight: 750; cursor: pointer; }
.admin-tabs button svg { width: 16px; height: 16px; }
.admin-tabs button.active { color: hsl(var(--primary-foreground)); background: hsl(var(--primary)); }
.admin-section { display: none; }
.admin-section.active { display: block; }
.admin-range { display: flex; align-items: end; flex-wrap: wrap; gap: 9px; padding: 13px; margin-bottom: 13px; }
.admin-range label { display: grid; gap: 4px; min-width: 130px; color: hsl(var(--muted-foreground)); font-size: .74rem; font-weight: 700; }
.admin-range .input { min-width: 145px; height: 39px !important; font-size: .8rem !important; }
.admin-range .btn { height: 39px; padding-inline: 12px; font-size: .78rem; }
.admin-stat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 13px; }
.admin-stat-card { display: grid; min-height: 102px; align-content: center; gap: 7px; padding: 16px; }
.admin-stat-card > span { color: hsl(var(--muted-foreground)); font-size: .78rem; }
.admin-stat-card > b { font-size: 1.8rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.admin-chart-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(240px, .85fr); gap: 12px; }
.admin-chart-card { min-width: 0; padding: 17px; margin-bottom: 12px; }
.admin-chart-card h2 { margin: 0 0 12px; font-size: .95rem; }
.admin-chart { min-height: 190px; }
.admin-chart svg { display: block; width: 100%; height: 220px; overflow: visible; }
.admin-chart-line { fill: none; stroke: var(--chart-color, hsl(var(--primary))); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.admin-chart-dots circle { fill: hsl(var(--primary)); stroke: hsl(var(--card)); stroke-width: 2; }
.admin-chart-labels { fill: hsl(var(--muted-foreground)); font: 11px sans-serif; }
.admin-feature-chart { display: grid; gap: 10px; }
.admin-feature-row { display: grid; gap: 5px; min-width: 0; }
.admin-feature-row > div { display: flex; justify-content: space-between; gap: 8px; font-size: .75rem; }
.admin-feature-row > div span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-feature-row > div b { font-variant-numeric: tabular-nums; }
.admin-feature-row > i { display: block; height: 7px; overflow: hidden; border-radius: 99px; background: hsl(var(--muted)); }
.admin-feature-row > i::after { display: block; width: var(--bar, 0%); height: 100%; border-radius: inherit; background: linear-gradient(90deg, hsl(var(--primary)), #f59e0b); content: ''; }
.admin-privacy-note { display: flex; align-items: flex-start; gap: 7px; color: hsl(var(--muted-foreground)); font-size: .72rem; line-height: 1.7; }
.admin-privacy-note svg { flex: none; width: 16px; height: 16px; }
.community-section-title .admin-status-select { width: auto; min-width: 155px; height: 38px; }
.admin-list { display: grid; gap: 12px; }
.admin-item { padding: 15px; }
.admin-item.is-important { border-color: rgba(245,158,11,.55); }
.admin-item-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 7px; margin-bottom: 9px; color: hsl(var(--muted-foreground)); font-size: .74rem; }
.admin-status-pill { display: inline-flex; padding: 4px 8px; border-radius: 999px; background: hsl(var(--muted)); font-size: .7rem; font-weight: 800; }
.status-pending { color: #a16207; background: rgba(234,179,8,.14); }
.status-published { color: #15803d; background: rgba(34,197,94,.12); }
.status-rejected, .status-removed { color: hsl(var(--destructive)); background: hsl(var(--destructive) / .1); }
.community-admin-post-meta { display: flex; justify-content: space-between; gap: 8px; margin-top: 12px; color: hsl(var(--muted-foreground)); font-size: .72rem; }
.admin-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.admin-actions .btn { min-height: 36px; padding-inline: 10px; font-size: .75rem; }
.admin-flag-details { padding: 9px 11px; margin: 8px 0 12px; border-radius: 10px; background: hsl(var(--muted) / .65); font-size: .85rem; overflow-wrap: anywhere; }
.admin-compose-card { width: min(100%, 760px); padding: 21px; }
.admin-compose-card .community-form { max-width: 620px; }
.community-check { display: flex; align-items: center; gap: 8px; font-size: .82rem; }
.community-check input { width: 17px; height: 17px; accent-color: hsl(var(--primary)); }
@media (max-width: 900px) { .citizen-layout { grid-template-columns: minmax(0, 1fr); } .citizen-form-card { position: static; order: 2; } .citizen-feed-section { order: 1; } }
@media (max-width: 680px) {
  .community-page.page { width: min(100% - 22px, 560px); padding-top: 22px; padding-bottom: 34px; }
  .community-heading { align-items: flex-start; gap: 11px; margin-bottom: 17px; }
  .community-heading-icon { flex-basis: 43px; width: 43px; height: 43px; border-radius: 13px; }
  .community-heading-icon svg { width: 21px; height: 21px; }
  .community-heading p { font-size: .8rem; }
  .citizen-page .citizen-feed-actions { width: 100%; flex-wrap: wrap; justify-content: flex-start; margin-inline-start: 0; }
  .citizen-page.is-composing .citizen-form-card { padding: 16px; }
  .community-post { padding: 15px; }
  .community-post h3 { font-size: .97rem; }
  .community-images { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-toolbar { padding: 10px; }
  .admin-tabs { margin: 11px 0 14px; }
  .admin-tabs button { padding-inline: 10px; }
  .admin-range { gap: 8px; }
  .admin-range label { flex: 1 1 42%; min-width: 120px; }
  .admin-range .input { min-width: 0; }
  .admin-range .btn { flex: 1 1 auto; }
  .admin-stat-grid { gap: 8px; }
  .admin-stat-card { min-height: 95px; padding: 12px; }
  .admin-stat-card > span { font-size: .7rem; }
  .admin-stat-card > b { font-size: 1.45rem; }
  .admin-chart-grid { grid-template-columns: minmax(0, 1fr); }
  .admin-chart-card { padding: 14px; }
  .admin-compose-card { padding: 16px; }
}
@media (max-width: 390px) {
  .community-page.page { width: min(100% - 16px, 560px); }
  .community-search .btn { padding-inline: 8px; font-size: .73rem; }
  .community-post-meta { gap: 6px; }
  .community-post-meta time { width: 100%; margin-inline-start: 0; }
  .admin-stat-card { padding: 10px 9px; }
  .admin-tabs { gap: 3px; padding: 5px; }
  .admin-tabs button { gap: 5px; padding-inline: 8px; font-size: .72rem; }
  .community-page-button { min-width: 34px; height: 35px; padding-inline: 7px; }
}
@media (prefers-reduced-motion: reduce) { .community-spinner, .community-post, .community-refresh-news.is-refreshing svg { animation: none !important; transition: none !important; } }
@media print {
  body { background: #fff !important; color: #111 !important; }
  .admin-toolbar, .admin-tabs, .admin-range, .admin-privacy-note, #adminLogin, .community-page > .community-status,
  [data-admin-section]:not(.active), .admin-actions, .community-post-foot { display: none !important; }
  .community-page.page { width: 100%; max-width: none; padding: 0; }
  .admin-heading { display: flex !important; }
  .admin-section.active { display: block !important; }
  .admin-stat-card, .admin-chart-card, .admin-item { break-inside: avoid; box-shadow: none !important; background: #fff !important; color: #111 !important; }
}

/* Aggregate load-time charts */
.admin-chart { --chart-color: hsl(var(--primary)); }
.admin-load-chart { --chart-color: #0ea5e9; }
.admin-load-chart .admin-chart-line { stroke-width: 2.5; }
.admin-donut-chart { min-height: 180px; display: grid; align-items: center; }
.admin-donut-wrap { display: grid; grid-template-columns: minmax(120px, .8fr) minmax(0, 1fr); align-items: center; gap: 14px; }
.admin-donut { width: min(100%, 180px); margin-inline: auto; overflow: visible; }
.admin-donut-track, .admin-donut-segment { fill: none; stroke-width: 14; transform: rotate(-90deg); transform-origin: 60px 60px; }
.admin-donut-track { stroke: hsl(var(--muted)); }
.admin-donut-segment { stroke: #f97316; stroke-linecap: butt; transition: stroke-dasharray .35s ease; }
.admin-donut-segment[data-index="1"] { stroke: #22c55e; }
.admin-donut-segment[data-index="2"] { stroke: #0ea5e9; }
.admin-donut-segment[data-index="3"] { stroke: #a855f7; }
.admin-donut-segment[data-index="4"] { stroke: #ef4444; }
.admin-donut text { fill: hsl(var(--foreground)); font-size: 14px; font-weight: 800; }
.admin-donut text.admin-donut-caption { fill: hsl(var(--muted-foreground)); font-size: 7px; font-weight: 600; }
.admin-donut-legend { display: grid; gap: 8px; }
.admin-donut-legend > div { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; align-items: center; gap: 7px; font-size: .72rem; }
.admin-donut-legend i { width: 9px; height: 9px; border-radius: 50%; background: #f97316; }
.admin-donut-legend i[style*="--i:1"] { background: #22c55e; }
.admin-donut-legend i[style*="--i:2"] { background: #0ea5e9; }
.admin-donut-legend i[style*="--i:3"] { background: #a855f7; }
.admin-donut-legend i[style*="--i:4"] { background: #ef4444; }
.admin-donut-legend span { min-width: 0; overflow-wrap: anywhere; color: hsl(var(--muted-foreground)); }
.admin-donut-legend b { font-variant-numeric: tabular-nums; }
.admin-settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.admin-settings-card { min-width: 0; padding: 19px; }
.admin-settings-card h2 { margin: 0 0 13px; font-size: 1rem; }
.admin-edit-form { padding: 13px; margin: 10px 0; border: 1px solid hsl(var(--border)); border-radius: 12px; background: hsl(var(--background) / .45); }
@media (max-width: 680px) { .admin-donut-wrap { grid-template-columns: minmax(100px, .7fr) minmax(0, 1fr); gap: 8px; } .admin-settings-grid { grid-template-columns: minmax(0, 1fr); } .community-post-excerpt { font-size: .74rem; } }
@media (max-width: 390px) { .community-post-preview { grid-template-columns: minmax(0, 1fr) 78px; } .community-post-thumb { width: 78px; height: 62px; } .community-post-stats { font-size: .64rem; } }
@media (prefers-reduced-motion: reduce) { .news-unread { animation: none !important; } .admin-donut-segment { transition: none; } }

/* News forms and moderation UI: use the same theme tokens as the app's route popovers. */
.community-page.page { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
.community-page .input {
  border-color: hsl(var(--border)) !important;
  border-radius: 14px !important;
  color: hsl(var(--foreground)) !important;
  font-family: var(--font-default), system-ui, sans-serif !important;
  box-shadow: 0 1px 2px hsl(var(--foreground) / .035) inset;
  transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}
html.dark .community-page .input {
  background: rgba(13, 17, 23, .76) !important;
  border-color: rgba(255, 255, 255, .12) !important;
  color: hsl(var(--foreground)) !important;
}
html:not(.dark) .community-page .input {
  background: hsl(var(--background)) !important;
  border-color: hsl(var(--border)) !important;
  color: hsl(var(--foreground)) !important;
}
.community-page .input:focus {
  border-color: hsl(var(--primary) / .7) !important;
  box-shadow: 0 0 0 3px hsl(var(--primary) / .14) !important;
}
.community-page textarea.input {
  display: block;
  width: 100%;
  height: auto !important;
  min-height: 190px;
  padding: 14px 15px !important;
  font: 400 16px/1.9 var(--font-default), system-ui, sans-serif !important;
  resize: vertical;
  overflow-wrap: anywhere;
}
.community-page textarea.input::placeholder { color: hsl(var(--muted-foreground)); opacity: .8; }
.community-textarea-meta {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 12px;
}
.community-textarea-meta > small:first-child { flex: 1 1 14rem; }
.community-char-count {
  flex: 0 0 auto;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.community-page select.input { cursor: pointer; }
.community-page select.input option {
  background-color: hsl(var(--popover));
  color: hsl(var(--popover-foreground));
}
.community-page select.input option:checked {
  background-color: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
}
html.dark .community-page select.input { color-scheme: dark; }
html:not(.dark) .community-page select.input { color-scheme: light; }

.admin-page .admin-section,
.admin-page .admin-section > *,
.admin-page .admin-item { min-width: 0; }
.admin-page .admin-list-heading { align-items: center; }
.admin-page .admin-list-heading > span { min-width: 0; }
.admin-page .admin-list-heading .admin-status-select {
  flex: 0 1 245px;
  width: auto;
  min-width: 0;
  height: 46px !important;
  padding-inline: 12px !important;
}
.admin-page .admin-item-head time { font-variant-numeric: tabular-nums; }
.admin-page .admin-item h3,
.admin-page .admin-item p,
.admin-page .admin-item .community-post-body { overflow-wrap: anywhere; }
.admin-page .admin-actions .btn { min-width: 0; white-space: normal; line-height: 1.4; }

@media (max-width: 680px) {
  .community-page.page { padding-bottom: calc(108px + env(safe-area-inset-bottom)); }
  .community-page .community-form .input,
  .community-page .community-search .input,
  .community-page .admin-range .input { font-size: 16px !important; }
  .community-page textarea.input { min-height: 200px; }
  .admin-page .admin-toolbar { align-items: center; }
  .admin-page .admin-tabs {
    flex-wrap: nowrap;
    justify-content: flex-start;
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: inline proximity;
  }
  .admin-page .admin-tabs::-webkit-scrollbar { display: none; }
  .admin-page .admin-tabs > button {
    flex: 0 0 auto;
    min-height: 44px;
    white-space: nowrap;
    scroll-snap-align: start;
  }
  .admin-page .admin-tabs > button:focus-visible { outline-offset: -3px; }
  .admin-page .admin-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-page .admin-list-heading { align-items: stretch; flex-direction: column; gap: 9px; }
  .admin-page .admin-list-heading .admin-status-select { flex: 1 1 auto; width: 100%; max-width: none; height: 48px !important; }
  .admin-page .admin-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .admin-page .admin-actions .btn { width: 100%; height: auto !important; min-height: 44px; padding: 8px 9px; }
  .admin-page .admin-range { align-items: stretch; }
  .admin-page .admin-range label { min-width: 0; }
  .admin-page .admin-range .input { width: 100%; min-width: 0; }
  .admin-page .admin-range .btn { min-height: 44px; height: auto; }
  .admin-page .admin-login-card { padding: 18px; }
  .community-modal { padding: 12px; }
  .community-modal-card { width: 100%; max-height: min(92dvh, 720px); padding: 20px 16px; }
  .community-modal-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .community-modal-actions .btn { width: 100%; min-width: 0; padding-inline: 8px; }
}
@media (max-width: 390px) {
  .community-page.page { width: min(100% - 16px, 560px); }
  .community-textarea-meta > small:first-child { flex-basis: 100%; }
  .admin-page .admin-toolbar { align-items: flex-start; }
  .admin-page .admin-toolbar > div { min-width: 0; gap: 6px; }
  .admin-page #adminLogout { flex: 0 0 auto; min-height: 42px; height: auto; padding-inline: 10px; }
}
@media (max-width: 360px) {
  .admin-page .admin-actions { grid-template-columns: minmax(0, 1fr); }
  .admin-page .admin-stat-card { padding: 10px 9px; }
  .community-modal-actions { grid-template-columns: minmax(0, 1fr); }
}

/* Keyboard-visible focus and readable six-item mobile dock */
:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 3px solid hsl(var(--ring));
  outline-offset: 3px;
}
.combo-item:focus-visible { outline-offset: -2px; }
.bottom-nav.six .bn-item .bn-label {
  font-size: 8px !important;
  line-height: 1.1;
  letter-spacing: -0.015em;
}
@media (max-width: 360px) {
  .bottom-nav.six .bn-item .bn-label { font-size: 8px !important; }
}

.data-error { min-height: min(70vh, 34rem); display: grid; place-items: center; }
.data-error-card {
  width: min(100%, 28rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .8rem;
  padding: 1.5rem;
  text-align: center;
}
.data-error-icon { color: hsl(var(--destructive, 0 72% 51%)); }
.data-error-icon svg { width: 2rem; height: 2rem; }
.data-error-card h1 { margin: 0; font-size: 1.2rem; font-weight: 800; }
.data-error-card p { margin: 0 0 .35rem; color: hsl(var(--muted-foreground)); line-height: 1.8; }
.data-error-card button { min-width: 9rem; }

/* Clear form outcomes, compact reader controls, and in-page photo viewing. */
.community-form-status.is-success,
.community-status.is-success {
  color: #15803d;
  font-weight: 750;
}
.community-form-status.is-error,
.community-status.is-error {
  color: #dc2626;
  font-weight: 750;
}
html.dark .community-form-status.is-success,
html.dark .community-status.is-success { color: #4ade80; }
html.dark .community-form-status.is-error,
html.dark .community-status.is-error { color: #f87171; }
.community-status.is-success,
.community-status.is-error {
  padding: 7px 10px;
  border-radius: 10px;
}
.community-status.is-success { background: rgba(34, 197, 94, .1); }
.community-status.is-error { background: rgba(239, 68, 68, .1); }

.citizen-page .community-heading { gap: 10px; margin-bottom: 14px; }
.citizen-page .community-heading-icon { flex-basis: 44px; width: 44px; height: 44px; border-radius: 13px; }
.citizen-page .community-heading-icon svg { width: 22px; height: 22px; }
.citizen-page .community-heading p { font-size: .8rem; }
.citizen-news-icon { background: linear-gradient(135deg, #0ea5e9, #2563eb); box-shadow: 0 7px 20px rgba(14, 165, 233, .2); }
.citizen-page .community-section-title { gap: 7px; margin-bottom: 9px; font-size: .92rem; flex-wrap: wrap; }
.citizen-feed-actions { display: inline-flex; align-items: center; gap: 6px; margin-inline-start: auto; }
.citizen-page .community-mark-read { display: inline-flex; width: auto; min-width: 0; align-items: center; justify-content: center; gap: 4px; min-height: 32px; height: 32px; padding: 5px 9px; font-size: .68rem; line-height: 1; white-space: nowrap; }
.citizen-page .community-mark-read svg { width: 14px; height: 14px; }
.citizen-page .community-mark-read:disabled { opacity: .55; cursor: wait; }
.citizen-page .community-refresh-news { display: inline-flex; min-width: 0; min-height: 32px; height: 32px; align-items: center; justify-content: center; gap: 5px; padding: 5px 9px; font-size: .68rem; line-height: 1; white-space: nowrap; }
.citizen-page .community-refresh-news svg { position: static; width: 14px; height: 14px; flex: 0 0 auto; color: currentColor; }
.citizen-page .community-refresh-news.is-refreshing svg { animation: spin .8s linear infinite; }
.citizen-page .community-refresh-news span { white-space: nowrap; }
.citizen-page .community-add-news { position: relative; min-height: 32px; height: 32px; padding: 5px 22px; font-size: .72rem; line-height: 1; display: inline-grid; place-items: center; text-align: center; }
.citizen-page .community-add-news span { text-align: center; white-space: nowrap; }
.citizen-page .community-add-news svg { position: absolute; inset-inline-start: 6px; width: 14px; height: 14px; }
.citizen-page .community-post-list { gap: 9px; }
.citizen-page .community-pagination { gap: 4px; margin-top: 12px; }
.citizen-page .community-page-button { min-width: 34px; height: 34px; padding-inline: 8px; font-size: .75rem; }
.citizen-page .community-search { flex-wrap: nowrap; align-items: center; gap: 6px; margin-bottom: 10px; }
.citizen-page .community-search.is-collapsed { width: 42px; }
.citizen-page .community-search .input { flex: 1 1 auto; min-width: 0; height: 40px !important; padding-inline: 11px !important; font-size: .82rem !important; }
.citizen-page .community-search-icon { display: grid; flex: 0 0 40px; width: 40px; min-width: 40px; height: 40px; min-height: 40px; place-items: center; padding: 0; }
.citizen-page .community-search-icon svg { width: 18px; height: 18px; }
.community-preview-copy { color: inherit; text-decoration: none; }
.community-post-thumb-button,
.community-image-button {
  display: block;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 12px;
  background: hsl(var(--muted));
  cursor: zoom-in;
}
.community-post-thumb-button { border-radius: 11px; }
.community-post-thumb-button .community-post-thumb { display: block; }
.community-images .community-image-button { width: 100%; aspect-ratio: 4 / 3; }
.community-images .community-image-button img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .2s; }
.community-image-button:hover img,
.community-post-thumb-button:hover img { transform: scale(1.035); }
.community-unread-dot {
  display: inline-block;
  flex: 0 0 9px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, .13);
  vertical-align: middle;
}
.community-lightbox {
  position: fixed;
  z-index: 5000;
  inset: 0;
  display: grid;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  box-sizing: border-box;
  place-items: center;
  padding: max(58px, calc(env(safe-area-inset-top) + 46px)) 64px max(30px, env(safe-area-inset-bottom));
  overflow: hidden;
  isolation: isolate;
}
.community-lightbox[hidden] { display: none !important; }
.community-lightbox-backdrop { position: absolute; z-index: 0; inset: 0; background: #020617; }
.community-lightbox-figure {
  position: relative;
  z-index: 1;
  display: grid;
  width: min(100%, 1280px);
  max-height: 100%;
  justify-items: center;
  align-content: center;
  gap: 8px;
  margin: 0;
}
.community-lightbox-figure img {
  display: block;
  max-width: 100%;
  max-width: min(100%, 1200px);
  max-height: 82vh;
  max-height: min(82vh, calc(100vh - 132px));
  max-height: min(82vh, calc(100dvh - 132px));
  border-radius: 12px;
  object-fit: contain;
  box-shadow: 0 16px 60px rgba(0, 0, 0, .42);
}
.community-lightbox-figure figcaption { color: #fff; font-size: .8rem; font-variant-numeric: tabular-nums; }
.community-lightbox-close,
.community-lightbox-nav {
  position: absolute;
  z-index: 2;
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .42);
  border-radius: 50%;
  background: #172033;
  color: #fff;
  cursor: pointer;
}
.community-lightbox-close {
  top: 12px;
  right: 12px;
  top: max(12px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
  z-index: 3;
}
.community-lightbox-close svg,
.community-lightbox-nav svg { width: 21px; height: 21px; }
.community-lightbox-previous { left: max(16px, env(safe-area-inset-left)); top: 50%; transform: translateY(-50%); }
.community-lightbox-next { right: max(16px, env(safe-area-inset-right)); top: 50%; transform: translateY(-50%); }
.community-lightbox-next svg { transform: rotate(180deg); }
.community-lightbox-close:hover,
.community-lightbox-nav:hover { background: #334155; }

.admin-page .admin-news-item { display: flex; flex-direction: column; min-height: 458px; }
.admin-page .admin-news-item > .community-admin-post {
  display: flex;
  flex: 1 0 auto;
  flex-direction: column;
  min-height: 212px;
  padding: 11px 12px;
  border-color: hsl(var(--border) / .75);
  box-shadow: none;
  cursor: pointer;
}
.admin-page .community-admin-post h3 {
  display: -webkit-box;
  height: 3.1em;
  min-height: 3.1em;
  max-height: 3.1em;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.admin-page .community-admin-post:not(.is-expanded) .community-post-body {
  display: -webkit-box;
  min-height: 3.8em;
  max-height: 3.8em;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.admin-page .community-admin-post:not(.is-expanded) .community-images { display: none; }
.admin-page .community-admin-post.is-expanded { cursor: default; }
.admin-page .community-admin-post.is-expanded h3 { display: block; height: auto; min-height: 0; max-height: none; }
.admin-page .community-admin-post.is-expanded .community-post-body { display: block; max-height: none; }
.admin-page .community-admin-post.is-expanded .community-images .community-image-button {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: auto;
  max-height: min(70vh, 620px);
  background: #080a0e;
}
.admin-page .community-admin-post.is-expanded .community-images .community-image-button img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: min(70vh, 620px);
  object-fit: contain;
}
.admin-page .community-admin-post-meta { align-items: center; min-height: 30px; }
.admin-page .community-admin-expand { padding: 4px 7px; border: 0; border-radius: 7px; background: hsl(var(--primary) / .1); color: hsl(var(--primary)); font: inherit; font-size: .7rem; font-weight: 750; cursor: pointer; }
.admin-page .admin-news-item > .admin-view-form {
  display: grid;
  grid-template-columns: minmax(80px, .45fr) minmax(0, 1fr);
  align-items: end;
  gap: 6px 9px;
  min-height: 68px;
  padding: 9px 0 2px;
  border-top: 1px solid hsl(var(--border) / .7);
}
.admin-page .admin-view-form label { display: grid; gap: 4px; color: hsl(var(--muted-foreground)); font-size: .72rem; font-weight: 750; }
.admin-page .admin-view-form .input { height: 38px !important; min-width: 0; padding-inline: 9px !important; }
.admin-page .admin-view-form .btn { min-width: 0; min-height: 38px; padding-inline: 9px; font-size: .72rem; }
.admin-page .admin-view-form .community-form-status { grid-column: 1 / -1; min-height: 0; }
.admin-page .admin-news-item > .admin-actions { min-height: 78px; align-content: flex-start; margin-top: auto; }

/* Compact floating navigation remains fixed while the page scrolls. */
.bottom-nav {
  position: fixed !important;
  z-index: 100;
  bottom: calc(8px + env(safe-area-inset-bottom)) !important;
  width: min(348px, calc(100% - 20px)) !important;
  height: 56px !important;
  min-height: 56px !important;
}
.bottom-nav .bn-item { min-width: 0; }
.bottom-nav .bn-item .bn-pill { width: 32px !important; height: 23px !important; }
.bottom-nav .bn-item svg { width: 19px; height: 19px; }
.bottom-nav .bn-item .bn-label { margin-top: 1px !important; font-size: 8px !important; line-height: 1.05; }
body { padding-bottom: calc(76px + env(safe-area-inset-bottom)) !important; }

@media (max-width: 680px) {
  .community-lightbox { padding: max(56px, calc(env(safe-area-inset-top) + 44px)) 12px max(28px, env(safe-area-inset-bottom)); }
  .community-lightbox-figure img { max-width: 100%; max-height: 76vh; max-height: min(76vh, calc(100vh - 116px)); max-height: min(76vh, calc(100dvh - 116px)); border-radius: 8px; }
  .community-lightbox-close,
  .community-lightbox-nav { width: 40px; height: 40px; }
  .community-lightbox-previous { left: 8px; }
  .community-lightbox-next { right: 8px; }
  .admin-page .admin-news-item { min-height: 512px; }
  .admin-page .admin-news-item > .admin-actions { min-height: 148px; }
}
@media (max-width: 390px) {
  .citizen-page .community-add-news { padding-inline: 22px; font-size: .7rem; }
  .community-lightbox-previous { left: 5px; }
  .community-lightbox-next { right: 5px; }
}

/* Language-aware compact header wordmark. */
.header-brand-fa, .header-brand-en { display: none; }
html[lang="fa"] .header-brand-fa { display: inline; }
html[lang="en"] .header-brand-en { display: inline; }

/* Keep map actions centered just above the floating dock, with a clear touch gap. */
.smap-wrap {
  --smap-controls-bottom: calc(18px + env(safe-area-inset-bottom)); /* 8px dock inset + 10px breathing gap */
  --smap-controls-height: 2.75rem;
  --smap-controls-gap: .5rem;
}
.smap-tools {
  position: absolute !important;
  z-index: 630 !important;
  top: auto !important;
  right: auto !important;
  bottom: var(--smap-controls-bottom) !important;
  left: 50% !important;
  width: max-content !important;
  max-width: calc(100% - .75rem);
  display: flex !important;
  flex-flow: row nowrap !important;
  align-items: center !important;
  justify-content: center !important;
  gap: .2rem !important;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 15px;
  background: #0d1117;
  box-shadow: 0 7px 20px rgba(0, 0, 0, .3);
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  transform: translateX(-50%);
}
.smap-tools .smap-tool {
  display: inline-flex !important;
  flex: 0 1 auto;
  min-width: 0;
  width: auto !important;
  min-height: 34px !important;
  height: 34px !important;
  align-items: center;
  justify-content: center;
  gap: .24rem;
  padding: 0 .34rem !important;
  border: 1px solid rgba(255, 255, 255, .13) !important;
  border-radius: 10px !important;
  color: rgba(255, 255, 255, .92) !important;
  background: rgba(255, 255, 255, .055) !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  font-family: inherit;
  font-size: .58rem;
  font-weight: 750;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background .16s ease, color .16s ease, border-color .16s ease, transform .16s ease;
}
.smap-tools .smap-tool > span {
  position: static !important;
  width: auto !important;
  height: auto !important;
  overflow: hidden !important;
  margin: 0 !important;
  padding: 0 !important;
  clip: auto !important;
  border: 0 !important;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.smap-tools .smap-tool svg { width: 14px; height: 14px; flex: 0 0 auto; }
.smap-tools .smap-tool.on,
.smap-tools .smap-info-btn[aria-expanded="true"],
.smap-tools .smap-lines-btn[aria-expanded="true"] {
  color: #111827 !important;
  background: hsl(var(--primary)) !important;
  border-color: hsl(var(--primary)) !important;
}
.smap-tools .smap-tool:hover { border-color: rgba(255, 255, 255, .28) !important; transform: translateY(-1px); }
.smap-tools .smap-tool.on:hover { border-color: hsl(var(--primary)) !important; }
.smap-tools .smap-legend {
  position: absolute !important;
  z-index: 660 !important;
  top: auto !important;
  right: auto !important;
  bottom: calc(100% + .5rem) !important;
  left: 50% !important;
  width: max-content !important;
  max-width: min(28rem, calc(100vw - 1rem)) !important;
  box-sizing: border-box;
  flex-wrap: nowrap;
  padding: 6px !important;
  border: 1px solid rgba(255, 255, 255, .13) !important;
  border-radius: 13px !important;
  background: #0d1117 !important;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .34) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  transform: translateX(-50%);
}
.smap-tools .smap-legend[hidden] { display: none !important; }
.smap-tools .smap-legend .smap-chip {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
.smap-info { position: static; display: inline-flex; flex: 0 0 auto; }
.smap-info-note {
  position: absolute;
  z-index: 650;
  left: 50%;
  bottom: calc(100% + .55rem);
  width: min(22rem, calc(100vw - 2rem));
  max-height: min(36vh, 12rem);
  overflow: auto;
  padding: .62rem .78rem;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 12px;
  color: rgba(255, 255, 255, .96);
  background: rgba(13, 17, 23, .94);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .4);
  backdrop-filter: blur(16px);
  font-size: .72rem;
  line-height: 1.7;
  text-align: start;
  transform: translateX(-50%);
}
.smap-info-note[hidden] { display: none !important; }

/* Station search opens above the action strip instead of covering its buttons. */
.smap-search {
  top: auto !important;
  right: auto !important;
  bottom: calc(var(--smap-controls-bottom) + var(--smap-controls-height) + var(--smap-controls-gap)) !important;
  left: 50% !important;
  z-index: 640 !important;
  width: min(21rem, calc(100% - 1rem)) !important;
  max-height: min(44vh, 15rem);
  transform: translateX(-50%);
}
.smap-search-list { max-height: min(9rem, 26vh); }
@media (max-width: 480px) {
  .smap-wrap { --smap-controls-height: 2.5rem; }
  .smap-tools {
    gap: .14rem !important;
    padding: 3px;
  }
  .smap-tools .smap-tool {
    min-height: 32px !important;
    height: 32px !important;
    gap: .18rem;
    padding-inline: .26rem !important;
    font-size: .55rem;
  }
  .smap-tools .smap-tool svg { width: 13px; height: 13px; }
  .smap-search-list { max-height: min(8rem, 24vh); }
}
@media (max-width: 360px) {
  .smap-tools .smap-tool {
    gap: .12rem;
    padding-inline: .2rem !important;
    font-size: .52rem;
  }
  .smap-tools .smap-tool svg { width: 12px; height: 12px; }
}

/* Compact, opaque notices in normal flow directly below the site header. */
.site-notice-stack {
  display: grid;
  gap: 6px;
  width: 100%;
  padding: 6px max(12px, calc((100vw - 1536px) / 2 + 16px));
  background: hsl(var(--background));
}
.site-notice-stack[hidden], .site-notice-stack [hidden] { display: none !important; }
.site-notice {
  width: 100%;
  margin: 0;
  text-align: start;
}
.site-notice-card {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 5px 9px;
  border: 1px solid hsl(var(--border));
  border-radius: 10px;
  background: hsl(var(--card));
  color: hsl(var(--card-foreground));
}
.site-notice.is-update .site-notice-card {
  border-color: hsl(var(--primary) / .72);
  background: hsl(38 80% 91%);
}
.dark .site-notice.is-update .site-notice-card { background: hsl(38 45% 17%); }
.site-notice.is-announcement .site-notice-card {
  border-color: hsl(198 48% 62%);
  background: hsl(198 60% 93%);
}
.dark .site-notice.is-announcement .site-notice-card { background: hsl(198 38% 17%); }
.site-notice-icon {
  display: grid;
  width: 27px;
  height: 27px;
  flex: 0 0 27px;
  place-items: center;
  border-radius: 50%;
  background: hsl(var(--primary) / .16);
  color: hsl(32 80% 35%);
}
.dark .site-notice-icon { color: hsl(var(--primary)); }
.site-notice-icon svg { width: 17px; height: 17px; }
.site-notice.is-announcement .site-notice-icon { background: hsl(198 65% 82%); color: hsl(198 75% 30%); }
.dark .site-notice.is-announcement .site-notice-icon { background: hsl(198 48% 28%); color: hsl(198 80% 78%); }
.site-notice-copy { flex: 1 1 auto; min-width: 0; text-align: start; }
.site-notice-copy p {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: hsl(var(--card-foreground));
  font-size: .77rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.site-notice-status { display: block; color: hsl(var(--destructive)); font-size: .68rem; line-height: 1.4; }
.site-notice-status:empty { display: none; }
.site-notice-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 5px;
  direction: rtl;
}
.site-notice-action.btn {
  display: inline-flex;
  min-height: 30px;
  height: 30px;
  align-items: center;
  justify-content: center;
  padding: 3px 10px;
  border-color: transparent;
  border-radius: 7px;
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  max-width: min(42vw, 170px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .7rem;
  line-height: 1.25;
}
.site-notice.is-announcement .site-notice-action.btn { background: hsl(198 70% 38%); color: #fff; }
.site-notice-action:focus-visible, .site-notice-dismiss:focus-visible { outline: 3px solid hsl(var(--ring) / .7); outline-offset: 2px; }
.site-notice-dismiss {
  display: grid;
  width: 27px;
  height: 27px;
  flex: 0 0 auto;
  place-items: center;
  padding: 0;
  border: 1px solid hsl(var(--border));
  border-radius: 50%;
  background: hsl(var(--card));
  color: hsl(var(--muted-foreground));
}
.site-notice-dismiss svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
@media (max-width: 480px) {
  .site-notice-stack { padding: 5px 8px; }
  .site-notice-card { gap: 6px; min-height: 39px; padding: 4px 7px; }
  .site-notice-copy p { font-size: .72rem; }
  .site-notice-actions { gap: 4px; }
  .site-notice-action.btn { min-height: 28px; height: 28px; padding: 3px 8px; }
}

/* Keep the desktop route form, including its expanded options and submit action, inside its card and scroll area. */
@media (min-width: 1024px) {
  html[data-route="/"] #app {
    overflow-x: hidden;
    overflow-y: auto;
  }
  html[data-route="/"] .hero {
    flex: 0 0 auto;
    height: auto;
    min-height: 100%;
  }
  html[data-route="/"] .route-card-wrap,
  html[data-route="/"] .route-card,
  html[data-route="/"] #routeForm { min-width: 0; }
  html[data-route="/"] .route-card {
    width: 100% !important;
    max-width: 380px !important;
  }
  html[data-route="/"] #routeForm > [type="submit"] {
    display: flex;
    width: 100% !important;
    max-width: 100%;
    min-width: 0;
  }
}
