/* REPLAY 화면 스타일: 휴대폰 먼저, 밝은·어두운 화면 모두 (onair 틀을 이어받음)
   색: 짙은 청록(공부·차분함) + 빨간 녹음 불 + 호박색(지금 방송). 숫자(시각·길이)는 고정폭 숫자
   크기 단계: 글 12·13·14·15·16·18·22 / 둥글기 8·12·16 / 간격 4의 배수 */
:root {
  --bg: #f4f3ef;
  --card: #ffffff;
  --sunk: #f7f6f2;
  --line: #e3e1da;
  --text: #16191d;
  --dim: #545b63;
  --faint: #6b727a;
  --accent: #0f6b5c;
  --accent-text: #ffffff;
  --accent-soft: #e2f1ed;
  --rec: #d92d20;
  --rec-soft: #fde8e6;
  --lamp: #b77900;
  --lamp-strong: #e0a100;
  --lamp-soft: #fbf0d4;
  --lamp-text: #8a5a00;
  --good: #1d7a4c;
  --good-soft: #e2f3e9;
  --warn: #9a5b00;
  --warn-soft: #fff1dc;
  --bad: #b42318;
  --bad-soft: #fdecea;
  --player: #0d2621;
  --player-2: #164238;
  --shadow: 0 1px 2px rgba(20, 24, 30, .04), 0 2px 8px rgba(20, 24, 30, .05);
  --shadow-lift: 0 8px 30px rgba(20, 24, 30, .16);
  --radius: 16px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --mini-h: 0px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1211;
    --card: #161c1b;
    --sunk: #121716;
    --line: #26302e;
    --text: #e7ecea;
    --dim: #a2aeaa;
    --faint: #7c8985;
    --accent: #5cc9b1;
    --accent-text: #08130f;
    --accent-soft: #15302a;
    --rec: #ff6b5e;
    --rec-soft: #351a18;
    --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;
    --player: #08130f;
    --player-2: #123a31;
    --shadow: none;
    --shadow-lift: 0 10px 32px rgba(0, 0, 0, .5);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
/* 문서는 스크롤되지 않고 당겨서 새로 고침도 없다 (모든 서비스 공통 규칙 /srv/infra/shared/UX.md '1. 화면 틀'·'7. 터치') */
html, body { overscroll-behavior: none; }
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; -webkit-tap-highlight-color: transparent;
}
/* 누르는 것은 두 번 눌러도 확대되지 않게 (UX.md '7. 터치') */
a, button, summary, label, [role="tab"] { touch-action: manipulation; }
[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, time { font-variant-numeric: tabular-nums; }
.ic { flex: none; display: block; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ic-play, .ic-pause { fill: currentColor; stroke-width: 1.5; }
.top-spacer { flex: 1; }
.clip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

/* ---- 머리줄 ---- */
.top {
  position: relative; flex: none; 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) 88%, 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; min-width: 0; }
.brand-text { display: grid; line-height: 1.15; font-weight: 800; font-size: 17px; letter-spacing: .01em; }
.brand-text small { font-size: 12px; font-weight: 500; color: var(--dim); }
.brand-mark { position: relative; display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: linear-gradient(145deg, #178a75, #0f6b5c); flex: none; }
.brand-mark::before { content: ''; width: 14px; height: 10px; border: 2px solid #fff; border-radius: 3px; }
.brand-mark::after { content: ''; position: absolute; right: 5px; top: 5px; width: 7px; height: 7px; border-radius: 50%; background: #ff5a4a; box-shadow: 0 0 0 2px #0f6b5c; }
/* 배지 바탕은 밝은·어두운 화면 모두 진한 빨강 (어두운 화면의 --bad는 밝아서 흰 글자 대비가 모자람, 체크리스트 F11) */
.count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 4px; border-radius: 9px; background: #b42318; color: #fff; font-size: 11px; font-weight: 700; }
.nav .count { position: absolute; top: 4px; left: calc(50% + 6px); margin: 0; }
.acct .ic { display: none; }
.rail-only { 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)); }
.main-page main { padding-bottom: calc(48px + var(--mini-h)); }

/* ---- 메뉴 탭: PC는 머리줄, 휴대폰은 화면 아래 ---- */
.nav { display: flex; gap: 4px; margin: 0 auto 0 16px; }
.nav a {
  position: relative; 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 (pointer: coarse) { .nav a, .brand { min-height: 44px; } } /* 터치(태블릿 머리줄 메뉴·로고): 누르는 곳 44px */
@media (hover: hover) { .nav a:hover { color: var(--text); background: var(--accent-soft); } } /* 터치 화면에서 눌린 배경이 남지 않게 */
.nav a.on { color: var(--accent); background: var(--accent-soft); }
.nav a .count { position: static; }
/* 휴대폰 아래 탭: 고른 탭은 아이콘 뒤에 둥근 띠 (글자 색만으로는 잘 안 보였음, 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; }
  .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) 94%, 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; }
  .nav a.on { background: none; } /* ux-ok: 고른 표시는 아이콘 뒤 띠(.on .ic) */
  .nav a .count { position: absolute; top: 2px; left: calc(50% + 6px); }
  .main-page main { padding-bottom: 36px; } /* 아래 탭·작은 재생 막대 자리는 내용 칸 밖에 비워 둔다 (맨 아래 '화면 틀') */
  .main-page .top { background: color-mix(in srgb, var(--bg) 96%, transparent); backdrop-filter: none; -webkit-backdrop-filter: none; }
}
@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 input, label select, label textarea { font-weight: 400; } /* 입력한 글자·예시가 굵어 이미 채운 것처럼 보이지 않게 */
.box label { min-height: 44px; }
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; }
/* 터치 기기에서는 폭과 상관없이 16px 이상 (아이폰이 화면을 확대하지 않게. 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, input[type="range"]: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;
}
.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: 44px; padding: 0 13px; font-size: 14px; border-radius: 10px; }
.btn.wide { width: 100%; }
.btn.danger { color: var(--bad); }
/* :hover는 마우스 기기에서만 (손가락으로 누른 뒤 바탕이 남지 않게), 누르는 순간 모양을 바꾸는 :active는 두지 않는다 (UX.md 7) */
@media (hover: hover) {
  .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-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.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; }
.linkbtn.danger { color: var(--bad); }
/* 로그인 비밀번호 보기·숨기기 (모든 서비스 같게, golf 2026-11-11). 단추가 label 밖에 있어야 칸 이름이 '비밀번호'로만 읽힘 */
.pw-field { display: grid; gap: 4px; }
.pw-wrap { position: relative; display: block; }
.pw-wrap input { width: 100%; padding-right: 72px; }
.pw-eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); min-width: 60px; min-height: 44px; border: 0; border-radius: 8px; background: transparent; color: var(--accent); font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
.msg { margin: 0; font-size: 14px; color: var(--bad); }
.msg:empty { display: none; }
.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: 12.5px; line-height: 1; padding: 5px 8px; border-radius: 999px;
  background: var(--sunk); color: var(--dim); border: 1px solid var(--line); font-weight: 600; 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.onrec { background: var(--rec-soft); color: var(--rec); border-color: transparent; }
.chip.onrec::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: blink 1.6s ease-in-out infinite; }
.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; }
.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:disabled { opacity: .6; }
.switch::before { content: ''; position: absolute; inset: -6px; } /* 누르는 영역 44px */
.filters { display: flex; gap: 6px; overflow-x: auto; margin: 0 -16px; padding: 2px 16px 12px; scrollbar-width: none; overscroll-behavior-x: contain; }
.filters::-webkit-scrollbar { display: none; }
@media (min-width: 720px) { .filters { flex-wrap: wrap; overflow: visible; } }
.pick { flex: none; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font: inherit; font-size: 14px; font-weight: 600; padding: 0 15px; min-height: 44px; border-radius: 999px;
  background: var(--card); color: var(--dim); border: 1px solid var(--line); white-space: nowrap; }
.pick small { font-size: 12px; font-weight: 600; opacity: .75; font-variant-numeric: tabular-nums; }
.pick.on { background: var(--text); border-color: var(--text); color: var(--bg); }
.state { display: grid; justify-items: center; gap: 10px; padding: 36px 18px; text-align: center; color: var(--dim); }
.state .ic { color: var(--faint); }
.state b { color: var(--text); font-size: 16px; }
.skel { border-radius: 14px; background: var(--line); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }
@keyframes rise { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---- 표지 ---- */
.cover { position: relative; flex: none; width: 56px; height: 56px; border-radius: 12px; overflow: hidden; background: linear-gradient(145deg, var(--accent-soft), color-mix(in srgb, var(--accent) 22%, var(--accent-soft))); display: grid; place-items: center; color: var(--accent); }
.cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover .ic { width: 45%; height: 45%; opacity: .8; }

/* ---- 녹음 목록 ---- */
.day-head { font-size: 13.5px; font-weight: 700; color: var(--dim); margin: 18px 6px 8px; display: flex; gap: 8px; align-items: baseline; }
.day-head:first-child { margin-top: 2px; }
.day-head small { font-weight: 500; color: var(--faint); }
.recs { display: grid; gap: 2px; padding: 6px; }
.rec {
  display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px; border-radius: 14px;
  border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; width: 100%; transition: background .15s;
}
@media (hover: hover) { .rec:hover { background: var(--sunk); } }
.rec.playing { background: var(--accent-soft); }
.rec .info { display: grid; gap: 2px; min-width: 0; }
.rec .name { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 15.5px; font-weight: 700; }
.rec .name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rec .ep { font-size: 13.5px; color: var(--dim); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rec .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 12.5px; color: var(--faint); font-variant-numeric: tabular-nums; }
.rec .meta .heard { color: var(--accent); font-weight: 600; }
.rec .meta .done { color: var(--good); font-weight: 600; display: inline-flex; align-items: center; gap: 3px; }
.rec .meta .done .ic { width: 14px; height: 14px; }
.rec .bar { height: 3px; border-radius: 2px; background: var(--line); overflow: hidden; margin-top: 4px; }
.rec .bar i { display: block; height: 100%; background: var(--accent); border-radius: 2px; }
.rec .side { display: grid; justify-items: end; gap: 6px; }
.rec .go { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); }
.rec .go .ic-play { margin-left: 2px; }
.rec.is-done .name, .rec.is-done .ep { color: var(--faint); }
.rec.is-done .cover { opacity: .65; }
.rec.failed { cursor: default; }
.rec.failed .go { background: var(--bad-soft); color: var(--bad); }
.rec.live { background: var(--rec-soft); cursor: default; }
.rec.live .go, .rec.live .chip.onrec { background: #b42318; color: #fff; }
.more-row { display: flex; justify-content: center; padding: 10px 0 0; }

/* ---- 편성표 ---- */
.days-bar { display: flex; gap: 6px; overflow-x: auto; margin: 0 -16px 12px; padding: 2px 16px 2px; scrollbar-width: none; overscroll-behavior-x: contain; }
.days-bar::-webkit-scrollbar { display: none; }
.day-pick { flex: none; display: grid; justify-items: center; gap: 1px; min-width: 58px; min-height: 52px; padding: 6px 10px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); color: var(--dim); font: inherit; cursor: pointer; }
.day-pick b { font-size: 15px; color: var(--text); font-variant-numeric: tabular-nums; }
.day-pick small { font-size: 11.5px; font-weight: 600; }
.day-pick.sun small { color: var(--bad); }
.day-pick.sat small { color: #1d5fbf; }
@media (prefers-color-scheme: dark) { .day-pick.sat small { color: #7fb0ff; } }
.dayline { display: flex; align-items: center; gap: 8px; margin: 10px 8px 4px; font-size: 12.5px; font-weight: 700; color: var(--faint); }
.dayline::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.day-pick.on { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.day-pick.on b, .day-pick.on small { color: inherit; }
.search { position: relative; margin-bottom: 12px; }
.search .ic { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.search input { padding-left: 42px; background: var(--card); }
.sched { display: grid; gap: 1px; padding: 6px; }
.slot {
  display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 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) { .slot:hover { background: var(--sunk); } }
.slot .t { font-size: 15px; font-weight: 700; color: var(--text); align-self: start; padding-top: 1px; }
.slot .t small { display: block; font-size: 11.5px; font-weight: 500; color: var(--faint); }
.slot .info { display: grid; gap: 2px; min-width: 0; }
.slot .info b { font-size: 15px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slot .info span { font-size: 13px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slot .tags { display: flex; gap: 4px; flex-wrap: wrap; }
.slot.past .t, .slot.past .info b { color: var(--dim); }
.slot.past .info span { color: var(--faint); }
.slot.gone .info b { text-decoration: line-through; }
.slot.onair { background: var(--lamp-soft); box-shadow: inset 3px 0 0 var(--lamp-strong); }
.slot.subbed .t { color: var(--accent); }
.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; }
.nowline span { position: relative; margin-left: 10px; padding: 0 8px; background: var(--card); color: var(--lamp-text); font-size: 12px; font-weight: 800; font-variant-numeric: tabular-nums; }
.progs { display: grid; gap: 2px; padding: 6px; }
.prog-row { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 8px; border-radius: 12px; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; width: 100%; }
@media (hover: hover) { .prog-row:hover { background: var(--sunk); } }
.prog-row .cover { width: 48px; height: 48px; border-radius: 10px; }
.prog-row .info { display: grid; gap: 2px; min-width: 0; }
.prog-row .info b { font-size: 15px; }
.prog-row .info span { font-size: 13px; color: var(--dim); }
.fetched { font-size: 12.5px; color: var(--faint); margin: 10px 6px 0; }

/* ---- 아래에서 올라오는 창 (프로그램 정보·녹음 자세히) ---- */
dialog.sheet { width: min(600px, 100vw); max-width: 100vw; max-height: 90vh; max-height: 90dvh; 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); overscroll-behavior: contain; }
@media (min-width: 720px) { dialog.sheet { margin: auto; border-radius: 22px; } }
dialog.sheet[open] { animation: rise .26s var(--ease); }
dialog.sheet::backdrop { background: rgba(8, 12, 12, .55); backdrop-filter: blur(2px); }
.sheet-in { display: grid; gap: 14px; padding: 10px 18px max(20px, env(safe-area-inset-bottom)); }
.grab { justify-self: center; width: 40px; height: 5px; border-radius: 3px; background: var(--line); }
/* 끌어 내려 닫는 머리(손잡이 막대·제목 줄): 손가락을 스크롤에 뺏기지 않게 (UX.md '2. 끌어 내려 닫기'·'7. 터치') */
.grab, .sheet-head, .pl-top, .pl-grab { touch-action: none; }
@media (min-width: 720px) { .grab { display: none; } .sheet-in { padding-top: 20px; } .sheet-head, .pl-top { touch-action: auto; } } /* 가운데 창은 끌지 않는다 → 손잡이도 없다 */
.sheet-head { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; gap: 14px; align-items: center; }
.sheet-head .cover { width: 72px; height: 72px; border-radius: 14px; }
.sheet-head h2 { font-size: 19px; }
.sheet-head .sub { font-size: 13.5px; color: var(--dim); }
.iconbtn { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--sunk); color: var(--dim); cursor: pointer; flex: none; }
@media (hover: hover) { .iconbtn:hover { color: var(--text); } }
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 14px; margin: 0; font-size: 14px; }
.kv dt { color: var(--faint); font-weight: 600; }
.kv dd { margin: 0; }
.about { font-size: 14px; color: var(--dim); line-height: 1.6; }
.box { display: grid; gap: 10px; padding: 14px; border-radius: 14px; background: var(--sunk); }
.box-row { display: flex; align-items: center; gap: 12px; }
.box-row > div { flex: 1; min-width: 0; display: grid; gap: 2px; }
.box-row b { font-size: 15px; }
.box-row span { font-size: 13px; color: var(--dim); }
.up-list { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.up-list li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 7px 2px; font-size: 13.5px; border-top: 1px solid var(--line); }
.up-list li:first-child { border-top: 0; }
.up-list .when { white-space: nowrap; font-weight: 700; font-variant-numeric: tabular-nums; }
.up-list .ep { color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.events { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; font-size: 13px; }
.events li { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 8px; }
.events time { color: var(--faint); }
.events .bad { color: var(--bad); }

/* ---- 재생: 아래 작은 막대 ---- */
.mini {
  position: fixed; z-index: 15; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: 44px minmax(0, 1fr) auto auto; gap: 12px; align-items: center;
  padding: 8px max(12px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  background: color-mix(in srgb, var(--card) 96%, transparent); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-top: 1px solid var(--line); box-shadow: 0 -4px 16px rgba(0, 0, 0, .05); cursor: pointer;
}
.mini .cover { width: 44px; height: 44px; border-radius: 9px; }
.mini .info { display: grid; min-width: 0; }
.mini .info b { font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini .info span { font-size: 12.5px; color: var(--dim); font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini .line { position: absolute; left: 0; right: 0; top: -1px; height: 2px; background: transparent; }
.mini .line i { display: block; height: 100%; background: var(--accent); }
.mini .iconbtn { background: none; color: var(--text); }
.mini .iconbtn.pp { background: var(--accent); color: var(--accent-text); }
.mini .loop { font-style: normal; color: var(--lamp); font-weight: 700; }
.mini .skip10 { position: relative; }
.mini .skip10 span { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -36%); font-size: 9.5px; font-weight: 800; }
@media (min-width: 720px) {
  .mini { left: 50%; right: auto; bottom: 16px; width: min(760px, calc(100vw - 32px)); transform: translateX(-50%); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-lift); padding: 8px 12px; }
  .mini .line { left: 18px; right: 18px; }
}
@media (max-width: 719px) { .main-page .mini { bottom: var(--nav-h); padding-bottom: 8px; background: var(--card); } .main-page .nav { background: var(--card); } }

/* ---- 재생: 크게 (아래에서 올라오는 창) ---- */
dialog.player { width: 100vw; max-width: 100vw; height: 100vh; height: 100dvh; max-height: none; margin: 0; padding: 0; border: 0; background: var(--player); color: #eef5f2; overscroll-behavior: contain; }
@media (min-width: 720px) {
  /* PC: 둥근 창은 그대로 두고 안쪽(.pl)이 스크롤 → 스크롤 막대가 모서리를 덮거나 밝은 띠로 보이지 않게 */
  dialog.player { width: min(560px, calc(100vw - 32px)); height: auto; max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); margin: auto; border-radius: 24px; overflow: hidden; }
  dialog.player .pl { max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow-y: auto; overscroll-behavior: contain; }
  .pl-grab { display: none; } /* 가운데 창은 끌지 않는다 */
}
dialog.player, dialog.player .pl { color-scheme: dark; scrollbar-width: thin; scrollbar-color: rgba(238, 245, 242, .28) transparent; }
dialog.player[open] { animation: rise .28s var(--ease); }
dialog.player::backdrop { background: rgba(5, 10, 9, .6); backdrop-filter: blur(3px); }
.pl { position: relative; display: grid; align-content: start; gap: 14px; min-height: 100%; padding: max(12px, env(safe-area-inset-top)) 20px max(22px, env(safe-area-inset-bottom));
  background: radial-gradient(130% 70% at 50% -10%, var(--player-2), var(--player) 70%); }
/* 머리(∨ 닫기)는 창 안을 끝까지 내려도 위에 붙어 있다 (닫는 단추가 늘 보이게, UX.md '3. 닫는 방법'). 내려갔을 때만 바탕을 칠한다(.stuck, player.js) */
.pl { --pl-pt: max(12px, env(safe-area-inset-top)); }
.pl-top { display: flex; align-items: center; gap: 8px; position: sticky; top: 0; z-index: 2; margin: calc(-1 * var(--pl-pt)) -20px -6px; padding: var(--pl-pt) 20px 6px; }
.pl-top.stuck { background: color-mix(in srgb, var(--player) 94%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
/* 손잡이 막대: 끌어 내려 닫을 수 있다는 표시 (40×5). 맨 위 가운데, 머리줄 바로 위 */
.pl-grab { position: absolute; z-index: 1; top: calc(max(12px, env(safe-area-inset-top)) - 8px); left: 50%; width: 40px; height: 5px; margin-left: -20px; border-radius: 3px; background: rgba(238, 245, 242, .28); }
.pl-top .iconbtn { background: rgba(255, 255, 255, .08); color: #eef5f2; }
.pl-top .lbl { flex: 1; text-align: center; font-size: 13px; font-weight: 700; color: rgba(238, 245, 242, .65); }
.pl-art { justify-self: center; width: min(52vw, 220px); aspect-ratio: 1; border-radius: 22px; overflow: hidden; box-shadow: 0 14px 40px rgba(0, 0, 0, .45); background: rgba(255, 255, 255, .06); display: grid; place-items: center; }
.pl-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pl-art .ic { width: 40%; height: 40%; color: rgba(238, 245, 242, .5); }
@media (max-height: 760px) { .pl-art { width: min(40vw, 150px); } }
@media (max-height: 640px) { .pl-art { display: none; } }
.pl-title { display: grid; gap: 4px; text-align: center; }
.pl-title b { font-size: 20px; line-height: 1.3; }
.pl-title span { font-size: 14.5px; color: rgba(238, 245, 242, .78); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.pl-note { padding: 10px 12px; border-radius: 12px; font-size: 13.5px; background: rgba(240, 182, 96, .14); color: #f6cf8f; }
.pl-resume { display: grid; gap: 10px; padding: 12px 14px; border-radius: 14px; background: rgba(255, 255, 255, .09); font-size: 14px; }
.pl-resume .btn-row .btn { flex: 1; }
.pl-resume .btn { background: rgba(255, 255, 255, .1); color: #eef5f2; border-color: transparent; }
.pl-resume .btn.primary { background: #5cc9b1; color: #08130f; }
.seek { position: relative; display: grid; gap: 4px; }
.seek input[type="range"] { touch-action: none; -webkit-appearance: none; appearance: none; width: 100%; height: 44px; min-height: 0; padding: 0; margin: 0; background: transparent; border: 0; box-shadow: none; cursor: pointer; }
.seek input[type="range"]::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: linear-gradient(90deg, #5cc9b1 var(--p, 0%), rgba(255, 255, 255, .18) var(--p, 0%)); }
.seek input[type="range"]::-moz-range-track { height: 6px; border-radius: 3px; background: linear-gradient(90deg, #5cc9b1 var(--p, 0%), rgba(255, 255, 255, .18) var(--p, 0%)); }
.seek input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; margin-top: -6px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .4); }
.seek input[type="range"]::-moz-range-thumb { width: 18px; height: 18px; border: 0; border-radius: 50%; background: #fff; }
.seek .times { display: flex; justify-content: space-between; font-size: 12.5px; color: rgba(238, 245, 242, .65); font-variant-numeric: tabular-nums; }
.seek .ab { position: absolute; top: 19px; height: 6px; border-radius: 3px; background: rgba(245, 195, 81, .55); pointer-events: none; }
.seek .mark { position: absolute; top: 12px; width: 2px; height: 20px; border-radius: 1px; background: #f5c351; pointer-events: none; }
.ctl { display: flex; justify-content: center; align-items: center; gap: 22px; }
.ctl button { display: grid; place-items: center; border: 0; background: none; color: #eef5f2; cursor: pointer; border-radius: 50%; }
.ctl .skip { position: relative; width: 60px; height: 60px; }
.ctl .skip span { position: absolute; font-size: 11px; font-weight: 800; top: 50%; left: 50%; transform: translate(-50%, -38%); }
.ctl .skip .ic { width: 40px; height: 40px; }
.ctl .pp { width: 76px; height: 76px; background: #eef5f2; color: var(--player); box-shadow: 0 6px 20px rgba(0, 0, 0, .35); transition: transform .12s var(--ease); }
.ctl .pp:active { transform: scale(.95); }
.ctl .pp .ic { width: 32px; height: 32px; }
.ctl .pp .ic-play { margin-left: 4px; }
.tools { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.tool { display: grid; justify-items: center; align-content: center; gap: 4px; min-height: 62px; padding: 8px 4px; border: 0; border-radius: 14px; background: rgba(255, 255, 255, .08); color: #eef5f2; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.tool .ic { width: 22px; height: 22px; }
.tool b { font-size: 15px; font-variant-numeric: tabular-nums; }
.tool.on { background: #f5c351; color: #2a1f05; }
.tool.good { background: rgba(103, 210, 156, .2); color: #8ee5b6; }
.speed { display: flex; align-items: center; gap: 8px; padding: 6px; border-radius: 14px; background: rgba(255, 255, 255, .08); }
.speed button { min-width: 48px; min-height: 44px; border: 0; border-radius: 10px; background: none; color: #eef5f2; font: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer; font-variant-numeric: tabular-nums; }
.speed button.on { background: #eef5f2; color: var(--player); }
.speed .val { flex: 1; text-align: center; }
.speed-box { display: grid; gap: 8px; }
.speed-presets { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; }
.speed-presets button { min-width: 0; padding: 0; min-height: 44px; border: 0; border-radius: 999px; background: rgba(255, 255, 255, .08); color: #eef5f2; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; font-variant-numeric: tabular-nums; }
.speed-presets button.on { background: #eef5f2; color: var(--player); }
@media (max-width: 340px) { .speed-presets { gap: 2px; } } /* 작은 휴대폰에서도 버튼 너비 44px */
.ab-help { text-align: center; font-size: 13px; color: #f5c351; min-height: 1.5em; }
.pl-more { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.pl-more .btn { background: rgba(255, 255, 255, .08); color: #eef5f2; border-color: transparent; font-size: 14px; }
.pl-more .btn.danger { color: #ff8a80; }
.pl-info { display: grid; gap: 8px; padding: 14px; border-radius: 14px; background: rgba(255, 255, 255, .06); font-size: 13.5px; color: rgba(238, 245, 242, .8); }
.pl-info .kv dt { color: rgba(238, 245, 242, .55); }
.pl-info a { color: #8fe0cd; display: inline-flex; align-items: center; min-height: 44px; }
.pl :focus-visible { outline-color: #f5c351; }
/* 큰 창의 두 묶음(듣기 · 그 밖): 세로 화면에서는 묶음이 없는 것처럼 한 줄로 흐른다. 순서만 예전대로 맞춘다 (안내 → 재생 위치 → 버튼 → 나머지) */
.pl-main, .pl-side { display: contents; }
.pl-top, .pl-art, .pl-title { order: -3; }
.pl-note, .pl-resume { order: -2; }
.pl-main > .seek, .pl-main > .ctl { order: -1; }
.seek .times .loop { font-style: normal; font-weight: 700; color: #f5c351; }
.speed button:disabled { opacity: .35; cursor: default; }
/* 가로로 눕힌 휴대폰에서만 쓰는 '지금 듣는 것' 칸 (맨 끝 가로 블록에서 켠다) */
.dock { display: none; }

/* ---- 예약·상태 (관리자) ---- */
.health { display: grid; gap: 8px; }
.hrow { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); font-size: 14px; }
.hrow .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--good); flex: none; }
.hrow.warn .dot { background: var(--lamp-strong); }
.hrow.bad { border-color: color-mix(in srgb, var(--bad) 35%, var(--line)); background: var(--bad-soft); color: var(--bad); }
.hrow.bad .dot { background: var(--bad); }
.hrow span { flex: 1; min-width: 0; }
.notes { display: grid; gap: 0; padding: 4px 6px; }
.note { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 10px; padding: 10px 6px; border-top: 1px solid var(--line); font-size: 14px; }
.note:first-child { border-top: 0; }
.note .ic { width: 20px; height: 20px; margin-top: 1px; color: var(--accent); }
.note.warn .ic { color: var(--warn); }
.note.bad .ic { color: var(--bad); }
.note.read { color: var(--dim); }
.note.read .ic { opacity: .5; }
.note time { display: block; font-size: 12px; color: var(--faint); }
.subrows { display: grid; gap: 2px; padding: 6px; }
.subrow { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 8px; border-radius: 12px; }
.subrow .cover { width: 48px; height: 48px; border-radius: 10px; }
.subrow .info { display: grid; gap: 2px; min-width: 0; }
.subrow .info b { font-size: 15px; }
.subrow .info span { font-size: 13px; color: var(--dim); }
.subrow.off .info { opacity: .55; }
.soon { display: grid; gap: 2px; padding: 6px; }
.soon-row { display: grid; grid-template-columns: 92px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 9px 8px; border-radius: 10px; font-size: 14px; }
.soon-row .when { font-weight: 700; font-variant-numeric: tabular-nums; }
.soon-row .when small { display: block; font-weight: 500; color: var(--faint); font-size: 12px; }
.soon-row .what { min-width: 0; display: grid; }
.soon-row .what b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.soon-row .what span { font-size: 12.5px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.soon-row > :last-child { justify-self: end; }
.soon-row.off .what { opacity: .5; text-decoration: line-through; }
.storage { display: grid; gap: 14px; }
.meter { height: 10px; border-radius: 5px; background: var(--sunk); overflow: hidden; display: flex; }
.meter i { display: block; height: 100%; background: var(--accent); }
.stat-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.stat { display: grid; gap: 2px; padding: 12px; border-radius: 12px; background: var(--sunk); }
.stat b { font-size: 18px; font-variant-numeric: tabular-nums; }
.stat span { font-size: 12.5px; color: var(--dim); }
.ptable { width: 100%; border-collapse: collapse; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.ptable th, .ptable td { padding: 7px 4px; text-align: right; border-top: 1px solid var(--line); }
.ptable th:first-child, .ptable td:first-child { text-align: left; }
.ptable td:first-child { max-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; width: 100%; }
.ptable th, .ptable td:not(:first-child) { white-space: nowrap; }
.ptable th { color: var(--faint); font-weight: 600; font-size: 12.5px; border-top: 0; }
.settings-note { font-size: 13px; color: var(--faint); }
@media (max-width: 360px) {
  .rec { grid-template-columns: 44px minmax(0, 1fr) auto; gap: 10px; padding: 10px 6px; }
  .rec .cover { width: 44px; height: 44px; border-radius: 10px; }
  .rec .go { width: 36px; height: 36px; }
}
@media (max-width: 400px) {
  .soon-row { grid-template-columns: 76px minmax(0, 1fr) auto; }
  .tools { gap: 6px; }
  .ctl { gap: 14px; }
}

/* ---- 로그인 ---- */
.login-page main { max-width: 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::before { width: 24px; height: 17px; border-width: 3px; border-radius: 4px; }
.login-head .brand-mark::after { width: 11px; height: 11px; right: 9px; top: 9px; }
.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: 44px; 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)이 그린다. 여기서는 자리와 색만 알려 준다 (UX.md '4. 아래 알림') ----
   자리: 작은 재생 막대 위 (휴대폰은 아래 탭도 더해서, 맨 아래 '화면 틀'). 단추 글자색은 css/kit-theme.css */
body.main-page { --ak-toast-b: var(--mini-h); }
:root { --ak-toast-bg: #1b2422; --ak-toast-text: #fff; }
dialog:focus { outline: none; }
/* 끌어 내려 닫기(kit dragToClose): 손을 떼면 제자리로 부드럽게. 끄는 동안은 kit이 .ak-dragging을 붙여 손가락을 바로 따라온다 */
dialog.sheet, dialog.player { transition: transform .2s var(--ease); }

/* ==== 화면 틀: 틀(머리줄·아래 탭·작은 재생 막대)은 제자리, 가운데 내용 칸(main)만 스크롤되고 끝에서 아이폰처럼 튕긴다 ====
   메인·로그인 모두, 세로·가로·PC 모든 폭에서 같다 (관리 화면은 kit의 body.ak가 같은 틀을 그린다). 규칙: /srv/infra/shared/UX.md '1. 화면 틀'
   문서(window)는 스크롤되지 않는다 → 위치를 읽고 옮길 때는 main의 scrollTop.
   가로로 눕힌 휴대폰 규칙(아래)이 여백을 덮어쓰도록 이 규칙은 그 앞에 둔다 */
:root { --nav-h: calc(59px + max(6px, env(safe-area-inset-bottom, 0px))); } /* 휴대폰 아래 탭 높이: 선 1 + 위 4 + 단추 54 + 아래 여백 */
body.main-page, body.login-page { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
.main-page main, .login-page main {
  --col: 820px; /* 글이 놓이는 가운데 폭 */
  flex: 1; min-height: 0; max-width: none; margin: 0; overflow-y: auto; overscroll-behavior-y: contain; -webkit-overflow-scrolling: touch; outline: none;
  /* 내용 칸은 화면 폭 전체(옆 빈 곳을 문질러도, 스크롤 막대는 화면 끝에), 글은 예전처럼 가운데 */
  padding-left: max(16px, env(safe-area-inset-left), calc((100% - var(--col)) / 2 + 16px));
  padding-right: max(16px, env(safe-area-inset-right), calc((100% - var(--col)) / 2 + 16px));
}
.login-page main { --col: 420px; }
@media (max-width: 719px) {
  /* 휴대폰: 아래 탭(과 그 위 작은 재생 막대)은 화면 아래에 붙어 있고, 내용 칸은 그 위에서 끝난다 (내용이 탭 밑으로 지나가지 않는다) */
  .main-page .nav { height: var(--nav-h); }
  .main-page main { margin-bottom: calc(var(--nav-h) + var(--mini-h)); }
  body.main-page { --ak-toast-b: calc(var(--nav-h) - env(safe-area-inset-bottom, 0px) + var(--mini-h)); }
}
/* 창이 열려 있는 동안 뒤 내용 칸은 움직이지 않는다 (터치 기기만: PC는 스크롤 막대가 사라지며 화면이 흔들린다) */
@media (pointer: coarse) { body:has(dialog[open]) > main { overflow: hidden; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* 앱으로 설치 안내 (kit installBanner) */
#view-library > .ak-install { margin-bottom: 14px; }

/* 아이폰 홈 화면 앱(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)은 높이가 가장 귀하다. 그래서
   - 머리줄·아래 탭 → 왼쪽 세로 메뉴 하나로 (위아래 높이를 먹지 않게)
   - 아래 작은 재생 막대 → 오른쪽 '지금 듣는 것' 칸 (.dock): 목록과 나란히, 차 거치대에 눕혀 두고도 누르기 쉬운 큰 버튼
   - 큰 재생 창·프로그램 정보 창·편성표·예약·로그인 → 두 칸 배치
   조건: 가로 + 높이 520 이하 + 폭 560 이상. 세로에서 키보드가 올라와 납작해진 화면, 태블릿, PC는 들어오지 않는다 (모든 서비스 공통 조건) */
/* 아이폰은 아일랜드가 한쪽에만 있어도 양쪽에 같은 여백을 알려 준다 → 아일랜드가 없는 쪽 여백은 없앤다 (쪽 판별은 common.js islandSide)
   좌우 여백은 env()를 바로 쓰지 말고 이 변수로 */
: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; }
@keyframes slide-in { from { transform: translateX(32px); opacity: 0; } to { transform: none; opacity: 1; } }

@media (orientation: landscape) and (max-height: 520px) and (min-width: 560px) {
  :root { --rail-w: 68px; --dock-w: clamp(264px, 34vw, 320px); --dock-space: 0px; }
  html.has-rec { --dock-space: calc(var(--dock-w) + var(--sa-r)); } /* 듣는 것이 있을 때만 오른쪽 칸 자리를 비운다 */
  /* 공통 부품(kit)의 아래 알림이 세로 메뉴와 오른쪽 칸을 피해 본문 가운데에 뜨게 폭을 알려 준다 (kit README '가로 모드') */
  body.main-page { --ak-rail-l: var(--rail-w); --ak-toast-b: 0px; } /* 가로에는 아래 탭·작은 막대가 없다 */
  html.has-rec body.main-page { --ak-rail-r: var(--dock-w); }

  /* ---- 머리줄 → 왼쪽 세로 메뉴. 아일랜드가 왼쪽이면 그 자리까지 메뉴 바탕으로 칠한다 ---- */
  .main-page .top {
    position: fixed; top: 0; bottom: 0; left: 0; width: calc(var(--rail-w) + var(--sa-l)); flex-direction: column; gap: 4px;
    padding: 8px 6px max(8px, var(--sa-b)) calc(6px + var(--sa-l)); background: var(--card); backdrop-filter: none; -webkit-backdrop-filter: none;
    border-bottom: 0; border-right: 1px solid var(--line); overflow-y: auto; scrollbar-width: none; overscroll-behavior: contain;
  }
  .main-page .top::-webkit-scrollbar { display: none; }
  .main-page .top .brand { flex: none; width: 44px; height: 44px; justify-content: center; }
  .main-page .top .brand-text { display: none; }
  .main-page .nav { position: static; height: auto; flex-direction: column; justify-content: flex-start; gap: 2px; width: 100%; margin: 0; padding: 0; background: none; border: 0; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .main-page .nav a { flex: none; flex-direction: column; justify-content: center; gap: 2px; min-height: 52px; padding: 5px 0 3px; border-radius: 12px; font-size: 12px; }
  .main-page .nav a .ic { width: 22px; height: 22px; }
  .main-page .nav a.on { background: var(--accent-soft); }
  .main-page .nav a .count { position: absolute; top: 3px; left: calc(50% + 6px); margin: 0; }
  .main-page .top .top-spacer { min-height: 0; }
  .main-page #admin-link { position: relative; flex: none; flex-direction: column; gap: 2px; width: 100%; min-height: 52px; padding: 5px 0 3px; border-color: transparent; border-radius: 12px; font-size: 12px; color: var(--dim); }
  .main-page #admin-link .rail-only { display: block; }
  .main-page #admin-link .count { position: absolute; top: 3px; left: calc(50% + 6px); margin: 0; }
  .main-page .acct { flex: none; width: 44px; height: 44px; padding: 0; border-radius: 50%; }
  .main-page .acct .ic { display: block; }
  .main-page .acct-text { display: none; }

  .main-page main { max-width: none; margin: 0 var(--dock-space) 0 calc(var(--rail-w) + var(--sa-l)); padding: 12px max(16px, var(--sa-r)) calc(24px + var(--sa-b)) 16px; }
  html.has-rec .main-page main { padding-right: 16px; }

  /* ---- 오른쪽 '지금 듣는 것' 칸 (작은 막대 대신). 큰 재생 창과 같은 짙은 청록 바탕 ---- */
  .main-page .mini { display: none; }
  .dock {
    position: fixed; z-index: 15; top: 0; right: 0; bottom: 0; width: calc(var(--dock-w) + var(--sa-r));
    display: grid; align-content: space-evenly; gap: 6px; padding: 10px calc(16px + var(--sa-r)) max(10px, var(--sa-b)) 16px;
    color: #eef5f2; color-scheme: dark; background: radial-gradient(140% 70% at 60% -10%, var(--player-2), var(--player) 72%);
    border-left: 1px solid rgba(255, 255, 255, .06); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none;
  }
  .dock::-webkit-scrollbar { display: none; }
  .dock-head { display: grid; grid-template-columns: 52px minmax(0, 1fr) 44px; gap: 10px; align-items: center; cursor: pointer; }
  .dock-head .cover { width: 52px; height: 52px; background: rgba(255, 255, 255, .08); color: rgba(238, 245, 242, .6); }
  .dock-title { display: grid; gap: 2px; min-width: 0; }
  .dock-title b, .dock-title span { word-break: normal; overflow-wrap: anywhere; }
  .dock-title b { font-size: 16px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .dock-title span { font-size: 13px; line-height: 1.35; color: rgba(238, 245, 242, .78); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .dock-title span:empty { display: none; }
  .dock .iconbtn { background: rgba(255, 255, 255, .08); color: #eef5f2; }
  .dock .ctl { gap: 14px; }
  .dock .speed .val small { font-size: 13px; color: rgba(238, 245, 242, .65); }
  .dock .speed .val b { font-size: 16px; font-variant-numeric: tabular-nums; }
  .dock :focus-visible { outline-color: #f5c351; }

  /* ---- 녹음 목록 ---- */
  .filters { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 10px; }
  .day-head { margin-top: 14px; }

  /* ---- 편성표: 왼쪽에 찾기·날짜(붙어 있음), 오른쪽에 그날 편성. 오른쪽 칸이 서 있을 때는 자리가 좁아 한 줄로 ---- */
  html:not(.has-rec) #view-schedule { display: grid; grid-template-columns: 256px minmax(0, 1fr); gap: 16px; align-items: start; }
  html:not(.has-rec) .sched-side { position: sticky; top: 12px; }
  html:not(.has-rec) .days-bar { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); overflow: visible; margin: 0; padding: 0; }
  html:not(.has-rec) .day-pick { min-width: 0; padding: 6px 2px; }

  .search input { text-overflow: ellipsis; }

  /* ---- 예약(관리자): 묶음을 두 줄로 나눠 놓는다. 상태 줄은 맨 위에 폭 전체 ---- */
  html:not(.has-rec) #manage { columns: 2; column-gap: 16px; }
  #manage > .health, #manage > .card, #manage > .state { -webkit-column-span: all; column-span: all; }
  html:not(.has-rec) .health { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
  .hrow { align-items: flex-start; }
  .hrow .dot { margin-top: 7px; }
  .msec { -webkit-column-break-inside: avoid; break-inside: avoid; padding-top: 14px; }
  .msec > .section-head { margin-top: 0; margin-bottom: 8px; min-height: 28px; align-items: center; }

  /* ---- 프로그램 정보·녹음 기록 창: 아래에서 올라오지 않고 오른쪽에서 높이 전체로 (낮은 화면에서 내용이 더 많이 보이게) ---- */
  dialog.sheet { width: calc(min(480px, 60vw) + var(--sa-r)); max-width: none; height: 100vh; height: 100dvh; max-height: none; margin: 0 0 0 auto; border-radius: 22px 0 0 22px; }
  dialog.sheet[open] { animation-name: slide-in; }
  .sheet-in { padding: 0 calc(18px + var(--sa-r)) max(16px, var(--sa-b)) 18px; }
  .sheet-in > :first-child:not(.grab), .sheet-in > .grab + :not(.sheet-head) { margin-top: 16px; }
  .grab { display: none; } /* 옆에서 나오는 창은 끌지 않는다 → 손잡이도 없다 */
  .sheet-head { touch-action: auto; }
  /* 닫기 단추가 늘 보이게 머리줄은 붙여 둔다 */
  .sheet-head { position: sticky; top: 0; z-index: 1; grid-template-columns: 52px minmax(0, 1fr) auto; padding: 12px 0 10px; background: var(--card); }
  .sheet-head .cover { width: 52px; height: 52px; border-radius: 12px; }

  /* ---- 큰 재생 창: 왼쪽은 듣기(제목·재생 위치·큰 버튼, 늘 보임), 오른쪽은 도구·정보(넘치면 이쪽만 스크롤) ---- */
  dialog.player { width: 100vw; max-width: 100vw; height: 100vh; height: 100dvh; max-height: none; margin: 0; border-radius: 0; overflow: hidden; }
  .pl-top { touch-action: none; position: static; margin: 0; padding: 0; } /* 가로는 왼쪽 칸이 스크롤되지 않아 붙여 둘 것이 없다 */
  .pl-grab { display: block; top: 4px; } /* 가로에서도 아래에서 올라오는 전체 화면 창 → 끌어 내려 닫는다 */
  dialog.player .pl { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); gap: 0; height: 100%; min-height: 0; max-height: none; padding: 0; overflow: hidden; }
  .pl-main { display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto; gap: 6px; min-height: 0; padding: 10px 16px max(12px, var(--sa-b)) max(20px, var(--sa-l)); }
  .pl-side { display: grid; align-content: start; gap: 12px; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 12px max(20px, var(--sa-r)) max(16px, var(--sa-b)) 8px; scrollbar-width: thin; }
  .pl-top, .pl-art, .pl-title, .pl-note, .pl-resume, .pl-main > .seek, .pl-main > .ctl { order: 0; }
  .pl-art { display: none; }
  .pl-title { align-content: center; min-height: 0; overflow: hidden; }
  .pl-title b { font-size: 22px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .pl-title span { font-size: 15px; -webkit-line-clamp: 2; }
  .pl-main .ctl { gap: 28px; padding-bottom: 2px; }
  .pl-side .tools { order: 1; }
  .pl-side .ab-help { order: 2; min-height: 0; }
  .pl-side .ab-help:empty { display: none; }
  .pl-side .speed-box { order: 3; }
  .pl-side .pl-info { order: 4; }
  .pl-side .pl-more { order: 5; justify-content: flex-start; }

  /* ---- 로그인·가입 신청: 왼쪽에 이름, 오른쪽에 입력 칸 ---- */
  .login-page main {
    --col: 820px; display: grid; grid-template-columns: minmax(0, .7fr) minmax(0, 1.3fr); gap: 28px; align-items: center;
    padding: 16px max(20px, var(--sa-r), calc((100% - var(--col)) / 2 + 20px)) max(16px, var(--sa-b)) max(20px, var(--sa-l), calc((100% - var(--col)) / 2 + 20px));
  }
  .login-head { margin: 0; align-self: start; position: sticky; top: max(16px, calc(50vh - 70px)); top: max(16px, calc(50dvh - 70px)); }
  .login-page #signup-form { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; align-items: end; }
  .login-page #signup-form > #invite-row, .login-page #signup-form > p, .login-page #signup-form > button { grid-column: 1 / -1; }
}
/* 아주 낮은 화면(사파리 주소 줄이 보일 때 등): 세로 메뉴에서 이름표를 빼 메뉴가 다 보이게 */
@media (orientation: landscape) and (max-height: 520px) and (min-width: 560px) and (max-height: 340px) {
  .main-page .top .brand { display: none; }
}
/* 가로 + 넉넉한 폭 + 오른쪽 칸이 없을 때: 녹음 목록을 두 줄로 (스크롤이 절반) */
@media (orientation: landscape) and (max-height: 520px) and (min-width: 800px) {
  html:not(.has-rec) .recs { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 6px; }
}
/* 가로 + 좁은 폭(작은 휴대폰)에서 오른쪽 칸이 서 있으면 목록이 좁다 → 표지를 줄인다 */
@media (orientation: landscape) and (max-height: 520px) and (min-width: 560px) and (max-width: 760px) {
  html.has-rec .rec { grid-template-columns: 44px minmax(0, 1fr) auto; gap: 10px; padding: 10px 6px; }
  html.has-rec .rec .cover { width: 44px; height: 44px; border-radius: 10px; }
}
