/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   BLineNote â€” 2026 Ultra-Modern Design System
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */

body {
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    letter-spacing: -0.01em;
}

/* â”€â”€ Base Transitions â”€â”€ */
button,
input,
select,
textarea {
    font-family: inherit;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

/* â”€â”€ Custom Scrollbar â”€â”€ */
.notes-scroll::-webkit-scrollbar,
#detail-content::-webkit-scrollbar,
#gemini-content::-webkit-scrollbar {
    width: 4px;
}
.notes-scroll::-webkit-scrollbar-track,
#detail-content::-webkit-scrollbar-track,
#gemini-content::-webkit-scrollbar-track {
    background: transparent;
}
.notes-scroll::-webkit-scrollbar-thumb,
#detail-content::-webkit-scrollbar-thumb,
#gemini-content::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 9999px;
}
.dark .notes-scroll::-webkit-scrollbar-thumb,
.dark #detail-content::-webkit-scrollbar-thumb,
.dark #gemini-content::-webkit-scrollbar-thumb {
    background: #475569;
}

/* Firefox */
.notes-scroll,
#detail-content,
#gemini-content {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}
.dark .notes-scroll,
.dark #detail-content,
.dark #gemini-content {
    scrollbar-color: #475569 transparent;
}

/* â”€â”€ Display Flex Utility â”€â”€ */
.display-flex:not(.hidden) {
    display: flex;
}

/* â”€â”€ Image Styling â”€â”€ */
#hasil-teks img.note-image,
#detail-content img.note-image {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
    margin: 0.5rem 0;
}
#hasil-teks figure.note-figure,
#detail-content figure.note-figure {
    margin: 0.5rem 0;
}
#hasil-teks figcaption.note-caption,
#detail-content figcaption.note-caption {
    font-size: 0.8rem;
    color: #64748b;
    margin-top: 0.25rem;
}
.dark #hasil-teks figcaption.note-caption,
.dark #detail-content figcaption.note-caption {
    color: #94a3b8;
}

/* â•â•â• Topbar â•â•â• */
#main-navbar {
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 4px 20px -2px rgba(99, 102, 241, 0.06);
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    display: flex;
    align-items: center;
    z-index: 50;
}
.dark #main-navbar {
    background-color: rgba(15, 23, 42, 0.85);
    border-bottom-color: rgba(51, 65, 85, 0.8);
    box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.4);
}

/* â•â•â• Glass Card (2026 Edition) â•â•â• */
.glass-card {
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-top: 1px solid rgba(255, 255, 255, 0.95);
    box-shadow: 0 25px 50px -12px rgba(99, 102, 241, 0.08), 0 0 0 1px rgba(99, 102, 241, 0.04);
}
.dark .glass-card {
    background: rgba(15, 23, 42, 0.88);
    border: 1px solid rgba(51, 65, 85, 0.8);
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(129, 140, 248, 0.1);
}


/* â•â•â• Auth Split Panel â€” Responsive â•â•â• */

/* Mobile: sembunyikan panel kiri, tampilkan mobile header */
.auth-left-panel       { display: none; }
.auth-mobile-header    { display: flex !important; }
.auth-desktop-corner   { display: none; }

/* Desktop (â‰¥768px): tampilkan panel kiri, sembunyikan mobile header */
@media (min-width: 768px) {
    .auth-left-panel    { display: block; }
    .auth-mobile-header { display: none !important; }
    .auth-desktop-corner { display: block; }
}

/* â•â•â• Sticky Formatting Toolbar â•â•â• */
#formatting-toolbar {
    position: sticky;
    top: 3.75rem;
    z-index: 30;
    background-color: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
}
.dark #formatting-toolbar {
    background-color: rgba(15, 23, 42, 0.92);
    border-bottom-color: rgba(51, 65, 85, 0.8);
}

.toolbar-group {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 3px;
    border-radius: 10px;
    background: rgba(241, 245, 249, 0.7);
}
.dark .toolbar-group {
    background: rgba(15, 23, 42, 0.6);
}

.toolbar-divider {
    width: 1px;
    height: 18px;
    background-color: #cbd5e1;
    margin: 0 4px;
    flex-shrink: 0;
}
.dark .toolbar-divider {
    background-color: #475569;
}

.toolbar-file-ops {
    opacity: 0.85;
    transition: opacity 0.15s ease;
}
.toolbar-file-ops:hover {
    opacity: 1;
}

.toolbar-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border-radius: 6px;
    font-size: 12px;
    color: #64748b;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
    flex-shrink: 0;
    position: relative;
}
.toolbar-btn:hover {
    background: #e2e8f0;
    color: #1e293b;
}
.dark .toolbar-btn {
    color: #94a3b8;
}
.dark .toolbar-btn:hover {
    background: #334155;
    color: #f1f5f9;
}
.toolbar-btn.active,
.toolbar-btn.auto-url-enabled {
    background: #6366f1;
    color: #fff;
    box-shadow: none;
}

/* â•â•â• Editor Area â•â•â• */
#hasil-teks {
    cursor: text !important;
    caret-color: #4f46e5 !important;
    color: #0f172a;
}
.dark #hasil-teks {
    color: #f8fafc;
}
#hasil-teks:empty::before {
    content: attr(placeholder);
    color: #94a3b8;
    pointer-events: none;
    font-style: italic;
}
.dark #hasil-teks:empty::before {
    color: #64748b;
}
#hasil-teks:focus {
    outline: none;
}

/* Custom Typography & Rich Formatting inside Editor */
#hasil-teks h1 {
    font-size: 1.65rem;
    font-weight: 700;
    color: #0f172a;
    margin-top: 0.75rem;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}
.dark #hasil-teks h1 {
    color: #f8fafc;
}

#hasil-teks h2 {
    font-size: 1.35rem;
    font-weight: 600;
    color: #1e293b;
    margin-top: 0.6rem;
    margin-bottom: 0.4rem;
    line-height: 1.35;
}
.dark #hasil-teks h2 {
    color: #f1f5f9;
}

#hasil-teks h3 {
    font-size: 1.15rem;
    font-weight: 600;
    color: #334155;
    margin-top: 0.5rem;
    margin-bottom: 0.3rem;
}
.dark #hasil-teks h3 {
    color: #e2e8f0;
}

/* Judul Utama Halaman Detail Catatan */
#detail-title-heading {
    color: #0f172a !important;
    font-size: 1.65rem !important;
    font-weight: 800 !important;
    line-height: 1.25 !important;
}
.dark #detail-title-heading {
    color: #ffffff !important;
}

/* Badge Tag Halaman Detail Catatan */
.detail-tag-badge {
    background-color: #e0e7ff !important;
    color: #3730a3 !important;
    border: 1px solid #c7d2fe !important;
    font-weight: 600 !important;
}
.dark .detail-tag-badge {
    background-color: #1e1b4b !important;
    color: #c7d2fe !important;
    border: 1px solid #312e81 !important;
}

/* Tipografi Halaman Detail Catatan (#detail-content) */
#detail-content {
    color: #1e293b !important;
}
.dark #detail-content {
    color: #f1f5f9 !important;
}

#detail-content h1,
#detail-content h1 *,
#detail-content .note-detail-title,
#detail-content .note-detail-title * {
    font-size: 1.75rem !important;
    font-weight: 800 !important;
    color: #0f172a !important;
    margin-top: 0.5rem !important;
    margin-bottom: 0.75rem !important;
    line-height: 1.3 !important;
}
.dark #detail-content h1,
.dark #detail-content h1 *,
.dark #detail-content .note-detail-title,
.dark #detail-content .note-detail-title * {
    color: #ffffff !important;
}


#detail-content h2,
#detail-content h2 * {
    font-size: 1.4rem !important;
    font-weight: 700 !important;
    color: #1e293b !important;
    margin-top: 0.75rem !important;
    margin-bottom: 0.5rem !important;
    line-height: 1.35 !important;
}
.dark #detail-content h2,
.dark #detail-content h2 * {
    color: #f8fafc !important;
}

#detail-content h3,
#detail-content h3 * {
    font-size: 1.2rem !important;
    font-weight: 600 !important;
    color: #334155 !important;
    margin-top: 0.6rem !important;
    margin-bottom: 0.4rem !important;
}
.dark #detail-content h3,
.dark #detail-content h3 * {
    color: #f1f5f9 !important;
}

#detail-content p,
#detail-content div,
#detail-content li {
    color: #334155 !important;
}
.dark #detail-content p,
.dark #detail-content div,
.dark #detail-content li {
    color: #cbd5e1 !important;
}

#detail-content a {
    color: #3b82f6 !important;
    text-decoration: underline !important;
}
.dark #detail-content a {
    color: #60a5fa !important;
}



#hasil-teks blockquote {
    border-left: 4px solid #6366f1;
    padding-left: 0.85rem;
    margin: 0.6rem 0;
    font-style: italic;
    color: #475569;
    background: rgba(99, 102, 241, 0.05);
    padding-top: 0.35rem;
    padding-bottom: 0.35rem;
    border-radius: 0 0.375rem 0.375rem 0;
}
.dark #hasil-teks blockquote {
    color: #cbd5e1;
    background: rgba(99, 102, 241, 0.12);
}

#hasil-teks table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.75rem 0;
    font-size: 0.9rem;
}
#hasil-teks table th,
#hasil-teks table td {
    border: 1px solid #cbd5e1;
    padding: 0.5rem 0.75rem;
    text-align: left;
}
.dark #hasil-teks table th,
.dark #hasil-teks table td {
    border-color: #475569;
}
#hasil-teks table th {
    background-color: #f1f5f9;
    font-weight: 600;
}
.dark #hasil-teks table th {
    background-color: #1e293b;
}

#hasil-teks img {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
    margin: 0.75rem 0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

#text-color-indicator {
    transition: background-color 0.2s ease;
}

/* Checkbox Login Presisi & Ringkas */
.custom-login-checkbox {
    appearance: auto !important;
    -webkit-appearance: checkbox !important;
    width: 15px !important;
    height: 15px !important;
    min-width: 15px !important;
    min-height: 15px !important;
    max-width: 15px !important;
    max-height: 15px !important;
    border-radius: 4px !important;
    accent-color: #3a7bd5 !important;
    cursor: pointer !important;
    margin: 0 !important;
    padding: 0 !important;
    display: inline-block !important;
    vertical-align: middle !important;
}


input[type="text"],
input[type="search"],
input[type="email"],
input[type="password"],
input[type="url"],
input[type="tel"],
textarea,
[contenteditable="true"],
#hasil-teks {
    cursor: text !important;
    caret-color: #000000 !important;
}

[contenteditable="true"]:empty::before,
[contenteditable]:empty::before {
    pointer-events: none !important;
}

#editor-card {
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
#editor-card:focus-within {
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.12);
    border-color: #8b5cf6;
}
.dark #editor-card:focus-within {
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
    border-color: #a78bfa;
}

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   Professional UI & Login Visual Design System
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */

/* Kolom Isi / Input Fields */
.input-login-styled {
    width: 100%;
    padding: 11px 16px;
    border: 1.5px solid #8b5cf6 !important;
    border-radius: 10px !important;
    font-size: 13.5px !important;
    font-weight: 500 !important;
    color: #1e293b !important;
    background-color: #ffffff !important;
    outline: none !important;
    box-sizing: border-box !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.input-login-styled:focus {
    border-color: #7c3aed !important;
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.15) !important;
    background-color: #ffffff !important;
}

.dark .input-login-styled {
    border-color: #8b5cf6 !important;
    background-color: #0f172a !important;
    color: #f8fafc !important;
}

.dark .input-login-styled:focus {
    border-color: #a78bfa !important;
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.25) !important;
}

/* Tombol Utama (Gradien Cyan-Biru) */
.btn-login-gradient {
    background: linear-gradient(135deg, #00d2ff 0%, #3a7bd5 100%) !important;
    color: #ffffff !important;
    height: 40px !important;
    padding: 0 20px !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    border-radius: 10px !important;
    border: none !important;
    cursor: pointer !important;
    box-shadow: 0 6px 18px rgba(58, 123, 213, 0.35) !important;
    letter-spacing: 0.04em !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    white-space: nowrap !important;
}

.btn-login-gradient:hover {
    opacity: 0.95 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 24px rgba(58, 123, 213, 0.45) !important;
}

.btn-login-gradient:active {
    transform: translateY(0) !important;
    box-shadow: 0 4px 12px rgba(58, 123, 213, 0.3) !important;
}

/* Tombol Rekam Suara (Gradien Rose-Red Professional) */
.btn-record-gradient {
    background: linear-gradient(135deg, #ff416c 0%, #ff4b2b 100%) !important;
    color: #ffffff !important;
    height: 40px !important;
    padding: 0 18px !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    border-radius: 10px !important;
    border: none !important;
    cursor: pointer !important;
    box-shadow: 0 6px 18px rgba(255, 65, 108, 0.35) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    white-space: nowrap !important;
}

.btn-record-gradient:hover {
    opacity: 0.95 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 24px rgba(255, 65, 108, 0.45) !important;
}

/* Tombol Sekunder (Clean Glass & Slim Border) */
.btn-login-secondary {
    background: #ffffff !important;
    border: 1.5px solid #e2e8f0 !important;
    border-radius: 10px !important;
    height: 40px !important;
    padding: 0 16px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    color: #334155 !important;
    cursor: pointer !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    white-space: nowrap !important;
}

.btn-login-secondary.btn-icon-only {
    width: 40px !important;
    padding: 0 !important;
}


.btn-login-secondary:hover {
    background: #f8fafc !important;
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
}

.dark .btn-login-secondary {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #f1f5f9 !important;
}

.dark .btn-login-secondary:hover {
    background: #334155 !important;
    border-color: #475569 !important;
}

/* Kartu Kontainer Dashboard Professional */
.card-login-styled {
    background: #ffffff !important;
    border-radius: 20px !important;
    border: 1px solid rgba(226, 232, 240, 0.9) !important;
    box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.05), 0 0 1px rgba(0,0,0,0.1) !important;
}

.dark .card-login-styled {
    background: #0f172a !important;
    border-color: #1e293b !important;
    box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.5) !important;
}

/* Animasi Denyut Rekam Suara */
@keyframes recordPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 65, 108, 0.6);
    }
    70% {
        box-shadow: 0 0 0 12px rgba(255, 65, 108, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 65, 108, 0);
    }
}

.recording-pulse-active {
    animation: recordPulse 1.5s infinite !important;
    background: linear-gradient(135deg, #ff416c 0%, #ff4b2b 100%) !important;
}



/* Tag input */
#tag-input {
    font-size: 0.8rem;
    height: 30px;
}

/* â•â•â• Notes List â•â•â• */
.note-card {
    padding: 10px 12px !important;
    border-radius: 8px !important;
    border: 1px solid transparent;
    transition: all 0.2s ease-in-out;
    cursor: pointer;
}
.note-card:hover {
    transform: translateY(-2px);
    border-color: #6366f1;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}
.dark .note-card:hover {
    border-color: #818cf8;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.35), 0 2px 4px -1px rgba(0, 0, 0, 0.25);
}
.note-card p,
.note-card .note-preview {
    font-size: 0.8rem !important;
    line-height: 1.45 !important;
}

/* â•â•â• Search Input â•â•â• */
#search-input {
    font-size: 0.85rem;
    height: 34px;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
#search-input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}

/* â•â•â• Filter & Sort Buttons (base transition) â•â•â• */
.quick-filter-btn {
    transition: background-color 0.15s ease, color 0.15s ease;
    -webkit-user-select: none;
    user-select: none;
}

/* â•â•â• Status Message â•â•â• */
#status {
    font-size: 0.75rem;
    height: 18px;
    transition: opacity 0.3s ease;
}

#status-div {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
    max-width: min(90vw, 360px);
    padding: 0.7rem 0.95rem;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    background: rgba(15, 23, 42, 0.92);
    color: #f8fafc;
    line-height: 1.4;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

.dark #status-div {
    background: rgba(2, 6, 23, 0.95);
}

/* â•â•â• Mobile Navigation â•â•â• */
.safe-area-bottom {
    padding-bottom: env(safe-area-inset-bottom, 0px);
}
#mobile-nav button {
    position: relative;
    transition: color 0.2s ease;
}
#mobile-nav button.active {
    color: #6366f1;
}
.dark #mobile-nav button.active {
    color: #818cf8;
}

/* â•â•â• FAB Buttons â•â•â• */
#fab-rekam,
#fab-pause {
    position: fixed;
    transition: box-shadow 0.2s ease;
}
#fab-rekam:hover,
#fab-pause:hover {
    box-shadow: 0 4px 10px rgba(15,23,42,0.14);
}

/* â•â•â• Modal Backdrops â•â•â• */
#modal-pengaturan,
#modal-hapus,
#modal-gemini {
    transition: opacity 0.12s ease;
}

/* â•â•â• Detail Page â•â•â• */
#note-detail-page {
    background: linear-gradient(135deg, #f8fafc 0%, #edf2f7 50%, #e2e8f0 100%);
}

.dark #note-detail-page {
    background: linear-gradient(135deg, #090d16 0%, #0f172a 50%, #090d16 100%);
}

#detail-header {
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.05);
}

#detail-card {
    border-radius: 20px;
    border: 1px solid rgba(226, 232, 240, 0.95);
    box-shadow: 0 20px 40px -15px rgba(15, 23, 42, 0.08);
}

.dark #detail-card {
    border-color: rgba(51, 65, 85, 0.8);
    box-shadow: 0 20px 40px -15px rgba(2, 6, 23, 0.5);
}

#detail-metadata > span {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.7rem;
    border-radius: 999px;
    background: rgba(241, 245, 249, 0.9);
    border: 1px solid rgba(226, 232, 240, 0.95);
    font-size: 0.75rem;
    font-weight: 500;
}

.dark #detail-metadata > span {
    background: rgba(30, 41, 59, 0.6);
    border-color: rgba(51, 65, 85, 0.8);
}

#detail-content {
    color: #1e293b;
    font-size: 1.0625rem;
    line-height: 1.85;
    letter-spacing: 0.01em;
    word-break: break-word;
}

.dark #detail-content {
    color: #f1f5f9;
}

#detail-content p {
    margin-top: 0.85rem;
    margin-bottom: 0.85rem;
}

#detail-content ul,
#detail-content ol {
    margin-top: 0.85rem;
    margin-bottom: 0.85rem;
    padding-left: 1.5rem;
}

#detail-content ul {
    list-style-type: disc;
}

#detail-content ol {
    list-style-type: decimal;
}

#detail-content li {
    margin-top: 0.35rem;
    margin-bottom: 0.35rem;
}

#detail-content blockquote {
    margin: 1.25rem 0;
    padding: 0.75rem 1.25rem;
    border-left: 4px solid #6366f1;
    background: rgba(99, 102, 241, 0.06);
    border-radius: 0 0.5rem 0.5rem 0;
    font-style: italic;
    color: #334155;
}

.dark #detail-content blockquote {
    background: rgba(99, 102, 241, 0.12);
    color: #cbd5e1;
}

#detail-content code {
    background: rgba(241, 245, 249, 0.9);
    color: #4f46e5;
    padding: 0.25rem 0.45rem;
    border-radius: 0.375rem;
    font-size: 0.9em;
}

.dark #detail-content code {
    background: rgba(30, 41, 59, 0.9);
    color: #818cf8;
}

#detail-content a {
    color: #4f46e5;
    font-weight: 500;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.dark #detail-content a {
    color: #818cf8;
}

#close-detail-btn,
#detail-copy-btn,
#detail-ai-btn,
#detail-speak-btn,
#detail-edit-btn,
#detail-delete-btn {
    transition: background-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

#close-detail-btn:hover,
#detail-copy-btn:hover,
#detail-ai-btn:hover,
#detail-speak-btn:hover,
#detail-edit-btn:hover,
#detail-delete-btn:hover {
    transform: translateY(-1px);
}

#detail-ai-btn:hover,
#detail-speak-btn:hover,
#detail-edit-btn:hover,
#detail-delete-btn:hover {
    transform: translateY(-1px);
}

/* â•â•â• Auth Page â•â•â• */
/* intentionally minimal for mature UI */

/* â•â•â• Loader â•â•â• */
.loader {
    width: 28px;
    height: 28px;
    border: 3px solid #e2e8f0;
    border-top-color: #6366f1;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}
.dark .loader {
    border-color: #334155;
    border-top-color: #818cf8;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* â•â•â• Responsive Tweaks â•â•â• */
@media (max-width: 767px) {
    /* Tighter main container on mobile */
    #main-content-container .container {
        padding-left: 12px;
        padding-right: 12px;
    }
    
    /* Editor card compact mobile */
    #editor-card {
        padding: 12px !important;
        border-radius: 10px !important;
    }
    
    /* Smaller toolbar on mobile */
    .toolbar-btn {
        width: 26px;
        height: 26px;
        font-size: 11px;
    }
    
    /* Notes container max-height mobile */
    #catatan-tersimpan-container {
        max-height: calc(100vh - 16rem);
    }
    
    /* Detail page mobile */
    #note-detail-page .prose {
        font-size: 0.9rem;
    }
}

@media (min-width: 768px) {
    /* Desktop: notes sidebar has fixed height scroll */
    #catatan-tersimpan-container {
        max-height: calc(100vh - 14rem);
    }
}

/* â•â•â• Selection â•â•â• */
::selection {
    background: rgba(99,102,241,0.2);
    color: inherit;
}
.dark ::selection {
    background: rgba(129,140,248,0.3);
}

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   Layout Refactoring â€“ 2-Column Side-by-Side
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */

/* Desktop: paksa 2-kolom grid (65% editor + 35% catatan) */
@media (min-width: 1024px) {
    #app-container {
        display: grid !important;
        grid-template-columns: 65fr 35fr !important;
        gap: 1.5rem !important;
        align-items: start;
    }

    /* Panel catatan kanan: sticky, scroll mandiri */
    #notes-view {
        position: sticky;
        top: 3.7rem;
        max-height: calc(100vh - 4.3rem);
        overflow-y: auto;
    }
}

/* Mobile: 1-kolom bersusun */
@media (max-width: 1023px) {
    #app-container {
        display: grid !important;
        grid-template-columns: 1fr !important;
    }
}

/* ══ Topbar Header User Pill & Spacing System ══ */
#auth-container {
    display: flex !important;
    align-items: center !important;
    gap: 0.75rem !important;
}

#user-info {
    display: flex !important;
    align-items: center !important;
    gap: 0.625rem !important;
}

#user-profile-trigger {
    display: flex !important;
    align-items: center !important;
    gap: 0.625rem !important;
    padding: 0.25rem 0.625rem 0.25rem 0.25rem !important;
    border-radius: 9999px !important;
    transition: background-color 0.2s ease, transform 0.15s ease !important;
}

#user-avatar {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    min-height: 32px !important;
    border-radius: 50% !important;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%) !important;
    color: #ffffff !important;
    font-size: 0.75rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.02em !important;
    text-transform: uppercase !important;
    flex-shrink: 0 !important;
    cursor: pointer !important;
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.25) !important;
}

#user-email {
    display: inline-block !important;
    margin: 0 !important;
    padding: 0 !important;
    font-size: 0.75rem !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 180px !important;
}

/* â•â•â• Right Side Drawer Pengaturan & Profil Compact Styling â•â•â• */
#modal-pengaturan {
    position: fixed;
    inset: 0;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

#modal-pengaturan.open {
    opacity: 1;
    pointer-events: auto;
}

.drawer-backdrop {
    position: absolute;
    inset: 0;
    background-color: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   Settings & Profile Precision Design System
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */

.drawer-panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 560px;
    background-color: #f8fafc;
    box-shadow: -12px 0 36px rgba(15, 23, 42, 0.16);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 10;
}

.dark .drawer-panel {
    background-color: #0b0f19;
    border-left: 1px solid #1e293b;
    box-shadow: -12px 0 36px rgba(2, 6, 23, 0.7);
}

#modal-pengaturan.open .drawer-panel {
    transform: translateX(0);
}

/* Settings Sub-Menu Tab Navigation */
.settings-tab-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px 0 20px;
    background-color: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.dark .settings-tab-bar {
    background-color: #0f172a;
    border-bottom-color: #1e293b;
}

.settings-tab-btn {
    position: relative;
    padding: 10px 18px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #64748b;
    border-bottom: 2.5px solid transparent;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
    background: transparent;
    border-top: none;
    border-left: none;
    border-right: none;
}

.settings-tab-btn:hover {
    color: #3b82f6;
}

.dark .settings-tab-btn {
    color: #94a3b8;
}

.dark .settings-tab-btn:hover {
    color: #60a5fa;
}

.settings-tab-btn.active {
    color: #2563eb !important;
    border-bottom-color: #2563eb !important;
    font-weight: 700 !important;
}

.dark .settings-tab-btn.active {
    color: #3b82f6 !important;
    border-bottom-color: #3b82f6 !important;
}

/* Profile Avatar Circle */
.profile-avatar-circle {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
    max-width: 44px !important;
    max-height: 44px !important;
    border-radius: 50% !important;
    background: linear-gradient(135deg, #00d2ff 0%, #3a7bd5 100%) !important;
    color: #ffffff !important;
    font-size: 1.15rem !important;
    font-weight: 700 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 4px 14px rgba(58, 123, 213, 0.25) !important;
    border: 2px solid #ffffff !important;
    flex-shrink: 0 !important;
}

.dark .profile-avatar-circle {
    border-color: #1e293b !important;
}

/* Premium Card Box Container */
.profile-card-box {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 20px 22px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.dark .profile-card-box {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 2px 10px rgba(2, 6, 23, 0.25);
}

.setting-card-title {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #3b82f6;
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f1f5f9;
}

.dark .setting-card-title {
    color: #60a5fa;
    border-bottom-color: #334155;
}

/* Form Label Hierarchy */
.setting-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 6px;
}

.dark .setting-label {
    color: #cbd5e1;
}

/* Form Input Fields */
.profile-input-field {
    width: 100%;
    height: 42px;
    padding: 0 14px;
    font-size: 0.875rem;
    border-radius: 10px;
    border: 1.5px solid #cbd5e1;
    background-color: #ffffff;
    color: #0f172a;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    box-sizing: border-box;
}

.profile-input-field:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3.5px rgba(59, 130, 246, 0.15);
}

.dark .profile-input-field {
    border-color: #475569;
    background-color: #0f172a;
    color: #f8fafc;
}

.dark .profile-input-field:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 0 3.5px rgba(96, 165, 250, 0.2);
}

/* Primary Button */
.btn-profile-primary {
    height: 42px;
    background: linear-gradient(90deg, #00d2ff 0%, #3a7bd5 100%);
    color: #ffffff;
    font-size: 0.8125rem;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    padding: 0 20px;
    cursor: pointer;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: opacity 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 4px 14px rgba(58, 123, 213, 0.3);
    flex-shrink: 0;
}

.btn-profile-primary:hover {
    opacity: 0.92;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(58, 123, 213, 0.4);
}

/* Backup & Restore Action Buttons System */
.btn-action-backup {
    height: 42px;
    background-color: #eef2ff;
    color: #4338ca;
    font-size: 0.8125rem;
    font-weight: 700;
    border: 1.5px solid #c7d2fe;
    border-radius: 12px;
    padding: 0 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: 0 2px 6px rgba(67, 56, 202, 0.08);
}
.btn-action-backup:hover {
    background-color: #e0e7ff;
    border-color: #a5b4fc;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(67, 56, 202, 0.16);
}
.dark .btn-action-backup {
    background-color: rgba(49, 46, 129, 0.5);
    color: #a5b4fc;
    border-color: rgba(99, 102, 241, 0.4);
}
.dark .btn-action-backup:hover {
    background-color: rgba(49, 46, 129, 0.8);
    border-color: #818cf8;
}

.btn-action-restore {
    height: 42px;
    background-color: #ecfdf5;
    color: #047857;
    font-size: 0.8125rem;
    font-weight: 700;
    border: 1.5px solid #a7f3d0;
    border-radius: 12px;
    padding: 0 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: 0 2px 6px rgba(4, 120, 87, 0.08);
}
.btn-action-restore:hover {
    background-color: #d1fae5;
    border-color: #6ee7b7;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(4, 120, 87, 0.16);
}
.dark .btn-action-restore {
    background-color: rgba(6, 78, 59, 0.5);
    color: #6ee7b7;
    border-color: rgba(16, 185, 129, 0.4);
}
.dark .btn-action-restore:hover {
    background-color: rgba(6, 78, 59, 0.8);
    border-color: #34d399;
}

.btn-action-export {
    height: 38px;
    background-color: #f8fafc;
    color: #334155;
    font-size: 0.8125rem;
    font-weight: 600;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 0 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
}
.btn-action-export:hover {
    background-color: #f1f5f9;
    border-color: #cbd5e1;
    color: #0f172a;
}
.dark .btn-action-export {
    background-color: #0f172a;
    color: #cbd5e1;
    border-color: #334155;
}
.dark .btn-action-export:hover {
    background-color: #1e293b;
    border-color: #475569;
    color: #ffffff;
}




/* Custom Bulletproof Dark Mode Toggle Switch */
.theme-switch-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    width: 50px !important;
    height: 26px !important;
    min-width: 50px !important;
    min-height: 26px !important;
    padding: 3px 5px !important;
    background-color: #cbd5e1 !important;
    border-radius: 9999px !important;
    cursor: pointer !important;
    border: 1px solid #94a3b8 !important;
    outline: none !important;
    transition: background-color 0.25s ease, border-color 0.25s ease !important;
    flex-shrink: 0 !important;
}

.dark .theme-switch-btn {
    background-color: #4f46e5 !important;
    border-color: #6366f1 !important;
}

.theme-switch-ball {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px !important;
    height: 20px !important;
    background-color: #ffffff !important;
    border-radius: 50% !important;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.3) !important;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.dark .theme-switch-ball {
    transform: translateX(24px) !important;
}

/* Guarantee SVG icons inside drawer never balloon or break layout */
.drawer-panel svg {
    display: inline-block;
    vertical-align: middle;
}

/* =========================================
   Modern Floating Toast Notification System
   ========================================= */
.status-toast {
    position: fixed !important;
    bottom: 24px !important;
    right: 24px !important;
    z-index: 99999 !important;
    width: auto !important;
    max-width: 400px !important;
    min-width: 280px !important;
    border-radius: 12px !important;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.25), 0 8px 10px -6px rgba(0, 0, 0, 0.15) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    opacity: 0 !important;
    transform: translateY(20px) scale(0.95) !important;
    pointer-events: none !important;
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), transform 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.status-toast.show {
    opacity: 1 !important;
    transform: translateY(0) scale(1) !important;
    pointer-events: auto !important;
}

.status-toast.hide {
    opacity: 0 !important;
    transform: translateY(12px) scale(0.95) !important;
    pointer-events: none !important;
}

/* Toast Color Variants */
.status-toast.toast-success {
    background-color: rgba(236, 253, 245, 0.95) !important;
    border: 1px solid rgba(52, 211, 153, 0.5) !important;
    color: #065f46 !important;
}

.dark .status-toast.toast-success {
    background-color: rgba(6, 78, 59, 0.95) !important;
    border: 1px solid rgba(16, 185, 129, 0.5) !important;
    color: #a7f3d0 !important;
}

.status-toast.toast-error {
    background-color: rgba(255, 241, 242, 0.95) !important;
    border: 1px solid rgba(251, 113, 133, 0.5) !important;
    color: #9f1239 !important;
}

.dark .status-toast.toast-error {
    background-color: rgba(136, 19, 55, 0.95) !important;
    border: 1px solid rgba(244, 63, 94, 0.5) !important;
    color: #fecdd3 !important;
}

.status-toast.toast-warning {
    background-color: rgba(254, 252, 232, 0.95) !important;
    border: 1px solid rgba(250, 204, 21, 0.5) !important;
    color: #854d0e !important;
}

.dark .status-toast.toast-warning {
    background-color: rgba(113, 63, 18, 0.95) !important;
    border: 1px solid rgba(234, 179, 8, 0.5) !important;
    color: #fef08a !important;
}

.status-toast.toast-info,
.status-toast.toast-loading {
    background-color: rgba(238, 242, 255, 0.95) !important;
    border: 1px solid rgba(129, 140, 248, 0.5) !important;
    color: #3730a3 !important;
}

.dark .status-toast.toast-info,
.dark .status-toast.toast-loading {
    background-color: rgba(30, 27, 75, 0.95) !important;
    border: 1px solid rgba(99, 102, 241, 0.5) !important;
    color: #c7d2fe !important;
}

@media (max-width: 640px) {
    .status-toast {
        left: 16px !important;
        right: 16px !important;
        bottom: 16px !important;
        max-width: none !important;
    }
}

.drawer-header-icon {
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    min-height: 18px !important;
    max-width: 18px !important;
    max-height: 18px !important;
    flex-shrink: 0 !important;
}

.drawer-section-title-icon {
    width: 14px !important;
    height: 14px !important;
    min-width: 14px !important;
    min-height: 14px !important;
    max-width: 14px !important;
    max-height: 14px !important;
    flex-shrink: 0 !important;
}

.btn-logout-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap !important;
    padding: 6px 12px;
    font-size: 0.78rem;
    font-weight: 600;
    border-radius: 8px;
    border: 1px solid #fecaca;
    background-color: #fef2f2;
    color: #dc2626;
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.btn-logout-danger:hover {
    background-color: #fee2e2;
    border-color: #fca5a5;
}

.dark .btn-logout-danger {
    background-color: rgba(127, 29, 29, 0.3);
    border-color: rgba(220, 38, 38, 0.45);
    color: #fca5a5;
}

/* Text truncation: potong konten catatan max 2 baris */
.note-card .note-content {
    display: -webkit-box !important;
    -webkit-box-orient: vertical !important;
    -webkit-line-clamp: 2 !important;
    overflow: hidden !important;
    line-height: 1.5 !important;
    max-height: 3em !important;
    font-size: 0.8rem;
    word-break: break-word;
}

/* Hapus margin prose pada child agar line-clamp dihitung dari teks, bukan margin */
.note-card .note-content p,
.note-card .note-content ul,
.note-card .note-content ol,
.note-card .note-content h1,
.note-card .note-content h2,
.note-card .note-content h3,
.note-card .note-content h4,
.note-card .note-content li,
.note-card .note-content blockquote {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

/* Tombol Rekam: saat aktif merekam, switch ke solid merah */
#tombol-rekam.recording-indicator {
    background-color: #dc2626 !important;
    color: #fff !important;
    border-color: transparent !important;
    animation: pulse 1.5s infinite;
}
.dark #tombol-rekam.recording-indicator {
    background-color: #b91c1c !important;
}

/* â•â•â• UI Refresh 2026 â•â•â• */
body {
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* Auth layout */
#auth-page-container {
    padding: 1.25rem;
}

#auth-page-container .glass-card {
    max-width: 27.5rem;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.08);
}

.dark #auth-page-container .glass-card {
    border-color: #334155;
    box-shadow: 0 20px 45px rgba(2, 6, 23, 0.45);
}

#login-form input,
#signup-form input {
    min-height: 42px;
    border-radius: 10px;
}

#tombol-submit-login,
#tombol-submit-daftar {
    min-height: 42px;
    border-radius: 10px;
    font-weight: 600;
    letter-spacing: 0.01em;
}

#auth-toggle-btn,
#auth-toggle-btn-2 {
    font-weight: 500;
}

/* Main layout */
#main-content-container > .container {
    padding-top: 4.5rem;
}

#main-content-container > header {
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

#main-content-container > header .container {
    height: 3.5rem;
}

#editor-card {
    border-radius: 16px;
    border: 1px solid #dbe3ef;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.dark #editor-card {
    border-color: #334155;
    box-shadow: 0 10px 24px rgba(2, 6, 23, 0.35);
}

#formatting-toolbar {
    gap: 0.35rem;
    padding-bottom: 0.75rem;
    margin-bottom: 0.85rem;
}

#hasil-teks {
    min-height: 230px;
    padding: 0.25rem 0.1rem;
    font-size: 0.98rem;
}

#template-selector,
#insert-template-btn,
#search-input,
#tag-input {
    border-radius: 10px;
}

/* Notes panel */
#notes-view {
    background: rgba(255, 255, 255, 0.86);
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 16px;
    padding: 0.9rem;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.dark #notes-view {
    background: rgba(30, 41, 59, 0.72);
    border-color: rgba(51, 65, 85, 0.95);
    box-shadow: 0 10px 24px rgba(2, 6, 23, 0.35);
}

#search-input {
    min-height: 40px;
    background: rgba(255, 255, 255, 0.95);
}

.dark #search-input {
    background: rgba(15, 23, 42, 0.68);
}

/* â•â•â• Filter & Sort Bar â•â•â• */
#filter-sort-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    flex-wrap: nowrap;
    gap: 0.5rem;
}

.filter-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: #64748b;
    white-space: nowrap;
    flex-shrink: 0;
}

.dark .filter-label {
    color: #94a3b8;
}

.quick-filter-btn {
    font-size: 0.78rem;
    font-weight: 500;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    border: 1px solid transparent;
    background-color: #f1f5f9;
    color: #475569;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
    white-space: nowrap;
    -webkit-user-select: none;
    user-select: none;
}

.quick-filter-btn:hover {
    background-color: #e2e8f0;
    border-color: rgba(99, 102, 241, 0.35);
}

.quick-filter-btn.active {
    background-color: #6366f1;
    color: #ffffff;
    border-color: transparent;
}

.dark .quick-filter-btn {
    background-color: #1e293b;
    color: #94a3b8;
}

.dark .quick-filter-btn:hover {
    background-color: #334155;
}

.dark .quick-filter-btn.active {
    background-color: #6366f1;
    color: #ffffff;
}

#limit-select {
    font-size: 0.78rem;
    font-weight: 500;
    padding: 0.22rem 2rem 0.22rem 0.65rem;
    border-radius: 999px;
    border: 1px solid #e2e8f0;
    background-color: #f1f5f9;
    color: #475569;
    cursor: pointer;
    outline: none;
    flex-shrink: 0;
    transition: background-color 0.15s ease, border-color 0.15s ease;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

#limit-select:hover {
    background-color: #e2e8f0;
    border-color: rgba(99, 102, 241, 0.4);
}

#limit-select:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.12);
}

.dark #limit-select {
    background-color: #1e293b;
    border-color: #334155;
    color: #94a3b8;
}

.dark #limit-select:hover {
    background-color: #334155;
}

#catatan-tersimpan-container {
    padding-right: 0.25rem;
    margin-top: 0.2rem;
}

.note-card {
    border-radius: 10px !important;
    border: 1px solid #e2e8f0;
    background: rgba(255, 255, 255, 0.9);
    transition: all 0.2s ease-in-out;
    cursor: pointer;
}

.note-card:hover {
    transform: translateY(-2px);
    border-color: #6366f1;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.dark .note-card {
    border-color: #334155;
    background: rgba(15, 23, 42, 0.62);
}

.dark .note-card:hover {
    border-color: #818cf8;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.35), 0 2px 4px -1px rgba(0, 0, 0, 0.25);
}

/* Mobile refinement */
@media (max-width: 767px) {
    #main-content-container > .container {
        padding-top: 4rem;
        padding-bottom: 5.2rem;
    }

    #notes-view {
        padding: 0.75rem;
        border-radius: 14px;
    }

    #hasil-teks {
        min-height: 180px;
        font-size: 0.95rem;
    }

    #filter-sort-bar {
        flex-wrap: wrap;
        align-items: center;
        gap: 0.45rem;
    }

    #filter-sort-bar > div:first-child {
        flex: 1 1 100%;
        min-width: 0;
        overflow-x: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
        padding-bottom: 1px;
    }

    #filter-sort-bar > div:first-child::-webkit-scrollbar {
        display: none;
    }

    #sort-select {
        margin-left: auto;
    }

    #status-div {
        left: 0.5rem;
        right: 0.5rem;
        bottom: calc(4.6rem + env(safe-area-inset-bottom, 0px));
        max-width: none;
    }

    #mobile-nav {
        height: 3.65rem;
        box-shadow: 0 -6px 20px rgba(15, 23, 42, 0.12);
    }

    #fab-rekam,
    #fab-pause {
        box-shadow: 0 12px 26px rgba(15, 23, 42, 0.28);
    }
}


/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   Modal Konfirmasi Kustom (Fase 4)
   Menggantikan browser native confirm()
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */

.confirm-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    animation: confirmFadeIn 0.18s ease-out forwards;
    padding: 1rem;
}

.confirm-modal-overlay.confirm-modal-exit {
    animation: confirmFadeOut 0.18s ease-in forwards;
}

.confirm-modal-box {
    background: #ffffff;
    border-radius: 1rem;
    box-shadow: 0 25px 60px rgba(15, 23, 42, 0.35), 0 0 0 1px rgba(15, 23, 42, 0.08);
    padding: 1.5rem;
    width: 100%;
    max-width: 22rem;
    animation: confirmSlideUp 0.22s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.dark .confirm-modal-box {
    background: #1e293b;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.confirm-modal-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.confirm-modal-icon {
    font-size: 1.5rem;
    line-height: 1;
    flex-shrink: 0;
}

.confirm-modal-title {
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
    line-height: 1.3;
}

.dark .confirm-modal-title {
    color: #f1f5f9;
}

.confirm-modal-message {
    font-size: 0.8125rem;
    color: #475569;
    line-height: 1.6;
    margin: 0 0 1.25rem 0;
}

.dark .confirm-modal-message {
    color: #94a3b8;
}

.confirm-modal-actions {
    display: flex;
    gap: 0.625rem;
    justify-content: flex-end;
}

.confirm-modal-actions button {
    padding: 0.5rem 1.1rem;
    border-radius: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.confirm-btn-cancel {
    background: #f1f5f9;
    color: #475569;
}

.confirm-btn-cancel:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.dark .confirm-btn-cancel {
    background: #334155;
    color: #94a3b8;
}

.dark .confirm-btn-cancel:hover {
    background: #475569;
    color: #f1f5f9;
}

.confirm-btn-danger {
    background: #ef4444;
    color: #ffffff;
}

.confirm-btn-danger:hover {
    background: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.35);
}

.confirm-btn-warning {
    background: #f59e0b;
    color: #ffffff;
}

.confirm-btn-warning:hover {
    background: #d97706;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.35);
}

.confirm-btn-info {
    background: #6366f1;
    color: #ffffff;
}

.confirm-btn-info:hover {
    background: #4f46e5;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

@keyframes confirmFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes confirmFadeOut {
    from { opacity: 1; }
    to   { opacity: 0; }
}

@keyframes confirmSlideUp {
    from { opacity: 0; transform: scale(0.9) translateY(12px); }
    to   { opacity: 1; transform: scale(1) translateY(0);      }
}


/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   Loading Skeleton (Fase 5)
   Ditampilkan saat pertama kali fetch catatan
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */

.skeleton-note {
    background: #f1f5f9;
    border-radius: 0.75rem;
    padding: 1rem;
    margin-bottom: 1rem;
    overflow: hidden;
    position: relative;
}

.dark .skeleton-note {
    background: #1e293b;
}

.skeleton-note::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255,255,255,0.35) 50%,
        transparent 100%
    );
    animation: skeletonShimmer 1.6s ease-in-out infinite;
}

.dark .skeleton-note::after {
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255,255,255,0.07) 50%,
        transparent 100%
    );
}

.skeleton-line {
    height: 0.75rem;
    border-radius: 9999px;
    background: #cbd5e1;
    margin-bottom: 0.5rem;
}

.dark .skeleton-line {
    background: #334155;
}

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

.skeleton-line-medium {
    width: 70%;
}

.skeleton-line-full {
    width: 100%;
}

@keyframes skeletonShimmer {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(100%);  }
}

/* ══ 2FA Popups High Priority Z-Index Fix ══ */
#modal-totp-verify,
#modal-2fa-setup {
    z-index: 10050 !important;
}

