/* ============================================================
   회의록 — 디자인 시스템
   구성: 1.토큰 → 2.베이스 → 3.앱 셸 → 4.사이드바 → 5.메인/상세
        → 6.투두 → 7.전사 → 8.플레이어 → 9.녹음 오버레이
        → 10.모달/토스트 → 11.스켈레톤 → 12.반응형
   ============================================================ */

/* ---------- 1. 토큰 ---------- */
:root {
  /* 색 */
  --bg: #f7f7f8;
  --surface: #ffffff;
  --surface-2: #fbfbfc;
  --border: #e9eaee;
  --border-strong: #dcdee4;
  --text: #1a1c22;
  --text-2: #5a6072;
  --text-3: #9aa0ad;
  --accent: #5b5bd6;
  --accent-strong: #4f4fc4;
  --accent-soft: #eeeefb;
  --accent-line: #d5d5f2;
  --danger: #d6494f;
  --danger-soft: #fceeee;
  --ok: #2e7d43;
  --ok-soft: #e9f5ec;
  --warn: #a86412;
  --warn-soft: #faf1e0;
  --track: #ededf0;

  /* 그림자 (2겹 레이어드) */
  --sh-sm: 0 1px 2px rgba(20, 22, 40, .05), 0 2px 8px rgba(20, 22, 40, .04);
  --sh-md: 0 1px 3px rgba(20, 22, 40, .07), 0 10px 30px rgba(20, 22, 40, .08);
  --sh-lg: 0 4px 10px rgba(20, 22, 40, .08), 0 24px 60px rgba(20, 22, 40, .16);

  /* 형태 */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;

  --side-w: 320px;
  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont,
    "Apple SD Gothic Neo", "Segoe UI", sans-serif;
}

/* ---------- 2. 베이스 ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
input { font: inherit; color: inherit; }
input::placeholder { color: var(--text-3); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--accent-soft); }

svg { width: 1em; height: 1em; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; fill: none; flex: none; }
svg .f { fill: currentColor; stroke: none; }

/* 스크롤바 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #d3d5db; border-radius: 6px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: #b9bcc5; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes scale-in { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes blink { 50% { opacity: .3; } }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ---------- 3. 앱 셸 ---------- */
#app { display: flex; height: 100vh; height: 100dvh; overflow: hidden; }

/* ---------- 4. 사이드바 ---------- */
#sidebar {
  width: var(--side-w);
  flex: none;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-right: 1px solid var(--border);
}
.side-top { padding: 18px 16px 12px; border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: 9px; padding: 2px 4px 16px; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px; background: var(--accent);
  color: #fff; display: flex; align-items: center; justify-content: center; font-size: 16px;
  box-shadow: var(--sh-sm);
}
.brand-name { font-size: 16.5px; font-weight: 800; letter-spacing: -0.3px; }

.btn-record {
  width: 100%;
  display: flex; align-items: center; justify-content: center; gap: 9px;
  background: var(--accent); color: #fff;
  font-weight: 700; font-size: 14.5px;
  padding: 12px; border-radius: var(--r-md);
  box-shadow: var(--sh-sm);
  transition: background .15s, transform .1s;
}
.btn-record:hover { background: var(--accent-strong); }
.btn-record:active { transform: scale(.985); }
.rec-dot { width: 8px; height: 8px; border-radius: 50%; background: #ff8f93; box-shadow: 0 0 0 3px rgba(255, 255, 255, .2); }

.searchbox {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg); border: 1px solid transparent; border-radius: var(--r-sm);
  padding: 8px 11px; margin-top: 10px; color: var(--text-3); font-size: 14px;
  transition: border-color .15s, background .15s;
}
.searchbox:focus-within { background: var(--surface); border-color: var(--accent-line); }
.searchbox input { flex: 1; border: 0; outline: 0; background: none; }
.searchbox svg { font-size: 15px; }

.list { flex: 1; overflow-y: auto; padding: 10px 10px 24px; }
.group-label {
  font-size: 11.5px; font-weight: 700; color: var(--text-3);
  letter-spacing: .4px; padding: 14px 8px 6px;
}
.group-label:first-child { padding-top: 6px; }

.item {
  position: relative;
  display: block; width: 100%; text-align: left;
  border-radius: var(--r-sm);
  padding: 10px 12px;
  margin-bottom: 2px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background .12s;
  animation: fade-in .2s both;
}
.item:hover { background: var(--surface-2); border-color: var(--border); }
.item.sel { background: var(--accent-soft); border-color: var(--accent-line); }
.item .t {
  font-size: 14px; font-weight: 650;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  padding-right: 26px;
}
.item.sel .t { color: var(--accent-strong); }
.item .m {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  font-size: 12px; color: var(--text-3); margin-top: 3px;
  font-variant-numeric: tabular-nums;
}
.item .snippet {
  font-size: 12px; color: var(--text-2); margin-top: 3px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; line-height: 1.45;
}
.item .del {
  position: absolute; top: 8px; right: 8px;
  color: var(--text-3); font-size: 14px;
  width: 26px; height: 26px; border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .12s, background .12s, color .12s;
}
.item:hover .del { opacity: 1; }
.item .del:hover { color: var(--danger); background: var(--danger-soft); }

.pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 700; padding: 1.5px 8px; border-radius: 999px;
}
.pill.processing { color: var(--warn); background: var(--warn-soft); }
.pill.uploading { color: var(--accent); background: var(--accent-soft); }
.pill.error { color: var(--danger); background: var(--danger-soft); }
.pill .dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; animation: blink 1.1s infinite; }

.todo-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 700; color: var(--accent); }
.todo-chip svg { font-size: 12px; }
.todo-chip.alldone { color: var(--ok); }

.side-empty { text-align: center; color: var(--text-3); padding: 56px 24px; font-size: 13.5px; line-height: 1.7; }

/* ---------- 5. 메인 / 상세 ---------- */
#main { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow: hidden; background: var(--bg); position: relative; }
.main-scroll { flex: 1; overflow-y: auto; }
.main-inner { max-width: 760px; margin: 0 auto; padding: 32px 32px 140px; animation: rise-in .25s both; }

/* 빈 화면 */
.placeholder { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px; animation: fade-in .3s both; }
.ph-icon {
  width: 64px; height: 64px; border-radius: 20px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--sh-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; color: var(--accent); margin-bottom: 18px;
}
.placeholder b { font-size: 16.5px; font-weight: 700; }
.placeholder .sub { color: var(--text-3); font-size: 13.5px; margin-top: 5px; text-align: center; line-height: 1.6; }
.ph-features { display: flex; gap: 10px; margin-top: 26px; flex-wrap: wrap; justify-content: center; }
.ph-feature {
  display: flex; align-items: center; gap: 7px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px;
  padding: 7px 14px; font-size: 12.5px; font-weight: 600; color: var(--text-2);
}
.ph-feature svg { font-size: 14px; color: var(--accent); }

/* 상세 헤더 */
.d-head { display: flex; align-items: flex-start; gap: 8px; }
.d-title-wrap { flex: 1; min-width: 0; }
.d-title {
  font-size: 25px; font-weight: 800; letter-spacing: -0.5px; line-height: 1.3;
  cursor: pointer; border-radius: 6px; display: inline-block; padding: 1px 6px; margin-left: -6px;
  transition: background .12s;
}
.d-title:hover { background: var(--accent-soft); }
.d-meta {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  color: var(--text-3); font-size: 13px; margin-top: 7px;
  font-variant-numeric: tabular-nums;
}
.d-meta .sep { color: var(--border-strong); }
.d-actions { display: flex; gap: 2px; padding-top: 4px; }
.iconbtn {
  width: 34px; height: 34px; border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-2); font-size: 16.5px;
  transition: background .12s, color .12s;
}
.iconbtn:hover { background: var(--surface); box-shadow: var(--sh-sm); color: var(--text); }
.iconbtn.danger:hover { color: var(--danger); background: var(--danger-soft); }

/* 배너 */
.banner {
  display: flex; align-items: center; gap: 12px;
  border-radius: var(--r-md); padding: 13px 16px; margin-top: 20px; font-size: 13.5px;
  animation: rise-in .25s both;
}
.banner.busy { background: var(--accent-soft); color: var(--accent-strong); font-weight: 600; }
.banner.err { background: var(--danger-soft); color: var(--danger); }
.spinner {
  width: 16px; height: 16px; flex: none;
  border: 2.5px solid rgba(91, 91, 214, .2); border-top-color: var(--accent);
  border-radius: 50%; animation: spin .8s linear infinite;
}

/* 탭 */
.tabs {
  position: sticky; top: 0; z-index: 5;
  display: flex; gap: 22px;
  margin-top: 22px;
  background: linear-gradient(var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--border);
}
.tab {
  position: relative; padding: 10px 2px 11px;
  font-size: 14px; font-weight: 650; color: var(--text-3);
  transition: color .12s;
}
.tab:hover { color: var(--text-2); }
.tab.on { color: var(--text); }
.tab.on::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
  background: var(--accent); border-radius: 2px;
}
.tab .n {
  font-size: 11.5px; font-weight: 700; color: var(--text-3);
  background: var(--track); border-radius: 999px; padding: 1px 7px; margin-left: 5px;
  font-variant-numeric: tabular-nums;
}
.tab.on .n { color: var(--accent-strong); background: var(--accent-soft); }

/* 카드/섹션 */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 22px 24px; margin-top: 18px; box-shadow: var(--sh-sm);
  animation: rise-in .25s both;
}
.card-label {
  display: flex; align-items: center; gap: 7px;
  font-size: 12px; font-weight: 800; color: var(--text-3);
  letter-spacing: .6px; margin-bottom: 13px;
}
.card-label svg { font-size: 14px; color: var(--accent); }
.card-label .right { margin-left: auto; font-weight: 600; letter-spacing: 0; font-variant-numeric: tabular-nums; }

.overview { font-size: 15px; line-height: 1.7; color: var(--text); }
.block { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
.block h4 { font-size: 13.5px; font-weight: 700; margin-bottom: 9px; color: var(--text-2); }
.block ul { list-style: none; }
.block li { display: flex; gap: 10px; font-size: 14.5px; line-height: 1.6; margin-bottom: 7px; }
.block li::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); margin-top: 9px; flex: none; }

/* 키워드 칩 */
.kw-row { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 18px; }
.kw {
  font-size: 12.5px; font-weight: 650; color: var(--accent-strong);
  background: var(--accent-soft); border-radius: 999px; padding: 4px 12px;
}

/* 주제별 구간 */
.topics { display: flex; flex-direction: column; }
.topic {
  display: flex; align-items: center; gap: 12px; width: 100%;
  text-align: left; padding: 10px 12px; margin: 0 -12px; width: calc(100% + 24px);
  border-radius: var(--r-sm); transition: background .12s; font-size: 14.5px;
}
.topic:hover { background: var(--surface-2); }
.topic-ts {
  font-size: 12px; font-weight: 700; color: var(--accent-strong);
  background: var(--accent-soft); border-radius: 6px; padding: 2px 8px;
  font-variant-numeric: tabular-nums; flex: none;
}
.topic-t { flex: 1; min-width: 0; }
.topic-play { color: var(--text-3); font-size: 13px; opacity: 0; transition: opacity .12s; }
.topic:hover .topic-play { opacity: 1; color: var(--accent); }

/* 참석자 발화 비율 */
.spk-bar {
  display: flex; height: 10px; border-radius: 5px; overflow: hidden; gap: 2px;
}
.spk-bar > div { min-width: 4px; border-radius: 3px; }
.spk-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 12px; }
.spk-item {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 13px; font-weight: 650; padding: 3px 6px; margin: -3px -6px;
  border-radius: 7px; transition: background .12s;
}
.spk-item:hover { background: var(--surface-2); }
.spk-item .swatch { width: 9px; height: 9px; border-radius: 3px; }
.spk-item .pct { color: var(--text-3); font-weight: 500; font-size: 12px; font-variant-numeric: tabular-nums; }

/* 메모 */
.memo {
  width: 100%; min-height: 88px; resize: vertical;
  border: 1px solid var(--border); border-radius: var(--r-sm);
  background: var(--surface-2); padding: 11px 13px;
  font: inherit; font-size: 14px; line-height: 1.6; color: var(--text);
  outline: none; transition: border-color .15s, background .15s;
}
.memo:focus { border-color: var(--accent); background: var(--surface); }

/* 기록 안 검색 */
.t-search {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-sm);
  padding: 8px 12px; margin-bottom: 10px; color: var(--text-3); font-size: 14px;
  transition: border-color .15s, background .15s;
}
.t-search:focus-within { border-color: var(--accent); background: var(--surface); }
.t-search input { flex: 1; border: 0; outline: 0; background: none; }
.t-search svg { font-size: 14px; }
.t-count { font-size: 12px; font-weight: 700; color: var(--accent-strong); font-variant-numeric: tabular-nums; }
mark { background: #ffe9a8; color: inherit; border-radius: 3px; padding: 0 1px; }

/* ---------- 6. 투두 ---------- */
.todo-progress-row { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.todo-progress { flex: 1; height: 6px; background: var(--track); border-radius: 3px; overflow: hidden; }
.todo-progress > div { height: 100%; background: var(--accent); border-radius: 3px; transition: width .3s cubic-bezier(.2, .8, .2, 1); }
.todo-progress-num { font-size: 12px; font-weight: 700; color: var(--text-2); font-variant-numeric: tabular-nums; }

.todo {
  display: flex; align-items: flex-start; gap: 11px;
  padding: 10px 10px; margin: 0 -10px; border-radius: var(--r-sm);
  transition: background .12s;
}
.todo:hover { background: var(--surface-2); }
.todo input[type="checkbox"] {
  appearance: none; width: 19px; height: 19px; flex: none;
  border: 1.8px solid var(--border-strong); border-radius: 6px;
  cursor: pointer; margin-top: 1.5px; position: relative;
  transition: background .12s, border-color .12s;
}
.todo input[type="checkbox"]:hover { border-color: var(--accent); }
.todo input[type="checkbox"]:checked { background: var(--accent); border-color: var(--accent); }
.todo input[type="checkbox"]:checked::after {
  content: ""; position: absolute; left: 4.5px; top: 1px;
  width: 5px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.todo .tx { flex: 1; font-size: 14.5px; line-height: 1.55; transition: color .15s; }
.todo.done .tx { color: var(--text-3); text-decoration: line-through; text-decoration-color: var(--border-strong); }
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11.5px; font-weight: 650; border-radius: 999px; padding: 1px 8px;
  margin-left: 6px; vertical-align: 1px; white-space: nowrap;
}
.chip.who { color: var(--accent-strong); background: var(--accent-soft); }
.chip.due { color: var(--warn); background: var(--warn-soft); }
.todo .rm {
  width: 26px; height: 26px; border-radius: 7px; flex: none;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3); font-size: 13px; opacity: 0; transition: opacity .12s;
}
.todo:hover .rm { opacity: 1; }
.todo .rm:hover { color: var(--danger); background: var(--danger-soft); }

.todo-add { display: flex; gap: 8px; margin-top: 14px; padding-top: 16px; border-top: 1px solid var(--border); }
.todo-add input {
  flex: 1; border: 1px solid var(--border); border-radius: var(--r-sm);
  padding: 9px 13px; outline: none; background: var(--surface-2); font-size: 14px;
  transition: border-color .15s, background .15s;
}
.todo-add input:focus { border-color: var(--accent); background: var(--surface); }
.todo-add button {
  background: var(--accent-soft); color: var(--accent-strong);
  font-weight: 700; padding: 0 18px; border-radius: var(--r-sm); font-size: 13.5px;
  transition: background .12s;
}
.todo-add button:hover { background: var(--accent-line); }

/* ---------- 7. 전사 ---------- */
.seg {
  display: flex; gap: 12px;
  padding: 11px 12px; margin: 0 -12px; border-radius: var(--r-sm);
  cursor: pointer; transition: background .12s;
}
.seg:hover { background: var(--surface-2); }
.seg.active { background: var(--accent-soft); }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; cursor: pointer;
  transition: transform .1s;
}
.avatar:hover { transform: scale(1.08); }
.seg .body { flex: 1; min-width: 0; }
.seg .who { font-size: 13px; font-weight: 700; cursor: pointer; }
.seg .who:hover { text-decoration: underline; }
.seg .ts { font-size: 11.5px; color: var(--text-3); margin-left: 8px; font-variant-numeric: tabular-nums; }
.seg .tx { font-size: 14.5px; line-height: 1.65; margin-top: 2px; color: var(--text); }
.hint { color: var(--text-3); font-size: 12px; margin-top: 12px; }

/* ---------- 8. 플레이어 (하단 도킹) ---------- */
.player {
  flex: none;
  display: flex; align-items: center; gap: 14px;
  background: var(--surface); border-top: 1px solid var(--border);
  padding: 12px 20px;
  animation: rise-in .25s both;
}
.player .pp {
  width: 40px; height: 40px; border-radius: 50%; flex: none;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 16px;
  box-shadow: var(--sh-sm); transition: background .12s, transform .1s;
}
.player .pp:hover { background: var(--accent-strong); }
.player .pp:active { transform: scale(.94); }
.player .skip {
  width: 32px; height: 32px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-2); font-size: 17px; transition: background .12s;
}
.player .skip:hover { background: var(--bg); }
.player .bar { flex: 1; min-width: 0; }
.player .track { height: 5px; background: var(--track); border-radius: 3px; cursor: pointer; position: relative; }
.player .track:hover { height: 7px; margin: -1px 0; }
.player .fill { height: 100%; background: var(--accent); border-radius: 3px; width: 0; position: relative; }
.player .fill::after {
  content: ""; position: absolute; right: -5px; top: 50%; transform: translateY(-50%);
  width: 11px; height: 11px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 1px 4px rgba(20, 22, 40, .3); opacity: 0; transition: opacity .12s;
}
.player .track:hover .fill::after { opacity: 1; }
.player .times { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-3); margin-top: 5px; font-variant-numeric: tabular-nums; }
.player .speed {
  flex: none; font-size: 12px; font-weight: 700; color: var(--text-2);
  border: 1px solid var(--border); border-radius: 999px; padding: 4px 11px;
  min-width: 52px; text-align: center; font-variant-numeric: tabular-nums;
  transition: border-color .12s, color .12s;
}
.player .speed:hover { border-color: var(--accent); color: var(--accent-strong); }

/* ---------- 9. 녹음 오버레이 ---------- */
.rec-overlay {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(18, 19, 26, .5);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center; padding: 24px;
  animation: fade-in .2s both;
}
.rec-panel {
  width: 100%; max-width: 460px;
  background: var(--surface); border-radius: 24px; box-shadow: var(--sh-lg);
  padding: 40px 36px 34px; text-align: center; position: relative;
  animation: scale-in .22s cubic-bezier(.2, .8, .2, 1) both;
}
.rec-x {
  position: absolute; top: 14px; right: 14px;
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3); font-size: 15px; transition: background .12s, color .12s;
}
.rec-x:hover { background: var(--bg); color: var(--text); }
.rec-state { font-size: 13px; font-weight: 700; color: var(--text-3); letter-spacing: .5px; }
.rec-state.on { color: var(--danger); }
.rec-timer {
  font-size: 54px; font-weight: 250; letter-spacing: 1px;
  font-variant-numeric: tabular-nums; margin-top: 6px; line-height: 1.15;
}
.rec-canvas { width: 100%; height: 64px; margin: 20px 0 4px; display: block; }
.rec-err { color: var(--danger); font-size: 13px; margin-top: 12px; line-height: 1.5; }
.rec-controls { display: flex; align-items: center; justify-content: center; gap: 22px; margin-top: 22px; }
.rec-main-btn {
  width: 76px; height: 76px; border-radius: 50%; position: relative;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 30px;
  box-shadow: 0 6px 20px rgba(91, 91, 214, .4);
  transition: background .15s, transform .1s;
}
.rec-main-btn:hover { background: var(--accent-strong); }
.rec-main-btn:active { transform: scale(.95); }
.rec-main-btn.on { background: var(--danger); box-shadow: 0 6px 20px rgba(214, 73, 79, .4); }
.rec-ring {
  position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid var(--danger); opacity: 0; pointer-events: none;
}
.rec-main-btn.on .rec-ring { animation: rec-pulse 1.4s ease-out infinite; }
@keyframes rec-pulse { 0% { transform: scale(1); opacity: .55; } 100% { transform: scale(1.65); opacity: 0; } }
.rec-tip { color: var(--text-3); font-size: 12.5px; margin-top: 22px; line-height: 1.65; }
.rec-busy { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 26px 0 12px; }

/* ---------- 10. 모달 / 토스트 ---------- */
.modal-bg {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(18, 19, 26, .45);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 24px;
  animation: fade-in .15s both;
}
.modal {
  width: 100%; max-width: 380px;
  background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--sh-lg);
  padding: 22px;
  animation: scale-in .18s cubic-bezier(.2, .8, .2, 1) both;
}
.modal h3 { font-size: 16.5px; font-weight: 800; letter-spacing: -0.2px; }
.modal p { font-size: 13.5px; color: var(--text-2); margin-top: 8px; line-height: 1.55; word-break: break-all; }
.modal input {
  width: 100%; border: 1px solid var(--border); border-radius: var(--r-sm);
  padding: 10px 13px; font-size: 14.5px; margin-top: 14px; outline: none; background: var(--surface-2);
  transition: border-color .15s, background .15s;
}
.modal input:focus { border-color: var(--accent); background: var(--surface); }
.modal .btns { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; }
.modal .btns button {
  padding: 9px 16px; border-radius: var(--r-sm); font-weight: 700; font-size: 13.5px;
  transition: filter .12s, background .12s;
}
.modal .ghost { background: var(--bg); color: var(--text-2); }
.modal .ghost:hover { background: var(--track); }
.modal .primary { background: var(--accent); color: #fff; }
.modal .primary:hover { background: var(--accent-strong); }
.modal .dangerbtn { background: var(--danger); color: #fff; }
.modal .dangerbtn:hover { filter: brightness(.94); }

#toast {
  position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%);
  background: rgba(24, 26, 32, .94); color: #fff;
  font-size: 13.5px; font-weight: 600;
  padding: 11px 19px; border-radius: 999px; z-index: 60; pointer-events: none;
  box-shadow: var(--sh-md);
  animation: rise-in .2s both;
}

/* ---------- 11. 스켈레톤 ---------- */
.sk {
  background: linear-gradient(90deg, var(--track) 25%, #f4f4f6 50%, var(--track) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
  border-radius: 6px;
}
.sk-detail { max-width: 760px; margin: 0 auto; padding: 36px 32px; }

/* ---------- 12. 반응형 ---------- */
@media (max-width: 840px) {
  #sidebar { width: 100%; border-right: 0; }
  #main { display: none; }
  body.detail-open #sidebar { display: none; }
  body.detail-open #main { display: flex; }
  .main-inner { padding: 20px 18px 140px; }
  .d-title { font-size: 21px; }
  .item .del { opacity: 1; }
  .todo .rm { opacity: 1; }
  .player { padding: 10px 14px; gap: 10px; }
  .player .skip { display: none; }
}
@media (min-width: 841px) { .only-mobile { display: none !important; } }
