/* ON AIR 화면 스타일: 휴대폰 먼저, 밝은·어두운 화면 모두
   색: 짙은 파랑(방송국 편성표) + 호박색 불(지금·생방송). 숫자(시각·길이)는 고정폭 숫자
   크기 단계: 글 12·13·14·15·16·18·22 / 둥글기 8·12·16 / 간격 4의 배수 */
:root {
  --bg: #f2f4f7;
  --card: #ffffff;
  --sunk: #f6f7f9;
  --line: #e1e5ea;
  --text: #121821;
  --dim: #535f6c;
  --faint: #687380;
  --accent: #1d5ca8;
  --accent-text: #ffffff;
  --accent-soft: #e6eef9;
  --lamp: #c47f00;
  --lamp-strong: #e0a100;
  --lamp-soft: #fbf0d4;
  --lamp-text: #8f5c00;
  --good: #1d7a4c;
  --good-soft: #e2f3e9;
  --warn: #9a5b00;
  --warn-soft: #fff1dc;
  --bad: #b42318;
  --bad-soft: #fdecea;
  --screen: #0b1420;
  --screen-2: #17304f;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 2px 8px rgba(16, 24, 40, .05);
  --shadow-lift: 0 6px 24px rgba(16, 24, 40, .12);
  --radius: 16px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1218;
    --card: #161d26;
    --sunk: #111820;
    --line: #26313d;
    --text: #e8edf2;
    --dim: #a3afbb;
    --faint: #75818e;
    --accent: #7db0f0;
    --accent-text: #0c1219;
    --accent-soft: #19283b;
    --lamp: #f0b73a;
    --lamp-strong: #f5c351;
    --lamp-soft: #362b12;
    --lamp-text: #f0b73a;
    --good: #67d29c;
    --good-soft: #13281e;
    --warn: #f0b660;
    --warn-soft: #2d2414;
    --bad: #ff8a80;
    --bad-soft: #321a19;
    --screen: #070c12;
    --screen-2: #13263f;
    --shadow: none;
    --shadow-lift: 0 8px 28px rgba(0, 0, 0, .45);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
/* 문서는 튕기지도 스크롤되지도 않는다. 가운데 내용 칸만 움직인다 (모든 서비스 공통 규칙 /srv/infra/shared/UX.md '1. 화면 틀') */
html, body { overscroll-behavior: none; }
/* 누르는 것은 두 번 눌러도 확대되지 않게 (UX.md '7. 터치') */
a, button, summary, label, input, select { touch-action: manipulation; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard", "Malgun Gothic", "Noto Sans KR", system-ui, sans-serif;
  word-break: keep-all; overflow-wrap: anywhere; letter-spacing: -.005em;
}
[hidden] { display: none !important; }
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.3; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 18px; }
p { margin: 0; }
small, .small { font-size: 13px; }
.muted { color: var(--dim); }
.faint { color: var(--faint); }
.mono, .t, .dur, time { font-variant-numeric: tabular-nums; }
.sr-only { position: fixed; top: 0; left: 0; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; } /* fixed: 위치를 잡을 부모가 없어도 문서를 늘리지 않게 (UX.md 1) */
.ic { flex: none; display: block; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ic-play { fill: currentColor; stroke-width: 1.5; }
.top-spacer { flex: 1; }

/* ---- 머리줄 ---- */
.top {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 8px;
  padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top));
  padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right));
  background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; }
.brand-text { display: grid; line-height: 1.15; font-weight: 800; font-size: 17px; letter-spacing: .05em; }
.brand-text small { font-size: 12px; font-weight: 500; letter-spacing: 0; color: var(--dim); }
.brand-text small:empty { display: none; }
.brand-mark { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: linear-gradient(145deg, #2f74c8, #1d5ca8); flex: none; }
.brand-mark::after { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--lamp-strong); box-shadow: 0 0 0 3px color-mix(in srgb, var(--lamp-strong) 35%, transparent); }
.count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 4px; border-radius: 9px; background: var(--bad); color: #fff; font-size: 11px; font-weight: 700; }
.acct .ic { display: none; }

main { max-width: 820px; margin: 0 auto; padding: 16px 16px 48px; padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }

/* ---- 메뉴 탭: PC는 머리줄, 휴대폰은 화면 아래 ---- */
.nav { display: flex; gap: 4px; margin: 0 auto 0 16px; }
.nav a {
  display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 0 14px; border-radius: 10px;
  color: var(--dim); text-decoration: none; font-weight: 600; font-size: 15px; transition: background .15s, color .15s;
}
.nav a .ic { width: 18px; height: 18px; }
@media (hover: hover) { .nav a:hover { color: var(--text); background: var(--accent-soft); } } /* 터치 화면에서 눌린 배경이 남지 않게 */
.nav a.on { color: var(--accent); background: var(--accent-soft); }
/* 휴대폰 아래 탭: 고른 탭은 아이콘 뒤에 둥근 띠 (글자 색만으로는 잘 안 보였음, 2026-11-11. golf·play와 같은 모양).
   가로 옆 메뉴일 때(가로 조건)만 빼고 아래 탭이 있는 모든 경우. 띠 높이만큼 탭 안 위아래 여백을 줄여 탭 막대 높이는 그대로 */
@media (max-width: 719px) and (orientation: portrait), (max-width: 559px), (max-width: 719px) and (min-height: 521px) {
  .nav a { -webkit-tap-highlight-color: transparent; }
  #nav a { padding: 2px 0 0; }
  .nav a .ic { box-sizing: content-box; padding: 4px 17px; border-radius: 999px; transition: background-color .15s, transform .2s var(--ease); }
  .nav a.on .ic { background: var(--accent-soft); }
  .nav a.on { font-weight: 700; }
}
@media (max-width: 719px) {
  .nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; margin: 0; gap: 0; justify-content: space-around;
    padding: 4px 8px max(6px, env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--card) 92%, transparent);
    backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
    border-top: 1px solid var(--line);
  }
  .nav a { flex: 1; flex-direction: column; gap: 3px; min-height: 54px; padding: 6px 0 2px; font-size: 11.5px; border-radius: 12px; justify-content: center; }
  .nav a .ic { width: 23px; height: 23px; transition: transform .2s var(--ease); }
  .nav a.on { background: none; } /* ux-ok: 고른 표시는 아이콘 뒤 띠(.on .ic) */
  .nav a.on .ic { transform: translateY(-1px); }
  .main-page main { padding-bottom: calc(100px + env(safe-area-inset-bottom)); }
  /* 머리줄에 흐림(backdrop-filter)을 주면 그 안의 아래 탭(position: fixed)이 머리줄에 붙어 버린다 → 휴대폰에선 끔 */
  .main-page .top { background: color-mix(in srgb, var(--bg) 96%, transparent); backdrop-filter: none; -webkit-backdrop-filter: none; }
}
/* 화면 틀 (UX.md '1. 화면 틀'): 머리줄 + 가운데 내용 칸(main, 여기만 스크롤하고 끝에서 튕김) + 아래 탭. 세로·가로·PC 모든 폭, 메인·로그인 모두 같다
   문서(window)는 스크롤되지 않는다. 맨 위로 올리기는 common.js toTop()이 이 칸을 올린다. 관리 화면 틀은 kit(body.ak)이 그린다
   내용 칸이 화면 폭을 다 쓰고(스크롤 막대가 화면 오른쪽 끝에) 안쪽 여백으로 글 폭(--mw)을 가운데에 맞춘다 */
body.main-page, body.login-page { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
.main-page .top { position: relative; flex: none; }
.main-page main, .login-page main {
  flex: 1; min-height: 0; width: 100%; max-width: none; margin: 0; overflow-y: auto; overscroll-behavior-y: contain; -webkit-overflow-scrolling: touch;
  padding-left: calc(max(0px, (100% - var(--mw, 820px)) / 2) + max(16px, env(safe-area-inset-left)));
  padding-right: calc(max(0px, (100% - var(--mw, 820px)) / 2) + max(16px, env(safe-area-inset-right)));
}
@media (max-width: 520px) {
  .acct { width: 44px; height: 44px; padding: 0; }
  .acct .ic { display: block; }
  .acct-text { display: none; }
}

/* ---- 카드·양식·버튼 ---- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.form { display: grid; gap: 14px; }
label { display: grid; gap: 4px; font-size: 14px; font-weight: 600; }
label small { font-weight: 400; color: var(--faint); }
/* 비밀번호 보기 단추: label 밖에 두어 칸 이름이 '비밀번호'로만 읽히게 (golf와 같게) */
.pw-field { display: grid; gap: 4px; font-size: 14px; font-weight: 600; }
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 72px; }
.pw-eye { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); min-width: 60px; min-height: 44px; border: 0; border-radius: 10px; background: transparent; color: var(--accent); font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
input, select, textarea {
  font: inherit; width: 100%; min-height: 44px; padding: 10px 12px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--sunk); color: var(--text); transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); outline: none; }
/* 아이폰 Safari: 날짜·시간 칸은 자기 너비를 고집해 좁은 화면에서 글자가 잘리고("5:30:00 A"), 빈 칸은 높이가 달라진다 (kit.css와 같은 처리) */
input:is([type="date"], [type="time"], [type="datetime-local"], [type="month"]) {
  -webkit-appearance: none; appearance: none; display: block; min-width: 0; max-width: 100%; height: 44px; line-height: normal;
}
input::-webkit-date-and-time-value { text-align: left; min-height: 1.4em; }
/* 아이폰은 16px보다 작은 입력칸을 누르면 화면을 확대한다 (label의 14px를 물려받지 않게). 터치 기기면 폭과 상관없이 (UX.md '6. 입력칸') */
@media (pointer: coarse) { input, select, textarea { font-size: 16px; } }
input[type="checkbox"] { width: 20px; height: 20px; min-height: 0; padding: 0; margin: 0 6px 0 0; vertical-align: -4px; accent-color: var(--accent); box-shadow: none; }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 16px;
  border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--text);
  font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: transform .12s var(--ease), background .15s, border-color .15s, filter .15s;
}
button.btn:active:not(:disabled) { transform: scale(.97); } /* 링크(a.btn)는 누르는 순간 모양을 바꾸지 않는다 (UX.md 7) */
.btn:disabled { opacity: .55; cursor: default; }
.btn.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.btn.ghost { background: transparent; }
.btn.small { min-height: 40px; padding: 0 13px; font-size: 14px; border-radius: 10px; }
.btn.wide { width: 100%; }
.btn.danger { color: var(--bad); }
@media (hover: hover) { /* 손가락으로 누른 뒤 모양이 남지 않게 (UX.md 7) */
  .btn.primary:hover:not(:disabled) { filter: brightness(1.08); }
  .btn:not(.primary):hover:not(:disabled) { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
}
.btn.on { border-color: var(--good); color: var(--good); background: var(--good-soft); }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.iconbtn { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--sunk); color: var(--dim); cursor: pointer; }
@media (hover: hover) { .iconbtn:hover { color: var(--text); } }
.linkbtn { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; border: 0; background: none; padding: 0 4px; font: inherit; font-size: 14px; font-weight: 600; color: var(--accent); cursor: pointer; text-decoration: none; white-space: nowrap; }
.linkbtn .ic { width: 16px; height: 16px; }
.msg { margin: 0; font-size: 14px; color: var(--bad); }
.msg:empty { display: none; }
.notice { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 12px 14px; border-radius: 12px; font-size: 14px; background: var(--accent-soft); color: var(--text); }
.notice > span { flex: 1 1 200px; }
.notice.warn { background: var(--warn-soft); color: var(--warn); }
.notice.bad { background: var(--bad-soft); color: var(--bad); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.chip {
  display: inline-flex; align-items: center; gap: 4px; font-size: 13px; line-height: 1; padding: 6px 9px; border-radius: 999px;
  background: var(--sunk); color: var(--dim); border: 1px solid var(--line); font-weight: 500; white-space: nowrap;
}
.chip.ok { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.chip.good { background: var(--good-soft); color: var(--good); border-color: transparent; }
.chip.lamp { background: var(--lamp-soft); color: var(--lamp-text); border-color: transparent; }
.chip.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.chip.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.chip.no { color: var(--faint); background: transparent; }
.cand.chosen .chip.ok { background: var(--card); }
.section-head { display: flex; align-items: baseline; gap: 8px; margin: 28px 4px 12px; }
.section-head h2 { margin-right: auto; font-size: 17px; }
.section-head.first { margin-top: 4px; }

/* 켜고 끄는 스위치 (button role=switch) */
.switch { flex: none; position: relative; width: 52px; height: 32px; border-radius: 999px; border: 0; padding: 0; cursor: pointer; background: color-mix(in srgb, var(--faint) 45%, transparent); transition: background .2s var(--ease); }
.switch i { position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s var(--ease); }
.switch[aria-checked="true"] { background: var(--good); }
.switch[aria-checked="true"] i { transform: translateX(20px); }
.switch.sm { width: 44px; height: 26px; }
.switch.sm i { width: 20px; height: 20px; }
.switch.sm[aria-checked="true"] i { transform: translateX(18px); }
.switch:disabled { opacity: .6; }

/* 상태 글 (편성표 줄·맨 위): 점 + 글 */
.st { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--dim); white-space: nowrap; }
.st .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.st.new { color: var(--good); }
.st.live { color: var(--lamp-text); }
.st.done { color: var(--faint); }
.st.wait { color: var(--faint); }
.st.wait .dot { background: transparent; box-shadow: inset 0 0 0 1.5px currentColor; }

/* 썸네일 + 길이 + 이어 보기 막대 */
.tb { position: relative; display: block; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: var(--line); flex: none; }
.tb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tb .dur, .tb .live-badge { position: absolute; right: 5px; bottom: 5px; background: rgba(0, 0, 0, .78); color: #fff; font-size: 11.5px; font-weight: 600; padding: 1px 5px; border-radius: 5px; line-height: 1.5; }
.tb .live-badge { background: #d93025; }
.tb .bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255, 255, 255, .35); }
.tb .bar i { display: block; height: 100%; background: var(--lamp-strong); }
.tb .bar.done i { background: rgba(255, 255, 255, .85); }
.tb.none { display: grid; place-items: center; color: var(--accent); background: var(--accent-soft); }

/* ---- 지금 칸 (맨 위 카드) ---- */
.now { display: grid; padding: 0; overflow: hidden; }
.now .pad { display: grid; gap: 10px; padding: 14px 16px 16px; }
.now .pad, .now .media > * { animation: fade .2s var(--ease); }
@keyframes fade { from { opacity: 0; } }
.load-err { display: grid; justify-items: center; gap: 8px; padding: 28px 18px; text-align: center; color: var(--dim); }
.media { background: #000; }
.player { position: relative; aspect-ratio: 16 / 9; max-width: 100%; overflow: hidden; background: #000; }
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; }
.player-wrap { display: grid; }
.player-note { margin: 0; padding: 10px 16px; font-size: 14px; color: var(--warn); background: var(--warn-soft); }
.player-note a { color: inherit; font-weight: 700; }
.poster { position: relative; display: block; width: 100%; border: 0; padding: 0; background: #000; cursor: pointer; }
.poster .tb { border-radius: 0; }
.poster .play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 68px; height: 68px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: rgba(0, 0, 0, .55); backdrop-filter: blur(4px); transition: transform .2s var(--ease), background .2s; }
.poster .play .ic { margin-left: 4px; }
@media (hover: hover) { .poster:hover .play { background: var(--accent); transform: translate(-50%, -50%) scale(1.06); } }
.poster .again { position: absolute; left: 12px; top: 12px; padding: 4px 10px; border-radius: 999px; background: rgba(0, 0, 0, .65); color: #fff; font-size: 13px; font-weight: 600; }
.now-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.now-head .st { margin-left: auto; }
.now-label { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--dim); letter-spacing: .01em; }
.now-label i { width: 9px; height: 9px; border-radius: 50%; background: var(--lamp-strong); box-shadow: 0 0 0 3px var(--lamp-soft); }
.now-label.past i { background: var(--faint); box-shadow: 0 0 0 3px var(--line); }
.now-title { font-size: 18px; font-weight: 700; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.now-title:focus { outline: none; }
.why li { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.now-meta { font-size: 13.5px; color: var(--dim); font-variant-numeric: tabular-nums; }
.why { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.why li { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 500; color: var(--accent); background: var(--accent-soft); border-radius: 999px; padding: 4px 9px 4px 7px; }
.why li.mine { color: var(--lamp-text); background: var(--lamp-soft); padding-left: 9px; }
.why li.warn { color: var(--warn); background: var(--warn-soft); padding-left: 9px; }
/* 알약 버튼 줄: 한 줄로, 넘치면 옆으로 밀기 */
.actbar { display: flex; gap: 8px; overflow-x: auto; margin: 2px -16px 0; padding: 2px 16px 2px; scrollbar-width: none; overscroll-behavior-x: contain;
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 18px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 18px), transparent); }
.actbar::-webkit-scrollbar { display: none; }
.act {
  flex: none; display: inline-flex; align-items: center; gap: 6px; height: 44px; padding: 0 16px 0 13px; border-radius: 999px;
  border: 0; background: var(--sunk); color: var(--text); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap;
  box-shadow: inset 0 0 0 1px var(--line); transition: transform .12s var(--ease), background .15s;
}
@media (hover: hover) { .act:hover { background: color-mix(in srgb, var(--accent-soft) 60%, var(--sunk)); } }
button.act:active { transform: scale(.96); }
.act:disabled { opacity: .55; }
.act .ic { color: var(--dim); }
.act.on { background: var(--accent-soft); color: var(--accent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent); }
.act.on .ic { color: currentColor; }
.act.on.good { background: var(--good-soft); color: var(--good); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--good) 35%, transparent); }
.act.speed { font-variant-numeric: tabular-nums; }
.act.round { width: 44px; padding: 0; justify-content: center; }
.act.back { background: var(--accent); color: var(--accent-text); box-shadow: none; }
.act.back .ic { color: currentColor; }

/* 대기 화면 (영상이 아직일 때 플레이어 자리) */
.screen {
  position: relative; aspect-ratio: 16 / 9; display: grid; place-items: center; overflow: hidden; color: #e9f0f7;
  background: radial-gradient(120% 90% at 20% 0%, var(--screen-2), var(--screen) 70%);
}
.screen::after { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(0deg, rgba(255, 255, 255, .025) 0 1px, transparent 1px 3px); pointer-events: none; }
.screen-in { display: grid; justify-items: center; gap: 6px; text-align: center; padding: 16px; z-index: 1; }
.screen-in .big { font-size: clamp(34px, 9vw, 54px); font-weight: 800; letter-spacing: .02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.screen-in > span:last-child { font-size: 14px; color: rgba(233, 240, 247, .72); }
.onair { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .22); font-size: 12px; font-weight: 800; letter-spacing: .14em; }
.onair i { width: 8px; height: 8px; border-radius: 50%; background: var(--lamp-strong); box-shadow: 0 0 10px var(--lamp-strong); animation: blink 2.4s ease-in-out infinite; }
.onair.wait { letter-spacing: .08em; }
.screen-foot { position: absolute; left: 14px; bottom: 10px; z-index: 1; font-size: 12px; color: rgba(233, 240, 247, .6); font-variant-numeric: tabular-nums; }
@media (min-width: 720px) { .now .screen.standby { aspect-ratio: 21 / 9; } }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.wait-msg { font-size: 15px; color: var(--dim); }
.prev { display: grid; grid-template-columns: 128px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px; margin-top: 2px; border-radius: 14px; background: var(--sunk); border: 1px solid var(--line); cursor: pointer; text-align: left; font: inherit; color: inherit; transition: border-color .15s; }
@media (hover: hover) { .prev:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); } }
.prev .info { display: grid; gap: 3px; min-width: 0; }
.prev small { color: var(--accent); font-weight: 700; font-size: 12.5px; }
.prev b { font-size: 14px; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.prev .go { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--accent); color: var(--accent-text); }
.prev .go .ic { margin-left: 2px; }

/* 처음 불러오는 동안 */
.skeleton .screen { background: var(--line); }
.skeleton .screen::after { display: none; }
.sk-line { height: 16px; margin: 16px 16px 0; border-radius: 8px; background: var(--line); }
.sk-line.short { width: 40%; margin-bottom: 18px; margin-top: 10px; }
.skeleton .screen, .sk-line { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }

/* 처음 (담은 것 없음) */
.now.empty h2 { font-size: 19px; }
.steps { margin: 0; padding: 0; list-style: none; counter-reset: s; display: grid; gap: 12px; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 28px 1fr; column-gap: 12px; }
.steps li::before { content: counter(s); grid-row: span 2; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 800; font-size: 14px; }
.steps span { color: var(--dim); font-size: 14px; }
.adnote { font-size: 12.5px; color: var(--faint); margin: 18px 4px 0; }

/* ---- 편성표 줄 (오늘 편성표·못 본 지난 회·지난 회) ---- */
.list { display: grid; gap: 4px; padding: 6px; }
.row {
  display: grid; grid-template-columns: 48px 120px minmax(0, 1fr); gap: 14px; align-items: center; padding: 8px; border-radius: 12px;
  border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; width: 100%; transition: background .15s;
}
@media (hover: hover) { .row:hover { background: var(--sunk); } }
.row.on { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.row.on .t { color: var(--accent); }
.row .t { font-size: 14px; font-weight: 700; color: var(--dim); align-self: start; padding-top: 4px; }
.row .tb { width: 120px; }
.row .info { display: grid; grid-template-columns: minmax(0, 1fr); gap: 3px; min-width: 0; }
/* 좁은 화면에서 '어제 회 · 45:49까지 봄'처럼 긴 상태 글이 줄 밖으로 나가지 않게 */
.row .info .st { white-space: normal; }
.row .info b { font-size: 15.5px; font-weight: 700; }
.row .info .sub { font-size: 13px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row.is-done .tb img { opacity: .55; }
.row.is-done .info b { color: var(--dim); }
.row.arch { grid-template-columns: 120px minmax(0, 1fr); }
.nowline { position: relative; display: flex; align-items: center; height: 18px; margin: 2px 8px; }
.nowline::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 2px; background: var(--lamp-strong); border-radius: 2px; opacity: .85; }
.nowline::after { content: ''; position: absolute; left: -2px; top: 50%; width: 10px; height: 10px; margin-top: -5px; border-radius: 50%; background: var(--lamp-strong); }
.nowline span { position: relative; margin-left: 14px; padding: 0 8px; background: var(--card); color: var(--lamp-text); font-size: 12px; font-weight: 800; letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.mrow { position: relative; }
.mrow .row { padding-right: 104px; }
.skip::before { content: ''; position: absolute; inset: -6px; }
.skip { position: absolute; right: 10px; bottom: 10px; min-height: 36px; padding: 0 12px; border-radius: 999px; border: 0; background: var(--sunk); box-shadow: inset 0 0 0 1px var(--line); color: var(--dim); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
@media (hover: hover) { .skip:hover { color: var(--text); } }
@media (max-width: 520px) {
  .row { grid-template-columns: 40px 96px minmax(0, 1fr); gap: 10px; padding: 8px 6px; }
  .row .tb { width: 96px; border-radius: 8px; }
  .row .t { font-size: 13px; }
  .row.arch { grid-template-columns: 112px minmax(0, 1fr); }
  .row.arch .tb { width: 112px; }
  /* '안 볼래요'는 상태 줄 오른쪽에 (상태 줄을 버튼 높이만큼 키워 제목을 가리지 않게) */
  .mrow .row { padding-right: 6px; }
  .mrow .row .st { min-height: 34px; }
  .skip { bottom: 6px; right: 6px; min-height: 34px; }
}

/* ---- 휴대폰: 맨 위 카드는 화면 너비 가득 (YouTube 앱처럼) ---- */
@media (max-width: 520px) {
  #now > .now { margin: -16px -16px 0; border: 0; border-radius: 0; box-shadow: none; border-bottom: 1px solid var(--line); }
  #now > .now.skeleton .sk-line { margin-left: 16px; }
  .now-title { font-size: 17px; }
  .screen-in .big { font-size: 44px; }
}

/* ---- 다른 후보 (아래에서 올라오는 창) ---- */
dialog.cands { width: min(560px, 100vw); max-width: 100vw; max-height: 88vh; max-height: 88dvh; margin: auto auto 0; padding: 0; border: 0; border-radius: 22px 22px 0 0; background: var(--card); color: var(--text); box-shadow: var(--shadow-lift); }
@media (min-width: 720px) { dialog.cands { margin: auto; border-radius: 22px; } }
dialog.cands[open] { animation: rise .28s var(--ease); }
@keyframes rise { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
dialog.cands::backdrop { background: rgba(8, 12, 18, .55); backdrop-filter: blur(2px); opacity: var(--fade, 1); }
/* 창 안만 스크롤 (끝에 닿아도 뒤 화면으로 넘어가지 않게). 끌어 내려 닫기는 공통 부품 kit dragToClose (now.js sheetDrag, UX.md '2. 끌어 내려 닫기')
   끄는 동안에는 kit이 .ak-dragging을 붙여 움직임(transition)을 끈다 */
dialog.cands { overflow-y: auto; overscroll-behavior: contain; transition: transform .24s var(--ease); }
/* 머리(손잡이 막대·제목 줄)는 잡고 끄는 곳 */
.grab, .cands-head { touch-action: none; }
/* 창이 떠 있는 동안 뒤 내용 칸은 스크롤되지 않게 (터치 기기. PC는 스크롤바가 사라지며 화면이 흔들려서 제외) */
@media (pointer: coarse) { body:has(dialog[open]:modal) > main { overflow: hidden; } }
.cands-in { display: grid; gap: 10px; padding: 10px 16px max(18px, env(safe-area-inset-bottom)); }
.grab { justify-self: center; width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin-bottom: 4px; }
@media (min-width: 720px) { .grab { display: none; } .cands-in { padding-top: 18px; } }
.cands-head { display: flex; align-items: center; gap: 8px; }
.cands-head h2 { margin-right: auto; }
.cands-list { display: grid; gap: 8px; }
.cand { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 12px; padding: 10px; border: 1px solid var(--line); border-radius: 14px; background: var(--sunk); cursor: pointer; text-align: left; font: inherit; color: inherit; width: 100%; transition: border-color .15s; }
@media (hover: hover) { .cand:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); } }
.cand.chosen { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: var(--accent-soft); }
.cand .tb { width: 120px; border-radius: 8px; }
.cand .info { display: grid; gap: 6px; min-width: 0; align-content: start; }
.cand .info b { font-size: 14px; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cand .chip { font-size: 12px; padding: 4px 7px; }
.suggest-box { display: grid; gap: 8px; padding: 12px; border-radius: 12px; background: var(--lamp-soft); }

/* ---- 지난 회 ---- */
.filters { display: flex; gap: 6px; overflow-x: auto; margin: 0 -16px; padding: 2px 16px 12px; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.chip.pick { cursor: pointer; font: inherit; font-size: 14px; font-weight: 600; padding: 0 16px; min-height: 44px; background: var(--card); }
.chip.pick.on { background: var(--text); border-color: var(--text); color: var(--bg); }
.arch-day { margin-bottom: 18px; }
.arch-head { font-size: 13.5px; font-weight: 700; color: var(--dim); margin: 6px 6px 8px; }
.empty-small { display: grid; justify-items: center; gap: 10px; padding: 28px 18px; text-align: center; color: var(--faint); }

/* ---- 내 프로그램 ---- */
.progs { display: grid; gap: 10px; }
.prog { display: grid; gap: 10px; padding: 14px 16px; }
.prog-top { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.prog-time { display: grid; place-items: center; min-width: 58px; height: 44px; padding: 0 8px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); font-weight: 800; font-size: 15px; font-variant-numeric: tabular-nums; }
.prog.other .prog-time { background: var(--sunk); color: var(--dim); }
.prog-id { display: grid; gap: 1px; min-width: 0; }
.prog-id b { font-size: 16px; }
.prog-id .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prog-rule { font-size: 13px; color: var(--dim); line-height: 1.55; }
.prog-ctl { display: flex; align-items: center; gap: 10px 18px; flex-wrap: wrap; padding: 10px 12px; border-radius: 12px; background: var(--sunk); }
.prog-ctl .lbl { font-size: 13px; font-weight: 700; color: var(--dim); }
.prog-ctl .bell { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.prog-foot { display: flex; align-items: center; gap: 4px 12px; flex-wrap: wrap; margin-top: -4px; }
.prog-err { font-size: 13px; color: var(--warn); }
.edit-box:empty { display: none; }
.edit-box { padding-top: 12px; border-top: 1px solid var(--line); }
.timepick { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; }
.timepick input[type="time"] { width: 124px; min-height: 44px; padding: 6px 10px; background: var(--card); }
.timepick input[inputmode="numeric"] { width: 110px; min-height: 40px; padding: 6px 10px; }

.add { display: grid; gap: 12px; padding: 18px 16px; border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.add-head { display: flex; align-items: center; gap: 10px; }
.add-ico { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: var(--accent); color: var(--accent-text); }
.add-hints { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; font-size: 13.5px; color: var(--dim); }
.add-hints b { color: var(--text); }
.add-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.push-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; margin-top: 12px; }
.push-ico { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--sunk); color: var(--dim); }
.push-card.on .push-ico { background: var(--good-soft); color: var(--good); }
.push-body { display: grid; gap: 4px; min-width: 0; }
.push-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.push-head h2 { font-size: 16px; }
.push-body .btn-row { margin-top: 4px; }
@media (max-width: 520px) {
  .push-card { grid-template-columns: minmax(0, 1fr) auto; }
  .push-ico { display: none; }
}
.rule { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.rule .wide { grid-column: 1 / -1; }
label.check.learn { margin-top: 8px; font-weight: 500; }
.days { display: flex; gap: 4px; flex-wrap: wrap; }
.days label { position: relative; display: inline-flex; }   /* relative: 숨긴 체크박스가 문서 기준으로 놓이면 문서가 길어지고, 누를 때 문서가 밀린다 */
.days input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.days span { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); font-weight: 600; font-size: 14px; color: var(--dim); cursor: pointer; background: var(--card); }
.days input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.days input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.preview { display: grid; gap: 2px; padding: 10px 12px; border-radius: 12px; background: var(--sunk); font-size: 13px; }
.preview .pr { display: grid; grid-template-columns: 70px minmax(0, 1fr) auto; gap: 8px; padding: 3px 0; }
.preview .pr span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preview .ok { color: var(--good); }
.preview .none { color: var(--faint); }
.sample { display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: 12px; align-items: center; }
.sample b { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.sample img { width: 128px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 10px; background: var(--line); }
details.more summary { cursor: pointer; font-size: 14px; color: var(--accent); font-weight: 600; }
@media (pointer: coarse) { details.more summary { line-height: 44px; } } /* 누르는 곳 44px (UX.md 7) */
.corners { display: grid; gap: 8px; }
.corner { display: grid; grid-template-columns: 112px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 14px; background: var(--sunk); }
.corner img { width: 112px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 8px; background: var(--line); display: block; }
.corner-info { display: grid; gap: 2px; min-width: 0; }
.corner-info b { font-size: 15px; }
.clip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 520px) {
  .prog-ctl { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .prog-ctl .timepick { display: grid; grid-template-columns: auto minmax(0, 1fr) auto minmax(0, 1fr); gap: 6px; }
  .prog-ctl .timepick input[type="time"] { width: 100%; min-width: 0; padding: 6px 8px; }
  .prog-ctl .bell { justify-content: space-between; }
  .corner { grid-template-columns: 88px minmax(0, 1fr); }
  .corner img { width: 88px; }
  .corner > .btn, .corner > .chip { grid-column: 2; justify-self: start; }
  .prog-ctl .bell { margin-left: 0; }
}
/* 아주 좁은 화면(320): '볼 시간' 글을 위 줄로 올려 시간 칸이 '5:30:00 A'처럼 잘리지 않게 */
@media (max-width: 360px) {
  .prog-ctl .timepick { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }
  .prog-ctl .timepick .lbl { grid-column: 1 / -1; }
  .prog-ctl .timepick input[type="time"] { padding: 6px; }
}

/* ---- 로그인 ---- */
.login-page main { --mw: 420px; padding-top: 8vh; }
.login-head { text-align: center; margin-bottom: 20px; display: grid; justify-items: center; gap: 6px; }
.login-head .brand-mark { width: 52px; height: 52px; border-radius: 14px; }
.login-head .brand-mark::after { width: 18px; height: 18px; }
.login-head h1 { letter-spacing: .06em; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 12px; background: var(--bg); margin-bottom: 16px; }
.tabs button { min-height: 40px; border: 0; border-radius: 9px; background: none; color: var(--dim); font: inherit; font-weight: 600; cursor: pointer; }
.tabs button.on { background: var(--card); color: var(--text); box-shadow: var(--shadow); }

/* ---- 아래 알림: 공통 부품 kit toast() 하나만 쓴다 (common.js toast, 색은 kit-theme.css). 아래 탭이 있으면 그 높이만큼 위에 (UX.md '4. 아래 알림') ---- */
@media (max-width: 719px) { body.main-page { --ak-toast-b: 68px; } }
/* 터치 기기에서는 작은 단추도 누르는 곳 44px (UX.md '7. 터치') */
@media (pointer: coarse) { .btn.small, .tabs button, .timepick input[inputmode="numeric"], .nav a, .brand, .act { min-height: 44px; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* 작은 창(PIP)으로 옮긴 동안 카드 자리 (작은 창 안의 꾸밈은 now.js PIP_CSS) */
.screen.pipnote { aspect-ratio: 16 / 9; }
.screen.pipnote .screen-in { gap: 10px; }
.piphelp-steps { margin: 0; padding-left: 22px; display: grid; gap: 8px; line-height: 1.5; }
/* 작은 창 안 페이지(pip.html): 창 전체가 플레이어 */
body.pip { margin: 0; height: 100vh; height: 100dvh; background: #000; overflow: hidden; }
body.pip .player-wrap { height: 100vh; height: 100dvh; grid-template-rows: 1fr auto; }
body.pip .player { aspect-ratio: auto; height: 100%; min-height: 0; }
body.pip .player-note { font-size: 12px; padding: 6px 10px; }

/* 앱으로 설치 안내 (kit installBanner) */
#view-now > .ak-install { margin-bottom: 14px; }
/* 휴대폰은 '지금' 카드를 위로 당겨 화면 가득 채우는데, 안내가 있을 때는 당기지 않는다 (겹치지 않게) */
@media (max-width: 520px) { #view-now > .ak-install:not([hidden]) + #now > .now { margin-top: 0; } }

/* 아이폰 홈 화면 앱(iOS 26~): 화면 맨 위에 고정된 띠가 없으면 아이폰이 머리줄 위에 뿌연 흐림을 덮는다.
   보이지 않는 고정 띠(.ios-edge, 각 HTML의 body 첫 줄)를 두면 흐림 대신 이 배경색으로 상태 표시줄 자리를 칠한다.
   글자 모양으로만 칠해서(background-clip: text) 실제로는 아무것도 그리지 않고, 누를 수도 없다 (2026-11-09) */
.ios-edge {
  position: fixed; top: 0; left: 0; right: 0; height: 11px; z-index: 2147483647; pointer-events: none;
  background-color: var(--bg); -webkit-background-clip: text; background-clip: text;
}
body.ak .ios-edge { background-color: var(--ak-card); }

/* ==== 휴대폰 가로 화면 (2026-11-10) ====
   낮고 넓은 화면(예: 844×390)은 높이가 가장 귀하다. 세로 화면을 넓히기만 하면 영상이 화면보다 커져서 밀어 올려야 보인다.
   그래서 배치를 통째로 바꾼다 ('극장' 배치):
     [세로 메뉴] [ 영상 (남는 높이 가득) + 그 아래 버튼 줄 ] [ 오른쪽 칸: 지금 회 정보 · 오늘 편성표 · 못 본 지난 회 ]
   - 위 바와 아래 탭은 왼쪽 세로 메뉴 하나로 모은다 (영상 높이를 빼앗지 않게)
   - 영상·대기 화면은 화면에 붙어 있고(fixed), 오른쪽 칸만 밀어 올려 본다. 돌려도 영상은 끊기지 않는다 (CSS만 바뀜)
   - 지난 회·내 프로그램은 넓은 폭을 2칸으로, 창(다른 후보·작은 창 안내)은 오른쪽에서 나와 영상을 가리지 않는다
   조건: 가로이고 높이 520 이하·폭 560 이상 (세로로 든 휴대폰에서 자판이 올라와 낮아진 경우·태블릿·PC는 빠짐. 모든 서비스가 같은 조건)
   아일랜드: 아이폰은 가로에서 양쪽에 같은 여백을 알려 주므로 js/edge.js가 붙인 html.island-left/right로 없는 쪽 여백을 지운다.
     왼쪽 여백은 메뉴 바탕색, 오른쪽 여백은 오른쪽 칸 바탕색으로 칠하고, 글자·버튼·영상은 여백 안쪽에만 둔다 */
:root { --sa-l: env(safe-area-inset-left, 0px); --sa-r: env(safe-area-inset-right, 0px); --sa-b: env(safe-area-inset-bottom, 0px); }
html.island-left { --sa-r: 0px; }
html.island-right { --sa-l: 0px; }
@media (orientation: landscape) and (max-height: 520px) and (min-width: 560px) {
  /* --rail 세로 메뉴 폭 · --info 오른쪽 칸 폭 · --strip 영상 아래 버튼 줄 높이 */
  :root { --rail: 48px; --info: clamp(168px, 21vw, 196px); --strip: 52px; }
  /* 공통 부품(kit)의 아래 알림이 세로 메뉴를 피해 뜨게 메뉴 폭을 알려 준다. '지금'에서는 오른쪽 칸도 피해 무대 가운데에 (kit README '가로 모드') */
  body.main-page { --ak-rail-l: var(--rail); --ak-toast-b: 0px; } /* 아래 탭이 없으니 알림 높이 보탬도 없다 */
  @supports selector(:has(a)) { body.main-page:has(#view-now:not([hidden])) { --ak-rail-r: var(--info); } }

  /* ---- 세로 메뉴 (위 바 + 아래 탭): 위에서부터 표시 · 지금 · 지난 회 · 내 프로그램, 맨 아래에 관리 · 내 계정 ---- */
  .main-page .top {
    position: fixed; top: 0; bottom: 0; left: 0; z-index: 20; flex-direction: column; gap: 4px;
    width: calc(var(--rail) + var(--sa-l)); padding: 8px 0 max(8px, var(--sa-b)) var(--sa-l);
    background: var(--card); backdrop-filter: none; -webkit-backdrop-filter: none; border-bottom: 0; border-right: 1px solid var(--line);
  }
  .main-page .brand { justify-content: center; width: 44px; height: 44px; }
  .main-page .brand-text { display: none; }
  .main-page .nav { position: static; flex-direction: column; gap: 2px; margin: 0; padding: 0; background: none; border: 0; backdrop-filter: none; -webkit-backdrop-filter: none; }
  /* 글자는 화면에서만 감춘다 (화면 읽기 프로그램은 그대로 읽음) */
  .main-page .nav a { flex: none; justify-content: center; gap: 0; width: 44px; height: 44px; min-height: 0; padding: 0; border-radius: 12px; font-size: 0; }
  .main-page .nav a .ic { width: 23px; height: 23px; transform: none; }
  .main-page .nav a.on { background: var(--accent-soft); }
  .main-page #admin-link { position: relative; width: 44px; height: 44px; min-height: 0; padding: 0; border: 0; font-size: 13px; }
  .main-page #admin-link .count { position: absolute; top: 0; right: 0; margin: 0; }
  .main-page .acct { width: 44px; height: 44px; min-height: 0; padding: 0; border: 0; }
  .main-page .acct .ic { display: block; }
  .main-page .acct-text { display: none; }

  /* ---- 틀: 메뉴 옆이 내용. 화면마다 안쪽 여백을 따로 준다 ('지금'은 오른쪽 칸만 쓰므로) ----
     내용 칸(main)이 화면 높이를 다 쓰고 그 안에서 스크롤한다. 메뉴와 무대(영상)는 화면에 붙어 있다 (UX.md '1. 화면 틀') */
  .main-page main { max-width: none; margin: 0; padding: 0 var(--sa-r) max(16px, var(--sa-b)) calc(var(--rail) + var(--sa-l)); }
  #pending, #view-archive, #view-programs { padding: 12px 16px 0; }

  /* ---- 지금: 왼쪽 무대(영상·대기 화면) + 오른쪽 칸 ---- */
  #view-now { width: var(--info); margin-left: auto; min-height: 100vh; min-height: 100dvh; }
  /* 오른쪽 칸 바탕: 화면 높이 가득, 아일랜드가 오른쪽이면 그 여백까지 칠한다 */
  #view-now::before { content: ''; position: fixed; z-index: -1; top: 0; bottom: 0; right: 0; width: calc(var(--info) + var(--sa-r)); background: var(--card); border-left: 1px solid var(--line); }
  #now > .now { display: block; overflow: visible; background: none; border: 0; border-radius: 0; box-shadow: none; }
  /* 무대: 메뉴와 오른쪽 칸 사이를 화면 높이 가득 */
  #now > .now > .media, #now > .now > .screen, #now > .load-err {
    position: fixed; z-index: 1; top: 0; bottom: 0; left: calc(var(--rail) + var(--sa-l)); right: calc(var(--info) + var(--sa-r));
  }
  #now > .load-err { align-content: center; border: 0; border-radius: 0; box-shadow: none; }
  /* 영상: 버튼 줄과 아래 홈 막대 자리를 뺀 높이를 16:9로 가득 채우고, 폭이 모자라면 폭에 맞춰 가운데 */
  #now .media { display: grid; place-items: center; padding-bottom: calc(var(--strip) + var(--sa-b)); }
  #now .media > * { width: min(100%, calc((100vh - var(--strip) - var(--sa-b)) * 16 / 9)); }
  @supports (height: 100dvh) { #now .media > * { width: min(100%, calc((100dvh - var(--strip) - var(--sa-b)) * 16 / 9)); } }
  /* 플레이어 안내(▶를 눌러 주세요·못 트는 영상)는 영상 아래에 두면 화면 밖으로 밀리므로 영상 위쪽에 겹친다 */
  #now .player-wrap { position: relative; }
  #now .player-note { position: absolute; z-index: 1; top: 0; left: 0; right: 0; padding: 8px 12px; font-size: 13px; }
  /* 대기 화면: 무대 가득 (방송국의 '곧 시작' 화면처럼) */
  #now .now > .screen { aspect-ratio: auto; }
  #now .now:not(.empty):not(.skeleton) > .screen { padding-bottom: calc(var(--strip) + var(--sa-b)); }
  #now .now:not(.empty) .screen-foot { left: 16px; bottom: calc(var(--strip) + var(--sa-b) + 8px); }
  #now .screen-in .big { font-size: clamp(40px, 15vh, 64px); }
  /* 버튼 줄: 영상 바로 아래, 무대 바닥에. 어두운 무대 위라 버튼도 어둡게 */
  #now .actbar {
    position: fixed; z-index: 2; left: calc(var(--rail) + var(--sa-l)); right: calc(var(--info) + var(--sa-r)); bottom: var(--sa-b);
    align-items: center; height: var(--strip); margin: 0; padding: 0 12px;
  }
  /* 남으면 가운데로, 넘치면 왼쪽부터 밀어 보게 (justify-content: center는 넘친 왼쪽이 잘려서 쓰지 않음) */
  #now .actbar > :first-child { margin-left: auto; }
  #now .actbar > :last-child { margin-right: auto; }
  #now .act { background: rgba(255, 255, 255, .11); color: #eef2f7; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .13); }
  @media (hover: hover) { #now .act:hover { background: rgba(255, 255, 255, .17); } }
  #now .act .ic { color: rgba(238, 242, 247, .72); }
  #now .act.on { background: rgba(125, 176, 240, .2); color: #a8ccf8; box-shadow: inset 0 0 0 1px rgba(125, 176, 240, .42); }
  #now .act.on.good { background: rgba(103, 210, 156, .17); color: #7ddbae; box-shadow: inset 0 0 0 1px rgba(103, 210, 156, .4); }
  #now .act.on .ic, #now .act.back .ic { color: currentColor; }
  #now .act.back { background: #7db0f0; color: #0c1219; box-shadow: none; }

  /* 오른쪽 칸: 지금 회 정보 (무엇 · 상태 · 제목 · 채널/길이 · 고른 까닭) */
  #now .pad { grid-template-columns: minmax(0, 1fr); gap: 6px; padding: 12px 12px 4px; } /* 한 줄짜리 긴 글(고른 까닭)이 칸을 넓히지 않게 */
  #now .now-head { gap: 2px 8px; }
  #now .now-head .st { margin-left: 0; }
  #now .now-title { font-size: 15px; }
  #now .now-meta { font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  #now .why li { font-size: 13px; }
  #now .wait-msg { font-size: 14px; }
  #now .notice { padding: 8px 10px; font-size: 13px; }
  #now .notice > span { flex-basis: 100%; }
  #now .prev { grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 8px; }
  #now .prev .go { display: none; }
  /* 오른쪽 칸: 오늘 편성표 · 못 본 지난 회 — 좁은 칸이라 썸네일 없이 시각 · 이름 · 상태만 (줄마다 44px 넘게) */
  #view-now .section-head { flex-wrap: wrap; gap: 0 8px; margin: 10px 0 0; padding: 10px 12px 0; border-top: 1px solid var(--line); }
  #view-now .section-head h2 { font-size: 15px; }
  #view-now .list { gap: 2px; padding: 4px 6px; background: none; border: 0; border-radius: 0; box-shadow: none; }
  #view-now .row { grid-template-columns: 38px minmax(0, 1fr); gap: 6px; min-height: 48px; padding: 6px; }
  #view-now .row .tb, #view-now .row .info .sub { display: none; }
  #view-now .row .t { font-size: 13px; padding-top: 2px; }
  #view-now .row .info b { font-size: 14px; }
  #view-now .nowline { margin: 0 6px; }
  /* '안 보기'는 줄 아래에 따로 (이름·상태를 가리지 않게) */
  #view-now .mrow .row { padding-right: 6px; padding-bottom: 54px; }
  #view-now .skip { left: 50px; right: auto; bottom: 6px; min-height: 44px; }
  #view-now .adnote { margin: 12px 12px 0; }
  /* 설치 안내: 좁은 오른쪽 칸에는 들어가지 않고 영상 위에 겹치면 영상을 가린다 → 영상이 없을 때(대기·처음)만 무대 위쪽에 띄운다.
     영상이 있을 때는 감춘다 (내 계정에서도 설치할 수 있음). :has를 모르는 옛 브라우저는 가로에서 늘 감춤 */
  #view-now > .ak-install { position: fixed; z-index: 3; top: 8px; left: calc(var(--rail) + var(--sa-l) + 8px); right: calc(var(--info) + var(--sa-r) + 8px); margin: 0; visibility: hidden; }
  @supports selector(:has(a)) {
    #view-now:not(:has(.media)) > .ak-install { visibility: visible; }
    /* 처음(담은 것 없음): 볼 영상이 없으니 오른쪽 칸을 넓혀 등록 안내를 편하게 읽게 */
    .main-page:has(.now.empty) { --info: 46vw; }
    .now.empty .pad { gap: 10px; padding: 16px; }
    #now .now.empty .screen-in .big { font-size: clamp(30px, 11vh, 44px); }
    /* 설치 안내가 떠 있으면 대기 화면 글을 그만큼 내려 겹치지 않게 */
    #view-now:has(> .ak-install:not([hidden])) .now > .screen { padding-top: 72px; }
    #view-now:has(> .ak-install:not([hidden])) .now.empty > .screen { padding-top: 96px; }
  }

  /* ---- 다른 후보 · 작은 창 안내: 오른쪽에서 나오는 창 (왼쪽의 영상은 그대로 보임) ---- */
  dialog.cands {
    width: calc(min(440px, 60vw) + var(--sa-r)); height: 100vh; height: 100dvh; max-height: none; margin: 0 0 0 auto; padding-right: var(--sa-r);
    border-radius: 22px 0 0 22px;
  }
  dialog.cands[open] { animation: slide-in .28s var(--ease); }
  .cands-in { padding: 6px 16px max(16px, var(--sa-b)); }
  .cands-head { position: sticky; top: 0; z-index: 1; margin: 0 -16px; padding: 6px 12px 6px 16px; background: var(--card); }
  .grab { display: none; }

  /* ---- 지난 회: 제목과 프로그램 고르기를 한 줄에, 목록은 2칸 ---- */
  #view-archive { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 12px; align-items: center; }
  #view-archive > .section-head { margin: 0 0 10px; }
  #view-archive .filters { margin: 0 -16px 0 0; padding: 0 16px 10px 0; }
  #archive { grid-column: 1 / -1; }
  #archive .list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #archive .row.arch { grid-template-columns: 112px minmax(0, 1fr); gap: 12px; }
  #archive .row.arch .tb { width: 112px; }
  .arch-day { margin-bottom: 12px; }

  /* ---- 내 프로그램: 등록 | 휴대폰 알림을 나란히, 프로그램 카드는 2칸 ---- */
  #view-programs { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); column-gap: 12px; align-items: start; }
  #view-programs > .section-head, #mine, #others { grid-column: 1 / -1; }
  #view-programs > .section-head { margin-top: 18px; }
  .push-card { margin-top: 0; }
  .add { padding: 14px 16px; gap: 10px; }
  .add > div:empty { display: none; } /* 빈 결과 칸이 카드 아래에 빈 줄을 만들지 않게 */
  .progs { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .progs > p { grid-column: 1 / -1; }
  /* 카드가 좁아 '볼 시간'과 알림을 위아래로 (세로 휴대폰과 같은 꼴) */
  .prog-ctl { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .prog-ctl .timepick { display: grid; grid-template-columns: auto minmax(0, 1fr) auto minmax(0, 1fr); gap: 6px; }
  .prog-ctl .timepick input[type="time"] { width: 100%; min-width: 0; padding: 6px 8px; }
  .prog-ctl .bell { justify-content: space-between; margin-left: 0; }
  .rule > label { align-content: start; } /* 옆 칸이 길어도 입력칸이 위아래로 늘어나지 않게 */
  .rule .timepick input[inputmode="numeric"] { width: 84px; }
  @supports selector(:has(a)) {
    /* 주소를 넣어 규칙 칸이 열리면 등록 카드를 폭 가득, 규칙을 고치는 카드도 폭 가득 (칸이 여러 줄로 나란히) */
    #view-programs:has(#add .form) > #add, #view-programs:has(#add .form) > #push { grid-column: 1 / -1; }
    #view-programs:has(#add .form) .push-card { margin-top: 12px; }
    .prog:has(.edit-box:not(:empty)) { grid-column: 1 / -1; }
  }

  /* ---- 알림 띠: 아래에 두면 버튼 줄을 가리므로 위쪽 가운데에 (창 안에 뜨는 알림은 그대로 창 아래쪽). 좌우는 위의 --ak-rail-l/r 로 kit이 맞춘다 ---- */
  body.main-page:has(#view-now:not([hidden])) > .ak-toast { top: 10px; bottom: auto; }   /* '지금' 화면에서만: 다른 탭은 위에 칩 줄이 있다 */

  /* ---- 로그인 · 가입 신청: 왼쪽에 이름, 오른쪽에 양식 (가입 칸은 2칸으로 나란히) ---- */
  .login-page main {
    display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.25fr); gap: 20px; align-items: center;
    /* 글 폭 780을 가운데에 (내용 칸은 화면 폭을 다 쓴다) */
    padding: 12px calc(max(0px, (100% - 780px) / 2) + 20px + var(--sa-r)) max(12px, var(--sa-b)) calc(max(0px, (100% - 780px) / 2) + 20px + var(--sa-l));
  }
  .login-head { margin-bottom: 0; }
  .login-page .card { padding: 14px; }
  .login-page .tabs { margin-bottom: 12px; }
  .login-page .form { gap: 10px; }
  #signup-form { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 10px; }
  #signup-form > label { align-content: end; } /* 설명 글 줄 수가 달라도 입력칸 높이가 나란히 */
  #signup-form > p, #signup-form > button { grid-column: 1 / -1; }
}
@keyframes slide-in { from { transform: translateX(32px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ==== 주머니 모드 (js/pocket.js, 2026-11-12) ====
   화면 전체를 검은 막으로 덮고, 플레이어만 막 위에 200×200으로 줄여 가운데 둔다.
   - YouTube 약관: 플레이어 위에 아무것도 겹치지 않고, 200×200보다 작게 줄이지 않는다
   - 플레이어는 자리(DOM)를 옮기면 다시 불러와지므로 CSS로만 옮긴다 (가로 화면 극장 배치의 fixed도 여기서 덮어씀)
   - 검은색은 테마와 상관없이 #000 (OLED에서 꺼진 화소), 글자는 아주 흐리게
   - 아이폰 실기기에서는 플레이어가 막 아래에 깔려 안 보인다(js/pocket.js 설명). 주인이 원해서 그대로 둔다 — 고치지 말 것 */
body.pocket, html:has(body.pocket) { overflow: hidden; }
.pocket {
  position: fixed; inset: 0; z-index: 2000; background: #000; color: #5d6670;
  display: grid; grid-template-rows: 1fr 1fr; align-items: stretch;
  padding: calc(16px + env(safe-area-inset-top, 0px)) calc(16px + var(--sa-r)) calc(16px + var(--sa-b)) calc(16px + var(--sa-l));
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; overscroll-behavior: none;
  animation: fade .3s var(--ease);
}
.pocket-top, .pocket-bottom { display: grid; justify-items: center; text-align: center; gap: 6px; font-size: 13px; line-height: 1.5; }
/* 가운데 플레이어(높이 200) 자리를 비우고 위·아래로 나눈다 */
.pocket-top { align-content: end; padding-bottom: 124px; }
.pocket-top b { font-size: 15px; color: #7d8793; }
.pocket-bottom { align-content: start; padding-top: 124px; gap: 14px; }
.pocket-tip { max-width: 300px; font-size: 12px; }
.pocket-unlock {
  position: relative; overflow: hidden; display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 22px;
  border: 1px solid #262c33; border-radius: 999px; background: #0b0d10; color: #8a94a0; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer;
  touch-action: none; -webkit-touch-callout: none;
}
.pocket-unlock .ic, .pocket-unlock span { position: relative; }
/* 길게 누르는 동안 왼쪽부터 차오른다 (다 차면 풀림) */
.pocket-fill { position: absolute; inset: 0; background: #1d2a38; transform: scaleX(0); transform-origin: left; }
.pocket-unlock.holding .pocket-fill { transform: scaleX(1); transition: transform 1.5s linear; }
.pocket-unlock:focus-visible { outline: 2px solid #4a6f96; outline-offset: 3px; }
body.pocket #now .media {
  position: fixed; inset: 50% auto auto 50%; z-index: 2001; transform: translate(-50%, -50%);
  width: 200px; height: 200px; padding: 0; display: grid; place-items: stretch; background: #000;
}
body.pocket #now .media > * { width: 100%; height: 100%; animation: none; }
body.pocket #now .player-wrap { grid-template-rows: 1fr; }
body.pocket #now .player { aspect-ratio: auto; height: 100%; }
/* 플레이어 위에 겹치는 안내(▶를 눌러 주세요 등)는 약관상 숨긴다. 같은 말을 막 위쪽 글로 대신 */
body.pocket #now .player-note { display: none; }
/* 아일랜드 옆 상태 표시줄 자리도 검게: 아이폰은 맨 위 고정 띠(.ios-edge)의 색으로 그 자리를 칠한다 */
body.pocket .ios-edge { background-color: #000; }
body.pocket #now .poster { display: grid; align-content: center; }
/* 휴대폰 가로 화면(가로 모드 규칙과 같은 조건): 위·아래 대신 왼쪽(안내)·오른쪽(풀기)으로 나눠 플레이어(폭 200) 양옆에 */
@media (orientation: landscape) and (max-height: 520px) and (min-width: 560px) {
  .pocket { grid-template-rows: none; grid-template-columns: 1fr 1fr; align-items: center; }
  .pocket-top { align-content: center; padding: 0 124px 0 0; justify-items: end; text-align: right; }
  .pocket-bottom { align-content: center; padding: 0 0 0 124px; justify-items: start; text-align: left; }
}
@media (prefers-reduced-motion: reduce) { .pocket-unlock.holding .pocket-fill { transition: transform 1.5s linear !important; } }
