:root{
  --page-accent:#3b82f6;
  --detail-map-font-size:12px;
  --detail-map-font-weight:650;
  --detail-card-shadow:0 16px 50px rgba(0,0,0,.14);
}

.page-header .top-nav a.current{
  color:var(--text);
  background:var(--surface-2);
  border-radius:10px;
  padding:8px 10px;
}
.detail-main{padding-bottom:72px}
.detail-hero{padding-block:48px 26px}
.breadcrumbs{display:flex;align-items:center;gap:8px;color:var(--muted);font-size:11px;margin-bottom:16px}
.breadcrumbs a:hover{color:var(--text)}
.breadcrumbs i{font-style:normal;opacity:.55}

/* Hero */
.line-hero-grid{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  align-items:end;
  gap:28px;
  padding:30px;
  border:1px solid var(--line);
  border-radius:24px;
  background:linear-gradient(135deg,color-mix(in srgb,var(--surface-solid) 94%,var(--page-accent) 6%),var(--surface));
  box-shadow:var(--detail-card-shadow);
  overflow:hidden;
  position:relative;
}
.line-hero-grid::before{content:"";position:absolute;right:0;top:0;width:5px;height:100%;background:var(--page-accent)}
.line-number-badge{display:inline-flex;align-items:center;gap:9px;color:var(--muted);font-size:11px;font-weight:700}
.line-number-badge i{width:10px;height:10px;border-radius:50%;background:var(--page-accent);box-shadow:0 0 0 5px color-mix(in srgb,var(--page-accent) 15%,transparent)}
.line-hero-grid h1{margin:12px 0 5px;font-size:clamp(31px,4vw,52px);line-height:1.25;letter-spacing:-.035em}
.line-hero-grid .english-name{direction:ltr;text-align:right;color:var(--muted);font-size:14px}
.line-hero-copy{max-width:760px;margin:15px 0 0;color:var(--muted);font-size:12px;line-height:2}
.line-hero-stats{display:grid;grid-template-columns:repeat(3,minmax(104px,1fr));gap:8px}
.line-hero-stat{min-width:104px;padding:15px 14px;border:1px solid var(--line);border-radius:14px;background:var(--surface-2);text-align:center}
.line-hero-stat strong{display:block;font-size:22px}.line-hero-stat span{color:var(--muted);font-size:10px}
.line-subnav{display:flex;align-items:center;justify-content:space-between;gap:14px;margin:16px 0 10px}
.line-tabs{display:flex;gap:7px;flex-wrap:wrap}
.line-tabs a{padding:9px 13px;border:1px solid var(--line);border-radius:10px;color:var(--muted);font-size:10.5px;background:var(--surface)}
.line-tabs a:hover{color:var(--text);border-color:color-mix(in srgb,var(--page-accent) 45%,var(--line))}
.line-picker{display:flex;align-items:center;gap:8px;color:var(--muted);font-size:10.5px}
.line-picker select{min-width:220px;color:var(--text);background:var(--surface);border:1px solid var(--line);border-radius:10px;padding:9px 10px;outline:none}

/* Dedicated map: keep SVG and semantic cards in separate layers */
.dedicated-map-card,
.line-detail-panel,
.related-products-panel{
  border:1px solid var(--line);
  border-radius:20px;
  background:var(--surface);
  box-shadow:var(--detail-card-shadow);
  overflow:hidden;
}
.dedicated-map-card{min-width:0}
.dedicated-map-toolbar{
  min-height:68px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding:14px 18px;
  border-bottom:1px solid var(--line);
}
.dedicated-map-title{display:flex;align-items:center;gap:10px;min-width:0}
.dedicated-map-title i{flex:0 0 auto;width:11px;height:11px;border-radius:50%;background:var(--page-accent);box-shadow:0 0 0 5px color-mix(in srgb,var(--page-accent) 12%,transparent)}
.dedicated-map-title strong{display:block;font-size:13px}
.dedicated-map-title small{display:block;color:var(--muted);font-size:9.5px;margin-top:3px}
.map-font-inline{display:flex;align-items:center;gap:8px;white-space:nowrap}
.map-font-inline label{color:var(--muted);font-size:10px}
.map-font-inline input{width:120px;accent-color:var(--page-accent)}
.font-value-pill{min-width:38px;text-align:center;padding:5px 7px;border:1px solid var(--line);border-radius:8px;color:var(--muted);font-size:10px}
.dedicated-svg-wrap{
  min-height:300px;
  overflow:auto;
  background:
    radial-gradient(circle at 50% 45%,color-mix(in srgb,var(--page-accent) 8%,transparent),transparent 36%),
    linear-gradient(var(--line) 1px,transparent 1px),
    linear-gradient(90deg,var(--line) 1px,transparent 1px);
  background-size:auto,36px 36px,36px 36px;
  scrollbar-width:thin;
  scrollbar-color:color-mix(in srgb,var(--text) 18%,transparent) transparent;
}
#lineSvg{display:block;width:100%;height:300px;overflow:visible}
.map-note{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:11px 18px;border-top:1px solid var(--line);color:var(--muted);font-size:9.5px}
.map-note span:first-child{display:flex;align-items:center;gap:7px}.map-note i{width:7px;height:7px;border-radius:50%;background:var(--page-accent)}

.line-route{fill:none;stroke:var(--page-accent);stroke-width:9;stroke-linecap:round;stroke-linejoin:round}
.line-route-glow{fill:none;stroke:var(--page-accent);stroke-width:27;opacity:.10;stroke-linecap:round}
.line-station{cursor:pointer;outline:none}
.line-station circle{fill:var(--surface-solid);stroke:var(--page-accent);stroke-width:5;transition:.18s ease}
.line-station:hover circle,.line-station.selected circle{r:11;filter:url(#detailGlow)}
.line-station text{fill:var(--text);font-family:"Vazirmatn","Vazir",Tahoma,sans-serif;font-size:var(--detail-map-font-size);font-weight:var(--detail-map-font-weight);pointer-events:none;unicode-bidi:plaintext;paint-order:stroke;stroke:var(--surface-solid);stroke-width:4px;stroke-linejoin:round}
.line-station .station-index{fill:var(--muted);font-size:9px;font-weight:500;stroke-width:3px}

/* Area below map */
.map-content-grid{display:grid;grid-template-columns:320px minmax(0,1fr);gap:16px;margin-top:16px;align-items:stretch}
.line-detail-panel{padding:20px;min-height:260px}
.line-detail-panel .detail-placeholder{height:100%;min-height:218px;display:grid;place-content:center;text-align:center;color:var(--muted);padding:20px}
.line-detail-panel .detail-placeholder strong{display:block;color:var(--text);font-size:14px;margin-bottom:8px}
.line-detail-panel .detail-placeholder p{margin:0;font-size:10px;line-height:1.9}
.line-info-view.hidden,.detail-placeholder.hidden{display:none}
.line-info-accent{width:38px;height:5px;border-radius:6px;background:var(--page-accent);margin-bottom:17px}
.line-info-kicker{color:var(--muted);font-size:10px}
.line-info-view h3{font-size:21px;margin:6px 0 7px;overflow-wrap:anywhere}
.line-info-subtitle{color:var(--muted);font-size:10px;line-height:1.8;overflow-wrap:anywhere}
.line-info-meta{display:grid;gap:7px;margin-top:17px}
.line-info-row{display:grid;grid-template-columns:90px minmax(0,1fr);align-items:start;gap:12px;padding:10px 0;border-top:1px solid var(--line);font-size:10px}
.line-info-row span{color:var(--muted)}.line-info-row b{text-align:right;overflow-wrap:anywhere}

.related-products-panel{padding:0}
.related-products-head{display:flex;align-items:flex-start;justify-content:space-between;gap:20px;padding:18px 20px;border-bottom:1px solid var(--line)}
.related-products-head strong{display:block;font-size:13px}.related-products-head p{margin:4px 0 0;color:var(--muted);font-size:9.5px;line-height:1.8}
.related-products-count{flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;min-width:34px;height:28px;padding-inline:9px;border-radius:999px;background:color-mix(in srgb,var(--page-accent) 12%,var(--surface-2));color:var(--page-accent);font-size:10px;font-weight:800}
.related-product-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;padding:14px}
.related-product-card{position:relative;min-width:0;text-align:right;padding:15px;border:1px solid var(--line);border-radius:14px;background:var(--surface-solid);color:var(--text);cursor:pointer;transition:.18s ease;overflow:hidden}
.related-product-card::before{content:"";position:absolute;right:0;top:0;bottom:0;width:3px;background:var(--page-accent);opacity:.75}
.related-product-card:hover,.related-product-card.selected{transform:translateY(-2px);border-color:color-mix(in srgb,var(--page-accent) 55%,var(--line));box-shadow:0 10px 30px rgba(0,0,0,.10)}
.product-card-top{display:flex;align-items:center;justify-content:space-between;gap:10px}
.product-card-top strong{min-width:0;direction:ltr;text-align:left;font-size:11px;overflow-wrap:anywhere}
.product-cross{margin-top:8px;direction:ltr;text-align:left;color:var(--muted);font-size:9px;line-height:1.5;overflow-wrap:anywhere}
.product-card-lines{display:flex;align-items:center;gap:6px;flex-wrap:wrap;margin-top:12px}
.product-card-empty{grid-column:1/-1;padding:32px;text-align:center;color:var(--muted);font-size:10px}

.status-badge{display:inline-flex;align-items:center;justify-content:center;width:max-content;min-width:54px;padding:5px 9px;border-radius:999px;font-size:9px;font-weight:750;white-space:nowrap}
.status-badge.active{color:#16a977;background:rgba(45,212,163,.12)}
.status-badge.inactive{color:#d88912;background:rgba(242,170,46,.13)}
:root:not([data-theme="light"]) .status-badge.active{color:#68e1b9}
:root:not([data-theme="light"]) .status-badge.inactive{color:#f7bd55}

/* Tables */
.data-section{padding-top:48px}
.data-section-head{display:flex;align-items:end;justify-content:space-between;gap:20px;margin-bottom:18px}
.data-section-head h2{margin:4px 0 5px;font-size:26px}
.data-section-head p{margin:0;color:var(--muted);font-size:11px;line-height:1.9}
.table-card{border:1px solid var(--line);border-radius:18px;background:var(--surface);overflow:hidden;box-shadow:var(--detail-card-shadow);margin-bottom:18px}
.table-card-head{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:16px 18px;border-bottom:1px solid var(--line);background:linear-gradient(180deg,var(--surface-2),transparent)}
.table-card-head strong{font-size:13px}.table-card-head span{color:var(--muted);font-size:10px}
.table-scroll{max-width:100%;overflow-x:auto;overflow-y:hidden;scrollbar-width:thin;scrollbar-color:color-mix(in srgb,var(--text) 18%,transparent) transparent}
.source-table{width:100%;border-collapse:collapse;min-width:760px;table-layout:auto}
.source-table th,.source-table td{padding:14px 16px;text-align:right;border-bottom:1px solid var(--line);font-size:11px;line-height:1.75;vertical-align:middle}
.source-table th{background:var(--surface-2);color:var(--muted);font-size:10.5px;font-weight:700;white-space:nowrap}
.source-table tbody tr:nth-child(even){background:color-mix(in srgb,var(--surface-2) 42%,transparent)}
.source-table tbody tr:hover{background:color-mix(in srgb,var(--page-accent) 7%,var(--surface-2))}
.source-table tr:last-child td{border-bottom:none}
.source-table td.en{direction:ltr;text-align:left;unicode-bidi:plaintext;font-weight:560;overflow-wrap:anywhere}
.source-table td.num,.source-table th.num{text-align:center;white-space:nowrap;width:78px}
.table-line-list{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.table-line-pill{display:inline-flex;align-items:center;gap:6px;max-width:100%;padding:5px 8px;border:1px solid var(--line);border-radius:8px;background:var(--surface-2);font-size:9.5px;line-height:1.4;white-space:normal}
.table-line-pill i{flex:0 0 auto;width:8px;height:8px;border-radius:50%;background:var(--pill-color)}
.empty-row{padding:30px!important;text-align:center!important;color:var(--muted)!important}

/* predictable column proportions */
.stations-source-table td:nth-child(1),.stations-source-table th:nth-child(1){width:80px}
.stations-source-table td:nth-child(2),.stations-source-table th:nth-child(2){width:46%}
.value-source-table td:nth-child(1),.value-source-table th:nth-child(1){width:30%}
.value-source-table td:nth-child(2),.value-source-table th:nth-child(2){width:40%}
.products-source-table td:nth-child(1),.products-source-table th:nth-child(1){width:30%}
.products-source-table td:nth-child(2),.products-source-table th:nth-child(2){width:29%}
.products-source-table td:nth-child(3),.products-source-table th:nth-child(3){width:18%}
.opportunities-source-table td:nth-child(1),.opportunities-source-table th:nth-child(1){width:30%}
.opportunities-source-table td:nth-child(2),.opportunities-source-table th:nth-child(2){width:28%}
.architecture-source-table td:nth-child(1),.architecture-source-table th:nth-child(1){width:72px}
.architecture-source-table td:nth-child(2),.architecture-source-table th:nth-child(2){width:22%}
.architecture-source-table td:nth-child(3),.architecture-source-table th:nth-child(3){width:24%}
.reference-value-source-table td:nth-child(1),.reference-value-source-table th:nth-child(1){width:29%}
.reference-value-source-table td:nth-child(2),.reference-value-source-table th:nth-child(2){width:41%}
.reference-products-source-table td:nth-child(1),.reference-products-source-table th:nth-child(1){width:29%}
.reference-products-source-table td:nth-child(2),.reference-products-source-table th:nth-child(2){width:29%}
.reference-products-source-table td:nth-child(3),.reference-products-source-table th:nth-child(3){width:18%}
.reference-opportunities-source-table td:nth-child(1),.reference-opportunities-source-table th:nth-child(1){width:26%}
.reference-opportunities-source-table td:nth-child(2),.reference-opportunities-source-table th:nth-child(2){width:24%}
.reference-opportunities-source-table td:nth-child(3),.reference-opportunities-source-table th:nth-child(3){width:31%}

/* Directory + reference page */
.line-directory-section{padding-block:38px 20px}.line-directory-head{display:flex;align-items:end;justify-content:space-between;gap:20px;margin-bottom:16px}.line-directory-head h2{margin:5px 0 4px;font-size:28px}.line-directory-head p{margin:0;color:var(--muted);font-size:10px}.line-directory-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}.line-directory-card{position:relative;display:block;min-height:155px;padding:17px;border:1px solid var(--line);border-radius:17px;background:var(--surface);overflow:hidden;transition:.2s}.line-directory-card:before{content:"";position:absolute;inset:0 auto 0 0;width:4px;background:var(--card-color)}.line-directory-card:hover{transform:translateY(-2px);border-color:color-mix(in srgb,var(--card-color) 50%,var(--line));box-shadow:var(--detail-card-shadow)}.line-directory-top{display:flex;align-items:center;justify-content:space-between}.line-directory-no{width:30px;height:30px;display:grid;place-items:center;border-radius:9px;background:color-mix(in srgb,var(--card-color) 13%,transparent);color:var(--card-color);font-size:10px;font-weight:800}.line-directory-arrow{color:var(--muted)}.line-directory-card h3{margin:16px 0 3px;font-size:14px}.line-directory-card p{margin:0;color:var(--muted);font-size:8.5px;direction:ltr;text-align:right}.line-directory-meta{display:flex;gap:12px;margin-top:17px;color:var(--muted);font-size:8px}
.tables-hero{padding-block:48px 24px}.tables-hero-card{padding:28px;border:1px solid var(--line);border-radius:22px;background:var(--surface);box-shadow:var(--detail-card-shadow)}.tables-hero h1{margin:8px 0 8px;font-size:clamp(31px,4vw,48px)}.tables-hero p{max-width:800px;margin:0;color:var(--muted);font-size:11px;line-height:2}.table-jump-nav{display:flex;gap:7px;flex-wrap:wrap;margin-top:20px}.table-jump-nav a{padding:8px 11px;border:1px solid var(--line);border-radius:9px;color:var(--muted);font-size:9px;background:var(--surface-2)}.table-jump-nav a:hover{color:var(--text);border-color:color-mix(in srgb,#5a9bf0 50%,var(--line))}

@media(max-width:1180px){
  .map-content-grid{grid-template-columns:1fr}
  .line-detail-panel{min-height:220px}
  .line-detail-panel .detail-placeholder{min-height:170px}
  .related-product-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .line-directory-grid{grid-template-columns:repeat(2,1fr)}
  .line-hero-grid{grid-template-columns:1fr}
  .line-hero-stats{justify-self:stretch}
}
@media(max-width:760px){
  .detail-hero{padding-top:30px}
  .line-hero-grid{padding:22px}
  .line-hero-stats{grid-template-columns:repeat(3,1fr)}
  .line-hero-stat{min-width:0;padding:12px 7px}
  .line-subnav{align-items:stretch;flex-direction:column}
  .line-picker{justify-content:space-between}.line-picker select{min-width:0;flex:1}
  .dedicated-map-toolbar{align-items:flex-start;flex-direction:column}
  .map-font-inline{width:100%}.map-font-inline input{flex:1}
  .related-product-grid{grid-template-columns:1fr}
  .line-directory-grid{grid-template-columns:1fr}
  .data-section-head{align-items:flex-start;flex-direction:column}
  .table-card-head{align-items:flex-start;flex-direction:column;gap:4px}
  .source-table{min-width:680px}
  .source-table th,.source-table td{padding:12px 13px;font-size:10.5px}
  .map-note{align-items:flex-start;flex-direction:column}
}
