/* 노션 블록 (노션과 같은 크기·서식) */
.nb { font-size: 16px; line-height: 1.6; color: var(--text); overflow-wrap: anywhere; }
.nb p { margin: 2px 0; min-height: 1.6em; }
.nb h1 { font-size: 1.875em; font-weight: 700; margin: 1.1em 0 .2em; line-height: 1.3; }
.nb h2 { font-size: 1.5em; font-weight: 700; margin: 1em 0 .15em; line-height: 1.3; }
.nb h3 { font-size: 1.25em; font-weight: 700; margin: .9em 0 .1em; line-height: 1.3; }
.nb ul, .nb ol { margin: 2px 0; padding-left: 1.6em; }
.nb li { margin: 2px 0; padding-left: 2px; }
.nb li > .kids { margin-top: 2px; }
.nb .todo { display: flex; gap: 8px; align-items: flex-start; margin: 2px 0; }
.nb .todo .box { width: 16px; height: 16px; border: 1.5px solid var(--muted); border-radius: 3px; margin-top: 4px; flex: none; display: grid; place-items: center; font-size: 11px; color: #fff; }
.nb .todo.done .box { background: #2383e2; border-color: #2383e2; }
.nb .todo.done .tx { text-decoration: line-through; color: var(--faint); }
.nb blockquote { border-left: 3px solid currentColor; margin: 6px 0; padding: 2px 14px; font-size: 1em; }
.nb .callout { display: flex; gap: 10px; padding: 14px 16px; border-radius: 6px; background: var(--surface-2); margin: 6px 0; }
.nb .callout .ci { font-size: 1.2em; line-height: 1.4; }
.nb hr { border: 0; border-top: 1px solid var(--line-2); margin: 14px 0; }
.nb pre { background: var(--surface-2); border-radius: 6px; padding: 14px 16px; font-family: var(--mono); font-size: 13.5px; line-height: 1.55; overflow-x: auto; white-space: pre; margin: 6px 0; }
.nb pre .lang { display: block; font-family: var(--font); font-size: 11px; color: var(--faint); margin-bottom: 6px; }
.nb code { font-family: var(--mono); font-size: .85em; background: rgba(135,131,120,.15); color: #eb5757; border-radius: 4px; padding: .1em .35em; }
.nb pre code { background: none; color: inherit; padding: 0; font-size: inherit; }
.nb a { color: inherit; text-decoration: underline; text-decoration-color: var(--faint); text-underline-offset: 2px; }
.nb details { margin: 2px 0; } .nb details > summary { cursor: pointer; list-style: none; display: flex; gap: 6px; align-items: baseline; }
.nb details > summary::before { content: "▸"; color: var(--muted); font-size: .85em; transition: transform .15s; display: inline-block; }
.nb details[open] > summary::before { transform: rotate(90deg); }
.nb details > .kids { padding-left: 1.4em; }
.nb details > summary h1, .nb details > summary h2, .nb details > summary h3 { margin: .4em 0; display: inline; }
.nb figure { margin: 10px 0; } .nb figure img { max-width: 100%; border-radius: 4px; display: block; } .nb figcaption { font-size: 13px; color: var(--muted); margin-top: 4px; }
.nb .link-card { display: flex; gap: 8px; align-items: center; border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; margin: 6px 0; text-decoration: none; font-size: 14px; }
.nb .link-card:hover { background: var(--surface-2); }
.nb table { border-collapse: collapse; margin: 8px 0; font-size: 14px; width: 100%; }
.nb td, .nb th { border: 1px solid var(--line-2); padding: 6px 9px; vertical-align: top; text-align: left; }
.nb th { background: var(--surface-2); font-weight: 600; }
.nb .cols { display: flex; gap: 24px; } .nb .cols > div { flex: 1; min-width: 0; }
.nb .sub-page { display: flex; gap: 6px; align-items: center; padding: 3px 2px; font-weight: 600; text-decoration: underline; text-decoration-color: var(--line-2); }
.nb .unsupported { color: var(--faint); font-size: 13px; }
/* 노션 글자색 / 배경색 */
.nc-gray { color: #787774; } .nc-brown { color: #9f6b53; } .nc-orange { color: #d9730d; } .nc-yellow { color: #cb912f; } .nc-green { color: #448361; } .nc-blue { color: #337ea9; } .nc-purple { color: #9065b0; } .nc-pink { color: #c14c8a; } .nc-red { color: #d44c47; }
.nc-gray_background { background: #f1f1ef; } .nc-brown_background { background: #f4eeee; } .nc-orange_background { background: #fbecdd; } .nc-yellow_background { background: #fbf3db; } .nc-green_background { background: #edf3ec; } .nc-blue_background { background: #e7f3f8; } .nc-purple_background { background: rgba(244,240,247,.8); } .nc-pink_background { background: rgba(249,238,243,.8); } .nc-red_background { background: #fdebec; }
:root[data-theme="dark"] .nc-gray { color: #9b9b9b; } :root[data-theme="dark"] .nc-brown { color: #ba856f; } :root[data-theme="dark"] .nc-orange { color: #c77d48; } :root[data-theme="dark"] .nc-yellow { color: #ca9849; } :root[data-theme="dark"] .nc-green { color: #529e72; } :root[data-theme="dark"] .nc-blue { color: #5e87c9; } :root[data-theme="dark"] .nc-purple { color: #9d68d3; } :root[data-theme="dark"] .nc-pink { color: #d15796; } :root[data-theme="dark"] .nc-red { color: #df5452; }
:root[data-theme="dark"] .nc-gray_background { background: #2f2f2f; } :root[data-theme="dark"] .nc-brown_background { background: #4a3228; } :root[data-theme="dark"] .nc-orange_background { background: #5c3b23; } :root[data-theme="dark"] .nc-yellow_background { background: #564328; } :root[data-theme="dark"] .nc-green_background { background: #243d30; } :root[data-theme="dark"] .nc-blue_background { background: #143a4e; } :root[data-theme="dark"] .nc-purple_background { background: #3c2d49; } :root[data-theme="dark"] .nc-pink_background { background: #4e2c3c; } :root[data-theme="dark"] .nc-red_background { background: #522e2a; }
.nb .callout.nc-default { background: var(--surface-2); }

/* 보기 화면 체크박스: 눌러서 체크 */
.nb .todo .box[data-todo] { cursor: pointer; } .nb .todo .box[data-todo]:hover { border-color: #2383e2; }
/* 코드 블록: 언어 자동 인식 + 색 구분 */
.nb pre.hl { position: relative; }
.nb pre .copy-code { position: absolute; top: 8px; right: 8px; color: var(--faint); padding: 4px; border-radius: 6px; opacity: 0; } .nb pre:hover .copy-code { opacity: 1; } .nb pre .copy-code:hover { background: var(--line); color: var(--text); }
.tk-kw { color: #c0392b; font-weight: 600; } .tk-str { color: #2f7d4f; } .tk-num { color: #b0571a; } .tk-com { color: #8c8a84; font-style: italic; } .tk-fn { color: #2c64b5; }
:root[data-theme="dark"] .tk-kw { color: #ff8a7a; } :root[data-theme="dark"] .tk-str { color: #8fd19e; } :root[data-theme="dark"] .tk-num { color: #f0b37e; } :root[data-theme="dark"] .tk-com { color: #7d7d7d; } :root[data-theme="dark"] .tk-fn { color: #82aaff; }

/* 노션식 블록 편집기 */
.de { margin-top: 6px; }
.de-tools { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; position: sticky; top: 0; z-index: 3; background: var(--bg); padding: 6px 0; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.de-tools button { font-size: 12.5px; padding: 4px 8px; border-radius: 6px; color: var(--muted); border: 1px solid var(--line); }
.de-tools button:hover { background: var(--panel); color: var(--text); }
.de-tools .faint { font-size: 11.5px; margin-left: 6px; }
/* 글자색·배경색 메뉴 (도구 줄은 가로 스크롤이라 body 에 고정 위치로 띄움) */
.de-colors { position: fixed; z-index: 80; min-width: 170px; overflow-y: auto; display: flex; flex-direction: column; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r, 12px); box-shadow: var(--shadow-lg); }
.de-colors .ph { font-size: 11.5px; font-weight: 700; color: var(--muted); padding: 8px 8px 4px; }
.de-colors button { display: flex; align-items: center; gap: 10px; padding: 5px 8px; border-radius: 8px; font-size: 13px; color: var(--text); text-align: left; }
.de-colors button:hover, .de-colors button:focus-visible { background: var(--surface-2); }
.de-colors .sw { width: 22px; height: 22px; flex: none; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 6px; font-weight: 700; }
/* 노션은 글자 하나에 색 하나(안쪽 색이 저장됨) → 편집 중에도 바깥 색이 비쳐 보이지 않게 */
.de [contenteditable] .nc-default { color: var(--text); background: var(--doc-bg); }
.de [contenteditable] [class*="_background"] { color: var(--text); }
.de [contenteditable] [class*="nc-"]:not([class*="_background"]) { background: var(--doc-bg); }
.de-body { font-size: 16px; line-height: 1.6; min-height: 200px; padding-bottom: 60px; cursor: text; }
.de-row { position: relative; display: flex; align-items: flex-start; gap: 6px; padding-left: calc(var(--lv, 0) * 1.6em); border-radius: 4px; }
.de-row:hover > .de-del { opacity: 1; }
.de-del { position: absolute; left: auto; right: 2px; top: 3px; width: 22px; height: 22px; border-radius: 5px; color: var(--faint); opacity: .55; font-size: 15px; line-height: 1; background: var(--surface); } /* 블록 안쪽 오른쪽 위 — 업무 창에서 왼쪽 바깥은 잘려 보이지 않았음 */
.de-code .de-code-h { padding-right: 10px; } .de-row:has(.de-code) > .de-del { display: none; } /* 코드 블록은 머리글의 [삭제] */
.de-code-del { margin-left: auto; flex: none; white-space: nowrap; padding: 2px 9px; border-radius: 6px; font-size: 12px; color: var(--muted); border: 1px solid var(--line-2); background: var(--surface); } .de-code-del:hover { color: #d93025; border-color: #d93025; }
.de-del:hover { background: var(--panel); color: var(--text); }
.de-txt { flex: 1; min-width: 0; outline: none; padding: 3px 2px; min-height: 1.6em; white-space: pre-wrap; overflow-wrap: anywhere; }
.de-txt:empty::before { content: attr(data-ph); color: var(--faint); pointer-events: none; }
.de-txt:not(.cur):empty::before { content: ""; } /* 본문 전체가 한 입력 영역 → 커서 줄(.cur)에만 안내 문구 */
.de-body:focus { outline: none; }
.de-row:only-child .de-txt:empty::before, .de-row:last-child .de-txt:empty::before { content: attr(data-ph); }
.de-txt code { font-family: var(--mono); font-size: .85em; background: rgba(135,131,120,.15); color: #eb5757; border-radius: 4px; padding: .1em .35em; }
.de-txt a { color: inherit; text-decoration: underline; }
.t-heading_1 .de-txt { font-size: 1.875em; font-weight: 700; line-height: 1.3; margin-top: .6em; }
.t-heading_2 .de-txt { font-size: 1.5em; font-weight: 700; line-height: 1.3; margin-top: .5em; }
.t-heading_3 .de-txt { font-size: 1.25em; font-weight: 700; line-height: 1.3; margin-top: .4em; }
.t-quote .de-txt { border-left: 3px solid currentColor; padding-left: 14px; }
.de-pre { flex: none; width: 1.4em; text-align: center; padding-top: 3px; user-select: none; color: var(--text); }
.de-pre.num { width: auto; min-width: 1.4em; font-variant-numeric: tabular-nums; }
.de-chk { display: inline-grid; place-items: center; width: 16px; height: 16px; border: 1.5px solid var(--muted); border-radius: 3px; font-size: 11px; color: #fff; cursor: pointer; vertical-align: -2px; }
.de-chk:hover { border-color: #2383e2; } .de-chk.on { background: #2383e2; border-color: #2383e2; }
.de-row.checked .de-txt { text-decoration: line-through; color: var(--faint); }
.de-hr { flex: 1; padding: 8px 0; outline: none; } .de-hr hr { border: 0; border-top: 1px solid var(--line-2); margin: 0; } .de-hr:focus hr { border-top-color: #2383e2; }
.de-code { flex: 1; min-width: 0; background: var(--surface-2); border-radius: 6px; margin: 4px 0; border: 1px solid var(--line); }
.de-code-h { display: flex; align-items: center; gap: 8px; padding: 6px 10px 0; font-size: 12px; }
.de-code-h select { padding: 2px 6px; font-size: 12px; border-radius: 6px; background: transparent; }
.de-code-b { position: relative; }
.de-code-b pre, .de-code-b textarea { margin: 0; padding: 10px 14px 14px; font-family: var(--mono); font-size: 13.5px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-all; tab-size: 2; overflow: hidden; border: 0; border-radius: 0 0 6px 6px; }
.de-code-b pre { position: absolute; inset: 0; pointer-events: none; color: var(--text); background: none; }
.de-code-b textarea { position: relative; display: block; width: 100%; resize: none; background: transparent; color: transparent; caret-color: var(--text); min-height: 3.2em; }
.de-code-b textarea::placeholder { color: var(--faint); }
.de-code-b textarea:focus { border: 0; }
.de-code-b textarea::selection { background: rgba(35,131,226,.25); color: transparent; }
.de-img { margin: 6px 0; flex: 1; } .de-img img { max-width: 100%; border-radius: 4px; display: block; min-height: 40px; background: var(--panel); }
.de-file { flex: 1; border: 1px solid var(--line); border-radius: 6px; padding: 9px 12px; font-size: 14px; margin: 4px 0; }
.de-up { position: absolute; left: 8px; top: 8px; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 3px 8px; font-size: 12px; display: flex; gap: 6px; align-items: center; }
.de-up.err { color: #d44c47; position: static; margin: 4px 0; }
.de-row.locked { opacity: .92; } .de-lock { flex: 1; min-width: 0; }
.de-lock-tag { position: absolute; right: 0; top: 2px; font-size: 10.5px; color: var(--faint); border: 1px solid var(--line); border-radius: 5px; padding: 0 5px; opacity: 0; } .de-row.locked:hover .de-lock-tag { opacity: 1; }
.de-slash { max-height: 300px; overflow-y: auto; } .de-slash .ph { font-size: 11px; color: var(--faint); padding: 4px 10px 2px; }
.draft-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
@media (max-width: 900px) { .de-del { left: auto; right: 0; } }
/* 임시저장 상태: 편집 화면 아래쪽에 고정 */
.draft-st { position: sticky; bottom: 12px; margin: 18px 0 0 auto; width: max-content; max-width: 100%; font-size: 12px; color: var(--faint); background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; box-shadow: var(--shadow); z-index: 4; }
.draft-st.on { color: var(--muted); } .draft-st.on::before { content: "●"; color: var(--ok); margin-right: 6px; font-size: 9px; vertical-align: 1px; }

.de-code-h select {color:var(--text)}
.project-doc {border:1px solid var(--line);border-radius:10px;padding:12px 18px;min-height:180px;max-height:52vh;overflow:auto;resize:vertical;}
.project-doc .de-body {font-size:14px;padding-bottom:20px;min-height:130px;}
.doc-status {font-size:12px;color:var(--muted);margin:6px 0;}
@media(max-width:640px){.project-doc{max-height:none;resize:none}.de-tools .faint{display:none}}

/* Shared writing surface: modal and toolbar use the same theme color. */
.de { --doc-bg:var(--bg); }
.modal .de { --doc-bg:var(--surface); }
.de-tools { flex-wrap:nowrap;gap:3px;background:var(--doc-bg);overflow-x:auto;scrollbar-width:thin;padding:7px 0;margin-bottom:0; }
.de-tools button { flex:0 0 auto;white-space:nowrap;padding:5px 6px;font-size:12px; }
.de-hint { font-size:11px;line-height:1.6;padding:6px 0 12px; }
.project-doc { background:var(--surface);max-height:68vh;min-height:420px; }
.project-doc .de-body { min-height:320px;font-size:15px; }
.doc-actions { display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin-bottom:9px; }
.doc-actions .faint { font-size:11px; }
.modal.doc-focused { width:calc(100vw - 24px)!important;height:calc(100dvh - 24px);max-height:calc(100dvh - 24px); }
.modal.doc-focused .modal-b { flex:1;min-height:0;display:flex;flex-direction:column; }
.modal.doc-focused .editor-grid { display:block!important;flex:1;min-height:0; }
.modal.doc-focused .ed-main { height:100%;padding:0; }
.modal.doc-focused .ed-side,.modal.doc-focused .log-col,.modal.doc-focused .ed-author,.modal.doc-focused .ed-src { display:none; }
.modal.doc-focused .ed-content { flex:1;min-height:0;display:flex;flex-direction:column; }
.modal.doc-focused .project-doc { flex:1;min-height:0;max-height:none;height:100%;resize:none; }
.modal.doc-focused .project-doc .de-body { min-height:55vh; }
.modal.doc-focused .doc-active { max-height:none; }
@media(max-width:640px){ .project-doc { min-height:360px;max-height:none; }.de-hint { display:none; }.modal.doc-focused { width:100vw!important;height:100dvh;max-height:100dvh; } }

/* Avoid a second scroll container and fixed 420px editor inside task dialogs. */
.task-editor .project-doc { min-height:clamp(180px,34dvh,420px);max-height:none;overflow:visible;resize:none;padding:10px 12px; }
.task-editor .project-doc .de-body { min-height:clamp(90px,20dvh,260px); }
.task-editor.doc-focused .task-editor-tabs { display:none; }
.task-editor.doc-focused .editor-grid > .ed-main { overflow:hidden; }
.task-editor.doc-focused .ed-content { flex:1; }
.task-editor.doc-focused .project-doc { min-height:0;overflow:auto; }
.task-editor.doc-focused .project-doc .de-body { min-height:clamp(90px,26dvh,320px); }

/* Media removal stays inside the editor, clear of clipping and attachment names. */
.de-row.de-media{padding-top:34px;min-width:0}
.de-row.de-media>.de-del{left:auto;right:4px;top:2px;width:28px;height:28px;display:grid;place-items:center;opacity:1;color:#d93025;background:var(--surface,var(--bg));border:1px solid #d9302560;box-shadow:0 1px 4px #0002;font-size:24px;font-weight:700;z-index:5;cursor:pointer}
.de-row.de-media>.de-del:hover{color:#d93025;background:#d930251a;border-color:#d93025}
.de-row.de-media>.de-del:focus-visible{outline:2px solid #d93025;outline-offset:2px}
.de-row.de-media>.de-lock-tag{right:42px;top:6px}
.de-row.de-media>.de-up{top:4px;max-width:calc(100% - 50px)}
.de-media .de-file{overflow-wrap:anywhere;min-width:0}
@media(pointer:coarse){.de-row.de-media{padding-top:42px}.de-row.de-media>.de-del{width:36px;height:36px}}

/* 링크: 편집 중에도 누르면 열림 · 문서 링크(다른 업무·노트)는 📄 표시 · 문서 링크 고르기 창 */
.de-txt a { cursor: pointer; text-decoration-color: var(--faint); text-underline-offset: 2px; } .de-txt a:hover, .nb a:hover { text-decoration-color: currentColor; }
.de-txt a[href*="?open="], .de-txt a[href*="/records?"], .nb a[href*="?open="], .nb a[href*="/records?"] { text-decoration: none; border-bottom: 1px solid var(--line-2); font-weight: 600; }
.de-txt a[href*="?open="]::before, .de-txt a[href*="/records?"]::before, .nb a[href*="?open="]::before, .nb a[href*="/records?"]::before { content: "📄"; font-size: .85em; margin-right: 3px; font-weight: 400; }
.de-docpick { width: min(380px, calc(100vw - 16px)); padding: 6px; display: flex; flex-direction: column; gap: 4px; }
.de-docpick input { height: 34px; font-size: 13px; }
.de-docpick .dp-list { max-height: 260px; overflow-y: auto; } .de-docpick .ph { font-size: 12px; color: var(--faint); padding: 8px; }
.de-docpick .sg-it { display: flex; align-items: baseline; gap: 8px; } .de-docpick .dp-t { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .de-docpick .dp-s { flex: none; font-size: 11.5px; color: var(--faint); }
.de-docpick .dp-foot { font-size: 11px; padding: 2px 6px; }
