:root {
  --ink: #111b2b;
  --muted: #667085;
  --soft: #7b8492;
  --night: #f6f4ef;
  --panel: #fffdf8;
  --panel-2: #ffffff;
  --card: #fffdf8;
  --line: #ddd9cf;
  --accent: #ef4b4f;
  --accent-2: #c08a17;
  --orange: #e59b53;
  --danger: #ff7f87;
  font-family: "Aptos", "Yu Gothic", "Hiragino Kaku Gothic ProN", sans-serif;
  color: var(--ink);
  background: var(--night);
  font-synthesis: none;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--night); overflow-x: hidden; }
button, input, select { font: inherit; }
button { cursor: pointer; }
.app-shell { max-width: 1540px; margin: 0 auto; padding: 0 38px 28px; }
.site-header { display: flex; justify-content: space-between; align-items: flex-start; margin: 0 -38px; padding: 34px 38px 26px; border-bottom: 1px solid rgba(255,255,255,.12); color: #fff; background: #111b2b; }
.eyebrow, .section-kicker { margin: 0; color: var(--accent); font-size: 0.68rem; letter-spacing: 0.21em; font-weight: 700; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin: 8px 0 8px; color: #fff; font-size: clamp(2rem, 5vw, 4.4rem); line-height: 0.95; letter-spacing: -0.07em; font-weight: 800; }
h1 span { color: var(--accent); }
.lead { color: #c6ceda; margin: 0; font-size: 0.96rem; }
.header-note { color: #aeb8c7; display: flex; align-items: center; gap: 9px; font-size: 0.75rem; padding-top: 5px; }
.live-dot { width: 7px; height: 7px; background: var(--accent); border-radius: 50%; box-shadow: 0 0 0 5px rgba(239,75,79,.15); }
.intro-panel { display: grid; grid-template-columns: 1fr; gap: 0; align-items: start; padding: 66px 0 45px; }
.intro-panel h2 { font-size: clamp(2.6rem, 6vw, 6.4rem); letter-spacing: -0.09em; line-height: 0.93; margin: 16px 0 0; }
.intro-panel em { color: var(--accent); font-style: normal; }
.intro-copy { max-width: 530px; color: var(--muted); line-height: 1.9; font-size: 0.96rem; margin: 0 0 4px; }
.control-panel { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 9px; align-items: stretch; background: var(--card); padding: 10px; border: 1px solid var(--line); }
.network-filter { display: flex; align-items: center; gap: 12px; min-width: 0; margin: 0; padding: 7px 12px; border: 1px solid var(--line); background: var(--panel-2); }
.network-filter legend { padding: 0 5px; color: var(--muted); font-size: .72rem; font-weight: 700; }
.network-filter-list { display: flex; flex-wrap: wrap; gap: 7px 14px; }
.network-check { display: inline-flex; align-items: center; gap: 5px; color: var(--ink); font-size: .78rem; cursor: pointer; white-space: nowrap; }
.network-check input { width: auto; height: auto; margin: 0; accent-color: var(--accent); }
.network-all-button { border: 1px solid var(--accent); background: var(--accent); color: var(--panel); padding: 4px 8px; font: inherit; font-size: .72rem; font-weight: 700; cursor: pointer; white-space: nowrap; }
.network-all-button[aria-pressed="false"] { background: transparent; color: var(--accent); }
.map-action { border: 1px solid var(--line); background: transparent; color: var(--muted); padding: 0 16px; transition: 180ms ease; }
.map-action:hover { color: var(--accent); border-color: var(--accent); }
.stats-row { display: flex; align-items: center; gap: 25px; padding: 20px 1px 26px; border-bottom: 1px solid var(--line); }
.stats-row[hidden] { display: none; }
.stats-row div { display: flex; align-items: baseline; gap: 7px; }
.stats-row strong { font-size: 1.45rem; color: var(--accent); }
.stats-row span, .data-note { color: var(--muted); font-size: 0.77rem; }
.data-note { margin: 0 0 0 auto; }
.atlas-layout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(350px, 0.6fr); gap: 14px; padding-top: 14px; }
.map-card, .list-card { background: var(--card); border: 1px solid var(--line); min-width: 0; }
.map-heading, .list-heading { display: flex; align-items: end; justify-content: space-between; padding: 22px 23px 17px; }
.map-tools { display: flex; align-items: center; gap: 13px; }
.map-data-label { color: var(--soft); font-size: 0.68rem; letter-spacing: 0.04em; }
.map-heading h2, .list-heading h2 { margin: 7px 0 0; font-size: 1.4rem; letter-spacing: -0.04em; }
.list-heading { align-items: center; }
.list-heading span { color: var(--soft); font-size: 0.72rem; }
#map { height: 620px; background: #f4f2ec; overflow: hidden; }
.leaflet-container { font-family: inherit; }
.leaflet-control-zoom a { background: rgba(255,255,255,.94) !important; color: var(--accent) !important; border-color: var(--line) !important; }
.leaflet-control-attribution { display: none; }
.tv-marker-wrap { background: transparent; border: 0; }
.tv-marker { display: block; width: var(--marker-size); height: var(--marker-size); border-radius: 50%; background: var(--marker-color); border: 2px solid rgba(255,255,255,.96); box-shadow: 0 1px 4px rgba(17,27,43,.28), 0 0 0 1px rgba(17,27,43,.25); }
.tv-marker.is-selected { box-shadow: 0 0 0 3px var(--accent), 0 0 12px rgba(239,75,79,.42); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; padding: 14px 22px 16px; color: var(--muted); font-size: 0.72rem; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.network-jnn { background: #f4c36a; } .network-nnn { background: #f57c80; } .network-fnn { background: #8aa9ff; }
.network-ann { background: #bd87f7; } .network-txn { background: #55d6b7; } .network-uhf { background: #b0b8b5; } .network-nhk { background: #c7f36b; }
.drill-marker-wrap { background: transparent; border: 0; overflow: visible; pointer-events: none; }
.drill-marker { width: 43px; height: 43px; display: grid; place-items: center; padding: 0; border: 2px solid rgba(239,75,79,.8); border-radius: 50%; background: rgba(255,253,248,.97); color: var(--ink); box-shadow: 0 4px 12px rgba(17,27,43,.2); white-space: nowrap; }
.drill-marker b { min-width: 0; color: var(--accent); font-size: .95rem; line-height: 1; }
.drill-marker small { display: none; }
.drill-marker-wrap-region .drill-marker { position: relative; margin: 0 auto; pointer-events: auto; }
.drill-marker-wrap-region .drill-marker small { display: block; position: absolute; top: calc(100% + 6px); left: 50%; transform: translateX(-50%); padding: 3px 8px; border: 1px solid rgba(17,27,43,.12); border-radius: 999px; background: rgba(255,253,248,.96); color: var(--ink); font-size: .67rem; font-weight: 700; line-height: 1.2; letter-spacing: .02em; box-shadow: 0 2px 7px rgba(17,27,43,.12); }
.drill-marker-wrap-region .drill-marker.drill-marker-region-koshinetsu small { top: auto; bottom: calc(100% + 6px); }
.drill-marker-wrap-region .drill-marker.drill-marker-region-kinki small { transform: translateX(-50%); }
.drill-marker-prefecture { width: 37px; height: 37px; border-color: rgba(192,138,23,.82); background: rgba(255,255,255,.97); }
.drill-marker-prefecture b { color: var(--accent-2); font-size: .82rem; }
.prefecture-hover-popup .leaflet-popup-content-wrapper { border: 1px solid rgba(17,27,43,.12); border-radius: 8px; background: rgba(255,253,248,.97); box-shadow: 0 4px 12px rgba(17,27,43,.16); }
.prefecture-hover-popup { pointer-events: none; }
.prefecture-hover-popup .leaflet-popup-content { margin: 7px 10px; color: var(--ink); font-size: .76rem; font-weight: 700; white-space: nowrap; }
.prefecture-hover-popup .leaflet-popup-tip { background: rgba(255,253,248,.97); }
.directory-group-card { display: flex; align-items: center; justify-content: space-between; gap: 14px; border-top: 1px solid var(--line); padding: 17px 11px 17px 13px; }
.directory-group-card .section-kicker { color: var(--accent-2); font-size: .6rem; }
.directory-group-card h3 { margin: 4px 0 3px; font-size: .97rem; }
.directory-group-card p:not(.section-kicker) { margin: 0; color: var(--muted); font-size: .72rem; }
.directory-group-card button { flex: 0 0 auto; border: 0; background: transparent; color: var(--accent-2); font-size: .72rem; }
.directory-group-card button:hover { color: var(--accent); text-decoration: underline; }
.station-list { display: flex; flex-direction: column; gap: 10px; max-height: 698px; overflow: auto; padding: 0 12px 14px; }
.station-card { display: block; position: relative; border: 1px solid var(--line); padding: 16px 11px 16px 13px; color: inherit; text-decoration: none; transition: background 180ms ease, border-color 180ms ease; }
.station-card:hover, .station-card.is-selected { background: #fff8f1; border-color: rgba(239,75,79,.42); }
.station-card-head { display: grid; grid-template-columns: minmax(0, 1fr) 110px; align-items: center; gap: 13px; }
.station-card-copy { min-width: 0; }
.station-card-title { display: flex; align-items: flex-start; gap: 9px; }
.station-card-head h3 { margin: 0; font-size: 0.97rem; line-height: 1.35; }
.channel-avatar { display: block; align-self: center; justify-self: center; width: 82px; height: 82px; border-radius: 14px; object-fit: cover; background: var(--panel-2); box-shadow: 0 2px 8px rgba(17,27,43,.14); }
.station-bullet { flex: 0 0 auto; width: 9px; height: 9px; margin-top: 5px; border-radius: 50%; box-shadow: 0 0 0 4px rgba(255,255,255,0.04); }
.station-meta { color: var(--muted); font-size: 0.72rem; margin: 7px 0 0 18px; }
.tag-row { display: flex; flex-wrap: wrap; gap: 5px; margin: 9px 0 0 18px; }
.tag { color: var(--soft); border: 1px solid var(--line); padding: 3px 6px; font-size: 0.63rem; }
.station-actions { display: flex; align-items: center; gap: 7px; margin: 13px 0 0 18px; }
.station-actions span { color: var(--accent-2); font-size: 0.72rem; }
.station-card:hover .station-actions span { color: var(--accent); text-decoration: underline; }
.empty-state { text-align: center; padding: 80px 30px; color: var(--muted); }
.empty-state span { color: var(--accent); font-size: 2.2rem; } .empty-state h3 { color: var(--ink); margin: 13px 0 7px; }
.empty-state p { font-size: 0.8rem; }
.site-footer { display: flex; justify-content: space-between; gap: 20px; padding: 23px 1px 0; color: var(--soft); font-size: 0.68rem; }
.site-footer p { margin: 0; }
.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; }

@media (max-width: 1050px) {
  .app-shell { padding: 0 20px 24px; }
  .atlas-layout { grid-template-columns: 1fr; }
  .station-list { max-height: 580px; }
}
@media (max-width: 700px) {
  .site-header, .site-footer { display: block; }
  .site-header { margin: 0 -20px; padding: 24px 20px 22px; }
  .header-note { margin-top: 18px; }
  .intro-panel { display: block; padding: 48px 0 32px; }
  .intro-copy { margin-top: 26px; }
  .control-panel { grid-template-columns: 1fr; }
  .network-filter { align-items: flex-start; flex-direction: column; gap: 3px; }
  .stats-row { gap: 13px; flex-wrap: wrap; }
  .data-note { width: 100%; margin: 3px 0 0; }
  #map { height: 460px; }
  .map-heading, .list-heading { padding-left: 15px; padding-right: 15px; }
  .map-tools { gap: 7px; }
  .map-data-label { display: none; }
  .legend { padding-left: 15px; padding-right: 15px; gap: 10px; }
  .site-footer p + p { margin-top: 8px; }
}
