/* 2026-11-19 한윤태님: 좁은 임베드에서도 긴 문서와 중첩 목록을 읽고 편집해야 합니다.
   사이드바 너비는 넓은 화면에서만 확보하고 본문 입력은 가용 폭에 맞춥니다. */
@font-face {
  font-family: "Pretendard";
  src: url("./fonts/PretendardVariable.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}
:root {
  color-scheme: light dark;
  --ui-font: "Pretendard", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  font: 16px/1.6 var(--ui-font);
  --bg: #fff; --panel: #f7f7f7; --ink: #161616; --sub: #606060; --line: #dedede;
  --action: #111; --action-text: #fff; --selected: #e9e9e9; --focus: #111;
  accent-color: var(--action);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --bg: #101010; --panel: #191919; --ink: #f5f5f5; --sub: #b7b7b7; --line: #3b3b3b;
    --action: #fff; --action-text: #101010; --selected: #323232; --focus: #fff; }
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; --bg: #101010; --panel: #191919; --ink: #f5f5f5; --sub: #b7b7b7;
  --line: #3b3b3b; --action: #fff; --action-text: #101010; --selected: #323232; --focus: #fff; }
::selection { color: var(--action-text); background: var(--action); }
.title, .block-text, .marker { font-family: var(--document-font, var(--ui-font)); }
.create-control { display: flex; gap: 4px; }
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--bg); }
input, textarea, button, select { font: inherit; color: inherit; }
button { cursor: pointer; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; min-height: 40px; padding: 5px 12px; }
button:not(:disabled):hover { background: var(--selected); }
button:disabled { opacity: .62; cursor: default; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.primary { background: var(--action); color: var(--action-text); border-color: var(--action); font-weight: 650; }
.primary:not(:disabled):hover { background: var(--action); filter: brightness(.94); }
.workspace { min-height: 100dvh; display: grid; grid-template-columns: 248px minmax(0,1fr); }
.sidebar { min-width: 0; font-size: 13px; line-height: 1.45; background: var(--panel); border-right: 1px solid var(--line); padding: 18px 16px; }
.brand { font-size: 14px; display: flex; gap: 10px; align-items: center; margin-bottom: 6px; }
.brand-mark { background: var(--action); color: var(--action-text); border-radius: 5px; width: 26px; height: 26px; display: grid; place-items: center; line-height: 1; }
.account, .muted, .save-status { color: var(--sub); font-size: .86rem; }
.account { font-size: 12px; margin: 0 0 21px 36px; overflow-wrap: anywhere; }
.new { width: 100%; text-align: left; }
.search { display: flex; margin: 14px 0; }
.search input { min-width: 0; width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: 6px 0 0 6px; padding: 7px 8px; }
.search button { border-left: 0; border-radius: 0 6px 6px 0; flex: none; font-size: 13px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.tabs button, .pages button { background: transparent; border-color: transparent; }
.tabs button { padding-inline: 9px; font-size: 13px; }
.tabs .active, .pages .active { background: var(--selected); font-weight: 600; }
.pages { list-style: none; margin: 8px 0; padding: 0; }
.pages button { width: 100%; min-height: 32px; padding: 6px 8px; font-size: 13px; font-weight: 400; line-height: 1.4; text-align: left; overflow-wrap: anywhere; }
main { min-width: 0; }
.topbar { min-height: 49px; padding: 4px 24px; display: flex; gap: 12px; align-items: center; border-bottom: 1px solid var(--line); font-size: .85rem; }
.save-status { margin-left: auto; }
.drawer-toggle, .close-drawer { display: none; }
.paper, .empty { max-width: 824px; margin: 42px auto; padding: 0 32px 60px; }
.title { border: 0; width: 100%; background: transparent; font-size: clamp(1.8rem,4vw,2.25rem); font-weight: 760; padding: 4px 0; line-height: 1.35; }
.toolbar { display: flex; flex-wrap: wrap; gap: 4px; margin: 20px 0 14px; padding-bottom: 9px; border-bottom: 1px solid var(--line); }
.toolbar button { font-size: .78rem; padding: 3px 8px; min-height: 32px; }
.block-row { display: flex; align-items: flex-start; gap: 4px; padding-left: min(calc(var(--depth) * 22px),42%); margin: 3px 0; }
.block-row.heading textarea { font-size: 1.35rem; font-weight: 700; line-height: 1.45; }
.block-text { flex: 1; min-width: 0; border: 1px solid transparent; border-radius: 3px; background: transparent; padding: 3px 2px; line-height: 1.65; resize: none; overflow: hidden; }
.block-text:focus-visible { outline-offset: 0; }
.check { margin: 9px 4px; width: 18px; height: 18px; accent-color: var(--action); }
.marker { min-width: 1.2em; text-align: center; margin-top: 4px; }
.add-block, .page-link { margin-top: 6px; color: var(--sub); background: transparent; }
.attachment { color: var(--sub); padding: 5px; }
.message, .login { max-width: 824px; margin: 12px auto; padding: 0 32px; overflow-wrap: anywhere; }
.conflict { border: 1px solid var(--line); padding: 16px; border-radius: 8px; margin-top: 24px; }
.conflict h2,.conflict h3 { margin: 6px 0; }
.conflict h2 { font-size: 1.15rem; } .conflict h3 { font-size: 1rem; }
.versions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.conflict pre { max-height: 18rem; overflow: auto; padding: 9px; background: var(--panel); white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; }
.conflict button { margin: 4px 8px 0 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
#startup, noscript { display: block; margin: 2rem; color: var(--sub); }
@media (max-width: 1023px) {
  .workspace { display: block; }
  .sidebar { display: none; }
  .sidebar.expanded { display: block; position: fixed; inset: 0 auto 0 0; width: min(320px,100%); z-index: 2; overflow: auto; box-shadow: 4px 0 24px #0003; }
  .drawer-toggle, .close-drawer { display: inline-block; min-width: 44px; min-height: 44px; }
  .close-drawer { margin-left: auto; }
  .paper, .empty, .message, .login { padding-inline: 24px; }
}
@media (max-width: 719px) {
  button, .toolbar button, .tabs button, .pages button { min-height: 44px; }
  .paper,.empty { margin-top: 22px; padding: 0 max(16px,env(safe-area-inset-right)) max(52px,env(safe-area-inset-bottom)) max(16px,env(safe-area-inset-left)); }
  .message,.login,.topbar { padding-inline: 16px; }
  .versions { grid-template-columns: 1fr; }
  .block-row { padding-left: min(calc(var(--depth) * 15px),36%); }
}
.logout { margin-left: 8px; padding: 0 4px; min-height: 30px; color: var(--sub); background: transparent; border: 0; text-decoration: underline; font-size: 12px; }
@media(max-width:719px){.logout{min-height:44px;}}
.share-entry { display: flex; align-items: center; gap: 4px; }
.share-entry[hidden] { display: none; }
.share-entry button { border-color: transparent; }
.sharing-panel { position: fixed; z-index: 3; right: max(16px,env(safe-area-inset-right)); top: 54px;
  max-height: calc(100dvh - 74px); overflow: auto; width: min(440px,calc(100% - 32px)); padding: 18px;
  border: 1px solid var(--line); border-radius: 9px; background: var(--bg); color: var(--ink); box-shadow: 0 5px 22px #0002; font-size: .94rem; }
.sharing-panel header { display: flex; align-items: center; justify-content: space-between; }
.sharing-panel h2 { margin: 0; font-size: 1.3rem; }
.sharing-panel h3 { margin: 16px 0 4px; font-size: 1rem; }
.sharing-panel form,.share-actions { display: flex; flex-wrap: wrap; align-items: end; gap: 6px; }
.sharing-panel label { display: inline-grid; gap: 2px; margin: 3px 8px 3px 0; }
.sharing-panel input,.sharing-panel select { padding: 6px; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 4px; font: inherit; }
.sharing-panel ul { list-style: none; padding: 0; margin: 6px 0; }
.sharing-panel li { display: grid; gap: 3px; border-bottom: 1px solid var(--line); padding: 6px 0; }
.sharing-panel li > span { color: var(--sub); }
.sharing-panel p:empty { display: none; }
@media(max-width:719px) {
  .sharing-panel { inset: 0; width: 100%; max-height: 100dvh; border-radius: 0; padding: max(16px,env(safe-area-inset-top)) 16px max(16px,env(safe-area-inset-bottom)); }
  .topbar { gap: 4px; flex-wrap: wrap; }
  .share-entry button,.topbar > button { padding-inline: 7px; }
}
.project-area, .task-detail { margin: 1em 0; }
.project-controls, .project-area form, .task-detail { display: flex; gap: .6rem; align-items: end; flex-wrap: wrap; }
.project-area label, .task-detail label { display: grid; gap: 2px; font-size: .9rem; color: var(--sub); }
.project-area select, .project-area input, .task-detail select, .task-detail input, .create-kind {
  color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 5px;
  padding: .3rem .55rem; font: inherit; min-height: 40px; max-width: 100%;
}
.project-controls [aria-pressed="true"] { background: var(--selected); }
.task-table { overflow-x: auto; margin-block: .8rem; }
.task-table table { width: 100%; border-collapse: collapse; }
.task-table td, .task-table th { border-bottom: 1px solid var(--line); text-align: start; padding: .35rem; }
.task-table th { color: var(--sub); font-size: .86rem; font-weight: 600; }
.task-board { display: grid; gap: .5rem; margin-block: .8rem; grid-template-columns: repeat(3,minmax(0,1fr)); }
.task-board section { border-radius: 6px; background: var(--panel); padding: .45rem; min-width: 0; }
.task-board h3 { margin: 0 .25rem .4rem; font-size: .95rem; }
.task-card { display: grid; gap: .3rem; padding: .4rem; margin-bottom: .35rem; border: 1px solid var(--line); background: var(--bg); border-radius: 6px; }
.task-title { border-color: transparent; text-align: start; overflow-wrap: anywhere; }
.project-area form { margin-block: .7rem; }
@media(max-width:719px) {
  .task-board { grid-template-columns: 1fr; }
  .project-area select, .project-area input, .task-detail select, .task-detail input, .create-kind { min-height: 44px; }
}
.font-toggle { padding-inline: .55rem; font-weight: 600; border-color: transparent; }
.font-panel { width: min(420px,calc(100vw - 24px)); max-height: 75dvh; overflow: auto; padding: 1rem;
  background: var(--bg); color: var(--ink); border: 1px solid var(--line); border-radius: 10px; }
.font-panel::backdrop { background: rgb(0 0 0 / .28); }
.font-panel header { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.font-panel h2 { font-size: 1.2rem; margin: 0; }
.font-panel input[type="search"] { width: 100%; background: var(--bg); color: var(--ink); border: 1px solid var(--line); border-radius: 5px; padding: .5rem; }
.font-panel .font-results { display: grid; gap: 2px; margin-block: .55rem; max-height: 34dvh; overflow: auto; }
.font-results button { text-align: start; border-color: transparent; }
.font-results button[aria-pressed="true"] { background: var(--selected); font-weight: 650; }
.font-panel footer, .font-panel .font-filter { display: flex; align-items: center; gap: .5rem; }
.font-panel footer { justify-content: space-between; color: var(--sub); }
.font-panel footer a { color: inherit; }
.font-panel .font-filter { margin-block: .5rem; }

/* 2026-11-19 한윤태님: 문서를 읽을 때 편집 조작이 본문보다 먼저 보였습니다.
   서식 조작은 펼쳐서 사용하고 제목·본문은 같은 왼쪽 여백에 맞춥니다. */
.editing-tools { margin: .45rem 0 1.4rem; }
.editing-tools > summary { display: inline-flex; align-items: center; gap: .45rem; list-style: none;
  cursor: pointer; color: var(--sub); border-radius: 4px; font-size: .83rem; font-weight: 520; padding: .3rem .4rem; }
.editing-tools > summary::after { content: "⌄"; line-height: 1; }
.editing-tools[open] > summary::after { transform: rotate(180deg); }
.editing-tools summary::-webkit-details-marker { display: none; }
.editing-tools summary:hover, .editing-tools summary:focus-visible { background: var(--selected); }
.editing-tools .toolbar { margin: 5px 0 0; padding: 6px 0; border-bottom: 0; }
.toolbar button, .add-block, .page-link { border-color: transparent; }
.add-block { margin-top: 12px; }
.page-link { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.topbar { min-height: 53px; }
.font-current { margin: .7rem 0; font-weight: 650; }
.sharing-panel { border-radius: 12px; padding: 20px; box-shadow: 0 12px 45px rgb(0 0 0 / .13); }
.sharing-panel header { padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.sharing-panel header button { border-color: transparent; }
.sharing-panel section, .sharing-panel form { margin-block: 10px; }
@media (min-width:1024px) {
  .sidebar { padding: 23px 18px; }
  .paper { margin-top: 58px; }
  .block-row { margin-block: 5px; }
}
@media (max-width:719px) {
  .editing-tools > summary { min-height: 44px; }
  .sharing-panel { border-radius: 0; padding: max(16px,env(safe-area-inset-top)) 16px; }
}

dialog.sharing-panel { margin: 0; left: auto; bottom: auto; }
.sharing-panel::backdrop { background: rgb(0 0 0 / .12); }
.sharing-panel header button { font-size: 1.45rem; line-height: 1; }
.sharing-panel label { color: var(--sub); font-size: .86rem; }
.sharing-panel input, .sharing-panel select { color: var(--ink); }
.sharing-panel form label { flex: 1; min-width: 120px; }
.grant-edit > summary { cursor: pointer; width: max-content; color: var(--sub); font-size: .85rem; padding: .25rem 0; }
.grant-edit .share-actions { padding: .5rem 0; }
@media (max-width:719px) { dialog.sharing-panel { inset: 0; height: 100dvh; max-width: 100vw; } }
.file-action, .file-summary button { color: var(--sub); border-color: transparent; }
.file-block { min-width: 0; width: 100%; padding-block: .2rem; }
.file-summary { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; border-block-end: 1px solid var(--line); }
.file-summary strong { overflow-wrap: anywhere; }
.file-summary span, .file-status { color: var(--sub); font-size: .85rem; }
.file-preview { display: block; max-width: 100%; max-height: 24rem; margin-top: .5rem; object-fit: contain; }

.import-launch { padding: 5px 8px; margin-bottom: 8px; font-size: 13px; }
.import-panel fieldset { min-width: 0; margin: 12px 0; padding: 8px; border: 1px solid var(--line); }
.import-panel .import-page { display: flex; align-items: center; gap: 8px; min-height: 44px; overflow-wrap: anywhere; }
.import-panel small { display: block; color: var(--sub); }
.import-panel input[type=file] { max-width: 100%; }
/* 2026-11-19 한윤태님: 원본과 사본의 동작은 본문 아래에서 필요할 때만 표시합니다.
   도구 연결은 흑백 테마와 기존 글꼴·터치 크기를 따르는 접이식 영역으로 둡니다. */
.source-picker { margin-top: 18px; padding: 12px 0; border-top: 1px solid var(--line); font-size: 13px; }
.source-picker summary { cursor: pointer; color: var(--muted); }
.source-picker label { display: grid; gap: 6px; margin: 12px 0; }
.source-picker input { width: 100%; min-height: 36px; box-sizing: border-box; }
.source-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.source-preview { margin: 12px 0; padding: 12px; border: 1px solid var(--line); border-radius: 8px; }
.source-block { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
@media (max-width: 719px) { .source-picker button, .source-picker input, .source-block button, .source-block a { min-height: 44px; } }

.page-menu-launch { font-size: 1.25rem; border-color: transparent; }
.page-menu .manage-actions { display: grid; gap: 4px; margin: 12px 0; }
.page-menu .manage-actions button,.page-menu li button { text-align: start; }
.page-menu .move-option { display: flex; gap: 8px; align-items: center; min-height: 36px; }
.page-menu button,.page-menu input { font-size: 13px; }
.menu-back { margin: 8px 0; }
.tree-impact,.historical-page { border-top: 1px solid var(--line); margin-top: 12px; }
.historical-page { overflow-wrap: anywhere; white-space: pre-wrap; }
@media(max-width:719px){.page-menu .move-option,.page-menu button,.page-menu-launch {min-height:44px;}}
.page-relations { font-size: 13px; }
.page-relations h3 { font-size: 13px; font-weight: 600; margin: 12px 0 4px; }
.page-relations ul { list-style: none; padding: 0; margin: 0; }
.page-relations button { font: inherit; border-color: transparent; text-align: start; overflow-wrap: anywhere; }
@media(max-width:719px){.page-relations button {min-height:44px;}}
/* 2026-11-24 한윤태님: 임베드에서 로그인 줄의 「브라우저에서 열기」가 기본 파란 링크로 보여 버튼 모양으로 맞춥니다.
   손노트 화면 이름 정리와 함께, 일부러 링크를 보조 버튼 모양으로 둡니다. */
.login { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.login a { display: inline-flex; align-items: center; min-height: 40px; padding: 5px 12px; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 6px; text-decoration: none; font-size: .9rem; }
.login a:hover { background: var(--selected); }

/* 2026-11-24 한윤태님: 손노트를 노션처럼 문서 도구다운 화면으로 바꿉니다(1229 1단계).
   따뜻한 회색 톤과 좁은 본문 열을 쓰며, 수치는 이 제품에서 정한 값이고 특정 제품의 값이 아닙니다.
   동작과 접근성(포커스·44px 터치 크기)은 기존 규칙을 유지하고 모양만 덮어씁니다. */
:root { --bg: #fff; --panel: #f7f6f3; --ink: #37352f; --sub: #787774; --line: #e9e8e4; --selected: #ebeae6; --hover: #efeeea;
  --action: #2f2e2b; --accent: #2383e2; font-size: 16px; line-height: 1.5; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --bg: #191919; --panel: #202020; --ink: #e6e4df; --sub: #9b9a97; --line: #2f2f2f; --selected: #2f2f2f; --hover: #2a2a2a; --action: #e6e4df; --accent: #529cca; }
}
:root[data-theme="dark"] { --bg: #191919; --panel: #202020; --ink: #e6e4df; --sub: #9b9a97; --line: #2f2f2f; --selected: #2f2f2f; --hover: #2a2a2a; --action: #e6e4df; --accent: #529cca; }
::selection { color: inherit; background: color-mix(in srgb, var(--accent) 28%, transparent); }
button { border-radius: 4px; min-height: 32px; }
button:not(:disabled):hover { background: var(--hover); }
.primary { font-weight: 600; }
.workspace { grid-template-columns: 244px minmax(0,1fr); }
.sidebar { background: var(--panel); border-right: 1px solid var(--line); padding: 14px 8px; }
.brand { padding: 0 8px; margin-bottom: 2px; font-weight: 600; }
.brand-mark { background: transparent; color: var(--ink); width: 22px; height: 22px; font-size: 16px; }
.account { margin: 0 8px 14px 38px; }
.import-launch { width: 100%; text-align: left; border-color: transparent; background: transparent; color: var(--sub); margin: 0 0 2px; padding: 4px 8px; min-height: 30px; }
.create-control { margin: 2px 0 6px; }
.new { text-align: left; background: transparent; color: var(--ink); border-color: transparent; font-weight: 500; min-height: 30px; padding: 4px 8px; }
.primary.new:not(:disabled):hover { background: var(--hover); filter: none; }
.create-kind { min-height: 30px; font-size: 12px; border-color: transparent; background: transparent; color: var(--sub); }
.search { margin: 6px 4px 10px; }
.search input { border-color: transparent; background: var(--hover); padding: 5px 8px; font-size: 13px; }
.search button { border-color: transparent; background: var(--hover); min-height: 30px; padding: 0 8px; color: var(--sub); }
.tabs { border-bottom: 0; padding: 0 4px 4px; }
.tabs button { min-height: 28px; padding: 2px 8px; color: var(--sub); font-size: 12px; font-weight: 500; }
.tabs .active { color: var(--ink); background: var(--selected); }
.pages { margin: 4px 0; }
.pages li { margin: 1px 0; }
.tree-row { display: flex; align-items: center; border-radius: 4px; padding-left: calc(var(--tree-depth, 0) * 16px); min-height: 28px; }
.tree-row:hover { background: var(--hover); }
.tree-row.active { background: var(--selected); font-weight: 600; }
.pages .tree-row button { background: transparent; border-color: transparent; min-height: 28px; }
.pages .tree-toggle { flex: none; width: 22px; min-height: 28px; padding: 0; color: var(--sub); font-size: 12px; line-height: 1; border-radius: 3px; }
.pages .tree-toggle[hidden] { display: block; visibility: hidden; }
.pages .tree-title { flex: 1; width: auto; min-height: 28px; min-width: 0; text-align: left; padding: 3px 6px 3px 2px; font-weight: inherit; font-size: 14px; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar { min-height: 44px; border-bottom-color: transparent; padding-inline: 16px; color: var(--sub); }
.topbar button { border-color: transparent; background: transparent; }
.topbar button:not(:disabled):hover { background: var(--hover); }
/* 2026-11-26 한윤태님: 「휴지통으로 이동」 창의 확인 단추가 안 보였습니다. 상단 막대 안의 창(.topbar button 투명 규칙)이 주 단추(.primary)의 배경을 지워 흰 글씨가 흰 바탕에 묻혔습니다.
   창 안 주 단추는 배경을 되돌립니다(상단 막대의 일반 단추는 그대로 투명). */
.topbar .primary { background: var(--action); border-color: var(--action); }
.topbar .primary:not(:disabled):hover { background: var(--action); filter: brightness(.94); }
.paper { max-width: 900px; padding: 0 96px 120px; margin-top: 64px; }
.title { font-size: clamp(2rem,5vw,2.5rem); font-weight: 700; line-height: 1.2; padding: 0 0 6px; letter-spacing: -.01em; }
.title::placeholder, .block-text::placeholder { color: color-mix(in srgb, var(--sub) 55%, transparent); }
.block-row { position: relative; gap: 2px; margin: 1px 0; }
.block-text { font-size: 16px; line-height: 1.6; padding: 4px 2px; }
.block-row.heading textarea { font-size: 1.6rem; font-weight: 650; line-height: 1.3; padding-top: 14px; }
.check { margin: 10px 6px 10px 2px; }
.marker { margin-top: 4px; color: var(--ink); }
.block-add { position: absolute; left: -30px; top: 4px; width: 24px; min-height: 24px; height: 24px; padding: 0; border: 0; background: transparent;
  color: var(--sub); border-radius: 4px; line-height: 1; font-size: 18px; opacity: 0; transition: opacity .12s; }
.block-row:hover .block-add, .block-row:focus-within .block-add, .block-add:focus-visible { opacity: 1; }
@media (hover: none) { .block-add { opacity: .55; left: -28px; } }
.editing-tools { margin: .2rem 0 1rem; }
.add-block { color: var(--sub); }
.sharing-panel { border-radius: 8px; box-shadow: 0 0 0 1px var(--line), 0 8px 28px rgb(0 0 0 / .12); }
@media (max-width: 1023px) {
  .paper { padding-inline: 32px; }
  .block-add { left: -26px; }
}
@media (max-width: 719px) {
  .paper { padding-inline: 20px 16px; margin-top: 24px; }
  .block-add { left: -22px; width: 22px; min-height: 44px; height: 44px; top: -8px; }
  .tree-row, .pages .tree-row button { min-height: 44px; }
}

/* 2026-11-24 한윤태님: 상업 사용이 가능한 무료 글꼴(OFL-1.1)을 서버에 직접 담아 외부 요청 없이 씁니다(1229).
   명조·고정폭은 선택했을 때만 내려받습니다. 파일 출처와 체크섬은 fonts/sources.json. */
@font-face { font-family: "Sonnote Serif"; src: url("./fonts/NotoSerifKR-Variable.woff2") format("woff2"); font-weight: 200 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Sonnote Mono"; src: url("./fonts/D2Coding-Regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Sonnote Mono"; src: url("./fonts/D2Coding-Bold.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
.font-quick { display: flex; gap: 6px; margin: .5rem 0; }
.font-quick button { flex: 1; min-height: 40px; }
.font-quick button[aria-pressed="true"] { background: var(--selected); font-weight: 650; }

/* 2026-11-24 한윤태님: 즐겨찾기 구역·사이드바 아래 휴지통·상단 링크 복사/즐겨찾기 아이콘(1229). */
.favorites h3 { margin: 10px 8px 2px; font-size: 12px; font-weight: 600; color: var(--sub); }
.favorites ul { list-style: none; margin: 0 0 6px; padding: 0; }
.favorites .fav-title { display: block; width: 100%; min-height: 28px; text-align: left; padding: 3px 8px; font-size: 14px; border-color: transparent; background: transparent; border-radius: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.favorites .fav-title:hover { background: var(--hover); }
.sidebar-foot { margin-top: auto; padding-top: 8px; border-top: 1px solid var(--line); }
.trash-entry { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; border-color: transparent; background: transparent; color: var(--sub); min-height: 30px; padding: 4px 8px; font-size: 14px; }
.trash-entry:hover { color: var(--ink); }
.topbar-icon { min-width: 32px; padding: 0 6px; font-size: 15px; color: var(--sub); }
.topbar-icon[aria-pressed="true"] { color: #e0a100; }
@media (min-width: 1024px) {
  .sidebar { position: sticky; top: 0; height: 100dvh; overflow-y: auto; display: flex; flex-direction: column; }
}
.sidebar.expanded { display: flex; flex-direction: column; }
@media (max-width: 719px) { .topbar-icon, .trash-entry { min-height: 44px; min-width: 44px; } }

/* 2026-11-24 한윤태님: `/` 블록 메뉴·블록 손잡이 메뉴·끌어서 순서 변경(1229 2단계). */
.block-handle { position: absolute; left: -26px; top: 4px; width: 22px; min-height: 24px; height: 24px; padding: 0; border: 0; background: transparent;
  color: var(--sub); border-radius: 4px; cursor: grab; font-size: 13px; letter-spacing: -2px; line-height: 1; opacity: 0; transition: opacity .12s; }
.block-row:hover .block-handle, .block-row:focus-within .block-handle, .block-handle:focus-visible, .block-handle[aria-expanded="true"] { opacity: 1; }
.block-add { left: -50px; }
@media (hover: none) { .block-handle { opacity: .55; left: -26px; } }
.block-row.drop-target { box-shadow: 0 2px 0 0 var(--accent); }
.slash-menu, .block-menu { position: absolute; z-index: 20; min-width: 240px; max-height: 320px; overflow: auto; padding: 4px; margin-top: 2px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 28px rgb(0 0 0 / .14); }
.slash-menu { top: 100%; left: 0; }
.block-menu { top: 28px; left: -26px; }
.slash-item, .block-menu button { display: flex; width: 100%; justify-content: space-between; align-items: center; gap: 12px; min-height: 32px; text-align: left; border-color: transparent; background: transparent; padding: 4px 8px; font-size: 14px; }
.slash-item[aria-selected="true"], .slash-item:hover, .block-menu button:hover { background: var(--selected); }
.slash-hint { color: var(--sub); font-size: 12px; }
.block-menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }
.block-menu .menu-label { margin: 4px 8px; font-size: 12px; color: var(--sub); }
.block-menu .danger { color: #d44c47; }
.menu-backdrop { position: fixed; inset: 0; z-index: 19; }
@media (max-width: 719px) { .block-handle, .block-add { display: none; } .slash-menu, .block-menu { min-width: min(240px, 90vw); } }

/* 2026-11-24 한윤태님: 검색 결과에서 일치한 글 앞뒤와 일치 부분 표시(이전 계획 F3). */
.pages .snippet { margin: 0 0 4px 22px; padding: 0 6px; font-size: 12px; line-height: 1.4; color: var(--sub); overflow-wrap: anywhere; }
.pages .snippet mark { background: color-mix(in srgb, var(--accent) 22%, transparent); color: inherit; border-radius: 2px; }

/* 2026-11-24 한윤태님: 페이지 아이콘(노션 이전 시 유실되던 항목). */
.icon-picker { position: relative; margin: 0 0 4px; }
.page-icon { font-size: 2.6rem; line-height: 1.2; background: transparent; border: 0; padding: 2px 6px; border-radius: 6px; cursor: pointer; }
.page-icon:hover:not(:disabled) { background: color-mix(in srgb, var(--sub) 14%, transparent); }
.page-icon:disabled { cursor: default; }
.icon-menu { position: absolute; z-index: 30; top: 100%; left: 0; width: min(320px, 90vw); padding: 8px; border: 1px solid color-mix(in srgb, var(--sub) 30%, transparent); border-radius: 8px; background: var(--paper, #fff); box-shadow: 0 8px 24px rgba(0,0,0,.14); }
.icon-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; }
.icon-grid button { font-size: 1.3rem; background: transparent; border: 0; border-radius: 4px; padding: 4px; cursor: pointer; }
.icon-grid button:hover { background: color-mix(in srgb, var(--sub) 16%, transparent); }
.icon-input { width: 100%; margin-top: 6px; box-sizing: border-box; }
.icon-clear { margin-top: 6px; width: 100%; }
.tree-icon { flex: none; width: 1.4em; text-align: center; font-size: 14px; }

/* 2026-11-25 한윤태님: 편집 중이 아닌 블록의 글 서식(굵게·기울임·코드·취소선) 읽기 모양. */
.block-render { white-space: pre-wrap; overflow-wrap: anywhere; cursor: text; min-height: 1.6em; }
.block-text.render-hidden { display: none; }
.block-render .fx-b { font-weight: 700; }
.block-render .fx-i { font-style: italic; }
.block-render .fx-s { text-decoration: line-through; }
.block-render .fx-c { font-family: var(--code-font, "D2Coding", ui-monospace, monospace); background: color-mix(in srgb, var(--sub) 16%, transparent); border-radius: 3px; padding: 0 .25em; font-size: .92em; }
.mark-btn { min-width: 2em; }
.mark-btn:nth-of-type(1) { font-weight: 700; }
.block-render a.fx-l { color: var(--link, #2383e2); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.block-row { position: relative; }
.link-pop { position: absolute; z-index: 30; left: 28px; top: 100%; display: flex; gap: 6px; padding: 6px; border: 1px solid color-mix(in srgb, var(--sub) 30%, transparent); border-radius: 8px; background: var(--paper, #fff); box-shadow: 0 8px 24px rgba(0,0,0,.14); width: min(460px, 92vw); }
.link-input { flex: 1; min-width: 0; }
.login-wait { padding: 24px 16px; color: var(--sub); text-align: center; }
