/* 선곡 공통 디자인 (apple-design 지침: 반투명 소재로 깊이, 누르는 즉시 반응, 크기별 자간, 접근성 설정 존중)
   첫 화면·송출 연결·대시보드·운영 현황이 함께 쓴다. 관리 화면(master.html)은 같은 값을 자체 스타일로 가진다. */
:root {
  --base: #f2f2f7;
  --glass: rgba(255, 255, 255, 0.62);
  --glass-strong: rgba(255, 255, 255, 0.8);
  --glass-edge: rgba(255, 255, 255, 0.7);
  --fill: rgba(118, 118, 128, 0.12);
  --fill-strong: rgba(118, 118, 128, 0.22);
  --text: #1d1d1f;
  --text-2: rgba(60, 60, 67, 0.72);
  --text-3: rgba(60, 60, 67, 0.4);
  --sep: rgba(60, 60, 67, 0.14);
  --blue: #007aff;
  --red: #ff3b30;
  --green: #34c759;
  --orange: #ff9500;
  --pink: #fa2d48;
  --purple: #af52de;
  --glow-a: rgba(250, 45, 72, 0.35);
  --glow-b: rgba(0, 122, 255, 0.3);
  --glow-c: rgba(175, 82, 222, 0.28);
  --shadow-card: 0 1px 1px rgba(0, 0, 0, 0.03), 0 10px 30px rgba(0, 0, 0, 0.06);
  --toast-bg: rgba(30, 30, 32, 0.72);
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
}
@media (prefers-color-scheme: dark) {
  :root {
    --base: #000;
    --glass: rgba(30, 30, 32, 0.56);
    --glass-strong: rgba(30, 30, 32, 0.78);
    --glass-edge: rgba(255, 255, 255, 0.08);
    --fill: rgba(118, 118, 128, 0.24);
    --fill-strong: rgba(118, 118, 128, 0.36);
    --text: #f5f5f7;
    --text-2: rgba(235, 235, 245, 0.68);
    --text-3: rgba(235, 235, 245, 0.32);
    --sep: rgba(84, 84, 88, 0.55);
    --blue: #0a84ff;
    --red: #ff453a;
    --green: #30d158;
    --orange: #ff9f0a;
    --pink: #ff375f;
    --purple: #bf5af2;
    --glow-a: rgba(255, 55, 95, 0.32);
    --glow-b: rgba(10, 132, 255, 0.26);
    --glow-c: rgba(191, 90, 242, 0.24);
    --shadow-card: none;
    --toast-bg: rgba(58, 58, 60, 0.7);
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { font: 100%/1.47 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Apple SD Gothic Neo", "Pretendard", "Noto Sans KR", system-ui, sans-serif; }
body { background: var(--base); color: var(--text); min-height: 100vh; -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }

/* 배경: 은은한 색 번짐 (움직이지 않음) */
.ambient { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.ambient::before, .ambient::after, .ambient span {
  content: ""; position: absolute; border-radius: 50%; filter: blur(80px);
}
.ambient::before { width: 60vmax; height: 60vmax; left: -20vmax; top: -25vmax; background: var(--glow-a); }
.ambient::after { width: 55vmax; height: 55vmax; right: -22vmax; top: 10vh; background: var(--glow-b); }
.ambient span { width: 45vmax; height: 45vmax; left: 10vw; bottom: -30vmax; background: var(--glow-c); }

.shell {
  position: relative; z-index: 1; max-width: 560px; margin: 0 auto;
  padding: calc(28px + env(safe-area-inset-top)) 16px calc(56px + env(safe-area-inset-bottom));
}
.shell.wide { max-width: 1100px; }

/* 큰 제목 */
.header { padding: 4px 4px 22px; }
.header-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.eyebrow { font-size: 13px; font-weight: 600; color: var(--text-2); letter-spacing: 0.01em; }
.large-title { font-size: 34px; font-weight: 700; letter-spacing: -0.026em; line-height: 1.12; margin-top: 2px; word-break: keep-all; }
.subtitle { font-size: 15px; color: var(--text-2); margin-top: 6px; line-height: 1.45; word-break: keep-all; }

.section { margin-bottom: 30px; }
.section-label {
  font-size: 13px; font-weight: 600; color: var(--text-2); letter-spacing: 0.01em;
  padding: 0 16px 8px; display: flex; justify-content: space-between; align-items: baseline;
}
.footnote { font-size: 13px; color: var(--text-2); line-height: 1.5; padding: 8px 16px 0; word-break: keep-all; }

/* 유리 카드 */
.card {
  background: var(--glass);
  -webkit-backdrop-filter: blur(30px) saturate(180%); backdrop-filter: blur(30px) saturate(180%);
  border: 0.5px solid var(--glass-edge);
  border-radius: 22px; box-shadow: var(--shadow-card); overflow: hidden;
}
.card-pad { padding: 16px; }

/* 버튼: 누르는 순간 반응 */
.btn {
  min-height: 48px; border: 0; border-radius: 14px; cursor: pointer; padding: 0 18px;
  font: inherit; font-size: 16px; font-weight: 600; letter-spacing: -0.01em; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--fill); color: var(--blue);
  transition: transform 0.1s ease-out, background 0.2s, opacity 0.2s;
}
.btn:active { transform: scale(0.97); background: var(--fill-strong); }
.btn:disabled { opacity: 0.5; }
.btn.primary { background: var(--blue); color: #fff; }
.btn.primary:active { background: color-mix(in srgb, var(--blue) 85%, #000); }
.btn.danger { color: var(--red); }
.btn.block { width: 100%; }
.btn.small { min-height: 34px; padding: 0 14px; font-size: 14px; border-radius: 999px; }
.row-btns { display: flex; gap: 10px; }
.row-btns > * { flex: 1; }
.link { background: none; border: 0; color: var(--blue); font: inherit; font-size: 15px; cursor: pointer; padding: 8px 0; }
.link.muted { color: var(--text-2); font-size: 13px; }
.link.danger { color: var(--red); }

/* 입력 */
input[type="text"], input[type="email"], input[type="password"], input[inputmode], textarea {
  width: 100%; border: 0; outline: none; resize: none; display: block;
  font: inherit; font-size: 16px; color: var(--text);
  background: var(--fill); border-radius: 12px; padding: 13px 14px; line-height: 1.45;
  transition: box-shadow 0.15s;
}
input:focus, textarea:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 35%, transparent); }
input::placeholder, textarea::placeholder { color: var(--text-3); }
.gap { height: 10px; }
.gap-lg { height: 16px; }

/* 목록 행 (인셋 그룹) */
.list-row { display: flex; align-items: center; gap: 12px; padding: 13px 16px; position: relative; }
.list-row + .list-row::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; height: 0.5px; background: var(--sep); }
a.list-row { color: var(--text); text-decoration: none; transition: background 0.15s; }
a.list-row:active { background: var(--fill); }
.chev { margin-left: auto; color: var(--text-3); font-size: 22px; line-height: 1; }

/* 상태 표시 */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; white-space: nowrap; background: var(--fill); color: var(--text-2); }
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); }
.pill.on { color: var(--green); } .pill.on .dot { background: var(--green); }
.pill.warn { color: var(--orange); } .pill.warn .dot { background: var(--orange); }

/* 안내 메시지 */
.msg { min-height: 20px; font-size: 14px; margin-top: 10px; line-height: 1.45; word-break: keep-all; color: var(--text-2); }
.msg.err { color: var(--red); }
.msg.ok { color: var(--green); }

details.disclosure summary { cursor: pointer; list-style: none; font-size: 14px; color: var(--text-2); padding: 12px 16px; }
details.disclosure summary::-webkit-details-marker { display: none; }
details.disclosure[open] summary { color: var(--text); }
details.disclosure .body { padding: 0 16px 16px; font-size: 13px; color: var(--text-2); line-height: 1.6; }

/* 알림 */
.toast {
  position: fixed; left: 50%; bottom: calc(28px + env(safe-area-inset-bottom)); z-index: 1000;
  transform: translate(-50%, 12px) scale(0.92); opacity: 0; pointer-events: none;
  background: var(--toast-bg); color: #fff;
  -webkit-backdrop-filter: blur(24px) saturate(180%); backdrop-filter: blur(24px) saturate(180%);
  padding: 12px 20px; border-radius: 999px; font-size: 15px; font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25); max-width: calc(100% - 32px); text-align: center;
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0) scale(1); }

/* 접근성: 움직임 줄이기 / 투명도 줄이기 / 대비 높이기 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
  .btn:active { transform: none; }
}
@media (prefers-reduced-transparency: reduce) {
  .card, .toast { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
  .card { background: var(--base); }
  .ambient { display: none; }
}
@media (prefers-contrast: more) {
  .card { border: 1px solid var(--text-3); }
  .ambient { display: none; }
}
