/* Monkeytype Palette - Light Theme (Default) */
:root {
    --bg-color: #ffffff;
    --main-color: #e2b714;
    --sub-color: #646669;
    --text-color: #202124;
    --error-color: #ca4754;
    --error-hover-color: #ef5a68;
}

/* Dark Theme */
.dark {
    --bg-color: #323437;
    --main-color: #e2b714;
    --sub-color: #646669;
    --text-color: #d1d0c5;
    --error-color: #ca4754;
    --error-hover-color: #ef5a68;
}

/* Light Theme */
.light {
    --bg-color: #ffffff;
    --main-color: #e2b714;
    --sub-color: #646669;
    --text-color: #202124;
    --error-color: #ca4754;
    --error-hover-color: #ef5a68;
}

/* Solarized Light Theme */
.solarized-light {
    --bg-color: #fdf6e3;
    --main-color: #859900;
    --sub-color: #2aa198;
    --text-color: #181819;
    --error-color: #ca4754;
    --error-hover-color: #ef5a68;
}

/* Paper Theme */
.paper {
    --bg-color: #eeeeee;
    --main-color: #444444;
    --sub-color: #b2b2b2;
    --text-color: #444444;
    --error-color: #ca4754;
    --error-hover-color: #ef5a68;
}

/* Darling Theme */
.darling {
    --bg-color: #fec8cd;
    --main-color: #a30000;
    --sub-color: #ffffff;
    --text-color: #a30000;
    --error-color: #ca4754;
    --error-hover-color: #ef5a68;
}

/* Matrix Theme */
.matrix {
    --bg-color: #000000;
    --main-color: #15ff00;
    --sub-color: #006500;
    --text-color: #d1ffcd;
    --error-color: #ca4754;
    --error-hover-color: #ef5a68;
}

/* Phantom Theme */
.phantom {
    --bg-color: #001;
    --main-color: #7aa2f7;
    --sub-color: #414868;
    --text-color: #c0caf5;
    --error-color: #ca4754;
    --error-hover-color: #ef5a68;
}

/* Red Dragon Theme */
.red-dragon {
    --bg-color: #1a0b0c;
    --main-color: #ff3a32;
    --sub-color: #4a4d4e;
    --text-color: #e2a528;
    --error-color: #ca4754;
    --error-hover-color: #ef5a68;
}

/* Anti Hero Theme */
.anti-hero {
    --bg-color: #00002e;
    --main-color: #ff3d8b;
    --sub-color: #ffadad;
    --text-color: #f1deef;
    --error-color: #ca4754;
    --error-hover-color: #ef5a68;
}

/* Lilac Mist Theme */
.lilac-mist {
    --bg-color: #fffbfe;
    --main-color: #b94189;
    --sub-color: #e094c2;
    --text-color: #5c2954;
    --error-color: #ca4754;
    --error-hover-color: #ef5a68;
}

/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Body */
body {
    min-height: 100%;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Roboto Mono', monospace;
    line-height: 1.6;
    text-align: center;
    transition: background 0.4s, color 0.4s;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

body::-webkit-scrollbar {
    display: none;
}

html {
    height: 100%;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

html::-webkit-scrollbar {
    display: none;
}

/* Navbar */
.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 3%;
    min-height: 60px;
}

/* Logo */
.logo {
    font-size: 1.2rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    position: relative;
    padding-left: 2.25rem;
}

.logo a {
    text-decoration: none;
    display: flex;
    align-items: center;
}

.logo .icon {
    text-decoration: none;
    color: var(--main-color);
    font-size: 1.5em;
    display: flex;
    align-items: center;
}

.home-logo {
    color: var(--text-color);
}

/* Navigation Links */
.nav-links {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.nav-links a {
    text-decoration: none;
    color: var(--sub-color);
    margin-left: 1.5rem;
    font-size: 0.85rem;
    transition: color 0.2s ease;
}

.nav-links a:hover {
    color: var(--text-color);
}

.nav-links a.accent {
    color: var(--main-color);
}

.nav-links a.danger:hover {
    color: var(--error-color);
}

/* Container */
.container {
    padding: 0 2rem 1rem 2rem;
    text-align: center;
    min-height: calc(100vh - 60px);
}

@media (max-width: 600px) {
    .container {
        padding: 0 1rem 1rem 1rem;
    }
}

/* Heading */
h1 {
    font-size: 1.75rem;
    font-weight: 300;
    letter-spacing: -1px;
    margin-bottom: 0.25rem;
}

@media (max-width: 600px) {
    h1 {
        font-size: 1.4rem;
    }
}

/* Theme Button */
button {
    padding: 10px 40px;
    background-color: transparent;
    color: var(--text-color);
    border: 2px solid var(--main-color);
    border-radius: 5px;
    cursor: pointer;
    transition: 0.3s;
}

@media (max-width: 600px) {
    form button {
        width: 100%;
    }
}

button:hover {
    background-color: var(--main-color);
    color: #000;
}

.icon-btn {
    border: none;
    background: transparent;
    padding: 4px;
    color: var(--sub-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
    transition: color 0.3s ease, text-shadow 0.3s ease;
}

.icon-btn:hover {
    background: transparent;
}

.delete-btn:hover,
.cancel-btn:hover,
.reject-btn:hover {
    color: var(--error-color);
    border-color: var(--error-color);
}

.accept-btn:hover {
    color: #4caf50;
    border-color: #4caf50;
}

.edit-btn:hover,
.save-btn:hover,
.share-btn:hover {
    color: var(--main-color);
}

#addNoteBtn {
    font-family: 'Roboto Mono', monospace;
    border: none;
    background: transparent;
    transition: color 0.3s ease;
}

#addNoteBtn:hover {
    color: var(--main-color);
    background: transparent;
}

.cancel-text {
    border: none;
    background: transparent;
    color: var(--sub-color);
    font-family: 'Roboto Mono', monospace;
    padding: 10px 40px;
    transition: color 0.3s ease;
}

.cancel-text:hover {
    color: var(--error-color);
    background: transparent;
}

.note-input .cancel-text {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, color 0.3s ease;
}

.note-input.is-editing .cancel-text {
    opacity: 1;
    pointer-events: auto;
}

.icon-btn {
    padding: 6px 10px;
    border: 1px solid var(--sub-color);
    border-radius: 6px;
    background: transparent;
    color: var(--sub-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
}

.icon-btn svg {
    display: block;
}

.icon-btn:hover {
    background: transparent;
}

.icon-btn.delete-btn {
    border: none;
    padding: 4px;
}

.icon-btn.edit-btn {
    border: none;
    padding: 4px;
    color: var(--sub-color);
}

.edit-btn:hover {
    color: var(--main-color);
}

.save-btn:hover {
    color: var(--main-color);
}

.save-btn:focus,
.save-btn:focus-visible {
    outline: none;
}

.icon-btn.save-btn {
    border: none;
    padding: 4px;
    color: var(--sub-color);
}

.icon-btn.save-btn:hover {
    color: var(--main-color);
}

.icon-btn.cancel-btn {
    border: none;
    padding: 4px;
    color: var(--text-color);
}

.icon-btn.cancel-btn:hover {
    color: var(--error-color);
}

.icon-btn.share-btn {
    border: none;
    padding: 4px;
    color: var(--sub-color);
}

.share-btn:hover {
    color: var(--text-color);
}

.cancel-delete-btn {
    border: none;
    padding: 0;
    color: var(--sub-color);
    text-decoration: none;
}

.cancel-delete-btn:hover {
    color: var(--text-color);
    text-decoration: none;
}

#outgoingModal .reject-btn,
#rescindModal .reject-btn,
#clearNotesModal .reject-btn,
#clearNotesModal .cancel-btn {
    border: none;
    padding: 0;
    background: transparent;
    color: var(--sub-color);
}

#clearNotesModal .reject-btn {
    color: var(--error-color);
}

#outgoingModal .reject-btn:hover,
#outgoingModal .reject-btn:focus,
#rescindModal .reject-btn:hover,
#rescindModal .reject-btn:focus,
#clearNotesModal .reject-btn:hover,
#clearNotesModal .reject-btn:focus {
    color: var(--error-hover-color);
    border: none;
    outline: none;
    background: transparent;
}

#clearNotesModal .cancel-btn:hover,
#clearNotesModal .cancel-btn:focus {
    color: var(--main-color);
    border: none;
    outline: none;
    background: transparent;
}

#requestModal .cancel-delete-btn:hover {
    color: var(--text-color);
}

#inboxModal .cancel-delete-btn:hover,
#inboxModal .cancel-btn:hover {
    color: var(--error-color);
}

#requestModal .accept-btn,
#requestModal .reject-btn {
    border: none;
    padding: 0;
}

#requestModal .share-actions {
    margin-top: 0.5rem;
}

.danger-link {
    color: var(--error-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

.danger-link:hover {
    color: var(--error-hover-color);
    text-decoration: none;
}

/* Form Inputs */
form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 400px;
    margin: 2rem auto;
    text-align: left;
}

label {
    font-size: 0.9rem;
    color: var(--sub-color);
    margin-bottom: -0.5rem;
}

input,
textarea,
select {
    background: transparent;
    color: var(--text-color);
    border: 1px solid var(--sub-color);
    border-radius: 6px;
    padding: 0.6rem 0.8rem;
    font-family: 'Roboto Mono', monospace;
}

.settings-select-wrap {
    position: relative;
    min-width: 140px;
}

.settings-select-btn {
    width: 100%;
    text-align: left;
    border: 1px solid var(--sub-color);
    border-radius: 8px;
    padding: 2px 8px;
    background: #2f3136;
    color: var(--sub-color);
    font-family: 'Roboto Mono', monospace;
    cursor: pointer;
    transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.settings-select-btn:hover,
.settings-select-btn:focus {
    border-color: var(--sub-color);
    color: var(--text-color);
    background: rgba(255, 255, 255, 0.04);
    outline: none;
}

.settings-select-menu {
    position: absolute;
    left: 0;
    top: 100%;
    margin-top: 6px;
    min-width: 100%;
    z-index: 20;
}

.settings-select-menu.share-menu {
    display: none;
}

.settings-select-menu.share-menu.open {
    display: grid;
}

.settings-select-menu .matrix-option:hover {
    color: #15ff00;
    background: rgba(0, 0, 0, 0.6);
    text-shadow: none;
}

.settings-select-menu .phantom-option:hover {
    color: #7aa2f7;
    background: rgba(0, 0, 17, 0.6);
    text-shadow: 0 0 14px rgba(122, 162, 247, 0.9);
}

.settings-select-menu .red-dragon-option:hover {
    color: #ff3a32;
    background: rgba(26, 11, 12, 0.6);
    text-shadow: none;
}

.settings-select-menu .anti-hero-option:hover {
    color: #ff3d8b;
    background: rgba(0, 0, 46, 0.6);
    text-shadow: none;
}

.settings-select-menu .dark-option:hover {
    color: #d1d0c5;
    background: rgba(255, 255, 255, 0.04);
    text-shadow: none;
}

html.phantom .settings-select-menu .share-option {
    text-shadow: none;
}

.settings-select-menu .light-option:hover {
    color: #202124;
    background: rgba(226, 183, 20, 0.08);
    text-shadow: none;
}

.settings-select-menu .lilac-mist-option:hover {
    color: #5c2954;
    background: rgba(185, 65, 137, 0.08);
    text-shadow: none;
}

.settings-select-menu .solarized-light-option:hover {
    color: #181819;
    background: rgba(133, 153, 0, 0.08);
    text-shadow: none;
}

.settings-select-menu .paper-option:hover {
    color: #444444;
    background: rgba(68, 68, 68, 0.08);
    text-shadow: none;
}

.settings-select-menu .darling-option:hover {
    color: #a30000;
    background: #fec8cd;
    text-shadow: none;
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill,
textarea:-webkit-autofill:hover,
textarea:-webkit-autofill:focus,
select:-webkit-autofill,
select:-webkit-autofill:hover,
select:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--text-color);
    transition: background-color 9999s ease-out 0s;
    box-shadow: 0 0 0px 1000px transparent inset;
}

input::placeholder,
textarea::placeholder {
    color: var(--sub-color);
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--main-color);
}

/* Theme Toggle */
.theme-toggle {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    margin-left: 1.5rem;
    position: fixed;
    right: 1.5rem;
    bottom: 1.5rem;
    z-index: 70;
    gap: 1rem;
}

.theme-toggle-inner {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    line-height: 0;
}

.settings-badge {
    display: inline-flex;
    align-items: center;
    line-height: 0;
    color: var(--sub-color);
    text-decoration: none;
    cursor: pointer;
}

.settings-badge svg {
    width: 18px;
    height: 18px;
    display: block;
}

.notification-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.notification-indicator {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: var(--error-color);
    opacity: 0;
    transform: scale(0.7);
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
}

.notification-wrap.has-notifications .notification-indicator {
    opacity: 1;
    transform: scale(1);
}

.notification-badge {
    border: none;
    background: transparent;
    padding: 0;
}

.notification-badge:hover,
.notification-badge:focus,
.notification-badge:focus-visible {
    background: transparent;
    outline: none;
}

.notification-badge:hover svg path {
    stroke: var(--text-color);
}

.notification-badge svg {
    width: 20px;
    height: 20px;
    display: block;
}

.notification-badge svg path {
    stroke-width: 1.2;
}

.notification-menu {
    left: auto !important;
    right: 100% !important;
    top: auto !important;
    bottom: 100% !important;
    margin-top: 0 !important;
    margin-bottom: 6px;
    margin-right: 8px;
}

.notification-menu.share-menu {
    display: none;
}

.notification-menu.share-menu.open {
    display: grid;
}

.notification-menu.share-menu {
    top: auto !important;
    bottom: 100% !important;
    margin-top: 0 !important;
    margin-bottom: 6px;
}

.settings-badge:hover {
    color: var(--text-color);
}

.settings-page {
    text-align: left;
    max-width: 720px;
    margin: 0 auto;
}

.settings-panel {
    margin-top: 0.25rem;
    border: 1px solid var(--sub-color);
    border-radius: 10px;
    padding: 1rem;
    display: grid;
    gap: 0.75rem;
    background: rgba(0, 0, 0, 0.02);
}

.settings-group h2 {
    font-size: 1rem;
    font-weight: 400;
    margin-bottom: 0.4rem;
    letter-spacing: 0.08em;
    color: var(--main-color);
}

.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.4rem;
}

@media (max-width: 600px) {
    .settings-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    .settings-select-wrap {
        width: 100%;
    }
    .settings-select-btn {
        width: 100%;
    }
}

.settings-row:last-child {
    margin-bottom: 0;
}

.settings-note {
    margin-top: 1rem;
    color: var(--sub-color);
    font-size: 0.85rem;
}


.theme-icon {
    width: 20px;
    height: 20px;
    display: block;
    cursor: pointer;
    transform: translateY(-1px);
}

.theme-icon * {
    fill: none;
    stroke: var(--main-color);
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: stroke 0.2s ease;
}

#moon-icon * {
    stroke: var(--sub-color);
}

#moon-icon:hover * {
    stroke: var(--main-color);
}

#sun-icon:hover * {
    stroke: var(--text-color);
}

#moon-icon {
    display: none;
}

#sun-icon {
    display: block;
}

html.dark #moon-icon {
    display: block;
}

html.dark #sun-icon {
    display: none;
}

html.phantom #moon-icon {
    display: block;
}

html.phantom #sun-icon {
    display: none;
}

html.red-dragon #moon-icon {
    display: block;
}

html.red-dragon #sun-icon {
    display: none;
}

html.anti-hero #moon-icon {
    display: block;
}

html.anti-hero #sun-icon {
    display: none;
}

html.matrix #moon-icon {
    display: block;
}

html.matrix #sun-icon {
    display: none;
}

/* Flash Prevention */
html.dark body {
    background-color: #323437;
    color: #d1d0c5;
}

html.matrix body {
    background-color: #000000;
    color: #d1ffcd;
}

html.phantom body {
    background-color: #001;
    color: #c0caf5;
    text-shadow: 0 0 14px rgba(122, 162, 247, 0.7);
}

html.red-dragon body {
    background-color: #1a0b0c;
    color: #e2a528;
}

html.anti-hero body {
    background-color: #00002e;
    color: #f1deef;
}

html.phantom h1,
html.phantom .settings-group:not(.danger-zone) h2,
html.phantom h3,
html.phantom .note-item,
html.phantom .note-title-input,
html.phantom .note-content,
html.phantom .share-preview,
html.phantom .notes-panel,
html.phantom .notes-sidebar,
html.phantom .settings-select-menu .share-option,
html.phantom .settings-select-btn,
html.phantom .data-port-btn,
html.phantom #addNoteBtn,
html.phantom .cancel-text,
html.phantom .save-btn,
html.phantom .settings-panel input[type="text"],
html.phantom .settings-panel input[type="email"],
html.phantom .settings-panel input[type="password"],
html.phantom .share-panel,
html.phantom .delete-panel,
html.phantom #inboxModal .cancel-btn {
    text-shadow: 0 0 18px rgba(122, 162, 247, 1);
    color: #c0caf5;
    transition: text-shadow 0.3s ease, color 0.3s ease;
}

html.phantom .settings-row label,
html.phantom .settings-row span,
html.phantom .settings-note {
    color: #414868;
    text-shadow: 0 0 14px rgba(122, 162, 247, 0.4);
    transition: text-shadow 0.3s ease, color 0.3s ease;
}

html.darling .settings-row label,
html.darling .settings-row span,
html.darling .settings-note,
html.darling .settings-panel input[type="text"],
html.darling .settings-panel input[type="email"],
html.darling .settings-panel input[type="password"],
html.darling .data-port-btn,
html.darling .settings-select-btn {
    color: #FFFFFF !important;
}

html.paper .settings-row label,
html.paper .settings-row span,
html.paper .settings-note,
html.paper .settings-panel input[type="text"],
html.paper .settings-panel input[type="email"],
html.paper .settings-panel input[type="password"],
html.paper .data-port-btn,
html.paper .settings-select-btn {
    color: #B2B2B2 !important;
}

html.solarized-light .settings-row label,
html.solarized-light .settings-row span,
html.solarized-light .settings-note,
html.solarized-light .settings-panel input[type="text"],
html.solarized-light .settings-panel input[type="email"],
html.solarized-light .settings-panel input[type="password"],
html.solarized-light .data-port-btn,
html.solarized-light .settings-select-btn {
    color: #2AA198 !important;
}

html.phantom .danger-link,
html.phantom .danger-link-btn,
html.phantom .delete-panel .delete-btn {
    color: var(--error-color) !important;
    text-shadow: 0 0 18px rgba(122, 162, 247, 0.8);
    transition: text-shadow 0.3s ease, color 0.3s ease;
}

html.phantom .danger-link:hover,
html.phantom .danger-link-btn:hover,
html.phantom .delete-panel .delete-btn:hover {
    color: var(--error-hover-color) !important;
    text-shadow: 0 0 22px rgba(122, 162, 247, 1);
}

html.phantom .nav-links a:hover,
html.phantom .logo:hover {
    text-shadow: 0 0 16px rgba(122, 162, 247, 0.95);
}

html.phantom svg {
    filter: none;
}

html.phantom .icon-btn:hover,
html.phantom .settings-select-btn:hover {
    text-shadow: 0 0 14px rgba(122, 162, 247, 0.8);
    color: var(--text-color);
    transition: text-shadow 0.3s ease, color 0.3s ease;
}

html.phantom #shareEmailModal .cancel-btn:hover,
html.phantom #inboxModal .cancel-btn:hover,
html.phantom .note-input.is-editing .cancel-text:hover {
    color: var(--error-color) !important;
    text-shadow: 0 0 14px rgba(122, 162, 247, 0.8);
    transition: text-shadow 0.3s ease, color 0.3s ease;
}

html.phantom .note-input.is-editing #addNoteBtn:hover,
html.phantom #addNoteBtn:hover {
    color: var(--main-color) !important;
    text-shadow: 0 0 14px rgba(122, 162, 247, 0.8);
    transition: text-shadow 0.3s ease, color 0.3s ease;
}

html.phantom .delete-panel .cancel-btn:hover,
html.phantom .share-panel .cancel-btn:hover {
    color: var(--main-color) !important;
    text-shadow: 0 0 14px rgba(122, 162, 247, 0.8);
    transition: text-shadow 0.3s ease, color 0.3s ease;
}

html.phantom .icon-btn:hover svg,
html.phantom .settings-select-btn:hover svg {
    filter: drop-shadow(0 0 10px rgba(122, 162, 247, 0.8));
}

/* Responsive */
@media (max-width: 768px) {
    .top-nav {
        flex-direction: column;
        padding: 1rem 3%;
        gap: 1rem;
        align-items: center;
    }

    .logo {
        padding-left: 0;
    }

    .nav-links {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        align-items: center;
        justify-content: center;
    }

    .nav-links a {
        margin-left: 0;
        margin: 0.25rem 0;
    }

    .menu-btn {
        z-index: 110;
        position: fixed;
        left: 1rem;
        top: 1rem;
        transform: none;
    }
}

/* Notes modal */
.notes-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    z-index: 50;
}

.notes-modal.open {
    display: flex;
}

.notes-panel {
    width: min(900px, 92vw);
    max-height: 86vh;
    overflow: auto;
    background: var(--bg-color);
    color: var(--text-color);
    border: 2px solid var(--main-color);
    border-radius: 10px;
    padding: 1.75rem;
    text-align: left;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
}

.notes-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    gap: 1rem;
}

.notes-panel h2 {
    font-size: 1.6rem;
    font-weight: 400;
    margin: 0;
}

.close-btn {
    padding: 6px 18px;
}

.note-input {
    display: grid;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.notes-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
    align-items: start;
}

.notes-main {
    text-align: left;
    max-width: 100%;
    width: 100%;
    margin: 0;
    transition: transform 0.22s ease;
    transform: translateX(0);
    max-height: none;
    overflow-y: visible;
}

.notes-main.menu-open {
    transform: translateX(320px);
}

.notes-title-row {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    margin-top: -8px;
}

.note-title-input {
    background: transparent;
    border: none;
    color: var(--text-color);
    font-family: 'Roboto Mono', monospace;
    font-size: 2rem;
    font-weight: 300;
    text-align: center;
    width: 100%;
}

.note-title-input:focus {
    outline: none;
}

.note-input-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    width: 100%;
    flex-wrap: wrap;
    min-width: 0;
}

@media (max-width: 600px) {
    .note-input-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }
    .note-input-buttons {
        padding: 0;
        display: flex;
        justify-content: space-between;
    }
    .rich-toolbar {
        justify-content: center;
        padding: 5px;
    }
}

.note-input:not(.show-line-numbers) .line-numbers-wrap {
    grid-template-columns: 1fr;
    overflow-y: hidden; /* hand off scroll to editor */
}

.note-input:not(.show-line-numbers) .note-input-editor {
    grid-column: 1;
    overflow-y: auto;  /* editor now handles its own scroll */
    height: 100%;      /* fill the full wrap height */
}

.note-input:not(.show-line-numbers) .note-input-editor {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.note-input:not(.show-line-numbers) .note-input-editor::-webkit-scrollbar {
    display: none;
}

.note-input-buttons {
    background: transparent;
    padding: 8px 16px;
    flex-shrink: 0;
}

#messageInline {
    flex: 1;
    min-width: 0;
}

/* Rich Text Toolbar */
.rich-toolbar {
    /* flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 4px;*/
    overflow: visible;
    scrollbar-width: none;
    margin-top: 15px;
    padding: 10px;
    display: flex;
    gap: 8px;
    align-items: center;
}

.rich-toolbar .settings-select-wrap {
    min-width: 100px;
}

.toolbar-btn {
    background: transparent;
    border: none;
    padding: 4px;
    color: var(--sub-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
    border-radius: 4px;
}

.toolbar-btn:hover,
.toolbar-btn.active {
    color: var(--text-color);
    background: transparent;
}

.toolbar-btn.active {
    color: var(--main-color);
}

.toolbar-btn svg {
    display: block;
    stroke-width: 1.5;
}

#formatBtn {
    width: auto;
    min-width: 100px;
    padding: 2px 10px;
    font-size: 0.8rem;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

#formatBtn.active {
    color: var(--main-color);
    border-color: var(--main-color);
}

#formatBtn::after {
    content: '';
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid var(--sub-color);
    margin-left: 8px;
}

#formatMenu {
    min-width: 140px;
    right: 0;
    left: auto;
    top: auto;
    bottom: 100%;
    margin-top: 0;
    margin-bottom: 6px;
}

.rich-toolbar-divider {
    width: 1px;
    height: 16px;
    background: var(--sub-color);
    opacity: 0.2;
    margin: 0 4px;
}

/* Link Modal Styles */
.link-modal-panel {
    width: min(320px, 92vw);
}

.link-modal-panel input {
    width: 100%;
    margin-bottom: 0.5rem;
}

.note-input-editor {
    grid-column: 2;
    width: 100%;
    background: transparent;
    color: var(--text-color);
    border: none;
    padding: 0.8rem;
    font-family: 'Roboto Mono', monospace;
    min-height: 100%;
    box-sizing: border-box;
    line-height: 1.6;
    display: block;
    outline: none;
    margin: 0;
    white-space: pre;
    overflow-x: auto;
    overflow-y: hidden;
    word-wrap: normal;
    overflow-wrap: normal;
    text-align: left;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.note-input-editor::-webkit-scrollbar {
    display: none;
}

.note-input-editor:empty:before {
    content: attr(placeholder);
    color: var(--sub-color);
    cursor: text;
}

.inline-message.success {
    color: var(--main-color);
}

.inline-message.error {
    color: var(--error-color);
}

.notes-sidebar {
    position: fixed;
    left: 2rem;
    top: 72px;
    width: 280px;
    max-height: calc(100vh - 140px);
    overflow-y: auto;
    text-align: left;
    transition: transform 0.22s ease, opacity 0.22s ease;
    transform: translateX(-16px);
    opacity: 0;
    pointer-events: none;
    z-index: 100;
}

@media (max-width: 768px) {
    .notes-sidebar {
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        max-height: 100%;
        background: var(--bg-color);
        padding: 5rem 2rem 2rem 2rem;
        transform: translateX(-100%);
    }
    .notes-sidebar.is-open {
        transform: translateX(0);
        opacity: 1;
        pointer-events: auto;
    }
    .notes-main.menu-open {
        transform: none;
    }
    .menu-btn {
        z-index: 110;
        position: fixed;
        left: 1rem;
        top: 1rem;
    }
}

.notes-sidebar::-webkit-scrollbar {
    width: 0;
    height: 0;
}

.notes-sidebar {
    scrollbar-width: none;
}

.notes-list {
    max-height: calc(100vh - 300px);
    overflow-y: auto;
}

@media (max-width: 768px) {
    .notes-list {
        max-height: calc(100vh - 150px);
    }
}

.notes-list::-webkit-scrollbar {
    width: 0;
    height: 0;
}

.notes-list {
    scrollbar-width: none;
}

.notes-sidebar.is-open {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
}

.menu-btn {
    border: none;
    padding: 6px;
    border-radius: 6px;
    color: var(--sub-color);
    line-height: 1;
    display: inline-flex;
    align-items: baseline;
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-55%);
}

.menu-btn svg {
    width: 1.5em;
    height: 1.5em;
    display: inline-block;
    vertical-align: baseline;
    transform: translateY(5px);
}

.menu-btn:hover {
    color: var(--text-color);
}

.note-input textarea,
.note-edit {
    width: 100%;
    background: transparent;
    color: var(--text-color);
    border: 1px solid var(--sub-color);
    border-radius: 6px;
    padding: 0.8rem;
    font-family: 'Roboto Mono', monospace;
    resize: none;
    min-height: 60vh;
    max-height: calc(100vh - 260px);
    box-sizing: border-box;
    white-space: pre;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.note-input textarea::-webkit-scrollbar,
.note-edit::-webkit-scrollbar {
    display: none;
}

.note-edit {
    display: none;
}

.note-item.is-editing .note-edit {
    border-color: transparent;
    box-shadow: none;
}

.notes-list {
    display: grid;
    gap: 1rem;
}

.notes-inbox {
    border: 1px solid var(--sub-color);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    background: rgba(0, 0, 0, 0.02);
}

.inbox-header h2 {
    margin: 0 0 0.75rem 0;
    font-size: 1.2rem;
    font-weight: 400;
}

.share-requests {
    display: grid;
    gap: 0.75rem;
}

.share-request {
    border: 1px solid var(--sub-color);
    border-radius: 8px;
    padding: 0.75rem;
    display: grid;
    gap: 0.75rem;
}

.share-request:hover {
    border-color: var(--main-color);
}

.share-request-item {
    border: none;
    background: transparent;
    text-align: left;
    padding: 6px 8px;
    cursor: pointer;
    color: var(--sub-color);
    width: 100%;
    display: block;
}

.share-request-item:hover,
.share-request-item:focus {
    color: var(--sub-color);
    background: transparent;
}

.share-request-item:focus,
.share-request-item:focus-visible {
    outline: none;
}

.share-request-item * {
    cursor: pointer;
}

.inbox-open-btn {
    width: 100%;
    border: 1px solid var(--sub-color);
    border-radius: 8px;
    padding: 8px 10px;
    color: var(--sub-color);
    background: transparent;
    cursor: pointer;
}

.inbox-open-btn:hover,
.inbox-open-btn:focus {
    color: var(--text-color);
    border-color: var(--main-color);
    outline: none;
}

.share-content {
    color: var(--sub-color);
    margin-top: 0.25rem;
}

.share-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.shared-badge {
    display: inline-block;
    font-size: 0.8rem;
    color: var(--sub-color);
    margin-bottom: 0.5rem;
}

.note-item {
    border: 1px solid var(--sub-color);
    border-radius: 8px;
    padding: 1rem;
    display: grid;
    gap: 0.75rem;
}

.note-item {
    cursor: pointer;
}

.note-item.is-editing {
    border-color: var(--main-color);
}

.note-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    min-height: 28px;
    align-items: center;
}

.note-actions button {
    padding: 6px 18px;
}

.share-user-select {
    background: transparent;
    color: var(--text-color);
    border: none;
    border-radius: 6px;
    padding: 0;
    font-family: 'Roboto Mono', monospace;
    width: 100%;
    height: 100%;
    padding-right: 0;
    text-indent: 9999px;
    appearance: none;
    max-height: 44px;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.18s ease, transform 0.18s ease, max-height 0.18s ease, padding 0.18s ease, border-color 0.18s ease;
}

.share-user-select:not(.is-hidden) {
    background: #2f3136;
    color: var(--sub-color);
    border: 1px solid var(--sub-color);
    padding: 4px 8px;
    border-radius: 6px;
    text-indent: 0;
    width: auto;
    height: auto;
}

.share-user-select:not(.is-hidden) option {
    background: #2f3136;
    color: var(--sub-color);
}

.share-user-select.is-hidden {
    max-height: 0;
    opacity: 0;
    transform: translateY(-4px);
    padding-top: 0;
    padding-bottom: 0;
    border-color: transparent;
    pointer-events: none;
    overflow: hidden;
}

.share-select-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin-left: 4px;
}

.share-select-wrap.is-hidden {
    display: none;
}

.share-menu {
    position: absolute;
    left: 0;
    top: 100%;
    margin-top: 6px;
    display: grid;
    gap: 2px;
    background: #2f3136;
    border: 1px solid var(--sub-color);
    border-radius: 8px;
    padding: 4px;
    min-width: 140px;
    z-index: 20;
}

.share-option {
    border: none;
    background: transparent;
    color: var(--sub-color);
    text-align: left;
    padding: 4px 8px;
    font-family: 'Roboto Mono', monospace;
    font-size: 0.85rem;
    cursor: pointer;
}

.share-option.is-hovered,
.share-option:hover {
    color: var(--text-color);
    background: rgba(255, 255, 255, 0.04);
}

/* Theme dropdown hover colors should be option-specific, not current theme */
.settings-select-menu .share-option:hover,
.settings-select-menu .share-option.is-hovered {
    text-shadow: none;
}

.settings-select-menu .light-option:hover,
.settings-select-menu .light-option.is-hovered {
    color: #202124 !important;
    background: #ffffff !important;
}

.settings-select-menu .dark-option:hover,
.settings-select-menu .dark-option.is-hovered {
    color: #d1d0c5 !important;
    background: #323437 !important;
}

.settings-select-menu .matrix-option:hover,
.settings-select-menu .matrix-option.is-hovered {
    color: #15ff00 !important;
    background: #000000 !important;
}

.settings-select-menu .phantom-option:hover,
.settings-select-menu .phantom-option.is-hovered {
    color: #c0caf5 !important;
    background: #000011 !important;
    text-shadow: 0 0 14px rgba(122, 162, 247, 0.9);
}

.settings-select-menu .red-dragon-option:hover,
.settings-select-menu .red-dragon-option.is-hovered {
    color: #e2a528 !important;
    background: #1a0b0c !important;
}

.settings-select-menu .anti-hero-option:hover,
.settings-select-menu .anti-hero-option.is-hovered {
    color: #f1deef !important;
    background: #00002e !important;
}

.settings-select-menu .lilac-mist-option:hover,
.settings-select-menu .lilac-mist-option.is-hovered {
    color: #b94189 !important;
    background: #fffbfe !important;
}

.settings-select-menu .solarized-light-option:hover,
.settings-select-menu .solarized-light-option.is-hovered {
    color: #859900 !important;
    background: #fdf6e3 !important;
}

.settings-select-menu .paper-option:hover,
.settings-select-menu .paper-option.is-hovered {
    color: #444444 !important;
    background: #eeeeee !important;
}

.settings-select-menu .darling-option:hover,
.settings-select-menu .darling-option.is-hovered {
    color: #a30000 !important;
    background: #fec8cd !important;
}

.share-select-wrap {
    position: relative;
    width: 0;
    height: 0;
    margin-left: 0;
}

.share-select-wrap.is-hidden {
    display: none;
}

.share-menu {
    position: absolute;
    left: 0;
    top: 100%;
    margin-top: 6px;
    display: grid;
    gap: 2px;
    background: #2f3136;
    border: 1px solid var(--sub-color);
    border-radius: 8px;
    padding: 4px;
    min-width: 140px;
    z-index: 20;
}

.share-option {
    border: none;
    background: transparent;
    color: var(--sub-color);
    text-align: left;
    padding: 4px 8px;
    font-family: 'Roboto Mono', monospace;
    font-size: 0.85rem;
    cursor: pointer;
}

.share-option.is-hovered,
.share-option:hover {
    color: var(--text-color);
    background: rgba(255, 255, 255, 0.04);
}



.note-actions.is-editing .icon-btn,
.note-actions.is-editing .share-select-wrap {
    display: none;
}

.response-container {
    margin-top: 1rem;
    font-size: 0.9rem;
}

.response-container.success {
    color: var(--main-color);
}

.response-container.error {
    color: var(--error-color);
}

.notes-launch {
    margin-top: 1.25rem;
}

.delete-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    z-index: 60;
}

.delete-modal.open {
    display: flex;
}

.delete-panel {
    width: min(420px, 92vw);
    background: var(--bg-color);
    color: var(--text-color);
    border: 2px solid var(--error-color);
    border-radius: 10px;
    padding: 1.5rem;
    text-align: left;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
    display: grid;
    gap: 0.75rem;
}

.delete-panel h2 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 400;
}

.delete-panel p {
    color: var(--sub-color);
}

.delete-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

.delete-panel .icon-btn,
.share-panel .icon-btn {
    font-family: 'Roboto Mono', monospace;
    line-height: 1.6;
}

.share-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    z-index: 60;
}

.share-modal.open {
    display: flex;
}

.share-panel {
    width: min(420px, 92vw);
    background: var(--bg-color);
    color: var(--text-color);
    border: 2px solid var(--main-color);
    border-radius: 10px;
    padding: 1.5rem;
    text-align: left;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
    display: grid;
    gap: 0.75rem;
}

.share-panel h2 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 400;
}

.inbox-panel {
    width: min(520px, 92vw);
}

.inbox-panel h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    font-weight: 400;
    color: var(--main-color);
}

.inbox-section {
    display: grid;
    gap: 0.5rem;
}

.share-panel p {
    color: var(--sub-color);
}

#deleteAccountUser {
    width: 100%;
    margin-bottom: 0.5rem;
}

#deleteAccountPass {
    width: 100%;
}

.share-preview {
    border: 1px solid var(--sub-color);
    border-radius: 8px;
    padding: 0.75rem;
    color: var(--text-color);
    background: rgba(0, 0, 0, 0.02);
    font-size: 0.9rem;
    max-height: 160px;
    overflow: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    white-space: pre-wrap;
    line-height: 1.6;
}

.share-preview::-webkit-scrollbar {
    width: 0;
    height: 0;
}

.share-preview.is-collapsed {
    max-height: 4.8em;
    overflow: hidden;
}

.link-btn {
    border: none;
    background: transparent;
    color: var(--sub-color);
    padding: 0;
    cursor: pointer;
    font-size: 0.85rem;
    display: inline;
    font-family: 'Roboto Mono', monospace;
    line-height: 1;
    width: auto;
    justify-self: start;
    align-self: start;
}

.link-btn:hover,
.link-btn:focus {
    background: transparent;
    color: var(--main-color);
}

.link-btn:focus,
.link-btn:focus-visible {
    outline: none;
    color: var(--sub-color);
}

.share-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1rem;
}

.share-confirm-btn {
    border: none;
    color: var(--main-color);
}

.share-confirm-btn:hover {
    color: var(--text-color);
}

/* Notes Page Styles */
.notes-list.grid-view {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
.note-edit.font-small, #noteContent.font-small, .line-numbers-wrap.font-small { font-size: 0.85rem; }
.note-edit.font-medium, #noteContent.font-medium, .line-numbers-wrap.font-medium { font-size: 1rem; }
.note-edit.font-large, #noteContent.font-large, .line-numbers-wrap.font-large { font-size: 1.25rem; }

.line-numbers-wrap {
    display: grid;
    grid-template-columns: auto 1fr;
    width: 100%;
    border: 1px solid var(--sub-color);
    border-radius: 6px;
    background: transparent;
    overflow-y: auto; /* Internal scrolling for the unified editor */
    overflow-x: hidden;
    position: relative;
    box-sizing: border-box;
    height: calc(100vh - 280px);
    min-height: 300px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

@media (max-width: 768px) {
    .line-numbers-wrap {
        height: auto;
        max-height: 60vh;
        min-height: 200px;
    }
}

.line-numbers-wrap::-webkit-scrollbar {
    display: none; /* Chrome, Safari and Opera */
}

.line-numbers {
    grid-column: 1;
    padding-top: 0.8rem;
    padding-bottom: 0.8rem;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    text-align: right;
    color: var(--sub-color);
    font-size: inherit;
    user-select: none;
    border-right: 1px solid var(--sub-color);
    background: rgba(0,0,0,0.02);
    min-width: 3.5rem;
    display: none;
    font-family: 'Roboto Mono', monospace;
    line-height: 1.6;
    margin: 0;
    overflow: hidden;
    box-sizing: border-box;
}

.line-numbers div {
    line-height: 1.6;
    height: 1.6;
    margin: 0;
    padding: 0;
}

.show-line-numbers .line-numbers {
    display: block;
}

.note-input textarea {
    grid-column: 2;
    width: 100%;
    background: transparent;
    color: var(--text-color);
    border: none;
    padding: 0.8rem;
    font-family: 'Roboto Mono', monospace;
    resize: none;
    height: auto;
    min-height: 100%;
    box-sizing: border-box;
    line-height: 1.6;
    display: block;
    outline: none;
    margin: 0;
    white-space: pre !important;
    overflow-x: auto !important;
    overflow-y: hidden;
    word-wrap: normal !important;
    overflow-wrap: normal !important;
}

.grid-item {
    padding: 1.5rem;
    min-height: 160px;
}

/* Settings Page Styles */
.settings-group.danger-zone h2 {
    color: var(--error-color);
}

.data-port-btn {
    border: none !important;
    padding: 0 !important;
    background: transparent !important;
    color: var(--text-color) !important;
    font-family: 'Roboto Mono', monospace !important;
    font-size: 1rem !important;
    cursor: pointer;
    transition: color 0.2s ease;
}

.settings-select-wrap.text-wrap {
    min-width: 0;
}

.data-port-btn:hover {
    color: var(--main-color) !important;
}

.danger-link-btn {
    border: none !important;
    background: transparent !important;
    color: var(--error-color) !important;
    font-family: 'Roboto Mono', monospace !important;
    font-size: 1rem !important;
    padding: 0 !important;
    cursor: pointer;
    transition: color 0.2s ease;
}

.danger-link-btn:hover {
    color: var(--error-hover-color) !important;
}

.hidden-file-input {
    display: none;
}
