:root{
  --nova-deep:#0A2A66;
  --nova-sky:#32B5FF;
  --support:#1E3A8A;
  --bg-soft:#f6f8ff;
  --text:#333;
  --muted:#555;
  --topbar-h: 58px;
}
/* ===== Global ===== */
html, body {
  height: 100%;
  margin: 0;
}
body{
  margin:0;
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial;
  background:#eef2f8;
  color:var(--text);
  line-height:1.55;
}
/* Landing */
.landing-container{
  max-width:860px;
  margin:80px auto;
  text-align:center;
  padding:0 20px;
}
.lab-title{ font-size:42px; margin:0 0 6px 0; }
.lab-title .nova{ color:var(--nova-deep); font-weight:800; }
.lab-title .mobility{ color:var(--nova-sky); font-weight:800; }
.project-title{ font-size:26px; margin:10px 0 0 0; color:var(--nova-deep); font-weight:800; }
.subtitle{ font-size:18px; color:#444; margin-top:12px; }
.divider{ margin:40px auto; width:80%; }
.description{ font-size:16px; max-width:720px; margin:0 auto 35px auto; }
.primary-btn{
  display:inline-block;
  padding:14px 34px;
  background:var(--nova-deep);
  color:#fff;
  font-size:18px;
  border-radius:10px;
  text-decoration:none;
  box-shadow:0 2px 6px rgba(0,0,0,0.15);
  font-weight:800;
}
.primary-btn:hover{ background:#133b8a; }
.landing-footer{ margin-top:60px; font-size:14px; color:var(--muted); }

#app-shell {
  height: 100%;          /* ← 关键 */
  margin: 0px;
  background: #ffffff;
  border-radius: 0;
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(0,0,0,0.08);

  display: flex;
  flex-direction: column;
}
/* ===== Top Bar ===== */
.top-bar {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: 0px 16px;
  background: var(--nova-deep);
  color: #fff;
}
.menu-toggle {
  display: none;           /* 默认 desktop 不显示 */
  font-size: 22px;
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  margin-right: 10px;
}
@media (max-width: 768px) {
  .page-subtitle {
    display: none;
  }
}
.lab-wordmark {
  display: flex;              /* 🔑 关键 */
  align-items: baseline;      /* 🔑 不同字号对齐 */
  gap: 6px;

  font-weight: 800;
  white-space: nowrap;        /* 禁止任何换行 */
}

.lab-wordmark .brand {
  font-size: 22px;
}

.lab-wordmark .page-title {
  font-size: 18px;
  opacity: 0.95;
}
.lab-wordmark .page-subtitle {
  font-size: 12px;        /* 更小 */
  font-weight: 400;      /* 不加粗 */
  color: #cfe3ff;
  opacity: 0.75;         /* 再弱一点 */
  white-space: nowrap;
}
.lab-wordmark .sep {
  margin: 0 6px;
  opacity: 0.7;
}
.lab-wordmark .nova{ color:#fff; }
.lab-wordmark .mobility{ color:var(--nova-sky); }

.center-group{ text-align:center; }
.main-title{ font-size:20px; font-weight:800; }
.sub-title{ font-size:12.5px; color:#cfe3ff; font-weight:500; }

.villanova-logo {
  display: block; 
  height: 32px;
  padding: 2px 3px;     /* 关键：增大内边距 */
  opacity: .95;
  border-radius: 5px;
  background: #fff; /* 如果你希望白框可见，必须加 */
}

/* ===== Layout ===== */
#layout {
  flex: 1; 
  display: flex;
  padding: 0 12px;
  box-sizing: border-box;
  min-height: 0; 
}

/* ==================== */
/* ===== SideBar ===== */
/* ==================== */
.sidebar-title {
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 10px;
  color: #0A2A66;
}

#sidebar {
  width: 280px;        /* 🔥 给一个明确锚点 */
  min-width: 280px;
  flex-shrink: 0;
  background: #fff;

  display: flex;
  flex-direction: column;
}
@media (max-width: 768px) {
  #sidebar {
    position: absolute;
    left: 0;
    top: var(--topbar-h);
    height: calc(100% - var(--topbar-h));
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    z-index: 2000;
  }

  #sidebar.open {
    transform: translateX(0);
  }
}
.sidebar-top {
  padding: 6px 8px;
  border-bottom: 1px solid #eef1f7;
  background: #fafbff;
}
.sidebar-top {
  position: sticky;
  top: 0;
  z-index: 10;
}

.sidebar-content {
  flex: 1 1 auto;        /* 🔥 吃掉剩余高度 */
  overflow-y: auto;      /* 只有这里滚 */
  padding: 8px 8px;
}

.sidebar-footer {
  margin-top: auto;  
  flex-shrink: 0;
  padding: 6px 10px;
  border-top: 1px solid #eef1f7;

  display: flex;
  align-items: center;
  gap: 6px;

  font-size: 11px;
  color: #444;
  background: #fafbff;
}

.view-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr); /* 一行两个 */
  gap: 6px;
}

.view-pill {
  font-size: 12px;
  padding: 6px 6px;
  border-radius: 8px;

  background: #f3f6ff;
  border: 1px solid #d6def5;
  color: #0A2A66;
  font-weight: 600;
  cursor: pointer;
}

.view-pill.active {
  background: #0A2A66;
  color: #fff;
  border-color: #0A2A66;
}

.lens-selector {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.lens-btn {
  background: #f5f7ff;
  border: 1px solid #d0d7e6;
  border-radius: 6px;
  padding: 6px 10px;
  font-weight: 600;
  color: #0A2A66;
  cursor: pointer;
}

.lens-btn.active {
  background: #0A2A66;
  color: white;
}

.card.subtle {
  background: #fafbff;
  border: none;
}


#map-wrap{
  flex:1;
  min-width: 0;
  position:relative;
  background:#fff;
}

#map{
  width:100%;
  height:100%;
  position: relative; 
}

/* ===== Stats Panel ===== */
.stats-panel {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 1200;

  min-width: 240px;
  background: #ffffff;
  border: 1px solid #e2e6f0;
  border-radius: 10px;
  padding: 10px 12px;

  font-size: 12px;
  color: #222;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}
 
.stats-title {
  font-weight: 800;
  font-size: 13px;
  margin-bottom: 8px;
  color: #0A2A66;
}

.stats-row {
  margin: 4px 0;
  line-height: 1.4;
}

#travelTimeChart {
  display: block;
  width: 260px;
  height: 120px;
  margin-top: 6px;
  border-top: 1px solid #eef1f7;
  padding-top: 6px;
}

/* ===== Cards / UI ===== */
.card{
  background:#fff;
  border:1px solid var(--border);
  border-radius:10px;
  padding:12px 12px;
  margin-bottom:12px;
  box-shadow:0 1px 0 rgba(0,0,0,.02);
}

.card h3{
  margin:0 0 8px 0;
  font-size:16px;
  color:var(--villanova-blue);
  font-weight:700;
}

.small{
  font-size:13px;
  color:var(--muted);
  margin-bottom:10px;
}

.hint{
  margin-top:10px;
  font-size:16px;
  color:#555;
  background:var(--bg-soft);
  border-left:4px solid var(--support-blue);
  padding:8px 10px;
  border-radius:8px;
}

.form-row{
  display:flex;
  flex-direction:column;
  gap:6px;
  margin-bottom:10px;
}
.form-row.inline{
  flex-direction:row;
  align-items:center;
}
label{
  font-size:13px;
  color:#222;
  font-weight:700;
}
select{
  padding:8px 10px;
  border:1px solid var(--border);
  border-radius:10px;
  font-size:13px;
  outline:none;
}
select:focus{
  border-color:var(--support-blue);
}

.checkbox{
  display:flex;
  gap:8px;
  align-items:center;
  font-size:13px;
  font-weight:700;
  color:#222;
  margin:8px 0;
}
.checkbox input{
  transform:translateY(1px);
}

/* ===== Tabs ===== */
.tab-bar{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}
.tab-btn{
  border:1px solid var(--border);
  background:#fff;
  border-radius:10px;
  padding:8px 10px;
  font-size:13px;
  font-weight:800;
  color:var(--villanova-blue);
  cursor:pointer;
}
.tab-btn.active{
  background:var(--bg-soft);
  border-color:var(--support-blue);
}
.tab-panel{ display:none; }
.tab-panel.active{ display:block; }

/* ===== Lists / tables ===== */
.list{
  display:flex;
  flex-direction:column;
  gap:8px;
}

.list-item{
  border:1px solid var(--border);
  border-radius:10px;
  padding:10px;
  cursor:pointer;
  background:#fff;
}
.list-item:hover{
  border-color:var(--support-blue);
  background:var(--bg-soft);
}
.list-item .title{
  font-weight:800;
  color:var(--villanova-blue);
  font-size:13px;
}
.list-item .meta{
  font-size:12px;
  color:var(--muted);
  margin-top:2px;
}

.kv{
  font-size:13px;
  color:#222;
}
.kv .row{
  display:flex;
  justify-content:space-between;
  padding:4px 0;
  border-bottom:1px dashed #eee;
}
.kv .row:last-child{ border-bottom:none; }
.kv .k{ font-weight:800; color:#222; }
.kv .v{ color:#222; }

.table{
  border:1px solid var(--border);
  border-radius:10px;
  overflow:hidden;
  margin-top:10px;
}
.table .trow{
  display:grid;
  grid-template-columns: 1fr 1fr 1fr;
  padding:8px 10px;
  border-bottom:1px solid #eee;
  font-size:13px;
}
.table .trow.head{
  background:var(--bg-soft);
  font-weight:900;
  color:var(--villanova-blue);
}
.table .trow:last-child{ border-bottom:none; }

/* ===== TDI legend ===== */
.legend{
  margin-top:10px;
  border:1px solid var(--border);
  border-radius:10px;
  padding:10px;
}
.legend-title{
  font-size:13px;
  font-weight:900;
  color:var(--villanova-blue);
  margin-bottom:8px;
}
.legend-row{
  display:flex;
  gap:10px;
  align-items:center;
  font-size:12px;
  margin:4px 0;
}
.swatch{
  width:16px; height:10px;
  border-radius:3px;
  border:1px solid rgba(0,0,0,.12);
}
.s1{ background: rgba(50,181,255,.25); }
.s2{ background: rgba(30,58,138,.25); }
.s3{ background: rgba(10,42,102,.55); }

/* ===== Map status ===== */
.map-status{
  position:absolute;
  left:14px;
  bottom:14px;
  background:#fff;
  border:1px solid var(--border);
  border-radius:10px;
  padding:8px 10px;
  font-size:12px;
  color:#222;
  box-shadow:0 2px 8px rgba(0,0,0,.08);
}


/* Base button */
.view-btn {
  appearance: none;
  border: none;
  background: transparent;

  padding: 6px 12px;
  border-radius: 999px;

  font-size: 12px;
  font-weight: 600;

  color: #0A2A66; /* Villanova blue */
  cursor: pointer;

  transition: all 0.15s ease-in-out;
}

/* Hover */
.view-btn:hover {
  background: rgba(10, 42, 102, 0.08);
}

/* Active */
.view-btn.active {
  background: #0A2A66;
  color: #ffffff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
/* ===== Basemap Toggle (Sidebar Bottom) ===== */
.basemap-toggle {
  flex-shrink: 0;               /* 🔥 不被压缩 */
  padding: 8px 10px;
  border-top: 1px solid #eef1f7;

  display: flex;
  align-items: center;
  gap: 6px;

  font-size: 11px;
  color: #444;
  background: #fafbff;
}


.basemap-toggle .label {
  margin-right: 4px;
  font-weight: 600;
  color: #444;
}

.bm-btn {
  border: 1px solid #d0d7e6;
  background: transparent;
  border-radius: 999px;
  padding: 2px 8px;

  font-size: 11px;
  font-weight: 600;
  color: #0A2A66;
  cursor: pointer;
}

.bm-btn.active {
  background: #0A2A66;
  color: #fff;
  border-color: #0A2A66;
}

.recenter-btn {
  width: 32px;
  height: 32px;

  background: #ffffff;
  border: 1px solid #d0d7e6;
  border-radius: 6px;

  font-size: 16px;
  font-weight: 700;
  color: #0A2A66;

  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.recenter-btn:hover {
  background: #f3f6ff;
}
/* ===== Recenter (Crosshair) Control ===== */
.recenter-btn {
  width: 34px;
  height: 34px;

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 32px;
  font-weight: 700;
  line-height: 1;

  background: #ffffff;
  color: #0A2A66;

  border: 1px solid #d0d7e6;
  border-radius: 8px;

  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);

  padding: 0;
}

/* Hover */
.recenter-btn:hover {
  background: #f3f6ff;
}

/* Active */
.recenter-btn:active {
  transform: translateY(1px);
  box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
.map-legend {
  position: absolute;
  right: 16px;
  bottom: 28px;
  z-index: 1000;  
  min-width: 140px;
  max-width: 200px;      
  background: #fff;
  border: 1px solid #e2e6f0;
  border-radius: 10px;
  padding: 8px 10px;
  pointer-events: auto;  
  font-size: 12px;
  color: #222;
  overflow: visible;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}

.map-legend .legend-title {
  font-weight: 800;
  margin-bottom: 6px;
  color: #0A2A66;
}

.legend-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0;
}
.legend-note {
  margin-top: 6px;
  font-size: 11px;
  color: #555;
  line-height: 1.35;

  white-space: normal;      /* 👈 允许换行 */
  word-break: break-word;   /* 👈 防止长词撑开 */
}
.legend-meta {
  font-size: 10px;
  color: #666;
  margin-left: auto;
}
/* line swatches */
.swatch.line {
  width: 20px;
  height: 3px;
  border-radius: 2px;
}

.line.car { background: #391b57ff; }
.line.bus { background: rgba(37,166,235,1); }
.line.rail { background: #e23c1bff; }
.line.walk { background: #15c856ff; }

/* point symbols */
.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.dot.origin { background: #22c55e; }
.dot.destination { background: #ef4444; }
.dot.transfer {
  border: 2px dashed #2563eb;
  background: #bfdbfe;
}

.pi-block {
  margin-top: 50px;
  font-size: 14px;
  color: #444;
}

.pi-title {
  font-weight: 700;
  color: #0A2A66;
  margin-bottom: 6px;
}

.pi-name {
  font-weight: 600;
  margin-bottom: 4px;
}

.pi-contact div {
  line-height: 1.6;
}

.pi-contact a {
  color: #0A2A66;
  text-decoration: none;
  word-break: break-all;
}

.pi-contact a:hover {
  text-decoration: underline;
}

@media (max-width: 600px) {
  .pi-block {
    font-size: 13px;
  }
}

.sidebar-attribution {
  padding: 8px 10px 10px;
  border-top: 1px solid #eef1f7;
  font-size: 8px;
  color: #555;
  background: #fafbff;
}

.attr-lab {
  font-weight: 700;
  color: #0A2A66;
}

.attr-pi {
  margin-top: 2px;
}

.attr-links a {
  color: #0A2A66;
  text-decoration: none;
}

.attr-links a:hover {
  text-decoration: underline;
}
@media (max-width: 768px) {
  .sidebar-attribution {
    font-size: 8px;
  }
}
/* =========================================================
   Mobile layout: top OD bar + map
========================================================= */

.mobile-od-bar {
  display: none;
}

@media (max-width: 768px) {

  /* 隐藏左侧 sidebar */
  #sidebar {
    display: none;
  }

  /* 显示顶部 OD bar */
  .mobile-od-bar {
    display: flex;
    gap: 12px;
    padding: 10px 12px;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
  }

  .mobile-od-bar .form-row {
    flex: 1;
  }

  /* 地图占满剩余空间 */
  #layout {
    padding: 0;
  }

  /* stats / legend 稍微缩小 */
  .stats-panel {
    top: 8px;
    right: 8px;
    min-width: 160px;
    max-width: 180px;

    padding: 6px 8px;
    font-size: 10.5px;
    line-height: 1.3;
  }

  .stats-title {
    font-size: 11px;
    margin-bottom: 4px;
  }

  #travelTimeChart {
    width: 160px;
    height: 90px;
    padding-top: 4px;
  }

  .map-legend {
    left: 8px;
    right: auto;
    bottom: 8px;
    max-width: 140px;

    min-width: unset;
    padding: 6px 8px;
    font-size: 10.5px;
  }

  .map-legend .legend-title {
    font-size: 11px;
    margin-bottom: 4px;
  }

  .map-legend .swatch.line {
    width: 16px;
    height: 2px;
  }

  .map-legend .legend-note {
    display: none;  
  }
  .legend-meta {
    font-size: 9px;
    color: #0A2A66;
    font-weight: 600;
  }
  .map-legend .dot {
    width: 8px;
    height: 8px;
  }  
  
  .map-legend .legend-title {
    font-size: 11px;
    margin-bottom: 4px;
  }

  .map-legend .legend-row {
    margin: 2px 0;
    gap: 6px;
  }

  .map-legend .swatch.line {
    width: 16px;
    height: 2px;
  }


}
@media (max-width: 768px) {

  .top-bar {
    padding: 0 8px;
  }

  .lab-wordmark .brand {
    font-size: 16px;
  }

  .lab-wordmark .page-title {
    font-size: 14px;
  }

  .lab-wordmark {
    gap: 4px;
  }

}
@media (max-width: 768px) {

  .lab-wordmark .page-subtitle {
    display: none;
  }

}

.leaflet-interactive:focus {
  outline: none !important;
}