.notes-textarea {
    min-height: 70px;
}

.notes-add-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 10px;
}

.notes-backup-row {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.notes-backup-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: 16px;
    border: 1px solid var(--border-card);
    background: transparent;
    color: var(--text-label);
    font-size: 0.78rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
}
.notes-backup-btn:hover {
    color: var(--text);
    border-color: var(--accent-purple);
}
.notes-backup-btn input[type="file"] {
    display: none;
}

.notes-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 6px;
}

.notes-breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    min-width: 0;
}

.notes-crumb {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-label);
    font-size: 0.85rem;
    font-family: inherit;
    padding: 2px 4px;
    border-radius: 6px;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.notes-crumb:hover {
    color: var(--text);
}
.notes-crumb.active {
    color: var(--text-accent);
    font-weight: 700;
}
.notes-crumb-sep {
    color: var(--text-label);
    opacity: 0.5;
    font-size: 0.8rem;
}

.notes-view-toggle {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.notes-view-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    border-radius: 16px;
    border: 1px solid var(--border-card);
    background: transparent;
    color: var(--text-label);
    font-size: 0.8rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
}
.notes-view-btn:hover {
    color: var(--text);
    border-color: var(--accent-purple);
}
.notes-view-btn.active {
    background: linear-gradient(90deg, var(--accent-purple), var(--accent-light-purple));
    border-color: transparent;
    color: #fff;
}

.notes-folder-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    margin-top: 14px;
}

.notes-folder-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 14px 8px 10px;
    border-radius: 10px;
    border: 1px solid var(--border-subtle);
    background: var(--bg-msg-item);
    cursor: pointer;
    transition: all 0.2s;
}
.notes-folder-card:hover {
    border-color: var(--accent-purple);
    transform: translateY(-2px);
}

.notes-folder-icon {
    font-size: 1.6rem;
    line-height: 1;
}

.notes-folder-name {
    font-size: 0.82rem;
    color: var(--text);
    text-align: center;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notes-folder-count {
    font-size: 0.7rem;
    color: var(--text-label);
}

.notes-folder-del {
    position: absolute;
    top: 4px;
    right: 6px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-label);
    font-size: 0.9rem;
    line-height: 1;
    opacity: 0.5;
    padding: 2px;
}
.notes-folder-del:hover {
    opacity: 1;
    color: var(--accent-pink);
}

.notes-item-path {
    font-size: 0.72rem;
    color: var(--text-label);
    margin-bottom: 4px;
}

.notes-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 8px;
    margin-top: 16px;
}

.notes-gallery-tile {
    aspect-ratio: 1;
    padding: 0;
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    background: var(--bg-msg-item);
    transition: transform 0.2s;
}
.notes-gallery-tile:hover {
    transform: scale(1.03);
    border-color: var(--accent-purple);
}
.notes-gallery-tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.notes-lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.82);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 24px;
}

.notes-lightbox-box {
    position: relative;
    max-width: min(90vw, 720px);
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.notes-lightbox-img {
    max-width: 100%;
    max-height: 76vh;
    border-radius: 10px;
    object-fit: contain;
}

.notes-lightbox-caption {
    color: #f5f5f5;
    font-size: 0.85rem;
    text-align: center;
    max-height: 4.5em;
    overflow: auto;
}

.notes-lightbox-close {
    position: absolute;
    top: -14px;
    right: -14px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.15);
    color: #fff;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
}
.notes-lightbox-close:hover {
    background: rgba(255,255,255,0.3);
}

.notes-category-form {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.notes-category-input {
    flex: 1;
    min-width: 100px;
    padding: 8px 12px;
    border-radius: 20px;
    border: 1px solid var(--border-input);
    background-color: var(--bg-input);
    color: var(--text);
    font-size: 0.82rem;
    font-family: inherit;
}
.notes-category-input:focus {
    outline: none;
    border-color: var(--accent-light-purple);
}

.notes-category-add-btn {
    flex: 0 0 auto;
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid var(--border-card);
    background: rgba(var(--accent-purple-rgb),0.08);
    color: var(--text-accent);
    font-size: 0.82rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
}
.notes-category-add-btn:hover {
    color: var(--text);
    border-color: var(--accent-purple);
    background: rgba(var(--accent-purple-rgb),0.18);
}

.notes-search-input {
    display: block;
    width: 100%;
    margin-top: 12px;
    padding: 9px 14px;
    border-radius: 20px;
    border: 1px solid var(--border-input);
    background-color: var(--bg-input);
    color: var(--text);
    font-size: 0.85rem;
    font-family: inherit;
}
.notes-search-input:focus {
    outline: none;
    border-color: var(--accent-light-purple);
    box-shadow: 0 0 15px rgba(192,132,252,0.25);
}

.notes-list {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.notes-item {
    background: var(--bg-msg-item);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    padding: 10px 14px;
    animation: fadeSlideIn 0.3s ease;
}
.notes-item.pinned {
    border-color: var(--accent-purple);
    background: rgba(var(--accent-purple-rgb),0.1);
}

.notes-item-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.notes-item-cat-group {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.notes-cat-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 1px solid rgba(255,255,255,0.4);
}

.notes-item-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.notes-item-pin {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    opacity: 0.4;
    transition: opacity 0.2s, transform 0.2s;
    padding: 2px 4px;
    line-height: 1;
    transform: rotate(30deg);
}
.notes-item-pin:hover {
    opacity: 0.8;
}
.notes-item-pin.active {
    opacity: 1;
    transform: rotate(0deg);
}

.notes-item-category {
    padding: 3px 8px;
    border-radius: 6px;
    border: 1px solid var(--border-subtle);
    background: transparent;
    color: var(--text-accent);
    font-size: 0.78rem;
    font-family: inherit;
    cursor: pointer;
}
.notes-item-category:focus {
    outline: none;
    border-color: var(--accent-light-purple);
}

.notes-item-text {
    width: 100%;
    display: block;
    border: none;
    background: transparent;
    color: var(--text);
    font-family: inherit;
    font-size: 0.9rem;
    line-height: 1.5;
    resize: none;
    overflow: hidden;
    padding: 0;
}
.notes-item-text:focus {
    outline: none;
}

.notes-item-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid var(--border-subtle);
}

.notes-item-time {
    color: var(--guestbook-msg-time);
    font-size: 0.75rem;
}

.notes-item-attachments {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}
.notes-item-attachments:empty {
    margin-top: 0;
}

.notes-attach-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(var(--accent-purple-rgb),0.08);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 4px 8px 4px 4px;
    max-width: 220px;
}

.notes-attach-link {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text);
    text-decoration: none;
    overflow: hidden;
}
.notes-attach-link:hover .notes-attach-name {
    color: var(--text-accent);
}

.notes-attach-thumb {
    width: 32px;
    height: 32px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

.notes-attach-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
}

.notes-attach-name {
    font-size: 0.78rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 110px;
}

.notes-attach-size {
    font-size: 0.7rem;
    color: var(--text-label);
    flex-shrink: 0;
}

.notes-attach-remove {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-label);
    font-size: 0.9rem;
    padding: 0 2px;
    line-height: 1;
    flex-shrink: 0;
}
.notes-attach-remove:hover {
    color: var(--accent-pink);
}

.notes-item-attach-btn {
    cursor: pointer;
    font-size: 0.95rem;
    opacity: 0.7;
    transition: opacity 0.2s;
}
.notes-item-attach-btn:hover {
    opacity: 1;
}
.notes-item-attach-btn input[type="file"] {
    display: none;
}

.notes-item-delete {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    opacity: 0.6;
    transition: opacity 0.2s, transform 0.2s;
    padding: 2px 6px;
    line-height: 1;
}
.notes-item-delete:hover {
    opacity: 1;
    transform: scale(1.15);
}
