/* 의견 접수함(트레저러/의견수거함/public/admin.html)과 같은 디자인 — 2026-10-20 '덜 정신사납게' 최종본 기준.
   점 찍힌 종이, 2px 잉크 선, 비뚤한 모서리, 2~3px 오프셋 그림자(지금 고른 것·카드에만), 포스트잇 노랑, 손그림 밑줄.
   녹취 본문은 읽기용 글꼴 17.5px로 두고, 손글씨 글꼴은 제목·도구에만 쓴다. */
@font-face { font-family: "KMU80 Haeong Sans"; font-weight: 400; font-display: swap; src: url("/static/fonts/haeongsans.woff2") format("woff2"); }
@font-face { font-family: "Gowun Dodum"; font-weight: 400; font-display: swap; src: url("/static/fonts/GowunDodum-Regular.woff2") format("woff2"); }

:root {
  --paper: #fdfbf7; --dot: #e5e0d8; --ink: #2d2d2d; --ink-soft: #6b665e; --ink-mute: #8a857c;
  --red: #ff4d4d; --red-ink: #e03c3c; --red-soft: #ffe8e8; --blue: #2d5da1; --green: #0c7a55; --mint: #d6f0e4;
  --postit: #fff9c4; --hl: #ffe96a; --muted: #e5e0d8; --surface: #fff;
  --peach: #fde7cf; --lilac: #e9dcfb; --skyb: #d6e6fb;
  --accent-green: #0ACB8F; /* 더벨 로그인 앱(tool.css) 형광초록. 채움에만 쓴다 — 종이 위 글자색으로는 대비가 낮다 */
  --radius: 12px 6px 11px 7px / 7px 11px 6px 12px;
  --radius-lg: 12px 26px 10px 24px / 24px 10px 26px 12px;
  --radius-card: 22px 6px 20px 8px / 8px 20px 6px 22px;
  --radius-in: 14px 6px 12px 8px / 8px 12px 6px 14px;
  --radius-note: 6px 18px 8px 16px / 16px 8px 18px 6px;
  --blob: 50% 45% 55% 48% / 52% 50% 46% 50%;
  --shadow: 2px 2px 0 0 var(--ink);
  --shadow-card: 3px 3px 0 0 var(--ink);
  --shadow-lg: 8px 8px 0 0 var(--ink);
  --font: "Gowun Dodum", "Malgun Gothic", "Apple SD Gothic Neo", system-ui, sans-serif;
  --font-display: "KMU80 Haeong Sans", "Malgun Gothic", "Apple SD Gothic Neo", system-ui, sans-serif;
  --wave-title: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 10'%3E%3Cpath d='M-12 5 Q -6 8 0 5 T 12 5 T 24 5 T 36 5' fill='none' stroke='%23ff4d4d' stroke-width='3.5'/%3E%3C/svg%3E");
  --caret: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%232d2d2d' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E");
  --check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-7' fill='none' stroke='%232d2d2d' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --top-h: 66px;
  --side-w: 300px;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  color: var(--ink);
  font: 400 16px/1.6 var(--font);
  word-break: keep-all;
  overflow-wrap: anywhere;
  background: var(--paper) radial-gradient(var(--dot) 1px, transparent 1px) 0 0 / 24px 24px;
}
button, input, select, textarea { font-family: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
:focus-visible { outline: 3px dashed var(--blue); outline-offset: 3px; }
svg { width: 18px; height: 18px; flex: none; }

/* ---------- layout ---------- */
.app {
  display: grid;
  grid-template-columns: var(--side-w) minmax(0, 1fr);
  grid-template-rows: var(--top-h) minmax(0, 1fr) auto;
  grid-template-areas: "top top" "side main" "player player";
  height: 100vh;
  height: 100dvh;
}
.topbar {
  grid-area: top;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 24px;
  border-bottom: 2px dashed var(--muted);
  z-index: 3;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 3px 15px 3px 10px;
  font: 400 21px var(--font-display);
  letter-spacing: -.01em;
  background: var(--surface);
  border: 2.5px solid var(--ink);
  border-radius: var(--radius);
  white-space: nowrap;
}
.brand svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* status pills (API · 폴더 자동) */
.api-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 14px 0 12px;
  font: 400 15.5px var(--font-display);
  color: var(--ink);
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: 999px;
  box-shadow: var(--shadow);
  white-space: nowrap;
  transition: transform .1s, box-shadow .1s, background .1s;
}
.api-chip:hover { background: var(--postit); box-shadow: 1px 1px 0 0 var(--ink); transform: translate(1px, 1px); }
.api-chip .dot { width: 11px; height: 11px; border-radius: var(--blob); border: 1.5px solid var(--ink); background: var(--muted); }
.api-chip .chip-sub { color: var(--ink-soft); }
.api-chip[data-state="missing"], .api-chip[data-state="auth_failed"], .api-chip[data-state="store_error"],
.watch-chip[data-state="paused"], .watch-chip[data-state="error"] { background: var(--red-soft); color: var(--red-ink); }
.api-chip[data-state="missing"] .dot, .api-chip[data-state="auth_failed"] .dot, .api-chip[data-state="store_error"] .dot,
.watch-chip[data-state="paused"] .dot, .watch-chip[data-state="error"] .dot { background: var(--red); }
.watch-chip[data-state="paused"] .chip-sub, .watch-chip[data-state="error"] .chip-sub { color: inherit; }
.api-chip[data-state="unverified"] .dot, .watch-chip[data-state="waiting"] .dot { background: var(--blue); }
.api-chip[data-state="verified"] .dot, .watch-chip[data-state="on"] .dot { background: var(--accent-green); }
.watch-chip[data-state="on"] .chip-sub { color: var(--green); }
.watch-chip { margin-left: auto; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  color: var(--ink);
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform .1s, box-shadow .1s, background .1s;
}
.icon-btn:hover { background: var(--hl); box-shadow: 1px 1px 0 0 var(--ink); transform: translate(1px, 1px); }
.icon-btn svg { fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
#moreBtn svg { fill: currentColor; stroke: none; }
.only-narrow { display: none; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 40px;
  padding: 0 16px;
  font: 400 16px var(--font-display);
  color: var(--ink);
  white-space: nowrap;
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform .1s, box-shadow .1s, background .1s;
}
.btn:hover:not(:disabled) { background: var(--hl); box-shadow: 1px 1px 0 0 var(--ink); transform: translate(1px, 1px); }
.btn:active:not(:disabled) { box-shadow: none; transform: translate(2px, 2px); }
.btn:disabled { opacity: .45; }
.btn.primary { background: var(--postit); }
.btn.primary:hover:not(:disabled) { background: var(--hl); }
.btn.danger { background: var(--red); color: #fff; }
.btn.danger:hover:not(:disabled) { background: var(--red-ink); color: #fff; }
.btn.sm { height: 34px; padding: 0 12px; font-size: 15px; }
.btn.ghost { box-shadow: none; }
.btn.ghost:hover:not(:disabled) { transform: none; box-shadow: none; }
.btn.block { width: 100%; height: 46px; font-size: 18px; }
/* 링크처럼 보이는 버튼: 의견 접수함의 '바꾸기' */
.link-btn, .btn.danger-text {
  height: auto;
  padding: 0 0 1px;
  font: 400 15px var(--font-display);
  color: var(--red-ink);
  background: none;
  border: 0;
  border-bottom: 2px solid var(--red);
  border-radius: 0;
  box-shadow: none;
}
.link-btn:hover, .btn.danger-text:hover:not(:disabled) { color: var(--ink); background: none; transform: none; box-shadow: none; }

/* 체크상자: 의견 접수함의 고르기 상자 */
input[type="checkbox"] {
  appearance: none;
  width: 22px;
  height: 22px;
  margin: 0;
  flex: none;
  background: var(--surface) no-repeat center / 16px 16px;
  border: 2px solid var(--ink);
  border-radius: 7px 4px 8px 5px;
  cursor: pointer;
  vertical-align: middle;
}
input[type="checkbox"]:checked { background-color: var(--hl); background-image: var(--check); }
input[type="checkbox"]:disabled { opacity: .45; cursor: default; }

/* ---------- sidebar ---------- */
.sidebar {
  grid-area: side;
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 2px dashed var(--muted);
}
.side-top { padding: 20px 20px 10px; }
.side-hint { margin: 10px 2px 0; font-size: 13.5px; color: var(--ink-soft); line-height: 1.5; }
.list-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px 8px;
  font: 400 19px var(--font-display);
}
#listCount {
  min-width: 24px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  display: inline-grid;
  place-items: center;
}
#listCount:empty { display: none; }
.rec-list { list-style: none; margin: 0; padding: 4px 14px 18px; overflow-y: auto; flex: 1; }
.rec-list li + li { margin-top: 6px; }
.rec {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 12px 11px;
  background: transparent;
  border: 2px solid transparent;
  border-radius: var(--radius);
}
.rec:hover { background: var(--surface); border-color: var(--muted); }
.rec[aria-current="true"] { background: var(--surface); border-color: var(--ink); box-shadow: var(--shadow-card); }
.rec-title {
  display: inline-block;
  max-width: 100%;
  vertical-align: top;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font: 400 17px/1.35 var(--font-display);
}
.rec[aria-current="true"] .rec-title { box-shadow: inset 0 -.45em 0 var(--hl); }
.rec-sub { display: flex; align-items: center; gap: 8px; margin-top: 5px; font-size: 13.5px; color: var(--ink-mute); font-variant-numeric: tabular-nums; }
.rec-sub .warn { font-family: var(--font-display); color: var(--red-ink); }
.rec.pending { opacity: .7; }
.list-empty { margin: 4px 22px; font-size: 14.5px; color: var(--ink-soft); }

/* 상태 딱지 */
.st {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 9px;
  font: 400 13.5px/22px var(--font-display);
  color: var(--ink);
  background: var(--surface);
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  white-space: nowrap;
}
.st-uploaded { color: var(--ink-soft); }
.st-processing { background: var(--postit); color: var(--blue); }
.st-processing::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: pulse 1.2s ease-in-out infinite; }
.st-completed { background: var(--mint); color: var(--green); }
.st-failed { background: var(--red-soft); color: var(--red-ink); }
.st-interrupted { background: var(--peach); color: #8a4b12; }
@keyframes pulse { 50% { opacity: .25; } }

/* ---------- main ---------- */
.main { grid-area: main; overflow-y: auto; min-height: 0; }
.main:focus { outline: none; }
.intro { padding: 10vh 32px 40px; text-align: center; }
.dropbox {
  position: relative;
  display: inline-block;
  max-width: 560px;
  padding: 30px 36px 28px;
  background: var(--postit);
  border: 2px solid var(--ink);
  border-radius: var(--radius-note);
  box-shadow: var(--shadow-card);
}
.dropbox::before {
  content: "";
  position: absolute;
  top: -11px;
  left: 50%;
  width: 20px;
  height: 20px;
  margin-left: -10px;
  border-radius: 50%;
  background: var(--red);
  border: 2px solid var(--ink);
}
.dropbox-title { margin: 0 0 6px; font: 400 24px var(--font-display); }
.dropbox-sub { margin: 0 0 20px; font-size: 15px; color: var(--ink-soft); }

.doc { max-width: 1000px; margin: 0 auto; padding: 28px 40px 56px; }
.doc-head { padding-bottom: 16px; border-bottom: 2px dashed var(--muted); }
.title-row { display: flex; align-items: flex-start; gap: 14px; flex-wrap: wrap; }
.title-input {
  flex: 0 1 auto;
  min-width: 4em;
  max-width: 100%;
  field-sizing: content;
  margin: 0 0 0 -6px;
  padding: 2px 4px 12px;
  font: 400 34px/1.15 var(--font-display);
  letter-spacing: -.01em;
  color: var(--ink);
  /* 손그림 물결 밑줄: 24px 고정 주기를 반복해 제목 길이와 무관하게 잔잔하게, 아래 패딩(12px) 안에만 그린다 */
  background: var(--wave-title) repeat-x left 0 bottom 1px / 24px 10px;
  background-clip: padding-box;
  border: 2px solid transparent;
  border-radius: var(--radius);
}
.title-input:hover { border-color: var(--muted); border-style: dashed; }
.title-input:focus { outline: none; border: 2px dotted var(--blue); background-color: var(--surface); }
.head-tools { display: flex; align-items: center; gap: 10px; margin-left: auto; padding-top: 4px; flex-wrap: wrap; }
.save-state { display: inline-flex; align-items: center; gap: 8px; font: 400 15px var(--font-display); color: var(--green); white-space: nowrap; }
.save-state.error { color: var(--red-ink); }
.save-state:empty { display: none; }

/* 내보내기: 의견 접수함의 필터 묶음처럼 테두리 하나에 버튼 여럿 */
.export { display: inline-flex; gap: 2px; padding: 3px; background: var(--surface); border: 2px solid var(--ink); border-radius: 999px; }
.export .btn { height: 32px; padding: 0 13px; font-size: 15px; border: 0; border-radius: 999px; box-shadow: none; background: transparent; }
.export .btn:hover:not(:disabled) { background: var(--hl); transform: none; box-shadow: none; }

.doc-meta { margin: 8px 0 0; font-size: 14.5px; color: var(--ink-soft); }
.doc-meta .tag {
  display: inline-flex;
  align-items: center;
  margin-left: 4px;
  padding: 0 9px;
  font: 400 13.5px/22px var(--font-display);
  color: var(--ink);
  background: var(--surface);
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
}
.export-note { margin: 8px 0 0; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 14.5px; color: var(--ink); }
.export-note .path { font-family: var(--font); }
.export-note.bad { color: var(--red-ink); }
.export-note .msg { flex-basis: 100%; color: var(--ink-soft); font-size: 13.5px; }

.menu-wrap { position: relative; }
.menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 200px;
  padding: 6px;
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  z-index: 10;
}
.menu button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 12px;
  font: 400 16px var(--font-display);
  background: transparent;
  border: 0;
  border-radius: 8px;
}
.menu button:hover:not(:disabled), .menu button:focus-visible { background: var(--hl); outline: none; }
.menu button:disabled { color: var(--ink-mute); opacity: .7; }
.menu button.danger { color: var(--red-ink); }

/* ---------- job panel (받아쓰기 설정·진행) ---------- */
.job {
  margin-top: 22px;
  padding: 20px 24px 22px;
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}
.job-grid { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 14px 18px; align-items: center; }
.job-grid > .lbl { font: 400 16px var(--font-display); color: var(--ink-soft); }
.seg-ctl { display: inline-flex; gap: 2px; padding: 3px; width: max-content; background: var(--surface); border: 2px solid var(--ink); border-radius: 999px; }
.seg-ctl label { position: relative; }
.seg-ctl input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.seg-ctl span { display: block; height: 34px; padding: 0 14px; font: 400 15.5px/34px var(--font-display); color: var(--ink-soft); border-radius: 999px; }
.seg-ctl label:hover input:not(:checked) + span { background: var(--paper); color: var(--ink); }
.seg-ctl input:checked + span { background: var(--ink); color: #fff; }
.seg-ctl input:focus-visible + span { outline: 3px dashed var(--blue); outline-offset: 2px; }
.inline { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; font: 400 16px var(--font-display); }
.select, .text-input {
  height: 40px;
  padding: 0 12px;
  font: 400 15.5px var(--font);
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: var(--radius-in);
}
.select { appearance: none; padding-right: 32px; background: var(--surface) var(--caret) no-repeat right 12px center / 10px 6px; }
.text-input { width: 100%; }
.select:focus, .text-input:focus { outline: none; border: 2.5px dotted var(--blue); }
.select:disabled { opacity: .45; }
.job-actions { display: flex; align-items: center; gap: 14px; margin-top: 18px; flex-wrap: wrap; }
.job-note { font-size: 14.5px; color: var(--ink-soft); }
.job-note.need { font: 400 16px var(--font-display); color: var(--red-ink); }
.job-warn, .job-error {
  margin: 0 0 14px;
  padding: 9px 14px;
  font-size: 15px;
  border-radius: var(--radius);
}
.job-warn { background: var(--postit); border: 1.5px dashed var(--ink); color: var(--ink); }
.job-error { background: var(--red-soft); border: 1.5px dashed var(--red-ink); color: var(--red-ink); }
.job-error .detail { display: block; margin-top: 4px; font-size: 13px; color: var(--ink-soft); }
.job-progress { display: flex; align-items: center; gap: 12px; font: 400 19px var(--font-display); }
.job-progress .elapsed { font: 400 16px var(--font); color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.spinner { width: 22px; height: 22px; flex: none; border-radius: 50%; border: 3px solid var(--muted); border-top-color: var(--ink); animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.job-sub { margin: 8px 0 0 34px; font-size: 14.5px; color: var(--ink-soft); }

/* ---------- speakers ---------- */
.speakers { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 20px 0 16px; }
.speakers-label { margin-right: 4px; font: 400 18px var(--font-display); }
.spk {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 8px 0 5px;
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
}
.spk .av, .spk .dot {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: none;
  font: 400 14px var(--font-display);
  background: var(--spk);
  border: 2px solid var(--ink);
  border-radius: var(--blob);
}
/* 이름 길이에 맞춘 너비. 고정 width를 두면 field-sizing보다 우선해 긴 이름 끝이 잘린다.
   상한은 %가 아닌 vw로: 입력칸은 폼 요소라 %를 주면 내용 폭이 0으로 계산된다.
   (아바타·발언 수·지우기·여백 ≈ 150px을 뺀 화면 폭, 넓은 화면에서는 20em) */
.spk-name {
  min-width: 3em;
  max-width: min(20em, calc(100vw - 150px));
  field-sizing: content;
  padding: 2px 2px 1px;
  font: 400 17px var(--font-display);
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
}
.spk-name:focus { outline: none; border-bottom: 2px dotted var(--blue); }
.spk-name.invalid { border-bottom-color: var(--red); }
.spk-count {
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  display: inline-grid;
  place-items: center;
  font-size: 12.5px;
  color: #fff;
  background: var(--ink);
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
}
.spk-del { width: 26px; height: 26px; padding: 0; font: 400 18px/1 var(--font-display); color: var(--ink-mute); background: none; border: 0; border-radius: 7px; }
.spk-del:hover { background: var(--red-soft); color: var(--red-ink); }
.speakers .add-spk { height: 44px; border-style: dashed; box-shadow: none; }
/* 화자 이름 자동 찾기: AI가 붙인 이름 표시 + 이름칸 아래 후보·근거 상자 */
.spk { position: relative; }
.spk.ai-named .spk-name { text-decoration: underline dotted var(--blue) 1.5px; text-underline-offset: 4px; }
.name-hints {
  position: absolute; top: calc(100% + 6px); left: -2px; z-index: 30;
  width: min(420px, calc(100vw - 32px)); padding: 10px 12px 8px;
  background: var(--surface); border: 2px solid var(--ink); border-radius: var(--radius); box-shadow: var(--shadow-card);
}
.nh-head { font: 400 15px var(--font-display); margin-bottom: 6px; }
.nh-empty { margin: 4px 0 6px; font-size: 14px; color: var(--ink-soft); }
.nh-item + .nh-item { margin-top: 8px; padding-top: 8px; border-top: 1.5px dashed var(--muted); }
.nh-cand {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%;
  padding: 6px 8px; font: 400 16px var(--font-display); text-align: left;
  background: var(--postit); border: 2px solid var(--ink); border-radius: var(--radius-in); cursor: pointer;
}
.nh-cand:hover { box-shadow: var(--shadow); }
.nh-cand.on { background: var(--mint); }
.nh-apply { font: 400 13px var(--font); color: var(--ink-soft); flex: none; }
.nh-ev { margin: 4px 2px 0; font-size: 13px; line-height: 1.45; color: var(--ink-soft); }
.nh-rerun { margin-top: 8px; font-size: 13.5px; }
.speakers .add-spk:hover { transform: none; box-shadow: none; }

/* 화자 색: 서로 또렷이 구별되는 선명한 색. 잉크 테두리와 이름을 늘 같이 써서 색만으로 구별하지 않는다.
   빨강(#ff4d4d, 위험·재생)과 형광펜 노랑(#ffe96a, 재생 위치)은 화자 색으로 쓰지 않는다. */
/* 앞 네 색(초록·코랄·밝은 파랑·보라)이 서로 가장 멀다 — 녹취 대부분은 화자 2~4명 */
.c0 { --spk: var(--accent-green); } .c1 { --spk: #ff6f59; } .c2 { --spk: #3d9bff; } .c3 { --spk: #9b6bff; }
.c4 { --spk: #ffa41b; } .c5 { --spk: #ff4fa0; } .c6 { --spk: #9fcf1f; } .c7 { --spk: #00b8d9; }

/* ---------- transcript ---------- */
.transcript {
  padding: 6px 28px;
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}
.transcript:empty { display: none; }
.seg {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 4px 14px;
  margin: 0 -28px;
  padding: 14px 28px 12px;
  border-bottom: 1.5px dashed var(--muted);
  box-shadow: inset 6px 0 0 var(--spk); /* 화자 색 띠 */
}
.seg:last-child { border-bottom: 0; }
.seg-time {
  align-self: start;
  margin-top: 1px;
  padding: 2px 8px;
  font: 400 15.5px var(--font-display);
  font-variant-numeric: tabular-nums;
  color: var(--blue);
  text-align: left;
  background: transparent;
  border: 2px solid transparent;
  border-radius: var(--radius);
}
.seg-time:hover:not(:disabled) { background: var(--hl); border-color: var(--ink); }
.seg-time:disabled { color: var(--ink-mute); }
.seg.playing { background: #fffdf0; }
.seg.playing .seg-time { background: var(--hl); border-color: var(--ink); color: var(--ink); }
.seg-head { display: flex; align-items: center; gap: 8px; min-height: 30px; }
/* 너비 상한은 폼 요소가 아닌 이 감싸개에 둔다. <button>에 max-width:%를 주면 내용 폭이 0으로 계산돼 이름이 '화…'로 잘린다 */
.spk-pick { display: flex; align-items: center; flex: 0 1 auto; min-width: 0; max-width: 100%; }
.spk-pick > .picker { min-width: 0; }
.spk-trigger { margin-left: -8px; }
.seg.cont .spk-trigger { color: var(--ink-soft); font-size: 15.5px; }
.seg-edited { font: 400 13.5px var(--font-display); color: var(--blue); text-decoration: underline wavy var(--blue) 1.5px; text-underline-offset: 4px; }
.seg-text {
  display: block;
  width: 100%;
  min-height: 1.8em;
  margin: 0 0 0 -10px;
  padding: 3px 8px;
  font: 400 17.5px/1.78 var(--font);
  color: var(--ink);
  background: transparent;
  border: 2px solid transparent;
  border-radius: var(--radius-note);
  resize: none;
  overflow: hidden;
  field-sizing: content;
}
.seg-text:hover:not([readonly]) { border-color: var(--muted); border-style: dashed; }
.seg-text:focus { outline: none; border: 2px dotted var(--blue); background: var(--surface); }
.seg-text[readonly] { color: var(--ink-soft); }
.transcript-empty { margin: 0; padding: 22px 0; color: var(--ink-soft); }

/* ---------- player ---------- */
.player {
  grid-area: player;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 22px;
  background: var(--paper);
  border-top: 2px solid var(--ink);
  z-index: 3;
}
.play {
  display: grid;
  place-items: center;
  flex: none;
  width: 48px;
  height: 48px;
  padding: 0;
  color: #fff;
  background: var(--red);
  border: 2px solid var(--ink);
  border-radius: var(--blob);
  box-shadow: var(--shadow);
  transition: transform .1s, box-shadow .1s;
}
.play svg { width: 20px; height: 20px; fill: currentColor; }
.play:hover:not(:disabled) { box-shadow: 1px 1px 0 0 var(--ink); transform: translate(1px, 1px); }
.play:disabled { color: var(--ink-mute); background: var(--muted); box-shadow: none; }
.play .i-pause { display: none; }
.play.playing .i-play { display: none; }
.play.playing .i-pause { display: block; }
.time { min-width: 50px; text-align: center; font: 400 16px var(--font-display); font-variant-numeric: tabular-nums; }
#seek {
  flex: 1;
  min-width: 80px;
  height: 16px;
  margin: 0;
  appearance: none;
  background: linear-gradient(90deg, var(--hl) var(--p, 0%), var(--surface) var(--p, 0%));
  border: 2px solid var(--ink);
  border-radius: 999px;
  cursor: pointer;
}
#seek::-webkit-slider-thumb { appearance: none; width: 22px; height: 22px; background: var(--surface); border: 2px solid var(--ink); border-radius: var(--blob); box-shadow: 1px 1px 0 0 var(--ink); }
#seek::-moz-range-thumb { width: 18px; height: 18px; background: var(--surface); border: 2px solid var(--ink); border-radius: var(--blob); }
#seek:disabled { opacity: .45; cursor: default; }
#rate {
  height: 36px;
  padding: 0 30px 0 12px;
  appearance: none;
  font: 400 15.5px var(--font-display);
  background: var(--surface) var(--caret) no-repeat right 11px center / 10px 6px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
}
.follow { display: inline-flex; align-items: center; gap: 7px; font: 400 15.5px var(--font-display); white-space: nowrap; }
.player-note { font-size: 14px; color: var(--ink-soft); white-space: nowrap; }
.player-note:empty { display: none; }

/* ---------- dropdown (Picker: 화자 · 참석자 수 · 재생 속도) ---------- */
.picker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 2px 28px 2px 8px;
  font: 400 17px var(--font-display);
  color: var(--ink);
  text-align: left;
  white-space: nowrap;
  background: transparent var(--caret) no-repeat right 10px center / 10px 6px;
  border: 2px solid transparent;
  border-radius: var(--radius);
}
.picker:hover:not(:disabled) { border-color: var(--ink); background-color: var(--surface); }
.picker.open { border-color: var(--ink); background-color: var(--postit); box-shadow: var(--shadow); }
.picker:disabled { opacity: .5; }
.picker-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.picker-swatch { width: 18px; height: 18px; flex: none; background: var(--spk, var(--muted)); border: 2px solid var(--ink); border-radius: var(--blob); }
.picker.boxed {
  height: 40px;
  padding: 0 34px 0 12px;
  font-size: 16px;
  background-color: var(--surface);
  border-color: var(--ink);
  border-radius: var(--radius-in);
}
.picker.boxed:hover:not(:disabled) { background-color: var(--hl); }
.picker.boxed.open { background-color: var(--postit); }
.picker.rate { height: 36px; border-radius: var(--radius); }
.picker-pop {
  position: fixed;
  z-index: 80;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 6px;
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}
.picker-opt {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px 7px 9px;
  font: 400 16.5px var(--font-display);
  white-space: nowrap;
  border-radius: 8px;
  cursor: pointer;
}
.picker-opt::after { content: ""; width: 20px; height: 20px; flex: none; margin-left: auto; border: 2px solid transparent; border-radius: var(--blob); }
.picker-opt.active { background: var(--hl); }
.picker-opt-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.picker-opt[aria-selected="true"] .picker-opt-label { box-shadow: inset 0 -.45em 0 var(--hl); }
/* 현재 선택: 잉크 테두리 형광초록 얼룩 안의 체크 */
.picker-opt[aria-selected="true"]::after { background: var(--accent-green) var(--check) no-repeat center / 14px 14px; border-color: var(--ink); }
.picker-opt.action { margin-top: 4px; padding-top: 9px; color: var(--blue); border-top: 1.5px dashed var(--muted); border-radius: 0 0 8px 8px; }
.picker-opt.disabled { opacity: .45; cursor: default; }

/* ---------- dialogs ---------- */
dialog {
  width: min(540px, calc(100vw - 28px));
  max-height: 92vh;
  padding: 0;
  color: var(--ink);
  background: var(--surface);
  border: 2.5px solid var(--ink);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}
dialog.wide { width: min(660px, calc(100vw - 28px)); }
dialog::backdrop { background: rgba(45, 45, 45, .55); }
.dlg { padding: 26px 28px 22px; }
.dlg h2 { margin: 0 0 12px; font: 400 25px/1.2 var(--font-display); letter-spacing: -.01em; }
.dlg h3 { font-weight: 400; }
.dlg-body { margin: 0 0 10px; font-size: 15.5px; line-height: 1.6; white-space: pre-line; }
.dlg-notice {
  margin: 0 0 14px;
  padding: 10px 14px;
  font: 400 16px var(--font-display);
  background: var(--postit);
  border: 1.5px dashed var(--ink);
  border-radius: var(--radius);
}
.dlg-error { margin: 10px 0 0; font: 400 16px var(--font-display); color: var(--red-ink); }
.settings-status { margin: 0 0 16px; font-size: 15px; color: var(--ink-soft); }
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; margin-bottom: 6px; font: 400 16px var(--font-display); color: var(--ink-soft); }
.field input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  font: 400 16px var(--font);
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: var(--radius-in);
}
.field input:focus { outline: none; border: 2.5px dotted var(--blue); }
.field input[readonly] { background: var(--paper); color: var(--ink-soft); }
.masked { -webkit-text-security: disc; text-security: disc; }
.field-help { margin: 0; font-size: 14px; color: var(--ink-soft); line-height: 1.6; }
.dlg-actions { display: flex; align-items: center; gap: 10px; margin-top: 20px; }
.spacer { flex: 1; }
.dlg-foot { margin-top: 16px; padding-top: 12px; border-top: 1.5px dashed var(--muted); }

/* 폴더 자동 */
.phone-note {
  margin: 0 0 18px;
  padding: 12px 16px;
  font-size: 14.5px;
  line-height: 1.6;
  background: var(--postit);
  border: 1.5px dashed var(--ink);
  border-radius: var(--radius);
}
.phone-note p { margin: 0; }
.phone-note p + p { margin-top: 6px; }
.phone-note strong { font-weight: 400; box-shadow: inset 0 -.45em 0 var(--hl); }
.phone-note .links a { font-family: var(--font-display); color: var(--red-ink); text-decoration: none; border-bottom: 2px solid var(--red); }
.phone-note h3, .pc-title { margin: 0 0 6px; font: 400 18px var(--font-display); }
.phone-note h3 span, .pc-title span { margin-left: 6px; font-size: 14px; color: var(--ink-soft); }
.field > .path-row { display: flex; gap: 8px; margin: 0; font: inherit; color: inherit; }
.path-row input { flex: 1; min-width: 0; }
.path-row .btn { height: 46px; }
.same-folder { margin: -4px 0 8px; }
.watch-where { margin: 0 0 14px; font-size: 14.5px; }
.watch-where::before { content: "→ "; color: var(--red-ink); }
.watch-opts { margin: 4px 0 14px; }
.dlg-notice p { margin: 0; }
.notice-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.watch-recent { margin-top: 18px; padding-top: 14px; border-top: 1.5px dashed var(--muted); }
.watch-recent h3 { margin: 0 0 6px; font: 400 18px var(--font-display); }
/* overflow-x를 따로 막고 오른쪽·아래 여백을 둔다: 끝 칸 'Word 열기'의 hover 이동(1~2px)이 목록 밖으로
   넘치면 가로 스크롤바가 생겨 목록 높이→가운데 정렬된 창 위치가 바뀌고 hover가 풀렸다 돌아오며 창이 떨렸다 */
.watch-recent ul { list-style: none; margin: 0; padding: 0 3px 3px 0; max-height: 240px; overflow-x: hidden; overflow-y: auto; }
.watch-recent li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 2px 10px; padding: 8px 0; border-bottom: 1.5px dashed var(--muted); }
.watch-recent li:last-child { border-bottom: 0; }
.watch-recent .name { min-width: 0; padding: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; font: 400 16px var(--font-display); background: none; border: 0; }
.watch-recent button.name:hover { box-shadow: inset 0 -.45em 0 var(--hl); }
.watch-recent .state { font: 400 14.5px var(--font-display); color: var(--ink-soft); white-space: nowrap; }
.watch-recent .state.good { color: var(--green); }
.watch-recent .state.bad { color: var(--red-ink); }
.watch-recent .msg { grid-column: 1 / -1; font-size: 13.5px; color: var(--ink-soft); }

/* ---------- toasts, overlays ---------- */
.toasts { position: fixed; right: 18px; bottom: 92px; z-index: 50; display: flex; flex-direction: column; gap: 10px; max-width: min(420px, calc(100vw - 36px)); }
.toast {
  padding: 10px 16px;
  font: 400 16px var(--font-display);
  background: var(--postit);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}
.toast.error { background: var(--red); color: #fff; }
.dragover { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; background: rgba(253, 251, 247, .88); border: 3px dashed var(--ink); pointer-events: none; }
.dragover p {
  position: relative;
  margin: 0;
  padding: 22px 30px;
  font: 400 22px var(--font-display);
  background: var(--postit);
  border: 2px solid var(--ink);
  border-radius: var(--radius-note);
  box-shadow: var(--shadow-card);
}
.offline { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; background: rgba(45, 45, 45, .55); }
.offline-box { max-width: 440px; padding: 24px 28px; background: var(--surface); border: 2.5px solid var(--ink); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }
.offline-title { margin: 0 0 8px; font: 400 23px var(--font-display); }
.offline-box p { margin: 0; }
.scrim { display: none; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  :root { --side-w: 262px; }
  .doc { padding: 24px 28px 44px; }
}
@media (max-width: 900px) {
  .doc { padding: 20px 22px 40px; }
  .title-input { font-size: 30px; }
  .head-tools { width: 100%; margin-left: 0; }
  .head-tools .save-state { margin-right: auto; }
  .player { flex-wrap: wrap; row-gap: 8px; }
  .player-note { order: 20; flex-basis: 100%; white-space: normal; }
}
@media (max-width: 720px) {
  :root { --top-h: 60px; }
  .app { grid-template-columns: minmax(0, 1fr); grid-template-areas: "top" "main" "player"; }
  .topbar { padding: 0 14px; gap: 8px; }
  .only-narrow { display: inline-grid; }
  .brand { font-size: 18px; padding: 2px 11px 2px 8px; }
  .brand svg { width: 19px; height: 19px; }
  .api-chip { height: 36px; padding: 0 11px 0 10px; font-size: 14.5px; }
  .sidebar {
    position: fixed;
    top: var(--top-h);
    left: 0;
    bottom: 0;
    width: min(330px, 88vw);
    z-index: 20;
    background: var(--paper) radial-gradient(var(--dot) 1px, transparent 1px) 0 0 / 24px 24px;
    border-right: 2px solid var(--ink);
    box-shadow: 4px 0 0 0 var(--ink);
    transform: translateX(-104%);
    transition: transform .18s ease;
    visibility: hidden;
  }
  .app.drawer-open .sidebar { transform: none; visibility: visible; }
  .app.drawer-open .scrim { display: block; position: fixed; inset: var(--top-h) 0 0 0; z-index: 15; background: rgba(45, 45, 45, .35); }
  .doc { padding: 16px 14px 30px; }
  .title-input { font-size: 26px; }
  .job { padding: 16px 16px 18px; }
  .job-grid { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .job-grid > .lbl { margin-top: 6px; }
  .transcript { padding: 4px 16px; }
  .seg { grid-template-columns: minmax(0, 1fr); gap: 0; margin: 0 -16px; padding: 12px 16px 10px; }
  .seg-time { justify-self: start; margin: 0 0 2px -8px; }
  .seg-text { font-size: 17px; }
  .player { gap: 6px 8px; padding: 8px 12px; }
  #seek { order: 10; flex-basis: 100%; }
  .intro { padding: 8vh 16px 30px; }
  .dlg { padding: 22px 18px 18px; }
  .path-row .btn { padding: 0 12px; }
}
@media (max-width: 480px) {
  .brand-name, .chip-sub { display: none; }
  .brand { padding: 4px 8px; }
  .dlg h2 { font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before { animation: none !important; transition: none !important; }
}

/* 지금 동기화 */
@supports not (field-sizing: content) {
  .spk-name { width: 9em; }
}
.sync-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: -4px 0 16px; }
.sync-result { flex: 1 1 260px; margin: 0; font-size: 14.5px; color: var(--ink-soft); }
.sync-result.bad { font-family: var(--font-display); font-size: 15.5px; color: var(--red-ink); }

/* 상단 '지금 동기화' 바로가기 (폴더 자동 칩 왼쪽) */
.sync-top {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  margin-left: auto;
  padding: 0;
  color: var(--ink);
  background: var(--accent-green);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform .1s, box-shadow .1s;
}
.sync-top svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.sync-top:hover:not(:disabled) { box-shadow: 1px 1px 0 0 var(--ink); transform: translate(1px, 1px); }
.sync-top:active:not(:disabled) { box-shadow: none; transform: translate(2px, 2px); }
.sync-top:disabled { cursor: progress; }
.sync-top.busy svg { animation: spin 1s linear infinite; }
.sync-top + .watch-chip { margin-left: 0; }

/* 상태 칩 hover·키보드 포커스: 형광초록 바탕 위에 잉크 글자, 점은 흰 테두리로 띄운다.
   ([data-state]로 상태별 색 규칙보다 구체적으로 — 기본 상태 색은 그대로) */
.api-chip[data-state]:hover, .api-chip[data-state]:focus-visible { background: var(--accent-green); color: var(--ink); }
.api-chip[data-state]:hover .chip-sub, .api-chip[data-state]:focus-visible .chip-sub { color: var(--ink); }
.api-chip[data-state]:hover .dot, .api-chip[data-state]:focus-visible .dot { box-shadow: 0 0 0 2px var(--surface); }
.api-chip:focus-visible, .sync-top:focus-visible { outline: 3px dashed var(--blue); outline-offset: 3px; }

.chip-short { display: none; }
@media (max-width: 720px) {
  .sync-top { width: 38px; height: 38px; }
}
@media (max-width: 480px) {
  /* 좁은 화면: API 칩은 'API'와 상태 점만(전체 상태는 버튼 이름·툴팁) */
  #apiChipText { display: none; }
  .chip-short { display: inline; }
}

/* =====================================================================================
   기능 1~9 (2026-10-30): 같은 문법 — 점 종이, 2px 잉크선, 비뚤한 모서리, 그림자는 카드·지금 고른 것에만,
   묶음 하나에 외곽선 하나(잉크로 고른 것), 포스트잇 메모, 형광펜 강조. 움직임은 120~220ms opacity/transform만.
   ===================================================================================== */
@keyframes rise { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes pop-in { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
@keyframes bump { 50% { transform: scale(1.18); } }
@keyframes flash-bg { from { background-color: var(--postit); } to { background-color: transparent; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.enter { animation: rise .16s ease-out; }
.float-menu.enter, .sel-quote.enter { animation: pop-in .14s ease-out; }

/* 공용: 탭 묶음 (.seg-ctl과 같은 결: 외곽선 하나, 고른 것은 잉크) */
.tabs {
  display: inline-flex; gap: 2px; padding: 3px; max-width: 100%; width: max-content;
  background: var(--surface); border: 2px solid var(--ink); border-radius: 999px;
  overflow-x: auto; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs [role="tab"] {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  height: 34px; padding: 0 14px; font: 400 15.5px var(--font-display); color: var(--ink-soft);
  background: transparent; border: 0; border-radius: 999px; white-space: nowrap;
  transition: background-color .15s, color .15s;
}
.tabs [role="tab"]:hover:not([aria-selected="true"]) { background: var(--paper); color: var(--ink); }
.tabs [role="tab"][aria-selected="true"] { background: var(--ink); color: #fff; }
.tabs [role="tab"]:focus-visible { outline: 3px dashed var(--blue); outline-offset: -3px; }
.tabs.small [role="tab"] { height: 30px; padding: 0 11px; font-size: 14.5px; }
.tab-count {
  min-width: 20px; height: 20px; padding: 0 6px; display: inline-grid; place-items: center;
  font: 400 12.5px var(--font-display); color: #fff; background: var(--ink); border-radius: 999px;
  font-variant-numeric: tabular-nums;
}
.tab-count:empty { display: none; }
[aria-selected="true"] > .tab-count { color: var(--ink); background: var(--hl); }
.tab-count.pop { animation: bump .22s ease-out; }

.tag { display: inline-flex; align-items: center; padding: 0 9px; font: 400 13.5px/22px var(--font-display); color: var(--ink);
  background: var(--surface); border: 1.5px solid var(--ink); border-radius: var(--radius); white-space: nowrap; }
.chip { display: inline-flex; align-items: center; padding: 0 9px; font: 400 13.5px/22px var(--font-display);
  border-radius: 999px; border: 1.5px solid var(--ink); background: var(--surface); white-space: nowrap; }
.chip.good { background: var(--mint); color: var(--green); }
.chip.warn { background: var(--red-soft); color: var(--red-ink); border-color: var(--red-ink); }
.chip.hl { background: var(--postit); }
.chip.muted { color: var(--ink-soft); border-style: dashed; }
.panel-note { margin: 8px 0 0; font-size: 14px; color: var(--ink-soft); line-height: 1.6; }
.panel-error { margin: 12px 0; font: 400 16px var(--font-display); color: var(--red-ink); }
.loading { margin: 0; padding: 22px 0; color: var(--ink-mute); font-size: 16px; }
.picker-host { display: inline-flex; min-width: 0; max-width: 100%; }
.picker.small { height: 34px; padding: 0 30px 0 10px; font-size: 15px; background-color: var(--surface);
  border-color: var(--ink); border-radius: var(--radius-in); }
.picker.small:hover:not(:disabled) { background-color: var(--hl); }
.empty { text-align: center; padding: 34px 12px 40px; }
.empty .note {
  position: relative; display: inline-block; max-width: 460px; padding: 20px 26px;
  background: var(--postit); border: 2px solid var(--ink); border-radius: var(--radius-note); box-shadow: var(--shadow-card);
}
.empty .note::before { content: ""; position: absolute; top: -10px; left: 50%; width: 18px; height: 18px; margin-left: -9px;
  border-radius: 50%; background: var(--red); border: 2px solid var(--ink); }
.empty b { display: block; margin-bottom: 4px; font: 400 20px var(--font-display); }
.empty .note span { font-size: 14.5px; color: var(--ink-soft); }
.memo {
  width: 100%; min-height: 64px; padding: 10px 13px; font: 400 15px/1.6 var(--font); color: var(--ink);
  background: var(--postit); border: 2px solid var(--ink); border-radius: var(--radius-note); resize: vertical; outline: 0;
}
.memo:focus { border: 2.5px dotted var(--blue); padding: 9.5px 12.5px; }
.memo.plain { background: var(--surface); min-height: 44px; }
.saved { font: 400 14px var(--font-display); color: var(--green); white-space: nowrap; }
.flash-text { animation: fade-in .2s ease-out; }
.del-btn { height: 30px; padding: 0 10px; font: 400 14px var(--font-display); color: var(--ink-mute);
  background: none; border: 0; border-radius: 7px; white-space: nowrap; transition: background-color .15s, color .15s; }
.del-btn:hover { background: var(--red-soft); color: var(--red-ink); }
.del-btn[data-confirm="1"] { background: var(--red); color: #fff; }
.toast .toast-act { margin-left: 6px; font-size: 15px; }
.toast.error .toast-act { color: #fff; border-color: #fff; }
.toast { animation: rise .18s ease-out; }
mark.hit { display: inline; padding: 0; border: 0; color: inherit; background: none; box-shadow: inset 0 -.5em 0 var(--hl); }
mark.hl { color: inherit; background: var(--hl); padding: 0 2px; border-radius: 3px; }
.spacer { flex: 1; }

/* ---------- 목록: 검색 · 탭 ---------- */
.side-search { padding: 2px 20px 10px; }
.search {
  display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 8px 0 13px; min-width: 0;
  background: var(--surface); border: 2px solid var(--ink); border-radius: var(--radius-in);
}
.search svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.search input { flex: 1; min-width: 0; height: 100%; padding: 0; font: 400 16px var(--font); background: transparent; border: 0; outline: 0; }
.search input::-webkit-search-cancel-button { display: none; }
.search:focus-within { border: 2.5px dotted var(--blue); padding: 0 7.5px 0 12.5px; }
.search-clear { width: 28px; height: 28px; padding: 0; flex: none; font: 400 19px/1 var(--font-display); color: var(--ink-soft);
  background: none; border: 0; border-radius: 7px; }
.search-clear:hover { background: var(--hl); color: var(--ink); }
.side-tabs { margin: 0 20px 4px; flex: none; }
/* 목록 칸은 세로로만 스크롤: hover 이동(1~2px)이 가로 스크롤바를 만들지 않게 overflow-x를 막는다 */
.side-panel { display: flex; flex-direction: column; min-height: 0; flex: 1; overflow-x: hidden; overflow-y: auto; }
#panelRec { overflow: hidden; }
.rec-list { overflow-x: hidden; }
.side-actions { display: flex; gap: 8px; flex-wrap: wrap; padding: 10px 20px 6px; }
.side-panel > .rec-list { flex: none; overflow: visible; padding: 6px 14px 18px; }
#panelRec > .rec-list { flex: 1; overflow-x: hidden; overflow-y: auto; }
.person-row { display: flex; align-items: center; gap: 10px; }
.person-text { display: flex; flex-direction: column; min-width: 0; }
.person-text .rec-sub { margin-top: 2px; }
.pav { display: grid; place-items: center; width: 34px; height: 34px; flex: none; font: 400 14px var(--font-display);
  background: var(--postit); border: 2px solid var(--ink); border-radius: var(--blob); }
.pav.big { width: 46px; height: 46px; font-size: 19px; }
#panelSearch { padding: 0 0 18px; }
.search-filters { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 20px 6px; }
.search-sum { margin: 4px 22px 6px; font-size: 13.5px; color: var(--ink-soft); }
#searchOut { transition: opacity .15s; }
#searchOut.busy { opacity: .55; }
.hit-list, .hit-group { list-style: none; margin: 0; padding: 0; }
.hit-list { padding: 0 14px; }
.hit-list > li + li { margin-top: 10px; }
.hg-title { display: flex; align-items: baseline; gap: 8px; margin: 6px 6px 4px; }
.hg-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 400 16px var(--font-display); }
.hg-date { flex: none; font-size: 13px; color: var(--ink-mute); font-variant-numeric: tabular-nums; }
.hit-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 2px; }
button.hit { display: block; width: 100%; min-width: 0; padding: 7px 10px 8px; text-align: left; background: transparent;
  border: 2px solid transparent; border-radius: var(--radius); transition: background-color .12s, border-color .12s; }
button.hit:hover { background: var(--surface); border-color: var(--muted); }
.hit-meta { display: block; font: 400 13.5px var(--font-display); color: var(--blue); font-variant-numeric: tabular-nums; }
.hit-text { display: block; font-size: 14.5px; line-height: 1.6; overflow-wrap: anywhere; }
.hit-play { display: grid; place-items: center; width: 32px; height: 32px; margin-top: 6px; padding: 0; color: var(--ink);
  background: transparent; border: 2px solid transparent; border-radius: var(--blob); }
.hit-play svg { width: 13px; height: 13px; fill: currentColor; }
.hit-play:hover { background: var(--hl); border-color: var(--ink); }

/* ---------- 녹취 화면: 탭 · 묶음 · 발언 도구 ---------- */
.doc-tabs { margin: 20px 0 0; }
.doc-panel { padding-top: 4px; }
.doc-projects { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0; }
.proj-tag { cursor: pointer; background: var(--postit); }
.proj-tag:hover { background: var(--hl); }
.proj-menu { min-width: 240px; max-height: min(360px, 60vh); overflow-x: hidden; overflow-y: auto; }
.menu .check-item { display: flex; align-items: center; gap: 10px; }
.check-item .box { width: 20px; height: 20px; flex: none; background: var(--surface) no-repeat center / 14px 14px;
  border: 2px solid var(--ink); border-radius: 7px 4px 8px 5px; }
.check-item[aria-checked="true"] .box { background-color: var(--hl); background-image: var(--check); }
.check-item .label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.check-item .kind { font-size: 13px; color: var(--ink-mute); }
.menu .menu-new { margin-top: 4px; color: var(--blue); border-top: 1.5px dashed var(--muted); border-radius: 0 0 8px 8px; }
.menu-empty { margin: 6px 12px; font-size: 14px; color: var(--ink-soft); }
.seg-tools { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; }
.seg-more {
  display: inline-grid; place-items: center; width: 32px; height: 30px; padding: 0; color: var(--ink-soft);
  background: transparent; border: 2px solid transparent; border-radius: var(--radius); opacity: 0;
  transition: opacity .15s, background-color .12s;
}
.seg-more svg { width: 16px; height: 16px; fill: currentColor; }
.seg:hover .seg-more, .seg:focus-within .seg-more, .seg-more[aria-expanded="true"] { opacity: 1; }
.seg-more:hover, .seg-more[aria-expanded="true"] { color: var(--ink); background: var(--hl); border-color: var(--ink); }
@media (hover: none) { .seg-more { opacity: 1; } }
.sel-quote { height: 30px; padding: 0 11px; font: 400 14.5px var(--font-display); color: var(--ink);
  background: var(--hl); border: 2px solid var(--ink); border-radius: 999px; white-space: nowrap; }
.sel-quote:hover { background: var(--hl); }
.seg.flash { animation: flash-bg 1.2s ease-out; }
.float-menu { position: fixed; top: 0; left: 0; right: auto; z-index: 70; min-width: 230px; }
.float-menu button { display: flex; flex-direction: column; align-items: flex-start; }
.float-menu small { font: 400 12.5px var(--font); color: var(--ink-mute); }

/* 인용 저장 대화상자 · 나눌 시각 · 처음 글 */
.quote-snap { margin: 0 0 6px; padding: 10px 14px; font: 400 17px/1.7 var(--font); background: var(--paper);
  border-left: 4px solid var(--hl); border-radius: 0 var(--radius-in) var(--radius-in) 0; max-height: 220px; overflow-y: auto; }
.quote-src { margin: 0 0 14px; font: 400 14.5px var(--font-display); color: var(--ink-soft); }
.field > .picker-host { display: flex; }
div.field > span:first-child { display: block; margin-bottom: 6px; font: 400 16px var(--font-display); color: var(--ink-soft); }
.split-pre { margin: 6px 0 14px; padding: 10px 12px; font-size: 15.5px; line-height: 1.7; background: var(--paper);
  border: 1.5px dashed var(--muted); border-radius: var(--radius); max-height: 160px; overflow-y: auto; }
.split-pre .cut { display: inline-block; width: 0; height: 1.3em; margin: 0 3px; vertical-align: -4px; border-left: 3px solid var(--red); }
.split-time { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.time-field { display: inline-flex; flex-direction: column; gap: 4px; }
.time-field > span { font: 400 14.5px var(--font-display); color: var(--ink-soft); }
.time-field .text-input, .text-input.time { width: 112px; font-variant-numeric: tabular-nums; }
.orig-body { max-height: 50vh; overflow-y: auto; }
.orig-part + .orig-part { margin-top: 12px; padding-top: 12px; border-top: 1.5px dashed var(--muted); }
.orig-head { margin: 0 0 2px; font: 400 14.5px var(--font-display); color: var(--blue); }
.orig-text { margin: 0; font-size: 16px; line-height: 1.7; white-space: pre-wrap; }
.dlg-section { margin-top: 18px; padding-top: 14px; border-top: 1.5px dashed var(--muted); }
.dlg-section h3 { margin: 0 0 8px; font: 400 18px var(--font-display); }
.check-line { display: flex; margin: 0 0 8px; font-size: 15.5px; }

/* 인용 카드 */
.qlist { display: flex; flex-direction: column; gap: 16px; padding-top: 16px; }
.qcard { padding: 16px 20px 14px; background: var(--surface); border: 2px solid var(--ink); border-radius: var(--radius-card);
  box-shadow: var(--shadow-card); transition: opacity .16s, transform .16s; }
.qcard.leaving { opacity: 0; transform: translateX(6px); }
.qcard.is-deleted { border-style: dashed; box-shadow: none; }
.qhead { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.qwho { font: 400 17px var(--font-display); }
.qtime { font: 400 14.5px var(--font-display); color: var(--blue); font-variant-numeric: tabular-nums; }
.qtitle { min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; color: var(--ink-soft); }
.qtext { margin: 0 0 10px; font: 400 17.5px/1.75 var(--font); white-space: pre-wrap; }
.qnow { margin: -2px 0 10px; padding: 7px 11px; font-size: 14.5px; line-height: 1.6; background: var(--paper);
  border: 1.5px dashed var(--muted); border-radius: var(--radius); }
.qnow b, .rorig b { font-weight: 400; font-family: var(--font-display); color: var(--ink-soft); }
.qcands { margin: 0 0 10px; }
.qcand { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; padding: 4px 0; }
.qctx { flex: 1 1 200px; min-width: 0; font-size: 14.5px; }
.qfoot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; }

/* 검수 */
.review-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.review-card { margin-top: 16px; padding: 18px 22px 16px; background: var(--surface); border: 2px solid var(--ink);
  border-radius: var(--radius-card); box-shadow: var(--shadow-card); }
.rhead { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rwho { font: 400 16.5px var(--font-display); }
.rtime { font: 400 14.5px var(--font-display); color: var(--blue); font-variant-numeric: tabular-nums; }
.rctx { margin: 12px 0 6px; }
.rside { margin: 0; font-size: 15px; line-height: 1.7; color: var(--ink-mute); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rmain { margin: 6px 0; font: 400 17.5px/1.78 var(--font); }
.rorig { margin: 4px 0 8px; font-size: 14.5px; color: var(--ink-soft); }
.rplay { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 10px; }
.rnote, .rpos { font-size: 13.5px; color: var(--ink-mute); font-variant-numeric: tabular-nums; }
.ractions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 14px; padding-top: 12px; border-top: 1.5px dashed var(--muted); }
.review-list { list-style: none; margin: 16px 0 0; padding: 0 3px 3px 0; max-height: 320px; overflow-x: hidden; overflow-y: auto;
  border-top: 1.5px dashed var(--muted); }
.ritem { display: grid; grid-template-columns: 14px 62px minmax(0, 1fr) auto; align-items: center; gap: 10px; width: 100%;
  padding: 7px 8px; text-align: left; background: transparent; border: 0; border-bottom: 1.5px dashed var(--muted); }
.ritem:hover { background: var(--paper); }
.ritem.current { background: var(--postit); }
.rdot { width: 12px; height: 12px; border-radius: var(--blob); border: 1.5px solid var(--ink); background: var(--surface); }
.rdot.s-ok { background: var(--accent-green); }
.rdot.s-later { background: var(--hl); }
.rdot.s-stale { background: var(--red); }
.rkind { font: 400 13.5px var(--font-display); color: var(--ink-soft); }
.rtext { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.fold { margin-top: 20px; }
.fold > summary { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; list-style: none; cursor: pointer;
  font: 400 16px var(--font-display); background: var(--surface); border: 2px solid var(--ink); border-radius: 999px; }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary:hover { background: var(--hl); }
.fold > summary .tri { font-size: 11px; transition: transform .2s; }
.fold[open] > summary .tri { transform: rotate(90deg); }
.fold[open] > .fold-body { animation: rise .2s ease-out; }
.fold-body { margin-top: 12px; }
.fix-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.fix-row .text-input { flex: 1 1 140px; width: auto; min-width: 0; }
.arrow { color: var(--red-ink); font-family: var(--font-display); }
.fix-list { list-style: none; margin: 12px 0 0; padding: 0 3px 3px 0; max-height: 300px; overflow-x: hidden; overflow-y: auto; }
.fix-item { display: grid; grid-template-columns: 22px 58px minmax(0, 1fr); gap: 10px; align-items: start; padding: 7px 0;
  border-bottom: 1.5px dashed var(--muted); cursor: pointer; }
.fix-text { font-size: 15px; line-height: 1.6; }
.fix-text del { color: var(--red-ink); text-decoration-thickness: 2px; }
.fix-text ins { text-decoration: none; box-shadow: inset 0 -.5em 0 var(--hl); }
.fix-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 12px; }

/* AI 정리 */
.ai-form { margin-top: 18px; padding: 18px 22px; background: var(--surface); border: 2px solid var(--ink);
  border-radius: var(--radius-card); box-shadow: var(--shadow-card); }
.ai-range { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; min-width: 0; }
.ai-times { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ai-times .time-field { flex-direction: row; align-items: center; gap: 8px; }
.ai-prov { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; min-width: 0; }
.prov-state { font: 400 15px var(--font-display); }
.prov-state.ok { color: var(--green); }
.prov-state.bad { color: var(--red-ink); }
.ai-plan { margin: 14px 0 0; padding: 8px 12px; font-size: 14.5px; background: var(--paper); border: 1.5px dashed var(--muted); border-radius: var(--radius); }
.ai-plan.bad { color: var(--red-ink); border-color: var(--red-ink); background: var(--red-soft); }
.ai-out { margin-top: 16px; }
.ai-out > .job-warn, .ai-out > .job-error { margin: 0 0 14px; }
.ai-running { margin: 0 0 14px; }
.ai-results { display: flex; flex-direction: column; gap: 16px; }
.ai-card { padding: 16px 22px 14px; background: var(--surface); border: 2px solid var(--ink); border-radius: var(--radius-card); box-shadow: var(--shadow-card); }
.ai-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.ai-meta { font-size: 13.5px; color: var(--ink-soft); }
.ai-sec { margin-top: 10px; }
.ai-sec h4 { margin: 0 0 4px; font: 400 17px var(--font-display); }
.ai-sec ul { margin: 0; padding: 0; list-style: none; }
.ai-sec li { padding: 7px 0; border-bottom: 1.5px dashed var(--muted); font-size: 15.5px; line-height: 1.65; }
.ai-sec li:last-child { border-bottom: 0; }
.ai-sec li.unsupported .ai-text { color: var(--ink-soft); }
.ai-text { margin-right: 8px; }
.qa .q, .qa .a { margin: 0; }
.qa .a { margin-top: 2px; }
.qa b { font-weight: 400; font-family: var(--font-display); color: var(--ink-soft); }
.who { display: inline-block; margin-right: 8px; font: 400 14px var(--font-display); }
.who.mentioned { color: var(--green); }
.who.unverified { color: var(--red-ink); }
.who.not_mentioned { color: var(--ink-mute); }
.evid { display: inline-flex; flex-wrap: wrap; gap: 4px; vertical-align: 1px; }
.evid-chip { height: 24px; padding: 0 8px; font: 400 13px var(--font-display); color: var(--blue); font-variant-numeric: tabular-nums;
  background: var(--surface); border: 1.5px solid var(--blue); border-radius: 999px; }
.evid-chip:hover:not(:disabled) { background: var(--hl); color: var(--ink); border-color: var(--ink); }
.evid-chip:disabled { color: var(--ink-mute); border-style: dashed; border-color: var(--ink-mute); }

/* ---------- 묶음 · 인물 · 기사 대조 화면 ---------- */
.view-title { margin: 0; font: 400 34px/1.15 var(--font-display); letter-spacing: -.01em; overflow-wrap: anywhere; }
.view .title-row { align-items: center; }
.panel-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.card-list { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.mini-card { display: flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; background: var(--surface);
  border: 2px solid var(--ink); border-radius: var(--radius); }
.mini-open { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; padding: 8px 10px; text-align: left;
  background: transparent; border: 0; border-radius: 8px; }
.mini-open:hover { background: var(--hl); }
.mini-open.person-row { flex-direction: row; align-items: center; }
.mini-title { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 400 17px var(--font-display); }
.mini-sub { font-size: 13.5px; color: var(--ink-mute); }
.gloss { margin-top: 16px; }
.sec-title { display: flex; align-items: center; gap: 10px; margin: 18px 0 2px; font: 400 19px var(--font-display); }
.gloss-count { font: 400 14px var(--font-display); color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.term-list { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.term-row { display: flex; align-items: center; gap: 8px; }
.term-row .text-input { flex: 1 1 auto; width: auto; min-width: 0; }
.row-del { width: 32px; height: 32px; flex: none; padding: 0; font: 400 19px/1 var(--font-display); color: var(--ink-mute);
  background: none; border: 0; border-radius: 7px; }
.row-del:hover { background: var(--red-soft); color: var(--red-ink); }
.gloss-add { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.gloss-add .memo { flex: 1 1 260px; width: auto; }
.gloss-foot { display: flex; align-items: center; gap: 14px; margin-top: 20px; padding-top: 14px; border-top: 1.5px dashed var(--muted); }
.pgroup { margin-top: 16px; padding: 12px 18px 10px; background: var(--surface); border: 2px solid var(--ink); border-radius: var(--radius-card); box-shadow: var(--shadow-card); }
.pgroup.excluded { box-shadow: none; border-style: dashed; opacity: .7; }
.pg-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pg-title { min-width: 0; max-width: 100%; padding: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left;
  font: 400 18px var(--font-display); background: none; border: 0; }
.pg-title:hover { box-shadow: inset 0 -.45em 0 var(--hl); }
.inline.small { font-size: 14.5px; gap: 7px; }
.pg-list { list-style: none; margin: 8px 0 0; padding: 0; }
.pg-list li { display: grid; grid-template-columns: 82px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 6px 0; border-top: 1.5px dashed var(--muted); }
.pg-text { font-size: 16px; line-height: 1.7; }
.article { display: block; width: 100%; margin-top: 18px; padding: 12px 14px; font: 400 16px/1.7 var(--font); background: var(--surface);
  border: 2px solid var(--ink); border-radius: var(--radius-in); resize: vertical; outline: 0; }
.article:focus { border: 2.5px dotted var(--blue); padding: 11.5px 13.5px; }
.check-out { margin-top: 18px; }
.check-sum { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 0 12px; }
.ccard { margin-top: 14px; padding: 14px 20px 12px; background: var(--surface); border: 2px solid var(--ink); border-radius: var(--radius-card); box-shadow: var(--shadow-card); }
.ccard.s-not_found, .ccard.s-skipped { box-shadow: none; border-style: dashed; }
.chead { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.cctx { margin: -4px 0 8px; font-size: 13.5px; color: var(--ink-mute); }
.cand { margin-top: 8px; padding: 10px 12px; background: var(--paper); border: 1.5px dashed var(--muted); border-radius: var(--radius); }
.cand-meta { margin: 0; font: 400 14.5px var(--font-display); color: var(--blue); }
.cand-text { margin: 4px 0 6px; font-size: 15.5px; line-height: 1.7; }
.cand-warn { margin: 0 0 6px; font: 400 14.5px var(--font-display); color: var(--red-ink); }
.cand-actions { display: flex; gap: 8px; flex-wrap: wrap; }

@media (max-width: 720px) {
  .side-search { padding: 4px 14px 8px; }
  .side-tabs { margin: 0 14px 4px; }
  .search-filters { padding: 4px 14px 6px; }
  .side-actions { padding: 10px 14px 6px; }
  .ai-form, .review-card, .qcard, .ai-card, .ccard, .pgroup { padding-left: 14px; padding-right: 14px; }
  .ritem { grid-template-columns: 12px 52px minmax(0, 1fr) auto; gap: 8px; }
  .pg-list li { grid-template-columns: minmax(0, 1fr) auto; }
  .pg-list .seg-time { grid-column: 1 / -1; justify-self: start; margin-left: -8px; }
  .view-title { font-size: 26px; }
  .seg-head { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  *::after { animation: none !important; transition: none !important; }
}
.ai-prov-wrap { min-width: 0; }
.ai-prov-wrap > .panel-note { margin-top: 6px; }

/* =====================================================================================
   홈 (2026-10-30): 같은 문법. 이어서 작업하기만 포스트잇 메모 한 장으로 강조하고,
   나머지는 흰 카드 안의 목록 행. 통계 타일은 만들지 않는다. 움직임은 화면 전환 때 한 번만.
   ===================================================================================== */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* 상단 브랜드 = 홈으로 */
a.brand { color: var(--ink); text-decoration: none; transition: background-color .15s; }
a.brand:hover { background: var(--hl); }
a.brand:focus-visible { outline: 3px dashed var(--blue); outline-offset: 3px; }
/* 마이크 아이콘(gpt_microphone.svg, 바탕 없음): 그림이 48칸 중 가로 34·세로 43칸을 차지한다.
   좌우 빈칸만 조금 당기고, 위아래는 브랜드 상자 테두리와 4px 넘게 띄운다 (상자 40px, 좁은 화면 36px) */
.brand img { display: block; width: 40px; height: 40px; flex: none; margin: 0 -3px; }
a.brand { padding: 3px 15px 3px 6px; gap: 5px; }

.home-head { padding-bottom: 18px; border-bottom: 2px dashed var(--muted); }
.home-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.home-search { flex: 1 1 320px; }
.home-search input { font-size: 17px; }
.home-hint { margin: 8px 2px 0; font-size: 14px; color: var(--ink-soft); }
.home-sec { margin-top: 28px; }
.home-sec-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 10px; }
.home-sec-head h2 { margin: 0; font: 400 21px var(--font-display); letter-spacing: -.01em; }
.home-sec > .panel-note { margin-top: 8px; }

/* 이어서 작업하기: 작은 가로 줄 하나 (흰 카드, 왼쪽 글 · 오른쪽 버튼) */
.resume-row {
  display: flex; align-items: center; gap: 16px; padding: 12px 18px;
  background: var(--surface); border: 2px solid var(--ink); border-radius: var(--radius-card); box-shadow: var(--shadow-card);
}
.resume-text { flex: 1; min-width: 0; }
.home-kicker { margin: 0; font: 400 13.5px var(--font-display); color: var(--ink-soft); }
.resume-title { margin: 1px 0 0; font: 400 19px/1.3 var(--font-display); overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.resume-meta { margin: 2px 0 0; font-size: 14px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.resume-row > .btn { flex: none; }

/* 목록 카드 (최근 녹음 · 확인 필요 · 묶음) */
.home-list { list-style: none; margin: 0; padding: 4px 20px; background: var(--surface);
  border: 2px solid var(--ink); border-radius: var(--radius-card); box-shadow: var(--shadow-card); }
.home-list > li { border-bottom: 1.5px dashed var(--muted); }
.home-list > li:last-child { border-bottom: 0; }
.home-rec { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 4px 12px; padding: 5px 0; }
.home-rec > .pick { margin-right: -2px; }
.home-rec.picked .hr-open { background: #fffdf0; }
.hr-open, .hp-open {
  display: flex; flex-direction: column; align-items: flex-start; min-width: 0; margin-left: -10px; padding: 7px 10px;
  text-align: left; background: transparent; border: 0; border-radius: var(--radius); transition: background-color .12s;
}
.hr-open:hover, .hp-open:hover { background: var(--hl); }
.hr-title, .hp-name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 400 18px/1.35 var(--font-display); }
.hr-sub, .hp-sub { font-size: 13.5px; color: var(--ink-mute); font-variant-numeric: tabular-nums; }
.att-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 6px 12px; padding: 10px 0; }
.att-text { display: flex; flex-direction: column; min-width: 0; }
.att-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 400 16.5px var(--font-display); }
.att-msg { font-size: 13.5px; color: var(--ink-soft); overflow-wrap: anywhere; }
.home-proj { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.hp-open { flex: 1; }
.pin-btn {
  display: grid; place-items: center; width: 34px; height: 34px; flex: none; padding: 0; color: var(--ink-mute);
  background: transparent; border: 2px solid transparent; border-radius: var(--blob);
  transition: background-color .15s, color .15s, border-color .15s;
}
.pin-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.pin-btn:hover { color: var(--ink); background: var(--paper); border-color: var(--muted); }
.pin-btn[aria-pressed="true"] { color: var(--ink); background: var(--hl); border-color: var(--ink); }
.home-proj-empty { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 18px;
  background: var(--surface); border: 2px dashed var(--muted); border-radius: var(--radius-card); }
.home-proj-empty p { flex: 1 1 240px; min-width: 0; margin: 0; font-size: 15px; color: var(--ink-soft); }
/* 설명은 왼쪽, '+ 새 묶음'은 오른쪽 끝 (좁아서 줄이 바뀌어도 오른쪽) */
.home-proj-empty > .btn { flex-shrink: 0; margin-left: auto; }
.home-empty { padding: 16px 0 6px; text-align: center; }
.rec-hits { margin-bottom: 8px; }

@media (max-width: 720px) {
  .brand img { width: 36px; height: 36px; }
  a.brand { padding: 3px 11px 3px 5px; gap: 5px; }
  .home-top .btn { flex: 1 1 auto; }
  .home-list { padding: 4px 12px; }
  .home-rec { grid-template-columns: auto minmax(0, 1fr) auto; }
  .home-rec > .btn { grid-column: 2 / -1; justify-self: start; margin: 0 0 6px; }
  .att-row { grid-template-columns: minmax(0, 1fr) auto; }
  .att-row > .st { grid-column: 1 / -1; justify-self: start; }
  .resume-row { flex-direction: column; align-items: stretch; gap: 10px; padding: 12px 14px; }
  .resume-row > .btn { align-self: flex-start; }
}

/* =====================================================================================
   홈 손질 (2026-10-30): 재생바 숨김 · 목록 체크 선택 · 선택 삭제 줄
   ===================================================================================== */
/* 재생할 녹음이 없는 화면(홈, 듣기 전의 묶음·인물·기사 대조)에서는 하단 재생바와 그 줄을 없앤다 */
.app.no-player { grid-template-rows: var(--top-h) minmax(0, 1fr) 0; }
.app.no-player .player { display: none; }

/* 목록 체크: 여는 버튼 밖에 둔 상자 (누르면 고르기만, 녹취는 열리지 않음) */
.rec-row { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 8px; }
.rec-row > .pick { margin-left: 2px; }
.rec-row.picked .rec:not([aria-current="true"]) { background: #fffdf0; border-color: var(--muted); }
.rec-list li.rec-row + li { margin-top: 6px; }

/* 선택 줄: 의견 접수함의 고르기 줄과 같은 포스트잇 막대 */
.selbar-host { padding: 0 14px 6px; }
.home-sec .selbar-host { padding: 0 0 10px; }
.selbar {
  display: flex; align-items: center; gap: 6px 12px; flex-wrap: wrap; padding: 8px 12px;
  font: 400 15.5px var(--font-display); background: var(--postit); border: 2px solid var(--ink); border-radius: var(--radius);
}
.selbar-count { flex: 1 1 auto; min-width: 0; }
.selbar-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.selbar .link-btn { font-size: 14.5px; }
.selbar .link-btn:disabled { opacity: .45; cursor: default; }
@media (max-width: 480px) {
  a.brand { padding: 3px; }
}

/* 목록 편집: 체크상자와 선택 줄은 연필 버튼으로 편집을 켰을 때만 보인다 (왼쪽 목록·홈 최근 녹음 함께) */
.app:not(.list-edit) .pick, .app:not(.list-edit) .selbar-host { display: none; }
.app:not(.list-edit) .rec-row { grid-template-columns: minmax(0, 1fr); }
.app:not(.list-edit) .home-rec { grid-template-columns: minmax(0, 1fr) auto auto; }
.edit-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px; flex: none; padding: 0;
  color: var(--ink); background: none; border: 0; border-radius: 10px;
}
.edit-btn svg { width: 27px; height: 27px; fill: none; stroke: currentColor; stroke-width: 2.1; stroke-linecap: round; stroke-linejoin: round; }
.edit-btn .fill { fill: transparent; transition: fill .15s; }
.edit-btn .i-done, .edit-btn[aria-pressed="true"] .i-edit { display: none; }
.edit-btn[aria-pressed="true"] .i-done { display: block; }
/* 켜짐: 형광초록 얼룩 + 잉크 체크. 올리면 연필·얼룩이 샛노랑으로 칠해진다(잉크 윤곽은 그대로) */
.edit-btn .i-done .fill { fill: var(--accent-green); }
.edit-btn:hover:not(:disabled) .fill { fill: var(--hl); }
.edit-btn:disabled { opacity: .45; cursor: default; }
.list-head .edit-btn { margin: -8px -8px -8px auto; }
.home-sec-head .edit-btn { margin: -6px -6px -6px 0; }
@media (max-width: 720px) {
  .app:not(.list-edit) .home-rec { grid-template-columns: minmax(0, 1fr) auto; }
  .app:not(.list-edit) .home-rec > .btn { grid-column: 1 / -1; }
}

/* =====================================================================================
   URL로 추가 (2026-10-30): 같은 문법. 녹음 추가 옆 버튼, 대화상자 안의 목록·진행 줄.
   ===================================================================================== */
.add-row { display: flex; gap: 8px; }
.add-row .btn.block { flex: 1 1 auto; width: auto; min-width: 0; }
.add-row #urlAddBtn { flex: none; height: 46px; padding: 0 12px; }
.url-row { display: flex; gap: 8px; margin: 12px 0 0; }
.url-row .text-input { flex: 1; min-width: 0; }
.url-row .text-input:read-only { color: var(--ink-soft); background: var(--paper); border-color: var(--muted); }
.url-body { margin-top: 4px; }
.url-hint { margin: 6px 0; font-size: 14px; color: var(--ink-soft); }
/* A안 한 장: 회사·연도 줄 → 발표 줄(고른 줄에 길이, 그 아래 진행·결과) → 언어·화자 */
.url-src { display: flex; align-items: center; gap: 10px; margin: 18px 0 8px; }
.url-company { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 400 19px var(--font-display); }
.url-items { list-style: none; margin: 0; padding: 0; max-height: 300px; overflow-x: hidden; overflow-y: auto;
  border-top: 1.5px dashed var(--muted); }
.url-item { border-bottom: 1.5px dashed var(--muted); transition: background-color .12s, opacity .15s; }
/* 고른 줄·가져오는 줄: 연한 초록 (진행 막대는 노랑 그대로) */
.url-item.on, .url-item.has-job { background: var(--mint); }
.url-pick { display: flex; align-items: center; gap: 12px; padding: 11px 10px; cursor: pointer; }
.url-item:not(.on) .url-pick:hover { background: var(--hl); }
.url-body.locked .url-item:not(.has-job):not(.on) { opacity: .4; }
.url-body.locked .url-pick { cursor: default; }
.url-body.locked .url-item:not(.on) .url-pick:hover { background: none; }
.url-pick input[type="radio"] { appearance: none; width: 20px; height: 20px; flex: none; margin: 0; cursor: pointer;
  background: var(--surface); border: 2px solid var(--ink); border-radius: var(--blob); }
.url-pick input[type="radio"]:checked { background: var(--ink); box-shadow: inset 0 0 0 3px var(--surface); }
.url-pick input[type="radio"]:disabled { cursor: default; }
.url-pick input[type="radio"]:focus-visible { outline: 3px dashed var(--blue); outline-offset: 2px; }
.url-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 400 17px var(--font-display); }
.url-len { flex: none; font-size: 14.5px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
/* 줄 안의 진행·결과: 이름 글자 줄에 맞춰 들여 쓴다 */
.url-line { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; padding: 0 10px 12px 42px; font: 400 15.5px var(--font-display); }
.url-line:empty { display: none; }
.url-line.bad { color: var(--red-ink); }
.url-line .spinner { width: 18px; height: 18px; border-width: 3px; }
.url-ok { width: 22px; height: 22px; flex: none; background: var(--accent-green) var(--check) no-repeat center / 14px 14px;
  border: 2px solid var(--ink); border-radius: var(--blob); }
.url-pct { min-width: 3.2ch; font-variant-numeric: tabular-nums; text-align: right; }
.url-msg { flex-basis: 100%; font: 400 14.5px var(--font); overflow-wrap: anywhere; }
.url-dup { color: var(--red-ink); }
/* 진행 막대: 재생바(#seek)와 같은 형광펜 채움 */
.url-bar { flex: 1 1 140px; height: 14px; border: 2px solid var(--ink); border-radius: 999px;
  background: linear-gradient(90deg, var(--hl) var(--p, 0%), var(--surface) var(--p, 0%)); }
.url-opts { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 28px; margin-top: 16px; }
.url-opt { display: inline-flex; align-items: center; gap: 12px; }
.url-opt > .lbl { font: 400 16px var(--font-display); color: var(--ink-soft); }
.url-sum { margin: 16px 0 0; font-size: 14.5px; color: var(--ink-soft); }
/* 지금 목록에 없는 발표(다른 페이지·연도)를 가져오는 중: 제목을 붙인 따로 줄 (상자 없이 점선 위) */
.url-job { margin-top: 14px; padding-top: 10px; border-top: 1.5px dashed var(--muted); }
.url-job .url-line { padding: 0; }
.url-jobtitle { margin: 0 0 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 400 16px var(--font-display); }
.url-acts { display: inline-flex; gap: 8px; }
.url-acts:empty { display: none; }
@media (max-width: 720px) {
  /* 좁은 화면: 주소 칸은 한 줄을 다 쓰고, 불러오기는 그 아래 자연 폭 */
  .url-row { flex-wrap: wrap; }
  .url-row .text-input { flex: 1 1 100%; }
  .url-row .btn { flex: 0 0 auto; }
  .url-line { padding-left: 10px; }
  .url-opts { gap: 12px 20px; }
}

/* =====================================================================================
   대화상자 닫기 X (2026-10-30): 아래 '취소'와 같은 value="cancel"로 창만 닫는다
   (진행 중인 내려받기·받아쓰기·삭제는 멈추지 않는다)
   제목과 X를 흰 바탕 머리줄로 묶어 창 맨 위에 붙인다. 스크롤해도 본문은 이 줄 아래로 지나가서 X와 겹치지 않는다
   ===================================================================================== */
.dlg-head {
  position: sticky; top: 0; z-index: 4;
  display: flex; align-items: flex-start; gap: 12px;
  margin: -26px -28px 6px; padding: 26px 12px 6px 28px;
  background: var(--surface);
}
.dlg-head h2 { flex: 1; min-width: 0; margin: 0; }
.dlg-x {
  flex: none; display: grid; place-items: center; width: 40px; height: 40px; margin-top: -5px; padding: 0;
  color: var(--ink); background: var(--surface); border: 2px solid var(--ink); border-radius: 50%;
  box-shadow: var(--shadow); transition: background-color .12s, color .12s, box-shadow .1s, transform .1s;
}
.dlg-x svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; }
.dlg-x:hover { color: #fff; background: #ff4b4b; }
.dlg-x:focus-visible { color: #fff; background: #ff4b4b; outline: 3px dashed #ff4b4b; outline-offset: 3px; }
.dlg-x:active { color: #fff; background: var(--red-ink); box-shadow: none; transform: translate(2px, 2px); }
@media (max-width: 720px) {
  .dlg-head { margin: -22px -18px 6px; padding: 22px 10px 6px 18px; }
}

/* =====================================================================================
   다운로드 옵션 (2026-10-30): DOCX·TXT·SRT 버튼 → 포함 정보(시간 기록 · 참석자) 작은 창
   ===================================================================================== */
#exportDlg { width: min(440px, calc(100vw - 28px)); }
.export-opts { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 28px; min-width: 0; margin: 6px 0 0;
  padding: 12px 16px 16px; border: 1.5px dashed var(--muted); border-radius: var(--radius); }
.export-opts legend { padding: 0 6px; font: 400 16px var(--font-display); color: var(--ink-soft); }
.export-opts .inline { font-size: 17px; }
/* 자막(SRT): 시간 기록은 고른 채로 잠금 */
.export-opts .inline:has(input:disabled) { color: var(--ink-soft); cursor: default; }
.export-note { margin: 8px 2px 0; }

/* =====================================================================================
   구간 묶기 (2026-10-30): 같은 묶음에서 이어지는 원래 구간은 시간·화자 머리줄과 구분선 없이 붙여
   한 덩어리로 읽힌다. 줄은 원래 구간 그대로 — 올리면 왼쪽에 그 구간 시각이, 눌러 고치면 그 구간의
   화자·도구 줄이 나온다 (화자 색 띠는 이어진다)
   ===================================================================================== */
.seg.gnext { border-bottom: 0; padding-bottom: 0; }
.seg.gcont { padding-top: 0; }
.seg.gcont .seg-time { opacity: 0; transition: opacity .12s, background-color .12s; }
.seg.gcont:hover .seg-time, .seg.gcont:focus-within .seg-time, .seg.gcont.playing .seg-time { opacity: 1; }
.seg.gcont:not(:focus-within):not(:has(.picker.open, .seg-more[aria-expanded="true"])) .seg-head { min-height: 0; }
.seg.gcont:not(:focus-within):not(:has(.picker.open, .seg-more[aria-expanded="true"])) .seg-head > :not(.seg-edited) { display: none; }
/* 화자 줄 끝의 '구간' 고르기 */
.group-ctl { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; }
.group-ctl > .lbl { font: 400 16px var(--font-display); color: var(--ink-soft); }
@media (max-width: 720px) {
  /* 좁은 화면은 시각이 글 위 줄이라, 이어지는 구간은 고치거나 재생 중일 때만 시각 줄을 둔다 */
  .seg.gcont:not(:focus-within):not(.playing) .seg-time { display: none; }
}

/* =====================================================================================
   서버판(2026-11-01): 상단 계정 칩, 계정 창의 사용량 막대. 로컬판에서는 숨어 있다(server_mode일 때만 보임).
   ===================================================================================== */
.account-chip { margin-left: auto; }
.account-chip[data-state="warn"] { background: var(--red-soft); color: var(--red-ink); }
.account-chip[data-state="warn"] .dot { background: var(--red); }
.account-chip[data-state="ok"] .dot { background: var(--accent-green); }
.account-email { margin: 0 0 16px; font: 400 17px var(--font-display); }
.account-email span { margin-left: 8px; font-size: 14.5px; color: var(--green); }
.usage-row { margin: 0 0 14px; }
.usage-label { display: flex; gap: 8px; align-items: baseline; margin-bottom: 6px; font: 400 16px var(--font-display); }
.usage-label .num { margin-left: auto; color: var(--ink-soft); font-size: 15px; }
.bar { position: relative; height: 14px; background: var(--paper); border: 2px solid var(--ink); border-radius: var(--radius-in); overflow: hidden; }
.bar > span { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--accent-green); border-right: 2px solid var(--ink); }
.bar.warn > span { background: var(--hl); }
.bar.full > span { background: var(--red); }
.bar.small { height: 10px; border-width: 1.5px; min-width: 90px; }
.bar.small > span { border-right-width: 1.5px; }
.usage-note { margin: 4px 0 0; font-size: 14px; color: var(--red-ink); }
#accountChipText { max-width: 16em; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 480px) {
  #accountChipText { max-width: 7em; }
}
