input, textarea, select,
[contenteditable="true"],
.dynamic-area, #docContent,
.note-doc-content, .mbb-single-ta,
.mbb-fw-content-input, .mbb-fw-label-input, .mbb-title-edit,
.editable-text, .doc-table td, .doc-table th, .doc-copy-box-editor {
    caret-color: auto !important;
    user-select: text; -webkit-user-select: text;
}

.nc-text-inner[contenteditable="true"] {
    caret-color: auto !important;
    user-select: text; -webkit-user-select: text;
}

body { caret-color: transparent; }
button, .btn, a, nav, header, .app-header, .app-tab, .app-logo,
.app-header-right, .ps-view-btn,
.ps-sub-tab, .ps-breadcrumb, .category-tab, .ps-section-title,
.section-title, .mbb-header, .mbb-drag-handle, .mbb-collapse-btn,
.mbb-copy-btn, .note-editor-topbar, .note-back-btn, .note-save-status,
.note-zoom-indicator, .tag-item, label, .note-card, .note-card-title,
.note-card-desc, .note-card-meta, .note-mode-opt, .note-group-chip,
.note-view-btn, .ps-tab-pill, .ps-tab-pill-btn, .nt-toolbar, .nt-btn,
.delete-badge, .dt-handle, .dt-table-ctrl, .doc-img-move-handle,
.nc-set-bgopt, .nc-set-name, .nc-set-label, .nc-group-bbox,
.note-canvas-hint, .doc-copy-box-handle, .doc-copy-box-copy, .doc-copy-box-more {
    caret-color: transparent;
    user-select: none; -webkit-user-select: none;
}

* { caret-color: transparent; }
input, textarea, [contenteditable="true"], [contenteditable="true"] *, .dynamic-area,
.nc-text-inner, #docContent, .note-doc-content, .note-doc-content *, .doc-copy-box-editor, .doc-copy-box-editor * {
    caret-color: var(--text-main) !important;
}

button, .btn, .app-header, .app-tab, .app-logo, .app-header-right,
.nt-toolbar, .nt-btn,
.ps-view-btn, .ps-sub-tab, .ps-breadcrumb, .ps-crumb-link,
.ps-crumb-sep, .ps-crumb-current, .category-tab, .controls-panel,
.ps-section-title, .section-title, .mbb-header, .mbb-drag-handle,
.mbb-collapse-btn, .note-editor-topbar, .note-back-btn,
.note-save-status, .note-zoom-indicator, .nc-group-bbox,
.tag-item, label, .ps-enc-navitem, .enc-section-label,
.enc-nav-item, .enc-folder-item, .enc-opts-item,
.note-card, .note-card-title, .note-card-desc, .note-card-meta,
.note-mode-opt, .note-group-chip, .note-view-btn,
.category-tab span:not([contenteditable="true"]),
.ps-tab-pill, .ps-tab-pill-btn, .ps-lang-btn, .ps-lang-toggle,
.nc-set-bgopt, .nc-set-name, .nc-set-label,
.note-canvas-hint, .mbb-label, nav, header,
.delete-badge,
.ps-enc-navitem, .ps-enc-cat-name, .ps-enc-sub-name,
.ps-enc-prompt-chip, .note-group-filter, .note-group-chip {
    user-select: none;
    -webkit-user-select: none;
}

textarea, input, select, [contenteditable="true"],
.dynamic-area, #docContent,
.editable-text, .reorder-chip-area, .doc-copy-box-editor {
    user-select: text;
    -webkit-user-select: text;
}

html { font-size: 90%; }

* { scrollbar-width: thin; scrollbar-color: #555 transparent; }
*::-webkit-scrollbar { width: 5px; height: 5px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: #888; border-radius: 4px; }
*::-webkit-scrollbar-thumb:hover { background: #aaa; }

.panel { overflow: visible !important; }

:root {

    --bg-color: #fbf9f4; --surface-color: #fffefb; --text-main: #33302a;
    --text-muted: #938f84; --border-color: #eae6db; --accent-color: #e5623f;
    --accent-hover: #fbe9e2; --danger-color: #c0492e; --font-medium: 500;
    --font-bold: 600; --transition: all 0.2s ease;
    --shadow-md: 0 8px 24px rgba(51,48,42,0.06);
    --shadow-lg: 0 16px 44px rgba(51,48,42,0.10);
    --surface-2: #f6f3ea; --text-faint: #b3aea1;
    --accent-strong: #d4522f; --accent-ink: #a8492c;
    --accent-shadow: rgba(229,98,63,0.25);
    --danger-soft: #fce8e4; --success-color: #3d8b4f; --success-soft: #e4f2e6;
    --canvas-bg: #e0e4f5; --canvas-text: #3d4578;
    --doc-bg: #f5ecd4; --doc-text: #7a6528;
    --param-bg: #eceefb; --param-text: #4a54b8;
    --shadow-popup: 0 20px 50px rgba(51,48,42,0.18);
    --accent-press: #be4a2a;
    --fs-caption: 12px; --fs-small: 13px; --fs-body: 14px;
    --fs-reading: 16px; --fs-subtitle: 18px; --fs-title: 23px;
    --r-swatch: 5px; --r-btn: 8px; --r-menu: 10px; --r-card: 12px; --r-modal: 14px;
}

[data-theme="dark"] {
    --bg-color: #161617; --surface-color: #1e1e20; --text-main: #ededee;
    --text-muted: #9a9a9e; --border-color: #333335; --accent-color: #8087ef;
    --accent-hover: #2a2c3f; --danger-color: #e07a5f;
    --shadow-md: 0 8px 24px rgba(0,0,0,0.25);
    --shadow-lg: 0 16px 44px rgba(0,0,0,0.35);
    --surface-2: #282829; --text-faint: #646468;
    --accent-strong: #9198f5; --accent-ink: #aeb4f7;
    --accent-shadow: rgba(128,135,239,0.28);
    --danger-soft: #3a2521; --success-color: #7ec18a; --success-soft: #233028;
    --canvas-bg: #2c2f52; --canvas-text: #aab2f5;
    --doc-bg: #3a3425; --doc-text: #d4c48a;
    --param-bg: #2c2f52; --param-text: #aab2f5;
    --shadow-popup: 0 20px 50px rgba(0,0,0,0.5);
    --accent-press: #6f76d8;
}

body {
    background-color: var(--bg-color); color: var(--text-main);
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, sans-serif;
    margin: 0; padding: 0; transition: var(--transition);
    -webkit-font-smoothing: antialiased;
    letter-spacing: -0.006em;
}

header { display: flex; justify-content: space-between; align-items: center; max-width: 1200px; margin: 0 auto 1.5rem; }
h1 { font-weight: var(--font-bold); font-size: 23px; margin: 0; }
b, strong { font-weight: 600; }

.btn {
    background: var(--surface-color); color: var(--text-main); border: 1px solid var(--border-color);
    padding: 10px 18px; border-radius: 8px; cursor: pointer;
    font: inherit; font-size: 13px; font-weight: 500; transition: all .15s ease;
}
.btn:hover { background: var(--surface-2); border-color: var(--text-faint); }
.btn:disabled { opacity: .35; cursor: not-allowed; }
.btn-primary { background: var(--accent-color); color: #ffffff; border: none; box-shadow: 0 2px 8px var(--accent-shadow); }
.btn-primary:hover { background: var(--accent-strong); box-shadow: 0 4px 14px var(--accent-shadow); transform: translateY(-1px); }
.btn-primary:active { background: var(--accent-press); box-shadow: 0 1px 4px var(--accent-shadow); transform: translateY(1px); }
.btn-danger { background: var(--danger-color); color: #fff; border: none; }
.btn-small { padding: 7px 13px; font-size: 12px; border-radius: 7px; white-space: nowrap; }

.container { max-width: 1200px; margin: 0 auto; display: grid; gap: 2rem; }

.controls-panel {
    background: var(--surface-color); border: 1px solid var(--border-color); border-radius: 12px;
    padding: 1rem 1.5rem; display: flex; flex-wrap: wrap; gap: 2rem; align-items: center;
}
.control-group { display: flex; align-items: center; gap: 1rem; }
.control-label { font-weight: var(--font-bold); color: var(--text-muted); font-size: 16px; }
.toggle-group { display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--bg-color); border-radius: 8px; padding: 0.25rem; border: 1px solid var(--border-color); }
.btn-toggle {
    background: transparent; border: none; padding: 0.4rem 1rem; border-radius: 6px; cursor: pointer;
    color: var(--text-muted); font-weight: var(--font-medium); transition: var(--transition); font-size: 14px;
}
.btn-toggle { text-align: center; white-space: nowrap; }
.btn-toggle.active { background: var(--surface-2); color: var(--text-main); font-weight: 600; }

.section-title { font-weight: 600; font-size: 18px; color: var(--text-main); margin: 0 0 0.8rem; letter-spacing: -0.01em; }
.panels-grid { display: grid; gap: 1.5rem; transition: var(--transition); align-items: start; }
.panels-grid.layout-2col { grid-template-columns: 1fr 1fr; }
.panels-grid.layout-1col { grid-template-columns: 1fr; }
@media (max-width: 768px) { .panels-grid.layout-2col { grid-template-columns: 1fr; } }

.panels-grid.layout-image { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; align-items: stretch; }
.panels-grid.layout-image #imagePanelWrapper { grid-column: 1; grid-row: 1 / 3; display: flex; flex-direction: column; min-height: 0; }
.panels-grid.layout-image #imagePanelWrapper .panel { flex: 1; min-height: 0; }
.panels-grid.layout-image > div:not(#imagePanelWrapper) { grid-column: 2; min-height: 0; }
@media (max-width: 768px) {
    .panels-grid.layout-image { grid-template-columns: 1fr; grid-template-rows: none; }
    .panels-grid.layout-image #imagePanelWrapper { grid-column: 1; grid-row: auto; }
    .panels-grid.layout-image > div:not(#imagePanelWrapper) { grid-column: 1; }
}

.panel { background: var(--surface-color); border: 1px solid var(--border-color); border-radius: 12px; padding: 1rem; display: flex; flex-direction: column; }

.image-drop-panel {
    align-items: center; justify-content: center; position: relative; min-height: 240px;
    text-align: center; cursor: pointer; transition: var(--transition); overflow: hidden;
}
.image-drop-panel.dragover { border-color: var(--accent-color); background: var(--accent-hover); }
.image-drop-empty { color: var(--text-muted); font-size: 16px; line-height: 1.7; padding: 1rem; }
#imageCanvas { max-width: 100%; max-height: 100%; border-radius: 8px; cursor: crosshair; }
.picked-colors-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 0.8rem; }
.picked-color-chip {
    display: flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; border-radius: 20px;
    border: 1px solid var(--border-color); background: var(--bg-color); cursor: grab;
    font-family: ui-monospace, 'SF Mono', monospace; font-size: 14px; font-weight: var(--font-bold);
    color: var(--text-main); transition: var(--transition);
}
.picked-color-chip:hover { border-color: var(--accent-color); background: var(--accent-hover); }
.picked-color-chip:active { cursor: grabbing; }
.picked-color-chip .pc-dot { width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--border-color); flex-shrink: 0; }

.dynamic-area {
    width: 100%; box-sizing: border-box; background: transparent; color: var(--text-main);
    border: none; font-family: inherit; font-size: 16px; line-height: 1.8; resize: none; outline: none; min-height: 200px;
    overflow-x: hidden !important; padding-right: 1.5rem;
}
.dynamic-area::placeholder { color: var(--text-muted); opacity: 0.7; }
.dynamic-area.dragover { background-color: var(--accent-hover); border-radius: 8px; }

.reorder-chip-area { display: flex; flex-wrap: wrap; gap: 6px; align-content: flex-start; min-height: 120px; }
.reorder-chip-area:empty::before { content: "순서를 편집할 프롬프트가 없습니다."; color: var(--text-muted); opacity: 0.7; font-size: 16px; }
.reorder-chip.dragging { opacity: 0.35; }
.reorder-chip { padding-right: 1.5rem; }

.reorder-chip.reorder-chip-param {
    color: var(--accent-color); font-weight: var(--font-bold);
    background-color: var(--bg-color); border-color: var(--border-color);
}

/* 칩을 지우는 x — 마우스를 올렸을 때만 나타나고 칩 안쪽에 있어 잘리지 않는다 */
.chunk-del, .reorder-chip-del {
    position: absolute; top: 50%; right: 3px; transform: translateY(-50%);
    width: 15px; height: 15px; border-radius: 50%; border: none; padding: 0;
    background: var(--surface-color); color: var(--text-muted); box-shadow: 0 0 0 1px var(--border-color);
    font-size: 12px; line-height: 1; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none; transition: opacity .12s, background-color .12s, color .12s;
}
.chunk:hover .chunk-del, .reorder-chip:hover .reorder-chip-del { opacity: 1; pointer-events: auto; }
.chunk-del:hover, .reorder-chip-del:hover { background: var(--danger-color); color: #fff; box-shadow: 0 0 0 1px var(--danger-color); }
.btn.btn-small.active { background: var(--accent-color); color: #fff; border-color: var(--accent-color); }

#outputArea:empty::before { content: "영문 프롬프트를 입력하면 칩으로 분리됩니다."; color: var(--text-muted); opacity: 0.7; pointer-events: none; }
.dynamic-area::-webkit-scrollbar { width: 6px; height: 6px; }
.dynamic-area::-webkit-scrollbar-track { background: transparent; }
.dynamic-area::-webkit-scrollbar-thumb { background-color: rgba(156, 163, 175, 0.3); border-radius: 10px; }
.dynamic-area::-webkit-scrollbar-thumb:hover { background-color: rgba(156, 163, 175, 0.6); }

.chunk, .tag-item {
    display: inline-block; padding: 0.4rem 0.6rem; margin: 0.2rem; border-radius: 6px;
    transition: var(--transition); background-color: var(--bg-color); border: 1px solid var(--border-color); font-size: 14px;
    position: relative; max-width: 100%; box-sizing: border-box;
    white-space: normal; word-break: break-word; line-height: 1.4; text-align: left; vertical-align: middle;
}
.chunk { padding-right: 1.5rem; }
.chunk.draggable:hover, .tag-item:hover { background-color: var(--accent-hover) !important; border-color: var(--accent-color) !important; cursor: grab; z-index: 10; }
.chunk.draggable:hover { cursor: grab; }
.chunk.draggable:active, .tag-item.draggable:active { cursor: grabbing; }

.chunk::after {
    content: attr(data-en);
    position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%);
    background: rgba(0,0,0,0.87); color: #fff; padding: 7px 11px; border-radius: 6px;
    font-size: 13px; font-weight: 500; line-height: 1.45; text-align: left;
    width: max-content; min-width: 100px; max-width: 300px;
    white-space: normal; word-break: break-all; box-sizing: border-box;
    pointer-events: none !important;
    opacity: 0; visibility: hidden; z-index: 9999;
    transition: opacity 0.18s ease; box-shadow: 0 4px 10px rgba(0,0,0,0.25);
}
.chunk::before {
    content: ''; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
    border-width: 5px; border-style: solid; border-color: transparent transparent rgba(0,0,0,0.87) transparent;
    pointer-events: none !important;
    opacity: 0; visibility: hidden; z-index: 9999;
    transition: opacity 0.18s ease;
}
.chunk:hover::after, .chunk:hover::before { opacity: 1; visibility: visible; }
.param-chunk { color: var(--accent-color); font-weight: var(--font-bold); border-color: var(--border-color); background-color: var(--bg-color); }
.param-chunk::after, .param-chunk::before { display: none !important; }
.comma { color: var(--text-muted); pointer-events: none; user-select: none; margin-right: 0.3rem; }

#outputArea { overflow: visible; }
body.conv-scroll-mode #outputArea {
    overflow-y: auto !important;
    overflow-x: hidden;
}

#builderContainer {
    order: 1;
    margin-top: 2.5rem;
}
#savedContainer {
    order: 2;
    margin-top: 2.5rem;
}
#bottomPanels.layout-2col #savedContainer { order: 1; }
#bottomPanels.layout-2col #builderContainer { order: 2; }

.category-tabs { display: flex; gap: 0.5rem; flex-wrap: wrap; border-bottom: 1px solid var(--border-color); padding-bottom: 0.8rem; padding-top: 16px; margin-bottom: 1rem; align-items: center; overflow: visible; }
.category-tab { padding: 0.35rem 0.85rem; border-radius: 8px; cursor: pointer; font-weight: 600; font-size: 14px; color: var(--text-muted); transition: var(--transition); border: 1px solid transparent; position: relative; white-space: nowrap; }
.category-tab:hover { background: var(--bg-color); }
.category-tab.active { background: var(--accent-color); color: #fff; font-weight: 600; }
.category-tab.dragover { border-color: var(--accent-color); background: var(--accent-hover); color: var(--accent-color); border-style: dashed; }

.tags-container { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; min-height: 60px; position: relative; }

.tag-item * { pointer-events: none; }
.tag-item.edit-mode * { pointer-events: auto; }

.drop-left { box-shadow: -3px 0 0 0 var(--accent-color) !important; }
.drop-right { box-shadow: 3px 0 0 0 var(--accent-color) !important; }

.tag-item.drag-over-left { box-shadow: -3px 0 0 0 var(--accent-color) !important; }
.tag-item.drag-over-right { box-shadow: 3px 0 0 0 var(--accent-color) !important; }
.drop-top { box-shadow: 0 -3px 0 0 var(--accent-color) !important; border-top-left-radius: 0; border-top-right-radius: 0; }
.drop-bottom { box-shadow: 0 3px 0 0 var(--accent-color) !important; border-bottom-left-radius: 0; border-bottom-right-radius: 0; }

.inline-input-box { display: flex; align-items: center; background: var(--bg-color); border: 1px solid var(--accent-color); border-radius: 6px; padding: 0.2rem 0.4rem; gap: 0.3rem; }
.inline-input-box input { background: transparent; border: none; outline: none; color: var(--text-main); font-size: 14px; width: 120px; }
.inline-input-box button { background: transparent; border: none; color: var(--accent-color); font-weight: bold; cursor: pointer; font-size: 16px; padding: 0 0.2rem; }

.tag-item.edit-mode { cursor: text; position: relative; padding-right: 1.5rem; }
.tag-item.edit-mode:hover { border-color: var(--accent-color); }
.editable-text { outline: none; display: inline-block; min-width: 20px; }

.delete-badge {
    position: absolute; top: -7px; right: -10px; background: #6b7280; color: #ffffff;
    border: none; border-radius: 50%; width: 15px; height: 15px; font-size: 8px; font-weight: bold;
    display: flex; align-items: center; justify-content: center; cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.25); z-index: 20;
    transition: background 0.2s; pointer-events: auto !important; line-height: 1;
    user-select: none; -webkit-user-select: none;
}
.delete-badge:hover { background: #ef4444; }

.tag-item.edit-mode { padding-right: 16px; }

.builder-panel { border: 1px solid var(--border-color); border-radius: 12px; background: var(--surface-color); padding: 14px 16px; transition: border-color .15s, box-shadow .15s; }
.builder-panel:focus-within { border-color: var(--accent-color); box-shadow: 0 0 0 3px var(--accent-hover); }
.builder-panel.dragover { border-color: var(--accent-color); background-color: var(--accent-hover); }

body.conv-scroll-mode #builderAreaSingle,
body.conv-scroll-mode #builderAreaFramework {
    max-height: 200px;
    overflow-y: auto !important;
}
body.conv-scroll-mode #builderReorderArea,
body.conv-scroll-mode #frameworkContainer {
    max-height: none;
}

/* 프로젝트 탭 빌더 창 보기 — 단일창·프레임워크 둘 다 일정 높이를 넘으면 안에서 스크롤 */
.proj-scroll-mode .mbb-body {
    max-height: 260px;
    overflow-y: auto;
}
.proj-scroll-mode .mbb-imgset .mbb-body { max-height: 260px; }

.conv-builder-head { display: flex; align-items: center; gap: 8px; }
.conv-bh-left { flex: 1 1 0; min-width: 0; display: flex; align-items: center; }
.conv-bh-center { flex: 0 0 auto; display: flex; align-items: center; justify-content: center; }
.conv-bh-right { flex: 1 1 0; display: flex; align-items: center; justify-content: flex-end; gap: .5rem; }
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.8rem; flex-wrap: wrap; gap: 1rem; }

.fw-container { display: flex; flex-direction: column; gap: 0; min-height: 60px; padding-top: 6px; }

.mbb-add-fw-btn {
    background: var(--surface-color); border: 1px solid var(--border-color); color: var(--text-muted);
    font-size: 12px; padding: 5px 14px; border-radius: 7px; cursor: pointer; transition: all .15s;
}
.mbb-add-fw-btn:hover { border-color: var(--accent-color); color: var(--accent-color); background: var(--accent-hover); }

.fw-block {
    background: var(--surface-color); border: 1px solid var(--border-color);
    border-radius: 8px; padding: 1.5rem 1rem 1rem 1rem; position: relative;
    transition: box-shadow 0.2s, border 0.2s, padding 0.2s; border-left: 1px solid var(--border-color);
}

.fw-block.active {
    border-left: 4px solid var(--accent-color); padding-left: calc(1rem - 3px); box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.drag-handle {
    position: absolute; top: 4px; left: 50%; transform: translateX(-50%);
    width: 30px; height: 15px; cursor: grab; opacity: 0; transition: opacity 0.2s;
    display: flex; justify-content: center; align-items: center; color: var(--text-muted);
    font-size: 18px; line-height: 1; letter-spacing: -2px; user-select: none;
}
.drag-handle:active { cursor: grabbing; }
.fw-block:hover .drag-handle, .fw-block.active .drag-handle { opacity: 1; }

.fw-delete-badge { position: absolute; top: -8px; right: -8px; display: none; z-index: 30; }
.fw-block.active .fw-delete-badge { display: flex; }

.fw-header { margin-bottom: 0.8rem; border-bottom: 1px solid var(--border-color); padding-bottom: 0.5rem; min-height: 45px;}

.fw-view-mode { display: block; cursor: text; }
.fw-title { font-weight: 600; font-size: 18px; color: var(--text-main); display: block; margin-bottom: 0.2rem; }
.fw-desc { font-weight: 300; font-size: 14px; color: var(--text-muted); display: block; }

.fw-edit-mode { display: none; flex-direction: column; gap: 0.5rem; width: 100%; }
.fw-block.active .fw-view-mode { display: none; }
.fw-block.active .fw-edit-mode { display: flex; }

.fw-input {
    width: 100%; background: transparent; border: none; border-bottom: 1px solid var(--border-color);
    color: var(--text-main); font-family: inherit; padding: 0.2rem 0; outline: none; transition: border-color 0.2s;
}
.fw-input:focus { border-bottom-color: var(--accent-color); }
.fw-input.title-input { font-weight: 600; font-size: 18px; }
.fw-input.desc-input { font-weight: 300; font-size: 14px; }

.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6); display: none; justify-content: center; align-items: center; z-index: 9999;
    caret-color: transparent;
}
.modal-box {
    background: var(--surface-color); padding: 1.5rem 2rem; border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5); text-align: center; border: 1px solid var(--border-color);
    min-width: 300px; max-width: 400px; animation: fadeIn 0.2s ease-out;
    caret-color: transparent;
}
@keyframes fadeIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }
.modal-box p { margin: 0 0 1.5rem 0; font-weight: var(--font-medium); color: var(--text-main); font-size: 16px; word-break: keep-all;}
.modal-actions { display: flex; justify-content: center; gap: 0.8rem; }
.modal-input {
    width: 100%; box-sizing: border-box; margin: -0.4rem 0 1.3rem; padding: 10px 12px;
    background: var(--bg-color); border: 1px solid var(--border-color); border-radius: 9px;
    color: var(--text-main); font: inherit; font-size: 14px; outline: none; transition: border-color .15s;
}
.modal-input:focus { border-color: var(--accent-color); box-shadow: 0 0 0 3px var(--accent-hover); }

.reorder-comma { color: var(--text-muted); font-size: 14px; line-height: 1; display: flex; align-items: center; user-select: none; padding: 0 1px; }

@keyframes insertFlash {
    0% { box-shadow: inset 0 0 0 2px var(--accent-color); background-color: var(--accent-hover); }
    100% { box-shadow: inset 0 0 0 2px transparent; background-color: transparent; }
}
.insert-flash { animation: insertFlash 0.6s ease-out; border-radius: 8px; }

.color-tool-v2 { display: flex; flex-direction: column; gap: 10px; }

.sv-picker {
    position: relative; width: 100%; height: 130px; border-radius: 10px; cursor: crosshair;
    border: 1px solid var(--border-color); overflow: hidden; touch-action: none; user-select: none;
    background-color: hsl(230, 90%, 60%);
    background-image: linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, transparent);
    background-blend-mode: multiply, normal;
}
.sv-cursor {
    position: absolute; width: 14px; height: 14px; border: 2px solid #fff; border-radius: 50%;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.35), 0 1px 3px rgba(0,0,0,0.35);
    transform: translate(-50%, -50%); pointer-events: none;
}
.hue-slider {
    position: relative; width: 100%; height: 12px; border-radius: 6px; cursor: pointer;
    touch-action: none; user-select: none;
    background: linear-gradient(to right, #f00 0%, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);
}
.hue-cursor {
    position: absolute; top: 50%; width: 16px; height: 16px; border: 2px solid #fff; border-radius: 50%;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.35), 0 1px 3px rgba(0,0,0,0.35);
    transform: translate(-50%, -50%); pointer-events: none;
}

.hex-row { display: flex; align-items: center; gap: 6px; }
.hex-preview {
    width: 36px; height: 36px; flex-shrink: 0; border-radius: 10px; border: 1px solid var(--border-color);
    cursor: grab; transition: var(--transition);
}
.hex-preview:hover { transform: scale(1.05); }
.hex-preview:active { cursor: grabbing; }
.hex-input-wrap {
    flex: 1; display: flex; align-items: center; gap: 1px; background: var(--bg-color);
    border: 1px solid var(--border-color); border-radius: 10px; padding: 0 10px; height: 36px;
    font-family: ui-monospace, 'SF Mono', 'Roboto Mono', monospace; font-weight: var(--font-bold);
    color: var(--text-muted); font-size: 16px;
}
.hex-input-wrap input {
    border: none; background: transparent; color: var(--text-main); font: inherit;
    width: 100%; outline: none; letter-spacing: 0.03em; text-transform: uppercase;
}

.bookmark-strip { display: flex; align-items: center; gap: 5px; flex-wrap: nowrap; overflow-x: auto; padding: 4px 2px 8px 2px; }
.bookmark-strip::-webkit-scrollbar { height: 3px; }
.bookmark-strip::-webkit-scrollbar-track { background: transparent; }
.bookmark-strip::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 2px; }
.bm-swatch {
    width: 28px; height: 28px; border-radius: 8px; flex-shrink: 0; border: 2px solid transparent;
    cursor: pointer; transition: var(--transition); position: relative;
    box-shadow: 0 0 0 1px var(--border-color);
}
.bm-swatch:hover { transform: scale(1.1); border-color: var(--accent-color); }
.bm-swatch.active-bm { border-color: var(--accent-color); }
.bm-swatch .bm-del {
    position: absolute; top: -6px; right: -6px; width: 14px; height: 14px; border-radius: 50%;
    background: var(--danger-color); color: #fff; font-size: 10px; line-height: 14px; text-align: center;
    opacity: 0; transition: opacity 0.15s; cursor: pointer; pointer-events: none;
}
.bm-swatch:hover .bm-del { opacity: 1; pointer-events: auto; }

.ps-page {
    max-width: 1200px; margin: 0 auto;
    padding: var(--tab-top-gap) 2rem 6rem; box-sizing: border-box;
}

.conv-page-wrap {
    max-width: 1200px; margin: 0 auto;
    padding: var(--tab-top-gap) 2rem 6rem; box-sizing: border-box;
}

.ps-breadcrumb {
    display: flex; align-items: center; gap: 7px;
    background: var(--surface-color); border: 1px solid var(--border-color);
    border-radius: 9px; padding: 7px 14px;
    font-size: 13px; color: var(--text-muted);
}
.ps-crumb-link { cursor: pointer; transition: color .15s; }
.ps-crumb-link:hover { color: var(--accent-color); }
.ps-crumb-sep { color: var(--border-color); }
.ps-crumb-current { color: var(--text-main); font-weight: 600; }

.ps-sub-tabs { display: flex; gap: 6px; margin-left: auto; }
.ps-sub-tab {
    display: flex; align-items: center; gap: 6px;
    padding: 7px 14px; border-radius: 9px;
    border: 1px solid var(--border-color); background: var(--surface-color);
    color: var(--text-muted); cursor: pointer; font-size: 13px; font-weight: 600;
    transition: all .15s;
}
.ps-sub-tab:hover { color: var(--text-main); }
.ps-sub-tab.active {
    background: var(--accent-color); color: #fff; border-color: var(--accent-color);
}

/* 보기 바는 모든 탭에서 같은 자리 — 위 여백은 앞 줄(브레드크럼/페이지 패딩)이 만든다 */
.ps-view-bar {
    display: flex; gap: 8px; margin-bottom: 2.5rem;
    margin-top: 0;
    border-bottom: 1px solid var(--border-color); padding-bottom: .75rem;
    flex-wrap: wrap; align-items: center;
}

.ps-view-sep {
    width: 1px; height: 20px; background: var(--border-color); margin: 0 4px; flex-shrink: 0;
}
.ps-view-label {
    font-size: 12px; font-weight: 600; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: .06em; padding: 0 4px 0 6px; white-space: nowrap;
}
.ps-view-btn {
    display: flex; align-items: center; gap: 6px;
    padding: 5px 12px; border-radius: 7px;
    border: 1px solid var(--border-color); background: transparent;
    color: var(--text-muted); cursor: pointer; font-size: 13px; font-weight: 600;
    transition: all .15s;
}
.ps-view-btn:hover { color: var(--text-main); background: var(--bg-color); }
.ps-view-btn.active {
    background: var(--surface-color); color: var(--text-main);
    border-color: var(--accent-color); box-shadow: 0 0 0 1px var(--accent-color);
}

/* 프로젝트 탭 소제목 = 프롬프트 전환 탭 소제목 (.section-header/.section-title) 과 같은 자리·크기 */
.ps-section-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 0.8rem;
    flex-wrap: wrap; gap: 1rem;
}
.ps-section-title {
    font-size: 18px; font-weight: 600; color: var(--text-main); margin: 0; letter-spacing: -0.01em;
}
.section-header .section-title { margin-bottom: 0; }

.ps-builders-list { display: flex; flex-direction: column; gap: .85rem; }

.ps-layout-vertical { display: flex; flex-direction: column; }
.ps-layout-horizontal {
    display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; align-items: start;
}
.ps-layout-horizontal #vidCollectionSection,
.ps-layout-horizontal #imgCollectionSection {
    position: sticky; top: 68px; max-height: calc(100vh - 88px); overflow-y: auto;
}

.ps-tab-pill {
    display: flex; background: var(--bg-color); border: 1px solid var(--border-color);
    border-radius: 7px; overflow: hidden;
}
.ps-tab-pill-btn {
    padding: 4px 12px; font-size: 12px; font-weight: 600;
    border: none; background: transparent; cursor: pointer;
    color: var(--text-muted); transition: all .15s;
}
.ps-tab-pill-btn.active { background: var(--surface-2); color: var(--text-main); }

.ps-search-wrap { position: relative; flex: 1; }
.ps-search-wrap .ps-search-icon {
    position: absolute; left: 9px; top: 50%; transform: translateY(-50%);
    color: var(--text-muted); pointer-events: none; opacity: .7;
}
.ps-search-wrap .ps-search-input { padding-left: 30px; }

.ps-search-input {
    flex: 1; background: var(--bg-color); border: 1px solid var(--border-color);
    border-radius: 8px; padding: 7px 10px; font-size: 13px;
    color: var(--text-main); outline: none; font: inherit; transition: border-color .15s;
}
.ps-search-input:focus { border-color: var(--accent-color); }

.ps-lang-toggle {
    display: flex; background: var(--bg-color); border: 1px solid var(--border-color);
    border-radius: 7px; overflow: hidden; flex-shrink: 0;
}
.ps-lang-btn {
    padding: 5px 10px; font-size: 12px; font-weight: 600;
    border: none; background: transparent; cursor: pointer;
    color: var(--text-muted); transition: all .15s;
}
.ps-lang-btn.active { background: var(--accent-color); color: #fff; }

.ps-enc-scroll {
    flex: 1; min-width: 0; max-height: calc(100vh - 260px); min-height: 520px; overflow-y: auto;
    scrollbar-width: thin; scrollbar-color: #555 transparent;
}
.ps-enc-scroll::-webkit-scrollbar { width: 5px; }
.ps-enc-scroll::-webkit-scrollbar-track { background: transparent; }
.ps-enc-scroll::-webkit-scrollbar-thumb { background: #666; border-radius: 3px; }
.ps-enc-scroll::-webkit-scrollbar-thumb:hover { background: #888; }

.ps-dict-toolbar {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    padding: 9px 12px; margin-bottom: .75rem;
    background: var(--accent-hover); border: 1px solid var(--border-color);
    border-radius: 9px;
}
.ps-dict-toolbar-label { font-size: 14px; font-weight: 600; color: var(--accent-color); margin-right: 2px; }
.ps-dict-import { border-color: var(--accent-color) !important; color: var(--accent-color) !important; font-weight: 600 !important; }
.ps-dict-import:hover { background: var(--accent-color) !important; color: #fff !important; }

.ps-enc-split { display: flex; gap: 1.1rem; align-items: flex-start; }
.ps-enc-nav {
    display: flex; flex-direction: column; gap: 3px;
    width: 190px; flex-shrink: 0; max-height: calc(100vh - 260px); min-height: 520px; overflow-y: auto;
    border-right: 1px solid var(--border-color); padding-right: .8rem;
    scrollbar-width: thin; scrollbar-color: #555 transparent;
}
.ps-enc-nav::-webkit-scrollbar { width: 5px; }
.ps-enc-nav::-webkit-scrollbar-thumb { background: #666; border-radius: 3px; }
.ps-enc-navitem {
    display: flex; align-items: center; gap: 8px; text-align: left;
    font-size: 14px; font-weight: 600; padding: 9px 11px;
    border: 1px solid transparent; border-radius: 9px;
    background: transparent; color: var(--text-muted);
    cursor: pointer; transition: all .15s; width: 100%;
}
.ps-enc-navitem { font-size: 13px !important; }
.ps-enc-navitem:hover { background: var(--surface-2); color: var(--text-main); }
.ps-enc-navitem.active { background: var(--accent-hover); color: var(--accent-ink); font-weight: 600; }
@media (max-width: 768px) {
    .ps-enc-split { flex-direction: column; }
    .ps-enc-nav { width: 100%; flex-direction: row; flex-wrap: wrap;
        border-right: none; border-bottom: 1px solid var(--border-color);
        padding-right: 0; padding-bottom: .7rem; max-height: none; }
    .ps-enc-navitem { width: auto; }
}

.ps-enc-prompt-chip {
    padding: 6px 11px; line-height: 1.3;
    border: 1px solid var(--border-color); border-radius: 7px;
    background: var(--surface-color); color: var(--text-main);
    cursor: grab; transition: all .15s; user-select: none;
    display: inline-flex; flex-direction: column; align-items: flex-start; gap: 1px;
}
.ps-enc-prompt-chip:hover { border-color: var(--text-faint); box-shadow: var(--shadow-md); }
.ps-enc-en { font-size: 12px; font-weight: 500; color: var(--text-main); }
.ps-enc-ko { font-size: 11px; font-weight: 400; color: var(--text-muted); }
.ps-enc-param { background: var(--param-bg); border-color: transparent; }
.ps-enc-param .ps-enc-en { color: var(--param-text); font-family: ui-monospace, 'SF Mono', monospace; }
.ps-enc-chip-ko { font-weight: 400; }

.ps-enc-divider { border: none; border-top: 1px solid var(--border-color); margin: 1rem 0 1.25rem; opacity: .6; }
.ps-enc-cat { margin-bottom: 1.25rem; }
.ps-enc-cat-name {
    font-size: 18px; font-weight: 600; color: var(--accent-color);
    margin-bottom: 14px; display: flex; align-items: center; gap: 7px;
}
.ps-enc-sub-name {
    font-size: 14px; font-weight: 600; color: var(--text-main);
    letter-spacing: .01em; margin: 18px 0 8px;
    padding: 3px 0 3px 8px;
    border-left: 2px solid var(--border-color);
}
.ps-enc-chips { display: flex; flex-wrap: wrap; gap: 7px; }

.mbb-block {
    border: 1px solid var(--border-color); border-radius: 12px;
    background: var(--surface-color); overflow: visible;
    transition: border-color .15s;
}
.mbb-block:focus-within { border-color: var(--accent-color); }
.mbb-block.drag-over-top { border-top: 2.5px solid var(--accent-color); }
.mbb-block.drag-over-bottom { border-bottom: 2.5px solid var(--accent-color); }
.mbb-header {
    display: flex; align-items: center; gap: 8px; padding: 10px 12px;
    border-bottom: 1px solid var(--border-color); background: var(--bg-color);
    border-radius: 11px 11px 0 0; caret-color: transparent;
}
.mbb-header-right {
    display: flex; align-items: center; gap: 4px; margin-left: auto;
    flex-shrink: 0; caret-color: transparent;
}
.mbb-copy-btn, .mbb-close-btn {
    caret-color: transparent; user-select: none; -webkit-user-select: none;
}
.mbb-drag-handle {
    color: var(--text-muted); cursor: grab; padding: 4px 6px; font-size: 16px;
    line-height: 1; user-select: none; border-radius: 5px; transition: all .15s;
    border: 1px solid transparent;
}
.mbb-drag-handle:hover { color: var(--accent-color); background: var(--accent-hover); border-color: var(--border-color); }
.mbb-drag-handle:active { cursor: grabbing; }

.mbb-collapse-btn {
    display: flex; align-items: center; justify-content: center;
    width: 24px; height: 24px; padding: 0; flex-shrink: 0;
    background: transparent; border: none; border-radius: 5px;
    color: var(--text-muted); cursor: pointer; transition: all .15s;
}
.mbb-collapse-btn:hover { background: var(--accent-hover); color: var(--accent-color); }
.mbb-collapse-btn svg { transition: transform .2s ease; }
.mbb-block.collapsed .mbb-collapse-btn svg { transform: rotate(-90deg); }
.mbb-block.collapsed .mbb-header { border-bottom-color: transparent; border-radius: 11px; }

.mbb-single-ta.drop-active {
    outline: 2px dashed var(--accent-color); outline-offset: 3px;
    background: var(--accent-hover); border-radius: 8px;
}
.mbb-title-edit {
    font-size: 14px; font-weight: 600; color: var(--text-main);
    background: transparent; border: none; outline: none; cursor: text;
    min-width: 60px; max-width: 180px; padding: 2px 4px;
    border-radius: 4px; font: inherit;
}
.mbb-title-edit:focus {
    background: var(--bg-color); border: 1px solid var(--accent-color); cursor: text;
}
.mbb-body { padding: 12px 14px; }
.mbb-empty {
    min-height: 120px; display: flex; align-items: center; justify-content: center;
    border: 1.5px dashed var(--border-color); border-radius: 9px;
    color: var(--text-muted); cursor: pointer; font-size: 13px; gap: 6px;
    transition: all .15s; background: transparent;
}
.mbb-empty:hover { border-color: var(--accent-color); color: var(--accent-color); }
.mbb-single-ta {
    width: 100%; min-height: 120px; background: transparent; border: none; outline: none;
    color: var(--text-main); font-family: inherit; font-size: 14px; font-weight: 400;
    resize: none; line-height: 1.6; padding: 0; box-sizing: border-box; display: block;
    caret-color: auto !important;
}

.mbb-single-panel {
    border: 1px solid var(--border-color); border-radius: 10px;
    padding: 12px 14px; background: transparent;
    transition: border-color .15s, box-shadow .15s;
}
.mbb-single-panel:focus-within { border-color: var(--accent-color); box-shadow: 0 0 0 3px var(--accent-hover); }
.mbb-single-panel.dragover { border-color: var(--accent-color); background: var(--accent-hover); }
.mbb-reorder-area { min-height: 110px; }

.mbb-h-left { display: flex; align-items: center; gap: 6px; flex: 1 1 0; min-width: 0; }
.mbb-h-center { display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.mbb-h-right { display: flex; align-items: center; gap: 5px; flex: 1 1 0; justify-content: flex-end; }
.mbb-h-left .mbb-title-edit { flex: 0 1 auto; min-width: 0; }

.mbb-block.mbb-imgmode { overflow: hidden; }
.mbb-imgmode .mbb-header { border-radius: 0; width: 100%; box-sizing: border-box; }
.mbb-imgset { display: flex; align-items: stretch; gap: 0; }
.mbb-imgset .mbb-body { flex: 1; min-width: 0; }
.mbb-img-pane {
    position: relative; flex: 0 0 36%; max-width: 340px; min-width: 200px; min-height: 200px;
    border-right: 1px solid var(--border-color); background: var(--bg-color);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; overflow: hidden; outline: none;
}
.mbb-img-pane:focus { box-shadow: inset 0 0 0 2px var(--accent-color); }
.mbb-img-pane.dragover { background: var(--accent-hover); box-shadow: inset 0 0 0 2px var(--accent-color); }
.mbb-img-pane.has-img { cursor: default; }
.mbb-img-preview { width: 100%; height: 100%; max-height: 420px; object-fit: contain; display: block; }
.mbb-img-empty { position: absolute; color: var(--text-muted); font-size: 13px; text-align: center; line-height: 1.6; padding: 12px; pointer-events: none; }
.mbb-img-pane.has-img .mbb-img-empty { display: none; }
.mbb-img-clear {
    position: absolute; top: 8px; right: 8px; width: 24px; height: 24px;
    border-radius: 6px; border: none; background: rgba(0,0,0,.55); color: #fff;
    cursor: pointer; opacity: 0; transition: opacity .15s; font-size: 13px; line-height: 1; z-index: 2;
}
.mbb-img-pane:hover .mbb-img-clear { opacity: 1; }
.mbb-img-pane:not(.has-img) .mbb-img-clear { display: none; }
.mbb-img-clear:hover { background: var(--danger-color); }
.mbb-action-menu { min-width: 150px; }
@media (max-width: 768px) {
    .mbb-imgset { flex-direction: column; }
    .mbb-img-pane { flex-basis: auto; max-width: none; border-right: none; border-bottom: 1px solid var(--border-color); min-height: 170px; }

    .mbb-header { flex-wrap: wrap; row-gap: 6px; }
    .mbb-h-left, .mbb-h-right { flex: 1 1 40%; }
    .mbb-h-center { order: 3; flex: 1 1 100%; }
    .conv-builder-head { flex-wrap: wrap; row-gap: 6px; }
    .conv-bh-center { order: 3; flex: 1 1 100%; }
    .mbb-title-edit { max-width: 110px; }
    .fav-panel { width: 100%; max-width: 100%; }
}

@media (max-width: 460px) {
    .mbb-h-right .btn.btn-small { padding: 4px 6px; font-size: 11px; }
    .ps-view-bar { flex-wrap: wrap; }
    .mbb-fw-label-input { width: 60px; }
}
.mbb-fw-rows { display: flex; flex-direction: column; gap: 4px; }
.mbb-fw-row {
    display: flex; align-items: stretch; border: 1px solid var(--border-color);
    border-radius: 7px; overflow: hidden; transition: all .15s;
}
.mbb-fw-row:focus-within { border-color: var(--accent-color); }
.mbb-fw-row.drag-over { border: 2px solid var(--accent-color); }
.mbb-fw-handle { color: var(--text-muted); cursor: grab; padding: 6px 6px; font-size: 14px; display: flex; align-items: center; background: transparent; user-select: none; }
.mbb-fw-label-input {
    width: 76px; flex-shrink: 0; padding: 8px 6px; background: transparent;
    font-size: 12px; font-weight: 600;
    color: var(--text-muted); border: none; outline: none; font: inherit; cursor: text;
    text-align: center; align-self: center;
}
.mbb-fw-label-input:focus { background: transparent; color: var(--accent-color); }
.mbb-fw-content-input {
    flex: 1; border: none; border-left: 1px solid var(--border-color); background: transparent; outline: none;
    padding: 8px 12px; font: inherit; font-size: 13px; color: var(--text-main);
}
.mbb-fw-del { background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 6px 8px; opacity: .5; transition: opacity .15s; align-self: center; }
.mbb-fw-del:hover { opacity: 1; color: var(--danger-color); }
.mbb-fw-chip-area {
    flex: 1; min-height: 0; align-items: center; gap: 5px;
    border-left: 1px solid var(--border-color); padding: 7px 12px;
    transition: background .15s;
}
.mbb-fw-chip-area:empty::before { content: none; }
.mbb-fw-chip-area.drag-over { background: var(--accent-hover); }
.mbb-fw-chip-empty { font-size: 13px; color: var(--text-faint); }

.ps-conv-grid { display: grid; gap: 1.25rem; }
.ps-conv-grid.layout-2col { grid-template-columns: 1fr 1fr; }
.ps-conv-grid.layout-1col { grid-template-columns: 1fr; }
.ps-conv-grid.layout-image { grid-template-columns: 280px 1fr 1fr; }

#projectModal.visible { display: flex !important; }

.drop-indicator {
    height: 3px; background: var(--accent-color); border-radius: 2px;
    margin: 2px 0; transition: opacity .15s; pointer-events: none;
}

.mbb-fw-updown {
    display: flex; flex-direction: column; flex-shrink: 0;
    background: transparent; align-self: center;
}
.mbb-fw-ud-btn {
    background: none; border: none; color: var(--text-muted); cursor: pointer;
    padding: 2px 6px; font-size: 12px; line-height: 1; transition: all 0.15s;
    flex: 1; display: flex; align-items: center; justify-content: center;
}
.mbb-fw-ud-btn:hover:not(:disabled) { color: var(--accent-color); background: var(--accent-hover); }
.mbb-fw-ud-btn:disabled { opacity: 0.25; cursor: not-allowed; }
.mbb-fw-row.drag-over { border-color: var(--accent-color) !important; background: var(--accent-hover); }
.mbb-fw-content-input { transition: background 0.15s; }
.mbb-fw-row.drag-over .mbb-fw-content-input { background: var(--accent-hover); }

.tag-item { transition: background 0.15s, border-color 0.15s; }

.tag-item:hover, .chunk:not(.param-chunk):hover {
    background: var(--accent-hover) !important;
    border-color: var(--accent-color) !important;
}

.ps-layout-horizontal {
    display: grid !important; grid-template-columns: 1fr 1fr !important; gap: 1.5rem; align-items: start;
}
.ps-layout-horizontal #vidCollectionSection,
.ps-layout-horizontal #imgCollectionSection {
    position: sticky; top: 68px; max-height: calc(100vh - 88px); overflow-y: auto;
}

.category-tabs { position: relative; }
.category-tab.drag-over-left { box-shadow: -3px 0 0 0 var(--accent-color) !important; }
.category-tab.drag-over-right { box-shadow: 3px 0 0 0 var(--accent-color) !important; }
.category-tab.draggable { cursor: grab; }
.category-tab.draggable:active { cursor: grabbing; }
.category-tab:hover { background: var(--accent-hover); color: var(--accent-color); }

.category-tab.active, .category-tab.active:hover { background: var(--accent-color) !important; color: #fff !important; }

.category-tab.cat-edit, .category-tab.cat-edit *, .category-tab.cat-edit .cat-name-editing { cursor: text !important; }
.category-tab.cat-edit.draggable { cursor: text; }

.cat-name-editing { background: transparent !important; }
.category-tab.active .cat-name-editing { color: #fff; outline-color: rgba(255,255,255,.7); }

.fs-sm { font-size: 12px; }
.fs-md { font-size: 14px; }
.fs-lg { font-size: 16px; }

.app-header {
    position: sticky; top: 0; z-index: 8000;
    background: var(--surface-color); border-bottom: 1px solid var(--border-color);
    box-shadow: 0 1px 8px rgba(0,0,0,0.08);

    width: 100%;
    box-sizing: border-box;
}

.app-header-inner {
    max-width: 1200px; margin: 0 auto;
    display: flex; align-items: stretch; height: 52px;
}
.app-logo {
    display: flex; align-items: center; justify-content: center;
    width: 52px; flex-shrink: 0; border-right: 1px solid var(--border-color);
    color: var(--accent-color);
}
#tabBar { display: flex; align-items: stretch; flex: 1; }
.app-tab {
    display: flex; align-items: center; padding: 0 1.1rem;
    font-size: 14px; font-weight: var(--font-medium); color: var(--text-muted);
    border: none; background: transparent; cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: color 0.15s, background 0.15s, border-color 0.15s;
    white-space: nowrap;
}
.app-tab:hover { color: var(--text-main); background: var(--bg-color); }
.app-tab.active { color: var(--accent-color); border-bottom-color: var(--accent-color); font-weight: var(--font-bold); }
.home-tab { padding: 0 1rem; border-right: 1px solid var(--border-color); }
.home-tab.active svg { stroke: var(--accent-color); }
.tab-divider { width: 1px; background: var(--border-color); margin: 10px 6px; flex-shrink: 0; }
.app-header-right { display: flex; align-items: center; gap: 0.5rem; padding: 0 0.75rem; flex-shrink: 0; }

.encyc-overlay {
    position: fixed; inset: 52px 0 0 0; background: rgba(0,0,0,0.3);
    z-index: 7000; opacity: 0; pointer-events: none; transition: opacity 0.2s;
}
.encyc-overlay.open { opacity: 1; pointer-events: auto; }
.encyc-sidebar {
    position: fixed; top: 52px; right: 0; bottom: 0; width: 360px;
    background: var(--surface-color); border-left: 1px solid var(--border-color);
    z-index: 7100; display: flex; flex-direction: column;
    transform: translateX(100%); transition: transform 0.25s cubic-bezier(0.4,0,0.2,1);
    box-shadow: -4px 0 20px rgba(0,0,0,0.15);
}
.encyc-sidebar.open { transform: translateX(0); }

.encyc-header {
    display: flex; align-items: center; gap: 8px; padding: 12px 14px;
    border-bottom: 1px solid var(--border-color); flex-shrink: 0;
}
.encyc-title { font-size: 14px; font-weight: var(--font-bold); color: var(--text-main); flex: 1; }
.encyc-close { background: none; border: none; cursor: pointer; color: var(--text-muted); padding: 4px; border-radius: 6px; transition: var(--transition); }
.encyc-close:hover { background: var(--bg-color); color: var(--text-main); }

.encyc-toolbar {
    display: flex; align-items: center; gap: 8px; padding: 8px 14px;
    border-bottom: 1px solid var(--border-color); flex-shrink: 0;
}
.encyc-search {
    flex: 1; background: var(--bg-color); border: 1px solid var(--border-color);
    border-radius: 8px; padding: 6px 10px; font-size: 13px; color: var(--text-main);
    outline: none; font: inherit;
}
.encyc-search:focus { border-color: var(--accent-color); }
.encyc-lang-toggle {
    display: flex; background: var(--bg-color); border: 1px solid var(--border-color);
    border-radius: 7px; overflow: hidden; flex-shrink: 0;
}
.encyc-lang-btn {
    padding: 5px 10px; font-size: 12px; font-weight: var(--font-bold);
    border: none; background: transparent; cursor: pointer; color: var(--text-muted);
    transition: var(--transition);
}
.encyc-lang-btn.active { background: var(--accent-color); color: #fff; }

.encyc-body { flex: 1; overflow-y: auto; padding: 8px 0; }
.encyc-body::-webkit-scrollbar { width: 3px; }
.encyc-body::-webkit-scrollbar-track { background: transparent; }
.encyc-body::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 2px; }
.encyc-body::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

.es-section-label {
    font-size: 11px; font-weight: var(--font-bold); color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.07em;
    padding: 10px 14px 4px;
}
.es-nav-item {
    display: flex; align-items: center; gap: 8px; padding: 6px 14px;
    cursor: pointer; font-size: 13px; color: var(--text-muted);
    transition: var(--transition);
}
.es-nav-item:hover { background: var(--bg-color); color: var(--text-main); }
.es-nav-item.active { background: var(--accent-hover); color: var(--accent-color); font-weight: var(--font-bold); border-right: 2px solid var(--accent-color); }
.es-nav-item svg { width: 14px; height: 14px; flex-shrink: 0; }

.es-content-area { padding: 12px 14px; }
.es-section-title { font-size: 14px; font-weight: var(--font-bold); color: var(--text-main); margin-bottom: 3px; }
.es-section-desc { font-size: 12px; color: var(--text-muted); margin-bottom: 10px; line-height: 1.5; }
.es-tip { background: var(--accent-hover); border-left: 2px solid var(--accent-color); padding: 7px 10px; border-radius: 0 6px 6px 0; font-size: 12px; color: var(--text-muted); margin-bottom: 12px; line-height: 1.5; }
.es-cat { margin-bottom: 16px; }
.es-cat-header { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.es-cat-name { font-size: 13px; font-weight: var(--font-bold); color: var(--text-main); }
.es-cat-badge {
    font-size: 0.65rem; padding: 1px 6px; border-radius: 20px;
    border: 1px solid var(--border-color); color: var(--text-muted); background: var(--bg-color);
}
.es-cat-badge.req { background: rgba(239,68,68,0.1); color: #EF4444; border-color: rgba(239,68,68,0.3); }
.es-sub { margin-bottom: 10px; }
.es-sub-name { font-size: 11px; font-weight: var(--font-bold); color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.07em; margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
.es-sub-name::after { content: ''; flex: 1; height: 1px; background: var(--border-color); }
.es-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.es-chip {
    font-size: 12px; padding: 3px 9px;
    border: 1px solid var(--border-color); border-radius: 20px;
    background: var(--bg-color); color: var(--text-secondary);
    cursor: grab; transition: var(--transition); user-select: none;
}
.es-chip:hover { border-color: var(--accent-color); color: var(--accent-color); background: var(--accent-hover); }
.es-chip:active { cursor: grabbing; transform: scale(0.96); }
.es-chip.fav-chip { border-color: #E84393; color: #E84393; background: rgba(232,67,147,0.08); }

.es-fav-section { padding: 8px 14px 4px; border-bottom: 1px solid var(--border-color); margin-bottom: 4px; }
.es-fav-header { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.es-fav-title { font-size: 12px; font-weight: var(--font-bold); color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.07em; flex: 1; }
.fav-heart { color: var(--text-muted); transition: var(--transition); cursor: pointer; padding: 2px 4px; border-radius: 4px; }
.fav-heart:hover { color: #E84393; }
.fav-heart.active { color: #E84393; }

.encyc-toggle-btn {
    display: flex; align-items: center; gap: 5px;
    padding: 5px 10px; border-radius: 8px; border: 1px solid var(--border-color);
    background: var(--bg-color); color: var(--text-muted); cursor: pointer;
    font-size: 13px; transition: var(--transition);
}
.encyc-toggle-btn:hover { border-color: var(--accent-color); color: var(--accent-color); background: var(--accent-hover); }
.encyc-toggle-btn.active { border-color: var(--accent-color); color: var(--accent-color); background: var(--accent-hover); }
.encyc-toggle-btn svg { width: 15px; height: 15px; }

#encycTabContent .enc-page {
    display: grid; grid-template-columns: 240px 1fr; gap: 0; min-height: 100vh;
}
.enc-sidenav {
    border-right: 1px solid var(--border-color); background: var(--surface-color);
    padding: 14px 10px; position: sticky; top: 0; height: 100vh; overflow-y: auto; box-sizing: border-box;
}
.enc-sidenav::-webkit-scrollbar { width: 3px; }
.enc-sidenav::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 2px; }
.enc-main { padding: 24px 28px; overflow-y: auto; }
.enc-fav-item {
    display: flex; align-items: center; gap: 8px; padding: 7px 14px;
    cursor: pointer; font-size: 13px; color: var(--text-muted);
    transition: var(--transition); justify-content: space-between;
}
.enc-fav-item:hover { background: var(--bg-color); }
.enc-fav-item .fav-del { opacity: 0; font-size: 12px; color: var(--danger-color); cursor: pointer; padding: 1px 5px; border-radius: 4px; }
.enc-fav-item:hover .fav-del { opacity: 1; }
.enc-folder-item {
    display: flex; align-items: center; gap: 8px; padding: 9px 11px;
    cursor: pointer; font-size: 13px; font-weight: 500; color: var(--text-muted);
    transition: var(--transition); border-radius: 9px; margin-bottom: 2px;
    border: 1px solid transparent;
}
.enc-folder-item:hover { background: var(--surface-2); color: var(--text-main); }
.enc-folder-item.active { background: var(--accent-hover); color: var(--accent-ink); font-weight: 600; }
.enc-folder-item.active .enc-folder-count { color: var(--accent-ink); }
.enc-folder-item svg { width: 13px; height: 13px; flex-shrink: 0; }
.enc-folder-count { margin-left: auto; font-size: 11px; color: var(--text-faint); font-variant-numeric: tabular-nums; }
.enc-section-header { display: flex; align-items: center; justify-content: space-between; padding: 8px 14px 3px; }
.enc-section-label { font-size: 11px; font-weight: var(--font-bold); color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; }
.enc-add-btn { width: 18px; height: 18px; border-radius: 5px; border: 1px dashed var(--border-color); background: transparent; color: var(--text-muted); cursor: pointer; font-size: 14px; display: flex; align-items: center; justify-content: center; transition: var(--transition); }
.enc-add-btn:hover { border-color: var(--accent-color); color: var(--accent-color); }
.enc-folder-opts { opacity: 0; margin-left: auto; color: var(--text-muted); font-size: 13px; cursor: pointer; padding: 1px 4px; border-radius: 3px; transition: var(--transition); }
.enc-folder-item:hover .enc-folder-opts { opacity: 1; }
.enc-folder-opts:hover { background: var(--border-color); color: var(--text-main); }
.enc-chip {
    padding: 6px 11px; border: 1px solid var(--border-color);
    border-radius: 7px; background: var(--surface-color); color: var(--text-main);
    cursor: pointer; transition: var(--transition); display: inline-flex; flex-direction: column; align-items: flex-start; gap: 1px;
}
.enc-chip:hover { border-color: var(--text-faint); box-shadow: var(--shadow-md); }
.enc-chip-en { font-size: 12px; font-weight: 500; color: var(--text-main); }
.enc-chip-ko { font-size: 11px; font-weight: 400; color: var(--text-muted); }
.enc-chip-copied { border-color: var(--success-color) !important; background: var(--success-soft) !important; }
.enc-chip-param { background: var(--param-bg); border-color: transparent; }
.enc-chip-param .enc-chip-en { color: var(--param-text); font-family: ui-monospace, 'SF Mono', monospace; }
.enc-chip-param:hover { border-color: var(--param-text); }
.enc-heart { font-size: 13px; opacity: 0; transition: var(--transition); }
.enc-chip:hover .enc-heart { opacity: 1; }
.enc-chip.faved .enc-heart { opacity: 1; color: #E84393; }
.enc-chip.faved { border-color: rgba(232,67,147,0.3); }
.enc-sub-header { display: flex; align-items: center; gap: 0; font-size: 11px; font-weight: var(--font-bold); color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.07em; margin-bottom: 8px; }
.enc-sub-header::after { content: ''; flex: 1; height: 1px; background: var(--border-color); margin-left: 8px; }

.enc-cat { margin-bottom: 22px; }
.enc-cat-header {
    display: flex; align-items: center; gap: 7px; cursor: pointer;
    user-select: none; -webkit-user-select: none;
    padding: 4px 0; margin-bottom: 12px; transition: var(--transition);
}
.enc-cat-header:hover .enc-cat-title { color: var(--accent-color); }
.enc-cat-arrow {
    flex-shrink: 0; color: var(--accent-color);
    transform: rotate(90deg); transition: transform 0.18s ease;
}
.enc-cat.collapsed .enc-cat-arrow { transform: rotate(0deg); }
.enc-cat-title { font-size: 16px; font-weight: var(--font-bold); color: var(--accent-color); }
.enc-cat-body { overflow: hidden; transition: max-height 0.2s ease; }
.enc-cat.collapsed .enc-cat-body { display: none; }

.enc-chip-wrap { display: flex; flex-wrap: wrap; gap: 8px; }

.enc-search-result { display: flex; flex-direction: column; gap: 12px; }
.enc-result-title { font-size: 16px; font-weight: 600; color: var(--text-main); }

.enc-hero { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.enc-hero-ic { width: 40px; height: 40px; border-radius: 11px; background: var(--accent-hover); color: var(--accent-color); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.enc-hero-ic svg { width: 20px; height: 20px; }
.enc-hero-title { font-size: 18px; font-weight: 600; color: var(--text-main); letter-spacing: -0.01em; }
.enc-hero-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.enc-search { position: relative; margin-bottom: 20px; }
.enc-search svg { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--text-faint); pointer-events: none; }
.enc-search input {
    width: 100%; box-sizing: border-box; background: var(--surface-color); border: 1.5px solid var(--border-color);
    border-radius: 999px; padding: 10px 16px 10px 40px; font: inherit; font-size: 13px;
    color: var(--text-main); outline: none; transition: border-color .15s, box-shadow .15s;
}
.enc-search input::placeholder { color: var(--text-faint); }
.enc-search input:focus { border-color: var(--accent-color); box-shadow: 0 0 0 3px var(--accent-hover); }
.enc-folder-opts-menu {
    position: absolute; background: var(--surface-color); border: 1px solid var(--border-color);
    border-radius: 10px; box-shadow: var(--shadow-lg); z-index: 100; min-width: 130px; padding: 4px;
}
.enc-opts-item { padding: 7px 12px; font-size: 13px; color: var(--text-main); cursor: pointer; border-radius: 6px; }
.enc-opts-item:hover { background: var(--bg-color); }
.enc-opts-item.danger { color: var(--danger-color); }

.contact-input {
    width:100%; box-sizing:border-box; background:var(--bg-color); border:1px solid var(--border-color);
    border-radius:9px; padding:10px 12px; font-size: 14px; color:var(--text-main);
    outline:none; font:inherit; transition:border-color 0.15s;
}
.contact-input:focus { border-color:var(--accent-color); }

.project-card {
    background:var(--surface-color); border:1px solid var(--border-color); border-radius:14px;
    padding:1.5rem; cursor:pointer; transition:all 0.18s; display:flex; flex-direction:column; gap:0.6rem;
    min-height:140px; position:relative;
}
.project-card:hover { border-color:var(--text-faint); transform:translateY(-2px); box-shadow:var(--shadow-lg); }
.project-card-icon { width:40px; height:40px; border-radius:10px; background:var(--surface-2); color:var(--accent-color); display:flex; align-items:center; justify-content:center; flex-shrink:0; margin-bottom:4px; }
.project-card-icon svg { width:20px; height:20px; }
.project-card-name { font-size: 13px; font-weight:500; color:var(--text-main); }
.project-card-desc { font-size: 12px; color:var(--text-muted); line-height:1.5; flex:1; }
.project-card-meta { font-size: 11px; color:var(--text-muted); margin-top:auto; }
.project-card-opts { position:absolute; top:10px; right:10px; background:none; border:none; color:var(--text-muted); cursor:pointer; padding:4px 6px; border-radius:6px; font-size: 16px; opacity:0; transition:opacity 0.15s; }
.project-card:hover .project-card-opts { opacity:1; }
.project-card-opts:hover { background:var(--bg-color); color:var(--text-main); }
.project-add-card {
    background:var(--bg-color); border:1.5px dashed var(--border-color); border-radius:14px;
    padding:1.5rem; cursor:pointer; transition:all 0.18s; display:flex; flex-direction:column;
    align-items:center; justify-content:center; gap:0.5rem; min-height:140px; color:var(--text-muted);
}
.project-add-card:hover { border-color:var(--accent-color); color:var(--accent-color); background:var(--accent-hover); }
.project-add-card span { font-size: 14px; font-weight:600; }

.multi-builder-block {
    border:1px solid var(--border-color); border-radius:14px; overflow:hidden;
    background:var(--surface-color); transition:border-color 0.15s;
}
.multi-builder-block:focus-within { border-color:var(--accent-color); }
.mbb-header {
    display:flex; align-items:center; gap:10px; padding:10px 14px;
    border-bottom:1px solid var(--border-color); background:var(--bg-color);
}
.mbb-title { font-size: 14px; font-weight:600; color:var(--text-main); min-width:80px; }
.mbb-body { padding:12px 14px; }
.mbb-single-area {
    width:100%; min-height:140px; background:transparent; border:none; outline:none;
    color:var(--text-main); font:inherit; font-size: 14px; resize:none; line-height:1.6;
}

.mbb-fw-rows { display:flex; flex-direction:column; gap:4px; }
.mbb-fw-row { display:flex; align-items:stretch; gap:0; border:1px solid var(--border-color); border-radius:8px; overflow:hidden; }
.mbb-fw-label {
    width:72px; flex-shrink:0; padding:8px 10px; background:var(--bg-color);
    border-right:1px solid var(--border-color); font-size: 12px; font-weight:600;
    color:var(--text-muted); display:flex; align-items:center; justify-content:center;
}
.mbb-fw-input {
    flex:1; border:none; background:transparent; outline:none; padding:8px 10px;
    font:inherit; font-size: 14px; color:var(--text-main); min-height:36px;
}
.mbb-fw-del { background:none; border:none; color:var(--text-muted); cursor:pointer; padding:6px 8px; opacity:0.5; transition:opacity 0.15s; font-size: 14px; }
.mbb-fw-del:hover { opacity:1; color:var(--danger-color); }
.mbb-empty-state {
    min-height:140px; display:flex; flex-direction:column; align-items:center; justify-content:center;
    gap:0.5rem; color:var(--text-muted);
}
.mbb-empty-state svg { opacity:0.35; }
.mbb-empty-state p { font-size: 14px; margin:0; }

.note-group-filter { display:flex; flex-wrap:wrap; gap:.4rem; align-items:center; }
.note-group-chip {
    padding:.35rem .85rem; border-radius:20px; cursor:pointer;
    font-size: 14px; font-weight:600; color:var(--text-muted);
    background:var(--surface-color); border:1px solid var(--border-color);
    transition:all .15s; white-space:nowrap;
}
.note-group-chip:hover { border-color:var(--text-faint); color:var(--text-main); }
.note-group-chip.active { background:var(--surface-2); color:var(--text-main); border-color:var(--text-faint); font-weight:600; }

.note-view-toggle { display:flex; gap:2px; background:var(--bg-color); border:1px solid var(--border-color); border-radius:9px; padding:3px; }
.note-view-btn {
    display:flex; align-items:center; justify-content:center; width:34px; height:30px;
    border:none; background:transparent; color:var(--text-muted); cursor:pointer;
    border-radius:6px; transition:all .15s;
}
.note-view-btn:hover { color:var(--text-main); }
.note-view-btn.active { background:var(--surface-2); color:var(--text-main); }

#noteGrid.note-view-block , .note-grid-section-body.note-view-block  { display:grid; grid-template-columns:repeat(auto-fill,minmax(240px,1fr)); gap:1rem; }
#noteGrid.note-view-list , .note-grid-section-body.note-view-list  { display:flex; flex-direction:column; gap:.5rem; }

.note-card {
    position:relative; background:var(--surface-color); border:1px solid var(--border-color);
    border-radius:12px; padding:1.1rem 1.2rem; cursor:pointer; transition:border-color .15s, box-shadow .15s, transform .1s;
    min-height:120px; display:flex; flex-direction:column;
}
.note-card:hover { border-color:var(--text-faint); box-shadow:var(--shadow-lg); transform:translateY(-2px); }
.note-card.dragging { opacity:.4; }
.note-card-mode-badge {
    display:inline-flex; align-items:center; gap:4px; font-size: 11px; font-weight:600;
    padding:1px 6px; border-radius:6px; margin-bottom:.5rem; width:fit-content;
}
.note-card-mode-badge.doc { background:var(--doc-bg); color:var(--doc-text); }
.note-card-mode-badge.canvas { background:var(--canvas-bg); color:var(--canvas-text); }
#noteGrid.note-view-block .home-note-card-icon, .note-grid-section-body.note-view-block .home-note-card-icon { margin-bottom: 4px; }
.note-card-title { font-size: 14px; font-weight:500; color:var(--text-main); margin-bottom:.3rem; word-break:break-word; }
.note-card-desc { font-size: 14px; color:var(--text-muted); line-height:1.5; flex:1; word-break:break-word;
    display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.note-card-meta { font-size: 12px; color:var(--text-muted); margin-top:.7rem; display:flex; align-items:center; gap:8px; }
.note-card-group-tag { font-size: 11px; font-weight:600; color:var(--accent-color); background:var(--accent-hover); padding:1px 7px; border-radius:5px; }

.note-card-group-tag { display:none !important; }
.note-card-opts {
    position:absolute; top:10px; right:10px; width:26px; height:26px; border:none; background:transparent;
    color:var(--text-muted); cursor:pointer; border-radius:6px; font-size: 18px; line-height:1;
    display:flex; align-items:center; justify-content:center; opacity:0; transition:all .15s;
}
.note-card:hover .note-card-opts { opacity:1; }
.note-card-opts:hover { background:var(--bg-color); color:var(--text-main); }
.note-card-handle {
    position:absolute; top:10px; left:10px; color:var(--text-muted); cursor:grab; opacity:0;
    transition:opacity .15s; font-size: 16px; line-height:1; user-select:none;
}
.note-card:hover .note-card-handle { opacity:.6; }
.note-card-handle:active { cursor:grabbing; }

#noteGrid.note-view-list .note-card , .note-grid-section-body.note-view-list .note-card  { flex-direction:row; align-items:center; min-height:auto; padding:.8rem 1.2rem .8rem 2rem; gap:1rem; }
#noteGrid.note-view-list .note-card-mode-badge , .note-grid-section-body.note-view-list .note-card-mode-badge  { margin-bottom:0; flex-shrink:0; min-width:0; width:auto; justify-content:flex-start; }
#noteGrid.note-view-list .note-card-main , .note-grid-section-body.note-view-list .note-card-main  { flex:1; min-width:0; }
#noteGrid.note-view-list .note-card-title , .note-grid-section-body.note-view-list .note-card-title  { margin-bottom:.15rem; font-size: 14px; }
#noteGrid.note-view-list .note-card-desc , .note-grid-section-body.note-view-list .note-card-desc  { -webkit-line-clamp:1; }

#noteGrid.note-view-list .note-card-meta , .note-grid-section-body.note-view-list .note-card-meta  { margin-top:0; flex-shrink:0; display:flex; align-items:center; justify-content:flex-end; gap:10px; }
#noteGrid.note-view-list .note-card-group-tag , .note-grid-section-body.note-view-list .note-card-group-tag  { min-width:64px; text-align:center; }
#noteGrid.note-view-list .note-card-meta > span , .note-grid-section-body.note-view-list .note-card-meta > span  { min-width:88px; text-align:right; font-variant-numeric:tabular-nums; }
#noteGrid.note-view-list .note-card-handle , .note-grid-section-body.note-view-list .note-card-handle  { opacity:.6; }
#noteGrid.note-view-list .note-card-opts , .note-grid-section-body.note-view-list .note-card-opts  { opacity:.6; position:static; }

.note-card.drop-before::before, .note-card.drop-after::after,
.project-card.drop-before::before, .project-card.drop-after::after {
    content:''; position:absolute; background:var(--accent-color); border-radius:3px; z-index:5;
}
#noteGrid.note-view-block .note-card.drop-before::before, .note-grid-section-body.note-view-block .note-card.drop-before::before,
#projectGrid .project-card.drop-before::before { left:-8px; top:8px; bottom:8px; width:3px; }
#noteGrid.note-view-block .note-card.drop-after::after, .note-grid-section-body.note-view-block .note-card.drop-after::after,
#projectGrid .project-card.drop-after::after { right:-8px; top:8px; bottom:8px; width:3px; }
#noteGrid.note-view-list .note-card.drop-before::before , .note-grid-section-body.note-view-list .note-card.drop-before::before  { left:8px; right:8px; top:-4px; height:3px; }
#noteGrid.note-view-list .note-card.drop-after::after , .note-grid-section-body.note-view-list .note-card.drop-after::after  { left:8px; right:8px; bottom:-4px; height:3px; }
.project-card { position:relative; }

.ps-modal-overlay {
    position:fixed; inset:0; background:rgba(0,0,0,.5); z-index:9500;
    display:flex; align-items:center; justify-content:center; padding:1rem; backdrop-filter:blur(2px);
}
.ps-modal {
    background:var(--surface-color); border:1px solid var(--border-color); border-radius:16px;
    padding:1.6rem; width:100%; box-shadow:var(--shadow-lg); max-height:90vh; overflow-y:auto;
}
.ps-modal-title { font-size: 18px; font-weight:600; color:var(--text-main); margin:0 0 1.2rem; }
.ps-modal-field { margin-bottom:1rem; }
.ps-modal-field > label { display:block; font-size: 12px; font-weight:600; color:var(--text-muted); margin-bottom:6px; }
.ps-modal-field input[type=text], .ps-modal-field textarea {
    width:100%; box-sizing:border-box; padding:.6rem .8rem; border:1px solid var(--border-color);
    border-radius:9px; background:var(--bg-color); color:var(--text-main); font-size: 14px; font-family:inherit; outline:none;
}
.ps-modal-field input[type=text]:focus, .ps-modal-field textarea:focus { border-color:var(--accent-color); }
.ps-modal-actions { display:flex; justify-content:flex-end; gap:.5rem; margin-top:1.4rem; }

.note-group-select { display:flex; flex-wrap:wrap; gap:.4rem; align-items:center; }
.note-group-opt {
    padding:.35rem .8rem; border-radius:8px; cursor:pointer; font-size: 13px; font-weight:600;
    color:var(--text-muted); background:var(--bg-color); border:1px solid var(--border-color); transition:all .15s;
}
.note-group-opt:hover { border-color:var(--accent-color); }
.note-group-opt.active { background:var(--accent-color); color:#fff; border-color:var(--accent-color); }
.note-group-add {
    padding:.35rem .7rem; border-radius:8px; cursor:pointer; font-size: 13px; font-weight:600;
    color:var(--accent-color); background:transparent; border:1px dashed var(--accent-color);
}
.note-group-add:hover { background:var(--accent-hover); }

.note-mode-select { display:grid; grid-template-columns:1fr 1fr; gap:.6rem; }
.note-mode-opt {
    display:flex; flex-direction:column; align-items:center; gap:5px; padding:1rem .6rem;
    border:1.5px solid var(--border-color); border-radius:11px; background:var(--bg-color);
    cursor:pointer; transition:all .15s; color:var(--text-muted);
}
.note-mode-opt:hover { border-color:var(--text-faint); }
.note-mode-opt.active { border-color:var(--text-muted); background:var(--surface-2); color:var(--text-main); }
.note-mode-name { font-size: 14px; font-weight:600; color:var(--text-main); }
.note-mode-opt.active .note-mode-name { color:var(--text-main); }
.note-mode-desc { font-size: 12px; }

.note-editor-topbar {
    display:flex; align-items:center; gap:.8rem; padding:.6rem 1.1rem; border-bottom:1px solid var(--border-color);
    background:var(--surface-color); position:sticky; top:0; z-index:100; flex-wrap:wrap;
}
.note-back-btn {
    display:flex; align-items:center; gap:5px; border:1px solid var(--border-color); background:var(--bg-color);
    color:var(--text-main); padding:.4rem .8rem; border-radius:8px; cursor:pointer; font-size: 14px; font-weight:600; flex-shrink:0;
}
.note-back-btn:hover { border-color:var(--accent-color); color:var(--accent-color); }
.note-editor-title-input {
    font-size: 18px; font-weight:600; color:var(--text-main); background:transparent; border:none; outline:none;
    flex:1; min-width:100px; font-family:inherit;
}
.note-save-status { font-size: 12px; color:var(--text-muted); flex-shrink:0; }

.note-history-group { display:flex; align-items:center; gap:2px; flex-shrink:0; }
.note-hist-btn {
    display:flex; align-items:center; justify-content:center; width:32px; height:32px;
    border:1px solid var(--border-color); background:var(--bg-color); color:var(--text-main);
    cursor:pointer; border-radius:8px; transition:all .12s;
}
.note-hist-btn:hover:not(:disabled) { border-color:var(--accent-color); color:var(--accent-color); background:var(--accent-hover); }
.note-hist-btn:disabled { opacity:.35; cursor:default; }

.nt-toolbar {
    display:flex; align-items:center; gap:4px; flex-wrap:wrap; padding:.5rem 1.1rem;
    border-bottom:1px solid var(--border-color); background:var(--bg-color);
    position:sticky; top:50px; z-index:99;
}
.nt-group { display:flex; align-items:center; gap:2px; }
.nt-sep { width:1px; height:22px; background:var(--border-color); margin:0 5px; flex-shrink:0; }
.nt-btn {
    display:flex; align-items:center; justify-content:center; min-width:32px; height:32px; padding:0 7px;
    border:1px solid transparent; background:transparent; color:var(--text-main); cursor:pointer;
    border-radius:8px; font-size: 14px; transition:all .12s; position:relative;
}
.nt-btn:hover { background:var(--surface-color); border-color:var(--border-color); }
.nt-btn.active { background:var(--accent-color); color:#fff; border-color:var(--accent-color); }
.nt-btn svg { width:17px; height:17px; }
.nt-select {
    height:32px; border:1px solid var(--border-color); background:var(--surface-color); color:var(--text-main);
    border-radius:8px; font-size: 13px; padding:0 8px; cursor:pointer; font-family:inherit; outline:none;
}
.nt-select:hover { border-color:var(--accent-color); }

.nt-stepper { display:flex; align-items:center; border:1px solid var(--border-color); border-radius:8px; overflow:hidden; background:var(--surface-color); height:32px; }
.nt-stepper button { width:26px; height:32px; border:none; background:transparent; color:var(--text-main); cursor:pointer; font-size: 16px; line-height:1; display:flex; align-items:center; justify-content:center; }
.nt-stepper button:hover { background:var(--accent-hover); color:var(--accent-color); }
.nt-stepper input { width:38px; height:32px; border:none; border-left:1px solid var(--border-color); border-right:1px solid var(--border-color); background:transparent; color:var(--text-main); text-align:center; font-size: 13px; outline:none; font-family:inherit; }

.nt-color-btn { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:1px; width:32px; height:32px; border:1px solid transparent; background:transparent; cursor:pointer; border-radius:8px; transition:all .12s; color:var(--text-main); }
.nt-color-btn:hover { background:var(--surface-color); border-color:var(--border-color); }
.nt-color-btn .nt-color-glyph { font-size: 13px; font-weight:600; line-height:1; }
.nt-color-btn .nt-color-bar { width:18px; height:4px; border-radius:2px; background:#18181b; }
.nt-spacing-ic { display:inline-flex; align-items:center; justify-content:center; width:22px; height:32px; color:var(--text-muted); }
.nt-spacing-ic svg { width:18px; height:18px; }

.nt-pop { position:relative; }
.nt-pop-menu {
    position:absolute; top:calc(100% + 6px); left:0; z-index:300;
    background:var(--surface-color); border:1px solid var(--border-color); border-radius:12px;
    box-shadow:var(--shadow-md); padding:6px; display:none; min-width:max-content;
}
.nt-pop-menu.show { display:block; animation:ntPopIn .12s ease; }
@keyframes ntPopIn { from { opacity:0; transform:translateY(-4px); } to { opacity:1; transform:translateY(0); } }
.nt-pop-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:4px; }
.nt-pop-row { display:flex; flex-direction:column; gap:2px; }
.nt-pop-item {
    display:flex; align-items:center; gap:9px; padding:7px 11px; border-radius:8px; cursor:pointer;
    color:var(--text-main); font-size: 13px; white-space:nowrap; background:transparent; border:none; width:100%; text-align:left; font-family:inherit;
}
.nt-pop-item:hover { background:var(--accent-hover); color:var(--accent-color); }
.nt-pop-item.active { background:var(--accent-color); color:#fff; }
.nt-pop-item svg { width:18px; height:18px; flex-shrink:0; }
.nt-pop-tile {
    display:flex; align-items:center; justify-content:center; width:40px; height:40px; border-radius:9px; cursor:pointer;
    color:var(--text-main); background:var(--bg-color); border:1px solid var(--border-color); transition:all .12s;
}
.nt-pop-tile:hover { border-color:var(--accent-color); color:var(--accent-color); background:var(--accent-hover); }
.nt-pop-tile.active { background:var(--accent-color); color:#fff; border-color:var(--accent-color); }
.nt-pop-tile svg { width:22px; height:22px; }
.nt-caret { width:12px !important; height:12px !important; margin-left:1px; opacity:.6; }

.nt-toolbar-right { margin-left:auto; display:flex; align-items:center; gap:2px; }

.nt-colorpop {
    position:absolute; top:calc(100% + 6px); z-index:400; width:230px;
    background:var(--surface-color); border:1px solid var(--border-color); border-radius:14px;
    box-shadow:var(--shadow-lg); padding:12px; display:none;
}
.nt-colorpop.show { display:block; animation:ntPopIn .12s ease; }
.nt-colorpop .sv-picker { height:120px; }
.nt-cp-swatches { display:flex; flex-wrap:wrap; gap:5px; margin-top:9px; }
.nt-cp-swatch { width:28px; height:28px; flex-shrink:0; border-radius:8px; cursor:pointer; box-shadow:0 0 0 1px var(--border-color); transition:transform .1s; position:relative; }
.nt-cp-swatch:hover { transform:scale(1.12); }

.nt-cp-custom .nt-cp-custom-x {
    position:absolute; top:-5px; right:-5px; width:14px; height:14px; border-radius:50%;
    background:var(--danger-color); color:#fff; font-size:10px; line-height:14px; text-align:center;
    display:none; cursor:pointer; box-shadow:0 0 0 1.5px var(--surface-color); font-weight:600;
}
.nt-cp-custom:hover .nt-cp-custom-x { display:block; }
.nt-cp-add {
    display:flex; align-items:center; justify-content:center; font-size:15px; font-weight:600;
    color:var(--text-muted); background:var(--surface-color); border:1px dashed var(--border-color); box-shadow:none;
}
.nt-cp-add:hover { color:var(--accent-color); border-color:var(--accent-color); }

#noteEditorView.note-editor-open {
    position: fixed;

    top: 0;
    right: 0;
    bottom: 0;
    left: var(--dock-w);
    z-index: 60;
    background: var(--bg-color); display: flex; flex-direction: column; overflow: hidden;
}

body.fav-open #noteEditorView.note-editor-open {
    left: calc(var(--dock-w) + var(--fav-w));
}
#noteEditorView.note-editor-open .note-editor-topbar,
#noteEditorView.note-editor-open .nt-toolbar { position:static; flex:none; }
#noteEditorView.note-editor-open #noteCanvasViewport { flex:1 1 auto; height:auto; min-height:0; }
#noteEditorView.note-editor-open .note-doc-scroll { flex:1 1 auto; min-height:0; overflow:auto; }
.note-doc-scroll { width:100%; }

.note-doc-page {
    max-width:820px; margin:1.5rem auto 6rem; background:var(--surface-color); border:1px solid var(--border-color);
    border-radius:12px; padding:3rem 3.5rem; min-height:60vh;
}

.note-doc-page.docw-wide   { max-width:820px; }
.note-doc-page.docw-medium { max-width:650px; margin-left:auto; margin-right:auto; }
.note-doc-page.docw-narrow { max-width:500px; margin-left:auto; margin-right:auto; }
.note-doc-content { outline:none; color:var(--text-main); line-height:1.8; font-size:20px; min-height:50vh; }

[data-theme="dark"] .note-doc-content { color:#CCCCCC; }
.note-doc-content:empty::before { content:attr(data-placeholder); color:var(--text-muted); pointer-events:none; }

.note-doc-content h1, .note-doc-content h2, .note-doc-content h3, .note-doc-content p { font-family: inherit; }

.note-doc-content h1 { font-size: 26px; font-weight:600; margin:1rem 0 .5rem; }
.note-doc-content h2 { font-size: 23px; font-weight:600; margin:.9rem 0 .4rem; }
.note-doc-content h3 { font-size: 23px; font-weight:600; margin:.8rem 0 .3rem; }
.note-doc-content p { margin:.4rem 0; }

.note-doc-content hr.doc-hr, .note-doc-content hr { border:none; border-top:2px solid var(--border-color); margin:1.2rem 0; }

.nt-divider { width:1px; align-self:stretch; background:var(--border-color); margin:4px 6px; flex-shrink:0; }
.note-doc-content table { border-collapse:collapse; margin:.8rem 0; width:auto; }
.note-doc-content td, .note-doc-content th { border:1px solid var(--border-color); padding:6px 12px; min-width:60px; }
.note-doc-content img { max-width:100%; border-radius:8px; margin:.5rem 0; }
.note-doc-content a { color:var(--accent-color); text-decoration:underline; }
.note-doc-content blockquote { border-left:3px solid var(--accent-color); padding-left:1rem; margin:.5rem 0; color:var(--text-muted); }
.note-doc-page.dragover { outline:2px dashed var(--accent-color); outline-offset:-6px; }

.doc-table-wrap {
    position:relative; display:block;
    width:100%; max-width:100%;
    margin:1.6rem 0;
    padding:30px 0 4px 30px;
    box-sizing:border-box;
    overflow:visible;
    text-align:right;
}
.doc-table-wrap[data-align="left"]   { text-align:left; }
.doc-table-wrap[data-align="center"] { text-align:center; }
.doc-table-wrap[data-align="right"]  { text-align:right; }
.doc-table { border-collapse:collapse; width:100%; table-layout:fixed; display:inline-table; text-align:left; }
.doc-table td, .doc-table th {
    border:1.5px solid var(--border-color); padding:5px 7px;
    min-width:30px; vertical-align:top; color:var(--text-main); position:relative;
    overflow:hidden; word-wrap:break-word;
}

.doc-todo { display:flex; align-items:flex-start; gap:7px; margin:3px 0; }
.doc-todo input[type="checkbox"] {
    margin-top:3px; width:16px; height:16px; flex-shrink:0; cursor:pointer;
    -webkit-appearance:none; appearance:none; background:var(--surface-color);
    border:2px solid var(--text-muted); border-radius:5px; position:relative; transition:all .15s;
}
.doc-todo input[type="checkbox"]:hover { border-color:var(--accent-color); }
.doc-todo input[type="checkbox"]:checked { background:var(--accent-color); border-color:var(--accent-color); }
.doc-todo input[type="checkbox"]:checked::after { content:''; position:absolute; left:4px; top:1px; width:4px; height:8px; border:solid #fff; border-width:0 2px 2px 0; transform:rotate(45deg); }

[data-theme="dark"] .doc-todo input[type="checkbox"] { border-width:2.5px; border-color:#9a9aa5; }
[data-theme="dark"] .doc-todo input[type="checkbox"]:hover { border-color:var(--accent-color); }

body:not([data-theme="dark"]) .doc-todo input[type="checkbox"] { border-color:#18181b; }
body:not([data-theme="dark"]) .doc-todo input[type="checkbox"]:hover { border-color:var(--accent-color); }
.doc-todo span { flex:1; min-width:0; }
.doc-todo.done span { text-decoration:line-through; color:var(--text-muted); }

.nt-fmt-btn { display:inline-flex; align-items:center; gap:6px; min-width:108px; justify-content:space-between; }
.nc-fmt-pop { padding:7px; min-width:184px; }
.nc-ctx-fmt-pop {
    position:fixed; z-index:10000; background:var(--surface-color);
    border:1px solid var(--border-color); border-radius:11px; box-shadow:var(--shadow-lg);
}
.nc-fmt-title { font-size:.62rem; font-weight:600; color:var(--text-muted); text-transform:uppercase; letter-spacing:.05em; padding:4px 6px 7px; }
.nc-fmt-grid { display:flex; flex-direction:column; gap:3px; }
.nc-fmt-tile {
    display:flex; align-items:center; gap:8px; padding:8px 9px; cursor:pointer;
    background:var(--bg-color); border:1px solid transparent; border-radius:8px;
    color:var(--text-main); transition:all .12s; text-align:left;
}
.nc-fmt-tile:hover { border-color:var(--accent-color); background:var(--accent-hover); }
.nc-fmt-tile.active { border-color:var(--accent-color); background:var(--accent-hover); color:var(--accent-color); }
.nc-fmt-preview { width:22px; text-align:center; flex-shrink:0; line-height:1; color:var(--text-main); display:flex; align-items:center; justify-content:center; }
.nc-fmt-preview svg { width:18px; height:18px; }
.nc-fmt-tile.active .nc-fmt-preview { color:var(--accent-color); }
.nc-fmt-label { font-size: 13px; font-weight:600; }

.doc-md-paste-menu {
    position:fixed; z-index:10060; min-width:220px; padding:7px;
    background:var(--surface-color); border:1px solid var(--border-color); border-radius:13px;
    box-shadow:var(--shadow-lg); color:var(--text-main);
    opacity:0; transform:translateY(-5px) scale(.98); transform-origin:top left;
    transition:opacity .14s ease, transform .14s ease; user-select:none; -webkit-user-select:none;
}
.doc-md-paste-menu.show { opacity:1; transform:translateY(0) scale(1); }
.doc-md-paste-title {
    padding:4px 7px 7px; font-size:.66rem; font-weight:600; color:var(--text-muted);
    text-transform:uppercase; letter-spacing:.055em;
}
.doc-md-paste-item {
    width:100%; display:flex; align-items:center; gap:9px; padding:8px 9px;
    background:transparent; border:1px solid transparent; border-radius:9px;
    color:var(--text-main); font:inherit; font-size: 13px; font-weight:600;
    text-align:left; cursor:pointer; transition:background .12s ease, border-color .12s ease, color .12s ease;
}
.doc-md-paste-item + .doc-md-paste-item { margin-top:4px; }
.doc-md-paste-item:hover, .doc-md-paste-item:focus-visible {
    background:var(--accent-hover); border-color:var(--accent-color); color:var(--accent-color); outline:none;
}
.doc-md-paste-item.primary { color:var(--text-main); }
.doc-md-paste-icon {
    width:25px; height:25px; border-radius:8px; flex-shrink:0;
    display:flex; align-items:center; justify-content:center;
    background:var(--bg-color); border:1px solid var(--border-color); color:var(--text-muted);
}
.doc-md-paste-item:hover .doc-md-paste-icon,
.doc-md-paste-item:focus-visible .doc-md-paste-icon,
.doc-md-paste-item.primary .doc-md-paste-icon {
    color:var(--accent-color); border-color:var(--accent-color); background:var(--accent-hover);
}
.doc-md-paste-icon svg { width:15px; height:15px; pointer-events:none; }

.nc-thick-tile.active { border:1.5px solid var(--accent-color) !important; background:var(--accent-hover) !important; }
#ncThickBtn.has-thick { color:var(--accent-color); }
.doc-table td:focus { outline:2px solid var(--accent-color); outline-offset:-2px; }
.doc-table td.dt-col-sel, .doc-table td.dt-row-sel { background:color-mix(in srgb, var(--accent-color) 14%, transparent); }
.doc-table-overlay { position:absolute; inset:0; pointer-events:none; z-index:6; }

.dt-table-ctrl {
    position:absolute; z-index:11;
    background:var(--surface-color); color:var(--text-muted);
    border:1px solid var(--border-color); border-radius:5px;
    cursor:grab; opacity:0; transition:opacity .15s;
    display:flex; align-items:center; justify-content:center;
    user-select:none; pointer-events:auto;
}
.doc-table-wrap:hover .dt-table-ctrl { opacity:0.7; }
.dt-table-ctrl:hover { opacity:1 !important; color:var(--text-main); border-color:var(--accent-color); }
.dt-table-ctrl:active { cursor:grabbing; }
.dt-table-ctrl svg { width:16px; height:9px; }

.dt-align-toolbar { right:auto !important; opacity:0; pointer-events:auto; }
.doc-table-wrap:hover .dt-align-toolbar { opacity:1; }

.dt-handle {
    position:absolute; pointer-events:auto;
    display:flex; align-items:center; justify-content:center;
    background:transparent; border:none;
    color:var(--text-muted); cursor:grab;
    opacity:0; transition:opacity .12s;
    user-select:none;
}
.doc-table-wrap:hover .dt-handle { opacity:0.7; }
.dt-handle:hover { opacity:1; color:var(--accent-color); }
.dt-handle.dragging { cursor:grabbing; color:var(--accent-color); opacity:1; }
.dt-handle svg { width:8px; height:8px; }

.dt-add { position:absolute; pointer-events:auto; display:flex; align-items:center; justify-content:center; background:transparent; border:1px dashed var(--border-color); border-radius:5px; color:var(--text-muted); cursor:pointer; opacity:0; transition:opacity .12s, background .12s, color .12s; }
.doc-table-wrap:hover .dt-add { opacity:.6; }
.dt-add:hover { opacity:1; background:color-mix(in srgb, var(--accent-color) 15%, transparent); border-color:var(--accent-color); border-style:solid; color:var(--accent-color); }
.dt-add svg { width:14px; height:14px; }
.dt-indicator { position:absolute; background:var(--accent-color); z-index:9; pointer-events:none; border-radius:2px; box-shadow:0 0 0 1px color-mix(in srgb, var(--accent-color) 40%, transparent); }
.doc-table-menu { position:fixed; z-index:9700; background:var(--surface-color); border:1px solid var(--border-color); border-radius:11px; box-shadow:var(--shadow-lg); padding:5px; min-width:172px; animation:notePopIn .12s ease; }
.doc-table-menu button { display:flex; align-items:center; gap:10px; width:100%; text-align:left; padding:8px 10px; border:none; background:transparent; color:var(--text-main); border-radius:7px; cursor:pointer; font-size: 13px; font-family:inherit; }
.doc-table-menu button:hover { background:var(--accent-hover); color:var(--accent-color); }
.doc-table-menu button.danger:hover { background:rgba(239,68,68,.14); color:var(--danger-color); }
.doc-table-menu button svg { width:15px; height:15px; flex-shrink:0; }
.doc-table-menu .dt-menu-sep { height:1px; background:var(--border-color); margin:4px 4px; }

.dt-col-resize, .dt-row-resize { position:absolute; pointer-events:auto; z-index:8; }
.dt-col-resize { cursor:col-resize; width:6px; }
.dt-col-resize:hover, .dt-col-resize.active { background:var(--accent-color); opacity:.4; border-radius:3px; }
.dt-row-resize { cursor:row-resize; height:6px; }
.dt-row-resize:hover, .dt-row-resize.active { background:var(--accent-color); opacity:.4; border-radius:3px; }
.dt-table-action-menu { animation:ntPopIn .12s ease; }

#noteCanvasViewport {
    position:relative; width:100%; height:calc(100vh - 110px); overflow:hidden;
    background:var(--bg-color); cursor:default; touch-action:none;
    caret-color: transparent;
}
#noteCanvasViewport.grabbing { cursor:grabbing; }
#noteCanvasViewport.panning { cursor:grabbing; }
#noteCanvasViewport.dragover { outline:2px dashed var(--accent-color); outline-offset:-6px; }
#noteCanvasViewport.bg-grid { background-image:linear-gradient(var(--nc-grid-color,var(--border-color)) .5px,transparent .5px),linear-gradient(90deg,var(--nc-grid-color,var(--border-color)) .5px,transparent .5px); }
#noteCanvasViewport.bg-dot  { background-image:radial-gradient(var(--nc-grid-color,var(--border-color)) 1.1px, transparent 1.1px); }
#noteCanvasWorld { position:absolute; top:0; left:0; transform-origin:0 0; width:100%; height:100%; }
.nc-marquee { position:absolute; z-index:40; border:1px solid var(--accent-color); background:color-mix(in srgb, var(--accent-color) 12%, transparent); pointer-events:none; border-radius:2px; }
.nc-item {
    position:absolute; box-sizing:border-box; cursor:grab; user-select:none;
}
.nc-item.selected { outline:1.5px solid var(--accent-color); outline-offset:2px; }
.nc-item:active { cursor:grabbing; }
.nc-text {
    background:var(--surface-color); border:1px solid var(--border-color); border-radius:8px;
    color:var(--text-main); line-height:1.6;
    display:block; box-sizing:border-box; overflow:visible;
}

.nc-text-inner {
    width:100%; height:100%; box-sizing:border-box;
    padding:10px 14px; outline:none; cursor:inherit;
    word-break:break-word; overflow-wrap:break-word; white-space:pre-wrap;
    writing-mode:horizontal-tb !important;
    direction:ltr !important;
    unicode-bidi:normal !important;
    text-orientation:mixed !important;
    caret-color: transparent;
}
.nc-text-inner:focus { cursor:text; caret-color: var(--text-main); }
.nc-text:focus-within { outline:1.5px solid var(--accent-color); }
.nc-text.editing {
    cursor:text;

    min-width:200px !important;
}

.nc-text.editing .nc-handle,
.nc-text.editing .nc-rotate { display:none !important; }
.nc-image img { display:block; max-width:none; border-radius:6px; pointer-events:none; width:100%; height:100%; }
.nc-image { line-height:0; }
.nc-link {
    background:var(--surface-color); border:1px solid var(--border-color); border-radius:10px; overflow:hidden;
    width:300px; text-decoration:none; display:block; transition:border-color .15s; cursor:grab;
}
.nc-link:hover { border-color:var(--accent-color); }
.nc-link-thumb { width:100%; height:160px; object-fit:cover; background:var(--bg-color); display:block; pointer-events:none; }
.nc-link-body { padding:9px 11px; }
.nc-link-title { font-size: 13px; font-weight:600; color:var(--text-main); margin:0 0 3px; line-height:1.3; word-break:break-word; }
.nc-link-url { font-size: 11px; color:var(--text-muted); word-break:break-all; }
.nc-link-play { position:absolute; top:50%; left:50%; transform:translate(-50%,-60%); width:48px; height:48px; pointer-events:none; opacity:.92; }

.nc-linkpop {
    position:absolute; z-index:600; display:flex; align-items:center; gap:7px;
    background:var(--surface-color); border:1px solid var(--border-color); border-radius:9px;
    box-shadow:var(--shadow-md); padding:5px 9px; font-size: 12px; max-width:280px;
}
.nc-linkpop a { color:var(--accent-color); text-decoration:none; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:220px; display:inline-block; }
.nc-linkpop a:hover { text-decoration:underline; }
.nc-linkpop svg { width:14px; height:14px; }
.nc-linkpop-ico { display:inline-flex; align-items:center; justify-content:center; width:24px; height:24px; border-radius:6px; color:var(--accent-color); cursor:pointer; flex-shrink:0; transition:background .12s; }
.nc-linkpop-ico:hover { background:var(--accent-hover); }

.nc-handle {
    position:absolute; width:11px; height:11px; background:var(--surface-color);
    border:1.5px solid var(--accent-color); border-radius:50%; display:none; z-index:10; box-sizing:border-box;
    transform: scale(var(--nc-hscale, 1));
}
.nc-item.single-sel .nc-handle { display:block; }
.nc-item.single-sel.no-resize .nc-handle { display:none; }
.nc-h-nw { left:-6px;  top:-6px;  cursor:nwse-resize; }
.nc-h-n  { left:50%;   top:-6px;  margin-left:-5.5px; cursor:ns-resize; }
.nc-h-ne { right:-6px; top:-6px;  cursor:nesw-resize; }
.nc-h-e  { right:-6px; top:50%;   margin-top:-5.5px; cursor:ew-resize; }
.nc-h-se { right:-6px; bottom:-6px; cursor:nwse-resize; }
.nc-h-s  { left:50%;   bottom:-6px; margin-left:-5.5px; cursor:ns-resize; }
.nc-h-sw { left:-6px;  bottom:-6px; cursor:nesw-resize; }
.nc-h-w  { left:-6px;  top:50%;    margin-top:-5.5px; cursor:ew-resize; }
.nc-rotate {
    position:absolute; left:50%; top:-30px; margin-left:-8px; width:16px; height:16px;
    background:var(--surface-color); border:1.5px solid var(--accent-color); border-radius:50%;
    display:none; z-index:10; cursor:grab; align-items:center; justify-content:center; box-sizing:border-box;
    transform: scale(var(--nc-hscale, 1));
}
.nc-item.single-sel.rotatable .nc-rotate { display:flex; }

.nc-group-frame {
    position:absolute; border:1.5px solid var(--accent-color); box-sizing:border-box;
    pointer-events:none; z-index:9; border-radius:1px;
}
.nc-group-frame .nc-gh { display:block; pointer-events:auto; }

.nc-ctx-menu {
    position:fixed; z-index:10000; min-width:194px; padding:6px;
    background:var(--surface-color); border:1px solid var(--border-color); border-radius:11px;
    box-shadow:var(--shadow-lg); display:flex; flex-direction:column; gap:2px;
}
.nc-ctx-item {
    display:flex; align-items:center; gap:7px; width:100%; text-align:left;
    background:transparent; border:none; color:var(--text-main); cursor:pointer;
    font-size: 13px; padding:8px 10px; border-radius:7px; transition:background .12s;
}
.nc-ctx-item svg { width:15px; height:15px; flex:none; }
.nc-ctx-item:hover { background:var(--accent-hover); color:var(--accent-color); }
.nc-ctx-sep { height:1px; background:var(--border-color); margin:4px 2px; }

.nc-ctx-pdf { font-weight:600; color:var(--accent-color); }
.nc-ctx-pdf svg { color:var(--accent-color); }
.nc-ctx-pdf:hover { background:var(--accent-hover); }
.nc-ctx-pdf .nc-ctx-pdf-count {
    margin-left:auto; min-width:19px; height:19px; padding:0 6px;
    display:inline-flex; align-items:center; justify-content:center;
    background:var(--accent-color); color:#fff; border-radius:999px;
    font-size:.66rem; font-weight:600; line-height:1;
}

.nc-pdf-loading {
    position:fixed; inset:0; z-index:12000; background:rgba(0,0,0,0.38);
    display:flex; align-items:center; justify-content:center;
    animation:ntPopIn .12s ease;
}
.nc-pdf-loading-card {
    display:flex; align-items:center; gap:12px; padding:16px 22px;
    background:var(--surface-color); border:1px solid var(--border-color);
    border-radius:14px; box-shadow:var(--shadow-lg);
    color:var(--text-main); font-size: 14px; font-weight:600;
}
.nc-pdf-spinner {
    width:19px; height:19px; flex:none; border-radius:50%;
    border:2.5px solid var(--border-color); border-top-color:var(--accent-color);
    animation:ncPdfSpin .8s linear infinite;
}
@keyframes ncPdfSpin { to { transform:rotate(360deg); } }

.nc-group-box {
    position:absolute; box-sizing:border-box;
    border:1.5px solid #000; border-radius:12px;
    cursor:grab;
    transition:box-shadow .12s;
}
.nc-group-box:hover { box-shadow:0 0 0 1.5px color-mix(in srgb, var(--accent-color) 45%, transparent); }
.nc-group-box.active { box-shadow:0 0 0 2px var(--accent-color); }
.nc-group-box:active { cursor:grabbing; }
.nc-group-ungroup {
    position:absolute; top:-52px; right:0; width:38px; height:38px;
    display:flex; align-items:center; justify-content:center;
    background:var(--surface-color); border:1.5px solid var(--border-color); border-radius:50%;
    color:var(--text-muted); cursor:pointer; padding:0;
    box-shadow:var(--shadow-lg); opacity:0; transition:opacity .12s, color .12s, border-color .12s, transform .12s;
}
.nc-group-ungroup svg { width:19px; height:19px; }
.nc-group-ungroup:hover { transform:scale(1.08); }
.nc-group-box.editing { border-style:dashed; cursor:default; }

.dt-cellfx-pop {
    background:var(--surface-color); border:1px solid var(--border-color); border-radius:11px;
    box-shadow:var(--shadow-lg); padding:6px; min-width:190px;
    animation:ntPopIn .1s ease;
}
.dt-cellfx-btn {
    width:100%; display:flex; align-items:center; gap:8px;
    padding:8px 10px; border:none; border-radius:8px; cursor:pointer;
    background:transparent; color:var(--text-main); font-size: 13px; font-weight:600;
}
.dt-cellfx-btn:hover { background:var(--accent-hover); }
.dt-cellfx-btn.active { background:var(--accent-hover); color:var(--accent-color); }
.dt-cellfx-btn.active svg { color:var(--accent-color); }
.dt-cellfx-state {
    margin-left:auto; font-size:.62rem; font-weight:600; letter-spacing:.05em;
    padding:2px 7px; border-radius:999px; background:var(--bg-color); color:var(--text-muted);
    border:1px solid var(--border-color);
}
.dt-cellfx-btn.active .dt-cellfx-state { background:var(--accent-color); color:#fff; border-color:var(--accent-color); }
.dt-cellfx-hint { font-size: 11px; color:var(--text-muted); line-height:1.5; padding:6px 10px 5px; }
.doc-table td.dt-fx-editing, .doc-table th.dt-fx-editing {
    outline:2px solid var(--accent-color); outline-offset:-2px;
}
.doc-table td.dt-fx-ref, .doc-table th.dt-fx-ref {
    outline:2px dashed var(--accent-color); outline-offset:-2px;
    background:color-mix(in srgb, var(--accent-color) 12%, transparent);
}

.doc-export-btn { width:auto !important; padding:0 10px; gap:6px; display:flex; align-items:center; }
.doc-export-label { font-size: 12px; font-weight:600; }
.doc-export-pop { min-width:186px; right:0; left:auto; }

.note-archive-open-btn {
    display:inline-flex; align-items:center; gap:5px;
    padding:6px 9px; border:1px solid var(--border-color); border-radius:8px;
    background:var(--surface-color); color:var(--text-muted); cursor:pointer;
    transition:color .12s, border-color .12s;
}
.note-archive-open-btn:hover { color:var(--accent-color); border-color:var(--accent-color); }
.note-archive-cnt {
    min-width:16px; height:16px; padding:0 4px;
    display:inline-flex; align-items:center; justify-content:center;
    background:var(--text-muted); color:var(--bg-color); border-radius:999px;
    font-size:.6rem; font-weight:600; line-height:1;
}

.note-archive-cnt:empty { display:none !important; }
.note-archive-overlay {
    position:fixed; inset:0; z-index:11000; background:rgba(0,0,0,0.42);
    display:flex; align-items:center; justify-content:center;
    animation:ntPopIn .12s ease;
}
.note-archive-modal {
    width:min(520px, 92vw); max-height:min(600px, 84vh);
    display:flex; flex-direction:column;
    background:var(--surface-color); border:1px solid var(--border-color);
    border-radius:16px; box-shadow:var(--shadow-lg); overflow:hidden;
}
.note-archive-head {
    display:flex; align-items:center; justify-content:space-between;
    padding:14px 18px; border-bottom:1px solid var(--border-color);
}
.note-archive-title { display:flex; align-items:center; gap:8px; font-size: 16px; font-weight:600; color:var(--text-main); }
.note-archive-close {
    width:30px; height:30px; display:flex; align-items:center; justify-content:center;
    border:none; border-radius:8px; background:transparent; color:var(--text-muted); cursor:pointer;
}
.note-archive-close:hover { background:var(--accent-hover); color:var(--text-main); }
.note-archive-list { flex:1; overflow-y:auto; padding:10px 14px 14px; }
.note-archive-empty { padding:44px 10px; text-align:center; font-size: 14px; color:var(--text-muted); line-height:1.7; }
.note-archive-row {
    display:flex; align-items:center; justify-content:space-between; gap:12px;
    padding:11px 12px; border:1px solid var(--border-color); border-radius:11px;
    margin-bottom:8px; background:var(--bg-color);
}
.note-archive-info { min-width:0; }
.note-archive-name { font-size: 14px; font-weight:600; color:var(--text-main); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.note-archive-meta { font-size: 11px; color:var(--text-muted); margin-top:3px; }
.note-archive-actions { display:flex; gap:6px; flex-shrink:0; }
.note-archive-restore, .note-archive-purge {
    padding:6px 12px; font-size: 12px; font-weight:600;
    border-radius:8px; cursor:pointer; border:1px solid var(--border-color);
    background:var(--surface-color); color:var(--text-main);
}
.note-archive-restore:hover { border-color:var(--accent-color); color:var(--accent-color); }
.note-archive-purge { color:#ef4444; }
.note-archive-purge:hover { background:rgba(239,68,68,0.1); border-color:#ef4444; }
.nc-group-box:hover .nc-group-ungroup, .nc-group-box.active .nc-group-ungroup { opacity:1; }
.nc-group-ungroup:hover { color:var(--accent-color); border-color:var(--accent-color); }

.doc-table td.dt-fx-cell, .doc-table th.dt-fx-cell {
    background:color-mix(in srgb, var(--accent-color) 6%, transparent);
}
.doc-table td.dt-fx-error, .doc-table th.dt-fx-error { color:#ef4444; }

#docSpellBtn.active { background:var(--accent-hover); color:var(--accent-color); }

.note-grid-section { margin-bottom:26px; }
.note-grid-section-title {
    display:flex; align-items:center; gap:8px;
    font-size: 13px; font-weight:600; color:var(--text-muted);
    letter-spacing:.04em; margin:0 0 12px; padding-bottom:8px;
    border-bottom:1px solid var(--border-color);
}
.note-grid-section-title .note-sec-cnt {
    min-width:20px; height:20px; padding:0 7px; display:inline-flex; align-items:center; justify-content:center;
    background:var(--accent-hover); color:var(--accent-color); border-radius:999px;
    font-size: 11px; font-weight:600;
}
.note-grid-section-empty { font-size: 13px; color:var(--text-muted); padding:10px 2px; opacity:.75; }

.nc-crop-overlay { position:fixed; inset:0; z-index:11000; background:var(--bg-color); display:flex; flex-direction:column; }
.nc-crop-bar { display:flex; align-items:center; justify-content:space-between; padding:12px 18px; border-bottom:1px solid var(--border-color); background:var(--surface-color); }
.nc-crop-bar-left { display:flex; align-items:center; gap:9px; font-weight:600; color:var(--text-main); font-size: 16px; }
.nc-crop-bar-right { display:flex; align-items:center; gap:10px; }
.nc-crop-cancel { background:transparent; border:none; color:var(--text-muted); font-size: 14px; font-weight:600; cursor:pointer; padding:7px 14px; border-radius:8px; }
.nc-crop-cancel:hover { background:var(--accent-hover); color:var(--text-main); }
.nc-crop-save { background:var(--accent-color); border:none; color:#fff; font-size: 14px; font-weight:600; cursor:pointer; padding:7px 18px; border-radius:8px; }
.nc-crop-save:hover { filter:brightness(1.08); }
.nc-crop-stage { flex:1; display:flex; align-items:center; justify-content:center; padding:32px; overflow:hidden; }
.nc-crop-imgwrap { position:relative; max-width:100%; max-height:100%; }
.nc-crop-img { display:block; max-width:80vw; max-height:78vh; user-select:none; -webkit-user-drag:none; }
.nc-crop-shade { position:absolute; background:rgba(0,0,0,0.55); pointer-events:none; }
.nc-crop-rect { position:absolute; border:1.5px solid #fff; box-shadow:0 0 0 1px rgba(0,0,0,.4); cursor:move; box-sizing:border-box; }
.nc-crop-h { position:absolute; width:12px; height:12px; background:#fff; border:2px solid var(--accent-color); border-radius:50%; box-sizing:border-box; }
.nc-crop-h.tl { left:-7px; top:-7px; cursor:nwse-resize; }
.nc-crop-h.tr { right:-7px; top:-7px; cursor:nesw-resize; }
.nc-crop-h.bl { left:-7px; bottom:-7px; cursor:nesw-resize; }
.nc-crop-h.br { right:-7px; bottom:-7px; cursor:nwse-resize; }
.nc-ctx-label { font-size:.62rem; font-weight:600; color:var(--text-muted); text-transform:uppercase; letter-spacing:.05em; padding:5px 10px 2px; }
.nc-rotate::before { content:''; position:absolute; top:14px; left:50%; width:1.5px; height:16px; background:var(--accent-color); transform:translateX(-50%); }
.nc-rotate svg { width:10px; height:10px; color:var(--accent-color); }

#ncDrawLayer .nc-shape-sel { cursor:pointer; }

.note-zoom-indicator {
    position:absolute; bottom:14px; right:14px; background:var(--surface-color); border:1px solid var(--border-color);
    border-radius:8px; padding:5px 12px; font-size: 12px; font-weight:600; color:var(--text-main); z-index:50; user-select:none;
}
.note-canvas-hint {
    position:absolute; bottom:14px; left:14px; background:var(--surface-color); border:1px solid var(--border-color);
    border-radius:8px; padding:6px 12px; font-size: 12px; color:var(--text-muted); z-index:50; max-width:320px;
}

.nc-settings-pop {
    position:absolute; top:calc(100% + 6px); right:0; z-index:400; width:248px;
    background:var(--surface-color); border:1px solid var(--border-color); border-radius:14px;
    box-shadow:var(--shadow-lg); padding:13px; display:none;
}
.nc-settings-pop.show { display:block; animation:ntPopIn .12s ease; }
.nc-set-label { font-size: 12px; font-weight:600; color:var(--text-muted); margin:0 0 7px; text-transform:uppercase; letter-spacing:.05em; }
.nc-set-bgrow { display:flex; gap:6px; }
.nc-set-divider { height:1px; background:var(--border-color); margin:12px 0; }
.nc-set-shortcuts { font-size: 13px; font-weight:500; line-height:1.65; color:var(--text-muted); margin:0; }
.nc-set-bgopt {
    flex:1; display:flex; flex-direction:column; align-items:center; gap:5px; padding:9px 4px; cursor:pointer;
    border:1.5px solid var(--border-color); border-radius:10px; background:var(--bg-color); transition:all .12s;
}
.nc-set-bgopt:hover { border-color:var(--accent-color); }
.nc-set-bgopt.active { border-color:var(--accent-color); background:var(--accent-hover); }
.nc-set-bgopt .nc-set-preview { width:40px; height:30px; border-radius:5px; border:1px solid var(--border-color); background:var(--surface-color); }
.nc-set-bgopt .nc-set-name { font-size: 11px; font-weight:600; color:var(--text-main); }
.nc-set-preview.pv-solid { background:var(--surface-color); }
.nc-set-preview.pv-dot { background-image:radial-gradient(var(--text-muted) 1px,transparent 1px); background-size:7px 7px; }
.nc-set-preview.pv-grid { background-image:linear-gradient(var(--text-muted) .5px,transparent .5px),linear-gradient(90deg,var(--text-muted) .5px,transparent .5px); background-size:7px 7px; }

.note-empty {
    text-align:center; padding:4rem 2rem; color:var(--text-muted);
}
.note-empty svg { opacity:.3; margin-bottom:1rem; }

.doc-block {
    display:block; position:relative;
    width:100%; box-sizing:border-box;
    margin:1.5rem 0;
    user-select:none;
    text-align:right;
}
.doc-block[data-align="left"]   { text-align:left; }
.doc-block[data-align="center"] { text-align:center; }
.doc-block[data-align="right"]  { text-align:right; }

.doc-block-inner {
    display:inline-block; position:relative;
    max-width:100%; vertical-align:top; text-align:left;
}

.doc-block-toolbar {
    position:absolute; top:-16px; right:0;
    display:flex; gap:2px; align-items:center;
    background:var(--surface-color); border:1px solid var(--border-color);
    border-radius:8px; padding:2px;
    opacity:0; transition:opacity .15s; z-index:13;
    box-shadow:var(--shadow-md); pointer-events:auto;
}
.doc-block-inner:hover > .doc-block-toolbar { opacity:1; }
.doc-tb-btn {
    display:flex; align-items:center; justify-content:center;
    width:24px; height:22px; border:none; background:transparent;
    color:var(--text-muted); border-radius:5px; cursor:pointer; transition:all .12s;
}
.doc-tb-btn:hover { background:var(--accent-hover); color:var(--accent-color); }
.doc-tb-btn.active { background:var(--accent-hover); color:var(--accent-color); }
.doc-tb-btn svg { width:15px; height:15px; }

.doc-img-wrap { }
.doc-block-inner:hover .doc-img-move-handle { opacity:0.75; }
.doc-block-inner:hover .doc-img-handle { opacity:1; }
.doc-img-move-handle {
    position:absolute; left:50%; top:-15px; transform:translateX(-50%);
    width:30px; height:15px;
    background:var(--surface-color); color:var(--text-muted);
    border:1px solid var(--border-color); border-radius:5px;
    cursor:grab; opacity:0; transition:opacity .15s;
    display:flex; align-items:center; justify-content:center;
    z-index:14; user-select:none;
}
.doc-img-move-handle:hover { opacity:1 !important; color:var(--text-main); border-color:var(--accent-color); }
.doc-img-move-handle:active { cursor:grabbing; }
.doc-img-move-handle svg { width:16px; height:9px; }

.doc-img-handle {
    position:absolute; width:11px; height:11px; box-sizing:border-box;
    background:var(--surface-color); border:1.5px solid var(--accent-color);
    border-radius:50%; opacity:0; transition:opacity .15s; z-index:11;
}
.doc-img-h-nw { left:-6px;  top:-6px;    cursor:nwse-resize; }
.doc-img-h-ne { right:-6px; top:-6px;    cursor:nesw-resize; }
.doc-img-h-sw { left:-6px;  bottom:-6px; cursor:nesw-resize; }
.doc-img-h-se { right:-6px; bottom:-6px; cursor:nwse-resize; }
.doc-img-wrap .doc-block-inner img { display:block; border-radius:8px; cursor:default; max-width:100%; height:auto; margin:0; }

.doc-img-row.doc-block { display:flex; gap:10px; align-items:flex-start; text-align:left; }
/* 칸의 너비는 flex-grow 비율로 정한다 — 모서리를 끌면 이 비율만 옮겨 가므로 줄 전체 폭은 그대로다 */
.doc-img-row > .doc-img-wrap { width:auto; flex:var(--imgcell, 1) 1 0; min-width:44px; margin:0; }
.doc-img-row > .doc-img-wrap > .doc-block-inner { display:block; width:100%; }
.doc-img-row .doc-img-wrap img { width:100% !important; height:auto !important; }

.doc-link-wrap .doc-block-inner { width:100%; }
.doc-block-inner:hover .doc-link-handle { opacity:0.75; }
.doc-link-handle {
    position:absolute; left:50%; top:-15px; transform:translateX(-50%);
    width:30px; height:15px;
    background:var(--surface-color); color:var(--text-muted);
    border:1px solid var(--border-color); border-radius:5px;
    cursor:grab; opacity:0; transition:opacity .15s;
    display:flex; align-items:center; justify-content:center;
    z-index:14; user-select:none;
}
.doc-link-handle:hover { opacity:1 !important; color:var(--text-main); border-color:var(--accent-color); }
.doc-link-handle:active { cursor:grabbing; }
.doc-link-handle svg { width:16px; height:9px; }
.doc-link-card {
    display:flex; align-items:stretch; gap:0; text-decoration:none;
    border:1px solid var(--border-color); border-radius:10px; overflow:hidden;
    background:var(--surface-color); cursor:pointer; transition:border-color .12s, box-shadow .12s;
    min-height:52px; height:52px; max-width:100%; text-align:left;
}
.doc-link-card:hover { border-color:var(--accent-color); box-shadow:var(--shadow-md); }
.note-doc-content a.doc-link-card, .note-doc-content a.doc-link-card:hover { text-decoration:none; color:inherit; }
.doc-link-body { flex:1; min-width:0; padding:7px 12px; display:flex; flex-direction:column; justify-content:center; gap:2px; }
.doc-link-title { font-size: 13px; font-weight:600; color:var(--text-main); line-height:1.3; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.doc-link-url { font-size: 11px; color:var(--text-muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.doc-link-thumb { position:relative; width:88px; flex-shrink:0; background:var(--bg-color); overflow:hidden; }
.doc-link-thumb img { width:100%; height:100%; object-fit:cover; display:block; }
.doc-link-play { position:absolute; left:50%; top:50%; transform:translate(-50%,-50%); width:22px; height:22px; border-radius:50%; background:rgba(0,0,0,.55); display:flex; align-items:center; justify-content:center; }
.doc-link-play svg { width:12px; height:12px; color:#fff; }

.link-modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,.5);
    display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 13500;
}
.link-modal {
    background: var(--surface-color); border: 1px solid var(--border-color);
    border-radius: 14px; box-shadow: var(--shadow-popup);
    width: 100%; max-width: 360px; padding: 20px; box-sizing: border-box;
}
.link-modal-title { font-size: 15px; font-weight: 600; color: var(--text-main); margin-bottom: 12px; }
.link-modal-input {
    width: 100%; box-sizing: border-box; background: var(--bg-color);
    border: 1.5px solid var(--border-color); border-radius: 8px; padding: 10px 13px;
    font: inherit; font-size: 13px; color: var(--text-main); outline: none;
    transition: border-color .15s, box-shadow .15s;
}
.link-modal-input:focus { border-color: var(--accent-color); box-shadow: 0 0 0 3px var(--accent-hover); }
.link-modal-err { font-size: 12px; color: var(--danger-color); min-height: 16px; margin-top: 6px; }
.link-modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; align-items: center; }
.sched-dates { display: flex; gap: 8px; margin-top: 10px; }
.sched-field { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.sched-field > span { font-size: 11px; font-weight: 500; color: var(--text-muted); }
.sched-field input { padding: 8px 10px; }
.sched-del-btn { color: var(--danger-color); border-color: var(--border-color); }
.sched-del-btn:hover { border-color: var(--danger-color); background: transparent; }

.doc-drop-indicator {
    position:fixed;
    height:2px;
    background:var(--accent-color);
    border-radius:1px;
    z-index:9999; pointer-events:none;
    box-shadow:0 0 0 1px color-mix(in srgb, var(--accent-color) 25%, transparent);
}
.doc-table-action-menu { animation:ntPopIn .12s ease; }

:root { --dock-w: 78px; --fav-w: 300px; }

body { padding-left: var(--dock-w); }
body.fav-open { padding-left: calc(var(--dock-w) + var(--fav-w)); }
@media (max-width: 768px) {
    :root { --dock-w: 60px; }
    body.fav-open { padding-left: var(--dock-w); }
}


.side-dock {
    position: fixed; left: 0; top: 0; bottom: 0; width: var(--dock-w);
    z-index: 9000; background: var(--surface-2);
    border-right: 1px solid var(--border-color);
    display: flex; flex-direction: column; align-items: stretch;
    padding: 10px 0; box-sizing: border-box;
    user-select: none; -webkit-user-select: none;
}
.dock-logo {
    display: flex; align-items: center; justify-content: center;
    height: 46px; flex-shrink: 0; color: var(--accent-color); margin-bottom: 8px;
}
.dock-group { display: flex; flex-direction: column; gap: 2px; }
.dock-top { flex: 0 0 auto; }
.dock-bottom { margin-top: auto; }

.dock-btn {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 4px; padding: 9px 2px 8px; margin: 0 6px; border: none; background: transparent;
    border-radius: 11px; cursor: pointer; color: var(--text-muted);
    transition: background 0.15s, color 0.15s; position: relative;
    text-decoration: none; appearance: none; -webkit-appearance: none;
    caret-color: transparent; user-select: none; -webkit-user-select: none;
}
.dock-btn .dock-ico { display: flex; align-items: center; justify-content: center; }
.dock-btn .dock-ico svg { width: 24px; height: 24px; stroke-width: 1.75; }
.dock-btn .dock-label {
    font-size: 0.66rem; font-weight: 600; line-height: 1.1; text-align: center;
    letter-spacing: -0.02em; word-break: keep-all;
}
.dock-btn:hover { background: var(--surface-color); color: var(--text-main); }

.dock-btn.active {
    background: var(--accent-hover); color: var(--accent-color); font-weight: 600;
}
.dock-btn.active .dock-label { font-weight: 600; }
.dock-btn.active::before {
    content: ''; position: absolute; left: -6px; top: 14%; bottom: 14%;
    width: 3px; border-radius: 0 3px 3px 0; background: var(--accent-color);
}

.fav-panel {
    position: fixed; top: 0; bottom: 0; left: var(--dock-w); width: var(--fav-w);
    z-index: 8500; background: var(--surface-color);
    border-right: 1px solid var(--border-color); box-shadow: var(--shadow-md);
    transform: translateX(-100%); opacity: 0; pointer-events: none;
    transition: transform 0.24s cubic-bezier(.4,0,.2,1), opacity 0.2s;
    display: flex; flex-direction: column; box-sizing: border-box; padding: 14px 12px;
}
body.fav-open .fav-panel { transform: translateX(0); opacity: 1; pointer-events: auto; }
.fav-panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.fav-panel-title { display: flex; align-items: center; gap: 7px; font-size: 16px; font-weight: 600; color: var(--text-main); }
.fav-panel-title svg { color: var(--accent-color); }
.fav-panel-close { background: transparent; border: none; color: var(--text-muted); cursor: pointer; padding: 5px; border-radius: 7px; display: flex; }
.fav-panel-close:hover { background: var(--bg-color); color: var(--text-main); }
.fav-panel-hint { font-size: 12px; color: var(--text-muted); margin: 2px 0 12px; }
.fav-panel-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.fav-empty { text-align: center; color: var(--text-muted); font-size: 13px; padding: 2rem 0.5rem; line-height: 1.6; }

.fav-item {
    border: 1px solid var(--border-color); border-radius: 10px; background: var(--bg-color);
    padding: 9px 10px; cursor: grab; transition: border-color 0.15s, box-shadow 0.15s;
}
.fav-item:hover { border-color: var(--accent-color); box-shadow: var(--shadow-md); }
.fav-item:active { cursor: grabbing; }
.fav-item.dragging { opacity: 0.5; }
.fav-item-top { display: flex; align-items: center; gap: 6px; margin-bottom: 5px; }
.fav-item-badge { font-size: 0.6rem; font-weight: 600; padding: 1px 6px; border-radius: 5px; background: var(--accent-hover); color: var(--accent-color); flex-shrink: 0; }
.fav-item-title {
    font: inherit; font-size: 12px; font-weight: 600; color: var(--text-main);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0;
    border: none; background: transparent; padding: 1px 3px; border-radius: 4px; outline: none; cursor: text;
}
.fav-item-title:hover { background: var(--bg-color); }
.fav-item-title:focus { background: var(--bg-color); box-shadow: 0 0 0 1px var(--accent-color); text-overflow: clip; }
.fav-item-del { background: transparent; border: none; color: var(--text-muted); cursor: pointer; font-size: 13px; padding: 0 2px; line-height: 1; flex-shrink: 0; }
.fav-item-del:hover { color: var(--danger-color); }
.fav-item-body { font-size: 12px; color: var(--text-muted); line-height: 1.5; max-height: 3.6em; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; word-break: break-word; overflow-wrap: anywhere; padding: 0; }
.fav-item-ts { font-size: 0.62rem; color: var(--text-muted); opacity: .8; margin-top: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: right; }

.fav-panel-subhead { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 2px 0 12px; }
.fav-panel-subhead .fav-panel-hint { margin: 0; }
.fav-folder-add { flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 7px; border: 1px solid var(--border-color); background: var(--surface-color); color: var(--text-muted); cursor: pointer; transition: all .15s; }
.fav-folder-add:hover { border-color: var(--accent-color); color: var(--accent-color); background: var(--accent-hover); }
.fav-folder { border: 1px solid var(--border-color); border-radius: 10px; background: var(--surface-color); overflow: hidden; transition: border-color .15s, box-shadow .15s; }
.fav-folder.drag-over { border-color: var(--accent-color); box-shadow: 0 0 0 2px var(--accent-hover); }
.fav-folder-head { display: flex; align-items: center; gap: 7px; padding: 8px 10px; border-bottom: 1px solid var(--border-color); }
.fav-folder-grip { color: var(--text-muted); cursor: grab; user-select: none; font-size: 14px; line-height: 1; flex-shrink: 0; }
.fav-folder-grip:active { cursor: grabbing; }
.fav-folder-ic { color: var(--accent-color); flex-shrink: 0; }
.fav-folder-toggle { background: transparent; border: none; color: var(--text-muted); cursor: pointer; font-size: .6rem; padding: 2px 3px; border-radius: 4px; flex-shrink: 0; line-height: 1; transition: color .12s; }
.fav-folder-toggle:hover { color: var(--accent-color); }
.fav-folder-name { font-size: 12px; font-weight: 600; color: var(--text-main); flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fav-folder-count { font-size: .62rem; font-weight: 600; color: var(--text-muted); background: var(--bg-color); border-radius: 9px; padding: 1px 7px; flex-shrink: 0; }
.fav-folder-more { background: transparent; border: none; color: var(--text-muted); cursor: pointer; font-size: 16px; line-height: 1; padding: 2px 5px; border-radius: 5px; flex-shrink: 0; }
.fav-folder-more:hover { background: var(--accent-hover); color: var(--accent-color); }
.fav-folder-body { padding: 8px; display: flex; flex-direction: column; gap: 8px; }
.fav-folder-empty { font-size: 11px; color: var(--text-muted); text-align: center; padding: 14px 8px; border: 1.5px dashed var(--border-color); border-radius: 8px; opacity: .8; }
.fav-root-zone { display: flex; flex-direction: column; gap: 8px; border-radius: 8px; transition: background .12s, box-shadow .12s; }
.fav-root-zone.empty { min-height: 18px; }
.fav-root-zone.drag-over { box-shadow: inset 0 0 0 2px var(--accent-color); background: var(--accent-hover); min-height: 40px; }
.fav-folder-menu { min-width: 150px; }
.fav-folder-menu button.danger { color: var(--danger-color); }

.mbb-fav-btn { background: transparent; border: none; cursor: pointer; color: var(--text-muted); padding: 3px; border-radius: 6px; display: inline-flex; align-items: center; }
.mbb-fav-btn:hover { background: var(--bg-color); color: var(--accent-color); }
.mbb-fav-btn.faved { color: #f5b301; }
.mbb-fav-btn svg { width: 16px; height: 16px; }

.mbb-drop-indicator {
    height: 0; border-top: 2.5px solid var(--accent-color); margin: 2px 0;
    box-shadow: 0 0 6px var(--accent-color); border-radius: 2px; pointer-events: none;
}
.ps-builders-list.fav-drag-over { outline: 2px dashed var(--accent-color); outline-offset: 4px; border-radius: 12px; }

.fav-box { color: var(--text-main); }

.fav-box .doc-block-inner {
    border: 1px solid var(--border-color); background: var(--surface-color);
    border-radius: 10px; padding: 10px 13px;
    font-size: 14px; line-height: 1.55;
    min-width: 280px; word-break: break-word;
    box-shadow: 0 1px 4px rgba(0,0,0,0.12);
}
.fav-box-title {
    display: block; font-size: 0.66rem; font-weight: 600;
    color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 4px;
}

.fav-box-text { outline: none; white-space: pre-wrap; word-break: break-word; min-height: 1.2em; }
.fav-box-text:focus { outline: none; }

.fav-box-handle {
    position: absolute; left: 50%; top: -15px; transform: translateX(-50%);
    width: 30px; height: 15px;
    background: var(--surface-color); color: var(--text-muted);
    border: 1px solid var(--border-color); border-radius: 5px;
    cursor: grab; opacity: 0; transition: opacity .15s;
    display: flex; align-items: center; justify-content: center;
    z-index: 14; user-select: none;
}
.fav-box .doc-block-inner:hover .fav-box-handle { opacity: 0.75; }
.fav-box-handle:hover { opacity: 1 !important; color: var(--text-main); border-color: var(--accent-color); }
.fav-box-handle:active { cursor: grabbing; }
.fav-box-handle svg { width: 16px; height: 9px; }

.doc-copy-box-wrapper { color: var(--text-main); }
.doc-copy-box-wrapper .doc-copy-box-inner {
    width: min(100%, 860px);
    min-width: min(100%, 320px);
    padding: 14px 46px 14px 16px;
    box-sizing: border-box;
    border: 1px solid var(--border-color);
    border-radius: 13px;
    background: color-mix(in srgb, var(--surface-color) 78%, var(--bg-color) 22%);
    box-shadow: 0 8px 24px rgba(0,0,0,.10);
}
[data-theme="dark"] .doc-copy-box-wrapper .doc-copy-box-inner {
    background: color-mix(in srgb, var(--surface-color) 82%, #111 18%);
}
.doc-copy-box-editor {
    min-height: 64px;
    user-select: text;
    -webkit-user-select: text;
    caret-color: var(--text-main) !important;
    outline: none;
    white-space: pre-wrap;
    word-break: break-word;
    font-family: ui-monospace, 'SF Mono', 'Consolas', 'Roboto Mono', 'Pretendard', monospace;
    font-size: 14px;
    line-height: 1.65;
    color: var(--text-main);
}
.doc-copy-box-editor:empty::before {
    content: '외부에 복사할 텍스트를 입력하세요.';
    color: var(--text-muted);
    opacity: .62;
    pointer-events: none;
}
.doc-copy-box-handle {
    position: absolute; left: 50%; top: -15px; transform: translateX(-50%);
    width: 30px; height: 15px;
    background: var(--surface-color); color: var(--text-muted);
    border: 1px solid var(--border-color); border-radius: 5px;
    cursor: grab; opacity: 0; transition: opacity .15s, border-color .15s, color .15s;
    display: flex; align-items: center; justify-content: center;
    z-index: 14; user-select: none;
}
.doc-copy-box-wrapper .doc-block-inner:hover .doc-copy-box-handle,
.doc-copy-box-wrapper .doc-block-inner:hover .doc-copy-box-copy,
.doc-copy-box-wrapper .doc-block-inner:hover .doc-copy-box-more,
.doc-copy-box-copy:hover,
.doc-copy-box-more:hover,
.doc-copy-box-copy.copied { opacity: .92; }
.doc-copy-box-handle:hover { opacity: 1 !important; color: var(--text-main); border-color: var(--accent-color); }
.doc-copy-box-handle:active { cursor: grabbing; }
.doc-copy-box-handle svg { width: 16px; height: 9px; }
.doc-copy-box-copy,
.doc-copy-box-more {
    position: absolute;
    top: 8px;
    width: 28px;
    height: 28px;
    border: 1px solid var(--border-color);
    border-radius: 9px;
    background: color-mix(in srgb, var(--surface-color) 88%, var(--bg-color) 12%);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity .15s, background .12s, color .12s, border-color .12s, transform .12s;
    z-index: 11;
    padding: 0;
}
.doc-copy-box-copy { right: 8px; }
.doc-copy-box-more { right: 40px; font-size: 18px; line-height: 1; }
.doc-copy-box-copy:hover,
.doc-copy-box-more:hover {
    background: var(--accent-hover);
    border-color: var(--accent-color);
    color: var(--accent-color);
}
.doc-copy-box-copy svg {
    width: 15px;
    height: 15px;
    position: absolute;
    pointer-events: none;
}
.doc-copy-box-copy .doc-copy-ico-done { opacity: 0; transform: scale(.72); }
.doc-copy-box-copy.copied {
    color: #22c55e;
    border-color: color-mix(in srgb, #22c55e 60%, var(--border-color));
    background: color-mix(in srgb, #22c55e 14%, var(--surface-color));
}
.doc-copy-box-copy.copied .doc-copy-ico-copy { opacity: 0; transform: scale(.72); }
.doc-copy-box-copy.copied .doc-copy-ico-done { opacity: 1; transform: scale(1); }

.settings-page { max-width: 1200px; margin: 0 auto; padding: 2.5rem 2rem 6rem; box-sizing: border-box; }
.settings-head h1 { font-size: 23px; font-weight: 600; color: var(--text-main); margin: 0 0 .3rem; }
.settings-head p { font-size: 14px; color: var(--text-muted); margin: 0 0 1.75rem; }
.settings-card { background: var(--surface-color); border: 1px solid var(--border-color); border-radius: 14px; padding: .5rem 1.5rem; max-width: 620px; }
.settings-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.15rem 0; }
.settings-row-info { display: flex; flex-direction: column; gap: 3px; }
.settings-row-title { font-size: 14px; font-weight: 600; color: var(--text-main); }
.settings-row-desc { font-size: 12px; color: var(--text-muted); }
.settings-divider { height: 1px; background: var(--border-color); }
.settings-seg { display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--bg-color); border: 1px solid var(--border-color); border-radius: 9px; padding: 3px; gap: 2px; flex-shrink: 0; }
.settings-seg-btn { display: inline-flex; align-items: center; gap: 6px; border: none; background: transparent; color: var(--text-muted); font-size: 13px; font-weight: 600; padding: 6px 14px; border-radius: 7px; cursor: pointer; transition: .15s; }
.settings-seg-btn:hover { color: var(--text-main); }
.settings-seg-btn { justify-content: center; white-space: nowrap; }
.settings-seg-btn.active { background: var(--surface-2); color: var(--text-main); font-weight: 600; }

.settings-shortcut-card { margin-top: 1rem; padding-bottom: 1.4rem; }
.settings-card-title { font-size: 14px; font-weight: 600; color: var(--text-main); padding-top: 1.15rem; }
.settings-shortcut-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 18px; }
@media (max-width: 640px) { .settings-shortcut-grid { grid-template-columns: 1fr; } }
.settings-shortcut-item { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--text-muted); }
.settings-shortcut-item kbd {
    background: var(--surface-2); border: 1px solid var(--border-color); border-radius: 6px;
    padding: 3px 8px; font-family: inherit; font-size: 11px; font-weight: 500;
    color: var(--text-muted); white-space: nowrap; flex-shrink: 0;
}

.mbb-fw-label-input {
    white-space: pre-wrap !important; word-break: break-word; height: auto; line-height: 1.45;
    overflow-wrap: anywhere;
}
.mbb-fw-content-input { height: auto; line-height: 1.45; }

.mbb-single-ta { line-height: 1.55; vertical-align: top; }

textarea.auto-h { overflow: hidden; resize: none; }

.tag-item .tag-del-x, .tag-item .delete-badge {
    font-size: 0.62rem !important; width: 14px; height: 14px; line-height: 14px;
}
.cat-name-editing, .chip-text-editing {
    outline: 1.5px solid var(--accent-color); border-radius: 5px; background: var(--surface-color);
    padding: 1px 4px; min-width: 24px;
}

.mbb-fw-label-input.auto-h, .mbb-fw-content-input.auto-h {
    resize: none; overflow: hidden; display: block; box-sizing: border-box;
    min-height: 0; font-family: inherit;
}
.mbb-fw-label-input.auto-h { white-space: pre-wrap !important; word-break: break-word; }
.mbb-fw-row { align-items: stretch; }

#builderAreaFramework {
    max-height: 360px !important;
    overflow: hidden !important;
    display: flex;
    flex-direction: column;
    min-height: 0;
}
#builderAreaFramework #frameworkContainer {
    flex: 1 1 auto;
    min-height: 0;
    max-height: 310px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding-right: 4px;
    overscroll-behavior: contain;
}
#builderAreaFramework .mbb-fw-rows {
    min-height: 0;
}
#builderAreaFramework .mbb-fw-row {
    flex: 0 0 auto;
}
@media (max-height: 760px) {
    #builderAreaFramework { max-height: 300px !important; }
    #builderAreaFramework #frameworkContainer { max-height: 250px !important; }
}

.note-doc-content .doc-todo {
    display:grid !important;
    grid-template-columns:18px minmax(0, auto) !important;
    align-items:center !important;
    justify-content:start !important;
    column-gap:8px !important;
    width:fit-content !important;
    max-width:100% !important;
    margin:4px 0 !important;
    line-height:1.55 !important;
}
.note-doc-content .doc-todo input[type="checkbox"] {
    width:16px !important;
    height:16px !important;
    min-width:16px !important;
    max-width:16px !important;
    flex:0 0 16px !important;
    margin:0 !important;
    padding:0 !important;
}
.note-doc-content .doc-check,
.nc-text-inner .nc-check {
    display:inline-flex !important;
    align-items:center !important;
    justify-content:center !important;
    width:16px !important;
    height:16px !important;
    min-width:16px !important;
    flex:0 0 16px !important;
    box-sizing:border-box !important;
    border:2px solid var(--text-muted) !important;
    border-radius:5px !important;
    background:transparent !important;
    cursor:pointer !important;
    user-select:none !important;
    -webkit-user-select:none !important;
    caret-color:transparent !important;
}
.note-doc-content .doc-check:hover,
.nc-text-inner .nc-check:hover { border-color:var(--accent-color) !important; }
.note-doc-content .doc-todo.done .doc-check,
.nc-text-inner .nc-todo-line.done .nc-check {
    background:var(--accent-color) !important;
    border-color:var(--accent-color) !important;
}
.note-doc-content .doc-todo.done .doc-check::after,
.nc-text-inner .nc-todo-line.done .nc-check::after {
    content:'';
    width:4px;
    height:8px;
    border:solid #fff;
    border-width:0 2px 2px 0;
    transform:rotate(45deg);
    margin-top:-2px;
}
.note-doc-content .doc-todo-text {
    display:inline !important;
    min-width:1ch !important;
    outline:none !important;
    white-space:pre-wrap !important;
    word-break:break-word !important;
}
.note-doc-content .doc-todo.done .doc-todo-text,
.nc-text-inner .nc-todo-line.done .nc-line-text {
    text-decoration:line-through !important;
    color:var(--text-muted) !important;
}
.note-doc-content .doc-todo span { flex:initial !important; }

.nc-text-inner .nc-line {
    display:block;
    min-height:1.35em;
    margin:0 0 3px 0;
    line-height:1.45;
}
.nc-text-inner .nc-todo-line,
.nc-text-inner .nc-list-line {
    display:grid;
    grid-template-columns:18px minmax(0,1fr);
    align-items:center;
    column-gap:8px;
    margin:2px 0;
}
.nc-text-inner .nc-bullet {
    display:inline-flex;
    width:18px;
    justify-content:center;
    align-items:center;
    user-select:none;
    -webkit-user-select:none;
    caret-color:transparent;
}
.nc-text-inner .nc-line-text {
    min-width:1ch;
    white-space:pre-wrap;
    word-break:break-word;
}
.nc-text-inner .nc-check { pointer-events:auto !important; }

/* 상단바 아래 첫 콘텐츠까지의 여백 — 모든 탭이 이 값을 공유한다 */
:root { --tab-top-gap: 1.75rem; --note-list-top-gap: var(--tab-top-gap); }

.note-list-view {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--note-list-top-gap) 2rem 6rem;
    box-sizing: border-box;
}
.note-list-controlbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}
.note-list-actions {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-shrink: 0;
}
.note-new-btn {
    height: 38px;
    padding: 0 .85rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    line-height: 1;
    font-size: 14px;
    font-weight: 600;
    background: var(--accent-color);
    color: #fff;
    border-color: var(--accent-color);
}
.note-new-btn:hover { filter: brightness(1.05); background: var(--accent-color); }
#noteGrid.note-view-block , .note-grid-section-body.note-view-block  {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
}
#noteGrid.note-view-list , .note-grid-section-body.note-view-list  {
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.doc-check,
.nc-check,
.nc-bullet,
.doc-todo input[type="checkbox"] { display:none !important; }

.nt-dd-btn { display:inline-flex; align-items:center; gap:5px; white-space:nowrap; }
.nt-dd-btn .nt-dd-val { font-size: 13px; font-weight:600; min-width:20px; text-align:center; color:var(--text-main); }
.nt-btn.nt-dd-btn { padding:0 8px; min-width:auto; }
.nt-select.nt-dd-btn { justify-content:space-between; }
.nt-dd-menu { min-width:96px; }
.nt-pop-item.nt-dd-item { justify-content:center; font-weight:600; }
.nt-pop-item.nt-dd-item.active { background:var(--accent-color); color:#fff; }

.nt-stepper.nt-disabled { opacity:.4; pointer-events:none; }

.nt-colorpop .hex-row { gap:6px; }
.nt-colorpop .hex-input-wrap { flex:1 1 auto; min-width:0; padding:5px 7px; }
.nt-colorpop .hex-input-wrap input { width:100%; min-width:0; }
.nt-colorpop .hex-preview { flex:0 0 auto; }
.nt-cp-clear,
.doc-table-menu .dt-header-color-pop .nt-cp-clear {
    flex:0 0 auto; width:36px; height:36px; min-width:0; padding:0; gap:0; box-sizing:content-box;
    display:inline-flex; align-items:center; justify-content:center; text-align:center;
    border:1px solid var(--border-color); border-radius:10px; background:var(--bg-color); color:var(--text-muted);
    cursor:pointer; transition:all .12s;
}
.nt-cp-clear:hover,
.doc-table-menu .dt-header-color-pop .nt-cp-clear:hover {
    border-color:var(--danger-color, #ef4444); color:var(--danger-color, #ef4444); background:var(--surface-color);
}
.nt-cp-clear svg,
.doc-table-menu .dt-header-color-pop .nt-cp-clear svg { width:16px; height:16px; flex-shrink:0; }

.doc-check-li {
    position:relative; padding-left:30px; margin:.2rem 0; min-height:1.4em; line-height:inherit;
}
.doc-check-li::before {
    content:''; position:absolute; left:0; top:.4em; width:20px; height:20px; box-sizing:border-box;
    border:2px solid var(--text-muted); border-radius:5px; cursor:pointer; transition:border-color .12s, background .12s;
}
.doc-check-li:hover::before { border-color:var(--accent-color); }
.doc-check-li::after {
    content:''; position:absolute; left:7px; top:calc(.4em + 4px); width:5px; height:10px;
    border:solid #fff; border-width:0 2.5px 2.5px 0; transform:rotate(45deg); opacity:0; transition:opacity .12s; pointer-events:none;
}
@supports (top: 1lh) {
    .doc-check-li::before { top: calc((1lh - 20px) / 2); }
    .doc-check-li::after { top: calc((1lh - 20px) / 2 + 4px); }
}
.doc-check-li[data-checked="true"]::before { background:var(--accent-color); border-color:var(--accent-color); }
.doc-check-li[data-checked="true"]::after { opacity:1; }
.doc-check-li[data-checked="true"] { text-decoration:line-through; color:var(--text-muted); }

.note-list-actions { align-items:center; }
.note-view-toggle { height:38px; box-sizing:border-box; }
.note-new-btn { height:38px; box-sizing:border-box; padding:0 .8rem; }

.nc-li.checked .nc-li.checked

#noteGrid.note-view-list .note-card , .note-grid-section-body.note-view-list .note-card  { gap:1.4rem; }
#noteGrid.note-view-list .note-card-main , .note-grid-section-body.note-view-list .note-card-main  { margin-left:.5rem; }

.delete-badge, .category-tab .delete-badge, .tag-item .delete-badge { cursor:pointer !important; }

.nc-link-thumb-logo { object-fit:contain !important; height:88px !important; padding:18px; background:var(--surface-color) !important; }

.nc-set-labelrow { display:flex; align-items:center; justify-content:space-between; margin-bottom:8px; }
.nc-bg-reset {
    font-size: 11px; font-weight:600; color:var(--text-muted); background:var(--bg-color);
    border:1px solid var(--border-color); border-radius:7px; padding:3px 9px; cursor:pointer; transition:all .12s;
}
.nc-bg-reset:hover { color:var(--text-main); border-color:var(--accent-color); }
.nc-bg-color-host { width:100%; }
.nc-bg-color-host .sv-picker { height:96px; }
.nc-set-shortcuts { display:none; }

.home-dash-wrap {
    max-width: 1100px; margin: 0 auto;
    padding: 2.5rem 2rem 6rem; box-sizing: border-box;
}

.home-brand-panel {
    display: flex; flex-direction: column; align-items: center;
    text-align: center; padding: 2.6rem 1.5rem 2.4rem; margin-bottom: 2.5rem;
    gap: .65rem; border-radius: 18px;
    background:
        radial-gradient(circle at 16% 22%, #fbe2d6 0, transparent 46%),
        radial-gradient(circle at 86% 24%, #e6e9fb 0, transparent 50%),
        radial-gradient(circle at 22% 92%, #fcecd6 0, transparent 52%);
}
[data-theme="dark"] .home-brand-panel {
    background:
        radial-gradient(circle at 16% 22%, #37281f 0, transparent 46%),
        radial-gradient(circle at 86% 24%, #24283b 0, transparent 52%),
        radial-gradient(circle at 22% 92%, #2e241c 0, transparent 50%);
}
.home-brand-logo { display: flex; align-items: center; gap: 12px; }
.home-brand-title {
    font-size: 26px; font-weight: 600; color: var(--text-main);
    margin: 0; letter-spacing: -.03em;
}

.home-brand-desc {
    color: var(--text-muted); font-size: 14px; margin: 0;
    line-height: 1.8; white-space: pre-line;
}
.home-brand-cta {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 14px; text-decoration: none; margin-top: .4rem;
}

.home-dash-grid {
    display: grid; grid-template-columns: 1.15fr 1fr; gap: 1rem; margin-bottom: 1rem;
    align-items: stretch;
}
.home-dash-col { position: relative; min-width: 0; min-height: 0; }
.home-dash-col-inner {
    position: absolute; inset: 0;
    display: flex; flex-direction: column; gap: 1rem; min-height: 0;
}
.home-tip-panel { flex: 0 0 auto; }
@media (max-width: 900px) {
    .home-dash-grid { grid-template-columns: 1fr; }
    .home-dash-col { position: static; }
    .home-dash-col-inner { position: static; }
    .home-memo-panel { flex: none; height: 300px; }
}
.home-panel {
    background: var(--surface-color); border: 1px solid var(--border-color);
    border-radius: 12px; padding: .85rem 1rem 1rem; box-sizing: border-box;
    display: flex; flex-direction: column; min-width: 0;
}
.home-wide-panel { margin-bottom: 1rem; }
.home-wide-panel:last-child { margin-bottom: 0; }
.home-panel-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px; margin-bottom: .7rem; min-height: 24px;
}
.home-panel-title { font-size: 13px; font-weight: 600; color: var(--text-main); margin: 0; }

.home-cal-nav { display: inline-flex; align-items: center; gap: 2px; }
.home-cal-arrow {
    height: 22px; min-width: 22px; padding: 0 5px; border: none; background: none; cursor: pointer;
    border-radius: 6px; color: var(--text-muted); font: inherit; font-size: 11px; font-weight: 500;
    display: inline-flex; align-items: center; justify-content: center; transition: background .12s, color .12s;
}
.home-cal-arrow svg { width: 12px; height: 12px; }
.home-cal-arrow:hover { background: var(--surface-2); color: var(--text-main); }
.home-cal-today-btn { margin-left: 3px; }
.home-cal-label {
    font-size: 13px; font-weight: 600; color: var(--text-main);
    min-width: 84px; text-align: center;
}
/* 셀 높이와 막대 위치를 같은 변수로 계산한다 — JS도 이 값을 읽어 쓰므로 서로 어긋나지 않는다 */
.home-cal {
    display: grid; grid-template-columns: repeat(7, 1fr); position: relative; user-select: none;
    --cal-pad-t: 3px; --cal-pad-b: 4px; --cal-num-h: 17px;
    --cal-bar-h: 16px; --cal-bar-gap: 2px; --cal-lanes: 2;
}
.home-cal-wd {
    text-align: center; font-size: 10px; font-weight: 500; color: var(--text-muted);
    padding-bottom: 6px;
}
.home-cal-wd.sun { color: var(--danger-color); }
.home-cal-wd.sat { color: #3b6ea5; }
[data-theme="dark"] .home-cal-wd.sat { color: #7ea6d8; }

/* 날짜 숫자를 flex 아이템으로 둬서 딱 --cal-num-h 만큼만 차지하게 한다 —
   inline 요소로 두면 줄상자(line-height:normal)가 더 높아 첫 일정 막대와 겹친다.
   높이 계산에 테두리 1px도 포함해야 JS가 잡는 막대 위치와 어긋나지 않는다 */
.home-cal-day {
    position: relative; box-sizing: border-box; cursor: pointer;
    display: flex; flex-direction: column; align-items: flex-start;
    padding: var(--cal-pad-t) 3px var(--cal-pad-b);
    height: calc(1px + var(--cal-pad-t) + var(--cal-num-h)
                 + var(--cal-lanes) * (var(--cal-bar-h) + var(--cal-bar-gap))
                 + var(--cal-bar-h) + var(--cal-pad-b));
    border-top: 1px solid var(--border-color);
    transition: background .12s;
}
.home-cal-day.pad { cursor: default; }
.home-cal-day.pad .home-cal-num { color: var(--text-faint); opacity: .45; }
.home-cal-day:not(.pad):hover { background: var(--surface-2); }
.home-cal-day.drag-range { background: var(--accent-hover); }
.home-cal-day.sel { background: var(--surface-2); box-shadow: inset 0 0 0 1.5px var(--accent-color); border-radius: 6px; }
.home-cal-num {
    font-size: 11px; color: var(--text-main); line-height: 1;
    min-width: var(--cal-num-h); height: var(--cal-num-h); padding: 0 4px; box-sizing: border-box;
    display: inline-flex; align-items: center; justify-content: center;
    flex: 0 0 auto; border-radius: 6px;
}
.home-cal-day.sun .home-cal-num { color: var(--danger-color); }
.home-cal-day.sat .home-cal-num { color: #3b6ea5; }
[data-theme="dark"] .home-cal-day.sat .home-cal-num { color: #7ea6d8; }
.home-cal-day.today .home-cal-num { background: var(--accent-color); color: #fff; font-weight: 600; }

.home-cal-bars { position: absolute; inset: 0; pointer-events: none; }
.home-cal-bar {
    position: absolute; pointer-events: auto; cursor: pointer;
    font-size: 10px; line-height: 16px; height: 16px; border-radius: 5px; padding: 0 6px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; box-sizing: border-box;
}
.home-cal-bar.ev-done { opacity: .5; text-decoration: line-through; }
.home-cal-more {
    position: absolute; pointer-events: auto; cursor: pointer;
    font-size: 9px; color: var(--text-faint); line-height: 16px;
}

.sch-rose  { background: #fbe0e0; color: #96393c; }
.sch-peach { background: #fdead7; color: #8f5527; }
.sch-sand  { background: #f5eed6; color: #756224; }
.sch-mint  { background: #d9efe2; color: #2c6349; }
.sch-sky   { background: #dbe9f7; color: #2b567d; }
.sch-lilac { background: #e5e1f6; color: #4e4585; }
.sch-gray  { background: #e8e6e1; color: #57544c; }
[data-theme="dark"] .sch-rose  { background: #4a2b2e; color: #f0c3c5; }
[data-theme="dark"] .sch-peach { background: #4a3524; color: #f3d3b3; }
[data-theme="dark"] .sch-sand  { background: #45401f; color: #ece3b4; }
[data-theme="dark"] .sch-mint  { background: #23412f; color: #b9e3cd; }
[data-theme="dark"] .sch-sky   { background: #24374a; color: #bcd8ef; }
[data-theme="dark"] .sch-lilac { background: #322d4e; color: #cec7ee; }
[data-theme="dark"] .sch-gray  { background: #35332e; color: #d5d2cb; }

.sched-swatches { display: flex; gap: 6px; margin-top: 12px; }
.sched-sw {
    width: 26px; height: 26px; border-radius: 7px; cursor: pointer; padding: 0;
    border: 2px solid transparent; box-shadow: 0 0 0 1px var(--border-color) inset;
    transition: transform .1s;
}
.sched-sw:hover { transform: scale(1.1); }
.sched-sw.on { border-color: var(--text-main); }

.home-cal-agenda { margin-top: .9rem; border-top: 1px solid var(--border-color); padding-top: .7rem; }
.home-agenda-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: .5rem; }
.home-agenda-title { font-size: 12px; font-weight: 600; color: var(--text-main); }
.home-agenda-add {
    display: inline-flex; align-items: center; gap: 4px; cursor: pointer;
    border: 1px solid var(--border-color); background: var(--surface-color);
    border-radius: 7px; height: 24px; padding: 0 9px;
    font: inherit; font-size: 11px; font-weight: 500; color: var(--text-muted);
    transition: background .12s, color .12s, border-color .12s;
}
.home-agenda-add svg { width: 11px; height: 11px; }
.home-agenda-add:hover { border-color: var(--accent-color); color: var(--accent-color); background: var(--accent-hover); }
/* 스크롤 없이 6개씩 끊어 보여 준다 — 세로로 3개 채우고 다음 열로, 나머지는 캐러셀로 */
.home-agenda-list {
    display: grid; grid-template-rows: repeat(3, min-content);
    grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr);
    column-gap: 10px; row-gap: 3px;
}
.home-agenda-list .home-agenda-empty { grid-row: 1 / -1; }
@media (max-width: 640px) {
    .home-agenda-list { grid-template-rows: none; grid-auto-flow: row; grid-auto-columns: auto; }
}
.home-agenda-item {
    display: flex; align-items: center; gap: 8px; padding: 5px 7px; border-radius: 7px;
    transition: background .12s;
}
.home-agenda-item:hover { background: var(--surface-2); }
.home-agenda-check {
    width: 15px; height: 15px; flex-shrink: 0; box-sizing: border-box; padding: 0; cursor: pointer;
    border: 1.6px solid var(--text-faint); border-radius: 5px; background: none;
    display: inline-flex; align-items: center; justify-content: center; color: #fff;
}
.home-agenda-check svg { width: 9px; height: 9px; opacity: 0; }
.home-agenda-item.done .home-agenda-check { background: var(--accent-color); border-color: var(--accent-color); }
.home-agenda-item.done .home-agenda-check svg { opacity: 1; }
.home-agenda-name {
    flex: 1; min-width: 0; font-size: 12px; color: var(--text-main); cursor: pointer;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.home-agenda-item.done .home-agenda-name { text-decoration: line-through; color: var(--text-faint); }
.home-agenda-range { font-size: 10px; color: var(--text-faint); flex-shrink: 0; }
.home-agenda-empty { font-size: 12px; color: var(--text-faint); padding: 10px 2px; }

.home-memo-panel { flex: 1 1 0; min-height: 0; }
.home-tip { display: flex; flex-direction: column; gap: 7px; }
.home-tip-en {
    font-size: 14px; font-weight: 600; color: var(--text-main);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    word-break: break-word;
}
.home-tip-ko { font-size: 12px; color: var(--text-muted); word-break: break-word; }
.home-tip-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 2px; }
.home-tip-cat { font-size: 11px; color: var(--text-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-tip-copy { flex-shrink: 0; }
.home-tip-empty { font-size: 12px; color: var(--text-faint); }

.sticky-list { display: flex; flex-direction: column; gap: 6px; flex: 1; min-height: 0; overflow-y: auto; }
.sticky-card {
    border: 1px solid var(--border-color); border-radius: 9px; background: var(--bg-color);
    padding: 9px 11px; cursor: pointer; transition: border-color .12s, background .12s;
}
.sticky-card:hover { border-color: var(--accent-color); background: var(--accent-hover); }
.sticky-card-text {
    font-size: 12px; color: var(--text-main); line-height: 1.6;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.sticky-card-date { font-size: 10px; color: var(--text-faint); margin-top: 5px; }
.sticky-empty {
    font-size: 12px; color: var(--text-faint); text-align: center;
    border: 1px dashed var(--border-color); border-radius: 9px; padding: 1.6rem 1rem;
}

.sticky-editor { display: flex; flex-direction: column; gap: 7px; flex: 1; min-height: 0; }
.sticky-headbar { display: flex; align-items: center; gap: 6px; min-width: 0; }
.sticky-back { font-size: 12px; }
.sticky-back svg { width: 13px; height: 13px; }
.sticky-del { width: 24px; height: 24px; }
.sticky-del svg { width: 13px; height: 13px; }
.sticky-del:hover { border-color: var(--danger-color) !important; color: var(--danger-color) !important; background: transparent !important; }
.sticky-body {
    flex: 1; min-height: 0; overflow-y: auto; box-sizing: border-box;
    border: 1px solid var(--border-color); border-radius: 9px; padding: 11px 13px;
    background: var(--bg-color); color: var(--text-main);
    font-size: 13px; line-height: 1.75; outline: none;
}
.sticky-body:focus { border-color: var(--accent-color); }
.sticky-body:empty::before { content: attr(data-placeholder); color: var(--text-faint); }
.sticky-body ul, .sticky-body ol { margin: .3rem 0; padding-left: 1.3rem; }
.sticky-body .doc-check-li { font-size: 13px; }
.sticky-toolbar {
    display: flex; align-items: center; gap: 2px; flex-wrap: wrap;
    border: 1px solid var(--border-color); border-radius: 9px; padding: 4px 7px;
    background: var(--surface-color);
}

.home-section { margin-bottom: 2.5rem; }

.home-section-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 1rem;
    padding-right: 44px;
}
.home-section-title {
    font-size: 16px; font-weight: 600; color: var(--text-main); margin: 0;
}
.home-see-all {
    font-size: 12px; font-weight: 600; color: var(--accent-color);
    background: none; border: none; cursor: pointer; padding: 4px 10px;
    border-radius: 8px; transition: background .12s;
}
.home-see-all:hover { background: var(--accent-hover); }

.home-recent-grid { margin-bottom: 0; }
.home-recent-panel { min-height: 0; }

.home-mini-pager { display: inline-flex; align-items: center; gap: 2px; }
.home-mini-arrow {
    width: 22px; height: 22px; border-radius: 6px; padding: 0;
    border: none; background: none; color: var(--text-muted); cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    transition: background .12s, color .12s;
}
.home-mini-arrow svg { width: 13px; height: 13px; }
.home-mini-arrow:hover:not(:disabled) { background: var(--surface-2); color: var(--text-main); }
.home-mini-arrow:disabled { opacity: .3; cursor: default; }

.home-recent-list { display: flex; flex-direction: column; gap: 6px; }
.home-recent-row {
    display: flex; align-items: center; gap: 11px; padding: 9px 10px;
    background: var(--bg-color); border: 1px solid var(--border-color);
    border-radius: 11px; cursor: pointer; box-sizing: border-box;
    transition: border-color .15s, background .15s;
}
.home-recent-row:hover { border-color: var(--accent-color); background: var(--accent-hover); }
.home-recent-icon {
    width: 34px; height: 34px; border-radius: 9px; box-sizing: border-box;
    background: var(--surface-color); border: 1px solid var(--border-color);
    display: flex; align-items: center; justify-content: center; color: var(--accent-color);
    flex-shrink: 0;
}
.home-recent-icon svg { width: 17px; height: 17px; }
.home-note-card-icon {
    width: 36px; height: 36px; border-radius: 9px; box-sizing: border-box;
    border: 1px solid var(--border-color); background: var(--surface-color);
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.home-note-card-icon svg { width: 18px; height: 18px; }
.home-note-icon-doc,
.home-note-icon-canvas { color: var(--doc-text); }
.home-recent-body { flex: 1; min-width: 0; }
.home-recent-name {
    font-size: 13px; font-weight: 500; color: var(--text-main); line-height: 1.3;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.home-recent-sub {
    font-size: 11px; color: var(--text-muted); line-height: 1.3; margin-top: 2px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.home-recent-date { font-size: 11px; color: var(--text-faint); flex-shrink: 0; }

.home-car-empty {
    color: var(--text-muted); font-size: 13px;
    padding: 1.6rem; text-align: center;
    border: 1px dashed var(--border-color); border-radius: 11px;
}

#homeTabContent .ps-page {
    padding-top: 2.5rem;
}
.home-proj-tab-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 1.5rem;
}
.home-proj-tab-title {
    font-size: 18px; font-weight: 600; color: var(--text-main); margin: 0;
}

.note-list-controlbar {
    align-items: flex-start;
}
.note-folder-panel {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: .55rem;
}
.note-folder-head {
    display: flex;
    align-items: center;
    gap: .45rem;
    flex-wrap: wrap;
}
.note-folder-root,
.note-folder-add-btn {
    height: 34px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--border-color);
    background: var(--surface-color);
    color: var(--text-muted);
    border-radius: 10px;
    padding: 0 .8rem;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s ease;
}
.note-folder-root:hover,
.note-folder-add-btn:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
    background: var(--accent-hover);
}
.note-folder-root.active {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: #fff;
}
.note-folder-root-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    opacity: .8;
}
.note-folder-add-btn svg { flex: 0 0 auto; }
.note-folder-tree {
    display: flex;
    flex-direction: column;
    gap: 3px;
    max-width: min(760px, 100%);
}
.note-folder-empty {
    color: var(--text-muted);
    font-size: 13px;
    padding: .35rem .2rem;
}
.note-folder-wrap { min-width: 0; }
.note-folder-node {
    --folder-depth: 0;
    --folder-color: var(--accent-color);
    position: relative;
    min-width: 0;
    height: 34px;
    display: grid;
    grid-template-columns: 22px 20px 22px minmax(0, 1fr) 28px 28px;
    align-items: center;
    gap: 4px;
    padding: 0 6px 0 calc(4px + (var(--folder-depth) * 18px));
    border: 1px solid transparent;
    border-radius: 10px;
    color: var(--text-muted);
    transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.note-folder-node:hover {
    background: color-mix(in srgb, var(--surface-color) 80%, var(--accent-hover));
    border-color: var(--border-color);
    color: var(--text-main);
}
.note-folder-node.active {
    background: var(--accent-hover);
    border-color: color-mix(in srgb, var(--folder-color) 55%, var(--border-color));
    color: var(--text-main);
}
.note-folder-node.dragging { opacity: .45; }
.note-folder-node.drop-before::before,
.note-folder-node.drop-after::after {
    content: '';
    position: absolute;
    left: calc(8px + (var(--folder-depth) * 18px));
    right: 8px;
    height: 2px;
    border-radius: 2px;
    background: var(--accent-color);
    z-index: 3;
}
.note-folder-node.drop-before::before { top: -1px; }
.note-folder-node.drop-after::after { bottom: -1px; }
.note-folder-node.drop-into {
    outline: 1.5px solid var(--accent-color);
    outline-offset: -1.5px;
    background: var(--accent-hover);
}
.note-folder-drag {
    cursor: grab;
    opacity: .42;
    user-select: none;
    text-align: center;
    font-size: 16px;
}
.note-folder-drag:hover { opacity: .9; color: var(--accent-color); }
.note-folder-drag:active { cursor: grabbing; }
.note-folder-caret,
.note-folder-more {
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: inherit;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
}
.note-folder-caret:hover,
.note-folder-more:hover { background: var(--bg-color); color: var(--text-main); }
.note-folder-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--folder-color);
}
.note-folder-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
    font-weight: 600;
    outline: none;
    cursor: text;
    caret-color: var(--text-main) !important;
    user-select: text;
    -webkit-user-select: text;
}
.note-folder-name:focus,
.note-folder-name.editing {
    background: var(--bg-color);
    border-radius: 6px;
    padding: 2px 5px;
}
.note-folder-color {
    width: 22px;
    height: 22px;
    padding: 0;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
    overflow: hidden;
}
.note-folder-color::-webkit-color-swatch-wrapper { padding: 0; }
.note-folder-color::-webkit-color-swatch { border: none; border-radius: 50%; }
.note-folder-children {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.note-folder-menu .enc-opts-item { min-width: 140px; }

.note-folder-select-row {
    display: flex;
    align-items: center;
    gap: .45rem;
}
.note-folder-select {
    flex: 1 1 auto;
    min-width: 0;
    height: 38px;
    border: 1px solid var(--border-color);
    border-radius: 9px;
    background: var(--bg-color);
    color: var(--text-main);
    padding: 0 .75rem;
    font: inherit;
    font-size: 14px;
    outline: none;
}
.note-folder-select:focus { border-color: var(--accent-color); }
.note-folder-inline-add,
.note-folder-inline-box button {
    height: 38px;
    border: 1px dashed var(--accent-color);
    border-radius: 9px;
    background: transparent;
    color: var(--accent-color);
    font-size: 13px;
    font-weight: 600;
    padding: 0 .75rem;
    cursor: pointer;
    white-space: nowrap;
}
.note-folder-inline-add:hover,
.note-folder-inline-box button:hover { background: var(--accent-hover); }
.note-folder-inline-box {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    flex: 1 1 auto;
}
.note-folder-inline-box input {
    height: 38px;
    min-width: 0;
    flex: 1 1 auto;
}

.note-card { cursor: pointer; }
.note-card-handle { cursor: grab; }
.note-card-handle:hover { opacity: 1 !important; color: var(--accent-color); }
.note-card-title {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    word-break: normal;
}
.note-card-title[contenteditable="true"] {
    cursor: text;
    user-select: text;
    -webkit-user-select: text;
    caret-color: var(--text-main) !important;
    outline: none;
    border-radius: 6px;
}
.note-card-title[contenteditable="true"]:focus {
    background: var(--bg-color);
    padding: 1px 4px;
    box-shadow: 0 0 0 1px var(--accent-color) inset;
}
.note-card-desc {
    overflow: hidden;
    text-overflow: ellipsis;
}
#noteGrid.note-view-list .note-card-title, .note-grid-section-body.note-view-list .note-card-title,
#noteGrid.note-view-list .note-card-desc , .note-grid-section-body.note-view-list .note-card-desc  {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
#noteGrid.note-view-list .note-card-main , .note-grid-section-body.note-view-list .note-card-main  { min-width: 0; }

@media (max-width: 820px) {
    .note-list-controlbar { flex-direction: column; align-items: stretch; }
    .note-list-actions { justify-content: flex-end; }
    .note-folder-tree { max-width: 100%; }
}

#memoTabContent .note-list-view.note-split-view {
    max-width: 1280px;
    width: min(1280px, calc(100vw - var(--dock-w, 78px) - 4rem));
    margin: 0 auto;
    padding: var(--tab-top-gap) 2rem 6rem;
    box-sizing: border-box;
    display: grid;
    grid-template-columns: minmax(250px, 310px) minmax(0, 1fr);
    gap: 1.25rem;
    align-items: start;
}
.note-split-sidebar {
    min-width: 0;
    position: sticky;
    top: 1.25rem;
    align-self: start;
}
.note-split-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.note-split-mainbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 38px;
}
.note-current-folder-title {
    min-width: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.note-folder-panel {
    width: 100%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: .75rem;
}
.note-folder-head {
    display: flex;
    align-items: center;
    gap: .45rem;
    flex-wrap: wrap;
}
.note-folder-root,
.note-folder-add-btn {
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1px solid var(--border-color);
    background: var(--surface-color);
    color: var(--text-muted);
    border-radius: 10px;
    padding: 0 .78rem;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: border-color .15s, background .15s, color .15s;
    white-space: nowrap;
}
.note-folder-root:hover,
.note-folder-add-btn:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
    background: var(--accent-hover);
}
.note-folder-root.active {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: #fff;
}
.note-add-side-btn { background: var(--surface-color); color: var(--text-muted); }
.note-folder-root-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    opacity: .85;
}
.note-folder-tree {
    width: 100%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 7px;
}
.note-folder-empty {
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
    padding: 1rem .75rem;
    border: 1.5px dashed var(--border-color);
    border-radius: 10px;
    opacity: .82;
}
.note-folder-wrap {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.note-folder-node {
    --folder-depth: 0;
    --folder-color: #64748b;
    position: relative;
    min-width: 0;
    min-height: 36px;
    display: grid;
    grid-template-columns: 18px 18px 20px minmax(0, 1fr) 28px;
    align-items: center;
    gap: 5px;
    padding: 0 8px 0 calc(8px + (var(--folder-depth) * 18px));
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--surface-color);
    color: var(--text-muted);
    overflow: hidden;
    transition: border-color .15s, background .15s, box-shadow .15s, color .15s;
}
.note-folder-node:hover {
    border-color: color-mix(in srgb, var(--folder-color) 35%, var(--border-color));
    color: var(--text-main);
    background: color-mix(in srgb, var(--surface-color) 88%, var(--accent-hover));
}
.note-folder-node.active {
    border-color: color-mix(in srgb, var(--folder-color) 55%, var(--border-color));
    background: color-mix(in srgb, var(--folder-color) 16%, var(--surface-color));
    color: var(--text-main);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--folder-color) 22%, transparent) inset;
}
.note-folder-node.dragging { opacity: .45; }
.note-folder-node.drop-before::before,
.note-folder-node.drop-after::after {
    content:'';
    position:absolute;
    left: calc(8px + (var(--folder-depth) * 18px));
    right: 8px;
    height: 2px;
    border-radius: 2px;
    background: var(--accent-color);
    z-index: 4;
}
.note-folder-node.drop-before::before { top: -1px; }
.note-folder-node.drop-after::after { bottom: -1px; }
.note-folder-node.drop-into {
    outline: 1.5px solid var(--accent-color);
    outline-offset: -1.5px;
    background: var(--accent-hover);
}
.note-folder-drag {
    color: var(--text-muted);
    cursor: grab;
    user-select: none;
    opacity: .5;
    font-size: 14px;
    line-height: 1;
    text-align: center;
}
.note-folder-drag:hover { opacity: .95; color: var(--accent-color); }
.note-folder-drag:active { cursor: grabbing; }
.note-folder-caret,
.note-folder-more {
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: inherit;
    border-radius: 6px;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    transition: background .12s, color .12s, transform .18s ease;
}
.note-folder-caret:disabled { opacity: .28; cursor: default; }
.note-folder-caret svg { transform: rotate(90deg); transition: transform .18s ease; }
.note-folder-node.collapsed .note-folder-caret svg { transform: rotate(0deg); }
.note-folder-caret:hover:not(:disabled),
.note-folder-more:hover { background: var(--bg-color); color: var(--accent-color); }
.note-folder-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--folder-color);
    min-width: 0;
}
.note-folder-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
    font-weight: 850;
    color: var(--text-main);
    cursor: default;
    user-select: none;
    -webkit-user-select: none;
    caret-color: transparent !important;
}
.note-folder-children {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.note-folder-color { display: none !important; }
.note-folder-menu .enc-opts-item { min-width: 140px; }

.note-split-main #noteGrid.note-view-block, .note-split-main .note-grid-section-body.note-view-block {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
}
.note-split-main #noteGrid.note-view-list, .note-split-main .note-grid-section-body.note-view-list {
    display: flex;
    flex-direction: column;
    gap: .55rem;
}
.note-card-title {
    cursor: default !important;
    user-select: none !important;
    -webkit-user-select: none !important;
    caret-color: transparent !important;
}
.note-card-title[contenteditable="true"] {
    cursor: default !important;
    user-select: none !important;
    -webkit-user-select: none !important;
    caret-color: transparent !important;
    box-shadow: none !important;
    background: transparent !important;
    padding: 0 !important;
}
.note-card-main { min-width: 0; }

.note-folder-info-modal .ps-modal-field { margin-bottom: 1rem; }
.note-folder-color-chips {
    display: block;
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
}
.note-folder-info-modal .note-folder-color-tool {
    gap: 10px;
    padding: .75rem;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    background: var(--bg-color);
}
.note-folder-info-modal .sv-picker {
    height: 130px;
    max-width: 100%;
}
.note-folder-info-modal .hex-preview {
    cursor: default;
}
.note-folder-info-modal .hex-preview:hover {
    transform: none;
}
.note-folder-info-modal .note-folder-preset-strip {
    flex-wrap: wrap;
    overflow: visible;
    padding: 4px 2px 0;
}
.note-folder-info-modal .note-folder-preset-swatch {
    width: 28px;
    height: 28px;
}

@media (max-width: 900px) {
    #memoTabContent .note-list-view.note-split-view {
        width: 100%;
        padding: var(--tab-top-gap) 1rem 5rem;
        grid-template-columns: 1fr;
    }
    .note-split-sidebar { position: static; }
}

#memoTabContent .note-list-view.note-split-view {
    --note-folder-panel-w: 330px;
    max-width: 1360px;
    width: min(1360px, calc(100vw - var(--dock-w, 78px) - 4rem));
    grid-template-columns: minmax(240px, var(--note-folder-panel-w)) 14px minmax(0, 1fr);
    column-gap: 1.25rem;
}

.note-split-resizer {
    width: 14px;
    min-height: calc(100vh - 13rem);
    align-self: stretch;
    position: sticky;
    top: 1.25rem;
    cursor: col-resize;
    display: flex;
    align-items: stretch;
    justify-content: center;
    touch-action: none;
}

.note-split-resizer::before {
    content: '';
    display: block;
    width: 1px;
    min-height: 100%;
    border-radius: 999px;
    background: color-mix(in srgb, var(--border-color) 82%, transparent);
    transition: background .15s ease, width .15s ease, box-shadow .15s ease;
}

.note-split-resizer:hover::before,
body.note-split-resizing .note-split-resizer::before {
    width: 2px;
    background: color-mix(in srgb, var(--accent-color) 70%, var(--border-color));
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-color) 14%, transparent);
}

body.note-split-resizing {
    cursor: col-resize !important;
    user-select: none !important;
}

.note-folder-head {
    gap: .5rem;
}

.note-folder-add-btn,
.note-add-side-btn {
    height: 34px;
    font-size: 13px;
    border-color: var(--border-color);
    background: color-mix(in srgb, var(--surface-color) 92%, var(--bg-color));
    color: var(--text-muted);
}

.note-folder-tree {
    gap: 7px;
}

.note-folder-uncat {
    width: 100%;
    height: 42px;
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    padding: 0 10px;
    border: 1px solid var(--border-color);
    border-radius: 11px;
    background: var(--surface-color);
    color: var(--text-muted);
    cursor: pointer;
    font: inherit;
    text-align: left;
    transition: border-color .15s ease, background .15s ease, color .15s ease, box-shadow .15s ease;
}

.note-folder-uncat:hover {
    border-color: var(--accent-color);
    color: var(--text-main);
    background: color-mix(in srgb, var(--surface-color) 88%, var(--accent-hover));
}

.note-folder-uncat.active {
    border-color: color-mix(in srgb, var(--accent-color) 65%, var(--border-color));
    background: color-mix(in srgb, var(--accent-color) 16%, var(--surface-color));
    color: var(--text-main);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent-color) 18%, transparent) inset;
}

.note-folder-uncat-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: var(--text-muted);
    opacity: .8;
}

.note-folder-uncat.active .note-folder-uncat-dot {
    background: var(--accent-color);
    opacity: 1;
}

.note-folder-uncat-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 16px;
    font-weight: 850;
}

.note-folder-separator {
    height: 1px;
    margin: .45rem .25rem .6rem;
    background: color-mix(in srgb, var(--border-color) 78%, transparent);
}

.note-folder-node {
    min-height: 42px;
    grid-template-columns: 20px 22px minmax(0, 1fr) 28px;
    gap: 7px;
    padding: 0 8px 0 calc(10px + (var(--folder-depth) * 20px));
    cursor: grab;
}

.note-folder-node:active {
    cursor: grabbing;
}

.note-folder-node .note-folder-caret,
.note-folder-node .note-folder-more {
    cursor: pointer;
}

.note-folder-drag,
.note-card-handle {
    display: none !important;
}

.note-folder-name {
    font-size: 16px;
    font-weight: 850;
}

.note-card {
    cursor: grab;
}

.note-card:active {
    cursor: grabbing;
}

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

#noteGrid.note-view-list .note-card , .note-grid-section-body.note-view-list .note-card  {
    padding-left: 1.2rem;
}

@media (max-width: 900px) {
    #memoTabContent .note-list-view.note-split-view {
        grid-template-columns: 1fr;
        column-gap: 0;
    }

    .note-split-resizer {
        display: none;
    }
}

.note-folder-name,
.note-folder-uncat-name {
    font-weight: 600;
}

.doc-table-wrap {
    margin: 0.9rem 0;
    padding: 30px 6px 6px 26px;
    text-align: left !important;
}
.doc-table-wrap[data-align="left"],
.doc-table-wrap[data-align="center"],
.doc-table-wrap[data-align="right"] { text-align: left !important; }
.dt-align-toolbar { display: none !important; }
.doc-table { display: table; width: 100%; }
.doc-table td.dt-cell-selected,
.doc-table th.dt-cell-selected {
    background: color-mix(in srgb, var(--accent-color) 22%, transparent) !important;
    outline: 2px solid var(--accent-color);
    outline-offset: -2px;
}
.doc-table td.dt-header-row,
.doc-table th.dt-header-row {
    background: #E0E7FF;
    color: #111827;
    font-weight: 750;
}
.doc-table td.dt-header-col,
.doc-table th.dt-header-col {
    background: #EEF2FF;
    color: #111827;
    font-weight: 600;
}
.doc-table td.dt-header-row.dt-header-col,
.doc-table th.dt-header-row.dt-header-col {
    background: #C7D2FE;
    color: #111827;
}
[data-theme="dark"] .doc-table td.dt-header-row,
[data-theme="dark"] .doc-table th.dt-header-row {
    background: #373B4A;
    color: #F8FAFC;
}
[data-theme="dark"] .doc-table td.dt-header-col,
[data-theme="dark"] .doc-table th.dt-header-col {
    background: #2D3342;
    color: #F8FAFC;
}
[data-theme="dark"] .doc-table td.dt-header-row.dt-header-col,
[data-theme="dark"] .doc-table th.dt-header-row.dt-header-col {
    background: #4F46E5;
    color: #FFFFFF;
}
.dt-table-ctrl { transition: opacity .15s ease, transform .15s ease; }
.doc-table-wrap:hover .dt-table-ctrl,
.dt-table-ctrl:hover { opacity: .9; }
.dt-add {
    border-radius: 7px;
    transition: opacity .18s ease .18s, background .12s, color .12s, border-color .12s;
}
.doc-table-wrap:hover .dt-add,
.dt-add:hover { opacity: .82; }
.dt-add:hover { transition-delay: 0s; }
.dt-add-col svg, .dt-add-row svg { width: 15px; height: 15px; }
.dt-table-settings-menu {
    min-width: 292px;
    max-width: 320px;
    padding: 8px;
}
.dt-menu-title {
    padding: 4px 6px 7px;
    font-size: .66rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .055em;
}
.dt-switch-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin: 0 0 8px;
}
.dt-toggle {
    border: 1px solid var(--border-color);
    background: var(--bg-color);
    color: var(--text-muted);
    border-radius: 8px;
    padding: 6px 8px;
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}
.dt-toggle:hover,
.dt-toggle.active {
    border-color: var(--accent-color);
    background: var(--accent-hover);
    color: var(--accent-color);
}

.nc-item.nc-image img.nc-img-loading {
    min-width: 120px;
    min-height: 90px;
    background: linear-gradient(135deg, var(--bg-color), var(--surface-color));
    border: 1px dashed var(--border-color);
}
.nc-item.nc-image img.nc-img-loading::after { content: ''; }

.doc-table-wrap {
    overflow: visible !important;
}
.doc-table {
    border-collapse: separate !important;
    border-spacing: 0 !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    background: var(--surface-color);
}
.doc-table td,
.doc-table th {
    border: 0 !important;
    border-right: 1.5px solid var(--border-color) !important;
    border-bottom: 1.5px solid var(--border-color) !important;
}
.doc-table tr:first-child > td,
.doc-table tr:first-child > th { border-top: 1.5px solid var(--border-color) !important; }
.doc-table tr > td:first-child,
.doc-table tr > th:first-child { border-left: 1.5px solid var(--border-color) !important; }
.doc-table tr:first-child > td:first-child,
.doc-table tr:first-child > th:first-child { border-top-left-radius: 12px; }
.doc-table tr:first-child > td:last-child,
.doc-table tr:first-child > th:last-child { border-top-right-radius: 12px; }
.doc-table tr:last-child > td:first-child,
.doc-table tr:last-child > th:first-child { border-bottom-left-radius: 12px; }
.doc-table tr:last-child > td:last-child,
.doc-table tr:last-child > th:last-child { border-bottom-right-radius: 12px; }

.doc-table td.dt-header-row,
.doc-table th.dt-header-row {
    background: color-mix(in srgb, #818CF8 22%, transparent);
    color: var(--text-main);
    font-weight: 750;
}
.doc-table td.dt-header-col,
.doc-table th.dt-header-col {
    background: color-mix(in srgb, #93C5FD 18%, transparent);
    color: var(--text-main);
    font-weight: 600;
}
.doc-table td.dt-header-row.dt-header-col,
.doc-table th.dt-header-row.dt-header-col {
    background: color-mix(in srgb, #818CF8 22%, transparent);
    color: var(--text-main);
    font-weight: 750;
}
[data-theme="dark"] .doc-table td.dt-header-row,
[data-theme="dark"] .doc-table th.dt-header-row {
    background: color-mix(in srgb, #818CF8 20%, transparent);
    color: var(--text-main);
}
[data-theme="dark"] .doc-table td.dt-header-col,
[data-theme="dark"] .doc-table th.dt-header-col {
    background: color-mix(in srgb, #60A5FA 16%, transparent);
    color: var(--text-main);
}
[data-theme="dark"] .doc-table td.dt-header-row.dt-header-col,
[data-theme="dark"] .doc-table th.dt-header-row.dt-header-col {
    background: color-mix(in srgb, #818CF8 20%, transparent);
    color: var(--text-main);
}

.dt-table-settings-menu {
    position: fixed;
    min-width: 244px;
    max-width: 280px;
    padding: 8px;
}
.dt-header-setting-row {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0 0 7px;
}
.dt-header-setting-row .dt-toggle {
    flex: 1 1 auto;
    justify-content: flex-start;
}
.doc-table-menu .dt-header-color-btn {
    width: 34px !important;
    height: 34px;
    flex: 0 0 34px;
    padding: 0 !important;
    justify-content: center;
    position: relative;
    border: 1px solid var(--border-color);
    background: var(--bg-color);
    color: var(--text-muted);
    border-radius: 9px;
}
.doc-table-menu .dt-header-color-btn:hover {
    border-color: var(--accent-color);
    background: var(--accent-hover);
    color: var(--accent-color);
}
.dt-header-color-btn svg {
    width: 16px !important;
    height: 16px !important;
    position: relative;
    z-index: 1;
}
.dt-header-color-dot {
    position: absolute;
    right: 4px;
    bottom: 4px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    border: 1px solid color-mix(in srgb, var(--surface-color) 70%, #000 30%);
    box-shadow: 0 0 0 1px rgba(0,0,0,.12);
}
.dt-header-color-pop {
    display: none;
    position: absolute;
    z-index: 9800;
    width: 252px;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--surface-color);
    box-shadow: var(--shadow-popup);
    box-sizing: border-box;
}
.dt-header-color-pop.show { display: block; }
.dt-header-color-pop .sv-picker { height: 104px; }
.dt-header-color-pop .hex-row { gap: 7px; }
.dt-header-color-pop .nt-cp-swatches { max-height: none; }
.dt-block-moving { pointer-events: none; }
.doc-table-wrap { border-radius: 14px; }

.note-list-tools {
    margin-left: auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: .8rem;
    min-width: max-content;
}
.note-sort-trigger {
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: -.01em;
    padding: 0 2px 0 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: color .15s ease, background .15s ease;
}
.note-sort-trigger:hover {
    color: var(--accent-color);
    background: var(--accent-hover);
}
.note-sort-trigger svg {
    width: 13px;
    height: 13px;
    flex: 0 0 auto;
    transition: transform .15s ease;
}
.note-sort-trigger:hover svg { transform: translateY(1px); }
.note-sort-trigger[data-mode="name"],
.note-sort-trigger[data-mode="modified"] { color: var(--accent-color); }

.nc-text.nc-text-scroll-mode {
    max-height: 300px !important;
}
.nc-text.nc-text-scroll-mode .nc-text-inner {
    max-height: 300px !important;
    height: auto !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, .45) transparent;
}
.nc-text.nc-text-scroll-mode .nc-text-inner::-webkit-scrollbar { width: 5px; }
.nc-text.nc-text-scroll-mode .nc-text-inner::-webkit-scrollbar-track { background: transparent; }
.nc-text.nc-text-scroll-mode .nc-text-inner::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, .45);
    border-radius: 999px;
}
.nc-text.nc-text-scroll-mode .nc-text-inner::-webkit-scrollbar-thumb:hover { background: rgba(148, 163, 184, .72); }
.nc-ctx-sep-strong {
    height: 1px;
    background: color-mix(in srgb, var(--border-color) 90%, var(--text-main));
    margin: 10px 0 8px;
}
.nc-textmode-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-top: 6px;
}
.nc-textmode-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 34px;
    border: 1px solid var(--border-color);
    border-radius: 9px;
    background: var(--bg-color);
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease, color .15s ease, transform .12s ease;
}
.nc-textmode-btn svg { width: 14px; height: 14px; flex: 0 0 auto; }
.nc-textmode-btn:hover {
    border-color: var(--accent-color);
    background: var(--accent-hover);
    color: var(--accent-color);
}
.nc-textmode-btn.active {
    border-color: var(--accent-color);
    background: var(--accent-hover);
    color: var(--accent-color);
}

.note-folder-node.drop-before,
.note-folder-node.drop-after { overflow: visible !important; }

.chunk.chunk-has-fixed-tip::after,
.chunk.chunk-has-fixed-tip::before {
    display: none !important;
    content: none !important;
}
.chunk-fixed-tooltip {
    position: fixed;
    z-index: 2147483000;
    max-width: min(420px, calc(100vw - 20px));
    min-width: 120px;
    box-sizing: border-box;
    padding: 6px 10px;
    border-radius: 6px;
    background: var(--surface-color);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.45;
    text-align: left;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-2px);
    transition: opacity .12s ease, transform .12s ease, visibility .12s ease;
}
.chunk-fixed-tooltip.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.chunk-fixed-tooltip::after {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
}
.chunk-fixed-tooltip[data-placement="bottom"]::after {
    bottom: 100%;
    border-bottom-color: var(--border-color);
}
.chunk-fixed-tooltip[data-placement="top"]::after {
    top: 100%;
    border-top-color: var(--border-color);
}

.corda-tip {
    position: fixed;
    z-index: 2147483000;
    max-width: min(320px, calc(100vw - 20px));
    box-sizing: border-box;
    padding: 6px 10px;
    border-radius: 7px;
    background: var(--surface-color);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.45;
    text-align: left;
    white-space: normal;
    overflow-wrap: anywhere;
    pointer-events: none;
    opacity: 0;
    transform: translateY(-2px);
    transition: opacity .12s ease, transform .12s ease;
}
.corda-tip.show { opacity: 1; transform: translateY(0); }

#builderInput,
.dynamic-area#builderInput {
    white-space: pre-wrap !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
    overflow-x: hidden !important;
    resize: none;
}
#builderAreaSingle.conv-builder-longtext-ready {
    min-width: 0;
    overflow-x: hidden !important;
}
body.conv-scroll-mode #builderAreaSingle.conv-builder-fav-expanded {
    max-height: none !important;
    overflow-y: visible !important;
}
body.conv-scroll-mode #builderAreaSingle.conv-builder-fav-expanded #builderInput {
    overflow-y: hidden !important;
}

.mypage-page { max-width: 1200px; margin: 0 auto; padding: 2.5rem 2rem 6rem; box-sizing: border-box; }
.mypage-head h1 { font-size: 23px; font-weight: 600; color: var(--text-main); margin: 0 0 .3rem; }
.mypage-head p { font-size: 14px; color: var(--text-muted); margin: 0 0 1.75rem; }

.my-card { background: var(--surface-color); border: 1px solid var(--border-color); border-radius: 14px; padding: 1.2rem 1.3rem; max-width: 620px; margin-bottom: 1rem; }
.my-card p { font-size: 13px; color: var(--text-muted); line-height: 1.7; margin: 0; }
.my-card .mh { display: flex; align-items: center; gap: 9px; margin-bottom: .7rem; }
.my-card .mh .mh-ic { width: 17px; height: 17px; color: var(--accent-color); flex-shrink: 0; }
.my-card .mh .mh-ic svg { width: 100%; height: 100%; display: block; }
.my-card .mh .mh-t { font-size: 14px; font-weight: 600; color: var(--text-main); }
.my-card .mh .stat-chip { margin-left: auto; }

.my-card-auth { text-align: center; padding: 1.8rem 1.3rem; }
.my-auth-title { font-size: 14px; font-weight: 600; color: var(--text-main); margin-bottom: 4px; }
.my-card-auth p { margin-bottom: 1rem; }

.gbtn { display: inline-flex; align-items: center; gap: 9px; background: #fff; border: 1px solid #dadce0; border-radius: 8px; padding: 9px 18px; font: inherit; font-size: 13px; font-weight: 500; color: #3c4043; cursor: pointer; transition: box-shadow .15s, background .15s; }
.gbtn:hover { box-shadow: 0 1px 6px rgba(0,0,0,.18); background: #f7f8f8; }

.stat-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; background: var(--surface-2); color: var(--text-muted); border-radius: 999px; padding: 4px 11px; }
.stat-chip .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--text-faint); flex-shrink: 0; }
.stat-chip.ok { background: var(--success-soft); color: var(--success-color); }
.stat-chip.ok .dot { background: var(--success-color); }

.my-profile-row { display: flex; align-items: center; gap: 1rem; }
.avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--accent-hover); color: var(--accent-ink); display: flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 600; flex-shrink: 0; overflow: hidden; }
.my-avatar-img { width: 100%; height: 100%; object-fit: cover; }
.my-profile-name { font-size: 14px; font-weight: 600; color: var(--text-main); }
.my-profile-email { font-size: 12px; color: var(--text-muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.my-actions { display: flex; gap: .5rem; margin-top: .9rem; flex-wrap: wrap; }

.danger-zone { border: 1px solid var(--danger-soft); border-radius: 14px; padding: 1.1rem 1.3rem; background: var(--surface-color); max-width: 620px; }
.danger-zone .dt { font-size: 13px; font-weight: 600; color: var(--danger-color); margin-bottom: 5px; }
.danger-zone-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.danger-zone-row p { font-size: 12px; color: var(--text-muted); line-height: 1.7; margin: 0; }
.btn-danger-outline { color: var(--danger-color); border-color: var(--danger-soft); flex-shrink: 0; }
.btn-danger-outline:hover { border-color: var(--danger-color); background: var(--danger-soft); color: var(--danger-color); }

.mypage-toast { position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%) translateY(12px); background: var(--surface-color); color: var(--text-main); border: 1px solid var(--border-color); font-size: 14px; font-weight: 500; padding: 11px 20px; border-radius: 10px; box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 12000; }
.mypage-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.mypage-modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.55); display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 13000; animation: mypageFade .15s ease; }
@keyframes mypageFade { from { opacity: 0; } to { opacity: 1; } }
.mypage-modal, .dlg { background: var(--surface-color); border: 1px solid var(--border-color); border-radius: 16px; box-shadow: var(--shadow-lg); width: 100%; max-width: 420px; padding: 22px; box-sizing: border-box; }
.mypage-modal-wide { max-width: 520px; }
.mypage-modal-danger { border-color: color-mix(in srgb, var(--danger-color) 40%, var(--border-color)); }
.mypage-modal-title, .dlg h4 { font-size: 18px; font-weight: 600; color: var(--text-main); margin-bottom: 12px; }
.mypage-modal-body { font-size: 14px; color: var(--text-main); line-height: 1.6; }
.mypage-modal-body p { margin: 0 0 8px; }
.mypage-modal-list { margin: 8px 0; padding-left: 18px; color: var(--text-muted); font-size: 13px; line-height: 1.7; }
.mypage-modal-warn { color: var(--danger-color); font-weight: 600; }
.mypage-modal-label { display: block; font-size: 13px; color: var(--text-muted); margin: 14px 0 6px; }
.mypage-modal-input { width: 100%; box-sizing: border-box; background: var(--bg-color); border: 1px solid var(--border-color); border-radius: 9px; padding: 10px 12px; font: inherit; font-size: 14px; color: var(--text-main); }
.mypage-modal-input:focus { outline: none; border-color: var(--accent-color); }
.mypage-modal-actions, .dact { display: flex; gap: .5rem; justify-content: flex-end; margin-top: 18px; }

.price-tbl { width: 100%; border-collapse: collapse; font-size: 12px; }
.price-tbl th, .price-tbl td { padding: 8px 10px; border-bottom: 1px solid var(--border-color); text-align: center; }
.price-tbl th:first-child, .price-tbl td:first-child { text-align: left; color: var(--text-muted); font-weight: 500; }
.price-tbl th { background: var(--surface-2); font-weight: 600; color: var(--text-main); }
.price-tbl .pro { font-weight: 600; color: var(--text-main); }

input[type="text"], input[type="email"], input[type="search"], input[type="number"], textarea, select {
    font-family: inherit;
}
input[type="text"]:focus, input[type="email"]:focus, input[type="search"]:focus,
input[type="number"]:focus, textarea:focus, select:focus {
    outline: none; border-color: var(--accent-color);
    box-shadow: 0 0 0 3px var(--accent-hover);
}
.contact-input, .settings-input, .modal-input {
    border: 1.5px solid var(--border-color); border-radius: 8px;
    padding: 10px 13px; font-size: 13px; background: var(--surface-color); color: var(--text-main);
    transition: border-color .15s, box-shadow .15s;
}

.tab-topbar {
    position: sticky; top: 0; z-index: 800;
    display: flex; align-items: center; gap: 12px; flex-wrap: nowrap;
    height: 56px; padding: 0 20px; box-sizing: border-box;
    background: var(--surface-color); border-bottom: 1px solid var(--border-color);
}
.tt-back {
    display: inline-flex; align-items: center; gap: 5px; flex-shrink: 0;
    border: none; background: none; padding: 0; cursor: pointer;
    font: inherit; font-size: 13px; font-weight: 500; color: var(--text-muted);
    transition: color .15s;
}
.tt-back:hover { color: var(--text-main); }
.tt-back svg { width: 15px; height: 15px; }
.tt-title { font-size: 16px; font-weight: 600; color: var(--text-main); }
.tt-chip {
    font-size: 12px; font-weight: 500; padding: 4px 10px; border-radius: 7px;
    background: var(--surface-2); color: var(--text-muted);
}
.tt-spacer { flex: 1; }
.tt-btn {
    display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0;
    height: 32px; padding: 0 13px; border-radius: 8px; cursor: pointer;
    border: 1px solid var(--border-color); background: var(--surface-color);
    font: inherit; font-size: 13px; font-weight: 500; color: var(--text-main);
    transition: background .15s, border-color .15s;
}
.tt-btn:hover { background: var(--surface-2); border-color: var(--text-faint); }
.tt-btn svg { width: 15px; height: 15px; }
.tt-hist { display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0; }
.tt-icon {
    width: 32px; height: 32px; border-radius: 8px; cursor: pointer; padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--border-color); background: var(--surface-color); color: var(--text-muted);
    transition: background .15s, color .15s, border-color .15s;
}
.tt-icon svg { width: 16px; height: 16px; }
.tt-icon:hover:not(:disabled) { border-color: var(--accent-color); color: var(--accent-color); background: var(--accent-hover); }
.tt-icon:disabled { opacity: .35; cursor: default; }
body.note-editing .tab-topbar { display: none !important; }
@media (max-width: 768px) {
    .tab-topbar { height: auto; min-height: 56px; padding: 10px 14px; gap: 9px; flex-wrap: wrap; }
}

.note-search {
    display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0; box-sizing: border-box;
    height: 34px; padding: 0 10px 0 12px;
    background: var(--surface-color); border: 1.5px solid var(--border-color); border-radius: 999px;
    transition: border-color .18s ease, box-shadow .18s ease;
}
.note-search:focus-within { border-color: var(--accent-color); }
.note-search > svg { flex-shrink: 0; color: var(--text-faint); pointer-events: none; }
.note-search input {
    width: 170px; min-width: 0; align-self: stretch;
    background: none; border: none; padding: 0; outline: none; box-shadow: none;
    font: inherit; font-size: 13px; font-weight: 400; color: var(--text-main);
    transition: width .22s ease;
}
.note-search input:focus { outline: none; box-shadow: none; border-color: transparent; }
.note-search:focus-within input { width: 240px; }
.note-search input::placeholder { color: var(--text-faint); }
.note-search-clear {
    flex-shrink: 0; width: 17px; height: 17px; border: none; background: var(--surface-2); padding: 0;
    border-radius: 50%; color: var(--text-muted); cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
}
.note-search-clear:hover { background: var(--border-color); color: var(--text-main); }
.note-search-scope {
    display: inline-flex; align-items: center; gap: 2px; flex-shrink: 0;
    background: var(--surface-2); border-radius: 999px; padding: 3px;
}
.nss-btn {
    border: none; background: transparent; color: var(--text-faint);
    font: inherit; font-size: 12px; font-weight: 500; padding: 0 11px; height: 26px;
    border-radius: 999px; cursor: pointer; white-space: nowrap; transition: background .15s ease, color .15s ease;
}
.nss-btn:hover { color: var(--text-main); }
.nss-btn.active { background: var(--surface-color); color: var(--text-main); box-shadow: 0 1px 2px rgba(0,0,0,.06); }
@media (max-width: 1100px) {
    .note-search input { width: 118px; }
    .note-search:focus-within input { width: 160px; }
}

.doc-quickbar {
    position: fixed; z-index: 11000; display: inline-flex; align-items: center; gap: 2px;
    background: var(--surface-color); border: 1px solid var(--border-color);
    border-radius: 999px; padding: 6px 10px; box-shadow: var(--shadow-popup);
    max-width: calc(100vw - 16px); flex-wrap: nowrap;
}
.dqb-color-btn { position: relative; flex-direction: column; gap: 1px; }
.dqb-color-btn .dqb-ci { font-size: 13px; font-weight: 600; line-height: 1; }
.dqb-color-btn svg { width: 15px; height: 15px; }
.dqb-cbar {
    display: block; width: 16px; height: 3px; border-radius: 2px;
    background: var(--border-color); box-shadow: 0 0 0 .5px rgba(0,0,0,.12);
}
.dqb-color-btn.open { background: var(--surface-2); color: var(--text-main); }
.dqb-pop {
    position: absolute; top: calc(100% + 8px); z-index: 1;
    display: grid; grid-template-columns: repeat(5, 24px); gap: 6px;
    background: var(--surface-color); border: 1px solid var(--border-color);
    border-radius: 12px; padding: 9px; box-shadow: var(--shadow-popup);
}
.dqb-sw {
    width: 24px; height: 24px; border-radius: 7px; border: none; padding: 0; cursor: pointer;
    box-shadow: 0 0 0 1px var(--border-color); transition: transform .1s;
}
.dqb-sw:hover { transform: scale(1.12); }
.dqb-sw-none {
    background: var(--bg-color); color: var(--text-muted); font-size: 12px; line-height: 1;
    display: inline-flex; align-items: center; justify-content: center;
}
.dqb-btn {
    width: 30px; height: 30px; border: none; background: none; border-radius: 8px;
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--text-muted); cursor: pointer; transition: background .12s, color .12s; flex-shrink: 0;
}
.dqb-btn svg { width: 16px; height: 16px; }
.dqb-glyph { font-family: inherit; font-size: 14px; line-height: 1; }
.dqb-btn:hover { background: var(--surface-2); color: var(--text-main); }
.dqb-btn.active { background: var(--accent-hover); color: var(--accent-ink); }
.dqb-sep { width: 1px; height: 18px; background: var(--border-color); margin: 0 4px; flex-shrink: 0; }
.dqb-fmt { display: inline-flex; align-items: center; gap: 2px; flex-shrink: 0; }
.dqb-fmt-btn {
    min-width: 28px; height: 30px; padding: 0 6px; border: none; background: none; border-radius: 8px;
    color: var(--text-muted); cursor: pointer; font-family: inherit; line-height: 1;
    transition: background .12s, color .12s;
}
.dqb-fmt-btn:hover { background: var(--surface-2); color: var(--text-main); }

.corda-copy-toast {
    position: fixed; bottom: 32px; left: 50%; transform: translateX(-50%) translateY(10px);
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--surface-color); color: var(--text-main); border: 1px solid var(--border-color);
    font-size: 13px; font-weight: 500; padding: 10px 18px; border-radius: 10px;
    box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none;
    transition: opacity .18s ease, transform .18s ease; z-index: 12800;
}
.corda-copy-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.corda-copy-toast svg { width: 15px; height: 15px; color: var(--success-color); flex-shrink: 0; }

.help-page { max-width: 780px; margin: 0 auto; padding: 2.4rem 1.6rem 6rem; box-sizing: border-box; }
.help-hero { text-align: center; padding: 1rem 0 2rem; }
.help-hero-ic { width: 52px; height: 52px; border-radius: 16px; background: var(--accent-hover); color: var(--accent-color); display: inline-flex; align-items: center; justify-content: center; margin-bottom: 12px; }
.help-hero-ic svg { width: 26px; height: 26px; }
.help-hero h1 { font-size: 18px; font-weight: 600; margin: 0 0 5px; }
.help-hero p { font-size: 13px; color: var(--text-muted); margin: 0; }

.help-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 2rem; }
@media (max-width: 720px) { .help-steps { grid-template-columns: 1fr; } }
.help-step { background: var(--surface-color); border: 1px solid var(--border-color); border-radius: 12px; padding: 1rem; }
.help-step-num { width: 22px; height: 22px; border-radius: 7px; background: var(--accent-color); color: #fff; font-size: 11px; font-weight: 600; display: flex; align-items: center; justify-content: center; margin-bottom: 9px; }
.help-step-title { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.help-step-desc { font-size: 12px; color: var(--text-muted); line-height: 1.6; }

.help-faq { margin-bottom: 1.6rem; }
.help-acc { border: 1px solid var(--border-color); border-radius: 10px; background: var(--surface-color); margin-bottom: 7px; overflow: hidden; }
.help-acc-head { display: flex; align-items: center; gap: 10px; width: 100%; padding: 11px 14px; background: none; border: none; cursor: pointer; font: inherit; color: var(--text-main); text-align: left; transition: var(--transition); }
.help-acc-head:hover { background: var(--surface-2); }
.help-acc-caret { width: 14px; height: 14px; color: var(--text-muted); flex-shrink: 0; transition: transform .2s; display: flex; }
.help-acc-caret svg { width: 100%; height: 100%; }
.help-acc.open .help-acc-caret { transform: rotate(90deg); }
.help-acc-title { font-size: 13px; font-weight: 500; }
.help-acc-body { display: none; padding: 12px 14px 14px; font-size: 12px; color: var(--text-muted); line-height: 1.75; border-top: 1px solid var(--border-color); }
.help-acc.open .help-acc-body { display: block; }
.help-acc-body b { color: var(--text-main); font-weight: 600; }

.help-contact { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; background: var(--surface-color); border: 1px solid var(--border-color); border-radius: 12px; padding: 1.1rem 1.2rem; }
.help-contact-main { display: flex; align-items: center; gap: 12px; }
.help-contact-ic { width: 34px; height: 34px; border-radius: 10px; background: var(--surface-2); color: var(--text-muted); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.help-contact-ic svg { width: 17px; height: 17px; }
.help-contact-title { font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.help-contact-mail { font-size: 12px; color: var(--accent-color); text-decoration: none; }
.help-contact-mail:hover { text-decoration: underline; }
.help-contact-legal { display: flex; gap: 14px; }
.help-contact-legal a { font-size: 12px; color: var(--text-muted); text-decoration: none; }
.help-contact-legal a:hover { color: var(--accent-color); text-decoration: underline; }

.settings-shortcut-group { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; margin: 1.3rem 0 .6rem; }
.settings-shortcut-group:first-of-type { margin-top: .3rem; }

.corda-sync-bar { position: fixed; bottom: 78px; left: 50%; transform: translateX(-50%); width: min(420px, calc(100vw - 40px)); background: var(--surface-color); border: 1px solid var(--border-color); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 12px 16px; z-index: 12500; }
.corda-sync-bar-label { font-size: 13px; font-weight: 600; color: var(--text-main); margin-bottom: 8px; }
.corda-sync-bar-track { height: 8px; background: var(--bg-color); border-radius: 6px; overflow: hidden; }
.corda-sync-bar-fill { height: 100%; background: var(--accent-color); border-radius: 6px; width: 0; transition: width .25s ease; }
.corda-sync-bar.indet .corda-sync-bar-fill { width: 40% !important; animation: cordaIndet 1.1s ease-in-out infinite; transition: none; }
@keyframes cordaIndet { 0% { margin-left: -40%; } 100% { margin-left: 100%; } }

/* ===== 비디오 프롬프트 (Seedance) ===== */
.sdw { display: flex; flex-direction: column; gap: 1rem; }
.sdw.split { display: grid; grid-template-columns: 420px 1fr; gap: 1.25rem; align-items: start; }
/* 좌측 묶음에 자체 스크롤을 두지 않는다 — 페이지 스크롤 하나만 쓴다 */
.sd-aside, .sd-main { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
.sdw:not(.split) .sd-aside { order: 2; }
@media (max-width: 1100px) {
    .sdw.split { grid-template-columns: 1fr; }
}

.sd-sec { background: var(--surface-color); border: 1px solid var(--border-color); border-radius: var(--r-card); }
.sd-sec-h {
    display: flex; align-items: center; gap: 8px; padding: 11px 14px;
    border-bottom: 1px solid var(--border-color); background: var(--bg-color);
    border-radius: 11px 11px 0 0;
}
.sd-sec-t { font-size: var(--fs-body); font-weight: var(--font-bold); color: var(--text-main); }
.sd-sec-b { padding: 12px 14px; }
.sd-spacer { flex: 1; }

.sd-blk { border: 1px solid var(--border-color); border-radius: var(--r-card); background: var(--surface-color); }
.sd-blk + .sd-blk { margin-top: .7rem; }
.sd-blk-h { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 11px; }
.sd-blk.open > .sd-blk-h {
    background: var(--bg-color); border-bottom: 1px solid var(--border-color);
    border-radius: 11px 11px 0 0;
}
.sd-caret {
    width: 15px; height: 15px; flex-shrink: 0; padding: 0; border: none; background: none;
    color: var(--text-muted); cursor: pointer; transition: transform .2s;
    display: flex; align-items: center; justify-content: center;
}
.sd-blk.open > .sd-blk-h .sd-caret { transform: rotate(90deg); }
.sd-asset.open > .sd-asset-caret { transform: rotate(90deg); }
.sd-blk-nm { font-size: var(--fs-body); font-weight: var(--font-medium); color: var(--text-main); cursor: pointer; }
.sd-blk-en { font-size: var(--fs-caption); color: var(--text-faint); font-weight: 400; }
.sd-blk-b { display: none; padding: 12px 14px; }
.sd-blk.open > .sd-blk-b { display: block; }

.sd-q {
    width: 17px; height: 17px; flex-shrink: 0; padding: 0; border-radius: 50%;
    border: 1px solid var(--border-color); background: var(--surface-color);
    color: var(--text-muted); font: inherit; font-size: 10px; font-weight: var(--font-bold);
    line-height: 1; cursor: pointer; display: inline-flex; align-items: center;
    justify-content: center; transition: all .15s;
}
.sd-q:hover, .sd-q.on { border-color: var(--accent-color); color: var(--accent-color); background: var(--accent-hover); }
.sd-tip {
    position: fixed; z-index: 1400; max-width: 310px; display: none;
    background: var(--surface-color); border: 1px solid var(--border-color);
    border-radius: var(--r-menu); box-shadow: var(--shadow-popup);
    padding: 11px 13px; font-size: var(--fs-small); line-height: 1.65; color: var(--text-main);
}
.sd-tip.on { display: block; }
.sd-tip b { display: block; margin-bottom: 4px; font-weight: var(--font-bold); }
.sd-tip .src { display: block; margin-top: 7px; font-size: var(--fs-caption); color: var(--text-faint); }

.sd-iconbtn {
    width: 26px; height: 26px; flex-shrink: 0; padding: 0; border: none; border-radius: 6px;
    background: transparent; color: var(--text-faint); cursor: pointer;
    display: flex; align-items: center; justify-content: center; transition: all .13s;
}
.sd-iconbtn:hover { background: var(--surface-2); color: var(--text-main); }
.sd-iconbtn.del:hover { background: var(--danger-soft); color: var(--danger-color); }

.sd-addwrap { position: relative; }
.sd-addmenu {
    position: absolute; z-index: 200; right: 0; top: calc(100% + 6px);
    width: 320px; max-height: 420px; overflow-y: auto; display: none;
    background: var(--surface-color); border: 1px solid var(--border-color);
    border-radius: var(--r-menu); box-shadow: var(--shadow-popup); padding: 8px;
}
.sd-addmenu.on { display: block; }
.sd-amgrp { font-size: var(--fs-caption); font-weight: var(--font-bold); color: var(--text-faint); padding: 8px 8px 4px; }
.sd-amitem {
    display: flex; align-items: baseline; gap: 6px; width: 100%; text-align: left;
    border: none; background: transparent; border-radius: var(--r-btn); padding: 8px 10px;
    font: inherit; font-size: var(--fs-small); color: var(--text-main); cursor: pointer; transition: all .13s;
}
.sd-amitem:hover { background: var(--accent-hover); color: var(--accent-ink); }
.sd-amitem .en { font-size: var(--fs-caption); color: var(--text-faint); }
.sd-amitem .done { margin-left: auto; font-size: var(--fs-caption); color: var(--success-color); font-weight: var(--font-bold); }
.sd-amsep { height: 1px; background: var(--border-color); margin: 6px 4px; }

.sd-ta, .sd-inp {
    width: 100%; box-sizing: border-box; background: var(--bg-color);
    border: 1px solid var(--border-color); border-radius: var(--r-btn);
    padding: 9px 12px; font: inherit; font-size: var(--fs-small); line-height: 1.7;
    color: var(--text-main); outline: none; transition: border-color .15s;
}
/* 칸을 끌어 늘리는 손잡이는 쓰지 않는다 — 높이는 보기 모드(자동 맞춤/스크롤)로 다룬다.
   자동 맞춤은 내용만큼 늘어나므로 스크롤바가 아예 뜨지 않는다 */
.sd-ta { resize: none; min-height: 76px; overflow-y: hidden; }
/* 스크롤 모드 — 블록 묶음 전체가 아니라 블록 하나하나의 높이를 제한하고 그 안에서 스크롤한다 */
.sd-ta.sd-ta-scroll { max-height: 220px; overflow-y: auto; }
.sd-ta:focus, .sd-inp:focus { border-color: var(--accent-color); }
.sd-ta::placeholder, .sd-inp::placeholder { color: var(--text-faint); }
.sd-auto { background: var(--bg-color); border: 1px solid var(--border-color); border-radius: var(--r-btn); padding: 10px 12px; font-size: var(--fs-small); line-height: 1.7; color: var(--text-muted); }

.sd-empty {
    border: 1.5px dashed var(--border-color); border-radius: var(--r-card);
    padding: 2rem 1rem; text-align: center; color: var(--text-muted);
    font-size: var(--fs-small); line-height: 1.8;
}

.sd-assets { display: flex; flex-direction: column; gap: .55rem; }
.sd-asset {
    display: flex; gap: 11px; align-items: flex-start; padding: 10px;
    border: 1px solid var(--border-color); border-radius: var(--r-menu); background: var(--surface-color);
    cursor: grab;
}
.sd-asset:active { cursor: grabbing; }
/* 마우스를 올리면 끌 수 있다는 게 보이게 — 테두리·그림자로 살짝 떠 보이게 한다 */
.sd-asset:hover { border-color: var(--accent-color); box-shadow: var(--shadow-md); }
/* 끌어서 순서 바꾸기 — 위/아래 어디로 들어갈지 선으로 알려 준다 */
.sd-asset.dragging { opacity: .35; }
.sd-asset.drop-above { box-shadow: 0 -2px 0 var(--accent-color); }
.sd-asset.drop-below { box-shadow: 0 2px 0 var(--accent-color); }

/* 참조 이미지 크게 보기 팝업 */
.sd-zoom {
    position: fixed; inset: 0; z-index: 9800; background: rgba(0,0,0,.62);
    display: flex; align-items: center; justify-content: center; padding: 2.5rem;
}
.sd-zoom-box {
    background: var(--surface-color); border: 1px solid var(--border-color);
    border-radius: var(--r-modal); box-shadow: var(--shadow-popup);
    max-width: min(1100px, 92vw); max-height: 90vh;
    display: flex; flex-direction: column; overflow: hidden;
}
.sd-zoom-head {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    padding: 11px 14px; border-bottom: 1px solid var(--border-color); background: var(--bg-color);
}
.sd-zoom-role { font-size: var(--fs-caption); color: var(--text-muted); }
.sd-zoom-x {
    width: 28px; height: 28px; flex-shrink: 0; padding: 0; border: none; border-radius: 7px;
    background: transparent; color: var(--text-muted); cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; transition: all .13s;
}
.sd-zoom-x:hover { background: var(--surface-2); color: var(--text-main); }
.sd-zoom-box img, .sd-zoom-box video { max-width: 100%; max-height: calc(90vh - 52px); object-fit: contain; display: block; }

/* 내보내기 고르는 팝업 — 노트탭 글작성 내보내기와 동일한 앵커 드롭다운 */
.tt-export-wrap { display: inline-flex; flex-shrink: 0; }
.doc-export-sub { font-size: var(--fs-caption); color: var(--text-muted); padding: 4px 11px 6px; white-space: nowrap; }

/* 이미지 프롬프트 JSON — 내보낼 블록을 고르는 팝업 */
.psb-exp-overlay {
    position: fixed; inset: 0; z-index: 9800; background: rgba(0,0,0,.45);
    display: flex; align-items: center; justify-content: center; padding: 2rem;
}
.psb-exp-box {
    background: var(--surface-color); border: 1px solid var(--border-color);
    border-radius: var(--r-modal); box-shadow: var(--shadow-popup);
    width: min(440px, 92vw); max-height: 80vh; display: flex; flex-direction: column;
}
.psb-exp-head { display: flex; align-items: center; gap: 8px; padding: 16px 18px 2px; }
.psb-exp-title { font-size: var(--fs-body); font-weight: var(--font-bold); color: var(--text-main); flex: 1; }
.psb-exp-x {
    border: none; background: none; padding: 0; cursor: pointer; color: var(--text-muted);
    display: inline-flex; align-items: center;
}
.psb-exp-x:hover { color: var(--text-main); }
.psb-exp-sub { font-size: var(--fs-caption); color: var(--text-muted); padding: 0 18px 10px; }
.psb-exp-list { overflow-y: auto; padding: 0 18px; }
.psb-exp-grp { margin-bottom: 10px; }
.psb-exp-row {
    display: flex; align-items: center; gap: 8px; padding: 5px 0;
    font-size: var(--fs-small); color: var(--text-main); cursor: pointer;
}
.psb-exp-row.grp { font-weight: var(--font-bold); }
.psb-exp-row.sub { padding-left: 22px; color: var(--text-muted); }
.psb-exp-row input { accent-color: var(--accent-color); cursor: pointer; }
.psb-exp-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px 16px; }
/* 참조 목록의 영상 썸네일도 이미지와 같은 크기로 */
.sd-asset video.th { width: 92px; height: 66px; flex-shrink: 0; border-radius: var(--r-btn);
    background: var(--surface-2); object-fit: cover; border: 1px solid var(--border-color); cursor: zoom-in; }
.sd-asset-role { font-size: var(--fs-caption); color: var(--text-muted); }
/* 접기 — 화살표는 프롬프트 블록과 같은 모양·동작 */
.sd-asset-caret { align-self: flex-start; }
.sd-asset:not(.open) .sd-asset-body { display: none; }
.sd-asset:not(.open) video.th, .sd-asset:not(.open) img.th { width: 46px; height: 34px; }
.sd-asset .th {
    width: 92px; height: 66px; flex-shrink: 0; border-radius: var(--r-btn);
    background: var(--surface-2); object-fit: contain; border: 1px solid var(--border-color); cursor: zoom-in;
}
/* JSON으로 불러왔지만 아직 이미지를 넣지 않은 참조 칸 */
.sd-asset .th.th-empty {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    border-style: dashed; background: var(--bg-color); color: var(--text-faint);
    font-family: inherit; font-size: 10px; line-height: 1.3; text-align: center; cursor: pointer; padding: 4px;
}
.sd-asset .th.th-empty svg { width: 14px; height: 14px; flex-shrink: 0; }
.sd-asset .th.th-empty:hover, .sd-asset .th.th-empty:focus-visible { border-color: var(--accent-color); color: var(--accent-color); }
.sd-asset .th.th-empty.drag-over { border-color: var(--accent-color); color: var(--accent-color); background: var(--accent-hover); }
.sd-asset .meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.sd-asset .r1 { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.sd-asset-body { display: flex; flex-direction: column; gap: 7px; }
.sd-code {
    font-size: var(--fs-caption); font-weight: var(--font-bold); font-family: ui-monospace, monospace;
    background: var(--param-bg); color: var(--param-text); border-radius: var(--r-swatch); padding: 3px 8px;
}
.sd-tok { font-size: var(--fs-caption); color: var(--text-muted); font-family: ui-monospace, monospace; }
.sd-roles { display: flex; gap: 4px; flex-wrap: wrap; }
.sd-role {
    font-size: var(--fs-caption); font-weight: var(--font-medium); color: var(--text-muted);
    background: transparent; border: 1px solid var(--border-color); border-radius: 999px;
    padding: 3px 11px; cursor: pointer; font-family: inherit; transition: all .13s;
}
.sd-role:hover { border-color: var(--text-faint); color: var(--text-main); }
.sd-role.on { background: var(--accent-color); border-color: var(--accent-color); color: #fff; }
.sd-keep { font-size: var(--fs-caption); color: var(--text-muted); line-height: 1.6; }
.sd-drop {
    width: 100%; border: 1.5px dashed var(--border-color); border-radius: var(--r-card);
    padding: 1.4rem 1rem; text-align: center; color: var(--text-muted);
    font: inherit; font-size: var(--fs-small); line-height: 1.7; cursor: pointer;
    background: transparent; transition: all .15s;
    display: flex; flex-direction: column; align-items: center; gap: 5px;
}
.sd-drop:hover, .sd-drop.over { border-color: var(--accent-color); color: var(--accent-ink); background: var(--accent-hover); }

/* 타임라인 — 바를 끌어 초를 나눈다 */
.sd-tlbar { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: .75rem; font-size: var(--fs-small); color: var(--text-muted); }
.sd-num {
    width: 58px; text-align: center; background: var(--bg-color);
    border: 1px solid var(--border-color); border-radius: 7px; padding: 5px 6px;
    font: inherit; font-size: var(--fs-small); color: var(--text-main); outline: none;
}
.sd-num:focus { border-color: var(--accent-color); }
.sd-track {
    position: relative; height: 46px; border-radius: var(--r-btn);
    background: var(--surface-2); border: 1px solid var(--border-color);
    overflow: hidden; user-select: none; margin-bottom: .7rem;
}
.sd-tseg {
    position: absolute; top: 0; bottom: 0; overflow: hidden;
    background: var(--accent-hover); border-right: 1px solid var(--surface-color);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 1px; cursor: pointer; transition: background .13s;
}
.sd-tseg:hover, .sd-tseg.on { background: var(--accent-color); }
.sd-tseg:hover .sd-tseg-id, .sd-tseg.on .sd-tseg-id,
.sd-tseg:hover .sd-tseg-s, .sd-tseg.on .sd-tseg-s { color: #fff; }
.sd-tseg-id { font-size: 11px; font-weight: var(--font-bold); color: var(--accent-ink); white-space: nowrap; }
.sd-tseg-s { font-size: 10px; color: var(--accent-ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.sd-grip {
    position: absolute; top: 0; bottom: 0; width: 11px; margin-left: -5px; z-index: 3;
    cursor: col-resize; display: flex; align-items: center; justify-content: center;
}
.sd-grip::after {
    content: ''; width: 3px; height: 22px; border-radius: 2px;
    background: var(--text-faint); transition: background .13s;
}
.sd-grip:hover::after, .sd-grip.drag::after { background: var(--accent-color); }

.sd-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 9px; }
.sd-card {
    border: 1px solid var(--border-color); border-radius: var(--r-card); background: var(--surface-color);
    padding: 10px 11px; cursor: pointer; transition: all .15s; text-align: left; font: inherit; color: inherit;
}
.sd-card:hover, .sd-card.on { border-color: var(--accent-color); box-shadow: var(--shadow-md); }
.sd-card.done { border-color: var(--success-color); }
/* 드래그 표시는 hover 규칙 뒤에 둬야 가려지지 않는다 */
.sd-card { cursor: grab; }
.sd-card:active { cursor: grabbing; }
.sd-card.dragging { opacity: .35; }
/* 숏은 좌우로 끼워 넣으므로 가이드선도 좌우에 세운다 */
.sd-card.drop-left, .sd-card.drop-left:hover { box-shadow: -2px 0 0 var(--accent-color); }
.sd-card.drop-right, .sd-card.drop-right:hover { box-shadow: 2px 0 0 var(--accent-color); }
.sd-card .id { display: flex; align-items: center; gap: 6px; font-size: var(--fs-small); font-weight: var(--font-bold); color: var(--text-main); }
/* 'Shot 1' 이 줄바꿈으로 쪼개지지 않게 한다 */
.sd-card .id .nm { white-space: nowrap; flex-shrink: 0; }
.sd-card .id .pv {
    width: 30px; height: 22px; object-fit: cover; border-radius: 4px;
    border: 1px solid var(--border-color); background: var(--surface-2); flex-shrink: 0;
}
.sd-card .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--border-color); flex-shrink: 0; }
.sd-card.done .dot { background: var(--success-color); }
.sd-card .tm { margin-left: auto; font-size: 11px; color: var(--text-faint); font-family: ui-monospace, monospace; font-weight: 400; }
.sd-card .bt {
    font-size: var(--fs-caption); color: var(--text-muted); margin-top: 4px; line-height: 1.55;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.5em;
}
.sd-card .bt.todo { color: var(--text-faint); }

/* 사이드바 — 본문을 밀어낸다 */
.sd-sb {
    position: fixed; top: 0; right: 0; bottom: 0; width: 400px; z-index: 1150;
    background: var(--surface-color); border-left: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg); display: flex; flex-direction: column;
    transform: translateX(100%); transition: transform .22s cubic-bezier(.4,0,.2,1); visibility: hidden;
}
.sd-sb.open { transform: translateX(0); visibility: visible; }
body.sd-sb-open #videoTabContent { padding-right: 400px; }
#videoTabContent { transition: padding-right .22s cubic-bezier(.4,0,.2,1); }
@media (max-width: 900px) {
    .sd-sb { width: 100%; }
    body.sd-sb-open #videoTabContent { padding-right: 0; }
}
.sd-sb-h {
    display: flex; align-items: center; gap: 8px; padding: 13px 16px;
    border-bottom: 1px solid var(--border-color); background: var(--bg-color);
}
.sd-sb-t { font-size: var(--fs-body); font-weight: var(--font-bold); color: var(--text-main); }
.sd-sb-b { flex: 1; overflow-y: auto; padding: 14px 16px; }

.sd-slot { padding: 9px 0; border-bottom: 1px solid var(--border-color); position: relative; }
.sd-slot:last-of-type { border-bottom: none; }
.sd-sl { font-size: var(--fs-caption); font-weight: var(--font-bold); color: var(--text-muted); margin-bottom: 6px; }
.sd-sl .en { font-weight: 400; color: var(--text-faint); margin-left: 5px; }
.sd-sv-row { display: flex; gap: 5px; align-items: flex-end; }
.sd-dictbtn {
    background: var(--surface-color); border: 1px solid var(--border-color); color: var(--text-muted);
    width: 28px; height: 28px; flex-shrink: 0; padding: 0; border-radius: 7px;
    display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all .13s;
}
.sd-dictbtn svg { width: 15px; height: 15px; }
.sd-dictbtn:hover, .sd-dictbtn.on { border-color: var(--accent-color); color: var(--accent-color); background: var(--accent-hover); }
.sd-slotinp {
    flex: 1; min-width: 140px; border: 1px solid var(--border-color); border-radius: 7px;
    padding: 6px 9px; font: inherit; font-size: var(--fs-small); line-height: 1.4;
    background: var(--bg-color); color: var(--text-main); outline: none;
    min-height: 30px; box-sizing: border-box; display: block;
}
.sd-slotinp:focus { border-color: var(--accent-color); }
.sd-dict {
    margin-top: 7px; background: var(--bg-color); border: 1px solid var(--border-color);
    border-radius: var(--r-menu); padding: 9px;
}
.sd-dict .srch {
    width: 100%; box-sizing: border-box; border: 1px solid var(--border-color); border-radius: 7px;
    padding: 6px 10px; font: inherit; font-size: var(--fs-small);
    background: var(--surface-color); color: var(--text-main); outline: none; margin-bottom: 8px;
}
.sd-dict .srch:focus { border-color: var(--accent-color); }
.sd-dictbody { display: flex; gap: 5px; flex-wrap: wrap; max-height: 210px; overflow-y: auto; align-content: flex-start; padding: 2px; }
.sd-pchip {
    display: inline-flex; flex-direction: column; gap: 1px; text-align: left;
    background: var(--surface-color); border: 1px solid var(--border-color);
    border-radius: var(--r-btn); padding: 5px 11px; cursor: pointer; font: inherit; transition: all .13s;
}
.sd-pchip:hover { border-color: var(--accent-color); background: var(--accent-hover); }
.sd-pchip .en { font-size: var(--fs-small); font-weight: var(--font-medium); color: var(--text-main); }
.sd-pchip .ko { font-size: var(--fs-caption); color: var(--text-muted); }
.sd-none { font-size: var(--fs-caption); color: var(--text-faint); padding: 4px; }

.sd-out {
    background: var(--bg-color); border: 1px solid var(--border-color); border-radius: var(--r-btn);
    padding: 13px 15px; font-size: var(--fs-small); line-height: 1.85; color: var(--text-main);
    white-space: pre-wrap; word-break: break-word;
}
.sd-out.scroll-mode { max-height: 340px; overflow-y: auto; }
.sd-out .todo { color: var(--text-faint); }

/* 최종 프롬프트 보기 모드 전환 — 무채색 미니 세그먼트 */
.sd-outview-seg { display: flex; background: var(--bg-color); border: 1px solid var(--border-color); border-radius: 7px; padding: 2px; flex-shrink: 0; }
.sd-outview-seg button {
    padding: 3px 9px; border: none; background: transparent; border-radius: 5px; cursor: pointer;
    font: inherit; font-size: 11px; font-weight: var(--font-medium); color: var(--text-muted); transition: all .13s;
}
.sd-outview-seg button:hover { color: var(--text-main); }
.sd-outview-seg button.on { background: var(--surface-2); color: var(--text-main); font-weight: 600; }
.sd-outsec + .sd-outsec { margin-top: .8rem; }
.sd-outlab { display: flex; align-items: center; gap: 7px; margin-bottom: 6px; }
.sd-outlab .t { font-size: var(--fs-caption); font-weight: var(--font-bold); color: var(--text-muted); }
.sd-outfoot { display: flex; gap: 7px; margin-top: .7rem; }
.sd-outfoot .btn { flex-shrink: 0; }
.sd-outfoot .grow { flex: 1; }

.sd-vlist { display: flex; flex-direction: column; gap: 5px; }
.sd-vrow {
    display: flex; gap: 7px; align-items: flex-start; width: 100%; text-align: left;
    font: inherit; font-size: var(--fs-small); line-height: 1.55; color: var(--text-main);
    background: none; border: none; padding: 5px 6px; border-radius: var(--r-swatch);
}
button.sd-vrow { cursor: pointer; }
button.sd-vrow:hover { background: var(--bg-color); }
.sd-vrow .lv { font-size: 10px; font-weight: var(--font-bold); flex-shrink: 0; margin-top: 3px; }
.sd-vrow.ok { color: var(--text-muted); }
.sd-vrow.ok .lv { color: var(--success-color); }
.sd-vrow.warn .lv { color: var(--warn-color, #a5740f); }
.sd-vrow.err .lv { color: var(--danger-color); }
.sd-flash { animation: sdFlash 1.2s ease; }
@keyframes sdFlash { 0%,100% { box-shadow: none; } 20%,60% { box-shadow: 0 0 0 3px var(--accent-hover); } }

/* 번역 기능 안내 */
.tr-tip {
    position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%); z-index: 10000;
    width: calc(100% - 2rem); max-width: 440px; box-sizing: border-box;
    background: var(--surface-color); border: 1px solid var(--border-color);
    border-radius: var(--r-modal); box-shadow: var(--shadow-popup); padding: 16px 18px;
}
.tr-tip-head { display: flex; align-items: center; gap: 9px; margin-bottom: 9px; }
.tr-tip-icon {
    width: 26px; height: 26px; border-radius: 8px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    background: var(--accent-hover); color: var(--accent-color);
}
.tr-tip-icon svg { width: 15px; height: 15px; }
.tr-tip-title { font-size: var(--fs-body); font-weight: var(--font-bold); color: var(--text-main); }
.tr-tip-close {
    margin-left: auto; width: 26px; height: 26px; flex-shrink: 0; padding: 0;
    border: none; border-radius: 7px; background: transparent; color: var(--text-faint);
    cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all .13s;
}
.tr-tip-close svg { width: 14px; height: 14px; }
.tr-tip-close:hover { background: var(--surface-2); color: var(--text-main); }
.tr-tip-body {
    margin: 0 0 14px; font-size: var(--fs-small); line-height: 1.75; color: var(--text-muted);
}
.tr-tip-body b { color: var(--text-main); font-weight: var(--font-bold); }
.tr-tip-foot { display: flex; align-items: center; gap: 7px; }
.tr-tip-check {
    display: flex; align-items: center; gap: 6px; margin-right: auto;
    font-size: var(--fs-caption); color: var(--text-muted); cursor: pointer;
}
.tr-tip-check input { accent-color: var(--accent-color); width: 14px; height: 14px; cursor: pointer; }

/* 세그먼트 컨트롤 — 글자수가 달라도 두 칸 크기 동일, 활성은 surface-2 (붉은 계열 금지) */
.sd-seg {
    display: flex; background: var(--bg-color); border: 1px solid var(--border-color);
    border-radius: 8px; padding: 2px; margin-bottom: 9px;
}
.sd-seg-btn {
    flex: 1 1 0; min-width: 76px; padding: 5px 10px; border: none; background: transparent;
    border-radius: 6px; cursor: pointer; font: inherit; font-size: var(--fs-caption);
    font-weight: var(--font-medium); color: var(--text-muted); transition: all .13s;
}
.sd-seg-btn:hover { color: var(--text-main); }
.sd-seg-btn.on { background: var(--surface-2); color: var(--text-main); font-weight: 600; }
.sd-seg-btn.muted { color: var(--text-faint); }

/* 샷 사이드바 — 참조 레이어 빠른 삽입 */
.sd-refbar {
    background: var(--bg-color); border: 1px solid var(--border-color);
    border-radius: var(--r-btn); padding: 9px 10px; margin-bottom: 12px;
}
.sd-refbar-head {
    display: flex; align-items: center; gap: 6px; margin-bottom: 7px;
    font-size: var(--fs-caption); font-weight: var(--font-bold); color: var(--text-muted);
}
.sd-refbar-to { font-weight: var(--font-medium); color: var(--accent-ink); }
.sd-refbar-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.sd-refchip {
    display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px 3px 3px;
    background: var(--surface-color); border: 1px solid var(--border-color);
    border-radius: 20px; cursor: pointer; font: inherit; transition: all .13s;
}
.sd-refchip:hover { border-color: var(--accent-color); background: var(--accent-hover); }
.sd-refchip img {
    width: 22px; height: 22px; border-radius: 50%; object-fit: cover;
    background: var(--surface-2); flex-shrink: 0;
}
.sd-refchip .code {
    font-size: var(--fs-caption); font-weight: var(--font-bold);
    font-family: ui-monospace, monospace; color: var(--param-text);
}

/* 씬·클립 고르는 줄 — 왼쪽은 씬(그룹), 오른쪽은 그 씬에 속한 클립 */
.sd-navbar {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    flex-wrap: wrap; margin-bottom: 1.1rem; padding-bottom: .75rem;
    border-bottom: 1px solid var(--border-color);
}
.sd-navgrp { display: flex; align-items: center; gap: 6px; min-width: 0; }
.sd-navgrp.right { margin-left: auto; }
.sd-navlabel {
    font-size: 12px; font-weight: 600; color: var(--text-muted);
    letter-spacing: .06em; padding-right: 2px; white-space: nowrap; flex-shrink: 0;
}
.sd-rail-host { margin-left: auto; }
.sd-rail { display: flex; align-items: center; gap: 6px; }
.sd-rail-track {
    display: flex; align-items: center; gap: 5px;
    overflow-x: auto; overflow-y: hidden; scrollbar-width: none; max-width: 100%;
    padding: 5px 5px 3px 1px; margin: -5px -5px -3px -1px;
}
.sd-rail-track::-webkit-scrollbar { display: none; }
.sd-rail-arrow {
    width: 20px; height: 20px; flex-shrink: 0; padding: 0; border: none; border-radius: 5px;
    background: none; color: var(--text-muted); cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; transition: all .12s;
}
.sd-rail-arrow svg { width: 12px; height: 12px; }
.sd-rail-arrow:hover:not(:disabled) { background: var(--surface-2); color: var(--text-main); }
.sd-rail-arrow:disabled { opacity: .3; cursor: default; }
/* 씬 버튼 + 삭제 x */
.sd-scene-wrap { position: relative; display: inline-flex; flex-shrink: 0; }
.sd-scene-del {
    position: absolute; top: -4px; right: -4px; width: 14px; height: 14px; padding: 0;
    border: none; border-radius: 50%; background: var(--danger-color); color: #fff;
    cursor: pointer; opacity: 0; transition: opacity .12s;
    display: inline-flex; align-items: center; justify-content: center;
}
.sd-scene-del svg { width: 7px; height: 7px; }
.sd-scene-wrap:hover .sd-scene-del { opacity: 1; }
.sd-scene {
    width: 28px; height: 28px; flex-shrink: 0; padding: 0; border-radius: 50%;
    border: 1px solid var(--border-color); background: var(--surface-color);
    color: var(--text-muted); cursor: pointer; font: inherit;
    font-size: 11px; font-weight: var(--font-bold);
    display: inline-flex; align-items: center; justify-content: center;
    transition: all .13s;
}
.sd-scene:hover { border-color: var(--text-faint); color: var(--text-main); }
.sd-scene.on { background: var(--accent-color); border-color: var(--accent-color); color: #fff; }
/* 클립 버튼 — 씬과 같은 원형, 드래그로 순서를 바꾼다 */
.sd-clip {
    width: 28px; height: 28px; flex-shrink: 0; padding: 0; border-radius: 50%;
    border: 1px solid var(--border-color); background: var(--surface-color);
    color: var(--text-muted); cursor: grab; font: inherit;
    font-size: 11px; font-weight: var(--font-bold);
    display: inline-flex; align-items: center; justify-content: center;
    transition: background .13s, color .13s, border-color .13s;
}
.sd-clip:hover { border-color: var(--text-faint); color: var(--text-main); }
.sd-clip.on { background: var(--accent-color); border-color: var(--accent-color); color: #fff; }
.sd-clip:active { cursor: grabbing; }
.sd-clip.dragging { opacity: .35; }
.sd-clip.drop-left { box-shadow: -2px 0 0 var(--accent-color); }
.sd-clip.drop-right { box-shadow: 2px 0 0 var(--accent-color); }
.sd-ctx-menu { min-width: 132px; }
.sd-scene-add {
    width: 28px; height: 28px; flex-shrink: 0; padding: 0; border-radius: 50%;
    border: 1px dashed var(--border-color); background: transparent; color: var(--text-muted);
    cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: all .13s;
}
.sd-scene-add svg { width: 13px; height: 13px; }
.sd-scene-add:hover { border-color: var(--accent-color); color: var(--accent-color); background: var(--accent-hover); }
.sd-rail-count {
    font-size: 11px; font-weight: var(--font-medium); color: var(--text-faint);
    font-variant-numeric: tabular-nums; flex-shrink: 0;
}

/* 최종 프롬프트 버튼 — 흰 박스, 호버에서 주황 */
.sd-outbtn {
    background: var(--surface-color); color: var(--text-main);
    border: 1px solid var(--border-color); transition: all .15s;
}
.sd-outbtn:hover:not(:disabled) {
    background: var(--accent-hover); border-color: var(--accent-color); color: var(--accent-ink);
}
.sd-outbtn:disabled { opacity: .5; }

/* 스토리보드 패널 나누기 */
.sd-slice { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sd-slice-lb { font-size: var(--fs-caption); font-weight: var(--font-bold); color: var(--text-muted); }
.sd-slice-x { font-size: var(--fs-caption); color: var(--text-faint); }
.sd-num.sm { width: 44px; padding: 4px 5px; }
/* 숏 이미지 자리 */
.sd-shotimg { width: 100%; box-sizing: border-box; margin-bottom: 12px; }
.sd-shotimg.drop {
    border: 1.5px dashed var(--border-color); border-radius: var(--r-btn);
    background: var(--bg-color); color: var(--text-muted); cursor: pointer;
    font: inherit; font-size: var(--fs-caption); padding: 22px 12px;
    display: flex; flex-direction: column; align-items: center; gap: 6px; transition: all .15s;
}
.sd-shotimg.drop:hover, .sd-shotimg.drop.over {
    border-color: var(--accent-color); background: var(--accent-hover); color: var(--accent-ink);
}
.sd-shotimg.has { position: relative; border-radius: var(--r-btn); overflow: hidden; }
.sd-shotimg.has img {
    width: 100%; display: block; border-radius: var(--r-btn);
    border: 1px solid var(--border-color); background: var(--surface-2);
}
.sd-shotimg-act {
    position: absolute; right: 6px; top: 6px; display: flex; gap: 4px;
    opacity: 0; transition: opacity .13s;
}
.sd-shotimg.has:hover .sd-shotimg-act { opacity: 1; }
.sd-shotimg-btn {
    border: none; border-radius: 6px; padding: 4px 9px; cursor: pointer;
    font: inherit; font-size: 11px; font-weight: var(--font-medium);
    background: rgba(0,0,0,.62); color: #fff; transition: background .13s;
}
.sd-shotimg-btn:hover { background: rgba(0,0,0,.8); }
.sd-shotimg-btn.del:hover { background: var(--danger-color); }
.sd-ta.tall { min-height: 132px; }
