.notes-workspace { display: grid; grid-template-columns: 290px minmax(0,1fr); gap: 22px; align-items: start; }
.notes-library, .note-editor, .note-welcome { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 20px; min-width: 0; }
.notes-library { display: grid; gap: 12px; }
#page-notes input:not([type=checkbox]), #page-notes textarea, #page-notes select { width: 100%; box-sizing: border-box; background: var(--bg2); color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: 12px; font: inherit; font-size: 14px; }
#page-notes textarea { resize: vertical; line-height: 1.7; }
#page-notes button { cursor: pointer; font: inherit; font-size: 14px; }
.note-card { display: flex; flex-direction: column; gap: 9px; padding: 15px 12px; width: 100%; text-align: left; color: var(--text); background: transparent; border: 1px solid transparent; border-bottom-color: var(--border); border-radius: 8px; overflow-wrap: anywhere; }
.note-card.selected { background: color-mix(in srgb,var(--accent) 10%,var(--card)); border-color: var(--accent); }
.note-card span, .note-card small, .note-muted, .note-welcome, #noteStatus, #noteDrop p { color: var(--muted); font-size: 13px; line-height: 1.6; }
.note-card span { white-space: pre-wrap; }
.note-top, .note-format, .note-footer { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.note-footer { margin: 18px 0 0; justify-content: space-between; }
.note-top button, .note-format button, #noteDelete, .note-image > button, #noteLightboxClose { color: var(--text); background: var(--bg2); border: 1px solid var(--border); padding: 8px 12px; border-radius: 8px; }
#noteDelete { color: var(--red); }
#noteFields { border: 0; padding: 0; margin: 0; min-width: 0; display: grid; gap: 12px; }
#noteFields label { font-size: 14px; color: var(--muted); }
#noteFields:disabled { opacity: .7; }
#noteTitle { font-size: 22px !important; font-weight: 600 !important; }
.note-format { margin: 6px 0 0; }
.note-pin { display: flex; align-items: center; gap: 8px; padding-block: 8px; }
#noteDrop { border: 1px dashed var(--border); border-radius: 10px; padding: 16px; }
.note-file-label { display: inline-block; cursor: pointer; }
#noteFiles { margin-top: 12px; }
#noteImages { display: grid; grid-template-columns: repeat(auto-fill,minmax(130px,1fr)); gap: 12px; }
.note-image { display: grid; gap: 8px; }
.note-image-open { height: 150px; padding: 0 !important; overflow: hidden; }
.note-image img { width: 100%; height: 100%; object-fit: cover; }
#notePreview { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.8; min-height: 180px; padding: 16px; background: var(--bg2); border-radius: 8px; }
#noteLightbox { width: min(1100px,90vw); max-height: 90vh; background: var(--bg2); color: var(--text); border: 1px solid var(--border); border-radius: 12px; padding: 16px; }
#noteLightbox::backdrop { background: #000b; }
#noteLightbox img { display: block; width: 100%; height: auto; margin-top: 12px; }
#page-notes [hidden] { display: none !important; }
@media(max-width:900px) {
 .notes-workspace { grid-template-columns: minmax(0,1fr); gap: 14px; }
 .note-open .notes-library, #noteWelcome { display: none; }
 .note-editor,.notes-library { padding: 16px; }
 #page-notes input:not([type=checkbox]), #page-notes textarea { font-size: 16px; }
 #page-notes button { min-height: 42px; }
}

.note-thumbnail { width: 100%; height: 110px; object-fit: cover; border-radius: 6px; }
.note-card span { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

#collectionFields, #wishFields { display: grid; gap: 12px; }
#noteVisit { color: var(--accent); padding: 8px 0; overflow-wrap: anywhere; }
.trash-row { display: flex; justify-content: space-between; gap: 16px; align-items: center; margin-top: 14px; padding: 20px; border: 1px solid var(--border); border-radius: 12px; background: var(--card); overflow-wrap: anywhere; }
.trash-row p { color: var(--muted); font-size: 13px; }
.trash-row button, #noteFolderTools button { background: var(--bg2); color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: 10px; cursor: pointer; }
@media(max-width:900px) { .trash-row { flex-direction: column; align-items: stretch; } }
#page-notes.notes-has-folders .notes-workspace { grid-template-columns: 210px 300px minmax(0,1fr); gap: 16px; }
#page-notes:not(.notes-has-folders) .notes-workspace { grid-template-columns: 300px minmax(0,1fr); }
.notes-folders { min-width: 0; }
#noteFoldersDisclosure summary { cursor: pointer; padding: 12px 10px; font-size: 15px; font-weight: 600; }
#noteSelectedFolder { display: block; margin: 6px 0 0 16px; color: var(--muted); font-size: 12px; font-weight: 400; overflow-wrap: anywhere; }
#noteFolderTree { display: grid; gap: 4px; margin-top: 8px; }
#page-notes #noteFolderTree button { border: 0; background: transparent; padding: 10px 12px; text-align: left; overflow-wrap: anywhere; }
#page-notes #noteFolderTree button[aria-current] { background: color-mix(in srgb,var(--accent) 12%,var(--card)); box-shadow: inset 2px 0 var(--accent); }
.note-folder-actions { display: flex; flex-wrap: wrap; gap: 4px; margin: 12px 0; }
#page-notes .note-folder-actions button { border: 0; background: transparent; font-size: 11px; padding: 8px; color: var(--muted); }
#page-notes #folderAdd { width: 100%; background: transparent; border-style: dashed; text-align: left; color: var(--muted); }
.notes-library-top { display: grid; gap: 16px; }
#page-notes #noteLibraryTitle { margin: 0 0 6px; font-size: 18px; overflow-wrap: anywhere; }
#noteRecordCount { font-size: 12px; color: var(--muted); }
#page-notes #noteNew { width: 100%; margin: 0; min-height: 42px; }
#notesList { border-top: 1px solid var(--border); padding-top: 10px; }
@media(min-width:1201px) {
 .notes-folders { position: sticky; top: 24px; max-height: calc(100dvh - 48px); overflow-y: auto; }
}
@media(min-width:901px) and (max-width:1200px) {
 #page-notes.notes-has-folders .notes-workspace { grid-template-columns: 200px minmax(0,1fr); }
 #page-notes.notes-has-folders.note-open .notes-library, #page-notes.notes-has-folders:not(.note-open) #noteWelcome { display: none; }
}
@media(max-width:900px) {
 #page-notes.notes-has-folders .notes-workspace, #page-notes:not(.notes-has-folders) .notes-workspace { grid-template-columns: minmax(0,1fr); gap: 12px; }
 .notes-folders { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 6px; }
 #page-notes.note-open .notes-folders { display: none; }
 .notes-library-top { grid-template-columns: minmax(0,1fr) auto; gap: 12px; align-items: center; }
 #page-notes .notes-library { position: static; max-height: none; }
}
#page-notes .note-card > span { white-space: normal; -webkit-line-clamp: 2; }
.sidebar-nav-item[hidden] { display: none !important; }
.legacy-notes-access { display: none; }
#page-notes.links-workspace .legacy-notes-access { display: block; margin: 16px 0; padding: 0; border: 0; background: transparent; color: var(--muted); font-size: 12px; }
#page-notes #linksQuickForm { display: grid; grid-template-columns: minmax(0,1.3fr) minmax(0,1fr) auto; gap: 12px; align-items: end; padding: 20px; background: var(--card); border: 1px solid var(--border); border-radius: 14px; margin-bottom: 16px; }
#quickLinkStatus { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: 13px; }
#page-notes.links-workspace.note-open #linksQuickForm { display: none; }
#page-notes.links-workspace:not(.note-open) .notes-workspace { grid-template-columns: minmax(0,1fr); }
#page-notes.links-workspace #noteWelcome { display: none; }
#page-notes.links-workspace .notes-library { position: static; max-height: none; }
#page-notes.links-workspace #notesList { display: grid; grid-template-columns: repeat(auto-fill,minmax(min(100%,290px),1fr)); gap: 14px; }
#page-notes.links-workspace .notes-library-top { display: flex; justify-content: space-between; align-items: center; }
#page-notes.links-workspace #noteNew { width: auto; }
.saved-link-card { display: flex; flex-direction: column; gap: 12px; min-width: 0; padding: 20px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg2); overflow-wrap: anywhere; }
.saved-link-card > a { color: var(--text); font-weight: 600; font-size: 17px; text-decoration: none; }
.saved-link-card > a:hover { color: var(--accent); text-decoration: underline; }
.saved-link-card small { color: var(--muted); font-size: 12px; }
.saved-link-card p { color: var(--muted); margin: 0; line-height: 1.6; font-size: 13px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.saved-link-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: auto; }
.saved-link-actions a, #page-notes .saved-link-actions button { font-size: 12px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; color: var(--text); background: var(--card); text-decoration: none; }
.saved-link-actions a { color: var(--accent); }
@media(max-width:900px) { #page-notes #linksQuickForm { grid-template-columns: minmax(0,1fr); padding: 16px; } #page-notes.links-workspace .notes-library-top { flex-wrap: wrap; gap: 12px; } .saved-link-actions a { min-height: 44px; display: inline-flex; align-items: center; box-sizing: border-box; } }

#page-notes #linksQuickForm[hidden] { display: none; }
#quickLinkStatus:empty { display: none; }
#page-notes.links-workspace #noteNew { background: transparent; color: var(--muted); border: 1px solid var(--border); }
