/* 노트 화면(노트 시안 A '모아 보기 표', 오른쪽 '연구 빈틈' 칸 없이 한 칸). docs/platform-home-plan.md
   종류 거름은 서재 거름처럼 글자색·굵기만 바뀐다(시안의 회색 바탕 칩은 쓰지 않는다). 제목 28px·바깥 여백은 서재 값.
   시안 --surface는 translate.html에서 --card로 덮이니 같은 색인 --paper를 쓴다. */

.notes-screen {
  /* .container 좌우 20px과 합쳐 서재와 같은 56px */
  padding: 32px 36px 34px;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
}

.notes-screen [hidden] {
  display: none !important;
}

.notes-screen button,
.notes-screen input,
.notes-screen textarea {
  font: inherit;
  color: inherit;
}

.notes-screen :focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.notes-faint { color: var(--ink-faint); }
.notes-soft { color: var(--ink-soft); }
.notes-num { font-variant-numeric: tabular-nums; }

/* 단추(테두리만, 채우지 않음)·글자 단추·밑줄 링크 */
.notes-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font-size: 13.5px;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
}

.notes-btn:hover,
.notes-btn[aria-expanded="true"] { background: var(--card); }
.notes-btn.main { border-color: var(--ink); }
.notes-btn.sm { height: 28px; padding: 0 10px; font-size: 13px; }
.notes-btn:disabled { color: var(--ink-faint); border-color: var(--line-strong); background: transparent; cursor: default; }

.notes-tl {
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink-soft);
  font-size: 13px;
  cursor: pointer;
}

.notes-tl:hover { color: var(--ink); }
.notes-tl.notes-faint { color: var(--ink-faint); }
.notes-tl.notes-faint:hover { color: var(--ink); }
.notes-tl:disabled { color: var(--ink-faint); cursor: default; }

.notes-go {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.notes-go:hover { text-decoration-color: currentColor; }

.notes-lk {
  color: var(--ink);
  font-size: 13px;
  text-decoration: none;
  white-space: nowrap;
}

.notes-lk:hover { text-decoration: underline; text-underline-offset: 3px; }

/* 제목 줄 */
.notes-head {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
}

.notes-title-row {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin: 0 0 6px;
}

.notes-title {
  margin: 0;
  font-size: 28px;
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.notes-title span { color: var(--ink-faint); }

.notes-lead {
  margin: 0;
  color: var(--ink-soft);
  font-size: 15px;
}

.notes-acts {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 8px;
}

.notes-acts .notes-faint { font-size: 12.5px; }

/* Markdown으로 받기 미리보기 */
.notes-md {
  position: absolute;
  top: 52px;
  right: 0;
  z-index: 10;
  width: 470px;
  padding: 14px 16px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 8px 24px rgba(30, 28, 18, 0.1);
}

.notes-md-row1 {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 13px;
}

.notes-md-row1 strong { font-weight: 500; }

.notes-md-seg {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  margin-bottom: 10px;
  font-size: 13px;
}

.notes-md-seg button {
  padding: 2px 0;
  border: 0;
  background: none;
  color: var(--ink-faint);
  white-space: nowrap;
  cursor: pointer;
}

.notes-md-seg button:hover { color: var(--ink-soft); }
.notes-md-seg button[aria-pressed="true"] { color: var(--ink); font-weight: 500; }

.notes-md-pre {
  max-height: 260px;
  margin: 0 0 12px;
  padding: 10px 12px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
  color: #51504a;
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.notes-md-row2 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--ink-faint);
  font-size: 12.5px;
}

/* 거름·찾기 */
.notes-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.notes-kinds {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  font-size: 14px;
}

.notes-kinds button {
  padding: 4px 0;
  border: 0;
  background: none;
  color: var(--ink-faint);
  white-space: nowrap;
  cursor: pointer;
}

.notes-kinds button:hover { color: var(--ink-soft); }
.notes-kinds button[aria-pressed="true"] { color: var(--ink); font-weight: 500; }

.notes-n {
  margin-left: 4px;
  color: var(--ink-faint);
  font-size: 12px;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}

.notes-find {
  display: flex;
  flex: none;
  align-items: center;
  gap: 8px;
  width: 230px;
  padding: 6px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink-faint);
}

.notes-find:focus-within { border-color: var(--ink); }
.notes-find svg { flex: none; width: 14px; height: 14px; }

.notes-find input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 13.5px;
}

.notes-find input::placeholder { color: var(--ink-faint); }

.notes-subtools {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 6px;
  color: var(--ink-soft);
  font-size: 13px;
}

.notes-period { position: relative; }

.notes-drop {
  padding: 2px 0;
  border: 0;
  background: none;
  color: var(--ink-soft);
  font-size: 13px;
  cursor: pointer;
}

.notes-drop::after { content: " ▾"; color: var(--ink-faint); font-size: 10px; }
.notes-drop:hover,
.notes-drop.set { color: var(--ink); }

/* 기간 펼침 목록(머리 팝오버 .pop.sm + .mlist와 같은 모양) */
.notes-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 20;
  width: 220px;
  margin: 0;
  padding: 4px 0;
  list-style: none;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 8px 22px color-mix(in srgb, var(--ink) 7%, transparent);
}

.notes-menu button {
  display: block;
  width: 100%;
  padding: 8px 14px;
  border: 0;
  background: none;
  color: var(--ink);
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}

.notes-menu button:hover { background: var(--card); }
.notes-menu button[aria-checked="true"]::after { content: "  ✓"; color: var(--ink-faint); }

.notes-order { margin-left: auto; color: var(--ink-faint); }

/* 표 */
.notes-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 14px;
}

.notes-table th {
  padding: 6px 10px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-faint);
  font-size: 12.5px;
  font-weight: 400;
  text-align: left;
  white-space: nowrap;
}

.notes-table td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.notes-table .notes-r { text-align: right; }
.notes-table .notes-c-page { color: var(--ink-soft); }
.notes-row { cursor: pointer; }
.notes-row:hover td,
.notes-row.open td { background: var(--card); }
.notes-row.open td { border-bottom-color: transparent; }
.notes-more td { padding: 2px 10px 16px; background: var(--card); }

.notes-sent { display: flex; gap: 10px; min-width: 0; }
.notes-sent-body { flex: 1; min-width: 0; }

.notes-en {
  display: block;
  width: 100%;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: none;
  color: var(--ink);
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.notes-ko {
  margin-top: 2px;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 펼친 줄은 문장·번역을 줄이지 않고 다 보인다(아래 칸에는 메모·링크만). */
.notes-row.open .notes-en,
.notes-row.open .notes-ko {
  overflow: visible;
  line-height: 1.6;
  white-space: normal;
}
.notes-row.open .notes-ko { margin-top: 4px; }

/* 노트 화면·홈 최근 노트 글 속 수식(math-text.js). KaTeX 기본(1.21em)보다 줄여 줄 높이가 흔들리지 않게 한다. */
.note-math .katex {
  font-size: 1.05em;
}

.notes-thumb {
  flex: none;
  width: 44px;
  height: 32px;
  border: 1px solid rgba(39, 38, 30, 0.2);
  background: #fff;
  object-fit: contain;
}

.notes-pap { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

.notes-pap small {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  color: var(--ink-faint);
  font-size: 12.5px;
  text-overflow: ellipsis;
}

.notes-c-kind { color: var(--ink-soft); font-size: 13px; white-space: nowrap; }

/* 종류 점: 작은 정사각 하나. 메모·캡처는 속 빈 점. */
.notes-sq {
  display: inline-block;
  flex: none;
  width: 9px;
  height: 9px;
  margin-right: 7px;
  border-radius: 2px;
  background: var(--c, transparent);
  box-shadow: inset 0 0 0 1px rgba(39, 38, 30, 0.16);
  vertical-align: 0;
}

.notes-sq.hollow { background: transparent; box-shadow: inset 0 0 0 1px var(--ink-faint); }

.notes-memo {
  display: -webkit-box;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 13px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.notes-memo.none { color: var(--ink-faint); }

.notes-none-row td {
  padding: 28px 10px;
  color: var(--ink-faint);
  text-align: center;
}

/* 펼친 줄 */
.notes-more-in { display: grid; gap: 8px; max-width: 720px; }
.notes-more-in p { margin: 0; }
.notes-pre { white-space: pre-wrap; }
.notes-shot { width: 150px; height: auto; border: 1px solid rgba(39, 38, 30, 0.2); background: #fff; }
.notes-mm { color: var(--ink-soft); font-size: 13px; }
.notes-mm b { margin-right: 6px; color: var(--ink-faint); font-weight: 400; }
.notes-mm-text { white-space: pre-wrap; }
.notes-mm.editing { display: grid; gap: 6px; }

.notes-mm-input {
  width: 100%;
  min-height: 64px;
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink);
  font-size: 13.5px;
  line-height: 1.55;
  resize: vertical;
}

.notes-mm-input:focus { border-color: var(--ink); outline: 0; }
.notes-mm-acts { display: flex; align-items: baseline; gap: 14px; }
.notes-mm-error { color: var(--accent-text); font-size: 12.5px; }

.notes-links {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 18px;
  padding-top: 4px;
  font-size: 13.5px;
}

/* 불러오는 중·못 불러옴·노트 없음 */
.notes-state { padding: 28px 0; border-top: 1px solid var(--line); }
.notes-state-text { margin: 0; color: var(--ink-soft); }
.notes-state-hint { margin: 4px 0 0; color: var(--ink-faint); font-size: 13.5px; }
.notes-state .notes-tl { margin-top: 8px; }

/* 노트에서 뺀 것: 표 아래 한 줄, 펼치면 다시 넣기 */
.notes-hidden { padding: 14px 0 4px; }
.notes-hidden-list { margin: 8px 0 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.notes-hidden-list > li { padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.notes-hidden-item { display: flex; align-items: baseline; gap: 12px; }
.notes-hidden-text { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-soft); }
.notes-hidden-item .notes-faint { flex: 0 1 auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40%; }

/* 노트에서 뺀 뒤 잠깐 보이는 되돌리기 */
.notes-undo {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 30;
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 10px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 8px 22px color-mix(in srgb, var(--ink) 7%, transparent);
  font-size: 13.5px;
  transform: translateX(-50%);
}

.notes-undo .notes-tl { color: var(--ink); font-size: 13.5px; text-decoration: underline; text-underline-offset: 3px; }

/* 휴대폰 아래 고정 줄은 넓은 화면에서 숨긴다. */
.notes-screen .notes-bar { display: none; }

/* 좁은 노트북: 서재와 같이 바깥 여백을 줄인다(library.css) */
@media (max-width: 1100px) {
  .notes-screen { padding: 28px 24px 30px; }
}

@media (max-width: 760px) {
  .notes-screen { padding: 16px 0 0; }
  .notes-head { margin-bottom: 10px; }
  .notes-title { font-size: 22px; }
  .notes-lead,
  .notes-acts,
  .notes-order { display: none; }

  .notes-md {
    position: fixed;
    top: auto;
    right: 12px;
    bottom: 60px;
    left: 12px;
    z-index: 40;
    width: auto;
    max-height: 70vh;
    overflow: auto;
  }

  .notes-tools { flex-direction: column; align-items: stretch; gap: 10px; }
  /* '최근 연 300편의 노트만 보여요'는 요약·기간 아래 한 줄로 */
  .notes-subtools { flex-wrap: wrap; row-gap: 2px; }
  .notes-cut { order: 1; flex-basis: 100%; }
  .notes-kinds {
    flex-wrap: nowrap;
    gap: 16px;
    overflow-x: auto;
    font-size: 13.5px;
    scrollbar-width: none;
  }
  .notes-kinds::-webkit-scrollbar { display: none; }
  .notes-find { width: 100%; }

  /* 표 → 줄 목록: 원문 2줄 · 번역 1줄 · '색 점 종류 · 짧은 이름 · p.N' */
  .notes-table,
  .notes-table tbody,
  .notes-table tr,
  .notes-table td { display: block; width: auto; }
  .notes-table colgroup,
  .notes-table thead { display: none; }
  .notes-row {
    display: flex !important;
    flex-wrap: wrap;
    align-items: center;
    padding: 11px 0;
    border-bottom: 1px solid var(--line);
  }
  .notes-row:hover td { background: none; }
  .notes-table .notes-row td { padding: 0; border: 0; }
  .notes-row.open { background: var(--card); border-bottom-color: transparent; }
  .notes-row .notes-c-sent { flex: 0 0 100%; }
  /* 한 줄 말줄임 글이 줄 폭을 넘겨 밀어내지 않게 */
  .notes-row .notes-c-sent,
  .notes-row .notes-sent,
  .notes-row .notes-sent-body { min-width: 0; max-width: 100%; }
  .notes-row .notes-c-kind,
  .notes-row .notes-c-paper,
  .notes-row .notes-c-page {
    margin-top: 5px;
    color: var(--ink-faint);
    font-size: 12.5px;
    text-align: left;
  }
  .notes-row .notes-c-kind { order: 1; display: flex; align-items: center; }
  .notes-row .notes-c-paper { order: 2; display: flex; min-width: 0; max-width: 55%; }
  .notes-row .notes-pap { min-width: 0; }
  .notes-row .notes-c-page { order: 3; }
  .notes-row .notes-c-paper::before,
  .notes-row .notes-c-page::before { content: "\00a0·\00a0"; }
  .notes-row .notes-pap small,
  .notes-row .notes-c-memo,
  .notes-row .notes-c-page.none { display: none; }
  .notes-en { white-space: normal; }
  .notes-en-text {
    display: -webkit-box;
    overflow: hidden;
    font-size: 14px;
    line-height: 1.5;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }
  .notes-row.open .notes-en-text { display: block; overflow: visible; }
  .notes-table .notes-more td { padding: 4px 0 16px; border-bottom: 1px solid var(--line); }
  .notes-none-row td { padding: 28px 0; }

  .notes-screen .notes-bar {
    position: sticky;
    bottom: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 0;
    border-top: 1px solid var(--line);
    background: var(--bg);
    font-size: 13px;
  }
  .notes-undo { bottom: 64px; }
}
