/*
  app.css — 회의록 자동화 웹앱 공용 스타일 (전 화면 공용, 단일 파일)
  ------------------------------------------------------------
  "차분한 업무 도구" 리디자인(v5). 이전 "모던 SaaS"(인디고→바이올렛 그라디언트 + 큰 라운드
  + 다층 그림자)를 걷어내고, 무채색 쿨그레이 위에 액센트 한 색(--primary #15529E)만 남겼다.
  액센트는 회의록 문서(templates/minutes.html.j2)가 쓰던 네이비 #1f2d50 계열을 UI 명도로
  끌어올린 값이라, 앱과 문서가 같은 팔레트를 공유한다.

  외부 CDN/JS 라이브러리는 여전히 쓰지 않는다. 서체만 self-host 한 IBM Plex Sans KR /
  IBM Plex Mono 를 우선 쓰고(→ /static/fonts, @font-face 는 아래 0번 섹션), 파일이 없으면
  기존 시스템 폰트 스택으로 자연스럽게 폴백된다.

  ⚠️ 주의(중요): 아래 선택자들은 record.js / status.js / meetings.js / detail.js /
  admin.js / account_password.js 및 templates/*.html 의 Jinja 가 실제로 참조하는 "훅"이다.
  시각(색/여백/그림자/타이포)은 자유롭게 바꾸되, 클래스/아이디/데이터 속성 이름 자체는
  절대 바꾸지 말 것. v5 재작성에서도 훅 이름은 하나도 바뀌지 않았다:
    #rec-btn #rec-title #rec-timer #rec-indicator #upload-progress #status-view
    #record-view #queue-position #status-error #view-btn #mic-warning #file-input
    #file-pick-label #file-name #file-upload-btn #meetings-list #meetings-status
    #meeting-card-template #meetings-empty #meetings-error #refresh-btn #minutes-frame
    #step-track #delete-confirm-* #employee-*-form #emp-* #edit-emp-* #admin-message
    #password-form #current-password #new-password #new-password-confirm #password-message
    #detail-frame-wrap #editing-badge #detail-toolbar #toolbar-view-actions
    #toolbar-edit-actions #toolbar-script-actions #btn-edit #btn-save #btn-cancel
    #btn-revert #btn-download #btn-download-pdf #btn-delete #pane-script #tab-minutes
    #tab-script #transcript-* #detail-processing #detail-title #format-toolbar
    #btn-bold #btn-italic #btn-bullet-list #btn-numbered-list #select-font-size
    #btn-clear-format #input-color
    [data-step], .status-badge[data-status], .role-badge[data-role],
    .is-recording/.is-current/.is-done/.is-error/.is-editing, [hidden], [aria-disabled],
    [aria-pressed], [aria-selected], .meeting-card__title/__datetime/__uploader/__delete,
    .has-file, .fmt-color-swatch[data-color], [data-fingerprint], [data-user-id],
    .js-edit-emp .js-reset-pw .js-toggle-role .js-delete-emp

  v5 에서 새로 추가된(=JS 훅이 아닌, 순수 시각/레이아웃용) 클래스:
    .app-fab            — 화면 하단 중앙 플로팅 [새 회의록](구 헤더 버튼/구 .refresh-fab 자리)
    .mobile-tabs        — 모바일 하단 탭바(구 .main-tabs 대체, 1024px 미만에서만 노출)
    .mobile-tabs__tab / __icon / __label / .is-active
    .list-toolbar       — 목록 상단 검색 + 상태 필터 줄
    .filter-chip        — 상태 필터 칩([aria-pressed]로 선택 표시)
    .meetings-group / __label / __body — 날짜 그룹(meetings.js 가 렌더)
    .meeting-card__progress / __steps / __step / __count — 목록 행 안 진행 단계 표시
    .app-header__lead / __center — 사이트 헤더 3분할(가운데는 페이지가 채운다)
    .app-back           — 헤더 좌측 "목록으로"(아이콘만)
    .doc-actions / __menu / __toggle — 문서 우측 하단 플로팅 액션 위젯
    .script-audio / __player — [스크립트] 탭의 원본 [음성 듣기]
    .settings-list / __item — 모바일 설정 화면 행 목록

  모바일 퍼스트로 작성하고 min-width 미디어쿼리로 확장한다.
------------------------------------------------------------ */

/* ---------- 0. 웹폰트(self-host — 외부 CDN 금지 원칙 유지) ----------
   IBM Plex Sans KR / IBM Plex Mono, SIL Open Font License 1.1 (static/fonts/LICENSE.txt).
   한글 완전판 woff2 가중치당 약 430KB — 서브셋(가중치당 94조각 + 거대한 unicode-range CSS)
   대신 통짜를 쓴다. 사내 LAN 도구이고 첫 로드 이후 브라우저가 캐시하므로 조각내는 복잡도가
   값을 못 한다. font-display:swap 이라 폰트가 늦어도 텍스트는 폴백으로 즉시 보인다.
   파일이 없으면 아래 --font-sans / --font-mono 폴백 스택으로 자연스럽게 내려간다. */
@font-face {
  font-family: "IBM Plex Sans KR";
  src: url("/static/fonts/IBMPlexSansKR-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans KR";
  src: url("/static/fonts/IBMPlexSansKR-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans KR";
  src: url("/static/fonts/IBMPlexSansKR-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("/static/fonts/IBMPlexMono-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("/static/fonts/IBMPlexMono-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

/* ---------- 1. 리셋 ---------- */
* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}
/* ---------- 스크롤바 숨김 ----------
   스크롤 자체는 그대로 두고 막대만 감춘다(휠/터치/키보드 모두 정상). 막대가 자리를
   차지하지 않으므로 스크롤이 생기는 화면과 아닌 화면의 좌/우 마진도 저절로 같아진다
   — 그래서 이 규칙과 짝이던 scrollbar-gutter:stable 은 함께 제거했다.
   ⚠️ iframe 안 회의록 문서는 별도 문서라 이 파일이 닿지 않는다 —
   templates/minutes.html.j2 에도 같은 규칙이 따로 들어가 있다. */
* {
  scrollbar-width: none;          /* Firefox */
  -ms-overflow-style: none;       /* 구 Edge / IE */
}

*::-webkit-scrollbar {            /* Chrome / Safari / Edge */
  width: 0;
  height: 0;
  display: none;
}

/* hidden 속성은 다른 컴포넌트 클래스(display:flex 등)에 밀리지 않도록 항상 최우선 */
[hidden] {
  display: none !important;
}

img,
svg {
  display: block;
  max-width: 100%;
}

button {
  font: inherit;
  color: inherit;
}

a {
  color: inherit;
}

/* ---------- 2. 디자인 토큰 ----------
   토큰 "이름"은 v4 와 그대로 두고 값만 새 시스템으로 재지정했다 — 혹시 재작성에서 놓친
   옛 규칙이 남아 있어도 새 팔레트로 자연스럽게 흡수되게 하기 위한 안전장치다.
   (--gradient-* 는 더 이상 그라디언트가 아니라 단색으로 정의된다.) */
:root {
  /* 액센트 — 단 한 색. 링크 · 포커스 · 선택 · 진행 · 문서 번호에만 쓴다 */
  --primary: #15529e;
  --primary-dark: #103f7a;
  --primary-darker: #0d3260;
  --primary-light: #edf2f9;
  --primary-soft: #c6d8ee;
  --accent: #15529e;
  --accent-light: #edf2f9;

  /* 주요 동작은 컬러가 아니라 잉크로 — 버튼은 근검정, 액센트는 상태/링크에 아껴 쓴다 */
  --gradient-primary: #14161b;
  --gradient-primary-hover: #000205;
  --gradient-danger: #c0392b;

  /* 중립 / 텍스트 (쿨그레이) */
  --ink: #14161b;
  --text: #2b2f38;
  --text-light: #5a616e;
  --text-faint: #868d9b; /* 흰 배경 대비 ~4.6:1 */

  --bg: #fafafb;
  --surface: #ffffff;
  --surface-alt: #f4f5f7;
  --line: #e4e6eb;
  --line-strong: #d2d6de;

  /* 상태 — 배지 전체를 물들이지 않는다. 뉴트럴 필 + 유색 도트가 기본이고,
     되돌릴 일이 필요한 failed 만 톤을 입힌다. */
  --c-uploaded-text: #5a616e;
  --c-uploaded-bg: #f4f5f7;
  --c-uploaded-border: #e4e6eb;
  --c-uploaded-dot: #15529e;

  --c-pending-text: #5a616e;
  --c-pending-bg: #f4f5f7;
  --c-pending-border: #e4e6eb;
  --c-pending-dot: #9aa1ae;

  --c-processing-text: #5a616e;
  --c-processing-bg: #f4f5f7;
  --c-processing-border: #e4e6eb;
  --c-processing-dot: #b26a00;

  --c-done-text: #5a616e;
  --c-done-bg: #f4f5f7;
  --c-done-border: #e4e6eb;
  --c-done-dot: #1a7f4b;

  --c-failed-text: #c0392b;
  --c-failed-bg: #fcf3f2;
  --c-failed-border: #ebc9c4;
  --c-failed-dot: #c0392b;

  /* 진행(처리중) 강조색 — 목록 행 안 단계 표시에 쓴다 */
  --progress: #b26a00;
  --progress-soft: #fbf6ec;
  --progress-line: #efe2c8;

  --danger: #c0392b;
  --danger-dark: #a5301f;

  /* 간격 스케일 (4/8px 리듬 — v4 와 동일) */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;
  --sp-8: 64px;

  /* 라운드 — 대폭 축소(10/14/20/28 → 4/6/8) */
  --radius-sm: 6px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 8px;
  --radius-full: 999px;

  /* 그림자 — 흐름 안 요소에는 쓰지 않는다. 떠 있는 것(모달/드롭다운/FAB)에만. */
  --shadow-xs: none;
  --shadow-sm: none;
  --shadow-md: 0 8px 24px rgba(20, 22, 27, 0.10);
  --shadow-lg: 0 12px 32px rgba(20, 22, 27, 0.16);
  --shadow-fab: 0 10px 28px rgba(20, 22, 27, 0.20), 0 2px 6px rgba(20, 22, 27, 0.12);

  --focus-ring: #15529e;

  /* 모바일 하단 탭바 실측 높이(= padding-top 6 + .mobile-tabs__tab min-height 56 +
     padding-bottom 10). 플로팅 버튼 위치와 본문 하단 여백이 이 값을 함께 참조해
     따로 놀지 않게 한다 — 탭바 치수를 바꾸면 여기 한 곳만 고치면 된다. */
  --mobile-tabs-h: 72px;

  /* 사이트 헤더 실측 높이(min-height 52 + 아래 테두리 1). 상세 화면이 뷰포트에서
     빼야 할 값이라 토큰으로 뽑아둔다 — 헤더 치수를 바꾸면 여기 한 곳만 고치면 된다. */
  --app-header-h: 53px;

  --font-sans: "IBM Plex Sans KR", -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", Roboto, Helvetica, Arial,
    sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* ---------- 3. 베이스 타이포그래피 / 배경 ---------- */
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3 {
  margin: 0;
  color: var(--ink);
  font-weight: 600;
  word-break: keep-all;
  letter-spacing: -0.012em;
}

.page-title {
  font-size: 21px;
  font-weight: 600;
}

.page-desc {
  margin: var(--sp-1) 0 0;
  color: var(--text-light);
  font-size: 13px;
}

/* 숫자 · 시각 · 파일명 · 코드는 전부 mono — 자릿수가 바뀌어도 흔들리지 않게 */
code,
.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

code {
  font-size: 0.92em;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--surface-alt);
  border: 1px solid var(--line);
}

/* 그룹 라벨(날짜 구분 등) */
.eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.09em;
  color: var(--text-faint);
  text-transform: uppercase;
}

/* ---------- 4. 접근성 유틸 ---------- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: var(--sp-3) var(--sp-4);
  background: var(--ink);
  color: #fff;
  border-radius: 0 0 var(--radius-sm) 0;
}

.skip-link:focus {
  left: 0;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ---------- 5. 레이아웃: 헤더 / 메인 / 푸터 ----------
   v5: 헤더에 있던 주요 동작([새 회의록])을 걷어냈다 — 화면 하단 중앙 플로팅(.app-fab)이
   그 역할을 맡는다. 헤더는 로고 + 계정 영역만 남는 조용한 크롬이다. */
.app-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}

.app-header__inner {
  max-width: 1080px;
  margin: 0 auto;
  min-height: 52px;
  padding: var(--sp-2) var(--sp-4);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

/* 좌/우를 flex:1 로 같게 두어 가운데 슬롯이 헤더 정중앙에 오게 한다. */
.app-header__lead {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.app-header__center {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.app-header__center:empty {
  display: none;
}

/* 헤더 좌측 "목록으로" — 아이콘만(라벨 없음) */
.app-back {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text-light);
  text-decoration: none;
  transition: background-color 120ms ease, color 120ms ease;
}

.app-back:hover,
.app-back:focus-visible {
  background: var(--surface-alt);
  color: var(--ink);
}

.app-logo {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -0.015em;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}

.app-logo__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 5px;
  background: var(--ink);
  color: #fff;
  flex: none;
}

/* v4 의 그라디언트 텍스트 클리핑 제거 — 평범한 잉크 텍스트 */
.app-logo__text {
  color: var(--ink);
}

.app-nav {
  flex: 1 1 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--sp-1);
}

.app-nav__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 var(--sp-3);
  border-radius: var(--radius-sm);
  color: var(--text-light);
  text-decoration: none;
  font-size: 12.5px;
  font-weight: 500;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease;
}

.app-nav__link:hover,
.app-nav__link.is-active {
  background: var(--surface-alt);
  color: var(--ink);
}

.app-nav__logout-form {
  margin: 0;
  display: inline-flex;
}

.app-nav__logout-btn:hover {
  background: var(--c-failed-bg);
  color: var(--danger-dark);
}

/* 아이콘 전용 헤더 링크(설정 등) */
.app-nav__admin-link,
.app-nav__icon-link {
  padding: 0 var(--sp-2);
  min-width: 36px;
}

/* 헤더 안 사용자 이름 */
/* ── 구 .main-tabs(본문 상단 [녹음][회의록 목록]) ──
   v5 에서 내비게이션은 하단 탭바(.mobile-tabs)와 플로팅 버튼(.app-fab)이 맡는다.
   템플릿에서 이미 제거했지만, 혹시 남아 있어도 조용히 숨긴다. */
.main-tabs {
  display: none;
}

.app-main {
  max-width: 1080px;
  margin: 0 auto;
  padding: var(--sp-5) var(--sp-4) var(--sp-8);
}

/* 문서 풀블리드 뷰어(detail.html, base.html 의 hide_app_chrome 과 짝) */
.app-main.app-main--flush {
  max-width: none;
  margin: 0;
  padding: 0;
}

.page {
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--sp-3);
  flex-wrap: wrap;
}

/* ── 하단 중앙 플로팅 주요 동작([새 회의록]) ──
   목록/관리자 화면에서 스크롤 내내 따라온다. 상세(.page--detail)에는 두지 않는다 —
   문서가 풀블리드라 가릴 것이 없어야 하기 때문. */
.app-fab {
  position: fixed;
  left: 50%;
  bottom: calc(var(--sp-5) + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 30;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  min-height: 46px;
  padding: 0 22px;
  border-radius: var(--radius-full);
  border: 1px solid var(--ink);
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: var(--shadow-fab);
  cursor: pointer;
  transition: background-color 120ms ease, transform 120ms ease;
}

.app-fab:hover {
  background: var(--gradient-primary-hover);
  color: #fff;
}

.app-fab:active {
  transform: translateX(-50%) translateY(1px);
}

/* 모바일·태블릿(<1024px)에서는 플로팅을 아예 숨긴다 — 하단 탭바 가운데 [녹음] 탭이
   같은 목적지를 상시 제공하므로, 둘을 함께 띄우면 같은 동작이 세로로 겹친다.
   1024px 이상(탭바가 사라지는 구간)에서만 플로팅이 그 역할을 대신한다. */
@media (max-width: 1023.98px) {
  .app-fab {
    display: none;
  }

  /* 좁은 헤더: 로고 텍스트를 접어 가운데 탭이 눌리지 않게 한다(로고 마크는 유지). */
  .app-header__center:not(:empty) ~ .app-nav .app-nav__logout-btn,
  .app-header__lead:has(+ .app-header__center:not(:empty)) .app-logo__text {
    display: none;
  }
}

/* ── 모바일 하단 탭바 ──
   최상위 화면(회의록 · 새 회의록 · 설정)에만 노출된다. 밀려 올라오는 화면
   (상세 · 처리중 · 직원 관리)은 base.html 에서 hide_mobile_tabs 로 끈다. */
.mobile-tabs {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  display: flex;
  align-items: stretch;
  gap: var(--sp-1);
  padding: 6px 10px calc(10px + env(safe-area-inset-bottom, 0px));
  background: var(--surface);
  border-top: 1px solid var(--line);
}

.mobile-tabs__tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-1);
  min-height: 56px;
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: var(--text-faint);
  font-size: 11px;
  font-weight: 500;
}

.mobile-tabs__tab.is-active {
  color: var(--ink);
  font-weight: 600;
}

.mobile-tabs__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* 가운데 [녹음] 탭만 잉크로 채워 이 앱에서 할 일이 무엇인지 먼저 말하게 한다 */
.mobile-tabs__tab--record .mobile-tabs__icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
}

.mobile-tabs__tab--record.is-active .mobile-tabs__icon {
  background: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

/* 탭바가 콘텐츠를 가리지 않도록 본문 하단 여유 */
@media (max-width: 1023.98px) {
  /* 탭바 높이 + 한 칸 — 마지막 목록 행이 탭바 뒤로 숨지 않게 한다.
     이 구간에는 플로팅(.app-fab)이 없으므로 그 높이는 더하지 않는다. */
  body.has-mobile-tabs .app-main {
    padding-bottom: calc(var(--mobile-tabs-h) + var(--sp-5)
      + env(safe-area-inset-bottom, 0px));
  }
}


@media (min-width: 1024px) {
  .mobile-tabs {
    display: none;
  }
}

/* ---------- 6. 버튼 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  min-height: 36px;
  padding: 0 var(--sp-4);
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease,
    opacity 120ms ease;
  touch-action: manipulation;
}

.btn:hover {
  background: var(--surface-alt);
  border-color: var(--line-strong);
}

/* 주요 동작 = 잉크. 액센트는 상태/링크 몫이다. */
.btn--primary {
  background: var(--gradient-primary);
  border-color: var(--gradient-primary);
  color: #fff;
}

.btn--primary:hover {
  background: var(--gradient-primary-hover);
  border-color: var(--gradient-primary-hover);
  color: #fff;
}

.btn--secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--line-strong);
}

.btn--secondary:hover {
  background: var(--surface-alt);
}

.btn--ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-light);
  padding: 0 var(--sp-3);
}

.btn--ghost:hover {
  background: var(--surface-alt);
  color: var(--ink);
}

/* 파괴적 동작은 idle 부터 또렷하게 — v10 에서 기존 hover 모양(연한 위험색 tint + 진한
   테두리)을 기본값으로 승격했다. hover 는 거기서 한 단계만 더 진해진다. */
.btn--danger {
  background: var(--c-failed-bg);
  color: var(--danger-dark);
  border-color: var(--danger);
}

.btn--danger:hover {
  background: #f7e3e0;
  border-color: var(--danger-dark);
  color: var(--danger-dark);
}

.btn--block {
  width: 100%;
}

.btn--sm {
  min-height: 30px;
  padding: 0 var(--sp-3);
  font-size: 12.5px;
  border-radius: 5px;
}

.btn:disabled,
.btn[aria-disabled="true"],
.detail-tabs__tab:disabled,
.detail-tabs__tab[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.btn__icon {
  display: inline-flex;
}

/* PDF 변환 진행 중(detail.js 가 aria-busy 토글) */
.btn[aria-busy="true"] {
  opacity: 0.45;
  cursor: progress;
  pointer-events: none;
}

/* 모바일 터치 타깃 — 44px 미만으로 내려가지 않게 */
@media (max-width: 1023.98px) {
  .btn {
    min-height: 44px;
  }

  .btn--sm {
    min-height: 36px;
  }
}

/* ---------- 7. 폼 ---------- */
.form-field {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  margin-bottom: var(--sp-4);
}

.form-label {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text);
}

.form-label__optional {
  font-weight: 400;
  color: var(--text-faint);
}

.form-input {
  min-height: 40px;
  padding: 0 var(--sp-3);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--text);
  background: var(--surface);
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.form-input::placeholder {
  color: var(--text-faint);
}

.form-input:hover {
  border-color: var(--text-faint);
}

.form-input:focus,
.form-input:focus-visible {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

select.form-input {
  appearance: none;
  padding-right: var(--sp-6);
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235a616e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9.5 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 14px;
}

/* ── 비밀번호 보기 토글 ──
   .form-input 위에 아이콘 버튼을 얹는다. 버튼 폭만큼 입력 오른쪽 패딩을 비워 커서와
   겹치지 않게 한다. 마크업/동작 계약은 static/password-toggle.js 상단 주석 참고. */
.form-password {
  position: relative;
  display: flex;
}

.form-password .form-input {
  width: 100%;
  padding-right: 44px;
}

.form-password__toggle {
  position: absolute;
  right: 3px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: none;
  border-radius: 5px;
  background: transparent;
  color: var(--text-faint);
  cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease;
}

.form-password__toggle:hover {
  background: var(--surface-alt);
  color: var(--ink);
}

.form-password__toggle[aria-pressed="true"] {
  color: var(--primary);
}

@media (max-width: 1023.98px) {
  /* 터치 타깃 44px 확보 — 입력 높이도 48px 로 커진다 */
  .form-password .form-input {
    padding-right: 52px;
  }

  .form-password__toggle {
    width: 44px;
    height: 44px;
  }
}

.form-check {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  min-height: 44px;
  margin: 0 0 var(--sp-3);
}

.form-check__input {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  flex: none;
}

.form-check__label {
  font-size: 13px;
  color: var(--text-light);
  cursor: pointer;
}

@media (max-width: 1023.98px) {
  .form-input {
    min-height: 48px;
    /* iOS 자동 확대 방지 — 16px 미만이면 포커스 시 화면이 줌된다 */
    font-size: 16px;
  }
}

/* ---------- 8. 알림 / 배너 ---------- */
.alert {
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--radius-sm);
  border: 1px solid var(--c-failed-border);
  border-left: 2px solid var(--c-failed-text);
  background: var(--c-failed-bg);
  color: var(--c-failed-text);
  font-size: 13px;
  line-height: 1.6;
}

.alert--error {
  border-color: var(--c-failed-border);
  border-left-color: var(--danger);
  background: var(--c-failed-bg);
  color: var(--c-failed-text);
}

.alert--success {
  border-color: var(--line);
  border-left-color: var(--c-done-dot);
  background: var(--surface);
  color: var(--text);
}

.banner {
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--radius-sm);
  border: 1px solid var(--c-failed-border);
  border-left: 2px solid var(--danger);
  background: var(--c-failed-bg);
  color: var(--c-failed-text);
  font-size: 13px;
  line-height: 1.65;
}

.banner--warning {
  border-color: var(--progress-line);
  border-left-color: var(--progress);
  background: var(--progress-soft);
  color: #7a4d05;
}

.banner__title {
  display: block;
  font-weight: 600;
  margin-bottom: var(--sp-1);
}

.banner__desc {
  color: inherit;
}

/* ---------- 9. 로그인 / 비밀번호 화면 ---------- */
.auth-wrap {
  position: relative;
  min-height: calc(100vh - 220px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-6) 0;
}

.auth-wrap--inline {
  min-height: 0;
  padding: 0;
  display: block;
}

.auth-wrap--inline .auth-card {
  margin: 0 auto;
}

.auth-card {
  position: relative;
  width: 100%;
  max-width: 392px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--sp-5);
}

/* v4 의 상단 그라디언트 바(.auth-card::before) 제거 */

.auth-card__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 7px;
  background: var(--ink);
  color: #fff;
  margin-bottom: var(--sp-4);
}

.auth-card__eyebrow {
  margin: 0 0 var(--sp-2);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.auth-card__title {
  font-size: 21px;
  margin-bottom: var(--sp-2);
}

.auth-card__desc {
  margin: 0 0 var(--sp-5);
  color: var(--text-light);
  font-size: 13px;
  line-height: 1.6;
}

.auth-form {
  display: flex;
  flex-direction: column;
}

.auth-card .alert {
  margin-bottom: var(--sp-4);
}

.auth-card__note {
  margin: var(--sp-4) 0 0;
  padding-top: var(--sp-4);
  border-top: 1px solid var(--line);
  color: var(--text-light);
  font-size: 12.5px;
  line-height: 1.6;
}

/* ---------- 10. 녹음 화면 ---------- */
.record-view,
.status-view {
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
  width: 100%;
  max-width: 620px;
  margin: 0 auto;
}

.page--record {
  padding-bottom: var(--sp-8);
}

.record-hint {
  margin: 0;
  color: var(--text-light);
  font-size: 12.5px;
  text-align: center;
}

/* 녹음 카드 — v5: 하단 고정 FAB 이던 것을 흐름 안 카드로 되돌렸다.
   하단 중앙은 이제 [새 회의록](.app-fab)과 모바일 탭바의 자리이기 때문. */
.record-fab-wrap {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--sp-6) var(--sp-5);
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: var(--sp-4);
}

.record-panel__status {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-2);
  min-height: 28px;
}

.rec-indicator {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  height: 24px;
  padding: 0 10px 0 8px;
  border-radius: var(--radius-full);
  background: var(--c-failed-bg);
  border: 1px solid var(--c-failed-border);
  color: var(--danger);
  font-weight: 600;
  font-size: 11.5px;
}

.rec-indicator__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--danger);
  animation: rec-pulse 1.4s ease-in-out infinite;
}

@keyframes rec-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.rec-timer {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 24px;
  font-weight: 400;
  color: var(--text-faint);
  letter-spacing: 0.02em;
}

.rec-btn.is-recording ~ .record-panel__status .rec-timer,
.record-fab-wrap:has(.is-recording) .rec-timer {
  color: var(--ink);
}

.rec-btn {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  border: none;
  background: var(--ink);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-1);
  cursor: pointer;
  transition: background-color 120ms ease, transform 120ms ease, box-shadow 120ms ease;
  touch-action: manipulation;
}

.rec-btn:active {
  transform: scale(0.97);
}

.rec-btn__label {
  font-size: 11.5px;
  font-weight: 500;
}

.rec-btn.is-recording {
  background: var(--danger);
  box-shadow: 0 0 0 6px rgba(192, 57, 43, 0.12);
}

/* .rec-btn--fab 는 v4 의 알약형 축소 보조 클래스였다. v5 에서는 원형 그대로 두되
   훅으로 남은 클래스가 레이아웃을 깨지 않도록 무해화만 한다(record.js 무변경). */
.rec-btn--fab {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  flex-direction: column;
  padding: 0;
}

.rec-btn--fab .rec-btn__icon svg {
  width: 26px;
  height: 26px;
}

@media (max-width: 1023.98px) {
  .rec-btn,
  .rec-btn--fab {
    width: 96px;
    height: 96px;
  }
}

.upload-progress-wrap {
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
}

.upload-progress {
  width: 100%;
  height: 6px;
  border-radius: var(--radius-full);
  border: none;
  overflow: hidden;
  accent-color: var(--primary);
}

.upload-progress::-webkit-progress-bar {
  background: var(--surface-alt);
  border-radius: var(--radius-full);
}

.upload-progress::-webkit-progress-value {
  background: var(--primary);
  border-radius: var(--radius-full);
  transition: width 200ms ease;
}

/* ---------- 10b. 파일 업로드 ---------- */
.upload-divider {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin: 0;
  color: var(--text-faint);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.upload-divider::before,
.upload-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.file-upload-panel {
  background: var(--surface);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  padding: var(--sp-5);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-3);
  text-align: center;
  transition: border-color 120ms ease, background-color 120ms ease;
}

.file-upload-panel:hover {
  border-color: var(--text-faint);
  background: var(--surface-alt);
}

.file-upload-panel__hint {
  margin: 0;
  color: var(--text-light);
  font-size: 12.5px;
  line-height: 1.65;
}

.file-upload-panel__formats {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-faint);
}

.file-upload-panel__controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-3);
  flex-wrap: wrap;
}

.file-upload-panel__filename {
  font-size: 12.5px;
  color: var(--text-light);
  overflow-wrap: anywhere;
}

.file-upload-panel__filename.has-file {
  color: var(--ink);
  font-weight: 500;
}

.file-upload-panel__pick-btn:focus-within {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ---------- 11. 처리 상태판(스테퍼) ----------
   v5: 가로 트랙을 버리고 항상 세로 목록으로 간다 — 6개 한글 라벨이 가로로는 항상 좁았고,
   목록 화면(.meeting-card__progress)에 같은 정보가 요약돼 있으므로 여기서는 정확도를
   택했다. */
.step-track {
  list-style: none;
  margin: 0;
  padding: var(--sp-4) var(--sp-5);
  display: flex;
  flex-direction: column;
  gap: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.step {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  min-height: 44px;
  position: relative;
}

.step__marker {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 5px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text-faint);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease,
    box-shadow 150ms ease;
}

.step__check {
  display: none;
}

.step__check::before {
  content: "\2713";
  font-family: var(--font-sans);
  font-weight: 600;
}

.step__label {
  font-size: 13.5px;
  color: var(--text-faint);
  transition: color 150ms ease;
}

.step.is-current .step__marker {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.step.is-current .step__label {
  color: var(--primary);
  font-weight: 600;
}

.step.is-done .step__marker {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
  box-shadow: none;
}

.step.is-done .step__num {
  display: none;
}

.step.is-done .step__check {
  display: inline;
}

.step.is-done .step__label {
  color: var(--text);
}

.step.is-error .step__marker {
  border-color: var(--c-failed-border);
  background: var(--c-failed-bg);
  color: var(--danger);
  box-shadow: none;
}

.step.is-error .step__label {
  color: var(--danger);
  font-weight: 600;
}

.queue-position {
  margin: 0;
  color: var(--text-light);
  font-size: 12.5px;
  text-align: center;
}

/* ---------- 12. 회의록 목록 ----------
   v5: 두꺼운 카드 그리드 → 날짜로 묶은 행 목록. meetings.js 가 날짜 그룹을 렌더하면
   .meetings-group 으로 감싸지고, 그렇지 않으면(구 마크업) .meetings-list 자신이 카드
   껍데기가 되도록 두 형태 모두를 지원한다. */
.meetings-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

/* 그룹 없이 .meeting-card 가 바로 들어오는 경우 — 목록 전체가 하나의 카드 */
.meetings-list > .meeting-card:first-of-type {
  border-top: 1px solid var(--line);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.meetings-list > .meeting-card:last-of-type {
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.meetings-list > .meeting-card {
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  margin-bottom: -1px;
}

.meetings-list__loading {
  margin: 0;
  padding: var(--sp-6);
  text-align: center;
  color: var(--text-light);
  font-size: 13px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  animation: skeleton-pulse 1.6s ease-in-out infinite;
}

@keyframes skeleton-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

/* ── 날짜 그룹 ── */
.meetings-group {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.meetings-group__label {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 0 2px;
}

.meetings-group__label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.meetings-group__count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-faint);
  order: 3;
}

.meetings-group__body {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

/* ── 목록 행 ── */
.meeting-card {
  position: relative;
  cursor: pointer;
  background: var(--surface);
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  /* 위/아래 여백을 12px -> 20px 로 넓혀 행 사이 숨통을 틔운다(행 높이 ~73px -> ~89px). */
  padding: 20px var(--sp-4);
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  transition: background-color 120ms ease;
}

.meetings-group__body > .meeting-card:last-child {
  border-bottom: 0;
}

@media (hover: hover) and (pointer: fine) {
  .meeting-card:hover {
    background: var(--surface-alt);
  }
}

/* done 이 아닌 행도 흐리게 만들지 않는다(v4 의 opacity:.72 제거) — 처리중 회의록이야말로
   사용자가 가장 궁금해하는 항목이다. 클릭 불가만 커서로 알린다. */
.meeting-card[data-status]:not([data-status="done"]) {
  cursor: default;
}

/* 처리중 행은 배경으로 한눈에 구분한다 — 진행 표시와 같은 앰버 계열의 아주 옅은 톤이라
   "작업 중"으로 읽히고, 회색을 쓸 때처럼 "비활성"으로 오해되지 않는다.
   클릭 대상이 아니므로 호버 강조도 주지 않는다(미끼 어포던스 방지). */
.meeting-card[data-status="processing"] {
  background: var(--progress-soft);
}

@media (hover: hover) and (pointer: fine) {
  .meeting-card[data-status="processing"]:hover {
    background: var(--progress-soft);
  }
}

.meeting-card__main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.meeting-card__title {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink);
  margin: 0;
  line-height: 1.4;
}

.meeting-card__meta {
  margin: 0;
  display: flex;
  gap: var(--sp-2);
  flex-wrap: wrap;
  color: var(--text-light);
  font-size: 12.5px;
}

.meeting-card__datetime {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.meeting-card__datetime::after {
  content: "·";
  margin-left: var(--sp-2);
  color: var(--text-faint);
  font-family: var(--font-sans);
}

.meeting-card__side {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex: none;
  padding-top: 0;
  border-top: 0;
}

.meeting-card__side-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
}

/* ── 처리중 행 ──
   제목/일시/업로더/상태배지를 감추고 안내 문구와 진행 단계만 가운데로 보여준다.
   아직 열 문서가 없으므로 클릭도 막힌다(meetings.js 의 NAVIGABLE). */
.meeting-card__processing {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) 0;
  text-align: center;
}

/* 업로더 이름 — 처리중 행에서 유일한 식별 정보라 문구보다 위에 세운다. */
.meeting-card__processing-who {
  margin: 0;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--progress);
}

.meeting-card__processing-title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

.meeting-card__processing-desc {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-light);
}

/* 행 안 진행 단계 — 어느 단계인지(음성 인식 2/6) 바로 읽힌다 */
.meeting-card__progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  flex-wrap: wrap;
}

.meeting-card__progress-label {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--progress);
  white-space: nowrap;
}

.meeting-card__steps {
  display: flex;
  gap: 3px;
}

.meeting-card__step {
  width: 15px;
  height: 4px;
  border-radius: 2px;
  background: var(--line-strong);
}

.meeting-card__step.is-done {
  background: var(--progress);
}

.meeting-card__step.is-current {
  background: var(--progress);
  opacity: 0.4;
}

.meeting-card__count {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-faint);
}

/* 실패 행 전용 [다시 처리] — 행이 좁아져도 눌리지 않게 줄어들지 않는다 */
.meeting-card__retry {
  flex: none;
}

.meeting-card__chevron {
  flex: none;
  color: var(--text-faint);
}

/* ── 상태 배지 / 권한 배지 — 뉴트럴 필 + 유색 도트 ── */
.status-badge,
.role-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  padding: 0 9px 0 8px;
  border-radius: var(--radius-full);
  border: 1px solid var(--line);
  background: var(--surface-alt);
  color: var(--text-light);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.status-badge::before,
.role-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-faint);
  flex: none;
}

.status-badge[data-status="uploaded"] {
  color: var(--c-uploaded-text);
  background: var(--c-uploaded-bg);
  border-color: var(--c-uploaded-border);
}
.status-badge[data-status="uploaded"]::before { background: var(--c-uploaded-dot); }

.status-badge[data-status="pending"] {
  color: var(--c-pending-text);
  background: var(--c-pending-bg);
  border-color: var(--c-pending-border);
}
.status-badge[data-status="pending"]::before { background: var(--c-pending-dot); }

.status-badge[data-status="processing"] {
  color: var(--c-processing-text);
  background: var(--c-processing-bg);
  border-color: var(--c-processing-border);
}
.status-badge[data-status="processing"]::before { background: var(--c-processing-dot); }

.status-badge[data-status="done"] {
  color: var(--c-done-text);
  background: var(--c-done-bg);
  border-color: var(--c-done-border);
}
.status-badge[data-status="done"]::before { background: var(--c-done-dot); }

/* 되돌릴 일이 필요한 실패만 톤을 입힌다 */
.status-badge[data-status="failed"] {
  color: var(--c-failed-text);
  background: var(--c-failed-bg);
  border-color: var(--c-failed-border);
}
.status-badge[data-status="failed"]::before { background: var(--c-failed-dot); }

.role-badge[data-role="admin"] {
  color: var(--primary);
  background: var(--primary-light);
  border-color: var(--primary-soft);
}
.role-badge[data-role="admin"]::before { background: var(--primary); }

.role-badge[data-role="staff"] {
  color: var(--c-pending-text);
  background: var(--c-pending-bg);
  border-color: var(--c-pending-border);
}
.role-badge[data-role="staff"]::before { background: var(--c-pending-dot); }

/* ── 목록 상단 도구줄(검색 + 상태 필터) ── */
.list-toolbar {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex-wrap: wrap;
}

.list-search {
  position: relative;
  flex: 0 1 300px;
  min-width: 200px;
  display: flex;
  align-items: center;
}

.list-search__icon {
  position: absolute;
  left: 11px;
  color: var(--text-faint);
  pointer-events: none;
}

.list-search .form-input {
  width: 100%;
  padding-left: 34px;
  margin: 0;
}

.filter-chips {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  flex-wrap: wrap;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text-light);
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}

.filter-chip:hover {
  background: var(--surface-alt);
  color: var(--ink);
}

.filter-chip__count {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-faint);
}

.filter-chip[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.filter-chip[aria-pressed="true"] .filter-chip__count {
  color: rgba(255, 255, 255, 0.65);
}

@media (max-width: 1023.98px) {
  .filter-chip {
    min-height: 44px;
    padding: 0 13px;
  }

  .list-search {
    flex: 1 1 100%;
  }
}

.empty-state {
  padding: var(--sp-7) var(--sp-5);
  text-align: center;
  background: var(--surface);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  color: var(--text-light);
}

.empty-state__title {
  margin: 0 0 var(--sp-2);
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
}

.empty-state__desc {
  margin: 0;
  font-size: 12.5px;
}

.empty-state a {
  color: var(--primary);
  font-weight: 500;
}

.page--meetings {
  padding-bottom: var(--sp-8);
}

/* #refresh-btn — v4 에서는 하단 중앙 고정 pill 이었다. 그 자리는 이제 [새 회의록]
   플로팅(.app-fab)이 차지하므로, 새로고침은 페이지 헤더 안 조용한 버튼으로 돌아간다.
   (id 는 meetings.js 훅이라 그대로 유지.) */
.refresh-fab {
  position: static;
  transform: none;
  box-shadow: none;
  border-radius: var(--radius-sm);
  padding: 0 var(--sp-3);
}

.refresh-fab:hover,
.refresh-fab:active {
  transform: none;
}

/* ---------- 13. 상세 보기 (v9) ----------
   더 이상 풀블리드가 아니다 — 다른 화면과 같은 사이트 헤더 아래, 같은 .app-main 컨테이너
   안에서 같은 좌/우 마진을 쓴다. [회의록|스크립트] 탭은 사이트 헤더 중앙으로 올라갔고,
   읽기/스크립트 액션은 문서 우측 하단 플로팅 위젯(.doc-actions)이 맡는다.
   ⚠️ v8 까지 있던 .detail-topbar / .detail-back / .detail-heading / .detail-topbar__actions
   규칙은 마크업과 함께 제거됐다(재추가 금지). */
/* 상세는 세로를 꽉 쓴다 — 푸터가 없고 본문 하단 패딩도 줄여, 뷰포트에서 헤더와 상하
   패딩만 뺀 높이를 그대로 갖는다. 안쪽은 flex 로 나눠 가지므로 패널 높이에 매직넘버가
   없다(편집 모드에서 하단 툴바가 생기면 딱 그만큼만 패널이 줄어든다). */
.app-main:has(> .page--detail) {
  padding-bottom: var(--sp-5);
}

.page--detail {
  height: calc(100dvh - var(--app-header-h) - var(--sp-5) * 2);
  min-height: 420px;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

/* 문서 + 액션 열을 나란히 놓는 행 */
.detail-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: stretch;
  gap: var(--sp-3);
}

/* 두 탭 패널은 같은 높이를 쓴다 — 뷰포트에서 헤더/여백/푸터를 뺀 값. 페이지 자체는
   넘치지 않고 스크롤은 패널 안에서만 일어난다(스크롤바 이중 노출 방지). */
.detail-frame-wrap,
.transcript-panel {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.detail-frame-wrap {
  position: relative;
  background: var(--surface);
}

.minutes-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: var(--surface);
}

/* ⚠️ detail.js 는 .is-editing 을 .page--detail 이 아니라 #detail-frame-wrap 에 건다
   (setEditingUi -> frameWrap.classList.toggle). 선택자를 그 기준으로 쓴다. */
.detail-frame-wrap.is-editing .minutes-frame {
  box-shadow: inset 0 0 0 2px var(--primary);
}

/* 탭(세그먼트) — 사이트 헤더 중앙에 놓인다 */
.detail-tabs {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  background: var(--surface-alt);
  border: 1px solid var(--line);
  border-radius: 7px;
}

.detail-tabs__tab {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  min-height: 28px;
  padding: 0 var(--sp-4);
  border-radius: 5px;
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-faint);
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 120ms ease, color 120ms ease;
}

.detail-tabs__tab:hover {
  color: var(--text);
}

.detail-tabs__tab[aria-selected="true"] {
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--ink);
  font-weight: 600;
}

.editing-badge {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  padding: 0 10px 0 8px;
  border-radius: var(--radius-full);
  background: var(--progress-soft);
  border: 1px solid var(--progress-line);
  color: var(--progress);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

.editing-badge__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--progress);
  flex: none;
}

/* ── 액션 열 ──
   데스크톱: 문서 **바깥** 오른쪽에 세로로 선다. justify-content:flex-end 로 아래 정렬해
   [삭제][편집][PDF 다운로드] 가 문서 하단과 눈높이를 맞춘다.
   #toolbar-view-actions / #toolbar-script-actions 를 복제하지 않고 그대로 품고 있어
   detail.js 의 hidden 토글이 탭/모드에 맞는 그룹 하나만 보여준다. */
.doc-actions {
  flex: none;
  width: 148px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: var(--sp-2);
}

/* 편집 모드에서는 하단 툴바가 모든 액션을 갖고 있으므로 이 열을 숨긴다(폭 148px 도 함께
   회수돼 문서가 그만큼 넓어진다). .doc-actions 는 #detail-frame-wrap 의 뒤 형제다. */
.detail-frame-wrap.is-editing ~ .doc-actions {
  display: none;
}

/* [스크립트] 탭에서는 이 열에 보일 그룹이 하나도 없다(스크립트 저장은 패널 안으로 갔다) —
   빈 열이나 모바일의 빈 [⋯] 토글만 남지 않게 통째로 숨긴다. */
.doc-actions:not(:has(.detail-toolbar__group:not([hidden]))) {
  display: none;
}

.doc-actions__menu {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  width: 100%;
}

.doc-actions__menu .detail-toolbar__group {
  flex-direction: column;
  width: 100%;
  max-width: none;
  flex-wrap: nowrap;
  gap: var(--sp-2);
}

.doc-actions__menu .btn {
  flex: none;
  width: 100%;
  min-width: 0;
  /* .btn--sm(30px)은 문서 옆 단독 열에 서기엔 너무 작다 — 목록 행이나 폼 컨트롤과
     비슷한 무게로 키운다. */
  min-height: 42px;
  padding: 0 var(--sp-3);
  font-size: 13px;
  justify-content: flex-start;
}

/* 데스크톱에서는 토글이 필요 없다 — 버튼이 항상 펼쳐져 있다. */
.doc-actions__toggle {
  display: none;
}

/* 스크립트 패널 */
.transcript-panel {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding: var(--sp-5);
  background: var(--surface);
}

.transcript-panel__state {
  margin: 0;
  padding: var(--sp-6);
  text-align: center;
  color: var(--text-light);
  font-size: 13px;
}

.transcript-panel__state--error {
  color: var(--danger);
}

.transcript-panel__content {
  max-width: 760px;
  margin: 0 auto;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.85;
  color: var(--text);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* 화자 뱃지 — 스크립트 탭에서 "[SPEAKER_01]" 줄 머리를 detail.js 가 이 span 으로 바꾼다 */
.speaker-badge {
  display: inline-block;
  margin-right: 8px;
  padding: 0 8px;
  border-radius: var(--radius-full);
  border: 1px solid var(--primary-soft);
  background: var(--primary-light);
  color: var(--primary-dark);
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  line-height: 20px;
  vertical-align: 1px;
  white-space: nowrap;
}

.speaker-badge[data-speaker="UNKNOWN"] {
  border-color: var(--line);
  background: var(--surface-alt);
  color: var(--text-faint);
}

/* ── 스크립트 패널 상단 줄 ──
   왼쪽 [음성 듣기](+재생 중이면 플레이어), 오른쪽 [스크립트 저장]. 저장 버튼은 flex:none
   이라 플레이어가 펼쳐져도 오른쪽 끝에 그대로 붙어 있는다. */
.script-toolbar {
  max-width: 760px;
  margin: 0 auto var(--sp-4);
  padding-bottom: var(--sp-4);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex-wrap: wrap;
}

.script-toolbar:empty {
  display: none;
}

.script-audio {
  /* basis 를 auto + min-width:0 으로 둬야 좁은 화면(390px)에서도 [스크립트 저장]과 한 줄에
     들어간다 — 고정 basis(240px)를 주면 저장 버튼이 다음 줄로 밀려난다. */
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.script-audio__player {
  flex: 1 1 auto;
  /* 네이티브 컨트롤은 고유 최소폭이 꽤 크다 — 0 으로 눌러 좁은 화면에서도 줄바꿈 없이
     남은 폭에 맞춰 줄어들게 한다. */
  min-width: 0;
  width: 100%;
  height: 36px;
}

.script-toolbar #toolbar-script-actions {
  flex: none;
  width: auto;
  max-width: none;
  margin-left: auto;
}

.script-toolbar #toolbar-script-actions .btn {
  flex: none;
  min-width: 0;
}

/* 처리 중 안내(문서가 아직 없을 때) */
.detail-processing {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-3);
  padding: var(--sp-6);
  text-align: center;
  background: var(--bg);
}

.detail-processing__spinner {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--line-strong);
  border-top-color: var(--primary);
  animation: spin 900ms linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.detail-processing__title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

.detail-processing__desc {
  margin: 0;
  max-width: 380px;
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--text-light);
}

/* 하단 툴바 — 편집 모드 전용 */
.detail-toolbar {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.detail-toolbar:not(:has(> .detail-toolbar__group:not([hidden]))) {
  display: none;
}

.detail-toolbar__group {
  display: flex;
  gap: var(--sp-2);
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
  max-width: 560px;
}

.detail-toolbar__group .btn {
  flex: 1 1 0;
  min-width: 96px;
}

.detail-toolbar__actions {
  display: flex;
  gap: var(--sp-2);
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
}

.detail-toolbar__divider {
  align-self: stretch;
  flex: none;
  width: 1px;
  min-height: 24px;
  background: var(--line);
}

.detail-toolbar__danger-group {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex: none;
}

/* ---------- 14. 서식 도구모음(편집 모드) ---------- */
.detail-toolbar__group--edit {
  flex-direction: column;
  gap: var(--sp-3);
  max-width: 680px;
}

.format-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  width: 100%;
  user-select: none;
}

.format-toolbar[data-selection="empty"] .format-btn:not(#btn-bullet-list):not(#btn-numbered-list),
.format-toolbar[data-selection="empty"] .format-select:not(#select-block-style),
.format-toolbar[data-selection="empty"] .fmt-color-swatch,
.format-toolbar[data-selection="empty"] .format-color-custom {
  opacity: 0.5;
}

.format-toolbar__cluster {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  flex: none;
}

.format-toolbar__seg {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  flex: none;
}

.format-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: var(--text-light);
  font-family: var(--font-sans);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease, border-color 120ms ease;
}

.format-btn:hover {
  background: var(--surface-alt);
  color: var(--ink);
}

.format-btn[aria-pressed="true"] {
  background: var(--surface-alt);
  border-color: var(--line-strong);
  color: var(--ink);
}

.format-btn--bold {
  font-weight: 700;
}

.format-btn--italic {
  font-style: italic;
}

.format-select {
  min-height: 32px;
  padding: 0 var(--sp-2);
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
}

.fmt-color-swatch {
  width: 19px;
  height: 19px;
  padding: 0;
  border: 1px solid rgba(20, 22, 27, 0.12);
  border-radius: 50%;
  cursor: pointer;
}

.fmt-color-swatch:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.format-color-custom {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px dashed var(--line-strong);
  border-radius: 50%;
  background: var(--surface);
  cursor: pointer;
}

/* ---------- 15. 관리자 화면 ---------- */
.admin-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 0;
  display: flex;
  flex-direction: column;
}

.admin-panel__title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--line);
}

.admin-panel > .banner,
.admin-panel > .emp-add-form,
.admin-panel > .empty-state,
.admin-panel > .emp-table-wrap {
  margin: var(--sp-4);
}

.admin-panel > .emp-table-wrap {
  margin: 0;
  border: 0;
  border-radius: 0;
}

.admin-panel > .empty-state {
  border: 0;
  background: transparent;
}

/* 직원 추가 폼: 모바일 1열 → 넓은 화면에서 다열(18번 반응형) */
.emp-add-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-3);
}

.emp-add-form .form-field {
  margin-bottom: 0;
}

.emp-add-form__submit {
  align-self: end;
}

.emp-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--surface);
}

.emp-table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
  font-size: 13px;
}

.emp-table thead tr {
  background: var(--surface-alt);
}

.emp-table th {
  padding: var(--sp-2) var(--sp-3);
  text-align: left;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text-faint);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.emp-table td {
  padding: var(--sp-3);
  border-bottom: 1px solid var(--line);
  color: var(--text);
  vertical-align: middle;
}

.emp-table tbody tr:last-child td {
  border-bottom: 0;
}

.emp-table tbody tr:hover {
  background: var(--surface-alt);
}

/* 이메일은 mono 로 — 자릿수/도메인이 눈으로 정렬된다 */
.emp-table td[data-label="이메일"] {
  font-family: var(--font-mono);
  font-size: 12.5px;
}

.emp-table__actions {
  white-space: nowrap;
  text-align: right;
}

.emp-table__actions .btn {
  margin-left: var(--sp-1);
}

/* ---------- 16. 모달(직원 수정 / 삭제 확인) ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-4);
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 22, 27, 0.42);
}

.modal__dialog {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  max-height: calc(100vh - var(--sp-7));
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--sp-5);
}

.modal__title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: var(--sp-3);
}

.modal__desc {
  margin: 0 0 var(--sp-3);
  font-size: 13px;
  line-height: 1.65;
  color: var(--text-light);
}

.modal__desc-target {
  color: var(--ink);
  font-weight: 600;
}

.modal__error {
  margin: 0 0 var(--sp-3);
  font-size: 12.5px;
  color: var(--danger);
}

.modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--sp-2);
  padding-top: var(--sp-2);
}

.emp-edit-form .form-field:last-of-type {
  margin-bottom: var(--sp-3);
}

/* ---------- 17. 설정 화면(모바일 [설정] 탭) ----------
   [설정]은 모든 권한이 쓴다 — 안에 들어있는 것이 권한마다 다를 뿐이다.
   직원: 계정 정보 · 비밀번호 변경 · 로그아웃 / 관리자: 위에 더해 [직원 관리] 한 줄. */
.settings-account {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-4);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.settings-account__avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--surface-alt);
  border: 1px solid var(--line);
  color: var(--text-light);
  flex: none;
}

.settings-account__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.settings-account__name {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}

.settings-account__email {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-account__dept {
  font-size: 11.5px;
  color: var(--text-faint);
}

.settings-section {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.settings-section__label {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 0 2px;
}

.settings-section__label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.settings-list {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.settings-list__item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  min-height: 56px;
  padding: 0 var(--sp-4);
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 120ms ease;
}

.settings-list__item:last-child {
  border-bottom: 0;
}

.settings-list__item:hover {
  background: var(--surface-alt);
}

.settings-list__icon {
  flex: none;
  color: var(--text-light);
  display: inline-flex;
}

.settings-list__text {
  flex: 1;
}

.settings-list__value {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-faint);
}

.settings-list__chevron {
  flex: none;
  color: var(--text-faint);
  display: inline-flex;
}

.settings-list__item--danger {
  color: var(--danger);
}

.settings-list__item--danger .settings-list__icon {
  color: var(--danger);
}

.settings-version {
  margin: 0;
  padding-top: var(--sp-2);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-faint);
  text-align: center;
}

/* ---------- 18. 반응형 (min-width 확장) ---------- */
@media (min-width: 640px) {
  .app-main {
    padding: var(--sp-5) var(--sp-5) var(--sp-8);
  }

  .transcript-panel {
    padding: var(--sp-6);
  }

  .emp-add-form {
    grid-template-columns: repeat(2, 1fr);
    align-items: end;
  }
}


@media (min-width: 1024px) {
  .app-main {
    padding-left: var(--sp-6);
    padding-right: var(--sp-6);
  }

  .emp-add-form {
    grid-template-columns: repeat(4, 1fr) auto;
  }
}

/* ---------- 19. 잔여 훅 / 소품 ----------
   템플릿·JS 가 참조하지만 위 섹션에서 다루지 않은 작은 것들. 이름은 훅이므로 유지한다. */

/* 버튼 안 텍스트 라벨(detail.js 가 PDF 버튼에서 querySelector(".btn__label")) */
.btn__label {
  display: inline;
}

/* 파일 input — 시각적으로만 숨기고 포커스는 살린다(.visually-hidden 과 함께 쓰인다) */
.file-upload-panel__input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

/* 목록 행 업로더 */
.meeting-card__uploader {
  color: var(--text-faint);
}

/* v3 에서 마크업이 제거된 "보기" 링크. 훅만 남아 있어도 레이아웃을 깨지 않게. */
.meeting-card__view-link {
  display: none;
}

/* 녹음 인디케이터 텍스트 */
.rec-indicator__text {
  font-weight: 600;
}

/* 서식 툴바 색 스와치 묶음 */
.format-swatches {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: none;
}

/* 하단 툴바 안내 문구 */
.detail-toolbar__notice {
  margin: 0;
  font-size: 11.5px;
  color: var(--text-faint);
  text-align: center;
}

/* 페이지 스코프 클래스(여백 조정용 훅) */
.page--admin {
  padding-bottom: var(--sp-8);
}

.page--password {
  padding-bottom: var(--sp-8);
}

/* 하단 탭바 라벨 */
.mobile-tabs__label {
  line-height: 1;
}

/* 설정 화면 — 섹션 사이 간격은 .page(gap)가 잡고, 하단 탭바 여유만 더해준다 */
.page--settings {
  padding-bottom: var(--sp-6);
}

/* ---------- 20. 목록으로 돌아가기(.page-back) ----------
   /record · /admin · /settings 처럼 목록에서 들어온 화면에서 되돌아갈 길을 준다.
   모바일·태블릿(<1024px)에는 하단 탭바가 같은 역할을 하므로 그때는 숨긴다 — 두 개가
   동시에 보이면 중복이다. */
.page-back {
  display: none;
  align-self: flex-start;
  align-items: center;
  gap: 5px;
  min-height: 32px;
  margin-bottom: calc(var(--sp-2) * -1);
  padding: 0 var(--sp-3) 0 var(--sp-2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text-light);
  font-size: 12.5px;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 120ms ease, color 120ms ease;
}

.page-back:hover,
.page-back:focus-visible {
  background: var(--surface-alt);
  color: var(--ink);
}

@media (min-width: 1024px) {
  .page-back {
    display: inline-flex;
  }
}

/* ── 상세: 모바일·태블릿(<1024px) ──
   편집은 데스크톱 전용이다(팀장 지시) — 좁은 화면에서 iframe contenteditable + 서식
   툴바는 실사용이 어렵고 오조작 위험만 크다. 버튼 자체를 숨겨 진입로를 막는다.
   액션 위젯은 [⋯] 토글을 눌러야 펼쳐지는 플로팅 메뉴가 된다. */
@media (max-width: 1023.98px) {
  #btn-edit {
    display: none !important;
  }

  /* 좁은 화면에서는 열을 세울 자리가 없다 — 문서 위에 뜨는 플로팅으로 되돌린다. */
  .detail-body {
    position: relative;
  }

  .doc-actions {
    position: absolute;
    right: var(--sp-3);
    bottom: var(--sp-3);
    width: auto;
    align-items: flex-end;
  }

  .doc-actions__menu {
    width: auto;
    align-items: flex-end;
  }

  .doc-actions__toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: var(--ink);
    color: #fff;
    cursor: pointer;
    box-shadow: var(--shadow-fab);
  }

  .doc-actions[data-open="true"] .doc-actions__toggle {
    background: var(--text-light);
  }

  .doc-actions__menu {
    display: none;
    flex-direction: column;
    align-items: flex-end;
    gap: var(--sp-2);
  }

  .doc-actions[data-open="true"] .doc-actions__menu {
    display: flex;
  }

  .doc-actions__menu .detail-toolbar__group {
    flex-direction: column;
    align-items: flex-end;
    width: auto;
  }

  .doc-actions__menu .btn {
    min-height: 44px;
    width: auto;
    justify-content: center;
    box-shadow: var(--shadow-fab);
  }


}
