/* ============================================================
   リレーページのレイアウト
   ============================================================ */
.app {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 18px;
  max-width: 1320px;
  margin: 0 auto;
  padding: 16px;
}

/* ---------- サイドバー ---------- */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}
.brand-logo {
  display: block;
  width: 100%;
  max-height: 220px;
  object-fit: contain;
}
.side-top { display: flex; gap: 10px; align-items: flex-start; }

/* タイトル（縦書き） */
.brand {
  writing-mode: vertical-rl;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 420px;
  padding: 4px 0;
}
.brand-main { display: flex; align-items: center; gap: 12px; }
.brand-title {
  margin: 0;
  font-family: var(--font-disp);
  font-size: 32px;
  font-weight: var(--title-weight);
  letter-spacing: .04em;
  line-height: 1.15;
  color: var(--title-color);
  text-shadow: var(--title-shadow);
}
.brand-badge { padding: 6px 0; }
.brand-sub { margin: 0; font-size: 12px; letter-spacing: .08em; color: var(--text-sub); }
.logo-only .brand-main { display: none; }

/* 次の配信まで */
.countdown {
  position: relative;
  writing-mode: vertical-rl;
  flex: 1;
  min-height: 380px;
  max-height: 88vh;
  padding: 14px 10px;
  color: var(--accent-text);
  background: var(--accent-bg);
  border: var(--bw) solid var(--win-line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.countdown-label { font-family: var(--font-disp); font-size: 13px; letter-spacing: .06em; opacity: .9; }
.countdown-label::before { content: "＼"; }
.countdown-main {
  font-family: var(--font-disp);
  font-size: 30px;
  font-weight: var(--title-weight);
  line-height: 1.15;
  letter-spacing: .03em;
}
.countdown-detail { font-size: 13px; letter-spacing: .05em; }
.countdown .tcy { text-combine-upright: all; }
.countdown-link {
  position: absolute;
  inset: 0;
  border-radius: inherit;
}
.countdown-link:hover { background: rgba(255, 255, 255, .18); }

/* リンクボタン */
.side-links { display: flex; flex-direction: column; gap: 8px; }
.side-links:empty { display: none; }
.side-links .btn { width: 100%; }

/* ---------- メイン ---------- */
.main { min-width: 0; display: flex; flex-direction: column; }
.tab-panel:not(.is-active) { display: none; }
.message-box { margin-top: 16px; }

/* ---------- タイムテーブル ---------- */
.tt-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.tt-range { font-family: var(--font-disp); font-size: 17px; }

.timetable-scroll {
  max-height: 72vh;
  overflow: auto;
  background: var(--grid-bg);
  border: 1px solid var(--grid-line);
  border-radius: var(--radius-sm);
}
.timetable { --gutter: 52px; min-width: calc(var(--gutter) + var(--cols) * 130px); }
.tt-head, .tt-body { display: grid; grid-template-columns: var(--gutter) repeat(var(--cols), minmax(130px, 1fr)); }
.tt-head {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--grid-bg);
  border-bottom: var(--bw) solid var(--win-line);
}
.tt-day-head { padding: 5px 4px; text-align: center; font-family: var(--font-disp); font-size: 14px; white-space: nowrap; }
.tt-day-head.is-today { color: var(--today-text); background: var(--today-bg); }

.tt-body {
  position: relative;
  height: var(--body-h);
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(var(--grid-line-half) 1px, transparent 1px);
  background-size: 100% var(--hh), 100% calc(var(--hh) / 2);
}
.tt-gutter { position: relative; }
.tt-hour {
  position: absolute;
  right: 6px;
  font-family: var(--font-disp);
  font-size: 12px;
  color: var(--text-sub);
  transform: translateY(-1px);
  font-variant-numeric: tabular-nums;
}
.tt-col { position: relative; border-left: 1px dotted var(--grid-line); }

.slot {
  position: absolute;
  left: 4px;
  right: 4px;
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding: 4px 6px;
  overflow: hidden;
  text-decoration: none;
  color: var(--block-text);
  background: var(--block-bg);
  border: 1px solid var(--slot-line);
  border-radius: calc(var(--radius-sm) * .6);
  box-shadow: var(--slot-shadow);
}
a.slot:hover { filter: brightness(1.04) saturate(1.1); z-index: 2; }
.slot.is-past { filter: grayscale(.85); opacity: .55; }
.slot.is-onair { color: var(--onair-text); background: var(--onair-bg); border-width: 2px; z-index: 3; }
.slot-text { min-width: 0; }
.slot-time { display: block; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.slot-name { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.onair-tag {
  display: inline-block;
  margin-left: 4px;
  padding: 0 5px;
  font-size: 10px;
  line-height: 16px;
  font-weight: 700;
  color: #fff;
  background: var(--nowline);
  border-radius: 3px;
  vertical-align: 1px;
}
.slot:not(.is-onair) .onair-tag,
.member-slots li:not(.is-onair) .onair-tag { display: none; }

.now-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--nowline);
  z-index: 4;
  pointer-events: none;
}
.now-line::before {
  content: "";
  position: absolute;
  left: -4px;
  top: -3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--nowline);
}

/* ---------- アイコン ---------- */
.avatar {
  flex: none;
  width: var(--size, 28px);
  height: var(--size, 28px);
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--slot-line);
  background: var(--panel-bg);
}
.avatar-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: calc(var(--size, 28px) * .45);
  background: hsl(var(--hue) 42% 58%);
}

/* ---------- メンバー ---------- */
.member-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.member-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 12px 14px;
  text-align: center;
  background: var(--card-bg);
  border: var(--bw) solid var(--win-line);
  border-radius: var(--radius);
  box-shadow: var(--slot-shadow);
}
.member-card.is-onair { outline: 3px solid var(--accent-bg); outline-offset: -1px; }
.member-name { margin: 0; font-family: var(--font-disp); font-size: 17px; font-weight: var(--title-weight); }
.member-slots { margin: 0; padding: 0; list-style: none; font-size: 13px; color: var(--text-sub); font-variant-numeric: tabular-nums; }
.member-slots li.is-onair { color: var(--text); font-weight: 700; }
.member-slots li.is-past { opacity: .55; }
.member-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 4px; }

/* ---------- 発信する ---------- */
.share-body { display: flex; flex-direction: column; gap: 14px; max-width: 640px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field-label { font-family: var(--font-disp); font-size: 13px; color: var(--text-sub); }
.share-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.share-msg { font-size: 13px; }

.empty-msg { padding: 24px; text-align: center; color: var(--text-sub); }

.site-footer { padding: 8px 16px 28px; text-align: center; font-size: 12px; color: var(--text-sub); }
.site-footer a { color: inherit; }

/* ---------- スマホ ---------- */
@media (max-width: 760px) {
  .app { grid-template-columns: minmax(0, 1fr); padding: 12px 16px; gap: 12px; }
  .brand-logo { max-height: 140px; }
  .side-top { flex-direction: column; align-items: stretch; }
  .brand { writing-mode: horizontal-tb; max-height: none; gap: 2px; }
  .brand-badge { padding: 0 8px; }
  .brand-title { font-size: 26px; }
  .countdown { writing-mode: horizontal-tb; min-height: 0; padding: 10px 14px; }
  .countdown-main { font-size: 24px; }
  .side-links { flex-direction: row; flex-wrap: wrap; gap: 6px; }
  .side-links .btn { width: auto; flex: 1 1 auto; min-height: 34px; font-size: 13px; }
  .tab { padding: 7px 12px 6px; font-size: 14px; }
  .window-body { padding: 8px; }
  .tt-range { font-size: 14px; }
  .timetable { --gutter: 44px; }
  .slot { padding: 3px 5px; }
  .slot .avatar { display: none; }
  .slot-time { font-size: 11px; white-space: nowrap; }
  .slot .onair-tag { position: absolute; right: 3px; bottom: 3px; margin: 0; }
}
