/* 노트 전용 본문·오답·편집 도구: index.html에서 선언 순서 그대로 이전. */
  .library-mode-btn.note.active {
    color: #7c3aed;
    border-color: rgba(124,58,237,0.55);
    background: rgba(124,58,237,0.12);
  }
  .note-actions {
    display: flex;
    gap: 6px;
    flex: 0 0 auto;
  }

  .note-summary {
    color: var(--text2);
    font-size: 13px;
    line-height: 1.6;
  }
  .note-keyline {
    border: 1px solid rgba(251,191,36,0.28);
    background: rgba(251,191,36,0.075);
    color: var(--text);
    border-radius: 11px;
    padding: 9px 11px;
    font-size: 13px;
    font-weight: 620;
    line-height: 1.55;
  }
  .note-keyline span {
    display: inline-flex;
    margin-right: 7px;
    color: #d29922;
    font-size: 10px;
    font-weight: 900;
  }
  .note-comparison {
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: 11px;
    padding: 10px 12px;
    color: var(--text2);
    font-size: 12px;
    line-height: 1.65;
    white-space: pre-wrap;
  }
  .note-body-render {
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: 12px;
    padding: 13px 14px;
    color: var(--text2);
    font-size: 13px;
    line-height: 1.7;
    overflow-wrap: anywhere;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .note-body-render h3,
  .note-body-render h4 {
    color: var(--text);
    margin: 10px 0 6px;
    line-height: 1.35;
  }
  .note-body-render p { margin: 6px 0; }
  .note-body-render ul,
  .note-body-render ol {
    margin: 6px 0 8px 20px;
    padding: 0;
  }
  .note-body-render table {
    width: 100%;
    border-collapse: collapse;
    margin: 8px 0;
    font-size: 12px;
  }
  .note-body-render th,
  .note-body-render td {
    border: 1px solid var(--border);
    padding: 7px 8px;
    text-align: left;
    vertical-align: top;
  }
  .note-body-render th {
    color: var(--text);
    background: rgba(88,166,255,0.08);
  }

  /* ── 개념·오답 노트 본문 위계 · 의미색 (에디터 + 카드 렌더 공통) ── */
  .note-body-render h3 {
    font-size: 16px; font-weight: 800; color: var(--text);
    margin: 4px 0 13px; padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
    letter-spacing: -0.01em;
  }
  .note-body-render h4 {
    font-size: 13.5px; font-weight: 800; color: var(--text);
    margin: 17px 0 7px; padding-left: 11px;
    border-left: 3px solid var(--text3);
    line-height: 1.4;
  }
  .note-body-render h4:first-child { margin-top: 2px; }
  .note-body-render p { margin: 6px 0; }
  .note-body-render ul, .note-body-render ol { margin: 6px 0; padding-left: 22px; }
  .note-body-render li { margin: 3px 0; }
  .note-body-render table {
    width: 100%; border-collapse: collapse; margin: 10px 0; font-size: 13px;
  }
  .note-body-render th, .note-body-render td {
    border: 1px solid var(--border); padding: 7px 10px; text-align: left; vertical-align: top;
  }
  .note-body-render th {
    background: var(--surface2); color: var(--text2); font-weight: 700;
  }
  .note-body-render tbody tr:nth-child(even) td {
    background: rgba(127,127,127,0.045);
  }

  .note-wrong-box {
    display: grid;
    gap: 5px;
    border: 1px solid rgba(248,81,73,0.24);
    background: rgba(248,81,73,0.055);
    border-radius: 11px;
    padding: 10px 12px;
    color: var(--text2);
    font-size: 12px;
    line-height: 1.55;
  }

    .note-image-toolbar, .note-callout-toolbar { display:flex; flex-wrap:wrap; align-items:center; gap:8px; margin:6px 0 0; padding:6px 8px; border:1px solid var(--border); border-radius:10px; background:var(--surface2); }
    .note-image-toolbar > *, .note-callout-toolbar > * { min-width:0; }
    /* 이 문구는 장식이 아니라 "지금 이 사진이 어느 단계인가"를 말하는 **유일한 텍스트 상태 표시**다.
       --text3은 다크에서 3.42:1로 미달이었다 — 상태를 말하는 글자는 보조 문구보다 한 단계 위여야 한다. */
    .note-image-toolbar__label, .note-callout-toolbar__label { flex:1 1 180px; color:var(--text2); font-size:12px; }
    .note-image-size, .note-image-align { display:flex; gap:4px; }
    .note-image-size button, .note-image-align button, .note-callout-collapse { min-height:34px; padding:6px 10px; border:1px solid var(--border); border-radius:8px; background:var(--surface); color:var(--text); font-size:12px; cursor:pointer; }
    .note-image-size button[aria-pressed="true"], .note-image-align button[aria-pressed="true"], .note-callout-collapse[aria-pressed="true"] { border-color:var(--accent); font-weight:700; }
    .note-image-field, .note-callout-title-field { display:flex; align-items:center; gap:6px; flex:1 1 200px; font-size:12px; color:var(--text3); }
    .note-image-field input, .note-callout-title-field input { flex:1 1 auto; min-width:0; min-height:34px; padding:4px 8px; border:1px solid var(--border); border-radius:8px; background:var(--surface); color:var(--text); font-size:12px; }
    /* 테마 인지 토큰을 쓴다. raw #ef4444는 라이트에서 3.43:1로 **AA 미달**이었다(2026-07-27 실측).
       형제 트레이 × 버튼이 raw hex인 것을 답습했던 자리 — 토큰이 있으면 토큰이 이긴다. */
    .note-image-del { min-height:34px; padding:6px 10px; border:1px solid var(--red); border-radius:8px; background:transparent; color:var(--red); font-size:12px; cursor:pointer; }
    .note-image-toolbar :disabled, .note-callout-toolbar :disabled { opacity:.5; cursor:default; }
    @media (max-width: 520px) {
      .note-image-toolbar__label, .note-callout-toolbar__label { flex:1 1 100%; }
      /* 설명 입력만 늘린다. 삭제까지 늘리면 375에서 전폭 CTA가 되어 **파괴적 버튼이 툴바의
         시각적 1순위**가 됐다(실측 289px). 크기 세그먼트와 같은 줄에 남겨 위계를 되돌린다. */
      .note-image-field, .note-callout-title-field { flex-grow:1; flex-basis:100%; }
      .note-image-size { flex-grow:0; }
      .note-image-del { flex-grow:0; }
    }
    .note-image-empty { color:var(--text2); font-size:12px; padding:6px 0; }
    .note-gallery { display:grid; grid-template-columns:repeat(auto-fill,minmax(120px,1fr)); gap:8px; margin:10px 0; }
    .note-gallery img { width:100%; border-radius:10px; display:block; cursor:zoom-in; }

/* 오답노트(notes) 도메인 CSS — index.html <style>에서 규칙 텍스트 그대로 옮겼다(2026-10-18 ②-2 도메인 완료 기준 1).
   오답노트만 그리는 선택자(features/notes/** 밖에서 쓰지 않는 클래스) 전부. 공용 선택자와 한 목록이던 혼합 규칙은
   오답노트 선택자만 같은 선언으로 옮기고 공용 선택자는 index.html에 남겼다. 원래 순서·@media 머리말 그대로.
   옮기기 전후 계산 스타일 대조(라이트·다크 × 390·768·1280) 차이 0 — 뉴스 ②-6과 같은 방식. */

.note-frame {
  display: grid;
  gap: 12px;
}

.note-frame-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--text2);
  font-size: 12px;
  padding: 3px 2px;
  border-bottom: 1px solid var(--border);
}

.note-frame-title strong {
  color: var(--text);
  font-size: 15px;
}

.note-card {
  border: 1px solid rgba(124,58,237,0.22);
  background: linear-gradient(180deg, rgba(124,58,237,0.07), rgba(0,0,0,0.02));
  border-radius: 13px;
  padding: 15px 17px;
  display: grid;
  gap: 10px;
}

.note-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.note-title {
  color: var(--text);
  font-size: 18px;
  font-weight: 900;
  line-height: 1.3;
}

.note-title-button {
  display: block;
  width: 100%;
  min-height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.note-title-button:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 5px;
}

.note-meta {
  margin-top: 4px;
  color: var(--text3);
  font-size: 11px;
  line-height: 1.35;
}

.note-list-source-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
  margin-top: 7px;
  cursor: text;
  user-select: text;
}

.note-list-source-chip {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 0;
  max-width: 100%;
  border: 1px solid rgba(88,166,255,0.32);
  background: rgba(88,166,255,0.08);
  color: var(--text2);
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 11px;
  line-height: 1.35;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.note-list-source-chip b { color: var(--text3); }

.note-auto-link {
  border: 0;
  border-bottom: 1px dotted rgba(88,166,255,0.8);
  background: rgba(88,166,255,0.08);
  color: #9cc7ff;
  border-radius: 5px;
  padding: 0 3px;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}

.note-auto-link:hover {
  background: rgba(88,166,255,0.16);
}

html[data-theme="light"] .note-auto-link {
  color: #1d4ed8;
  background: #eff6ff;
  border-bottom-color: #60a5fa;
}

.note-editor-wrap {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 13px;
  overflow: hidden;
}

.note-editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px;
  border-bottom: 1px solid var(--border);
  background: rgba(88,166,255,0.05);
}

.note-editor-toolbar button {
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text2);
  border-radius: 8px;
  padding: 6px 9px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
}

.note-editor-toolbar button:hover {
  color: var(--text);
  border-color: rgba(88,166,255,0.45);
}

.note-editor {
  min-height: 300px;
  padding: 14px 15px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.7;
  outline: none;
  overflow-wrap: anywhere;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* 선택 표시는 outline — border를 바꾸면 이미지에 이미 1px 테두리가 있어 두께가 변하며 레이아웃이
   밀린다. outline은 박스 크기에 영향을 주지 않는다. 이 class는 원장 밖이라 저장 시 지워진다. */
.note-editor .note-body-image.is-selected {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.note-editor .note-body-image {
  cursor: default;
}

.note-editor:empty::before {
  content: attr(data-placeholder);
  color: var(--text3);
}

.note-template-hint {
  color: var(--text3);
  font-size: 11px;
  line-height: 1.5;
  margin-top: 5px;
}

.note-editor h3 {
  font-size: 16px; font-weight: 800; color: var(--text);
  margin: 4px 0 13px; padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  letter-spacing: -0.01em;
}

.note-editor h4 {
  font-size: 13.5px; font-weight: 800; color: var(--text);
  margin: 17px 0 7px; padding-left: 11px;
  border-left: 3px solid var(--text3);
  line-height: 1.4;
}

.note-editor h4:first-child { margin-top: 2px; }

.note-editor h4.note-sec-path, .note-body-render h4.note-sec-path { border-left-color: var(--accent); color: var(--accent); }

.note-editor h4.note-sec-usmle, .note-body-render h4.note-sec-usmle { border-left-color: #a78bfa; color: #a78bfa; }

.note-editor h4.note-sec-link, .note-body-render h4.note-sec-link { border-left-color: var(--accent2); color: var(--accent2); }

.note-editor p { margin: 6px 0; }

.note-editor ul, .note-editor ol { margin: 6px 0; padding-left: 22px; }

.note-editor li { margin: 3px 0; }

.note-editor table {
  width: 100%; border-collapse: collapse; margin: 10px 0; font-size: 13px;
}

.note-editor th, .note-editor td {
  border: 1px solid var(--border); padding: 7px 10px; text-align: left; vertical-align: top;
}

.note-editor th {
  background: var(--surface2); color: var(--text2); font-weight: 700;
}

.note-editor tbody tr:nth-child(even) td {
  background: rgba(127,127,127,0.045);
}

/* ── 툴바 그룹 구분선 · 의미색 버튼 ── */
.note-tool-sep {
  width: 1px; height: 18px; background: var(--border); margin: 0 2px; align-self: center;
}

.note-editor-toolbar button.note-tool-callout {
  border-color: rgba(251,191,36,0.42); color: var(--accent3); background: rgba(251,191,36,0.09);
}

.note-editor-toolbar button.note-tool-warning {
  border-color: rgba(248,81,73,0.42); color: var(--confirm-danger); background: rgba(248,81,73,0.09);
}

.note-editor-toolbar button:active { transform: scale(0.96); }

.note-editor-helper-grid {
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 8px;
}

.note-editor-helper-grid .formula-input-helper {
  margin-top: 0;
}

.note-source-search-btn {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface2);
  color: var(--accent);
  padding: 5px 9px;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
}

.note-list-card {
  cursor: pointer;
}

.note-view-stack {
  display: grid;
  gap: 14px;
  min-width: 0;
  max-width: 100%;
}

.note-view-stack > * { min-width: 0; max-width: 100%; }

.note-export-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding-top: 2px;
}

.note-export-row .data-action-btn {
  min-width: 0;
  min-height: 44px;
  white-space: normal;
}

@media (max-width: 600px) {
  .note-export-row { grid-template-columns: 1fr; }

}

.note-brief-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  border: 1px solid var(--border);
  background: var(--surface2);
  border-radius: 12px;
  padding: 9px 11px;
  min-width: 0;
  max-width: 100%;
}

.note-brief-chip {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  min-width: 0;
  max-width: 100%;
  border: 1px solid rgba(148,163,184,0.28);
  background: var(--surface);
  color: var(--text2);
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.3;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.note-brief-chip b {
  color: var(--text3);
  font-size: 10px;
  font-weight: 850;
}

.note-brief-chip.source {
  border-color: rgba(88,166,255,0.28);
  color: var(--text);
}

.note-brief-chip.empty {
  color: var(--text3);
  font-weight: 600;
}

.note-source-choice-list {
  display: grid;
  gap: 10px;
}

.note-source-choice-card {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 12px;
  padding: 12px 13px;
  text-align: left;
  cursor: pointer;
  font-family: 'Noto Sans KR', sans-serif;
}

.note-source-choice-card:hover {
  border-color: rgba(88,166,255,0.55);
  background: var(--surface2);
}

.note-source-choice-title {
  font-size: 15px;
  font-weight: 850;
  margin-bottom: 7px;
}

.note-source-choice-summary {
  margin-top: 8px;
  color: var(--text2);
  font-size: 12px;
  line-height: 1.5;
}

.note-original-mcq {
  grid-column: 1 / -1;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface2);
  overflow: hidden;
}

.note-original-mcq.hidden {
  display: none;
}

.note-original-mcq-toggle {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-weight: 900;
  cursor: pointer;
}

.note-original-mcq-toggle .play {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text3);
  background: var(--surface);
}

.note-original-mcq-drawer {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(320px, 1.3fr);
  gap: 14px;
  border-top: 1px solid var(--border);
  padding: 14px;
  transform-origin: left center;
  transition: grid-template-columns 0.18s ease, opacity 0.18s ease;
}

.note-original-mcq:not(.open) .note-original-mcq-drawer {
  display: none;
}

.note-mcq-side, .note-mcq-main {
  display: grid;
  gap: 10px;
}

.note-mcq-choice-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 42px;
  gap: 8px;
  align-items: center;
}

.note-mcq-choice-letter {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  color: var(--text);
  background: var(--surface);
}

.note-mcq-choice-row.correct .note-mcq-choice-letter {
  background: rgba(35,134,54,0.18);
  border-color: rgba(35,134,54,0.55);
  color: var(--accent2);
}

.note-mcq-tools {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.note-mcq-tools button {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  padding: 9px 12px;
  font-weight: 800;
  cursor: pointer;
}

.note-mcq-tools button.accent {
  border-color: rgba(217,119,6,0.42);
  color: var(--warning);
}

/* ⚠️ grid 아이템의 기본 `min-width:auto`는 **칸을 내용의 min-content까지 늘린다** — 안쪽 어느
   한 줄에 무공백 긴 토큰(문제 식별자·URL)이 있으면 이 상자 전체가 모달 밖으로 밀려 나간다.
   `minmax(0,1fr)`은 격자 칸만 잡고 칸 안의 고유 폭은 못 잡으므로 자식 쪽에서도 함께 막는다
   (2026-08-17 responsive 리뷰 R1 실측: 375에서 409px 넘침). */
.note-mcq-view {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface2);
  padding: 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}

.note-mcq-view > * {
  min-width: 0;
}

/* ⚠️ `pre-wrap`은 공백에서만 줄을 바꾼다 — 무공백 토큰은 통째로 한 줄을 차지해 상자를 뚫는다. */
.note-mcq-view-stem {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  color: var(--text);
  line-height: 1.55;
}

/* 무엇을 보고 그렸는지 한 줄로 말한다(QB-8 ①). 「못 봤다」와 「그때 판본」은 색이 달라야 한다 —
   같은 회색이면 확인 실패가 정상 상태처럼 읽힌다. 색만으로 가르지 않도록 문장 자체가 사유를 담는다.
   ⚠️ 이 문장은 `ref.question_id`를 **그대로 싣는다**(missing 판정). 그 값은 서버가 준 식별자라
   길이도 공백 유무도 앱이 못 정한다 — 줄바꿈을 열어 두지 않으면 사유 줄이 모달을 가로로 뚫는다. */
.note-mcq-source {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text2);
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.note-mcq-source--unknown {
  /* ⚠️ 하드코딩 hex는 테마를 안 본다. `#b45309`는 라이트에서 5.02:1로 통과했지만 **다크에서
     3.44:1**로 AA(4.5:1) 미달이었다(2026-08-17 독립 a11y 리뷰 실측 · 12px 본문 · 대조군
     `--text` on `--surface` 14.64, 양성 대조군 `#777` on `#666` 1.28로 측정기 교정).
     하필 이 줄이 「확인 실패」를 알리는 자리다 — 가장 읽혀야 할 문장이 가장 안 읽혔다.
     형제인 관련 문제 패널의 `.qb-related__state--unknown`은 같은 뜻을 `var(--ui-warning)`으로
     칠하고 있었다. 토큰으로 맞춘다(다크 7.16:1 · 라이트 5.19:1 — 둘 다 AA). */
  color: var(--ui-warning);
  border-color: var(--ui-warning);
}

.note-mcq-source-action {
  justify-self: start;
  min-height: 44px;
}

.note-mcq-view-options {
  display: grid;
  gap: 8px;
}

.note-mcq-view-option {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 11px;
  background: var(--surface);
  color: var(--text2);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.note-mcq-view-option.correct {
  border-color: rgba(35,134,54,0.48);
  background: rgba(35,134,54,0.1);
  color: var(--text);
}

.note-original-mcq {
  background: linear-gradient(180deg, var(--surface), var(--surface2));
  border-radius: 16px;
}

.note-original-mcq-toggle {
  min-height: 68px;
  padding: 16px 20px;
}

.note-original-mcq-toggle-title {
  display: grid;
  gap: 4px;
  text-align: left;
}

.note-original-mcq-toggle-title strong {
  font-size: 1rem;
  color: var(--text);
}

.note-original-mcq-toggle-title small {
  font-size: 0.78rem;
  color: var(--text3);
  font-weight: 700;
}

.note-original-mcq-drawer {
  grid-template-columns: minmax(260px, 0.76fr) minmax(360px, 1.24fr);
  gap: 22px;
  padding: 22px 24px 24px;
}

@media (max-width: 768px) {
  .note-original-mcq-drawer {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    padding: 14px;
  }

}

.note-mcq-side,
.note-mcq-main {
  align-content: start;
  gap: 14px;
}

.note-mcq-panel-title {
  display: grid;
  gap: 5px;
}

.note-mcq-panel-title strong {
  font-size: 0.95rem;
  color: var(--text);
}

.note-mcq-panel-title span {
  font-size: 0.78rem;
  color: var(--text3);
  line-height: 1.45;
}

.note-mcq-tools button {
  min-height: 44px;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 0.82rem;
}

.note-mcq-choice-row {
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  gap: 10px;
}

.note-mcq-choice-letter {
  width: 44px;
  height: 44px;
  cursor: pointer;
}

.note-original-mcq-drawer .drawer-close-btn,
.note-original-mcq-drawer .data-action-btn,
.note-original-mcq-drawer input:not([type="file"]) {
  min-width: 44px;
  min-height: 44px;
}

.note-mcq-choice-row.correct .note-mcq-choice-letter::after {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: currentColor;
  margin-left: 5px;
}

.note-mcq-answer-hint {
  border: 1px solid rgba(35,134,54,0.25);
  border-radius: 12px;
  background: rgba(35,134,54,0.08);
  color: var(--text2);
  padding: 9px 11px;
  font-size: 0.78rem;
  line-height: 1.45;
}

.note-table-menu .note-table-menu-sep { height: 1px; background: var(--border); margin: 4px 3px; }

.note-wrong-label {
  color: #f87171;
  font-size: 11px;
  font-weight: 900;
}

.note-links {
  display: grid;
  gap: 8px;
}

.note-link-group {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 8px;
  align-items: start;
}

.note-link-label {
  color: var(--text3);
  font-size: 11px;
  font-weight: 850;
  padding-top: 5px;
}

.note-empty-card {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 13px;
  padding: 28px 18px;
  text-align: center;
  color: var(--text2);
}

.note-empty-card .icon {
  font-size: 30px;
  margin-bottom: 8px;
}

.note-inline-result {
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  display: grid;
  gap: 2px;
  font-family: 'Noto Sans KR', sans-serif;
  padding: 8px 9px;
  text-align: left;
  width: 100%;
  white-space: normal;
}

.note-inline-result:hover {
  background: var(--surface2);
  border-color: var(--border);
}

.note-inline-result strong {
  font-size: 12px;
  color: var(--text);
  overflow-wrap: anywhere;
}

.note-inline-result span {
  font-size: 10px;
  color: var(--text3);
}

.note-modal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.note-modal-field label {
  display: block;
  color: var(--text3);
  font-size: 11px;
  font-weight: 750;
  margin-bottom: 5px;
}

.note-modal-section-title {
  color: var(--text2);
  font-size: 12px;
  font-weight: 900;
  margin-top: 4px;
}

html[data-theme="light"] .note-card, html[data-theme="light"] .note-empty-card {
  background: #ffffff;
}

@media (max-width: 640px) {
  .note-frame-title, .note-card-head {
    align-items: stretch;
    flex-direction: column;
  }

  .note-modal-grid {
    grid-template-columns: 1fr;
  }

  .note-link-group {
    grid-template-columns: 1fr;
  }

}

.note-editor[data-medical-editor-mounted="true"] {
  padding: 0;
}

.note-editor .medical-editor-surface {
  min-height: 300px;
  padding: 14px 15px;
  outline: none;
  color: var(--text);
  background: var(--surface);
  line-height: 1.65;
}

.note-editor .medical-editor-surface:focus-visible {
  box-shadow: inset 0 0 0 2px var(--accent);
}

.note-editor-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  border-top: 1px solid var(--border);
  color: var(--text3);
  font-size: 12px;
}

.note-editor-status strong { color: var(--text2); }

/* 통합검색 종류 배지 (다크 기본 + 라이트 대비 보정) */
.note-kind-badge { display:inline-block; flex:0 0 auto; font-size:10px; font-weight:800; line-height:1; padding:3px 7px; border-radius:999px; border:1px solid var(--border); color:var(--text2); background:var(--surface2); }

/* 도메인 배지 — 색은 :root --dm-* 토큰 SSOT(라이트 오버라이드는 토큰이 담당하므로 개별 규칙 제거). */
.note-kind-badge.terms    { color:var(--dm-terms);   background:var(--dm-terms-bg);   border-color:var(--dm-terms-bd); }

.note-kind-badge.microbes { color:var(--dm-microbe); background:var(--dm-microbe-bg); border-color:var(--dm-microbe-bd); }

.note-kind-badge.drugs    { color:var(--dm-drug);    background:var(--dm-drug-bg);    border-color:var(--dm-drug-bd); }

.note-kind-badge.formulas { color:var(--dm-formula); background:var(--dm-formula-bg); border-color:var(--dm-formula-bd); }

.note-kind-badge.diseases { color:var(--dm-disease); background:var(--dm-disease-bg); border-color:var(--dm-disease-bd); }

.note-section-label-row .inline-add-btn { min-height: 44px; }

.medical-core-filter-pane .filter-summary{margin:0;padding:7px 9px;color:var(--ui-text-tertiary);font-size:11px;line-height:1.45;overflow-wrap:anywhere}

@media(min-width:768px) {
  /* 오답노트 목록 제목 줄은 바로 아래 노트 틀이 같은 뜻을 반복하므로 사이 여백만 줄인다. */
  #mainContent>.section-label:has(.note-section-label-row){margin-bottom:2px}

}
