/* Paperdana - Modals (3-Tier Dialog Standard, 33 Specialized Dialogs) */

/* ==========================================================================
   Modals
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  top: var(--titlebar-h, 0px);
  right: 0;
  bottom: 0;
  left: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(var(--blur-surface));
  -webkit-backdrop-filter: blur(var(--blur-surface));
  z-index: var(--z-modal-backdrop);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.modal-backdrop.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.modal-dialog {
  position: relative;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-modal);
  box-shadow: 0 24px 48px -12px rgba(0, 0, 0, 0.32), 0 0 0 1px rgba(255, 255, 255, 0.06);
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(20px) scale(0.98);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-backdrop.active .modal-dialog {
  transform: translateY(0) scale(1);
}

.modal-close-btn,
.btn-modal-close {
  position: absolute;
  top: 1.1rem;
  right: 1.25rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid transparent;
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease, transform 0.18s ease;
  z-index: 10;
  padding: 0;
}

.modal-close-btn svg,
.btn-modal-close svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  stroke-width: 2;
  transition: transform 0.18s ease;
}

.modal-close-btn:hover,
.btn-modal-close:hover {
  background: rgba(255, 255, 255, 0.18);
  color: var(--text-bright);
}

.modal-close-btn:hover svg,
.btn-modal-close:hover svg {
  transform: scale(1.08);
}

[data-theme="light"] .modal-close-btn,
[data-theme="light"] .btn-modal-close {
  background: rgba(0, 0, 0, 0.06);
  color: var(--text-dim);
}

[data-theme="light"] .modal-close-btn:hover,
[data-theme="light"] .btn-modal-close:hover {
  background: rgba(0, 0, 0, 0.12);
  color: var(--text-bright);
}

/* Detail View Redesign (Left Meta Cards L1~L4, Right Information R1~R6)

   [v0.8.80] `.detail-card` / `.detail-card-header` 의 정의를 이 파일에서 제거했다.
   상세 뷰는 모달이 아니라 '페이지'이므로 소유자는 layout.css 가 맞다.
   종전에는 양쪽에 정의가 있었고 로드 순서상 이 파일이 늘 이겨서,
   layout.css 의 값은 실제로 한 번도 적용되지 않는 죽은 선언이었다.
   → 단일 정의: static/css/layout.css 의 "상세 뷰 카드 시스템 (단일 정의)" 참조. */

.detail-card-icon {
  font-size: 1rem;
  line-height: 1;
}

.detail-card-title {
  letter-spacing: -0.01em;
}


.badge-doc-type {
  background: var(--accent-purple-soft);
  color: var(--author-color);
  border: 1px solid var(--accent-purple-border);
}

/* (제거된 중복) `.detail-title` 1.55rem / `.detail-subtitle` 0.98rem 정의는
   이 파일 아래쪽(R1: Header Block, 약 320행)에서 1.85rem / 1.05rem 로
   다시 정의되고 있었다. 같은 파일 안에서 앞 정의가 늘 덮여 죽은 코드였으므로
   삭제했다. 상세 뷰 제목 규격은 아래 R1 블록 하나만 남는다. */

/* Author Chips */
.detail-authors-box {
  margin-bottom: 0.85rem;
}

.author-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.author-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-chip);
  font-size: 0.82rem;
  color: var(--text-main);
  cursor: pointer;
  transition: var(--transition);
}

.author-chip:hover {
  background: var(--accent-blue-soft);
  border-color: var(--accent-blue);
  color: var(--text-bright);
}

.author-chip.primary {
  background: var(--btn-tertiary-bg);
  border-color: var(--border-active);
  color: var(--author-color);
  font-weight: 600;
}

.chip-role {
  font-size: 0.65rem;
  background: var(--accent-gradient);
  color: #fff;
  padding: 0.1rem 0.35rem;
  border-radius: var(--radius-chip);
  font-weight: 600;
}

/* Journal & Source Details Card */
.detail-source-card {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-paper-md);
  padding: 0.75rem 1rem;
  margin-bottom: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.source-header {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.source-icon {
  font-size: 1.2rem;
}

.source-journal {
  font-size: 0.95rem;
  font-weight: 600;
  color: #38bdf8;
  cursor: pointer;
}

.source-journal:hover {
  text-decoration: underline;
}

.source-vol-issue {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}

.source-sub-details {
  display: flex;
  gap: 1.25rem;
  font-size: 0.76rem;
  color: var(--text-dim);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 0.35rem;
}

/* Keywords Row */
.detail-keywords-row {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
  flex-wrap: wrap;
}

.keywords-label {
  font-size: 0.78rem;
  color: var(--text-dim);
  font-weight: 600;
}

.keywords-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

/* v0.10.4: 직접 지정한 하늘색 → 커스텀 태그 칩·컬렉션 배지와 같은 중성 면 토큰 (라이트 테마 대비 문제 해소) */
.keyword-chip {
  background: var(--surface-control);
  /* v0.10.6: 규격도 커스텀 태그 칩(.detail-tag-chip)과 같게 — 0.76rem · 600 · --text-bright */
  color: var(--text-bright);
  border: 1px solid var(--border-subtle);
  font-size: 0.76rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-chip);
  cursor: pointer;
  transition: var(--transition);
}

.keyword-chip:hover {
  background: var(--bg-hover);
  border-color: var(--accent-blue);
  color: var(--accent-blue);
}

/* L3 & L4: Key-Value Lists */
.detail-kv-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

/* [v0.8.81 · C-3] 정렬을 space-between + 우측정렬에서 좌측정렬 + 라벨 고정폭으로 바꿨다.
   종전에는 라벨이 왼쪽, 값이 오른쪽 끝에 붙어 줄마다 눈이 좌우로 지그재그로 튀었다.
   320px 컬럼에서 값이 두 줄로 접히면 '라벨 … 값' 사이 빈 골짜기가 크게 벌어져
   한 항목으로 읽히지 않고 두 개의 단어로 흩어졌다.
   이제 라벨은 min-width 로 세로 정렬선을 만들고 값은 바로 옆에서 시작한다.
   (min-width 이지 width 가 아니다 — '내장 서지정보'처럼 긴 라벨은 늘어날 수 있어야
    값이 잘리지 않는다.) */
.detail-kv-row {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: 0.84rem;
  line-height: 1.45;
}

.detail-kv-row .kv-label {
  min-width: 5.5rem;
  color: var(--text-dim);
  font-weight: 600;
  font-size: 0.8rem;
  flex-shrink: 0;
  padding-top: 0.05rem;
}

.detail-kv-row .kv-val {
  flex: 1;
  min-width: 0;
  color: var(--text-main);
  /* [v0.8.104] 600 → 400. 라벨과 값의 굵기가 같아 위계가 없었다.
     0.8rem/600 인 라벨보다 0.84rem/600 인 값이 '더 크고 같은 굵기'라
     값이 라벨을 눌러버려, 항목명은 보조인데 내용이 제목처럼 읽혔다.
     typography_system_guide.md §3 의 3단계 규칙상 이 텍스트는
       · 300(정독 본문: 초록·메모·부제 — 전부 --font-serif)
       · 600(제목·라벨·강조·버튼)
     어느 쪽도 아니다. DOI·권호·파일 크기·해시 같은 짧은 메타데이터이므로
     가이드 판정 트리 ⑤ '어느 쪽도 아니면 굵기를 지정하지 않는다(400 상속)'
     가 정본이다. 300 은 serif 정독 계층의 값이라 여기 쓰면 의미가 흐려진다. */
  font-weight: 400;
  text-align: left;
  /* [v0.8.85] break-all 은 한글에는 무해하지만 URL 에는 재앙이다.
     '.../viewdoc/download?doi=10.1...' 처럼 슬래시·물음표 없이도 아무 글자나
     잘려 URL 하나가 2줄로 쪼개졌다. URL 은 한 줄에 하나가 원칙이므로,
     일반 텍스트는 단어 단위(keep-all + break-word)로, URL 만 별도 규칙으로
     한 줄 고정 + 말줄임 처리한다. */
  word-break: keep-all;
  overflow-wrap: break-word;
}

/* URL 링크: 한 줄 고정. 길면 자르고 말줄임. 절대 2줄이 되지 않는다.
   - display: flex + width:100% 로 링크가 kv-val 폭을 꽉 채우게 해야
     text-align:left 가 실제로 왼쪽 정렬로 보인다(인라인 요소는 폭이 내용만큼만
     잡혀 정렬이 무의미하다).
   - .detail-urls-column 이 align-items:flex-end 였기 때문에 오른쪽으로 밀려
     '왜 왼쪽 정렬이 아니지'로 보였다. 여기서 stretch + left 로 되돌린다.
   - 링크 아이콘도 flex-shrink:0 으로 고정해, 텍스트가 잘릴 때 아이콘이
     먼저 찌그러지지 않게 한다(2줄로 보이던 또 다른 원인). */
.detail-kv-row .kv-val a,
.detail-kv-row .kv-val .detail-urls-column a {
  color: var(--accent-blue);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 링크 안의 텍스트만 줄어들 수 있어야 말줄임이 걸린다.
   아이콘(외부링크)은 고정, 텍스트는 min-width:0 + overflow:hidden + ellipsis. */
.detail-kv-row .kv-val a > .detail-link-text {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-kv-row .kv-val a > svg,
.detail-kv-row .kv-val a > .external-link-icon {
  flex: 0 0 auto;
}

/* 말줄임이 걸리는 텍스트 노드 래퍼가 없으므로, 링크의 텍스트는
   축소 가능하게 두고 아이콘만 고정한다. (아이콘은 위 규칙으로 flex-shrink:0) */
.detail-kv-row .kv-val .detail-urls-column a {
  /* URL 목록 자체도 좌측 정렬·한 줄 원칙을 따른다. */
  justify-content: flex-start;
}

/* URL 묶음: 종전엔 flex-end + width:100% 라 오른쪽 정렬로 보였다.
   세로로 쌓되 각 줄은 왼쪽에서 시작한다. */
.detail-kv-row .kv-val .detail-urls-column {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.3rem;
  width: 100%;
  min-width: 0;
}

/* [v0.8.85] DOI 행도 같은 문제(긴 DOI 가 2줄)를 겪는다.
   kv-val 직계 <a> 도 텍스트 래퍼가 없으므로 동일하게 한 줄 고정한다.
   단, DOI 는 URL 보다 짧아 대개 한 줄에 들어가고, 넘칠 때만 말줄임된다. */
.detail-kv-row .kv-val > a {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.detail-kv-row .kv-val a:hover {
  text-decoration: underline;
}

.detail-kv-row .badge-doc-type {
  background: var(--bg-tertiary);
  color: var(--text-bright);
  font-size: 0.76rem;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-chip);
  border: 1px solid var(--border-subtle);
}

/* R1: Header Block */
.detail-header-block {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin-bottom: 0.1rem;
}

.detail-title {
  font-family: var(--font-serif);
  font-size: 1.85rem;
  font-weight: 600;
  line-height: 1.38;
  color: var(--text-bright);
  letter-spacing: -0.015em;
  word-break: keep-all;
  margin-bottom: 0 !important;

  /* 브랜드 로고와 동일한 그라디언트 텍스트 효과 */
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  /* fallback */
  display: inline-block;
  /* 배경 클리핑이 블록 전체로 밀리지 않도록 인라인 블록 권장 */
}

.detail-subtitle {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 300;
  line-height: 1.5;
  color: var(--text-dim);
  letter-spacing: -0.01em;
  word-break: keep-all;
  margin-bottom: 0 !important;
  margin-top: 0.1rem;
}

.crumb-sep {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  margin: 0 0.15rem;
  vertical-align: middle;
}

.crumb-author-year {
  /* font-size: 0.82rem; */
  font-weight: 600;
  color: var(--text-dim);
  margin-left: 0.35rem;
  vertical-align: middle;
}

/* R2: 서지 바 — 정의를 layout.css 로 단일화했다 (v0.8.80).
   이 파일에 있던 `.detail-biblio-bar` 는 카드형(bg + border + shadow)을 선언했지만
   layout.css 의 `background/border/box-shadow: none !important` 에 전부 무력화되어
   화면에는 아무 영향이 없었다. 선언 두 벌이 서로 상쇄하는 상태만 남았으므로 제거.

   함께 삭제한 미사용(dead) 셀렉터 — index.html 에 존재하지 않는다:
     .biblio-line, .biblio-line-icon, .biblio-pub-text,
     .biblio-action-area, .btn-copy-biblio(+:hover)

   함께 삭제한 중복 정의 — layout.css 에 실제 정의가 있다:
     .biblio-main-content  → layout.css
     .biblio-journal-vol   → layout.css
     .biblio-year          → layout.css
     .biblio-publisher     → layout.css
     .biblio-sep           → layout.css */



.detail-notes-box:focus-within {
  border-color: var(--accent-blue);
  box-shadow: 0 0 15px rgba(var(--accent-blue-rgb), 0.20);
}

.notes-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.65rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.notes-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.notes-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.notes-icon svg {
  width: 17px;
  height: 17px;
  color: var(--marker-memo);
}

.notes-header h4 {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-main);
  letter-spacing: -0.2px;
}

.notes-saved-badge {
  font-size: 0.72rem;
  color: var(--accent-green);
  background: var(--accent-green-soft);
  border: 1px solid var(--accent-green-border);
  padding: 0.1rem 0.45rem;
  border-radius: var(--radius-chip);
  font-weight: 600;
}

.notes-header-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.btn-notes-action {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.22rem 0.65rem;
  border-radius: var(--radius-control-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-tertiary);
  color: var(--text-main);
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.btn-notes-action svg {
  display: inline-block;
  vertical-align: middle;
}

.btn-notes-action:hover {
  filter: brightness(1.15);
  border-color: var(--text-dim);
}

.btn-notes-save {
  background: var(--accent-gradient);
  color: #fff;
  border-color: transparent;
}

.btn-notes-cancel {
  background: transparent;
  color: var(--text-dim);
}

/* [v0.8.84 · P1/P2] notes-rendered 는 '받는 면'(inset)이다.
   · dashed → solid: 상세 페이지에 dashed 가 4곳 있어 화면 전체가 '여기 뭔가
     넣으세요' 표시를 4번 반복한 노트처럼 보였다. 함몰면 + solid 1px 로
     충분히 '받는 곳'임이 전달된다.
   · hover 시 --bg-tertiary 로 면이 바뀌던 것을 없앴다. inset(파인 곳)이
     hover 에서 raised(떠오른 카드) 색이 되어 계층을 뛰어넘었기 때문이다.
     hover 는 테두리 색만 올린다 — 면은 계층을 유지한다. */
.notes-rendered {
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: 0.95rem;
  line-height: 1.75;
  min-height: 60px;
  box-sizing: border-box;
  padding: 0.75rem 1.1rem;
  background: var(--surface-inset);
  backdrop-filter: blur(var(--blur-surface));
  -webkit-backdrop-filter: blur(var(--blur-surface));
  border-radius: var(--radius-paper-md);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: border-color var(--transition-fast);
}

/* [v0.9.11 · FIX] #notesRendered 는 class="notes-rendered markdown-body" 이다.
   .markdown-body(0.88rem/1.65)가 뒤에 선언되어 .notes-rendered(0.95rem/1.75)를
   덮어쓰고 있었다. 그 결과 '보기 모드 본문'이 '편집 textarea'(0.95rem/1.75)보다
   작게 보여, 같은 메모인데 모드를 오갈 때 글자 크기가 튀었다.
   두 클래스가 함께 붙은 경우에는 편집 입력과 동일한 타이포그래피로 고정한다. */
.notes-rendered.markdown-body,
.notes-rendered .notes-md-content {
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: 0.95rem;
  line-height: 1.75;
}

.notes-rendered:hover {
  border-color: var(--accent-purple-border);
}

/* 플레이스홀더 힌트도 실제 입력 글자와 같은 크기/행간을 쓴다.
   종전 0.85rem/1.6 은 본문(0.95rem/1.75)보다 작아 '다른 글꼴'처럼 보였다.
   구분은 크기가 아니라 색(--text-dim)과 이탤릭으로만 준다. */
.notes-empty-hint {
  color: var(--text-dim);
  font-style: italic;
  font-size: 0.95rem;
  margin: 0;
  line-height: 1.75;
}

.notes-editor-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* [v0.8.84 · P1] 편집 textarea 도 보기 모드(.notes-rendered)와 같은 '받는 면'.
   종전에는 보기가 --bg-primary, 편집이 --bg-tertiary 로 달라서 모드를
   전환할 때마다 면의 밝기가 튀었다. 같은 계층 토큰을 쓰면 전환이 매끄럽다. */
.notes-textarea {
  width: 100%;
  background: var(--surface-inset);
  backdrop-filter: blur(var(--blur-surface));
  -webkit-backdrop-filter: blur(var(--blur-surface));
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-control-sm);
  padding: 0.75rem 1rem;
  color: var(--text-main);
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: 0.95rem;
  line-height: 1.75;
  resize: vertical;
  min-height: 110px;
}

.notes-textarea:focus {
  outline: none;
}

.notes-editor-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ==========================================================================
   [v0.9.10] Memo Edit Mode Accent Frame (Top & Bottom Accent Blue)
   토글 버튼을 굳이 보지 않아도 입력창 상단과 하단의 안쪽 테두리/그림자 효과로
   현재 편집 모드(Edit)임을 즉각 직관적으로 인지할 수 있는 Paperdana 악센트 프레임
   (원칙: 보라색 엄금, accent-blue 단일 색상으로 상단과 하단에만 배치)
   ========================================================================== */
.reader-notes-editor,
.notes-textarea,
.col-modal-notes-editor {
  /* 상단과 하단에만 깔끔한 accent-blue 안쪽 하이라이트 */
  box-shadow:
    inset 0 2px 0 0 rgba(var(--accent-blue-rgb), 0.70),
    inset 0 -2px 0 0 rgba(var(--accent-blue-rgb), 0.45),
    inset 0 6px 14px -3px rgba(var(--accent-blue-rgb), 0.12),
    inset 0 -6px 14px -3px rgba(var(--accent-blue-rgb), 0.10);
  transition: box-shadow var(--motion-subtle, 0.2s ease), border-color var(--motion-subtle, 0.2s ease);
}

.reader-notes-editor:focus,
.notes-textarea:focus,
.col-modal-notes-editor:focus {
  outline: none;
  border-color: rgba(var(--accent-blue-rgb), 0.65) !important;
  /* 포커스 활성 상태: 상단과 하단 라인 및 앰비언트 글로우 강화 */
  box-shadow:
    inset 0 2.5px 0 0 var(--accent-blue),
    inset 0 -2.5px 0 0 rgba(var(--accent-blue-rgb), 0.70),
    inset 0 8px 18px -3px rgba(var(--accent-blue-rgb), 0.20),
    inset 0 -8px 18px -3px rgba(var(--accent-blue-rgb), 0.16);
}

.notes-hint {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.notes-hint code {
  background: rgba(255, 255, 255, 0.08);
  padding: 0.1rem 0.3rem;
  border-radius: var(--radius-paper-xs);
  color: #c4b5fd;
}

/* Markdown Rendering in Notes */
.markdown-body {
  font-size: 0.88rem;
  line-height: 1.65;
  color: var(--text-main);
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3 {
  color: var(--text-bright);
  margin: 0.6rem 0 0.3rem;
  font-weight: 600;
}

.markdown-body h1 {
  font-size: 1.15rem;
}

.markdown-body h2 {
  font-size: 1.05rem;
}

.markdown-body h3 {
  font-size: 0.95rem;
}

.markdown-body p {
  margin-bottom: 0.5rem;
}

.markdown-body p:last-child {
  margin-bottom: 0;
}

.markdown-body ul,
.markdown-body ol {
  padding-left: 1.3rem;
  margin-bottom: 0.5rem;
}

.markdown-body li {
  margin-bottom: 0.25rem;
}

.notes-md-content ul li.md-list-sub-1,
.addon-md ul li.md-list-sub-1 {
  list-style-type: circle;
  margin-left: 1.25rem;
}

.notes-md-content ul li.md-list-sub-2,
.addon-md ul li.md-list-sub-2 {
  list-style-type: square;
  margin-left: 2.5rem;
}

.notes-md-content ol li.md-list-sub-1,
.addon-md ol li.md-list-sub-1 {
  list-style-type: lower-alpha;
  margin-left: 1.25rem;
}

.notes-md-content ol li.md-list-sub-2,
.addon-md ol li.md-list-sub-2 {
  list-style-type: lower-roman;
  margin-left: 2.5rem;
}

.notes-md-content li.task-list-item.md-list-sub-1,
.addon-md li.task-list-item.md-list-sub-1 {
  list-style: none;
  margin-left: 0.15rem;
}

.notes-md-content li.task-list-item.md-list-sub-2,
.addon-md li.task-list-item.md-list-sub-2 {
  list-style: none;
  margin-left: 1.4rem;
}

.markdown-body strong,
.notes-rendered strong,
.reader-notes-preview strong,
.notes-md-content strong {
  color: var(--text-bright);
  font-weight: 600;
}

.markdown-body em,
.notes-rendered em,
.reader-notes-preview em {
  color: var(--text-main);
  font-style: italic;
}

.markdown-body strong em,
.notes-rendered strong em,
.reader-notes-preview strong em,
.notes-md-content strong em,
.addon-md strong em {
  color: var(--text-bright);
}

.markdown-body mark.md-highlight,
.notes-rendered mark.md-highlight,
.reader-notes-preview mark.md-highlight,
.notes-md-content mark.md-highlight,
.addon-md mark.md-highlight,
.shortcut-desc mark.md-highlight {
  background: color-mix(in srgb, var(--marker-star) 26%, transparent);
  color: var(--text-bright);
  padding: 0.05em 0.25em;
  border-radius: var(--radius-paper-xs);
}

.markdown-body u,
.notes-rendered u,
.reader-notes-preview u,
.notes-md-content u,
.addon-md u,
.shortcut-desc u {
  text-decoration: underline;
  text-underline-offset: 0.16em;
  text-decoration-thickness: 1.5px;
}

.markdown-body sup,
.notes-rendered sup,
.reader-notes-preview sup,
.notes-md-content sup,
.addon-md sup,
.shortcut-desc sup {
  font-size: 0.72em;
  line-height: 0;
  vertical-align: super;
}

.markdown-body blockquote {
  border-left: 3.5px solid var(--primary-color, var(--accent-blue));
  padding-left: 0.75rem;
  margin: 0.5rem 0;
  color: var(--text-muted);
}

.markdown-body code {
  background: rgba(var(--accent-blue-rgb), 0.12);
  padding: 0.15rem 0.35rem;
  border-radius: var(--radius-paper-xs);
  font-size: 0.82rem;
  color: var(--accent-blue);
}

.markdown-body pre {
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  padding: 0.75rem;
  border-radius: var(--radius-paper-md);
  overflow-x: auto;
  margin: 0.5rem 0;
}

.markdown-body pre code {
  background: transparent;
  padding: 0;
  color: var(--text-main);
}

.markdown-body a {
  color: var(--accent-blue);
  text-decoration: underline;
}

.notes-md-content .notes-table-wrap,
.addon-md .notes-table-wrap {
  overflow-x: auto;
  margin: 0.55rem 0;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-paper-md);
  background: var(--surface-inset);
}

.notes-md-content table.notes-table,
.addon-md table.notes-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86em;
  line-height: 1.5;
}

.notes-md-content table.notes-table th,
.notes-md-content table.notes-table td,
.addon-md table.notes-table th,
.addon-md table.notes-table td {
  padding: 0.42rem 0.65rem;
  border-bottom: 1px solid var(--border-subtle);
  border-right: 1px solid var(--border-subtle);
  text-align: left;
  vertical-align: top;
}

.notes-md-content table.notes-table th,
.addon-md table.notes-table th {
  background: var(--surface-control);
  color: var(--text-bright);
  font-weight: 600;
}

.notes-md-content table.notes-table td,
.addon-md table.notes-table td {
  color: var(--text-main);
}

.notes-md-content table.notes-table tbody tr:nth-child(even),
.addon-md table.notes-table tbody tr:nth-child(even) {
  background: var(--surface-inset);
}

.notes-md-content table.notes-table th:last-child,
.notes-md-content table.notes-table td:last-child,
.addon-md table.notes-table th:last-child,
.addon-md table.notes-table td:last-child {
  border-right: none;
}

.notes-md-content table.notes-table tbody tr:last-child td,
.addon-md table.notes-table tbody tr:last-child td {
  border-bottom: none;
}

.notes-md-content table.notes-table th.align-left,
.notes-md-content table.notes-table td.align-left,
.addon-md table.notes-table th.align-left,
.addon-md table.notes-table td.align-left {
  text-align: left;
}

.notes-md-content table.notes-table th.align-center,
.notes-md-content table.notes-table td.align-center,
.addon-md table.notes-table th.align-center,
.addon-md table.notes-table td.align-center {
  text-align: center;
}

.notes-md-content table.notes-table th.align-right,
.notes-md-content table.notes-table td.align-right,
.addon-md table.notes-table th.align-right,
.addon-md table.notes-table td.align-right {
  text-align: right;
}

/* ==========================================================================
   Smart Rename & Edit Modals
   ========================================================================== */
.rename-modal-dialog {
  width: 100%;
  max-width: 620px;
  padding: 2rem;
}

.edit-meta-modal-dialog {
  width: min(660px, 95vw);
  max-width: 660px;
  height: 610px;
  max-height: 95vh;
  padding: 0 !important;
  display: flex;
  flex-direction: column;
  overflow: hidden !important;
  border-radius: var(--radius-modal);
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.28), 0 0 0 1px rgba(255, 255, 255, 0.06);
  position: relative !important;
}

.edit-meta-modal-dialog .modal-header {
  margin: 0 2rem;
  padding: 1.4rem 0 1.05rem 0;
  border-bottom: 1px solid var(--border-subtle);
  background: transparent !important;
  flex-shrink: 0;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 2.2rem;
  box-sizing: border-box;
}

.edit-meta-header-compact {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 2.2rem;
}

.edit-meta-header-title-wrap {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.edit-meta-header-title-wrap h3 {
  font-size: 1.18rem;
  margin: 0;
  color: var(--text-bright);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.edit-meta-header-title-wrap h3 i,
.edit-meta-header-title-wrap h3 svg {
  color: var(--text-bright);
  flex-shrink: 0;
}

.edit-meta-header-compact .edit-meta-lookup-wrap,
.edit-meta-header-compact .bulk-meta-desc-wrap {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.bulk-meta-desc-wrap .modal-desc {
  margin: 0;
  font-size: 0.81rem;
  line-height: 1.35;
  color: var(--text-muted);
  text-align: right;
  width: 100%;
}

.edit-meta-lookup-wrap .auto-lookup-input {
  flex: 1 1 auto;
  min-width: 0;
  height: 34px !important;
  font-size: 0.82rem !important;
  padding: 0.35rem 0.65rem !important;
  border-radius: var(--radius-control-sm) !important;
  box-sizing: border-box;
}

.edit-meta-lookup-wrap .btn {
  height: 34px !important;
  padding: 0 0.85rem !important;
  font-size: 0.81rem !important;
  font-weight: 600;
  border-radius: var(--radius-control-sm) !important;
  white-space: nowrap;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  box-sizing: border-box;
}

.edit-meta-close-btn {
  position: static !important;
  flex-shrink: 0;
  margin-left: 0.15rem;
}

.edit-meta-header-controls-row {
  display: flex;
  gap: 0.75rem;
  align-items: stretch;
  width: 100%;
}

.edit-meta-header-controls-row .doi-fetch-box {
  flex: 1 1 0;
  min-width: 0;
}

.edit-meta-body {
  padding: 1.15rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  flex: 1;
  overflow-y: auto;
  max-height: none;
}

.edit-meta-body.edit-meta-grid-8col {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  column-gap: 0.75rem;
  row-gap: 0.65rem;
  align-items: start;
}

.edit-meta-grid-8col .span-1 { grid-column: span 1; }
.edit-meta-grid-8col .span-2 { grid-column: span 2; }
.edit-meta-grid-8col .span-3 { grid-column: span 3; }
.edit-meta-grid-8col .span-4 { grid-column: span 4; }
.edit-meta-grid-8col .span-8 { grid-column: span 8; }

/* 600px 이하 모바일/협소 화면: 8열 -> 4열 반응형 전환
   (1~4열 좌측 핵심 필드가 상단에 모두 모이고, 5~8열 우측 필드가 그 전체 아래로 깔끔하게 떨어짐) */
@media (max-width: 600px) {
  .edit-meta-body.edit-meta-grid-8col {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }
  .edit-meta-grid-8col .edit-col-left {
    order: 1 !important;
  }
  .edit-meta-grid-8col .edit-col-right {
    order: 2 !important;
  }
  .edit-meta-grid-8col .span-4 {
    grid-column: span 4 !important;
  }
  .edit-meta-grid-8col .span-8 {
    grid-column: span 4 !important;
  }
  .edit-meta-modal-dialog {
    height: auto !important;
    max-height: 94vh !important;
  }
  .edit-meta-modal-dialog .modal-header {
    margin: 0 1.2rem !important;
    gap: 1rem !important;
    flex-wrap: wrap !important;
  }
  .edit-meta-body {
    padding: 1rem 1.2rem !important;
  }
  .edit-meta-modal-dialog .modal-footer {
    margin: 0 1.2rem !important;
    padding: 0.75rem 0 1rem 0 !important;
    display: flex !important;
    flex-wrap: wrap !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 0.65rem 0.6rem !important;
  }
  .edit-meta-modal-dialog .modal-footer .modal-footer-actions {
    display: contents !important;
  }
  .edit-meta-modal-dialog .modal-footer .bulk-label-with-checkbox {
    order: 1 !important;
    width: 100% !important;
    margin: 0 !important;
    padding-bottom: 0.55rem !important;
    border-bottom: 1px dashed var(--border-subtle) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    font-size: 0.79rem !important;
  }
  .edit-meta-modal-dialog .modal-footer .modal-footer-left {
    order: 2 !important;
    width: auto !important;
    margin-right: auto !important;
  }
  .edit-meta-modal-dialog .modal-footer .modal-footer-actions .btn {
    order: 3 !important;
  }
}

.edit-meta-modal-dialog .modal-footer {
  margin: 0 2rem;
  padding: 0.8rem 0 1.1rem 0;
  border-top: 1px solid var(--border-subtle);
  background: transparent !important;
  flex-shrink: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  box-sizing: border-box;
}

.edit-meta-footer .modal-footer-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  flex-wrap: wrap;
}

.edit-meta-footer .bulk-label-with-checkbox {
  font-size: 0.82rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--text-muted);
  margin: 0;
  margin-right: 0.5rem;
  user-select: none;
  white-space: nowrap;
}

.edit-meta-footer .modal-footer-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
}

.doi-fetch-box {
  background: linear-gradient(135deg, rgba(var(--accent-secondary-rgb, var(--accent-purple-rgb)), 0.12) 0%, rgba(var(--accent-blue-rgb), 0.16) 100%);
  border: 1px solid rgba(var(--accent-blue-rgb), 0.35);
  border-radius: var(--radius-paper-md);
  padding: 0.55rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.32rem;
  box-shadow: 0 2px 10px rgba(var(--accent-blue-rgb), 0.08);
}

.doi-fetch-box.auto-lookup-box-inline {
  padding: 0.35rem 0.55rem;
  gap: 0;
}

.auto-lookup-lead-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-bright);
  padding: 0 0.35rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.auto-lookup-lead-label [data-lucide],
.auto-lookup-lead-label svg {
  color: var(--accent-blue);
  flex-shrink: 0;
}

.auto-lookup-input {
  height: 34px !important;
  font-size: 0.82rem !important;
  padding: 0.35rem 0.65rem !important;
  border-radius: var(--radius-control-sm) !important;
  flex: 1 1 auto;
  min-width: 0;
  box-sizing: border-box;
}

.auto-lookup-box-inline .auto-lookup-input-group .btn {
  height: 34px !important;
  padding: 0 0.85rem !important;
  font-size: 0.81rem !important;
  box-sizing: border-box;
}

.doi-fetch-box label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-bright);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.doi-fetch-box label svg {
  color: var(--accent-blue);
  flex-shrink: 0;
}

.auto-lookup-input-group {
  display: flex;
  gap: 0.45rem;
  align-items: stretch;
}

.auto-lookup-textarea {
  resize: none;
  min-height: 38px;
  height: 38px;
  font-size: 0.82rem;
  line-height: 1.35;
  padding: 0.45rem 0.65rem;
  font-family: var(--font-sans);
  flex: 1;
  border-radius: var(--radius-control-sm);
}

.auto-lookup-input-group .btn {
  height: 38px;
  padding: 0 0.95rem;
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-control-sm);
  background: var(--accent-gradient);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 2px 8px rgba(var(--accent-blue-rgb), 0.28);
  cursor: pointer;
  transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease, transform 0.18s ease;
}

.auto-lookup-input-group .btn:hover {
  opacity: 0.92;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(var(--accent-blue-rgb), 0.38);
}

.auto-lookup-box .form-hint {
  font-size: 0.72rem;
  color: var(--text-dim);
  line-height: 1.3;
  margin: 0;
}

.edit-meta-body .form-group {
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
}

.edit-meta-body .form-group label {
  font-size: 0.81rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0;
}

.edit-meta-body .form-input {
  height: 34px;
  padding: 0.35rem 0.65rem;
  font-size: 0.85rem;
  border-radius: var(--radius-control-sm);
  box-sizing: border-box;
}

.edit-meta-body select.form-input {
  height: 34px;
  box-sizing: border-box;
}

.edit-meta-body select.form-input.is-empty,
.edit-meta-body select.form-input:has(option[value=""]:checked) {
  color: var(--text-main);
}

.edit-meta-body select.form-input option {
  color: var(--text-bright);
}

.edit-meta-body select.form-input option[value=""] {
  color: var(--text-main);
}

/* 특정 보조/부가 입력창에 차분한 --surface-control 배경 적용 (글 제목, 글쓴이, 연도, 학술지, 권, 호, 발행처는 primary 유지) */
.edit-meta-body #editSubtitleInput,
.edit-meta-body #editMonthInput,
.edit-meta-body .form-group:not(.is-book-adapted) #editIsbnInput,
.edit-meta-body #editPagesInput,
.edit-meta-body #editIssnInput,
.edit-meta-body #editDocTypeSelect,
.edit-meta-body #editLanguageSelect,
.edit-meta-body #editDoiInput,
.edit-meta-body #editKeywordsInput,
.edit-meta-body #editUrlInput,
.edit-meta-body #editAbstractInput,
.edit-meta-body #bulkMetaSubtitle,
.edit-meta-body #bulkMetaMonth,
.edit-meta-body .form-group:not(.is-book-adapted) #bulkMetaIsbn,
.edit-meta-body #bulkMetaPages,
.edit-meta-body #bulkMetaIssn,
.edit-meta-body #bulkMetaDocType,
.edit-meta-body #bulkMetaLanguage,
.edit-meta-body #bulkMetaDoi,
.edit-meta-body #bulkMetaKeywords,
.edit-meta-body #bulkMetaUrl,
.edit-meta-body #bulkMetaAbstract {
  background: var(--surface-control);
}

/* 단행본 / 단행본 내 논문 문맥 전환 시 변경된 항목 라벨만 프라이머리 블루로 담백하게 표시 */
.edit-meta-body .form-group.is-book-adapted > label {
  color: var(--accent-blue);
}

@keyframes editMetaBookFieldFlash {
  0% {
    box-shadow: 0 0 0 2px rgba(var(--accent-blue-rgb), 0.22);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(var(--accent-blue-rgb), 0);
  }
}

.edit-meta-body .form-group.is-book-changed-flash .form-input {
  animation: editMetaBookFieldFlash 0.85s ease-out;
}


.edit-meta-body .form-textarea {
  padding: 0.4rem 0.65rem;
  font-size: 0.84rem;
  border-radius: var(--radius-control-sm);
}

.edit-meta-body #editUrlInput,
.edit-meta-body #editAbstractInput,
.edit-meta-body #bulkMetaUrl,
.edit-meta-body #bulkMetaAbstract {
  height: 68px;
  min-height: 68px;
  max-height: 68px;
  resize: none;
  overflow-y: auto;
  line-height: 1.45;
  box-sizing: border-box;
}

.edit-meta-body .form-hint {
  font-size: 0.73rem;
  color: var(--text-dim);
  line-height: 1.3;
  margin-top: 0.1rem;
}

.edit-meta-body .form-row-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.edit-meta-body .form-row-2-1-1,
.form-row-2-1-1 {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 0.75rem;
}

.edit-meta-body .form-row-2-2,
.form-row-2-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.edit-meta-body .form-row-1-1-2,
.form-row-1-1-2 {
  display: grid;
  grid-template-columns: 1fr 1fr 2fr;
  gap: 0.75rem;
}

.edit-meta-body .form-row-1-3,
.form-row-1-3 {
  display: grid;
  grid-template-columns: 1fr 3fr;
  gap: 0.75rem;
}

.edit-meta-body .form-row-1-1,
.form-row-1-1 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

@media (max-width: 640px) {
  .edit-meta-header-controls-row {
    flex-direction: column;
  }

  .edit-meta-body .form-row-2-1-1,
  .form-row-2-1-1,
  .edit-meta-body .form-row-1-1-2,
  .form-row-1-1-2,
  .edit-meta-body .form-row-1-3,
  .form-row-1-3,
  .edit-meta-body .form-row-1-1,
  .form-row-1-1 {
    grid-template-columns: 1fr;
  }
}

.edit-meta-footer {
  display: flex;
  justify-content: space-between !important;
  align-items: center;
}

.modal-footer-actions {
  display: flex;
  gap: 0.75rem;
}

.btn-reset-meta {
  color: var(--accent-red) !important;
  border-color: rgba(239, 68, 68, 0.3) !important;
  background: transparent;
  transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease, transform 0.18s ease;
  display: inline-flex;
  align-items: center;
}

.btn-reset-meta:hover {
  background: rgba(239, 68, 68, 0.1) !important;
  border-color: var(--accent-red) !important;
}

.form-section-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 0.35rem;
  margin-top: 0.4rem;
}

.form-row-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
}

.form-row-3col {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.8rem;
}

.form-hint {
  font-size: 0.72rem;
  color: var(--text-dim);
  line-height: 1.4;
}

.required {
  color: var(--accent-red);
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
  line-height: 1.5;
  font-family: var(--font-sans);
}

.modal-header {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1.5rem;
  padding-right: 2.2rem;
}

.modal-header-icon {
  font-size: 2rem;
  line-height: 1;
}

.modal-header h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-bright);
}

.modal-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.rename-body {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.current-file-box {
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-paper-md);
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.current-file-box .label {
  color: var(--text-dim);
}

.current-file-box .current-name {
  color: var(--accent-red);
  word-break: break-all;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-group label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* [v0.8.93] 라벨과 안내 힌트를 한 줄에 놓는다.
   종전에는 힌트가 입력칸 아래에 따로 붙어 폼이 세로로 길어졌다.
   짧은 필드(저자·권 등)는 라벨 오른쪽으로 힌트를 올려 한 줄을 아낀다. */
.form-label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}

.form-label-row .form-hint {
  text-align: right;
  white-space: nowrap;
}

.format-chips {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.format-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.9rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-chip);
  font-size: 0.82rem;
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
}

.format-chip:hover {
  background: var(--bg-tertiary);
  border-color: var(--accent-blue);
}

.format-chip.active {
  border-color: var(--accent-blue);
  background: var(--accent-blue-soft);
}

.format-chip .chip-name {
  color: var(--author-color);
  font-weight: 600;
}

.format-chip .chip-val {
  color: var(--text-muted);
  font-size: 0.78rem;
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.form-input,
.form-control {
  width: 100%;
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-control-md);
  padding: 0.7rem 0.9rem;
  color: var(--text-bright);
  font-size: 0.88rem;
  outline: none;
  transition: var(--transition);
}

.form-input:focus,
.form-control:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(var(--accent-blue-rgb), 0.22);
}

.field-hint {
  font-size: 0.74rem;
  color: var(--text-dim);
}

.rename-preview-box {
  background: var(--bg-surface-elevated, rgba(56, 189, 248, 0.05));
  border: 1px solid var(--border-subtle, rgba(56, 189, 248, 0.3));
  border-radius: var(--radius-paper-md);
  padding: 0.85rem 1rem;
}

.preview-label {
  font-size: 0.76rem;
  color: var(--primary, #2563eb);
  font-weight: 600;
  display: block;
  margin-bottom: 0.35rem;
}

.preview-result {
  color: var(--text-bright, var(--text-base));
  font-size: 0.88rem;
  font-weight: 600;
  word-break: break-all;
  background: var(--bg-surface-hover, rgba(0, 0, 0, 0.04));
  padding: 0.4rem 0.65rem;
  border-radius: var(--radius-paper-sm);
  border: 1px solid var(--border-subtle);
  display: inline-block;
  max-width: 100%;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.8rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
}

.modal-footer .btn,
.modal-actions-footer .btn,
.library-modal-footer .btn,
.welcome-footer .btn {
  height: 38px;
  min-height: 38px;
  padding: 0 1.25rem;
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: var(--radius-control-md);
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* ==========================================================================
   Full PDF Reader Modal (Edge-to-Edge Fullscreen, Floating FAB & Split Notes Pane)
   ========================================================================== */
.reader-backdrop {
  padding: 0 !important;
  background: rgba(0, 0, 0, 0.94) !important;
  backdrop-filter: blur(var(--blur-surface));
}

.reader-container {
  /* [v0.8.94] 100vh 는 주소창이 숨겨진 상태(large viewport) 기준이다.
     모달이 열려 body 스크롤이 잠기면 주소창이 다시 보여 실제 가시 영역이
     그만큼 줄어드는데, 100vh 를 그대로 쓰면 중앙 정렬(backdrop 의
     align-items:center) 때문에 위아래가 동시에 잘린다.
     → JS 가 측정한 --app-vh 로 실제 가시 높이를 따른다.
       (--app-vh 미설정 시 1vh 로 폴백하므로 기존 동작과 같다) */
  width: 100vw !important;
  height: calc(var(--app-vh, 1vh) * 100 - var(--titlebar-h, 0px)) !important;
  max-width: 100vw !important;
  max-height: calc(var(--app-vh, 1vh) * 100 - var(--titlebar-h, 0px)) !important;
  border-radius: 0 !important;
  border: none !important;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  background: var(--bg-primary);
}

.reader-workspace {
  display: flex;
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
}

.reader-pdf-pane {
  flex: 1;
  min-width: 300px;
  height: 100%;
  /* [v0.8.96] iframe 문서의 배경을 투명화했으므로(pdfjs_theme.css 6-b)
     이 면이 PDF 바깥 배경의 실제 공급원이 된다. iframe 이 스스로 칠하던
     --body-bg-color 와 값이 같은 --bg-primary 로 맞춘다.
     (--bg-secondary 는 한 단계 어두워 색이 바뀐다)

     [서브테마 배경 일치] 서가 배경(body, base.css)은 --bg-primary 단색 위에
     radial-gradient 두 겹을 얹은 면이다. 여기서 단색만 칠하면 서브테마에 따라
     서가와 미묘하게 어긋난다.
       · solarized : glow 0.10/0.08 + 바탕 #002b36 -> glow 가 바탕에 묻혀 티가 안 남
       · obsidian / dana : glow 0.04~0.05 + 바탕이 거의 순수 검정
         -> 검정 위 옅은 유색 glow 가 또렷해져 리더 단색과 불일치가 드러난다
     따라서 body 와 **같은 두 그라디언트**를 동일 각도·정지점으로 공급한다.
     --radial-gradient-1/2 는 html 에 정의되어 상속되므로 테마별 값이 그대로 온다. */
  background-color: var(--bg-primary);
  background-image:
    radial-gradient(circle at 15% 10%, var(--radial-gradient-1) 0%, transparent 40%),
    radial-gradient(circle at 85% 60%, var(--radial-gradient-2) 0%, transparent 45%);
  background-attachment: fixed;
  position: relative;
  /* ::before 의 mix-blend-mode 가 이 면의 바탕색에만 섞이도록 격리한다.
     격리하지 않으면 상위(모달·백드롭)까지 블렌드 대상에 끌어들인다. */
  isolation: isolate;
}

.reader-pdf-pane iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
  /* 질감 레이어(:before, z-index 0) 위에 iframe 을 올린다 */
  position: relative;
  z-index: 1;
}

/* [v0.8.96] PDF 리더 배경 질감 — 종이(페이지)가 아니라 그 바깥 여백.
   전역 body::before 와 동일한 패턴이며, iframe 이 투명해져 이 레이어가
   그대로 비쳐 보인다. .reader-notes-pane 은 텍스트 편집 면이므로 제외.
   여백은 "배경" 표면이므로 설정의 [배경] 토글을 따른다. */
[data-texture]:not([data-texture="none"]):not([data-texture-bg="off"]) .reader-pdf-pane::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: var(--bg-texture-image);
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
  opacity: calc(var(--bg-texture-opacity) * var(--bg-texture-strength));
  mix-blend-mode: var(--bg-texture-blend);
  transition: opacity 0.25s ease;
}

@media (forced-colors: active) {
  [data-texture]:not([data-texture="none"]):not([data-texture-bg="off"]) .reader-pdf-pane::before {
    display: none;
  }
}

/* Split Divider: 슬림한 2px 경계선 (호버 시 강조) */
.reader-split-divider {
  width: 2px;
  background: var(--border-subtle);
  cursor: col-resize;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, width 0.15s ease;
  user-select: none;
  z-index: 40;
  position: relative;
}

/* 마우스 잡기 쉬운 터치/클릭 확장 영역 (8px 투명 여백) */
.reader-split-divider::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: -4px;
  right: -4px;
  z-index: 1;
}

.reader-split-divider:hover,
.reader-split-divider.dragging {
  background: var(--accent-blue);
}

.divider-handle {
  display: none;
}

/* Notes Pane
   최소 너비 380px (v0.10.1): 맨 위 띠에 '간단 메모 · 컬렉션 메모 · 주석' 탭과 창 제어 3버튼이
   겹치지 않고 들어가는 폭. pdf_viewer.js 의 끌어 줄이기 하한(READER_NOTES_MIN_WIDTH)과 같아야 한다. */
.reader-notes-pane {
  width: 30%;
  min-width: 380px;
  max-width: 65vw;
  height: 100%;
  background: var(--bg-card);
  border-left: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  z-index: 35;
  box-shadow: -6px 0 25px rgba(0, 0, 0, 0.22);
  animation: slideInRight 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-reader-notes-drawer-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  border-radius: var(--radius-control-sm);
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s ease, color 0.15s ease;
}

.btn-reader-notes-drawer-close:hover {
  background: var(--nav-hover-bg);
  color: var(--text-bright);
}

@media (max-width: 768px) {
  .reader-pdf-pane {
    min-width: 0;
    width: 100%;
    height: 100%;
    flex: 1;
  }

  .reader-split-divider {
    display: none !important;
  }

  .reader-notes-pane {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(380px, 88vw) !important;
    min-width: 0;
    max-width: 100%;
    height: 100%;
    max-height: none;
    border-left: 1px solid var(--border-subtle);
    border-top: none;
    z-index: 1260;
    box-shadow: -8px 0 28px rgba(0, 0, 0, 0.32);
  }
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
  }

  to {
    transform: translateX(0);
  }
}

.reader-notes-tab-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 0 0.5rem 0 0.65rem;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-subtle);
  height: var(--reader-topbar-height, 34px);
  box-sizing: border-box;
}

.reader-tab-left {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  flex: 1;
}

.btn-reader-notes-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  height: 25px;
  padding: 0 0.6rem;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-dim);
  background: transparent;
  border: none;
  outline: none;
  border-radius: var(--radius-chip);  /* v0.10.4: 설정 탭처럼 반원 */
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease, transform 0.15s ease;
  user-select: none;
  white-space: nowrap;
}

.btn-reader-notes-tab:hover:not(.is-disabled):not(.active) {
  color: var(--text-bright);
  background: var(--nav-hover-bg);
}

.btn-reader-notes-tab.active {
  color: #fff;
  background: var(--accent-gradient);
  font-weight: 600;
  box-shadow: 0 0 8px rgba(var(--accent-blue-rgb), 0.38);
}

.btn-reader-notes-tab.active svg,
.btn-reader-notes-tab.active i {
  color: #fff;
  stroke: #fff;
}

.btn-reader-notes-tab.is-disabled {
  opacity: 0.42;
  cursor: not-allowed;
  color: var(--text-dim);
}

.btn-reader-notes-tab .tab-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reader-tab-collection-container {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

.reader-tab-col-select {
  height: 34px;
  padding: 0 0.55rem;
  font-family: inherit;
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--text-bright);
  background: var(--bg-tertiary);
  border: none;
  border-radius: var(--radius-control-md);
  cursor: pointer;
  outline: none;
  min-width: 0;
  flex: 0 1 auto;
  max-width: 100%;
  min-width: 0;
  flex: 0 1 auto;
  box-sizing: border-box;
  transition: background-color 0.15s ease;
}

.reader-tab-col-select:hover,
.reader-tab-col-select:focus {
  color: var(--text-bright);
  border-color: var(--accent-blue);
}

.reader-notes-header {
  height: 54px;
  min-height: 54px;
  max-height: 54px;
  padding: 0 0.85rem;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  box-sizing: border-box;
}

.notes-header-left {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text-bright);
  min-width: 0;
  flex: 1;
}

.notes-header-icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.notes-header-meta-stack {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.notes-header-line1 {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  line-height: 1.25;
}

.notes-header-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-bright);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.notes-header-line2 {
  font-size: 0.73rem;
  font-weight: 400;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.notes-header-left svg,
.notes-header-icon {
  color: var(--marker-memo);
  stroke: var(--marker-memo);
  flex-shrink: 0;
}

.notes-header-left .col-mode-icon,
.notes-header-left svg.col-mode-icon {
  color: var(--accent-blue) !important;
  stroke: var(--accent-blue) !important;
}

.notes-header-left .col-mode-icon.is-unassigned,
.notes-header-left svg.col-mode-icon.is-unassigned {
  color: var(--text-dim) !important;
  stroke: var(--text-dim) !important;
}

.reader-col-membership-badge {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 6px;
  border-radius: var(--radius-chip);
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: -0.01em;
}

.reader-col-membership-badge.is-assigned {
  color: var(--accent-blue);
  background: color-mix(in srgb, var(--accent-blue) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent-blue) 28%, transparent);
}

.reader-col-membership-badge.is-unassigned {
  color: var(--text-dim);
  background: var(--bg-hover);
  border: 1px solid var(--border-subtle);
}

.notes-header-right {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

#readerNotesHeader .notes-mode-segmented-control {
  height: 34px;
  padding: 3px;
  gap: 3px;
  border: none;
  border-radius: var(--radius-control-md);
  box-sizing: border-box;
}

#readerNotesHeader .btn-notes-mode {
  width: 30px;
  height: 26px;
  border-radius: var(--radius-control-sm);
}

/* [v0.8.84 · P1] 세그먼트는 '누르는 면'(control)이다.
   종전에는 홈이 --bg-primary 인데 활성 버튼이 --bg-secondary 라서,
   파인 홈 안에 더 떠 있는 버튼이 들어간 모양이었다(의미상 반대).
   이제 홈=control, 활성 버튼=raised 로 '홈 위로 올라온 손잡이'가 된다. */
/* [v0.8.92] 편집/보기 토글 세그먼트: 이중 캡슐(chip 중첩)을 탈피하고 슬림한 26px 규격으로 단일화 */
.notes-mode-segmented-control {
  display: inline-flex;
  align-items: center;
  background: var(--surface-control);
  border: none;
  border-radius: var(--radius-control-sm, 6px);
  padding: 2px;
  gap: 2px;
}

.btn-notes-mode {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 22px;
  padding: 0;
  color: var(--text-dim);
  background: transparent;
  border: none;
  outline: none;
  border-radius: var(--radius-control-sm);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease, transform 0.15s ease;
  user-select: none;
}

.btn-notes-mode:hover {
  color: var(--text-bright);
  background: rgba(255, 255, 255, 0.08);
}

[data-theme="light"] .btn-notes-mode:hover {
  background: rgba(0, 0, 0, 0.06);
}

.btn-notes-mode.active {
  color: #fff;
  background: var(--accent-gradient);
  box-shadow: 0 0 8px rgba(var(--accent-blue-rgb), 0.38);
}

.btn-notes-mode svg,
.btn-notes-mode i {
  stroke: currentColor;
  flex-shrink: 0;
}

/* [v0.8.104] 단축키 안내 팝업 헤더 탭: .btn-notes-mode 24px 고정폭 오버플로 해소 */
#shortcutsModalTabs .btn-notes-mode {
  width: auto;
  padding: 0 0.65rem;
  gap: 0.35rem;
  font-size: 0.8rem;
  /* [v0.8.104] 굵기 선언 제거 → 부모 상속(400).
     v0.8.104 에서 이 두 버튼을 아이콘 전용 24px 토글에서 '텍스트 탭'으로
     승격할 때 굵기 500 을 함께 넣었다. 그런데 500 은
     typography_system_guide.md §3 이 금지한 중간값이며
     (금지: 500·900·100·200) 셋 중 어느 계층에도 속하지 않는다.
     판정 트리 ⑤ '어느 쪽도 아니면 굵기를 지정하지 않는다(400 상속)'에 따라
     선언 자체를 지운다. 굵기를 고르는 대신 '고르지 않음'으로 되돌리는 쪽이
     규정 문언에 가장 충실하고, 남는 값 하나를 새로 만들지도 않는다.
     ※ .btn-notes-mode 기본 규칙에도 굵기 선언이 없으므로
       실제 계산값은 모달 본문에서 상속된 400 이 된다.
     ※ 다른 탭 컨트롤(.btn-settings-tab 600 / .edit-meta-tab-btn 600)과
       굵기가 달라 보인다면, 그때는 이 자리에 600 을 명시하는 것이
       다음 수순이다(먼저 400 을 눈으로 확인한 뒤 판단).
     ※ 주의: 이 주석에 '굵기 + 콜론 + 숫자' 형태의 문자열을 쓰면
       scripts/check_font_weights.py 의 정규식이 주석을 선언으로 오인한다.
       (실제로 1차 시도에서 이 주석 때문에 FAIL 이 났다.) */
}

.notes-header-divider {
  width: 1px;
  height: 16px;
  background: var(--border-subtle);
  margin: 0 0.15rem;
  flex-shrink: 0;
}

.reader-notes-body {
  flex: 1;
  padding: 0;
  overflow: hidden;
  display: flex;
  position: relative;
  background: var(--bg-primary);
}

.reader-notes-editor {
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 0;
  background: var(--bg-primary);
  color: var(--text-normal);
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: 0.95rem;
  line-height: 1.75;
  padding: 1rem 1.15rem;
  resize: none;
  box-sizing: border-box;
  outline: none;
}

.reader-notes-editor:focus {
  outline: none;
}

.reader-notes-preview {
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 0;
  background: var(--bg-primary);
  color: var(--text-normal);
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: 0.95rem;
  line-height: 1.75;
  padding: 1rem 1.15rem;
  overflow-y: auto;
  box-sizing: border-box;
  word-break: break-word;
  cursor: text;
}

.reader-notes-preview blockquote,
.notes-rendered blockquote,
.notes-md-content blockquote {
  margin: 0.55rem 0;
  padding: 0.45rem 0.8rem;
  border-left: 3.5px solid var(--primary-color, var(--accent-blue));
  background: rgba(var(--accent-blue-rgb), 0.08);
  border-radius: 0 var(--radius-paper-sm) var(--radius-paper-sm) 0;
  color: var(--text-bright);
  font-size: 0.9rem;
  line-height: 1.55;
}

.reader-notes-preview p,
.notes-rendered p,
.notes-md-content p {
  margin: 0 0 0.55rem 0;
}

.reader-notes-preview p:last-child,
.notes-rendered p:last-child,
.notes-md-content p:last-child {
  margin-bottom: 0;
}

.reader-notes-preview h1, .notes-rendered h1, .notes-md-content h1,
.reader-notes-preview h2, .notes-rendered h2, .notes-md-content h2,
.reader-notes-preview h3, .notes-rendered h3, .notes-md-content h3,
.reader-notes-preview h4, .notes-rendered h4, .notes-md-content h4,
.reader-notes-preview h5, .notes-rendered h5, .notes-md-content h5,
.reader-notes-preview h6, .notes-rendered h6, .notes-md-content h6 {
  margin: 0.7rem 0 0.35rem 0;
  font-weight: 600;
  color: var(--text-bright);
  line-height: 1.35;
}

.reader-notes-preview h1:first-child, .notes-rendered h1:first-child, .notes-md-content h1:first-child,
.reader-notes-preview h2:first-child, .notes-rendered h2:first-child, .notes-md-content h2:first-child,
.reader-notes-preview h3:first-child, .notes-rendered h3:first-child, .notes-md-content h3:first-child {
  margin-top: 0;
}

.reader-notes-preview h1, .notes-rendered h1, .notes-md-content h1 { font-size: 1.25rem; }
.reader-notes-preview h2, .notes-rendered h2, .notes-md-content h2 { font-size: 1.1rem; }
.reader-notes-preview h3, .notes-rendered h3, .notes-md-content h3 { font-size: 0.98rem; }
.reader-notes-preview h4, .notes-rendered h4, .notes-md-content h4 { font-size: 0.92rem; }
.reader-notes-preview h5, .notes-rendered h5, .notes-md-content h5 { font-size: 0.88rem; }
.reader-notes-preview h6, .notes-rendered h6, .notes-md-content h6 { font-size: 0.84rem; color: var(--text-muted); }

.reader-notes-preview ul, .notes-rendered ul, .notes-md-content ul,
.reader-notes-preview ol, .notes-rendered ol, .notes-md-content ol {
  margin: 0.4rem 0 0.55rem 1.25rem;
  padding: 0;
}

.reader-notes-preview li,
.notes-rendered li,
.notes-md-content li {
  margin-bottom: 0.22rem;
  line-height: 1.5;
}

.reader-notes-preview li:last-child,
.notes-rendered li:last-child,
.notes-md-content li:last-child {
  margin-bottom: 0;
}

.reader-notes-preview li.task-list-item,
.notes-rendered li.task-list-item,
.notes-md-content li.task-list-item {
  list-style: none;
  margin-left: -1.1rem;
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
}

.reader-notes-preview li.task-list-item input[type="checkbox"],
.notes-rendered li.task-list-item input[type="checkbox"],
.notes-md-content li.task-list-item input[type="checkbox"] {
  margin: 0;
  vertical-align: middle;
  cursor: default;
  accent-color: var(--accent-blue);
}

.reader-notes-preview hr,
.notes-rendered hr,
.notes-md-content hr {
  border: 0;
  border-top: 1px solid var(--border-subtle);
  margin: 0.75rem 0;
}

.reader-notes-preview del,
.notes-rendered del,
.notes-md-content del {
  color: var(--text-muted);
  text-decoration: line-through;
}

.reader-notes-preview code,
.notes-rendered code,
.notes-md-content code {
  font-size: 0.84rem;
  background: rgba(255, 255, 255, 0.08);
  padding: 0.15rem 0.35rem;
  border-radius: var(--radius-paper-xs);
  color: var(--accent-yellow);
}

.reader-notes-preview pre,
.notes-rendered pre,
.notes-md-content pre {
  background: rgba(0, 0, 0, 0.25);
  padding: 0.65rem;
  border-radius: var(--radius-paper-sm);
  overflow-x: auto;
  margin: 0.5rem 0;
}

.reader-notes-preview pre code,
.notes-rendered pre code,
.notes-md-content pre code {
  background: transparent;
  padding: 0;
  color: inherit;
  font-size: 0.84rem;
}

/* PDF 딥링크 뱃지 스타일 */
.pdf-deep-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.1rem 0.45rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-blue) !important;
  background: rgba(var(--accent-blue-rgb), 0.12);
  border: 1px solid rgba(var(--accent-blue-rgb), 0.35);
  border-radius: var(--radius-paper-sm);
  text-decoration: none !important;
  cursor: pointer;
  transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease, transform 0.18s ease;
  vertical-align: middle;
  user-select: none;
}

.pdf-deep-link:hover {
  background: rgba(var(--accent-blue-rgb), 0.22);
  border-color: var(--accent-blue);
  color: var(--text-bright) !important;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(var(--accent-blue-rgb), 0.2);
}

.pdf-deep-link:active {
  transform: translateY(0);
}

.pdf-deep-link svg,
.pdf-deep-link i {
  stroke: currentColor;
  flex-shrink: 0;
}

.reader-notes-footer {
  padding: 0.65rem 0.95rem;
  min-height: 78px;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.5rem;
  box-sizing: border-box;
}

.notes-footer-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-height: 30px;
}

.notes-footer-action-slots {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex: 1;
  min-width: 0;
}

/* Logical Page Calibrator & Footer Action Buttons */
.reader-page-sync-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.btn-page-sync-display {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  height: 28px;
  padding: 0 0.65rem;
  border-radius: var(--radius-control-sm);
  background: var(--surface-control);
  border: 1px solid var(--border-subtle);
  color: var(--text-bright);
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease, transform 0.15s ease;
  user-select: none;
  outline: none;
}

.btn-page-sync-display:hover {
  background: var(--nav-hover-bg);
  border-color: var(--accent-blue);
}

.btn-page-sync-display svg,
.btn-page-sync-display i {
  color: var(--accent-blue);
  stroke: var(--accent-blue);
  flex-shrink: 0;
}

.page-sync-text {
  font-weight: 600;
  color: var(--text-bright);
}

.page-sync-sub {
  color: var(--text-dim);
  font-size: 0.7rem;
}

.page-sync-gear {
  color: var(--text-muted);
  stroke: var(--text-muted);
  margin-left: 1px;
  transition: transform 0.2s ease;
}

.btn-page-sync-display:hover .page-sync-gear {
  color: var(--text-bright);
  stroke: var(--text-bright);
  transform: rotate(45deg);
}

/* Page Calibration Popover Dialog */
.page-sync-popover {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  min-width: 215px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-control-md);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  padding: 0.65rem 0.8rem;
  z-index: var(--z-popover);
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  box-sizing: border-box;
  animation: fadeInPop 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

.page-sync-popover-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border-subtle);
}

.page-sync-popover-title {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-bright);
}

.btn-page-sync-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: var(--radius-control-sm);
  color: var(--text-dim);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease, transform 0.15s ease;
}

.btn-page-sync-close:hover {
  color: var(--text-bright);
  background: var(--nav-hover-bg);
}

.page-sync-popover-body {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.78rem;
  color: var(--text-main);
}

.page-sync-guide strong {
  color: var(--accent-blue);
}

.page-sync-input-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: auto;
}

.page-sync-input {
  width: 64px;
  height: 26px;
  padding: 0 0.4rem;
  background: var(--surface-control);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-control-sm);
  color: var(--text-bright);
  font-size: 0.84rem;
  font-family: inherit;
  font-weight: 600;
  text-align: right;
  outline: none;
  box-sizing: border-box;
  -moz-appearance: textfield;
  appearance: textfield;
}

.page-sync-input::-webkit-outer-spin-button,
.page-sync-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.page-sync-input:focus {
  border-color: var(--accent-blue);
}

.page-sync-unit {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.page-sync-popover-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.4rem;
  padding-top: 0.35rem;
  border-top: 1px solid var(--border-subtle);
}

.page-sync-btn-reset {
  font-size: 0.72rem;
  padding: 0.2rem 0.5rem;
  height: 24px;
  color: var(--text-dim);
}

.page-sync-btn-apply {
  font-size: 0.72rem;
  padding: 0.2rem 0.65rem;
  height: 24px;
}

/* One-click Page Tag Insert Button */
.btn-notes-footer-action {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  height: 28px;
  padding: 0 0.65rem;
  border-radius: var(--radius-control-sm);
  background: var(--surface-control);
  border: 1px solid var(--border-subtle);
  color: var(--text-bright);
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease, transform 0.15s ease;
  user-select: none;
  outline: none;
}

.btn-notes-footer-action:hover {
  background: var(--nav-hover-bg);
  border-color: var(--accent-blue);
  color: var(--accent-blue);
}

.btn-notes-footer-action svg,
.btn-notes-footer-action i {
  color: var(--accent-blue);
  stroke: var(--accent-blue);
  flex-shrink: 0;
}

.notes-footer-bottom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-height: 22px;
}

.notes-footer-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  flex: 1;
}

.notes-autotag-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-dim);
  cursor: pointer;
  user-select: none;
  transition: color 0.15s ease;
}

.notes-autotag-toggle:hover {
  color: var(--text-bright);
}

.notes-autotag-toggle input[type="checkbox"] {
  width: 13px;
  height: 13px;
  accent-color: var(--accent-blue);
  cursor: pointer;
  margin: 0;
}

.notes-autotag-text {
  font-size: 0.72rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.notes-footer-right {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.notes-saved-status-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

/* FE-04 (261107): '[직전 복구]' 링크 — 인라인 스타일(인디고 폴백 #4f46e5)을 클래스로 옮김.
   조작 요소는 프라이머리 블루 단일색(AGENTS.md 8조). */
.notes-restore-link {
  color: var(--accent-blue);
  text-decoration: underline;
  margin-left: 6px;
  cursor: pointer;
}

.notes-status-indicator {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 6px color-mix(in srgb, var(--accent-cyan) 60%, transparent);
  display: inline-block;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.notes-status-indicator.saving {
  background: var(--accent-yellow, #b58900);
  box-shadow: 0 0 6px rgba(181, 137, 0, 0.7);
  animation: pulseNotesIndicator 1s infinite alternate;
}

.notes-status-indicator.error {
  background: var(--accent-red);
  box-shadow: 0 0 6px rgba(220, 50, 47, 0.7);
}

@keyframes pulseNotesIndicator {
  from { opacity: 0.5; transform: scale(0.85); }
  to { opacity: 1; transform: scale(1.15); }
}

/* [v0.8.98] .reader-notes-saved-status 는 제거했다.
   리더 인디케이터도 상세 페이지와 같은 .notes-saved-status-text 로 일원화해
   문구·서체·색 규칙을 한 곳(아래)에서만 관리한다. */

/* Notes Bottom Footer (Detail View & Collection Notes Modal) */
.notes-bottom-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  /* 노트 편집 영역과 푸터 사이의 여백은 편집기 자체 하단 여백이 이미 준다.
     여기서 또 주면 이중 여백이 되므로 0 으로 둔다. */
  margin-top: 0;
  padding: 0;
  flex-wrap: wrap;
}

.notes-footer-left-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

/* Satellite Export to Attached Document */
.notes-satellite-group {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  z-index: 15;
}

.notes-satellite-group::after {
  content: '';
  position: absolute;
  top: -6px;
  bottom: -6px;
  left: -4px;
  right: -8px;
  pointer-events: none;
}

.notes-satellite-group:hover::after {
  pointer-events: auto;
}

.btn-notes-satellite-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  background: var(--surface-control);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-control-sm, 6px);
  color: var(--text-dim);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease, transform 0.15s ease;
  user-select: none;
  flex-shrink: 0;
}

.btn-notes-satellite-trigger:hover:not(:disabled) {
  color: var(--text-bright);
  background: var(--surface-raised);
  border-color: var(--accent-blue);
}

.btn-notes-satellite-trigger:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-notes-satellite-trigger svg,
.btn-notes-satellite-trigger i {
  stroke: currentColor;
}

.notes-satellite-strip {
  position: absolute;
  left: calc(100% + 4px);
  top: 50%;
  transform: translateY(-50%) translateX(-6px);
  display: inline-flex;
  align-items: center;
  gap: 3px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease 0.03s, transform 0.18s ease 0.03s;
  white-space: nowrap;
  z-index: 20;
}

.notes-satellite-group:hover .notes-satellite-strip,
.notes-satellite-strip:hover {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(-50%) translateX(0);
}

.btn-satellite-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 22px;
  padding: 0 0.45rem;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-dim);
  background: var(--surface-control);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-control-sm, 4px);
  cursor: pointer;
  transition: background-color 0.12s ease, color 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease, opacity 0.12s ease, transform 0.12s ease;
  user-select: none;
}

.btn-satellite-pill:hover:not(:disabled) {
  color: var(--accent-blue);
  background: var(--surface-raised);
  border-color: var(--accent-blue);
  transform: translateY(-1px);
}

.btn-satellite-pill:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.notes-saved-status-text {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-dim);
  white-space: nowrap;
  letter-spacing: -0.01em;
  transition: color 0.2s ease;
}

.notes-saved-status-text.saving {
  color: var(--accent-yellow);
}

.notes-saved-status-text.saved {
  color: var(--marker-check);
}

/* ── Reader Vertical Docking Rail (PDF 영역 우측 플로팅 세로 도킹 바) ────────── */
.reader-dock-rail {
  position: absolute;
  /* 상단바(34px) + 8px = 42px */
  top: calc(var(--reader-topbar-height, 34px) + 8px);
  right: 18px;
  z-index: 1250;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px 4px;
  background: var(--capsule-bg);
  backdrop-filter: blur(var(--blur-surface));
  -webkit-backdrop-filter: blur(var(--blur-surface));
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-control-md);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.16);
  pointer-events: auto;
  opacity: 0.35;
  transition: right 0.2s ease, opacity 0.18s ease;
  height: fit-content;
}

.reader-dock-rail:hover,
.reader-dock-rail:has(:focus-visible) {
  opacity: 1;
}

.reader-dock-rail.is-collapsed > :not(#closeReaderBtn):not(#btnReaderDockCollapse) {
  display: none !important;
}

[data-texture]:not([data-texture="none"]):not([data-texture-floating="off"]) .reader-dock-rail::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  z-index: 0;
  pointer-events: none;
  background-image: var(--bg-texture-image);
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
  opacity: calc(var(--bg-texture-opacity) * var(--bg-texture-strength));
  mix-blend-mode: var(--bg-texture-blend);
}

.reader-dock-rail > * {
  position: relative;
  z-index: 1;
}

.btn-reader-dock-action {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-control-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease, transform 0.18s ease;
  text-decoration: none;
  padding: 0;
  outline: none;
  position: relative;
  flex-shrink: 0;
}

.btn-reader-dock-action:hover {
  color: var(--text-bright);
  background: var(--surface-hover);
}

.btn-reader-dock-action:active {
  transform: scale(0.95);
}

.btn-reader-dock-action.active {
  color: var(--accent-blue);
  background: color-mix(in srgb, var(--accent-blue) 14%, transparent);
}

.btn-reader-dock-action.btn-reader-close:hover {
  color: var(--danger-color, #dc322f);
  background: color-mix(in srgb, var(--danger-color, #dc322f) 12%, transparent);
}

.reader-dock-divider {
  width: 20px;
  height: 0;
  border-top: 1px solid var(--border-subtle);
  margin: 3px 0;
  flex-shrink: 0;
  box-sizing: content-box;
  transform: translateZ(0);
}

.reader-addon-toolbar-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.btn-reader-dock-action .addon-icon-mask {
  display: inline-block;
  background-color: currentColor;
}

.icon-reader-notepad {
  color: var(--marker-memo);
}

/* PDF Reader Addon Extension Points (RFC-2026-ADDON-002) */
.reader-addon-overlay-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 10;
  overflow: hidden;
}

.reader-addon-overlay-item {
  position: absolute;
  pointer-events: auto;
  z-index: 11;
  transition: opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1), transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.reader-addon-overlay-item.pos-bottom-right {
  bottom: 24px;
  right: 24px;
}

.reader-addon-overlay-item.pos-bottom-left {
  bottom: 24px;
  left: 24px;
}

.reader-addon-overlay-item.pos-top-left {
  top: 24px;
  left: 24px;
}

.reader-addon-overlay-item.pos-top-right {
  top: 64px;
  right: 70px;
}

.reader-addon-overlay-item.is-hidden {
  display: none !important;
}

.reader-addon-overlay-item.is-collapsed {
  opacity: 0.45;
  transform: scale(0.95);
}

.reader-addon-overlay-item.is-collapsed:hover {
  opacity: 0.95;
  transform: scale(1);
}

/* Bookshelf Addon Overlay Extension Point */
.bookshelf-addon-overlay-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 40;
  overflow: hidden;
}

.bookshelf-addon-overlay-item {
  position: fixed;
  pointer-events: auto;
  z-index: 41;
  transition: opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1), transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.bookshelf-addon-overlay-item.pos-bottom-right {
  bottom: 24px;
  right: 24px;
}

.bookshelf-addon-overlay-item.pos-bottom-left {
  bottom: 24px;
  left: 24px;
}

.bookshelf-addon-overlay-item.pos-top-left {
  top: 24px;
  left: 24px;
}

.bookshelf-addon-overlay-item.pos-top-right {
  top: 64px;
  right: 70px;
}

.bookshelf-addon-overlay-item.is-hidden {
  display: none !important;
}

.bookshelf-addon-overlay-item.is-collapsed {
  opacity: 0.45;
  transform: scale(0.95);
}

.bookshelf-addon-overlay-item.is-collapsed:hover {
  opacity: 0.95;
  transform: scale(1);
}

/* Slim Card (Hide Thumbnails) Grid Layout: Respect S / M / L Size Settings (포스터 카드와 규격 및 간격 100% 일치) */
.paper-grid:not(.view-layout-list):not(.view-layout-sheet).hide-thumbnails {
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 2rem;
}

.paper-grid:not(.view-layout-list):not(.view-layout-sheet).hide-thumbnails.grid-size-small {
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)) !important;
  gap: 2rem !important;
}

.paper-grid:not(.view-layout-list):not(.view-layout-sheet).hide-thumbnails.grid-size-medium {
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)) !important;
  gap: 2rem !important;
}

.paper-grid:not(.view-layout-list):not(.view-layout-sheet).hide-thumbnails.grid-size-large {
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)) !important;
  gap: 2rem !important;
}

.paper-grid:not(.view-layout-list):not(.view-layout-sheet).hide-thumbnails.grid-size-xlarge {
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)) !important;
  gap: 2rem !important;
}

/* ==========================================================================
   Modal Styling: Unified 3-Tier Dialog Standard
   [Header (Fixed)] - [Body (Scrollable)] - [Footer (Fixed)]
   ========================================================================== */
.collection-modal-dialog,
.paper-colls-modal-dialog,
.unsaved-modal-dialog,
.reader-unsaved-dialog,
.system-confirm-dialog,
.rename-modal-dialog,
.library-modal-dialog,
.welcome-modal-card,
.convert-notes-modal-dialog,
.remote-access-dialog,
.admin-auth-dialog,
.merge-vault-dialog {
  width: 92%;
  max-height: 88vh;
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: var(--radius-modal);
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.28), 0 0 0 1px rgba(255, 255, 255, 0.06);
  position: relative;
}

.collection-modal-dialog {
  width: min(780px, 94vw);
  max-width: 780px;
}

.paper-colls-modal-dialog {
  max-width: 500px;
}

.unsaved-modal-dialog,
.reader-unsaved-dialog,
.system-confirm-dialog,
.convert-notes-modal-dialog,
.admin-auth-dialog {
  max-width: 480px;
}

.rename-modal-dialog {
  width: 92%;
  max-width: 680px;
  max-height: 88vh;
}

.library-modal-dialog,
.remote-access-dialog,
.merge-vault-dialog {
  max-width: 540px;
}

/* 1. Header (Fixed at top) */
.collection-modal-dialog .modal-header,
.paper-colls-modal-dialog .modal-header,
.unsaved-modal-dialog .modal-header,
.system-confirm-dialog .modal-header,
.rename-modal-dialog .modal-header,
.library-modal-header,
.welcome-header,
.convert-notes-modal-dialog .modal-header,
.remote-access-dialog .modal-header,
.admin-auth-dialog .modal-header,
.merge-vault-dialog .modal-header {
  margin: 0 2.4rem;
  padding: 1.6rem 0 1.1rem 0;
  border-bottom: 1px solid var(--border-subtle);
  background: transparent;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.welcome-header {
  text-align: center;
  flex-direction: column;
  justify-content: center;
}

.collection-modal-dialog .modal-header h3,
.paper-colls-modal-dialog .modal-header h3,
.unsaved-modal-dialog .modal-header h3,
.system-confirm-dialog .modal-header h3,
.rename-modal-dialog .modal-header h3,
.library-modal-title,
.convert-notes-modal-dialog .modal-header h3,
.remote-access-dialog .modal-header h3,
.admin-auth-dialog .modal-header h3,
.merge-vault-dialog .modal-header h3,
.edit-meta-modal-dialog .modal-header h3 {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-bright);
  margin: 0;
}

/* 2. Body (Scrollable in between) */
.collection-modal-dialog .modal-body,
.paper-colls-modal-dialog .modal-body,
.rename-body,
.library-modal-body,
.welcome-body,
.convert-notes-modal-dialog .modal-body,
.remote-access-dialog .modal-body,
.admin-auth-dialog .modal-body,
.merge-vault-dialog .modal-body {
  padding: 1.4rem 2.4rem;
  flex: 1 1 auto;
  overflow-y: auto;
  max-height: none;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Confirmation & text-based modal body: use standard block layout so inline elements (b, span, br) flow naturally without splitting into flex items */
.unsaved-modal-dialog .modal-body,
.system-confirm-dialog .modal-body {
  padding: 1.25rem 2.2rem;
  flex: 1 1 auto;
  overflow-y: auto;
  max-height: none;
  display: block;
  font-size: 0.94rem;
  color: var(--text-dim);
  line-height: 1.6;
  word-break: break-word;
}

/* Slim elegant scrollbars for modal bodies */
.edit-meta-body::-webkit-scrollbar,
.rename-body::-webkit-scrollbar,
.collection-modal-dialog .modal-body::-webkit-scrollbar,
.paper-colls-modal-dialog .modal-body::-webkit-scrollbar,
.unsaved-modal-dialog .modal-body::-webkit-scrollbar,
.system-confirm-dialog .modal-body::-webkit-scrollbar,
.library-modal-body::-webkit-scrollbar,
.welcome-body::-webkit-scrollbar,
.remote-access-dialog .modal-body::-webkit-scrollbar,
.admin-auth-dialog .modal-body::-webkit-scrollbar,
.merge-vault-dialog .modal-body::-webkit-scrollbar {
  width: 5px;
}

.edit-meta-body::-webkit-scrollbar-thumb,
.rename-body::-webkit-scrollbar-thumb,
.collection-modal-dialog .modal-body::-webkit-scrollbar-thumb,
.paper-colls-modal-dialog .modal-body::-webkit-scrollbar-thumb,
.unsaved-modal-dialog .modal-body::-webkit-scrollbar-thumb,
.system-confirm-dialog .modal-body::-webkit-scrollbar-thumb,
.library-modal-body::-webkit-scrollbar-thumb,
.welcome-body::-webkit-scrollbar-thumb,
.remote-access-dialog .modal-body::-webkit-scrollbar-thumb,
.admin-auth-dialog .modal-body::-webkit-scrollbar-thumb,
.merge-vault-dialog .modal-body::-webkit-scrollbar-thumb {
  background: var(--border-subtle);
  border-radius: var(--radius-chip);
}

.paper-colls-modal-dialog .modal-subtitle {
  font-size: 0.88rem;
  color: var(--text-dim);
  margin-bottom: 0.2rem;
  line-height: 1.4;
}

/* 3. Footer (Fixed at bottom) */
.collection-modal-dialog .modal-actions-footer,
.paper-colls-modal-dialog .modal-actions-footer,
.unsaved-modal-dialog .modal-footer,
.system-confirm-dialog .modal-actions-footer,
.system-confirm-dialog .modal-footer,
.rename-modal-dialog .modal-footer,
.library-modal-footer,
.convert-notes-modal-dialog .modal-footer,
.remote-access-dialog .modal-actions-footer,
.admin-auth-dialog .modal-actions-footer,
.merge-vault-dialog .modal-footer {
  margin: 0 2.4rem;
  padding: 1.25rem 0 1.6rem 0;
  border-top: 1px solid var(--border-subtle);
  background: transparent;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* 공용 확인 창(openSystemConfirmModal)은 호출부마다 버튼 문구 길이가 달라진다.
   38px 고정 높이 버튼 안에서 글자가 줄바꿈되며 넘치지 않도록, 글자는 한 줄로 두고
   폭이 모자라면 버튼 단위로 다음 줄로 넘긴다. */
.system-confirm-dialog .modal-actions-footer {
  flex-wrap: wrap;
}

.system-confirm-dialog .modal-actions-footer .btn {
  white-space: nowrap;
}

.reader-unsaved-dialog .modal-footer {
  justify-content: space-between;
  box-sizing: border-box;
}

/* Brand Accent Gradient Button */
.btn-brand-gradient {
  background: var(--accent-gradient);
  color: #fff;
  border: 1px solid transparent;
  box-shadow: 0 2px 10px rgba(var(--accent-blue-rgb), 0.35);
  font-weight: 600;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
}

.btn-brand-gradient:hover {
  filter: brightness(1.12) !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 14px rgba(var(--accent-blue-rgb), 0.45) !important;
}

.btn-brand-gradient:active {
  transform: translateY(0) !important;
  filter: brightness(0.98) !important;
}

.collection-modal-dialog .form-group {
  margin-bottom: 1.35rem;
}

.collection-modal-dialog .form-group:last-of-type {
  margin-bottom: 1.8rem;
}

.collection-modal-dialog label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-bright);
  margin-bottom: 0.55rem;
  letter-spacing: -0.01em;
}

/* Polished Form Controls */
.collection-modal-dialog .form-control {
  width: 100%;
  padding: 0.72rem 1rem;
  font-size: 0.92rem;
  font-family: inherit;
  color: var(--text-bright);
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-modal);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.15);
  transition: background-color 0.2s cubic-bezier(0.16, 1, 0.3, 1), color 0.2s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

[data-theme="light"] .collection-modal-dialog .form-control {
  background: var(--bg-primary);
  border-color: var(--border-subtle);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

.collection-modal-dialog .form-control:focus {
  outline: none;
  background: var(--bg-tertiary);
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(var(--accent-blue-rgb), 0.22), inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .collection-modal-dialog .form-control:focus {
  background: var(--input-bg);
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(var(--accent-blue-rgb), 0.2);
}

/* Custom Select Dropdown Styling */
.collection-modal-dialog select.form-control {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  padding-right: 2.6rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 16px;
}

.collection-modal-dialog select.form-control option {
  background: var(--bg-secondary);
  color: var(--text-bright);
  padding: 0.5rem;
}

/* Description Textarea */
.collection-modal-dialog textarea.form-control {
  min-height: 80px;
  resize: vertical;
  line-height: 1.55;
}

.collection-modal-dialog .form-hint {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-top: 0.45rem;
  display: block;
  line-height: 1.4;
}

/* Icon Presets: 4 Horizontal Groups with 2-Column (2x4) Subgrids */
.col-icon-palette-wrap {
  display: flex;
  align-items: stretch;
  width: 100%;
  margin-top: 0.45rem;
  box-sizing: border-box;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-paper-md);
  padding: 0.45rem;
  gap: 0;
}

.col-icon-subgrid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(4, 38px);
  gap: 6px;
  padding: 0.25rem 0.65rem;
  background: transparent;
  border: none;
  border-radius: 0;
  box-sizing: border-box;
}

.col-icon-subgrid:not(:last-child) {
  border-right: 1px solid var(--border-subtle);
}

.col-icon-subgrid .btn-icon-preset {
  width: 100%;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-control-sm);
  color: var(--text-dim);
  cursor: pointer;
  transition: background-color 0.16s ease, color 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, opacity 0.16s ease, transform 0.16s ease;
  padding: 0;
}

.col-icon-subgrid .btn-icon-preset:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--accent-blue);
  color: var(--text-bright);
}

.col-icon-subgrid .btn-icon-preset.active {
  background: rgba(var(--accent-blue-rgb), 0.22);
  border-color: var(--accent-blue);
  color: var(--accent-blue);
  box-shadow: 0 0 0 1px var(--accent-blue), 0 2px 6px rgba(var(--accent-blue-rgb), 0.3);
}

[data-theme="light"] .col-icon-palette-wrap {
  background: rgba(0, 0, 0, 0.03);
}

[data-theme="light"] .col-icon-subgrid {
  background: transparent;
}

[data-theme="light"] .col-icon-subgrid .btn-icon-preset {
  background: var(--bg-primary);
}

[data-theme="light"] .col-icon-subgrid .btn-icon-preset:hover {
  background: rgba(var(--accent-blue-rgb), 0.1);
}

#colDescInput {
  height: 38px;
  min-height: 38px;
  max-height: 38px;
  resize: none;
  overflow-y: hidden;
  line-height: 1.4;
  padding: 0.5rem 0.75rem;
  box-sizing: border-box;
}

.icon-preset-group {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.55rem;
  margin-top: 0.45rem;
  padding: 0.75rem;
  background: rgba(0, 0, 0, 0.16);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-paper-md);
  box-sizing: border-box;
}

[data-theme="light"] .icon-preset-group {
  background: rgba(0, 0, 0, 0.04);
}

.btn-icon-preset {
  width: 100%;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-control-sm);
  color: var(--text-muted);
  cursor: pointer;
  transition: background-color 0.18s cubic-bezier(0.16, 1, 0.3, 1), color 0.18s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.18s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.18s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.18s cubic-bezier(0.16, 1, 0.3, 1), transform 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 0;
}

.btn-icon-preset svg {
  width: 19px;
  height: 19px;
  stroke: currentColor;
  transition: transform 0.18s ease;
}

.btn-icon-preset:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--accent-blue);
  color: var(--text-bright);
  transform: translateY(-2px);
}

[data-theme="light"] .btn-icon-preset:hover {
  background: rgba(101, 123, 131, 0.1);
}

.btn-icon-preset.active {
  background: var(--accent-blue-soft);
  border-color: var(--accent-blue);
  color: var(--accent-blue-light);
  box-shadow: 0 0 0 2px rgba(var(--accent-blue-rgb), 0.45), 0 4px 10px rgba(var(--accent-blue-rgb), 0.25);
  transform: scale(1.05);
}

[data-theme="light"] .btn-icon-preset.active {
  background: var(--accent-blue-soft);
  color: var(--accent-blue);
  box-shadow: 0 0 0 2px rgba(var(--accent-blue-rgb), 0.4), 0 4px 10px rgba(var(--accent-blue-rgb), 0.15);
}

/* Modal Actions Footer: Right-Aligned Cancel & Save */
.collection-modal-dialog .modal-actions-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.8rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-subtle);
}

.collection-modal-dialog .modal-actions-footer .btn-danger {
  margin-right: auto;
  padding: 0.65rem 1.15rem;
}

.collection-modal-dialog .modal-actions-footer .btn-secondary,
.collection-modal-dialog .modal-actions-footer .btn-primary {
  padding: 0.65rem 1.35rem;
  font-weight: 600;
  font-size: 0.9rem;
}

/* Header Trigger Button */
.btn-col-notes-header-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin-left: 0.45rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-control-sm);
  color: var(--text-dim);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease, transform 0.15s ease;
  vertical-align: middle;
}

.btn-col-notes-header-trigger:hover {
  color: var(--marker-memo);
  border-color: var(--marker-memo);
  background: rgba(255, 255, 255, 0.06);
}

/* Collection Notes Modal (Step 2) - Standard 3-tier Dialog */
.col-notes-modal-dialog {
  width: min(840px, 94vw);
  max-width: 840px;
  max-height: 90vh;
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: var(--radius-modal);
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.28), 0 0 0 1px rgba(255, 255, 255, 0.06);
  position: relative;
}

.col-notes-modal-dialog .col-notes-modal-header {
  margin: 0 2rem;
  padding: 1.3rem 0 1rem 0;
  border-bottom: 1px solid var(--border-subtle);
  background: transparent !important;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.col-notes-header-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.col-notes-modal-main-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0;
  color: var(--text-bright);
  letter-spacing: -0.01em;
}

.col-notes-target-badge-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-chip);
  padding: 0.22rem 0.75rem 0.22rem 0.4rem;
  width: fit-content;
  max-width: 100%;
}

.col-notes-header-icon-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(139, 92, 246, 0.15);
  color: var(--accent-purple);
  flex-shrink: 0;
}

.col-notes-target-name {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 320px;
}

.col-notes-target-desc {
  font-size: 0.78rem;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 300px;
}

.col-notes-target-desc:empty {
  display: none;
}

.col-notes-target-desc::before {
  content: "•";
  margin-right: 0.35rem;
  opacity: 0.6;
}

.col-notes-modal-body {
  padding: 1.2rem 2rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 1.15rem;
}

.col-notes-modal-footer {
  margin: 0 2rem;
  padding: 0.9rem 0 1.25rem 0;
  border-top: 1px solid var(--border-subtle);
  background: transparent !important;
  flex-shrink: 0;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.75rem;
}

.col-notes-section,
.col-attachments-section {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-paper-md);
  padding: 0.9rem 1rem;
}

.col-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.col-section-header-left {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text-bright);
}

.col-section-header-left svg {
  color: var(--marker-memo);
}

.col-section-header-right {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.col-modal-notes-editor {
  width: 100%;
  min-height: 180px;
  max-height: 380px;
  resize: vertical;
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-paper-sm);
  color: var(--text-primary);
  padding: 0.75rem;
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: 0.95rem;
  line-height: 1.75;
  outline: none;
  box-sizing: border-box;
}

.col-modal-notes-editor:focus {
  outline: none;
}

.col-modal-notes-preview {
  min-height: 180px;
  max-height: 380px;
  overflow-y: auto;
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-paper-sm);
  padding: 0.75rem;
  box-sizing: border-box;
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: 0.95rem;
  line-height: 1.75;
}

.col-attachments-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.col-attachments-empty {
  padding: 1.5rem;
  text-align: center;
  color: var(--text-dim);
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-paper-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
}

.col-attachments-empty svg {
  opacity: 0.5;
}

.col-attachment-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-paper-sm);
  gap: 0.75rem;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease, transform 0.15s ease;
}

.col-attachment-card:hover {
  border-color: var(--border-focus);
}

.col-att-info {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
  flex: 1;
}

.col-att-icon {
  flex-shrink: 0;
  color: var(--accent-purple);
}

.col-att-meta {
  min-width: 0;
}

.col-att-name {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-bright);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.col-att-details {
  font-size: 0.72rem;
  color: var(--text-dim);
  display: flex;
  gap: 0.5rem;
}

.col-att-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.btn-att-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: var(--radius-control-sm);
  border: 1px solid var(--border-subtle);
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s, opacity 0.15s, transform 0.15s;
}

.btn-att-action:hover {
  color: var(--text-bright);
  background: rgba(255, 255, 255, 0.08);
}

.btn-att-action.danger:hover {
  color: var(--accent-red);
  border-color: var(--accent-red);
}

.paper-colls-checklist {
  max-height: 280px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 1rem 0;
  padding: 0.5rem;
  background: var(--bg-tertiary);
  border-radius: var(--radius-paper-md);
  border: 1px solid var(--border-subtle);
}

.paper-coll-check-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0.6rem;
  border-radius: var(--radius-paper-sm);
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.88rem;
  color: var(--text-main);
  user-select: none;
}

.paper-coll-check-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.paper-coll-check-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent-blue);
  cursor: pointer;
}

/* ==========================================================================
   User Settings Modal
   ========================================================================== */
.settings-modal-dialog {
  max-width: 620px;
  width: 95%;
  background: var(--modal-bg);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-modal);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.30), 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.modal-header-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.settings-modal-body {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 1.5rem 1.75rem;
  max-height: 75vh;
  overflow-y: auto;
}

.settings-modal-body .settings-section {
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 1.25rem;
}

.settings-modal-body .settings-section:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.settings-section-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.3rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.settings-section-desc {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-bottom: 0.85rem;
  line-height: 1.4;
}

.marker-labels-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.65rem;
}

.marker-label-card {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: var(--bg-tertiary);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-paper-md);
  border: 1px solid var(--border-subtle);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
  box-sizing: border-box;
}

.marker-label-card:focus-within {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 2px rgba(var(--accent-blue-rgb), 0.2);
}

.marker-icon-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.marker-icon-badge svg {
  width: 17px;
  height: 17px;
}

.marker-input-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.marker-default-hint {
  font-size: 0.7rem;
  color: var(--text-dim);
  font-weight: 600;
  line-height: 1;
}

.marker-name-input {
  border: none !important;
  background: transparent !important;
  padding: 0 !important;
  font-size: 0.84rem !important;
  font-weight: 600;
  color: var(--text-main) !important;
  font-family: var(--font-sans);
  outline: none !important;
  box-shadow: none !important;
  width: 100%;
}

.marker-name-input::placeholder {
  color: var(--text-dim) !important;
  opacity: 0.6;
  font-weight: 400;
}

.settings-checkbox-group {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  width: 100%;
}

@media (max-width: 680px) {
  .settings-checkbox-group {
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  }
}

.list-layout-notice {
  display: none;
  align-items: center;
  gap: 0.65rem;
  padding: 0.85rem 1rem;
  margin-top: 0.85rem;
  background: var(--bg-tertiary);
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-paper-md);
  color: var(--text-dim);
  font-size: 0.82rem;
  line-height: 1.4;
}

.list-layout-notice svg {
  flex-shrink: 0;
  color: var(--accent-cyan, #2aa198);
}

.list-only-setting {
  display: none !important;
}

#panelDisplay.is-list-mode .card-only-setting,
#panelDisplay.is-sheet-mode .card-only-setting {
  display: none !important;
}

#panelDisplay.is-list-mode .list-only-setting,
#panelDisplay.is-sheet-mode .list-only-setting {
  display: flex !important;
}

#panelDisplay.is-sheet-mode #rowListWidthSetting,
#panelDisplay.is-list-mode #rowSheetWidthSetting {
  display: none !important;
}

.settings-checkbox-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.65rem 0.75rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-control-md);
  font-size: 0.88rem;
  color: var(--text-main);
  cursor: pointer;
  user-select: none;
  transition: var(--transition);
}

.settings-checkbox-label:hover {
  background: var(--bg-tertiary);
  border-color: var(--border-active);
}

.settings-checkbox-label input[type="checkbox"] {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--accent-blue);
  cursor: pointer;
}

/* 배경 질감 체크박스 — 테마 체크박스 아래에 붙는 2번째 항목.
   인라인 style 억제를 위해 클래스로 분리 (check_frontend.py 상한 관리). */
.settings-checkbox-dual-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  width: 100%;
  margin-top: 0.85rem;
}

@media (max-width: 680px) {
  .settings-checkbox-dual-row {
    grid-template-columns: 1fr;
  }
}

.settings-checkbox-label-left {
  justify-content: flex-start;
  padding: 0.65rem 0.9rem;
}

/* 라벨 + 셀렉트 한 줄 배치 (배경 질감 프리셋 선택). */
.settings-inline-field-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.85rem;
}

.settings-inline-field-label {
  flex: 0 0 auto;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.settings-segment-group {
  display: inline-flex;
  align-items: center;
  gap: 0;
  height: 34px;
  background: var(--surface-control);
  padding: 0;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-control-md);
  box-sizing: border-box;
  overflow: hidden;
  flex-shrink: 0;
}

.btn-segment {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  height: 100%;
  padding: 0 0.5rem;
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap !important;
  background: transparent;
  border: none;
  border-radius: 0;
  color: var(--text-main);
  border-right: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease;
  text-align: center;
  user-select: none;
  box-sizing: border-box;
  box-shadow: none;
}

.btn-segment:last-child {
  border-right: none;
}

.btn-segment:has(+ .btn-segment.active) {
  border-right-color: transparent;
}

.btn-segment:hover:not(.active) {
  color: var(--text-bright);
  background: var(--chip-hover-bg);
}

.btn-segment.active {
  background: var(--accent-blue);
  border-right-color: var(--accent-blue);
  color: #ffffff;
  font-weight: 600;
  box-shadow: none;
}

.settings-select {
  width: 100%;
  max-width: 320px;
  height: 34px;
  box-sizing: border-box;
  padding: 0 2.2rem 0 0.85rem;
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 32px;
  color: var(--text-main);
  background: var(--surface-control);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-control-md);
  cursor: pointer;
  transition: var(--transition);
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2393a1a1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat !important;
  background-position: right 0.85rem center !important;
  background-size: 14px !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.settings-select:hover {
  border-color: var(--border-active);
  background-color: var(--card-hover);
}

.settings-select:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(var(--accent-blue-rgb), 0.22);
}

.settings-select option {
  background: var(--bg-secondary);
  color: var(--text-main);
  padding: 0.5rem;
}

/* ==========================================================================
   Remote Update / Restart Progress Modal Overlay
   ========================================================================== */
.update-progress-backdrop {
  position: fixed !important;
  inset: 0 !important;
  z-index: var(--z-toast) !important;
  background: rgba(0, 0, 0, 0.82) !important;
  backdrop-filter: blur(var(--blur-surface)) !important;
  -webkit-backdrop-filter: blur(var(--blur-surface)) !important;
  display: none;
  align-items: center !important;
  justify-content: center !important;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.update-progress-backdrop.active {
  display: flex !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

.update-progress-layout,
.update-progress-center {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 3.5rem;
  max-width: 680px;
  width: 90%;
  padding: 2.5rem;
  box-sizing: border-box;
  user-select: none;
  animation: fadeInModal 0.25s ease-out;
}

.update-progress-left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  flex: 1;
  min-width: 260px;
}

/* ── 보안 설정 (v0.10.18): 설정 화면과 같은 줄 · 선택 단추 · 짧은 안내 ───────────────── */
.remote-cfg-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.remote-cfg-title svg {
  color: var(--accent-blue);
}

.remote-cfg-body .settings-row-control {
  width: 260px;
  max-width: 60%;
}

/* 인스펙터 사이드바(기본 너비)에서 좌측 라벨('외부 기기 접속', '비밀번호 요구')이 2줄로 꺾이지 않도록 폭 균형 조정 */
#sidebarRightContent .ssp-dialog-slot .remote-cfg-body .settings-row-title {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  white-space: nowrap;
}

#sidebarRightContent .ssp-dialog-slot .remote-cfg-body .settings-row-control {
  width: clamp(168px, 46%, 240px);
  max-width: 48%;
  flex-shrink: 0;
}

/* 라디오는 감추고 감싼 label 이 선택 단추 노릇 (snapshot·저장 로직은 라디오 값을 그대로 읽는다) */
.remote-cfg-radio {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.remote-cfg-segment .btn-segment:has(.remote-cfg-radio:focus-visible) {
  outline: 2px solid var(--accent-blue);
  outline-offset: -2px;
}

.remote-cfg-input-group {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  width: 100%;
}

.remote-cfg-input-group .form-input,
.remote-cfg-hosts {
  width: 100%;
  min-width: 0;
  height: 34px;
}

.remote-cfg-input-group .sys-token-toggle-btn {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  padding: 0;
}

.remote-cfg-feedback {
  display: none;
}

.remote-cfg-feedback.is-ok,
.remote-cfg-feedback.is-warn,
.remote-cfg-feedback.is-error {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.3rem;
  padding: 0 0 0.35rem;
  font-size: var(--font-xs);
}

.remote-cfg-feedback.is-ok {
  color: var(--accent-green);
}

.remote-cfg-feedback.is-warn {
  color: var(--accent-yellow);
}

.remote-cfg-feedback.is-error {
  color: var(--accent-red);
}

/* ── 서재 설정 묶음 일괄 내보내기 · 가져오기 (A5) ───────────────────────── */
.settings-bundle-body {
  gap: 0.75rem;
}

.settings-bundle-sections {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.settings-bundle-card {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.65rem 0.8rem;
  border-radius: var(--radius-control-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-primary);
}

.settings-bundle-card-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  cursor: pointer;
}

.settings-bundle-card-head input[type="checkbox"] {
  accent-color: var(--primary-color);
  flex-shrink: 0;
}

.settings-bundle-option-title {
  font-size: var(--font-sm);
  font-weight: 600;
  color: var(--text-bright);
}

.settings-bundle-sublist {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  padding-left: 1.25rem;
}

.settings-bundle-subrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  font-size: var(--font-xs);
  line-height: 1.35;
}

.settings-bundle-sublabel {
  display: inline-flex;
  align-items: center;
  color: var(--text-dim);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-bundle-sublabel .settings-sub-bullet {
  margin-right: 0.35rem;
}

.settings-bundle-subval {
  color: var(--text-main);
  font-weight: 600;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 56%;
  flex-shrink: 0;
}

.settings-bundle-note {
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-control-sm);
  background: var(--bg-tertiary);
  color: var(--text-dim);
  font-size: var(--font-xs);
  line-height: 1.4;
}

.settings-bundle-file-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-control-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-primary);
}

.settings-bundle-file-meta {
  font-size: var(--font-xs);
  color: var(--text-main);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-bundle-warnings {
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-control-sm);
  border: 1px solid var(--accent-yellow);
  background: color-mix(in srgb, var(--accent-yellow) 10%, transparent);
  color: var(--text-bright);
  font-size: var(--font-xs);
  line-height: 1.4;
}

.settings-bundle-badge {
  margin-left: auto;
  font-size: var(--font-xs);
  color: var(--accent-blue);
  font-weight: 600;
}

.update-brand-wrap {
  margin-bottom: 0.85rem;
  line-height: 1;
}

.update-brand-logo {
  font-family: var(--font-brand) !important;
  font-size: 2.85rem;
  /* [v0.8.91] Paperdana 풀 로고 700 롤백. */
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  display: inline-block;
  min-width: 120px;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  user-select: none;
}

/* 로고 글꼴 '페이퍼다나' (v0.10.17): 낱말 전환은 components.css 묶음, 여기서는 크기만 */
:root[data-brand-wordmark="ko"] .update-brand-logo {
  font-size: 3.1rem;
}

.update-progress-right {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.update-spinner-container {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-blue);
  margin: 0;
  width: 96px;
  height: 96px;
  flex-shrink: 0;
  box-sizing: border-box;
}

.update-spinner-container svg,
.spin-linear-1s {
  animation: spinLinear 1s linear infinite !important;
  transform-origin: 50% 50% !important;
  transform-box: fill-box !important;
  will-change: transform;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform: translateZ(0);
  display: block;
  width: 96px;
  height: 96px;
  pointer-events: none;
}

@keyframes spinLinear {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.update-loading-text {
  font-size: 1.45rem;
  font-weight: 600;
  color: #ffffff;
  letter-spacing: -0.02em;
  margin: 0 0 0.5rem 0;
  text-align: left;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
}

.update-loading-subtext {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.78);
  margin: 0;
  letter-spacing: -0.01em;
  line-height: 1.5;
  text-align: left;
  word-break: keep-all;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.update-version-diff {
  display: inline-flex;
  align-items: baseline;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.update-version-from {
  color: rgba(255, 255, 255, 0.65);
}

.update-version-arrow {
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.9em;
  user-select: none;
}

.update-version-to {
  font-weight: 600;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: none;
  display: inline-block;
}

@media (max-width: 640px) {
  .update-progress-layout,
  .update-progress-center {
    flex-direction: column;
    text-align: center;
    gap: 2rem;
    padding: 1.5rem;
  }

  .update-progress-left {
    align-items: center;
    text-align: center;
    min-width: 0;
  }

  .update-loading-text {
    text-align: center;
  }

  .update-loading-subtext {
    text-align: center;
  }

  .update-version-diff {
    justify-content: center;
  }
}

/* ==========================================================================
   Duplicate PDF Inspection & Modal
   ========================================================================== */
/* 높이는 휴지통 헤더(.trash-list-header)와 동일한 34px 로 고정한다. */
.duplicate-hashes-preview-card {
  padding: 0 0.85rem;
  height: 34px;
  background: var(--surface-control);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-control-md);
  margin-top: 0.45rem !important;
  display: flex;
  align-items: center;
  box-sizing: border-box;
}

.dup-preview-empty,
.dup-preview-results {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
  width: 100%;
}

.dup-summary-text {
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--warning-amber);
}

.dup-clean-text {
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--accent-blue);
}

.duplicate-modal-dialog {
  max-width: 840px !important;
  width: 92% !important;
}

.duplicate-modal-body {
  max-height: 60vh;
  overflow-y: auto;
  padding: 1rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.dup-group-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-paper-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.dup-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.dup-group-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-bright);
}

.dup-hash-code {
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--bg-primary);
  padding: 2px 6px;
  border-radius: var(--radius-paper-sm);
}

.dup-paper-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.85rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-paper-sm);
  gap: 1rem;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease, transform 0.15s ease;
}

.dup-paper-item.is-selected-keep {
  border-color: var(--accent-blue);
  background: rgba(var(--accent-blue-rgb), 0.08);
}

.dup-paper-item.is-marked-trash {
  opacity: 0.65;
  border-style: dashed;
}

.dup-paper-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex: 1;
  min-width: 0;
}

.dup-paper-title {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-bright);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dup-paper-meta {
  font-size: 0.76rem;
  color: var(--text-muted);
  display: flex;
  gap: 0.6rem;
  align-items: center;
  flex-wrap: wrap;
}

.dup-radio-wrap {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
}



.dup-modal-filter-wrap {
  padding: 0.85rem 2rem;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-secondary);
}

.dup-modal-filter-wrap .settings-segment-group {
  max-width: 620px;
}

.dup-group-header-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.dup-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-chip);
}

.dup-type-badge.badge-exact-match {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.dup-type-badge.badge-annot-match {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.dup-type-badge.badge-biblio-match {
  background: rgba(38, 139, 210, 0.15);
  color: var(--accent-blue, #268bd2);
  border: 1px solid rgba(38, 139, 210, 0.3);
}

.dup-paper-title-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.badge-recommended-keep {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: var(--accent-blue-soft);
  color: var(--accent-blue);
  border: 1px solid rgba(var(--accent-blue-rgb), 0.35);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.1rem 0.45rem;
  border-radius: var(--radius-chip);
  white-space: nowrap;
}

.badge-has-annotations {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: rgba(245, 158, 11, 0.12);
  color: #d97706;
  border: 1px solid rgba(245, 158, 11, 0.25);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.1rem 0.45rem;
  border-radius: var(--radius-chip);
  white-space: nowrap;
}

.badge-clean-pdf {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: rgba(6, 182, 212, 0.12);
  color: #0891b2;
  border: 1px solid rgba(6, 182, 212, 0.25);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.1rem 0.45rem;
  border-radius: var(--radius-chip);
  white-space: nowrap;
}

.dup-group-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 0.65rem;
  border-top: 1px dashed var(--border-subtle);
  flex-wrap: wrap;
}

.dup-checkbox-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.78rem;
  color: var(--text-dim);
  cursor: pointer;
  user-select: none;
}

.dup-checkbox-wrap input[type="checkbox"] {
  cursor: pointer;
  accent-color: var(--accent-blue);
}

.dup-pill {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.12rem 0.48rem;
  border-radius: var(--radius-chip);
}

.dup-pill.pill-exact {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
}

.dup-pill.pill-annot {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
}

.dup-pill.pill-biblio {
  background: rgba(38, 139, 210, 0.15);
  color: var(--accent-blue, #268bd2);
}

/* ==========================================================================
   Duplicate Modal Backdrop Override & Shortcuts Help Modal
   ========================================================================== */
#modalDuplicateHashes {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background: rgba(0, 0, 0, 0.75) !important;
  backdrop-filter: blur(var(--blur-surface)) !important;
  -webkit-backdrop-filter: blur(var(--blur-surface)) !important;
  z-index: 3000 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

#modalDuplicateHashes[style*="display: none"],
#modalDuplicateHashes:not(.active) {
  display: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

#modalDuplicateHashes.active {
  display: flex !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

/* Help view guide items are styled in components.css */


/* ==========================================================================
   Bulk Edit Metadata Modal: Matched to edit-meta-modal-dialog standards
   ========================================================================== */
.bulk-label-with-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}

.bulk-label-with-checkbox:hover {
  color: var(--text-bright);
}

.bulk-field-checkbox {
  cursor: pointer;
  accent-color: var(--primary);
  width: 14px;
  height: 14px;
  margin: 0;
  vertical-align: middle;
}

.bulk-edit-input:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  background-color: var(--bg-hover) !important;
}

#bulkEditMetaModal .form-group {
  margin-bottom: 0;
}


.merge-vault-dialog .modal-footer {
  justify-content: space-between;
}


/* ==========================================================================
   Bibliographic Data Management & Export Section (Settings > Data)
   ========================================================================== */
.export-data-card {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  background: transparent;
  padding: 0;
  border: none;
}

.export-scope-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.export-scope-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.export-scope-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-bright);
}

.export-scope-desc {
  font-size: 0.78rem;
  color: var(--text-dim);
}



.export-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 0.25rem 0;
}

.export-options-row {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.65rem 0.85rem;
  background: var(--bg-secondary);
  border-radius: var(--radius-control-sm);
  border: 1px solid var(--border-subtle);
}

.export-option-check-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  user-select: none;
}

.export-option-checkbox {
  width: 15px;
  height: 15px;
  accent-color: var(--accent-blue);
  cursor: pointer;
}

.export-option-label {
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--text-bright);
}

.export-option-desc {
  font-size: 0.76rem;
  color: var(--text-dim);
  padding-left: 1.45rem;
}

.export-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.export-action-box {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 1rem 1.15rem;
  background: var(--surface-control);
  border-radius: var(--radius-control-md);
  border: 1px solid var(--border-subtle);
  box-sizing: border-box;
  transition: border-color var(--transition-fast);
}

.export-action-box:hover {
  border-color: var(--accent-blue);
}

.export-box-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.export-box-title {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-bright);
}

.export-box-desc {
  font-size: 0.78rem;
  color: var(--text-dim);
  line-height: 1.4;
}

.export-btn-grid-4 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
  margin-top: auto;
  padding-top: 0.5rem;
}

.export-btn-single {
  margin-top: auto;
  padding-top: 0.5rem;
}

.export-btn-single .btn,
.export-btn-grid-4 .btn {
  justify-content: center;
  height: 34px;
}

/* ==========================================================================
   External Bibliographic Import & Dry-Run Diff Modal (#modalBiblioImport)
   ========================================================================== */
.biblio-import-modal-dialog {
  max-width: 860px !important;
  width: 92% !important;
}

.biblio-import-filter-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.5rem 0.5rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  gap: 1rem;
  flex-wrap: wrap;
}

.biblio-import-select-all-box {
  display: flex;
  align-items: center;
}

.biblio-select-all-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}

.biblio-select-all-label:hover {
  color: var(--text-bright);
}

.biblio-import-modal-body {
  max-height: 60vh;
  overflow-y: auto;
  padding: 1rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.biblio-import-loading-state,
.biblio-import-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
  gap: 0.75rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  text-align: center;
}

.biblio-import-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.biblio-diff-item {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 0.9rem 1rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-paper-md);
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.biblio-diff-item:hover {
  border-color: var(--border-active);
}

.biblio-diff-item.is-unselected {
  opacity: 0.55;
  background: var(--bg-primary);
}

.biblio-diff-check-wrap {
  display: flex;
  align-items: center;
  padding-top: 0.2rem;
  cursor: pointer;
}

.biblio-diff-check-wrap input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent-blue);
  cursor: pointer;
}

.biblio-diff-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.biblio-diff-header {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.biblio-action-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-chip);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

.badge-diff-new {
  background: rgba(42, 161, 152, 0.18);
  color: var(--accent-cyan);
  border: 1px solid rgba(42, 161, 152, 0.35);
}

.badge-diff-update {
  background: rgba(38, 139, 210, 0.18);
  color: var(--accent-blue);
  border: 1px solid rgba(38, 139, 210, 0.35);
}

.badge-diff-unchanged {
  background: rgba(147, 161, 161, 0.12);
  color: var(--text-dim);
  border: 1px solid rgba(147, 161, 161, 0.25);
}

.badge-diff-error {
  background: rgba(220, 50, 47, 0.18);
  color: var(--accent-red);
  border: 1px solid rgba(220, 50, 47, 0.35);
}

.biblio-diff-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-bright);
  margin: 0;
  line-height: 1.35;
}

.biblio-diff-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.biblio-diff-match-info {
  font-size: 0.74rem;
  color: var(--text-dim);
  background: var(--bg-primary);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-control-sm);
  display: inline-block;
  margin-top: 0.1rem;
}

.biblio-diff-table {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  background: var(--bg-primary);
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius-control-sm);
  border: 1px solid var(--border-subtle);
  margin-top: 0.25rem;
}

.biblio-diff-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.78rem;
  flex-wrap: wrap;
}

.diff-field-name {
  font-weight: 600;
  color: var(--text-muted);
  min-width: 65px;
}

.diff-val-old {
  color: var(--text-dim);
  text-decoration: line-through;
  opacity: 0.8;
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.diff-arrow {
  color: var(--text-dim);
  flex-shrink: 0;
}

.diff-val-new {
  font-weight: 600;
  color: var(--accent-blue);
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.biblio-error-box {
  background: rgba(220, 50, 47, 0.08);
  border: 1px solid rgba(220, 50, 47, 0.25);
  color: var(--accent-red);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-control-sm);
  font-size: 0.8rem;
  line-height: 1.4;
  margin-top: 0.25rem;
}

.biblio-import-modal-footer {
  justify-content: space-between;
}

.biblio-summary-highlight {
  font-weight: 600;
  color: var(--text-bright);
}

.biblio-summary-subtext {
  font-size: 0.76rem;
  color: var(--text-muted);
}

/* ==========================================================================
   리더 '주석' 탭 (261108 PDF 인덱싱 계획 §7.4) — PDF 주석 거울 목록 (읽기 전용)
   메모 본문·편집 토글은 숨기고 같은 자리에 목록을 그린다. 바닥 쪽수 알약은 그대로 둔다.
   ========================================================================== */
.reader-notes-pane.is-annots-tab .reader-notes-editor,
.reader-notes-pane.is-annots-tab .reader-notes-preview,
.reader-notes-pane.is-annots-tab #readerNotesHeader .notes-mode-segmented-control {
  display: none !important;
}

.reader-tab-count {
  font-size: var(--font-2xs);
  font-weight: 600;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}

.reader-tab-count:empty {
  display: none;
}

/* 보기 탭(주석·검색 일치, v0.10.5): 아이콘 + 개수만이라 좌우 여백을 줄인다 */
.btn-reader-notes-tab.is-view-tab {
  padding: 0 0.5rem;
  gap: 0.3rem;
}

.btn-reader-notes-tab[hidden] {
  display: none;
}

/* 리더 '검색 일치' 2층 바 한 줄 검색 (v0.10.6): 제목은 고정, 입력칸이 남는 폭 전부, 개수는 오른쪽 끝 고정 폭 */
.reader-notes-pane.is-hits-view .notes-header-left,
.reader-notes-pane.is-hits-view .notes-header-meta-stack {
  flex: 1;
  min-width: 0;
}

.reader-notes-pane.is-hits-view .notes-header-line1 {
  display: flex;
  align-items: center;
  min-width: 0;
}

.reader-notes-pane.is-hits-view .notes-header-title {
  flex-shrink: 0;
}

.reader-hits-search {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex: 1;
  min-width: 0;
  margin-left: 0.55rem;
}

.reader-hits-search[hidden] {
  display: none;
}

.reader-hits-input-wrap {
  position: relative;
  display: flex;
  flex: 1;
  min-width: 0;
}

.reader-hits-input {
  width: 100%;
  min-width: 0;
  height: 28px;
  padding: 0 1.7rem 0 0.6rem;
  box-sizing: border-box;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-control-sm);
  background: var(--surface-control);
  color: var(--text-main);
  font-size: var(--font-sm);
  font-family: inherit;
}

.reader-hits-input:focus {
  outline: none;
  border-color: var(--accent-blue);
}

.reader-hits-clear {
  position: absolute;
  top: 50%;
  right: 4px;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border: none;
  background: transparent;
  border-radius: var(--radius-chip);
  color: var(--text-dim);
  cursor: pointer;
}

.reader-hits-clear[hidden] {
  display: none;
}

.reader-hits-clear:hover {
  color: var(--text-bright);
  background: var(--bg-hover);
}

.reader-hits-count {
  flex-shrink: 0;
  min-width: 3.2em;
  text-align: right;
  font-size: var(--font-xs);
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}

.reader-hits-count.is-zero {
  opacity: 0.6;
}

/* 리더 '검색 일치' 목록: 인스펙터 스니펫 줄(.ft-hit)을 그대로 쓴다 */
.reader-annots-panel .ra-hits {
  gap: 0.15rem;
}

/* 지금 보고 있는 쪽의 줄 (주석·검색 일치 공통) */
.reader-annots-panel .is-current-page {
  background: var(--bg-hover);
}

.btn-reader-notes-tab.active .reader-tab-count {
  color: #fff;
}

.reader-annots-panel {
  width: 100%;
  height: 100%;
  overflow-y: auto;
  box-sizing: border-box;
  padding: 0.6rem 0.75rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  background: var(--bg-primary);
}

.reader-annots-panel[hidden] {
  display: none;
}

.ra-empty {
  margin: auto;
  padding: 1.5rem 1rem;
  text-align: center;
  font-size: var(--font-sm);
  line-height: 1.6;
  color: var(--text-dim);
}

.ra-page {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.ra-page-head {
  align-self: flex-start;
  display: inline-flex;
  align-items: baseline;
  gap: 0.3rem;
  padding: 0.15rem 0.35rem;
  border: none;
  background: transparent;
  border-radius: var(--radius-control-sm);
  cursor: pointer;
  font-size: var(--font-xs);
  font-weight: 600;
  color: var(--text-bright);
  font-variant-numeric: tabular-nums;
}

.ra-page-head:hover {
  background: var(--bg-hover);
}

.ra-page-phys {
  font-weight: 400;
  color: var(--text-dim);
}

.ra-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  width: 100%;
  padding: 0.35rem 0.4rem;
  border: none;
  background: transparent;
  border-radius: var(--radius-control-sm);
  text-align: left;
  cursor: pointer;
  color: var(--text-main);
  transition: background var(--transition-fast);
}

.ra-item:hover {
  background: var(--bg-hover);
}

.ra-item-textless {
  align-items: center;
  font-size: var(--font-xs);
  color: var(--text-dim);
}

.ra-dot {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  margin-top: 0.4rem;
  border-radius: 50%;
}

.ra-body {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
  word-break: break-word;
}

.ra-quote {
  font-size: var(--font-sm);
  line-height: 1.55;
  color: var(--text-main);
}

.ra-comment {
  font-size: var(--font-xs);
  line-height: 1.5;
  color: var(--text-dim);
  white-space: pre-wrap;
}

/* 상세 화면 '파일 내 주석' 행: 개수 · 보기 링크 · 색인 예외 한 줄 */
#detailFileAnnotations {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem;
}

.detail-annots-link {
  border: none;
  background: transparent;
  padding: 0 0.2rem;
  font-size: inherit;
  color: var(--accent-blue);
  cursor: pointer;
  border-radius: var(--radius-control-sm);
}

.detail-annots-link:hover {
  background: var(--accent-blue-soft);
}

/* 상세 화면 '본문 색인' 카드 (v0.10.1): 색인 안 됨(텍스트 없음·암호·실패)은 흐린 글씨로 */
.detail-index-card[hidden] {
  display: none;
}

/* 상태 글자 강조 (v0.10.2): 정상 파랑 · 주의 호박 · 오류 빨강 · 판정 전/꺼짐 흐림 */
#detailIndexState.is-tone-ok {
  color: var(--accent-color);
}

#detailIndexState.is-tone-caution {
  color: var(--warning-amber);
}

#detailIndexState.is-tone-error {
  color: var(--accent-red);
}

#detailIndexState.is-tone-dim {
  color: var(--text-dim);
}
