/* ==========================================================================
   TOKYO CX — 放送局UI（コンソール / 番組表 / この放送局について）
   正本: docs/DESIGN.md v3。トークンは tokyocx.css を継承。放送局UIはダーク固定。
   ========================================================================== */
html.station-dark { color-scheme: dark; }
body.station { overflow-x: hidden; }
body.station .theme-toggle { display: none; }

/* --- 共通部品 ------------------------------------------------------------ */
.key {
  display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 18px; padding: 0 5px;
  border: 1px solid var(--line-strong); border-radius: 2px; font-family: var(--font-mono); font-size: 10px; color: var(--text-dim);
}
.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 0 10px;
  background: transparent; border: 1px solid var(--line-strong); border-radius: 3px;
  color: var(--text-muted); font-size: 12px; font-family: inherit; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.chip:hover { color: var(--text); background: var(--surface-2); }
.chip[aria-pressed="true"], .chip.is-on { color: var(--text); border-color: var(--accent); }
.chip--primary { background: var(--accent); border-color: var(--accent); color: #0A0D11; font-weight: 600; }
.chip--primary:hover { background: var(--accent-hover); color: #0A0D11; }
.tag {
  display: inline-flex; align-items: center; gap: 5px; padding: 1px 7px; border: 1px solid var(--line-strong); border-radius: 3px;
  font-size: 10.5px; color: var(--text-muted); white-space: nowrap; line-height: 1.5;
}
.tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--line-strong); }
.tag--anchor { color: var(--up); } .tag--anchor::before { background: var(--up); }
.tag--dormant { color: var(--text-dim); } .tag--dormant::before { display: none; }
.tag--sig { color: var(--text-muted); } .tag--sig::before { display: none; }
.tag--ov { color: var(--text-muted); } .tag--ov::before { display: none; }
.tag--face { color: var(--text-dim); } .tag--face::before { display: none; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong); flex: 0 0 auto; }
.dot--live { background: var(--live); animation: tally 2s ease-in-out infinite; }
.dot--latest { background: var(--latest); }
.dot--post { background: var(--post); }
@keyframes tally { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
.cc {
  display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 16px; padding: 0 3px;
  border: 1px solid var(--line); border-radius: 2px; font-family: var(--font-mono); font-size: 10px; color: var(--text-deco);
}
.dots { display: inline-block; vertical-align: middle; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* --- コンソール ---------------------------------------------------------- */
.console { display: flex; flex-direction: column; }
.console__body { display: flex; flex-direction: column; }
.rail { display: flex; gap: 6px; padding: 10px 16px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); }
.rail::-webkit-scrollbar { display: none; }
.rail__b {
  display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 10px; flex: 0 0 auto;
  background: transparent; border: 1px solid var(--line-strong); border-radius: 3px; color: var(--text-muted);
  font-size: 12.5px; font-family: inherit; cursor: pointer; white-space: nowrap;
}
.rail__b .hue { width: 7px; height: 7px; border-radius: 50%; }
.rail__b .num { font-size: 11px; color: var(--text-dim); }
.rail__b .who { display: none; }
.rail__b[aria-pressed="true"] { color: var(--text); border-color: var(--accent); }
.stage { display: flex; flex-direction: column; gap: 10px; padding: 0 0 12px; min-width: 0; }
.screen { position: sticky; top: 52px; z-index: 20; background: var(--bg); }
.player {
  position: relative; aspect-ratio: 16 / 9; background: #000; border: 1px solid var(--line); border-radius: 4px; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player.is-frame { background: #000; }
.player.is-frame iframe { position: absolute; left: 50%; top: 0; transform: translateX(-50%); width: min(100%, 560px); height: 100%; }
/* SP: X の投稿は 16:9 に収まらないので、枠を縦に伸ばして iframe 内でスクロールさせる（クリップしない） */
@media (max-width: 719px) { .player.is-frame { aspect-ratio: auto; height: 56vh; min-height: 320px; } }
.player__fallback { display: none; flex-direction: column; align-items: flex-start; gap: 12px; padding: 24px; max-width: 560px; }
.player.is-fallback .player__fallback { display: flex; }
.player__msg { margin: 0; font-size: 14px; color: var(--text-2); line-height: 1.7; }
.player__acts { display: flex; gap: 8px; flex-wrap: wrap; }
.hint {
  position: absolute; left: 12px; top: 10px; z-index: 21; padding: 6px 10px; background: rgba(10,13,17,.85); border: 1px solid var(--line-strong);
  border-radius: 3px; font-size: 12px; color: var(--text-2); pointer-events: none; opacity: 0; transition: opacity .3s;
}
.hint.is-on { opacity: 1; }

.tally {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 12px 16px; margin: 0 16px;
  background: var(--surface-1); border: 1px solid var(--line); border-radius: 3px;
}
.tally__now { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.tally__row { display: flex; align-items: center; gap: 12px; min-width: 0; }
.tally__state { display: flex; align-items: center; gap: 7px; min-width: 76px; }
.tally__nm { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 16px; font-weight: 600; }
.tally__nm .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tally__meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tally__src { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tally__src a { font-family: var(--font-mono); font-size: 12px; text-decoration: none; }
.tally__side {
  display: none; flex-direction: column; gap: 4px; padding: 8px 10px; background: transparent; border: 1px solid var(--line);
  border-radius: 3px; color: var(--text-muted); font-family: inherit; cursor: pointer; text-align: left; min-width: 0;
}
.tally__side b { display: flex; gap: 8px; align-items: baseline; font-weight: 500; font-size: 12.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tally__side:hover { background: var(--surface-2); color: var(--text); }
.tally__side--next { text-align: right; align-items: flex-end; }
.faces { display: flex; gap: 6px; }
.faces .chip { min-height: 26px; padding: 0 8px; font-size: 11px; }

.desk { display: flex; flex-direction: column; gap: 8px; padding: 0 16px; }
.desk__cards { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.desk__cards::-webkit-scrollbar { display: none; }
.desk__card {
  flex: 0 0 220px; display: flex; flex-direction: column; gap: 4px; padding: 11px 13px; min-width: 0;
  background: var(--surface-2); border: 1px solid var(--line); border-left: 2px solid var(--hue, var(--line-strong)); border-radius: 3px;
  color: var(--text); text-decoration: none;
}
.desk__card:hover { border-color: var(--line-strong); border-left-color: var(--hue, var(--line-strong)); color: var(--text); }
.desk__card .t { font-size: 13px; font-weight: 600; }
.desk__card .d { font-size: 11.5px; color: var(--text-muted); line-height: 1.5; }
.quick { display: flex; flex-direction: column; gap: 8px; padding: 0 16px; }
.quick__list { display: flex; gap: 8px; flex-wrap: wrap; }
.quick__list .chip .num { font-size: 11px; color: var(--text-dim); }

.guide { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.guide__filters { display: flex; gap: 6px; flex-wrap: wrap; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.guide__filters .chip { min-height: 28px; font-size: 11.5px; padding: 0 9px; }
.guide__list { display: flex; flex-direction: column; }
.guide__band {
  position: sticky; top: 0; z-index: 2; display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
  padding: 10px 14px 6px; background: var(--surface-1); border-bottom: 1px solid var(--line); border-left: 2px solid var(--hue, var(--line-strong));
}
.guide__band .who { font-size: 11px; color: var(--text-deco); }
.guide__band .cnt { font-family: var(--font-mono); font-size: 12px; color: var(--text-dim); }
.row {
  display: grid; grid-template-columns: 36px 28px minmax(0, 1fr) auto 18px; align-items: center; gap: 8px; min-height: 48px; padding: 0 14px 0 12px;
  background: transparent; border: 0; border-left: 2px solid transparent; border-bottom: 1px solid var(--line-soft);
  color: var(--text); font-family: inherit; font-size: 13px; text-align: left; cursor: pointer; width: 100%;
}
.row:hover { background: var(--surface-2); }
.row[aria-current="true"] { background: var(--surface-2); border-left-color: var(--accent); }
.row .row__ch { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 13px; color: var(--text-dim); }
.row[aria-current="true"] .row__ch { color: var(--text); }
.row .row__nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .row__face { font-family: var(--font-mono); font-size: 10px; color: var(--text-deco); text-align: right; }
.row.is-dormant { opacity: .55; }
.guide__empty { padding: 16px; font-size: 13px; color: var(--text-dim); }

.strip {
  display: flex; align-items: center; gap: 18px; min-height: 28px; padding: 4px 16px; overflow-x: auto; scrollbar-width: none;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface-1);
  font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 11px; color: var(--text-muted); white-space: nowrap;
}
.strip::-webkit-scrollbar { display: none; }
.strip b { font-weight: 600; color: var(--text); }
.strip .k { color: var(--text-deco); }
.strip__keys { display: none; gap: 10px; margin-left: auto; }
.strip__keys span { display: inline-flex; align-items: center; gap: 5px; }
@media (min-width: 1200px) { .strip__keys { display: flex; } }

/* ドック（SP） */
.dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: flex; background: var(--surface-1); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.dock button {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; height: 56px;
  background: transparent; border: 0; color: var(--text-muted); font-family: inherit; font-size: 10px; cursor: pointer;
}
.dock button .num { font-family: var(--font-mono); font-size: 15px; color: var(--text-dim); line-height: 1; }
body.has-dock { padding-bottom: calc(56px + env(safe-area-inset-bottom)); }
@media (min-width: 1200px) { .dock { display: none; } body.has-dock { padding-bottom: 0; } }

/* 選局スレート */
.slate {
  position: fixed; left: 50%; top: 40%; transform: translate(-50%, -50%); z-index: 60; display: none; flex-direction: column; align-items: center; gap: 8px;
  padding: 18px 26px; background: rgba(10,13,17,.92); border: 1px solid var(--line-strong); border-radius: 4px;
}
.slate.is-on { display: flex; }
/* シート */
.sheet { position: fixed; inset: 0; z-index: 70; display: none; align-items: flex-end; justify-content: center; background: rgba(0,0,0,.55); }
.sheet.is-open { display: flex; }
.sheet__box { width: 100%; max-width: 560px; background: var(--surface-1); border: 1px solid var(--line-strong); border-radius: 6px 6px 0 0; padding-bottom: env(safe-area-inset-bottom); }
@media (min-width: 720px) { .sheet { align-items: center; } .sheet__box { border-radius: 6px; } }
.sheet__hd { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.sheet__body { padding: 16px; }
.keys { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; align-items: center; font-size: 13px; color: var(--text-2); }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.keypad button {
  height: 56px; background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: 3px; color: var(--text);
  font-family: var(--font-mono); font-size: 20px; cursor: pointer;
}
.keypad button:active { background: var(--line); }
.roomsheet { display: flex; flex-direction: column; gap: 6px; }
.roomsheet button {
  display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 12px; background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 3px; color: var(--text); font-family: inherit; font-size: 14px; cursor: pointer; text-align: left;
}
.roomsheet .who { margin-left: auto; font-size: 11px; color: var(--text-dim); }

/* SEO 静的テキスト */
.seo { padding: 28px 16px; border-top: 1px solid var(--line); }
.seo h2 { font-size: 20px; font-weight: 650; line-height: 1.35; letter-spacing: -0.01em; }
.seo h2 .dim { color: var(--text-muted); font-weight: 500; }
.seo p { margin-top: 10px; max-width: 760px; font-size: 14px; color: var(--text-2); line-height: 1.8; }
.seo__index { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.seo__index .chip .num { color: var(--text-dim); font-size: 11px; }

/* --- タブレット / PC ----------------------------------------------------- */
@media (min-width: 720px) {
  .console__body { display: grid; grid-template-columns: minmax(0, 1fr); }
  .tally { grid-template-columns: 150px minmax(0, 1fr) 150px; align-items: center; }
  .tally__side { display: flex; }
  .rail__b .who { display: inline; font-size: 10.5px; color: var(--text-deco); }
}
@media (min-width: 1200px) {
  .console__body { grid-template-columns: 96px minmax(0, 1fr) 372px; height: calc(100vh - 56px - 28px - 28px); min-height: 640px; }
  .rail { flex-direction: column; gap: 0; padding: 8px 0 0; border-bottom: 0; border-right: 1px solid var(--line); background: var(--surface-1); overflow: hidden; }
  .rail__lbl { padding: 6px 12px 8px; }
  .rail__b {
    flex-direction: column; align-items: flex-start; gap: 3px; height: auto; padding: 10px 8px 10px 10px; border: 0; border-left: 2px solid transparent; border-radius: 0; white-space: normal;
  }
  .rail__b .top { display: flex; align-items: center; gap: 6px; }
  .rail__b .nm { font-size: 13px; font-weight: 600; }
  .rail__b .who { font-size: 10px; line-height: 1.3; }
  .rail__b[aria-pressed="true"] { border-left-color: var(--accent); background: var(--surface-2); }
  .stage { padding: 16px 16px 12px; overflow-y: auto; }
  .screen { position: static; }
  .tally { margin: 0; }
  .desk, .quick { padding: 0; }
  .desk__cards { flex-wrap: wrap; overflow: visible; }
  .desk__card { flex: 1 1 200px; }
  .guide { border-top: 0; border-left: 1px solid var(--line); overflow: hidden; }
  .guide__list { overflow-y: auto; flex: 1; }
  .row { min-height: 40px; }
  .seo { padding: 32px 24px; }
}

/* --- 下層ページ（番組表 / この放送局について） --------------------------- */
.hero { padding: 36px 16px 20px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 12px; }
.hero h1 { font-size: clamp(30px, 5vw, 52px); line-height: 1.08; letter-spacing: -0.02em; font-weight: 650; }
.hero h1 .dim { color: var(--text-muted); }
.hero p { max-width: 720px; font-size: 15px; color: var(--text-muted); line-height: 1.75; }
.hero__search {
  display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 14px; max-width: 760px; border: 1px solid var(--line-strong); border-radius: 3px; background: var(--surface-1);
}
.hero__search input { flex: 1; min-width: 0; background: transparent; border: 0; outline: 0; color: var(--text); font-size: 15px; font-family: inherit; }
.hero__search input::placeholder { color: var(--text-dim); }
.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.filters .chip { min-height: 28px; font-size: 11.5px; padding: 0 9px; }
@media (min-width: 768px) { .hero { padding: 44px 24px 24px; } }

.bands { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 24px; padding: 8px 0 24px; }
@media (min-width: 900px) { .bands { grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 16px 24px 32px; } }
.bands section { display: flex; flex-direction: column; }
.g {
  display: grid; grid-template-columns: 36px 28px minmax(0, 1fr) auto 22px; align-items: center; gap: 8px; min-height: 48px; padding: 6px 14px 6px 12px;
  border-bottom: 1px solid var(--line-soft); border-left: 2px solid transparent;
}
.g.is-dormant { opacity: .55; }
.g .g__ch { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 13px; color: var(--text-dim); text-decoration: none; }
.g .g__nm { color: var(--text); text-decoration: none; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g .g__nm:hover { color: var(--accent); }
.g .g__ext { color: var(--text-dim); text-decoration: none; text-align: right; font-size: 13px; }
.g .g__vn { grid-column: 2 / 6; font-size: 11.5px; color: var(--text-dim); line-height: 1.5; }
.g .g__faces { display: flex; gap: 6px; grid-column: 2 / 6; }
.g .g__faces a { font-family: var(--font-mono); font-size: 10.5px; color: var(--text-dim); text-decoration: none; border: 1px solid var(--line); border-radius: 2px; padding: 1px 6px; }
.g .g__faces a:hover { color: var(--text); border-color: var(--line-strong); }
.g[hidden] { display: none; }
.bandhd { padding: 12px 14px 6px 12px; }
.foot-note { padding: 12px 16px 24px; font-size: 12px; color: var(--text-dim); border-top: 1px solid var(--line); }
@media (min-width: 768px) { .foot-note { padding: 12px 24px 24px; } }

.about { max-width: 1100px; padding: 8px 16px 24px; }
@media (min-width: 768px) { .about { padding: 16px 24px 32px; } }
.sec { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px 32px; padding: 24px 0; border-top: 1px solid var(--line); }
@media (min-width: 900px) { .sec { grid-template-columns: 280px minmax(0, 1fr); padding: 28px 0; } }
.sec__hd { display: flex; flex-direction: column; gap: 6px; }
.sec__hd h2 { font-size: 20px; font-weight: 650; line-height: 1.3; }
.sec__body { font-size: 14.5px; color: var(--text-2); line-height: 1.85; max-width: 760px; display: flex; flex-direction: column; gap: 12px; }
.sec__body p { margin: 0; }
.sec__body blockquote { margin: 0; padding: 10px 14px; border-left: 2px solid var(--accent); background: var(--surface-1); font-size: 13.5px; color: var(--text); }
.sec__body cite { display: block; margin-top: 6px; font-size: 11.5px; color: var(--text-dim); font-style: normal; font-family: var(--font-mono); }
.steps { display: flex; flex-direction: column; gap: 14px; }
.steps > div { display: flex; gap: 14px; }
.steps .n { flex: 0 0 28px; font-family: var(--font-mono); color: var(--accent); font-size: 13px; padding-top: 3px; }
.nots { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px 24px; font-size: 13.5px; }
@media (min-width: 720px) { .nots { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.sec__body table { border-collapse: collapse; font-size: 13px; }
.sec__body th, .sec__body td { text-align: left; padding: 6px 12px 6px 0; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.sec__body th { color: var(--text-dim); font-weight: 500; white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
  .dot--live { animation: none; }
  .hint { transition: none; }
}
