*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
button {
    cursor: pointer;
    font-family: inherit;
}
textarea {
    font-family: inherit;
}

:root {
    --canvas: #0a0a0a;
    --canvas-soft: #0f0f0f;
    --canvas-card: #191919;
    --canvas-mid: #2a2d32;
    --hairline: #212327;
    --ink: #ffffff;
    --body: #dadbdf;
    --mute: #a3a3a3;
    --accent: #fbec5d;
    --btn-hover: #2a2d32;
    --r-sm: 8px;
    --r-pill: 9999px;
    --f: Inter, system-ui, -apple-system, sans-serif;
    --fm: ui-monospace, "SF Mono", Menlo, monospace;
    --fs-xs: 11px;
    --fs-sm: 12px;
    --fs-base: 13px;
    --fs-md: 14px;
    --fs-lg: 16px;
    --fs-xl: 18px;
    --fs-2xl: 22px;
    --fs-3xl: 30px;
}

[data-theme="yellow"] {
    --accent: #fbec5d;
}

[data-theme="rose"] {
    --accent: #feb3d9;
}

[data-theme="mint"] {
    --accent: #98f5e1;
}

[data-theme="lavender"] {
    --accent: #d8b4f8;
}

html,
body {
    height: 100%;
    font-family: var(--f);
    font-size: var(--fs-lg);
    background: var(--canvas);
    color: var(--ink);
    line-height: 24px;
    -webkit-font-smoothing: antialiased;
}

.hidden {
    display: none !important;
}

#help-modal.hidden,
#settings-modal.hidden,
#confirm-modal.hidden,
#privacy-modal.hidden,
#terms-modal.hidden,
#about-modal.hidden {
    display: flex !important;
}

#btn-preview.hidden,
#md-tools.hidden {
    display: none !important;
}

#app {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* ── Sidebar ── */
#sidebar {
    width: 272px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background: var(--canvas-soft);
    border-right: 1px solid var(--hairline);
    overflow: hidden;
    transition: all 0.3s ease;
}

.s-top {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px 12px 12px;
    border-bottom: 1px solid var(--hairline);
}

.s-actions {
    display: flex;
    gap: 6px;
}

#btn-new {
    flex: 1;
    background: var(--accent);
    color: var(--canvas);
    border: none;
    border-radius: var(--r-pill);
    padding: 7px 14px;
    font-size: var(--fs-base);
    line-height: 20px;
    transition: opacity 0.15s;
    font-weight: 500;
}
#btn-new:hover {
    opacity: 0.78;
}

#btn-settings {
    background: #161616;
    color: var(--mute);
    border: 1px solid #2a2a2a;
    border-radius: var(--r-pill);
    padding: 6px 10px;
    cursor: pointer;
    transition:
        color 0.15s,
        border-color 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}
#btn-settings svg {
    width: 16px;
    height: 16px;
}
#btn-settings:hover {
    color: var(--ink);
    border-color: #3d3d3d;
}

#search {
    background: #161616;
    color: var(--ink);
    border: 1px solid #2a2a2a;
    border-radius: var(--r-sm);
    padding: 9px 12px;
    font-size: var(--fs-md);
    outline: none;
    width: 100%;
    transition: border-color 0.15s;
}
#search::placeholder {
    color: var(--mute);
}
#search:focus {
    border-color: #3d3d3d;
}

.s-sort {
    flex-shrink: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--hairline);
}

.s-sort #search {
    flex: 1;
    min-width: 100%;
    order: -1;
}

.sort-lbl {
    order: 0;
}

.sort-lbl {
    font-family: var(--fm);
    font-size: var(--fs-xs);
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--mute);
    margin-right: 2px;
    flex-shrink: 0;
}

.sort-btn {
    background: transparent;
    border: 1px solid #2a2a2a;
    border-radius: var(--r-pill);
    padding: 2px 9px;
    font-size: var(--fs-sm);
    color: var(--mute);
    cursor: pointer;
    transition: all 0.2s ease;
}
.sort-btn:hover {
    color: var(--body);
    border-color: #3d3d3d;
}
.sort-btn.on {
    border-color: #2a2a2a;
    color: var(--ink);
}

#note-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

.n-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 10px;
    border-radius: var(--r-sm);
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    margin-bottom: 5px;
    min-height: 62px;
    background: transparent;
}
.n-item:hover {
    background: #161616;
}
.n-item.on {
    background: #161616;
    border: 1px solid #2a2a2a;
}

.n-head {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 18px;
}
.n-title {
    font-size: var(--fs-base);
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    line-height: 18px;
    min-width: 0;
}
.n-pin {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: var(--fs-xs);
    color: var(--accent);
    margin: 0;
    padding: 0;
}
.n-preview {
    font-size: var(--fs-sm);
    color: var(--mute);
    line-height: 17px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    text-overflow: ellipsis;
}
.n-time {
    font-family: var(--fm);
    font-size: var(--fs-xs);
    color: var(--mute);
}

.s-tags {
    flex-shrink: 0;
    border-top: 1px solid var(--hairline);
    padding: 10px 12px 12px;
    display: none;
}
.s-tags.on {
    display: block;
}
.tags-lbl {
    font-family: var(--fm);
    font-size: var(--fs-xs);
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--mute);
    margin-bottom: 8px;
}
#tag-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    max-height: 200px;
    overflow-y: auto;
    overflow-x: hidden;
}
#tag-chips::-webkit-scrollbar {
    width: 6px;
}
#tag-chips::-webkit-scrollbar-track {
    background: transparent;
}
#tag-chips::-webkit-scrollbar-thumb {
    background: var(--canvas-mid);
    border-radius: 3px;
}
#tag-chips::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}
.t-chip {
    background: transparent;
    border: 1px solid #2a2a2a;
    border-radius: var(--r-pill);
    padding: 2px 9px;
    font-size: var(--fs-xs);
    color: var(--mute);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}
.t-chip:hover,
.t-chip.on {
    border-color: var(--accent);
    color: var(--accent);
}

/* ── Main ── */
#main {
    flex: 1;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 100%;
}

#toolbar {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--hairline);
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    min-width: 0;
}
.spacer {
    flex: 1;
}
.tb-right {
    display: flex;
    align-items: center;
    gap: 6px;
}

.md-tools {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 8px;
}

.md-btn {
    background: transparent;
    border: 1px solid #2a2a2a;
    border-radius: 4px;
    padding: 6px 12px;
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--mute);
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.md-btn:hover {
    color: var(--ink);
    border-color: #3d3d3d;
}
.md-btn:active {
    background: var(--canvas-mid);
}

#btn-menu {
    display: none;
    background: transparent;
    border: 1px solid #2a2a2a;
    border-radius: var(--r-pill);
    padding: 5px 12px;
    font-size: var(--fs-sm);
    color: var(--mute);
    transition: color 0.15s;
}
#btn-menu:hover {
    color: var(--ink);
}

.tb-btn {
    background: transparent;
    border: 1px solid #2a2a2a;
    border-radius: var(--r-pill);
    padding: 5px 14px;
    font-size: var(--fs-sm);
    color: var(--mute);
    cursor: pointer;
    transition: all 0.2s ease;
}
.tb-btn:hover {
    color: var(--ink);
    border-color: #3d3d3d;
}
.tb-btn.on {
    color: var(--ink);
    border-color: #3d3d3d;
}
.tb-btn.dis {
    opacity: 0.3;
    pointer-events: none;
}
.tb-btn.del:hover {
    color: #f55;
    border-color: #f55;
}

/* ── Content ── */
#content {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: row;
    position: relative;
    height: 100%;
    min-height: 0;
    width: 100%;
}

#empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--mute);
}
.e-title {
    font-size: var(--fs-xl);
}
.e-hint {
    font-family: var(--fm);
    font-size: var(--fs-xs);
    letter-spacing: 0.5px;
}

#editor {
    display: none;
    flex: 1;
    min-width: 0;
    min-height: 0;
    background: transparent;
    color: var(--ink);
    border: none;
    outline: none;
    font-size: var(--fs-lg);
    line-height: 28px;
    padding: 36px 52px;
    resize: none;
    box-sizing: border-box;
    overflow-y: scroll;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: none;
}
#editor.vis {
    display: block;
}
#editor::placeholder {
    color: var(--mute);
}

#preview {
    flex: 1;
    min-width: 0;
    min-height: 0;
    height: 100%;
    overflow: auto;
    padding: 36px 52px;
    font-size: var(--fs-lg);
    line-height: 28px;
    color: var(--body);
    box-sizing: border-box;
    position: relative;
}
#preview.hidden {
    display: none;
}
#preview.vis {
    display: block;
}

/* Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--canvas-mid);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

* {
    scrollbar-color: var(--canvas-mid) transparent;
    scrollbar-width: thin;
}

#divider {
    width: 1px;
    background: var(--hairline);
    flex-shrink: 0;
    transition: background 0.2s ease;
}
#divider:hover {
    background: var(--canvas-mid);
}

#preview h1 {
    font-size: var(--fs-3xl);
    font-weight: 400;
    line-height: 36px;
    letter-spacing: -0.5px;
    color: var(--ink);
    margin: 0 0 16px;
}
#preview h2 {
    font-size: var(--fs-2xl);
    font-weight: 400;
    color: var(--ink);
    margin: 24px 0 10px;
}
#preview h3 {
    font-size: var(--fs-xl);
    font-weight: 400;
    color: var(--ink);
    margin: 20px 0 8px;
}
#preview p {
    margin: 0 0 14px;
}
#preview strong {
    font-weight: 600;
    color: var(--ink);
}
#preview em {
    font-style: italic;
}
#preview blockquote {
    border-left: 3px solid var(--accent);
    margin: 0 0 14px;
    padding: 2px 0 2px 16px;
    color: var(--mute);
}
#preview pre {
    background: var(--canvas-soft);
    border: 1px solid #2a2a2a;
    border-radius: var(--r-sm);
    padding: 14px 16px;
    margin: 0 0 14px;
    overflow-x: auto;
}
#preview code {
    font-family: var(--fm);
    font-size: var(--fs-base);
    background: var(--canvas-soft);
    padding: 1px 5px;
    border-radius: 4px;
}
#preview pre code {
    background: none;
    padding: 0;
}
#preview ul,
#preview ol {
    padding-left: 22px;
    margin: 0 0 14px;
}
#preview li {
    margin-bottom: 5px;
}
#preview .cb-list {
    list-style: none;
    padding-left: 0;
    margin: 0 0 14px;
}
#preview .cb-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}
#preview .cb-item input[type="checkbox"] {
    accent-color: var(--accent);
    flex-shrink: 0;
    cursor: pointer;
    margin: 0;
}
#preview .cb-item.done span {
    text-decoration: line-through;
    color: var(--mute);
}
#preview .gap {
    display: block;
    height: 8px;
}
#preview a {
    color: var(--accent);
    text-decoration: none;
}
#preview a:hover {
    text-decoration: underline;
}
#preview .tag {
    color: var(--accent);
    cursor: pointer;
}
#preview .tag.on {
    color: var(--accent);
    border-bottom: 2px solid var(--accent);
}
#preview del {
    color: var(--mute);
}
#preview hr {
    border: none;
    border-top: 1px solid var(--hairline);
    margin: 20px 0;
}
#preview table {
    border-collapse: collapse;
    width: 100%;
    margin: 0 0 14px;
}
#preview table td {
    border: 1px solid #2a2a2a;
    padding: 8px;
}
#preview table tr:nth-child(odd) {
    background: var(--canvas-soft);
}

/* ── Footer ── */
#footer {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 20px;
    border-top: 1px solid var(--hairline);
    font-family: var(--fm);
    font-size: var(--fs-xs);
    color: var(--mute);
    letter-spacing: 0.3px;
}
.f-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ── Focus Mode ── */
#sidebar.focus-hidden {
    display: none;
}
#toolbar.focus-hidden {
    display: none;
}
#footer.focus-hidden {
    display: none;
}
#editor.focus-mode {
    padding: 36px 52px !important;
    max-width: none;
}
#preview.focus-mode {
    padding: 36px 52px !important;
    max-width: none;
}

/* ── Mobile ── */
#overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 99;
    transition: opacity 0.22s ease;
    opacity: 0;
    pointer-events: none;
}
#overlay.vis {
    display: block;
    opacity: 1;
    pointer-events: auto;
}

@media (max-width: 768px) {
    #sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        z-index: 100;
        transform: translateX(-100%);
        transition: transform 0.22s ease;
        width: 288px;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.5);
    }
    #sidebar.open {
        transform: translateX(0);
    }
    #btn-menu {
        display: block;
    }
    #content {
        flex-direction: column;
    }
    #editor {
        padding: 24px 20px;
    }
    #preview {
        padding: 24px 20px;
        border-left: none;
        border-top: 1px solid var(--hairline);
    }
    #toolbar {
        padding: 10px 14px;
    }
    #footer {
        padding: 7px 14px;
    }
}

/* ── Settings Modal ── */
#settings-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    transition:
        opacity 0.2s ease,
        visibility 0.2s ease;
    opacity: 1;
    visibility: visible;
}
#settings-modal.hidden {
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
}
#settings-modal.hidden {
    display: none;
}

.settings-content {
    background: #161616;
    border: 1px solid #2a2a2a;
    border-radius: var(--r-sm);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    max-width: 340px;
    width: 90%;
    gap: 0;
    padding: 0;
}

.settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid var(--hairline);
    flex-shrink: 0;
}
.settings-header h2 {
    font-size: var(--fs-lg);
    font-weight: 500;
    margin: 0;
    color: var(--ink);
}
.settings-close {
    background: transparent;
    border: none;
    color: var(--mute);
    font-size: var(--fs-2xl);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.1s;
}
.settings-close:hover {
    color: var(--ink);
}

.settings-body {
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.settings-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.settings-item label {
    font-size: var(--fs-md);
    color: var(--body);
    cursor: pointer;
}

.toggle {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 24px;
}
.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}
.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--canvas-mid);
    transition: 0.2s;
    border-radius: 24px;
    border: 1px solid #2a2a2a;
}
.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 2px;
    background-color: var(--ink);
    transition: 0.2s;
    border-radius: 50%;
}
input:checked + .toggle-slider {
    background-color: var(--accent);
    border-color: var(--accent);
}
input:checked + .toggle-slider:before {
    transform: translateX(16px);
}

.settings-hint {
    font-size: var(--fs-sm);
    color: var(--mute);
    padding-left: 0;
}

/* ── Confirm Modal ── */
#confirm-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    transition: opacity 0.3s ease;
    opacity: 1;
}
#confirm-modal.hidden {
    opacity: 0;
    pointer-events: none;
}
#confirm-modal.hidden {
    display: none;
}

.confirm-content {
    background: #161616;
    border: 1px solid #2a2a2a;
    border-radius: var(--r-sm);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    max-width: 340px;
    width: 90%;
    gap: 20px;
    padding: 24px;
}

.confirm-title {
    font-size: var(--fs-lg);
    font-weight: 500;
    color: var(--ink);
}

.confirm-message {
    font-size: var(--fs-md);
    color: var(--body);
    line-height: 20px;
}

.confirm-buttons {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.confirm-btn {
    padding: 8px 16px;
    border-radius: var(--r-pill);
    border: none;
    font-size: var(--fs-md);
    cursor: pointer;
    transition: all 0.1s;
}

.confirm-btn.cancel {
    background: transparent;
    border: 1px solid #2a2a2a;
    color: var(--mute);
}
.confirm-btn.cancel:hover {
    color: var(--ink);
    border-color: var(--mute);
}

.confirm-btn.ok {
    background: var(--accent);
    color: var(--canvas);
    font-weight: 500;
}
.confirm-btn.ok:hover {
    opacity: 0.8;
}

/* ── Help Modal ── */
#help-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    transition: opacity 0.3s ease;
    opacity: 1;
}
#help-modal.hidden {
    opacity: 0;
    pointer-events: none;
}
#help-modal.hidden {
    display: none;
}

.help-content {
    background: #161616;
    border: 1px solid #2a2a2a;
    border-radius: var(--r-sm);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    max-width: 380px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
}

.help-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid var(--hairline);
    flex-shrink: 0;
}
.help-header h2 {
    font-size: var(--fs-lg);
    font-weight: 500;
    margin: 0;
    color: var(--ink);
}
.help-close {
    background: transparent;
    border: none;
    color: var(--mute);
    font-size: var(--fs-2xl);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.1s;
}
.help-close:hover {
    color: var(--ink);
}

.help-body {
    padding: 16px 20px;
    overflow-y: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.help-item {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1 1 calc(50% - 6px);
    min-width: 150px;
}
.help-item kbd {
    background: #1f1f1f;
    border: 1px solid #2a2a2a;
    border-radius: 4px;
    padding: 4px 8px;
    font-family: var(--fm);
    font-size: var(--fs-sm);
    color: var(--ink);
    white-space: nowrap;
    flex-shrink: 0;
}
.help-item span {
    font-size: var(--fs-md);
    color: var(--body);
}

#btn-help {
    background: transparent;
    border: 1px solid #2a2a2a;
    border-radius: var(--r-pill);
    padding: 2px 8px;
    font-family: var(--fm);
    font-size: var(--fs-sm);
    color: var(--mute);
    cursor: pointer;
    transition: all 0.1s;
}
#btn-help:hover {
    color: var(--ink);
    border-color: var(--mute);
}

.legal-links {
    display: flex;
    gap: 8px;
}
.legal-links button {
    background: none;
    border: none;
    color: var(--mute);
    cursor: pointer;
    padding: 0;
    transition: color 0.2s;
    font-size: var(--fs-xs);
}
.legal-links button:hover {
    color: var(--body);
}

#about-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    transition: opacity 0.3s ease;
    opacity: 1;
}
#about-modal.hidden {
    opacity: 0;
    pointer-events: none;
    display: none;
}

.help-content,
.settings-content,
.confirm-content {
    transition:
        transform 0.2s ease,
        opacity 0.2s ease;
    transform: scale(1);
}

#help-modal.hidden .help-content,
#settings-modal.hidden .settings-content,
#confirm-modal.hidden .confirm-content,
#privacy-modal.hidden .help-content,
#terms-modal.hidden .help-content,
#about-modal.hidden .help-content {
    transform: scale(0.95);
}

.settings-themes {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 12px !important;
}

.theme-list {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    width: 100%;
}

.theme-option {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    padding: 12px !important;
    border: 2px solid transparent !important;
    border-radius: var(--r-sm) !important;
    background: transparent !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    font-size: var(--fs-base) !important;
    color: var(--ink) !important;
    flex: 1 1 calc(50% - 4px) !important;
}

.theme-option:hover {
    background: var(--canvas-mid) !important;
}

.theme-option.active {
    background: var(--canvas-mid) !important;
    border-color: var(--accent) !important;
    color: var(--ink) !important;
}

.theme-option.theme-yellow,
.theme-option.theme-rose,
.theme-option.theme-mint,
.theme-option.theme-lavender {
    background: #1f1f1f !important;
}

.theme-dot {
    width: 20px !important;
    height: 20px !important;
    border-radius: 50% !important;
    flex-shrink: 0 !important;
}

.theme-yellow {
    background: #fbec5d !important;
}

.theme-rose {
    background: #feb3d9 !important;
}

.theme-mint {
    background: #98f5e1 !important;
}

.theme-lavender {
    background: #d8b4f8 !important;
}

/* ── Toast ── */
#toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translateX(-50%) translateY(-50%) scale(0.9);
    background: #1f1f1f;
    border: 1px solid #2a2a2a;
    border-radius: var(--r-sm);
    padding: 16px 24px;
    font-size: var(--fs-base);
    color: var(--body);
    z-index: 1000;
    max-width: 320px;
    text-align: center;
    pointer-events: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    opacity: 0;
}
#toast.show {
    transform: translateX(-50%) translateY(-50%) scale(1);
    opacity: 1;
}
