:root {
    --bg-canvas: #f7f8fc;
    --card-lime: #e8f3bf;
    --card-pink: #fcd3e7;
    --card-mint: #d6f0ce;
    --card-peach: #feddc0;
    --accent-purple: #7c4dff;
    --accent-purple-hover: #6536eb;
    --text-primary: #232228;
    --text-secondary: #4a454e;
    --text-muted: #827c88;
    --border-subtle: #e6e8ec;
    --shadow-soft: 0 8px 30px rgba(0, 0, 0, 0.04);
    --shadow-card: 0 4px 16px rgba(0, 0, 0, 0.03);
    --shadow-hover: 0 14px 30px rgba(124, 77, 255, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
}

*::-webkit-scrollbar,
::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    background: transparent !important;
}

html, body, .modal-box, textarea, .form-textarea, .drawer-menu-list, .editor-preview-container {
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar,
.modal-box::-webkit-scrollbar,
textarea::-webkit-scrollbar,
.form-textarea::-webkit-scrollbar,
.drawer-menu-list::-webkit-scrollbar,
.editor-preview-container::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    background: transparent !important;
}

body {
    background-color: var(--bg-canvas);
    color: var(--text-primary);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

.sphere {
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    animation: ambientDrift 8s ease-in-out infinite alternate;
}

.sphere-1 {
    width: 65px;
    height: 65px;
    top: 15px;
    right: 25px;
    background: radial-gradient(circle at 35% 30%, #b388ff 0%, #7c4dff 45%, #311b92 100%);
    box-shadow: inset -6px -6px 14px rgba(0, 0, 0, 0.4), inset 6px 6px 10px rgba(255, 255, 255, 0.7), 0 12px 25px rgba(124, 77, 255, 0.25);
}

.sphere-2 {
    width: 32px;
    height: 32px;
    top: 5px;
    right: 120px;
    background: radial-gradient(circle at 30% 30%, #f48fb1 0%, #d81b60 55%, #880e4f 100%);
    box-shadow: inset -3px -3px 8px rgba(0, 0, 0, 0.35), inset 3px 3px 6px rgba(255, 255, 255, 0.7), 0 8px 16px rgba(216, 27, 96, 0.2);
    animation-duration: 6s;
    animation-delay: -2s;
}

.sphere-3 {
    width: 44px;
    height: 44px;
    top: 150px;
    right: 40px;
    background: radial-gradient(circle at 32% 32%, #d1c4e9 0%, #9575cd 50%, #4527a0 100%);
    box-shadow: inset -4px -4px 10px rgba(0, 0, 0, 0.35), inset 4px 4px 8px rgba(255, 255, 255, 0.6), 0 10px 20px rgba(103, 58, 183, 0.2);
    animation-duration: 9s;
    animation-delay: -4s;
}

.sphere-4 {
    width: 38px;
    height: 38px;
    bottom: 120px;
    left: 45px;
    background: radial-gradient(circle at 35% 30%, #ffab91 0%, #f4511e 50%, #bf360c 100%);
    box-shadow: inset -4px -4px 10px rgba(0, 0, 0, 0.4), inset 4px 4px 8px rgba(255, 255, 255, 0.65), 0 10px 20px rgba(244, 81, 30, 0.25);
    animation-duration: 7s;
    animation-delay: -1s;
}

.sphere-5 {
    width: 24px;
    height: 24px;
    bottom: 220px;
    left: 65px;
    background: radial-gradient(circle at 30% 30%, #f8bbd0 0%, #ec407a 50%, #ad1457 100%);
    box-shadow: inset -3px -3px 6px rgba(0, 0, 0, 0.35), inset 3px 3px 5px rgba(255, 255, 255, 0.6), 0 6px 14px rgba(236, 64, 122, 0.2);
    animation-duration: 5s;
    animation-delay: -3s;
}

.sphere-6 {
    width: 60px;
    height: 60px;
    bottom: 40px;
    left: 50px;
    background: radial-gradient(circle at 32% 32%, #b39ddb 0%, #7e57c2 45%, #311b92 100%);
    box-shadow: inset -6px -6px 14px rgba(0, 0, 0, 0.4), inset 6px 6px 10px rgba(255, 255, 255, 0.7), 0 14px 28px rgba(126, 87, 194, 0.25);
    animation-duration: 8.5s;
    animation-delay: -5s;
}

@keyframes ambientDrift {
    0% {
        transform: translateY(0px) rotate(0deg);
    }
    50% {
        transform: translateY(-12px) rotate(6deg);
    }
    100% {
        transform: translateY(6px) rotate(-4deg);
    }
}

.app-wrapper {
    max-width: 1280px;
    margin: 0 auto;
    padding: 20px 32px 30px 32px;
    position: relative;
    z-index: 2;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    width: 100%;
}

main,
.dashboard-stage,
.main-content {
    flex: 1 0 auto;
    min-width: 0;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
}

#notesGrid {
    min-height: calc(100vh - 250px);
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

body.dark-mode .site-footer a {
    color: #b388ff;
}

.site-footer {
    margin-top: auto;
    width: 100%;
    text-align: center;
    padding: 2.5rem 1rem 1.5rem 1rem;
    position: relative;
    z-index: 5;
    border-top: 1px solid var(--border-subtle);
}

.site-footer p {
    font-size: 0.92rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    font-weight: 400;
}

.site-footer a {
    color: var(--accent-purple);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.site-footer a:hover {
    color: var(--accent-purple-hover);
    text-decoration: underline;
}

.footer-socials {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 0.5rem;
}

.footer-socials a,
.footer-social-link {
    font-size: 1.4rem;
    color: var(--text-secondary);
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent-purple-light);
}

.footer-socials a:hover,
.footer-social-link:hover {
    color: var(--accent-purple);
    transform: translateY(-3px);
    background: rgba(124, 77, 255, 0.2);
}

.nav-domain-notice {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 999999;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: rgba(18, 18, 28, 0.94);
    border: 1px solid rgba(255, 170, 0, 0.45);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 15px rgba(255, 170, 0, 0.15);
    padding: 7px 16px;
    border-radius: 40px;
    font-size: 0.84rem;
    color: #f8fafc;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: all 0.3s ease;
    max-width: 92vw;
    width: max-content;
}

.nav-domain-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 170, 0, 0.25);
    color: #fbbf24;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 14px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.nav-domain-msg {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.nav-domain-msg code {
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 6px;
    border-radius: 6px;
    color: #67e8f9;
    font-size: 0.82rem;
}

.nav-domain-link {
    color: #ffffff;
    background: #4f46e5;
    padding: 3px 9px;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.nav-domain-link:hover {
    background: #4338ca;
    color: #ffffff;
}

.nav-domain-close {
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 1.1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px;
    border-radius: 50%;
    margin-left: 2px;
    transition: all 0.2s ease;
    width: 22px;
    height: 22px;
}

.nav-domain-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

@media (max-width: 768px) {
    .nav-domain-notice {
        top: 70px;
        font-size: 0.76rem;
        padding: 6px 12px;
        gap: 6px;
        max-width: 95vw;
    }
    .nav-domain-msg {
        font-size: 0.74rem;
    }
    .nav-domain-tag {
        font-size: 0.68rem;
        padding: 2px 6px;
    }
}

.top-navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 8px 0 28px 0;
}

.brand-link {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--accent-purple);
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    transition: transform 0.2s ease;
}

.brand-link:hover {
    transform: scale(1.02);
}

.brand-logo-icon {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-pill-container {
    flex: 1;
    max-width: 520px;
    margin: 0 auto;
}

.search-pill {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    background: #ffffff;
    border: 1px solid var(--border-subtle);
    border-radius: 9999px;
    padding: 11px 22px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.03);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.search-pill:focus-within {
    border-color: var(--accent-purple);
    box-shadow: 0 6px 24px rgba(124, 77, 255, 0.12);
    transform: translateY(-1px);
}

.search-pill svg {
    width: 18px;
    height: 18px;
    stroke: var(--text-muted);
    stroke-width: 2;
    fill: none;
    flex-shrink: 0;
}

.search-pill input {
    border: none;
    background: transparent;
    outline: none;
    width: 100%;
    font-size: 0.95rem;
    color: var(--text-primary);
    font-weight: 400;
}

.search-pill input::placeholder {
    color: #9c96a3;
}

.user-profile-bar {
    display: inline-flex;
    align-items: center;
    gap: 16px;
}

.profile-link {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 500;
}

.avatar-img {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
}

.theme-mode-toggle {
    background: #ffffff;
    border: 1px solid var(--border-subtle);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    color: var(--text-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: all 0.2s ease;
}

.theme-mode-toggle:hover {
    background: #f4f5f9;
    border-color: var(--accent-purple);
    color: var(--accent-purple);
    transform: scale(1.05);
}

.theme-mode-toggle i {
    font-size: 1.25rem;
}

.hamburger-btn {
    background: #ffffff;
    border: 1px solid var(--border-subtle);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-end;
    gap: 5px;
    padding: 7px;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: all 0.2s ease;
}

.hamburger-btn:hover {
    background: #f4f5f9;
    border-color: var(--accent-purple);
}

.hamburger-btn span {
    display: block;
    height: 2px;
    background-color: #333333;
    border-radius: 2px;
}

.hamburger-btn span:nth-child(1) {
    width: 20px;
}

.hamburger-btn span:nth-child(2) {
    width: 14px;
}

.hamburger-btn span:nth-child(3) {
    width: 18px;
}

.dashboard-stage {
    position: relative;
    margin-top: 14px;
}

.floating-stationery-widget {
    position: absolute;
    top: -55px;
    right: 25px;
    width: 115px;
    height: 115px;
    z-index: 10;
    pointer-events: auto;
    cursor: pointer;
    animation: binderHover 6s ease-in-out infinite alternate;
}

.floating-stationery-widget img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 12px 22px rgba(124, 77, 255, 0.22));
    transition: transform 0.3s ease;
}

.floating-stationery-widget:hover img {
    transform: scale(1.08) rotate(4deg);
}

@keyframes binderHover {
    0% {
        transform: translateY(0px) rotate(0deg);
    }
    100% {
        transform: translateY(-8px) rotate(-3deg);
    }
}

.notes-masonry-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
    align-items: start;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.grid-column {
    display: flex;
    flex-direction: column;
    gap: 22px;
    min-width: 0;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
}

.pastel-card {
    border-radius: 22px;
    padding: 22px 24px 18px 24px;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.22s ease, box-shadow 0.22s ease;
    box-shadow: var(--shadow-card);
    cursor: pointer;
    user-select: none;
    min-height: 120px;
    height: auto;
    overflow: hidden;
    animation: cardFadeIn 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    min-width: 0;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
}

.pastel-card > div {
    min-width: 0;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
}

@keyframes cardFadeIn {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pastel-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.card-lime {
    background-color: var(--card-lime);
}

.card-pink {
    background-color: var(--card-pink);
}

.card-mint {
    background-color: var(--card-mint);
}

.card-peach {
    background-color: var(--card-peach);
}

.card-header-bar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
    padding-right: 32px;
    min-width: 0;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
}

.card-title {
    font-size: 1.18rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
    letter-spacing: -0.2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
    max-width: 100%;
}

.card-content-body {
    font-size: 0.89rem;
    color: var(--text-secondary);
    line-height: 1.6;
    font-weight: 400;
    margin-bottom: 14px;
    display: -webkit-box;
    -webkit-line-clamp: 7;
    -webkit-box-orient: vertical;
    overflow: hidden;
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: pre-wrap;
    min-width: 0;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
}

.lazy-load-sentinel {
    width: 100%;
    padding: 36px 0 20px 0;
    text-align: center;
}

.lazy-loader-indicator {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 0.92rem;
    color: var(--text-muted);
    background: #ffffff;
    padding: 10px 24px;
    border-radius: 9999px;
    border: 1px solid var(--border-subtle);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.lazy-loader-indicator i {
    font-size: 1.3rem;
    color: var(--accent-purple);
}

.card-footer-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.76rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    min-width: 0;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
    gap: 8px;
}

.card-footer-meta > span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    flex-shrink: 1;
}

.card-badges-row {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.card-badge-secure {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.72rem;
    padding: 2px 8px;
    border-radius: 9999px;
    background: rgba(0, 0, 0, 0.06);
    color: var(--text-secondary);
}

.card-ai-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(124, 77, 255, 0.2);
    color: var(--accent-purple);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 5;
}

.card-ai-btn:hover {
    background: var(--accent-purple);
    color: #ffffff;
    transform: scale(1.08);
}

.card-add-fab {
    position: absolute;
    bottom: 14px;
    right: 14px;
    width: 38px;
    height: 38px;
    background-color: var(--accent-purple);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(124, 77, 255, 0.35);
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.card-add-fab:hover {
    background-color: var(--accent-purple-hover);
    transform: scale(1.1) rotate(90deg);
}

.card-add-fab svg {
    width: 20px;
    height: 20px;
    stroke: #ffffff;
    stroke-width: 2.5;
    fill: none;
}

.global-fab-corner {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 52px;
    height: 52px;
    background-color: var(--accent-purple);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    border: none;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(124, 77, 255, 0.4);
    transition: transform 0.2s ease, background-color 0.2s ease;
    z-index: 99;
}

.global-fab-corner:hover {
    background-color: var(--accent-purple-hover);
    transform: scale(1.08) rotate(90deg);
}

.global-fab-corner svg {
    width: 24px;
    height: 24px;
    stroke: #ffffff;
    stroke-width: 2.5;
    fill: none;
}

.footer-watermark {
    text-align: right;
    padding-top: 36px;
    font-size: 0.8rem;
    color: #a49fab;
    font-weight: 500;
}

.side-drawer-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(18, 14, 28, 0.35);
    backdrop-filter: blur(4px);
    z-index: 500;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.side-drawer-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}

.side-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 320px;
    height: 100vh;
    background: #ffffff;
    box-shadow: -8px 0 30px rgba(0, 0, 0, 0.1);
    z-index: 501;
    transform: translateX(100%);
    transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
    display: flex;
    flex-direction: column;
    padding: 24px;
}

.side-drawer-backdrop.active .side-drawer {
    transform: translateX(0);
}

.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 20px;
}

.drawer-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.drawer-close-btn {
    background: #f1f2f6;
    border: none;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
}

.drawer-menu-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    list-style: none;
    flex: 1;
    overflow-y: auto;
}

.drawer-item a,
.drawer-item button {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 12px 16px;
    border-radius: 14px;
    text-decoration: none;
    color: var(--text-primary);
    background: transparent;
    border: none;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
    text-align: left;
}

.drawer-item a:hover,
.drawer-item button:hover {
    background: #f7f8fc;
    color: var(--accent-purple);
}

.drawer-item i {
    font-size: 1.25rem;
    color: var(--accent-purple);
}

.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(18, 14, 28, 0.45);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    padding: 20px;
}

.modal-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-box {
    background: #ffffff;
    border-radius: 26px;
    max-width: 680px;
    width: 100%;
    padding: 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.14);
    transform: translateY(16px) scale(0.97);
    transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-backdrop.active .modal-box {
    transform: translateY(0) scale(1);
}

.modal-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.modal-header-row h2 {
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close-btn {
    background: #f1f2f6;
    border: none;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: background 0.2s ease;
}

.modal-close-btn:hover {
    background: #e4e6ed;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 12px 16px;
    border-radius: 14px;
    border: 1px solid var(--border-subtle);
    background: #fafbfe;
    font-size: 0.95rem;
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-textarea {
    min-height: 200px;
    resize: vertical;
    line-height: 1.6;
    font-family: 'Outfit', sans-serif;
}

.form-input:focus,
.form-textarea:focus {
    border-color: var(--accent-purple);
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(124, 77, 255, 0.1);
}

.note-options-toggle-grid {
    display: flex;
    gap: 14px;
    margin-bottom: 22px;
    flex-wrap: wrap;
}

.toggle-option-card {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: #f7f8fc;
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    flex: 1;
    min-width: 220px;
}

.toggle-option-card:hover {
    background: #f0f2f8;
    border-color: rgba(124, 77, 255, 0.35);
    transform: translateY(-1px);
}

.toggle-switch-control {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
    cursor: pointer;
}

.toggle-switch-control input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.toggle-switch-track {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    border-radius: 24px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.toggle-switch-track::before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 2px;
    bottom: 2px;
    background-color: #ffffff;
    border-radius: 50%;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25);
}

.toggle-switch-control input:checked + .toggle-switch-track {
    background: linear-gradient(135deg, #7c4dff, #651fff);
    border-color: #651fff;
    box-shadow: 0 2px 10px rgba(101, 31, 255, 0.35);
}

.toggle-switch-control input:checked + .toggle-switch-track::before {
    transform: translateX(20px);
}

.toggle-option-label {
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    line-height: 1.3;
}

.editor-toolbar-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.toolbar-btn {
    background: #f1f2f6;
    border: none;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, color 0.15s ease;
}

.toolbar-btn:hover {
    background: var(--accent-purple);
    color: #ffffff;
}

.editor-mode-tabs {
    display: inline-flex;
    background: #f1f2f6;
    border-radius: 10px;
    padding: 3px;
    margin-left: auto;
    gap: 3px;
}

.editor-mode-tab {
    background: transparent;
    border: none;
    padding: 5px 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
}

.editor-mode-tab.active {
    background: #ffffff;
    color: var(--accent-purple);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.editor-preview-container {
    display: none;
    min-height: 200px;
    max-height: 380px;
    overflow-y: auto;
    padding: 14px 18px;
    border-radius: 14px;
    border: 1px solid var(--border-subtle);
    background: #fafbfe;
    font-size: 0.95rem;
    line-height: 1.65;
    color: var(--text-primary);
}

.editor-preview-container.active {
    display: block;
}

.editor-preview-container h1,
.editor-preview-container h2,
.editor-preview-container h3 {
    margin: 12px 0 6px 0;
    color: var(--text-primary);
}

.editor-preview-container pre,
.editor-preview-container code {
    font-family: 'JetBrains Mono', monospace;
    background: #f1f2f6;
    border-radius: 6px;
    padding: 2px 6px;
    font-size: 0.88rem;
}

.editor-preview-container pre {
    padding: 12px;
    overflow-x: auto;
    margin: 10px 0;
}

.editor-meta-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.78rem;
    color: var(--text-muted);
    padding: 6px 2px;
    margin-bottom: 14px;
}

.color-picker-row {
    display: flex;
    gap: 10px;
    margin-bottom: 18px;
}

.color-choice {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.color-choice.selected {
    border-color: var(--accent-purple);
    transform: scale(1.15);
}

.modal-btn-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
}

.btn-secondary {
    background: #f1f2f6;
    color: var(--text-secondary);
    border: none;
    padding: 10px 20px;
    border-radius: 12px;
    font-size: 0.92rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
}

.btn-secondary:hover {
    background: #e4e6ed;
}

.btn-primary {
    background: var(--accent-purple);
    color: #ffffff;
    border: none;
    padding: 10px 24px;
    border-radius: 12px;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(124, 77, 255, 0.28);
    transition: background 0.2s ease, transform 0.2s ease;
}

.btn-primary:hover {
    background: var(--accent-purple-hover);
    transform: translateY(-1px);
}

.btn-danger {
    background: #fee2e2;
    color: #b91c1c;
    border: none;
    padding: 10px 18px;
    border-radius: 12px;
    font-size: 0.92rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
    margin-right: auto;
}

.btn-danger:hover {
    background: #fecaca;
}

.read-modal-actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.read-action-icon-btn {
    background: #f1f2f6;
    border: none;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
}

.read-action-icon-btn:hover {
    background: var(--accent-purple);
    color: #ffffff;
}

.read-action-icon-btn.danger:hover {
    background: #ef4444;
    color: #ffffff;
}

.toast-popup {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%) translateY(40px);
    background: #232228;
    color: #ffffff;
    padding: 12px 24px;
    border-radius: 9999px;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    opacity: 0;
    pointer-events: none;
    transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
    z-index: 2000;
}

.toast-popup.active {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

.empty-notes-view {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-notes-view p {
    font-size: 1.05rem;
    margin-top: 10px;
}

@media (max-width: 1024px) {
    .notes-masonry-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 680px) {
    .app-wrapper {
        padding: 16px 16px 24px 16px;
    }
    .top-navbar {
        flex-wrap: wrap;
    }
    .search-pill-container {
        order: 3;
        max-width: 100%;
        margin-top: 10px;
    }
    .notes-masonry-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 16px;
        width: 100%;
        max-width: 100%;
    }
    .grid-column {
        gap: 16px;
        width: 100%;
        max-width: 100%;
    }
    .pastel-card {
        border-radius: 18px;
        padding: 18px 18px 14px 18px;
        width: 100%;
        max-width: 100%;
    }
    .skeleton-card {
        border-radius: 18px;
        padding: 18px 18px 14px 18px;
        width: 100%;
        max-width: 100%;
    }
    .floating-stationery-widget {
        display: none;
    }
    .sphere {
        display: none;
    }
}

body.dark-mode {
    --bg-canvas: #0f0e15;
    --text-primary: #f3f2f7;
    --text-secondary: #b5b0be;
    --text-muted: #a39eb0;
    --border-subtle: rgba(255, 255, 255, 0.08);
    --shadow-soft: 0 8px 30px rgba(0, 0, 0, 0.35);
    --shadow-card: 0 4px 18px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 16px 36px rgba(0, 0, 0, 0.55);
}

body.dark-mode .top-navbar {
    border-color: rgba(255, 255, 255, 0.07);
}

body.dark-mode .search-pill {
    background: #181722;
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

body.dark-mode .search-pill input {
    color: #f3f2f7;
}

body.dark-mode .search-pill input::placeholder {
    color: #6d6878;
}

body.dark-mode .search-pill svg {
    stroke: #878292;
}

body.dark-mode .theme-mode-toggle,
body.dark-mode .hamburger-btn {
    background: #181722;
    border-color: rgba(255, 255, 255, 0.1);
    color: #f3f2f7;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

body.dark-mode .theme-mode-toggle:hover,
body.dark-mode .hamburger-btn:hover {
    background: #232230;
    border-color: var(--accent-purple);
    color: var(--accent-purple);
}

body.dark-mode .hamburger-btn span {
    background-color: #f3f2f7;
}

body.dark-mode .card-lime {
    background-color: #1e2617;
    border: 1px solid rgba(232, 243, 191, 0.2);
}

body.dark-mode .card-lime .card-title {
    color: #e8f3bf;
}

body.dark-mode .card-pink {
    background-color: #2b1722;
    border: 1px solid rgba(252, 211, 231, 0.2);
}

body.dark-mode .card-pink .card-title {
    color: #fcd3e7;
}

body.dark-mode .card-mint {
    background-color: #15271a;
    border: 1px solid rgba(214, 240, 206, 0.2);
}

body.dark-mode .card-mint .card-title {
    color: #d6f0ce;
}

body.dark-mode .card-peach {
    background-color: #2a1e15;
    border: 1px solid rgba(254, 221, 192, 0.2);
}

body.dark-mode .card-peach .card-title {
    color: #feddc0;
}

body.dark-mode .card-content-body {
    color: #c2bdcb;
}

body.dark-mode .card-footer-meta {
    color: #a8a2b5;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

body.dark-mode .card-badge-secure {
    background: rgba(255, 255, 255, 0.08);
    color: #c2bdcb;
}

body.dark-mode .card-ai-btn {
    background: rgba(30, 29, 40, 0.85);
    border-color: rgba(124, 77, 255, 0.4);
}

body.dark-mode .side-drawer {
    background: #171622;
    box-shadow: -8px 0 30px rgba(0, 0, 0, 0.45);
}

body.dark-mode .drawer-header {
    border-color: rgba(255, 255, 255, 0.08);
}

body.dark-mode .drawer-header h3 {
    color: #f3f2f7;
}

body.dark-mode .drawer-close-btn {
    background: #232230;
    color: #b5b0be;
}

body.dark-mode .drawer-item a,
body.dark-mode .drawer-item button {
    color: #f3f2f7;
}

body.dark-mode .drawer-item a:hover,
body.dark-mode .drawer-item button:hover {
    background: #232230;
    color: var(--accent-purple);
}

body.dark-mode .modal-box {
    background: #181722;
    box-shadow: 0 24px 65px rgba(0, 0, 0, 0.6);
}

body.dark-mode .modal-header-row h2 {
    color: #f3f2f7;
}

body.dark-mode .modal-close-btn {
    background: #232230;
    color: #b5b0be;
}

body.dark-mode .form-input,
body.dark-mode .form-textarea {
    background: #12111b;
    border-color: rgba(255, 255, 255, 0.12);
    color: #f3f2f7;
}

body.dark-mode .form-input:focus,
body.dark-mode .form-textarea:focus {
    background: #161522;
    border-color: var(--accent-purple);
}

body.dark-mode .toggle-option-card {
    background: #14131d;
    border-color: rgba(255, 255, 255, 0.08);
}

body.dark-mode .toggle-option-card:hover {
    background: #1a1926;
    border-color: rgba(124, 77, 255, 0.4);
}

body.dark-mode .toggle-switch-track {
    background-color: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.12);
}

body.dark-mode .toggle-option-label {
    color: #f3f2f7;
}

body.dark-mode .toolbar-btn {
    background: #232230;
    color: #b5b0be;
}

body.dark-mode .editor-mode-tabs {
    background: #232230;
}

body.dark-mode .editor-mode-tab.active {
    background: #181722;
    color: var(--accent-purple);
}

body.dark-mode .editor-preview-container {
    background: #12111b;
    border-color: rgba(255, 255, 255, 0.1);
    color: #f3f2f7;
}

body.dark-mode .editor-preview-container pre,
body.dark-mode .editor-preview-container code {
    background: #232230;
    color: #e5e3ec;
}

body.dark-mode .btn-secondary {
    background: #232230;
    color: #b5b0be;
}

body.dark-mode .btn-secondary:hover {
    background: #2d2c3e;
}

body.dark-mode .read-action-icon-btn {
    background: #232230;
    color: #b5b0be;
}

body.dark-mode .read-action-icon-btn:hover {
    background: var(--accent-purple);
    color: #ffffff;
}

body.dark-mode .lazy-loader-indicator {
    background: #181722;
    border-color: rgba(255, 255, 255, 0.1);
    color: #b5b0be;
}

body.dark-mode .footer-watermark {
    color: #555060;
}

.site-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    padding: 18px 28px;
    margin: 40px auto 24px auto;
    max-width: 1200px;
    width: calc(100% - 40px);
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    box-shadow: var(--shadow-card);
    transition: all 0.3s ease;
    z-index: 10;
    position: relative;
}

body.dark-mode .site-footer {
    background: rgba(24, 23, 36, 0.85);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.site-footer p {
    margin: 0;
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.site-footer p a {
    color: var(--accent-purple);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.site-footer p a:hover {
    color: var(--accent-purple-hover);
    text-decoration: underline;
}

.footer-socials {
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-social-link {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f4f5f8;
    border: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 1.15rem;
    text-decoration: none;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.footer-social-link:hover {
    background: var(--accent-purple);
    color: #ffffff;
    border-color: var(--accent-purple);
    transform: translateY(-3px) scale(1.06);
    box-shadow: 0 6px 18px rgba(124, 77, 255, 0.35);
}

body.dark-mode .footer-social-link {
    background: #232230;
    border-color: rgba(255, 255, 255, 0.08);
    color: #b5b0be;
}

body.dark-mode .footer-social-link:hover {
    background: var(--accent-purple);
    color: #ffffff;
}

@media (max-width: 640px) {
    .site-footer {
        flex-direction: column;
        text-align: center;
        justify-content: center;
        padding: 16px 20px;
    }
}

.classic-chip-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 13px;
    background: #ffffff;
    border: 1px solid var(--border-subtle);
    border-radius: 9999px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.classic-chip-btn i {
    font-size: 1rem;
    color: var(--accent-purple);
}

.classic-chip-btn:hover {
    background: #fbfbfe;
    color: var(--text-primary);
    border-color: var(--accent-purple);
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(124, 77, 255, 0.15);
}

body.dark-mode .classic-chip-btn {
    background: #232230;
    border-color: rgba(255, 255, 255, 0.08);
    color: #b5b0be;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

body.dark-mode .classic-chip-btn:hover {
    background: #2b2a3b;
    color: #ffffff;
    border-color: var(--accent-purple);
}

@media (max-width: 480px) {
    .app-wrapper {
        padding: 12px 12px 20px 12px;
    }
    .pastel-card {
        border-radius: 16px;
        padding: 16px 14px 12px 14px;
    }
    .skeleton-card {
        border-radius: 16px;
        padding: 16px 14px 12px 14px;
    }
    .global-fab-corner {
        bottom: 20px;
        right: 20px;
    }
    .classic-chip-btn span {
        display: none;
    }
    .classic-chip-btn {
        padding: 6px 8px;
    }
}

.drawer-section-title {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    font-weight: 700;
    padding: 12px 14px 4px 14px;
    margin-top: 8px;
}

.form-group.split-mode {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    align-items: stretch;
}

.form-group.split-mode label {
    grid-column: 1 / -1;
}

.form-group.split-mode .form-textarea,
.form-group.split-mode .editor-preview-container {
    height: 380px;
    min-height: 380px;
    max-height: 380px;
    margin-bottom: 0;
}

@media (max-width: 680px) {
    .form-group.split-mode {
        grid-template-columns: 1fr;
    }
    .modal-box {
        padding: 20px 16px;
        border-radius: 20px;
    }
    .modal-header-row {
        flex-wrap: wrap;
        gap: 10px;
    }
    .read-modal-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
    }
}

.skeleton-card {
    border-radius: 22px;
    padding: 24px;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: var(--shadow-card);
    overflow: hidden;
    background: #ffffff;
    border: 1px solid var(--border-subtle);
    min-width: 0;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
}

body.dark-mode .skeleton-card {
    background: #181724;
    border-color: rgba(255, 255, 255, 0.08);
}

.skeleton-shimmer {
    background: linear-gradient(90deg, rgba(124, 77, 255, 0.05) 0%, rgba(124, 77, 255, 0.15) 50%, rgba(124, 77, 255, 0.05) 100%);
    background-size: 200% 100%;
    animation: skeletonShimmer 1.6s infinite ease-in-out;
    border-radius: 8px;
}

body.dark-mode .skeleton-shimmer {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.12) 50%, rgba(255, 255, 255, 0.04) 100%);
    background-size: 200% 100%;
}

@keyframes skeletonShimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.skeleton-title {
    height: 22px;
    width: 65%;
    margin-bottom: 16px;
}

.skeleton-line {
    height: 14px;
    width: 100%;
    margin-bottom: 10px;
}

.skeleton-line.short {
    width: 80%;
}

.skeleton-line.shorter {
    width: 55%;
}

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

.skeleton-meta-badge {
    height: 18px;
    width: 48px;
    border-radius: 9999px;
}

.skeleton-date {
    height: 14px;
    width: 80px;
}



