/* ============================================================================
 * traffic.css — MAPRISE TRAFFIC-001 Phase 2 (独立スタイル、独自プレフィックス .traffic-*)
 * 既存 CSS 変数は使用しない (鉄則 116-B、ダーク背景に染まらないよう固定色)。
 * ========================================================================== */

.traffic-panel {
  position: fixed;
  right: 12px;
  bottom: 12px;
  width: min(560px, 92vw);
  max-height: 78vh;
  overflow: auto;
  z-index: 2000;
  background: #ffffff;
  color: #1a1d27;
  border: 1px solid #d0d4dc;
  border-radius: 10px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.18);
  font-size: 13px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", sans-serif;
}
.traffic-panel__head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px;
  background: #085041; color: #fff;
  border-top-left-radius: 10px; border-top-right-radius: 10px;
}
.traffic-panel__title { font-weight: 600; font-size: 14px; }
.traffic-panel__close {
  background: transparent; color: #fff; border: none; font-size: 20px; cursor: pointer; line-height: 1;
}
.traffic-panel__close:hover { color: #ffd; }
.traffic-panel__body { padding: 12px 14px; }

.traffic-controls {
  display: flex; flex-direction: column; gap: 6px;
  margin-bottom: 10px;
}
.traffic-controls label { font-size: 12px; color: #444; }
.traffic-time-display {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 14px;
  color: #085041;
  font-weight: 600;
}
#traffic-slider { width: 100%; }

.traffic-buttons { display: flex; gap: 8px; }
.traffic-btn {
  padding: 4px 10px; font-size: 12px;
  background: #ffffff; color: #085041; border: 1px solid #085041;
  border-radius: 4px; cursor: pointer;
}
.traffic-btn:hover { background: #085041; color: #fff; }

.traffic-legend { margin: 10px 0; }
.traffic-legend__title { font-size: 12px; color: #444; margin-bottom: 4px; }
.traffic-legend__bar {
  display: flex; height: 18px; border-radius: 3px; overflow: hidden; border: 1px solid #d0d4dc;
}
.traffic-legend__seg {
  flex: 1; display: flex; align-items: center; justify-content: center;
  font-size: 10px; color: #1a1d27;
}
.traffic-legend__seg-label { background: rgba(255,255,255,0.7); padding: 1px 4px; border-radius: 2px; }
.traffic-legend__hint { display: flex; justify-content: space-between; font-size: 11px; color: #666; margin-top: 2px; }
.traffic-legend__note { font-size: 11px; color: #666; margin-top: 6px; line-height: 1.4; }

.traffic-dh { margin: 12px 0; }
.traffic-dh__title { font-size: 12px; color: #444; margin-bottom: 4px; }
.traffic-dh__tbl {
  width: 100%; border-collapse: collapse; font-size: 9px;
}
.traffic-dh__tbl th, .traffic-dh__tbl td {
  border: 1px solid #e6e8ec; padding: 1px 2px; text-align: center;
}
.traffic-dh__tbl th { background: #f5f7fa; color: #555; font-weight: 600; }
.traffic-dh__cell { height: 14px; background: #f0f1f4; color: transparent; }
.traffic-dh__cell:hover { outline: 1px solid #085041; }

.traffic-attribution {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid #e6e8ec;
  font-size: 10px;
  color: #666;
  line-height: 1.5;
}

/* Popup */
.traffic-popup { color: #1a1d27; font-size: 12px; max-width: 300px; }
.traffic-popup__title { font-weight: 600; color: #085041; margin-bottom: 6px; }
.traffic-popup__tbl { width: 100%; border-collapse: collapse; }
.traffic-popup__tbl th {
  text-align: left; font-weight: 500; color: #555; padding: 2px 6px 2px 0; white-space: nowrap; vertical-align: top;
}
.traffic-popup__tbl td {
  padding: 2px 0; font-family: ui-monospace, Menlo, Consolas, monospace;
}
.traffic-popup__note {
  margin-top: 6px; font-size: 11px; color: #b45200; background: #fff8e1; padding: 4px 6px; border-radius: 3px;
}
.traffic-popup__attr {
  margin-top: 8px; padding-top: 6px; border-top: 1px solid #e6e8ec; font-size: 10px; color: #666; line-height: 1.4;
}

/* Toggle button (will be rendered in layer panel sidebar by traffic-launcher) */
.traffic-launcher {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px;
  background: #ffffff; color: #085041;
  border: 1px solid #085041; border-radius: 5px;
  cursor: pointer; font-size: 12px;
  margin: 4px 0;
}
.traffic-launcher:hover { background: #085041; color: #fff; }
.traffic-launcher--on { background: #085041; color: #fff; }
