:root {
  --bg: #FFFFFF;
  --text: #2C2C2A;
  --muted: #5F5E5A;
  --line: #B5D4F4;
  --dot: #D3D1C7;
  --today: #378ADD;
  --now: #E24B4A;
  --hour: 32px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic UI", "Meiryo", system-ui, sans-serif;
  line-height: 1.6;
}
a { color: #185FA5; }

.hd { padding: 14px 12px 6px; max-width: 980px; margin: 0 auto; }
.hd h1 { font-size: 20px; margin: 0; }
.unofficial {
  display: inline-block; margin-left: 8px; padding: 0 8px; font-size: 11px; font-weight: 600;
  border: 1px solid var(--muted); border-radius: 10px; color: var(--muted); vertical-align: middle;
}
.sub { margin: 2px 0 0; font-size: 12px; color: var(--muted); }

.wrap { max-width: 980px; margin: 0 auto; padding: 8px 4px 24px; }

/* カウントダウン */
.cd {
  margin: 8px 8px 12px; padding: 12px 14px; border-radius: 10px;
  background: #F1EFE8; color: #444441; text-align: center;
}
.cd-label { font-size: 12px; opacity: .85; }
.cd-main { font-size: 26px; font-weight: 700; line-height: 1.3; }
.cd-sub { font-size: 13px; }

/* 週の切り替え */
.weekbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 4px 8px 8px; }
.weeklabel { font-size: 15px; font-weight: 600; }
.btn {
  font: inherit; font-size: 14px; cursor: pointer; text-decoration: none; display: inline-block;
  padding: 6px 14px; border-radius: 18px; background: #fff; color: #185FA5; border: 1px solid #378ADD;
}
.btn:hover { background: #E6F1FB; }
.btn-primary { background: #378ADD; color: #fff; }
.btn-primary:hover { background: #185FA5; }
:focus-visible { outline: 2px solid #185FA5; outline-offset: 1px; }

.msg { margin: 24px 12px; text-align: center; color: var(--muted); }
.msg strong { display: block; font-size: 16px; color: var(--text); margin-bottom: 4px; }

/* 番組表 */
.tt-wrap { position: relative; }
.tt-head { display: grid; grid-template-columns: 30px repeat(7, 1fr); }
.tt-head div {
  text-align: center; font-size: 11px; line-height: 1.3; padding: 3px 0; color: var(--text);
  border-bottom: 1px solid var(--line);
}
.tt-head .today { color: #fff; background: var(--today); border-radius: 6px 6px 0 0; font-weight: 700; }
.tt-body { position: relative; }
.hline { position: absolute; left: 30px; right: 0; border-top: .5px solid var(--line); height: 0; }
.hlabel {
  position: absolute; left: 0; width: 28px; text-align: right; font-size: 10px; line-height: 12px;
  color: var(--muted); transform: translateY(-6px);
}
.cols { position: absolute; left: 30px; right: 0; top: 0; bottom: 0; display: grid; grid-template-columns: repeat(7, 1fr); }
.col { position: relative; border-left: 1px dotted var(--dot); }
.col:last-child { border-right: 1px dotted var(--dot); }

.blk {
  position: absolute; left: 1px; right: 1px; margin: 0; padding: 2px 1px; overflow: hidden;
  border: 1px solid transparent; border-radius: 4px; cursor: pointer;
  font: inherit; font-size: 11px; line-height: 1.25; letter-spacing: -0.03em;
  text-align: left; overflow-wrap: break-word;
}
.blk .t { display: block; font-weight: 700; }
.blk .k { display: block; }
.blk .k.tent { font-size: 11px; }
.blk.tentative { background: transparent !important; border: 1.5px dotted currentColor; }
.blk.past { background: #D3D1C7 !important; color: #5F5E5A !important; border-color: transparent; }
.blk.past.tentative { background: transparent !important; border: 1.5px dotted #B4B2A9; }
.blk.rest {
  background: transparent; color: var(--muted); border: 1.5px dotted #B4B2A9;
  text-align: center;
}
.blk.rest .t { font-weight: 600; }

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

/* 吹き出し */
.tip {
  position: absolute; z-index: 20; width: 250px; max-width: calc(100vw - 16px); padding: 10px 12px;
  background: #fff; color: var(--text); border: 1px solid #B4B2A9; border-radius: 8px;
  box-shadow: 0 4px 14px rgba(0,0,0,.18); font-size: 13px;
}
.tip[hidden] { display: none; }
.tip .when { font-size: 12px; color: var(--muted); }
.tip .badges { margin: 4px 0; }
.tip .badge { display: inline-block; padding: 0 8px; margin-right: 4px; border-radius: 10px; font-size: 12px; font-weight: 600; }
.tip .badge.asa { background: #FAEEDA; color: #633806; }
.tip .badge.kari { background: #fff; border: 1px dotted #5F5E5A; color: #444441; }
.tip .ttl { font-weight: 600; margin: 2px 0 8px; word-break: break-word; }
.tip .none { font-size: 12px; color: var(--muted); }
.tip .btn { font-size: 13px; padding: 4px 12px; }

/* 購読 */
.sub-area { text-align: center; margin: 18px 8px 0; }
.sub-area[hidden] { display: none; }
.note { font-size: 11px; color: var(--muted); margin: 4px 0 0; }

/* フッター */
.ft { border-top: 1px solid var(--dot); padding: 14px 12px 28px; max-width: 980px; margin: 0 auto; font-size: 12px; color: var(--muted); }
.ft .links { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 8px 0; }
.ft p { margin: 4px 0; }

@media (min-width: 700px) {
  .hd { padding-top: 22px; }
  .hd h1 { font-size: 24px; }
  .blk { font-size: 13px; letter-spacing: 0; padding: 3px 5px; left: 3px; right: 3px; }
  .tt-head div { font-size: 13px; }
  .hlabel { font-size: 11px; }
  .cd-main { font-size: 32px; }
}
