@font-face {
    font-family: "DumbPad Reading";
    src: url("/font/LXGWWenKai-Regular.ttf") format("truetype");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "DumbPad Code";
    src: url("/font/FiraCode-Regular.ttf") format("truetype");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

.mobile-only {
    display: none !important;
}
.vditor-reset pre > code{

    background: #e3e3e3;
}

.pc-only {
    display: block !important;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(2px);
    z-index: 1500;
}

.sidebar-overlay.visible {
    display: block;
}

:root {
    --bg-color: #f6f7f9;
    --text-color: #20242b;
    --muted-text: #697180;
    --primary-color: #2563eb;
    --primary-rgb: 37, 99, 235;
    --secondary-color: #dde3ec;
    --header-bg: #ffffff;
    --textarea-bg: #ffffff;
    --surface-subtle: #f9fafb;
    --border-color: #e4e8ef;
    --success-status-bg: rgba(37, 99, 235, 0.5);
    --danger-status-bg: rgba(220, 38, 38, 0.5);
    --modal-overlay: rgba(0, 0, 0, 0.5);
    --modal-bg: #ffffff;
    --button-hover: #f3f4f6;
    --danger-color: #dc2626;
    --danger-hover: #ef4444;
    --code-markdown: rgba(37, 100, 235, 0.2);
    --transition: background-color 0.3s, color 0.3s;
    --input-element-transition: background-color 0.2s ease;
    --ease-out-expo: cubic-bezier(0.19, 1, 0.22, 1);
    --font-reading: "DumbPad Reading", "Source Han Sans SC", "Noto Serif SC", "Microsoft YaHei", sans-serif;
    --font-code: "DumbPad Code", "Fira Code", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

[data-theme="dark"] {
    --bg-color: #111318;
    --text-color: #e7eaf0;
    --muted-text: #9aa3b2;
    --primary-color: #60a5fa;
    --primary-rgb: 96, 165, 250;
    --secondary-color: #2d3542;
    --header-bg: #171a21;
    --textarea-bg: #1b1f27;
    --surface-subtle: #151922;
    --border-color: #2a313d;
    --success-status-bg: rgba(96, 165, 250, 0.5);
    --danger-status-bg: rgba(220, 38, 38, 0.5);
    --modal-bg: #242424;
    --button-hover: #374151;
    --danger-color: #dc2626;
    --danger-hover: #b91c1c;
    --code-markdown: rgba(96, 165, 250, 0.2);
    --command-palette-bg: rgba(23, 26, 33, 0.95);
    --shadow-premium: 0 20px 50px rgba(0, 0, 0, 0.3);
    --toc-bg: rgba(23, 26, 33, 0.8);
}

* {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.sidebar,
.header,
.icon-button,
.sidebar-tab,
.floating-btn,
.item-action-btn {
    user-select: none;
}

html,
body {
    overscroll-behavior-y: none;
    overflow: hidden;
    height: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: var(--transition);
    overflow: hidden;
    line-height: 1.5;
}

.container {
    max-width: 100%;
    height: 100vh;
    margin: 0;
    padding: 12px;
    padding-bottom: env(safe-area-inset-bottom, 12px);
    display: flex;
    flex-direction: column;
    transition: var(--transition);
}

header {
    display: flex;
    flex-direction: column;
    padding: 6px 20px;
    background: color-mix(in srgb, var(--header-bg) 48%, transparent);
    backdrop-filter: blur(16px) saturate(185%) contrast(106%);
    -webkit-backdrop-filter: blur(16px) saturate(185%) contrast(106%);
    border: 1px solid rgba(128, 128, 128, 0.12);
    border-radius: 12px;
    margin-bottom: 16px;
    box-shadow: 0 1px 1px rgba(15, 23, 42, 0.03),
        0 8px 24px rgba(15, 23, 42, 0.055);
    z-index: 1000;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-width: 72px;
}

.mark-popover-actions .save-btn {
    color: var(--primary-color);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    justify-content: flex-end;
}

#header-title {
    flex: 0 1 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    min-width: 0;
    margin: 0 20px;
    white-space: nowrap;
}

#header-title h1 {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--text-color);
    margin: 0;
    opacity: 0.9;
    line-height: 20px;
    max-width: 30vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.startup-sync-status {
    --sync-status-color: var(--muted-text);
    position: relative;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 20px;
    min-width: 20px;
    height: 20px;
    min-height: 20px;
    margin-top: 0;
    color: var(--sync-status-color);
    font-size: 0;
    line-height: 1.2;
    border: 0;
    border-radius: 6px;
    cursor: pointer;
}

.startup-sync-status:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 3px;
}

.sync-status-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    margin-left: 0;
}

.sync-status-icon svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.sync-status-dot {
    position: absolute;
    left: 2px;
    top: 50%;
    width: 7px;
    height: 7px;
    transform: translateY(-50%);
    border-radius: 50%;
    background: var(--sync-status-color);
    border: 1.5px solid var(--header-bg, var(--bg-color));
}

.sync-status-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.startup-sync-status[data-state="idle"] {
    visibility: hidden;
}

.startup-sync-status[data-kind="cached"] {
    --sync-status-color: #8a6d1d;
}

.startup-sync-status[data-kind="syncing"] {
    --sync-status-color: var(--primary-color);
}

.startup-sync-status[data-kind="synced"] {
    --sync-status-color: #2f7d4f;
}

.startup-sync-status[data-kind="unsynced"] {
    --sync-status-color: var(--danger-color);
}

.startup-sync-status[data-kind="syncing"] .sync-status-dot {
    animation: syncStatusPulse 1.1s ease-in-out infinite;
}

@keyframes syncStatusPulse {
    0%,
    100% {
        opacity: 0.5;
        transform: translateY(-50%) scale(0.86);
    }

    50% {
        opacity: 1;
        transform: translateY(-50%) scale(1);
    }
}

@media (max-width: 640px) {
    #header-title h1 {
        max-width: 25vw;
        font-size: 14px;
    }

    .startup-sync-status {
        width: 20px;
        min-width: 20px;
    }
}

#theme-toggle span {
    font-size: 1.5rem;
    line-height: 1;
    display: block;
}

#theme-toggle:hover {
    background-color: var(--secondary-color);
}

[data-theme="light"] .moon {
    display: block;
}

[data-theme="light"] .sun {
    display: none;
}

[data-theme="dark"] .moon {
    display: none;
}

[data-theme="dark"] .sun {
    display: block;
}

main {
    flex: 1;
}

/* Custom Scrollbars */
/* Webkit browsers */
::-webkit-scrollbar {
    width: 10px;
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: transparent;
    border-radius: 8px;
    border: 2px solid var(--bg-color);
    min-height: 40px;
    transition: background 0.2s;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

::-webkit-scrollbar-corner {
    background: transparent;
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--secondary-color) transparent;
}

/* Scrollbars for specific scrollable containers */
#editor,
#preview-pane {
    scrollbar-width: thin;
    scrollbar-color: var(--secondary-color) transparent;
    width: 100%;
    height: 100%;
    padding: 1.5rem;
    font-size: 1rem;
    line-height: 1.6;
    border: none;
    outline: none;
    resize: none;
    background-color: transparent;
    color: var(--text-color);
    transition: var(--transition);
    position: relative;
    z-index: 2;
}

#editor {
    font-family: monospace;
}

#editor::placeholder {
    color: #9ca3af;
}

.editor-container,
.preview-container {
    height: calc(100vh - 9rem);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 1;
    background-color: var(--textarea-bg);
    transition: var(--transition);
}

.editor-container {
    overflow: hidden;
}

/* Three Column Layout */
.three-column-layout {
    display: flex;
    flex-direction: row;
    height: calc(100vh - 92px);
    gap: 12px;
    width: 100%;
}

.sidebar {
    width: 270px;
    background-color: var(--textarea-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: var(--transition);
    flex-shrink: 0;
}

.sidebar-header {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
    color: var(--text-color);
}

.sidebar-header h3 {
    font-size: 0.82rem;
    letter-spacing: 0;
    text-transform: uppercase;
    color: var(--muted-text);
    margin: 0;
}

.directory-tree,
.recent-files-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.editor-main {
    padding: 0;
    flex: 1;
    background-color: transparent;
    border: 0;
    border-radius: 8px;
    box-shadow: none;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-width: 0;
    /* Important for flex child to allow shrinking */
}

/* Directory tree styles */
.dir-group {
    margin-bottom: 6px;
}

.dir-group-title {
    width: 100%;
    border: 0;
    background: transparent;
    font-size: 0.78rem;
    color: var(--muted-text);
    padding: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    border-radius: 6px;
    text-align: left;
}


.dir-group-title:hover {
    background-color: var(--button-hover);
    color: var(--text-color);
}

.dir-items {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.dir-group.is-collapsed .dir-items {
    display: none;
}

.chevron {
    display: inline-flex;
    transform: rotate(90deg);
    transition: transform 0.16s ease;
}

.dir-group.is-collapsed .chevron {
    transform: rotate(0deg);
}

.dir-count {
    margin-left: auto;
    font-size: 0.72rem;
    color: var(--muted-text);
}

.sidebar-item-wrapper {
    display: flex;
    align-items: center;
    gap: 4px;
    width: 100%;
    border-radius: 6px;
    transition: background-color 0.2s;
    padding-right: 4px;
    margin-bottom: 2px;
}

.sidebar-item-wrapper:hover {
    background-color: var(--button-hover);
}

.sidebar-item-wrapper.active {
    background-color: var(--primary-color);
    color: white;
}

.dir-item,
.recent-item {
    flex: 1;
    border: 0;
    background: transparent;
    padding: 8px;
    cursor: pointer;
    color: inherit;
    font-size: 0.88rem;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    text-align: left;
    overflow: hidden;
}

.item-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.item-time {
    color: var(--muted-text);
    font-size: 0.74rem;
}

.sidebar-item-wrapper.active .item-time {
    color: rgba(255, 255, 255, 0.78);
}

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

.sidebar-item-wrapper:hover .item-actions {
    display: flex;
}

.item-action-btn {
    background: none;
    border: none;
    padding: 6px;
    cursor: pointer;
    color: var(--muted-text);
    border-radius: 4px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.item-delete-btn {
    color: #ef4444;
    /* Red delete button */
}

.sidebar-item-wrapper.active .item-action-btn {
    color: rgba(255, 255, 255, 0.8);
}

.sidebar-item-wrapper.active .item-delete-btn {
    color: #ff8a8a;
    /* Lighter red on active background */
}

.item-action-btn:hover {
    background-color: rgba(var(--primary-rgb), 0.1);
    color: var(--primary-color);
}

.item-delete-btn:hover {
    color: white !important;
    background-color: #ef4444 !important;
}

.sidebar-item-wrapper.active .item-action-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
    color: white !important;
}

.sidebar-item-wrapper.show-actions .item-actions {
    display: flex;
}

@media (max-width: 980px) {

    /* Actions only shown on .show-actions class (long press) on mobile */
    .sidebar-item-wrapper:hover .item-actions {
        display: none;
    }

    .sidebar-item-wrapper.show-actions .item-actions {
        display: flex;
    }
}

.recent-stack {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.empty-state {
    color: var(--muted-text);
    font-size: 0.86rem;
    padding: 12px 8px;
}

.toast-container {
    position: fixed;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 2000;
}

.toast {
    color: #ffffff;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    max-width: 300px;
    box-sizing: border-box;
    word-wrap: break-word;
    font-size: 0.875rem;
    text-align: center;
}

.toast.show {
    opacity: 1;
}

.toast.success {
    background-color: var(--success-status-bg);
}

.toast.error {
    background-color: var(--danger-status-bg);
}

.toast.info {
    background-color: rgba(var(--primary-rgb), 0.85);
    color: white;
}

.notepad-controls {
    position: absolute;
    left: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.select-wrapper,
.notepad-controls-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.icon-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    color: var(--text-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--input-element-transition);
}

.icon-button:hover {
    background-color: var(--button-hover);
}

#preview-markdown.active svg {
    stroke: var(--primary-color);
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--modal-overlay);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.visible {
    display: flex;
}

.modal-content {
    background-color: var(--modal-bg);
    padding: 2rem;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

#settings-modal .modal-content {
    max-width: min(760px, calc(100vw - 32px));
    max-height: min(86vh, 820px);
    overflow-y: auto;
}

.modal-content h2 {
    margin-bottom: 1rem;
    color: var(--text-color);
}

.modal-input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--secondary-color);
    border-radius: 6px;
    background-color: var(--textarea-bg);
    color: var(--text-color);
    font-size: 1rem;
}

.modal-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1rem;
}

.modal-buttons button {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: var(--input-element-transition);
}

#rename-cancel,
#download-cancel,
#settings-cancel {
    background-color: var(--secondary-color);
    color: var(--text-color);
}

#rename-confirm,
#download-txt,
#download-md,
#settings-save {
    background-color: var(--primary-color);
    color: white;
}

.modal-message {
    color: var(--text-color);
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

/* Command Palette Styles */
.command-palette-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    z-index: 5000;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding-top: 15vh;
    animation: fadeIn 0.2s var(--ease-out-expo);
}

.command-palette-overlay.active {
    display: flex;
}

.command-palette {
    width: 90%;
    max-width: 600px;
    background: var(--header-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    box-shadow: var(--shadow-premium);
    overflow: hidden;
    transform: translateY(-20px) scale(0.98);
    transition: all 0.3s var(--ease-out-expo);
}

.command-palette-overlay.active .command-palette {
    transform: translateY(0) scale(1);
}

.command-input-wrapper {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.command-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-color);
    font-size: 18px;
    outline: none;
    margin-left: 12px;
}

.command-results {
    max-height: 350px;
    overflow-y: auto;
    padding: 8px;
}

.command-item {
    padding: 12px 16px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--muted-text);
}

.command-item:hover,
.command-item.selected {
    background: var(--button-hover);
    color: var(--text-color);
}

.command-item kbd {
    margin-left: auto;
    background: var(--border-color);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    opacity: 0.6;
}

.command-item-main {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.command-item-title {
    font-weight: 600;
    color: var(--text-color);
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.command-item-snippet {
    font-size: 12px;
    color: var(--muted-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Table of Contents */
.toc-container {
    position: fixed;
    right: 30px;
    top: 100px;
    width: 240px;
    max-height: 70vh;
    background: var(--toc-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 24px;
    overflow-y: auto;
    display: none;
    z-index: 1000;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.toc-container.visible {
    display: block;
}

.toc-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--muted-text);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: 20px;
    opacity: 0.8;
}

.toc-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.toc-item {
    font-size: 13.5px;
    color: var(--muted-text);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    line-height: 1.4;
    padding: 6px 12px;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.toc-item:hover {
    color: var(--primary-color);
    background: rgba(var(--primary-rgb), 0.05);
}

.toc-item.h1 {
    font-weight: 700;
    color: var(--text-color);
    font-size: 14px;
}

.toc-item.h2 {
    padding-left: 20px;
}

.toc-item.h3 {
    padding-left: 24px;
    font-size: 12.5px;
    opacity: 0.9;
}

.toc-item.h4 {
    padding-left: 44px;
    font-size: 12px;
    opacity: 0.8;
}

.toc-item.active {
    color: var(--primary-color);
    font-weight: 600;
}

/* Premium Empty State */
.empty-state-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 100%;
    padding: 40px;
    text-align: center;
    color: var(--muted-text);
}

.empty-state-glow {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, var(--primary-color) 0%, transparent 70%);
    opacity: 0.1;
    filter: blur(60px);
    position: absolute;
    z-index: -1;
    animation: pulse 4s infinite alternate;
}

.empty-state-title {
    font-size: 36px;
    font-weight: 800;
    color: var(--text-color);
    margin-bottom: 16px;
    letter-spacing: -0.05em;
    background: linear-gradient(to right, var(--text-color), var(--primary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.empty-state-subtitle {
    font-size: 16px;
    max-width: 400px;
    line-height: 1.6;
}

@keyframes pulse {
    from {
        transform: scale(1);
        opacity: 0.05;
    }

    to {
        transform: scale(1.5);
        opacity: 0.15;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Responsive Optimizations */
@media (max-width: 1024px) {
    .toc-container {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .empty-state-title {
        font-size: 28px;
    }
}

.modal-buttons button.danger {
    background-color: var(--danger-color);
    color: white;
}

.modal-buttons button.danger:hover {
    background-color: var(--danger-hover);
}

#delete-notepad {
    color: var(--danger-color);
}

#delete-notepad:hover {
    background-color: rgba(220, 38, 38, 0.1);
}

#pin-modal {
    background-color: var(--bg-color);
}

#pin-modal .modal-content {
    text-align: center;
    padding: 3rem 2rem;
}

.pin-header {
    color: var(--text-color);
    font-size: 1.2rem;
    margin-bottom: 1rem;
    font-weight: 700;
    text-shadow: none;
}

.pin-header h2 {
    color: var(--text-color);
    opacity: 0.8;
    font-size: 1.25rem;
    font-weight: 500;
    margin-top: 1rem;
}

.pin-container {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    margin: 2rem 0;
}

.pin-digit {
    width: 35px;
    height: 45px;
    text-align: center;
    font-size: 1.25rem;
    border: 2px solid var(--secondary-color);
    border-radius: 8px;
    background-color: var(--textarea-bg);
    color: var(--text-color);
    transition: all 0.2s ease;
    flex: none;
    max-width: 30px;
    padding: 0;
}

.pin-digit:disabled,
.pin-digit.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    border-color: var(--secondary-color) !important;
    background-color: var(--textarea-bg) !important;
    color: var(--text-color) !important;
    box-shadow: none !important;
}

.pin-digit.disabled:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: none;
}

.pin-digit:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px var(--primary-color);
    outline: none;
}

.pin-digit.filled {
    border-color: var(--primary-color);
    background-color: var(--primary-color);
    color: white;
}

.error-message {
    color: var(--danger-color);
    margin-top: 1rem;
    font-size: 0.875rem;
    min-height: 1.25rem;
}

.modal-buttons button.primary {
    background-color: var(--primary-color);
    color: white;
    padding: 0.75rem 2rem;
    font-size: 1rem;
    margin-top: 1rem;
    min-width: 120px;
    border-radius: 8px;
    transition: var(--input-element-transition);
}

.modal-buttons button.primary:hover {
    background-color: var(--primary-color);
    opacity: 0.9;
}

#pin-modal .modal-buttons {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
}

#pin-modal .modal-buttons button.primary:hover {
    transform: translateY(-1px);
}

#pin-modal .modal-buttons button.primary:active {
    transform: translateY(0);
}

.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background-color: var(--bg-color);
    position: relative;
}

#login-content {
    text-align: center;
    padding: 2rem;
    border-radius: 12px;
    max-width: 400px;
    width: 90%;
}

/* Theme toggle for login page */
.login-container #theme-toggle {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    color: var(--text-color);
    border-radius: 8px;
    transition: var(--input-element-transition);
}

.login-container #theme-toggle:hover {
    background-color: var(--secondary-color);
}

.hybrid-editor {
    height: 100%;
    width: 100%;
    background: var(--textarea-bg);
    color: var(--text-color);
    overflow: hidden;
    border-radius: 8px;
}

.hybrid-editor-scroller {
    height: 100%;
    overflow: auto;
    padding: 30px 40px 100px;
    scroll-behavior: smooth;
}

/* Typography Polish */
.hybrid-line {
    font-size: 16px;
    line-height: 1.68;
    color: var(--text-color);
    margin-bottom: 2px;
    min-height: 30px;
    border-radius: 6px;
    padding: 2px 8px;
    overflow-wrap: anywhere;
}

.hybrid-line.h1 {
    font-size: 2.2em;
    font-weight: 800;
    margin-top: 1.2em;
    margin-bottom: 0.6em;
    letter-spacing: -0.02em;
}

.hybrid-line.h2 {
    font-size: 1.6em;
    font-weight: 700;
    margin-top: 1em;
    margin-bottom: 0.5em;
    letter-spacing: -0.01em;
}

.hybrid-line.h3 {
    font-size: 1.3em;
    font-weight: 600;
    margin-top: 0.8em;
    margin-bottom: 0.4em;
}

.hybrid-line.is-rendered {
    cursor: text;
}

.hybrid-line.is-rendered:hover {
    background: var(--surface-subtle);
}

.hybrid-line.is-active {
    background: color-mix(in srgb, rgb(153, 153, 153) 9%, transparent);
    box-shadow: inset 3px 0 0 #b3b3b3;
}

.hybrid-source-line {
    display: block;
    width: 100%;
    min-height: 30px;
    resize: none;
    border: 0;
    outline: 0;
    padding: 0;
    overflow: hidden;
    background: transparent;
    color: var(--text-color);
    line-height: 1.68;
    font: 14px/1.68 var(--font-code);
}

.hybrid-line p,
.hybrid-line ul,
.hybrid-line ol,
.hybrid-line blockquote,
.hybrid-line pre {
    margin: 0;
}

.hybrid-line h1,
.hybrid-line h2,
.hybrid-line h3,
.hybrid-line h4,
.hybrid-line h5,
.hybrid-line h6 {
    margin: 0;
    line-height: 1.3;
}

.hybrid-line h1 {
    font-size: 1.75rem;
}

.hybrid-line h2 {
    font-size: 1.42rem;
}

.hybrid-line h3 {
    font-size: 1.18rem;
}

.hybrid-line h4,
.hybrid-line h5,
.hybrid-line h6 {
    font-size: 1rem;
}

.hybrid-line ul,
.hybrid-line ol {
    padding-left: 1.35rem;
}

.hybrid-line blockquote {
    border-left: 3px solid var(--secondary-color);
    color: var(--muted-text);
    padding-left: 10px;
}

.hybrid-line code {
    font-family: var(--font-code);
    font-size: 0.9em;
}

.hybrid-line pre {
    max-width: 100%;
    overflow: auto;
    padding: 8px 10px;
    border-radius: 6px;
    background: var(--surface-subtle);
}

.hybrid-line a {
    color: var(--primary-color);
}

.hybrid-line.is-jump-target {
    background: color-mix(in srgb, var(--primary-color) 14%, transparent);
}

.typora-editor-shell {
    position: relative;
    background: transparent;
}

.hybrid-editor.typora-editor-shell.vditor,
.typora-editor-shell .vditor {
    height: 100%;
    max-height: 100%;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--text-color);
    overflow: hidden;
}

.hybrid-editor.typora-editor-shell.vditor {
    border: 0 !important;
    background: transparent;
    box-shadow: none;
}

.typora-editor-shell .vditor-toolbar {
    display: none;
}

.typora-editor-shell .vditor-panel {
    display: none !important;
}

.typora-editor-shell .vditor-content {
    height: 100%;
    max-height: 100%;
    background: transparent;
    overflow: hidden;
}

.typora-editor-shell .vditor-ir,
.typora-editor-shell .vditor-sv {
    background: transparent;
}

.typora-editor-shell .vditor-ir,
.typora-editor-shell .vditor-sv,
.typora-editor-shell .vditor-preview {
    display: none !important;
}

.typora-editor-shell .vditor-wysiwyg {
    display: block !important;
    height: 100%;
    max-height: 100%;
    overflow: auto;
    background: transparent;
}

.typora-editor-shell .vditor-reset {
    max-width: 760px;
    margin: 0 auto;
    padding: 38px 40px 110px;
    background: transparent;
    color: var(--text-color);
    font-family: var(--font-reading);
    font-size: 16.5px;
    line-height: 1.78;
}

.typora-editor-shell .vditor-wysiwyg pre.vditor-reset {
    width: 100%;
    max-width: 760px;
    min-height: 100%;
    height: auto;
    margin: 0 auto;
    padding: 38px 40px 110px;
    overflow: visible;
    background: var(--textarea-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.05);
    box-sizing: border-box;
}

.typora-source-editor {
    display: none;
    width: 100%;
    height: 100%;
    border: 0;
    outline: 0;
    resize: none;
    padding: 38px max(40px, calc((100% - 760px) / 2)) 110px;
    background: var(--textarea-bg);
    color: var(--text-color);
    font: 14px/1.7 var(--font-code);
    tab-size: 4;
}

.typora-source-toggle {
    position: fixed;
    right: 300px;
    bottom: 24px;
    z-index: 1000;
    width: 40px;
    height: 40px;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    background: var(--header-bg);
    color: var(--muted-text);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
    cursor: pointer;
    font: 700 12px/1 var(--font-code);
    display: grid;
    place-items: center;
}

@media (max-width: 1200px) {
    .typora-source-toggle {
        right: 24px;
    }
}

.typora-source-toggle:hover,
.typora-source-toggle.active {
    color: var(--primary-color);
    border-color: color-mix(in srgb, var(--primary-color) 45%, var(--border-color));
    background: color-mix(in srgb, var(--primary-color) 12%, var(--header-bg));
}

.typora-editor-shell.is-source-mode .vditor-content {
    display: none;
}

.typora-editor-shell.is-source-mode .typora-source-editor {
    display: block;
}

.typora-editor-shell .vditor-reset p,
.typora-editor-shell .vditor-reset li {
    color: var(--text-color);
}

.typora-editor-shell .vditor-reset a {
    color: var(--primary-color);
}

.typora-editor-shell .vditor-reset .is-jump-target {
    background: color-mix(in srgb, var(--primary-color) 16%, transparent);
    border-radius: 6px;
    transition: background 0.2s ease;
}

.typora-editor-shell.is-reading-mode .vditor-toolbar,
.typora-editor-shell.is-reading-mode .vditor-hint,
.typora-editor-shell.is-reading-mode .vditor-counter,
.typora-editor-shell.is-reading-mode .typora-source-toggle {
    display: none;
}

.typora-editor-shell.is-reading-mode .vditor-reset {
    cursor: default;
}

.typora-editor-shell.is-reading-mode .vditor-wysiwyg pre.vditor-reset[contenteditable="false"] {
    opacity: 1;
}

.typora-editor-shell.is-reading-mode .vditor-reset,
.typora-editor-shell.is-reading-mode .vditor-reset * {
    pointer-events: auto;
}

body.reading-mode-active .toc-container,
body.reading-mode-active .toc-container * {
    pointer-events: auto;
}

.is-code {
    border-radius: 0;
}

.is-code .hybrid-source-line {
    background: transparent !important;
}

.is-code-start {
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    margin-top: 8px;
}

.is-code-end {
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
    margin-bottom: 8px;
}

.md-code-fence,
.md-code-line {
    font-family: var(--font-code);
    font-size: 14px;
    margin: 0 -8px;
    padding: 0 16px;
}

.md-code-fence {
    color: var(--muted-text);
    opacity: 0.8;
}

.md-code-line {
    color: var(--text-color);
}

.md-code-block {
    position: relative;
    background: var(--surface-subtle);
    border-radius: 8px;
    padding: 12px 16px;
    margin: 8px 0;
    overflow-x: auto;
}

.md-code-lang {
    position: absolute;
    top: 6px;
    right: 12px;
    font-size: 11px;
    font-family: var(--font-mono);
    color: var(--muted-text);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.7;
    pointer-events: none;
}

.md-code-block pre {
    background: transparent !important;
    padding: 0 !important;
    font-family: var(--font-code) !important;
}

.is-block-editor {
    background: var(--surface-subtle) !important;
    border-radius: 8px !important;
    padding: 12px 16px !important;
    margin: 8px 0 !important;
    border-left: 3px solid var(--primary-color);
}

.hybrid-block-source {
    font-family: var(--font-code) !important;
    font-size: 14px !important;
    line-height: 1.6 !important;
}

.md-table-block {
    margin: 8px 0;
    overflow-x: auto;
    cursor: pointer;
    border-radius: 8px;
    transition: background-color 0.2s ease;
    padding: 4px;
}

.md-table-block:hover {
    background-color: rgba(var(--primary-rgb), 0.05);
}

.md-table-block table {
    border-collapse: collapse;
    width: 100%;
}

.md-table-block th,
.md-table-block td {
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    text-align: left;
}

.md-table-block th {
    background-color: var(--surface-subtle);
    font-weight: 600;
}

.md-table-row-placeholder {
    display: none;
}

/* When a row in the table is active, we show it as a source line */
.hybrid-line.is-table-row.is-active {
    background-color: var(--surface-subtle) !important;
    border-left: 3px solid var(--primary-color);
}

@media (max-width: 980px) {
    .container {
        padding: 8px;
    }

    header {
        align-items: center;
        flex-wrap: nowrap;
        margin-bottom: 4px;
        min-height: 48px;
        padding: 4px 8px;
    }

    .header-top {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        gap: 0;
    }

    .header-left {
        display: flex;
        align-items: center;
        gap: 4px;
        flex: 1;
        justify-content: flex-start;
    }

    .header-right {
        display: flex;
        align-items: center;
        gap: 4px;
        flex: 1;
        justify-content: flex-end;
        position: static;
    }

    #header-title {
        flex: 1.5;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 1px;
        min-width: 0;
        text-align: center;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    #header-title h1 {
        font-size: 1.1rem !important;
        margin: 0;
    }

    .notepad-controls {
        display: none;
        /* Hide for now on mobile or move to sidebar */
    }

    .mobile-only {
        display: flex !important;
    }

    .pc-only {
        display: none !important;
    }

    /* Sidebar Tabs */
    .sidebar-tabs {
        display: flex !important;
        gap: 12px;
        flex: 1;
    }

    .sidebar-tab {
        background: none;
        border: none;
        padding: 4px 8px;
        font-size: 14px;
        font-weight: 500;
        color: var(--muted-text);
        cursor: pointer;
        position: relative;
        transition: color 0.2s ease;
    }

    .sidebar-tab.active {
        color: var(--primary-color);
    }

    .sidebar-tab.active::after {
        content: '';
        position: absolute;
        bottom: -8px;
        left: 0;
        right: 0;
        height: 2px;
        background: var(--primary-color);
    }

    .sidebar-content-section {
        display: none !important;
        height: 100%;
        overflow-y: auto;
    }

    .sidebar-content-section.active {
        display: block !important;
    }

    .three-column-layout {
        height: calc(100vh - 56px);
        position: relative;
        padding-bottom: env(safe-area-inset-bottom);
    }

    .sidebar {
        position: fixed;
        top: 50%;
        left: 10px;
        z-index: 2000;
        width: 280px;
        height: calc(100vh - 100px);
        background-color: var(--modal-bg);
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.3s;
        border-radius: 16px;
        overflow: hidden;
        visibility: hidden;
        transform: translateY(-50%) translateX(calc(-100% - 20px));
    }

    .sidebar-header {
        padding: 8px 12px;
    }

    .sidebar-left {
        left: 0;
        display: flex !important;
        transform: translateX(-100%);
        visibility: hidden;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.3s;
    }

    .sidebar-left.visible {
        transform: translateY(-50%) translateX(0);
        visibility: visible;
    }

    .sidebar-right {
        right: 10px;
        left: auto;
        transform: translateY(-50%) translateX(calc(100% + 20px));
    }

    .sidebar-right.visible {
        transform: translateY(-50%) translateX(0);
        visibility: visible;
        display: flex !important;
    }

    .editor-main {
        width: 100%;
        max-width: 800px;
        margin: 0 auto;
        border: none;
        box-shadow: none;
        background: transparent;
    }
}

@media (max-width: 720px) {
    .hybrid-editor-scroller {
        padding: 16px 14px 48px;
    }
}

/* Remote cursor styling */
.remote-cursor {
    position: absolute;
    pointer-events: none;
    z-index: 3;
    width: 2px;
    height: 1.6em;
    background-color: currentColor;
    will-change: transform;
    transform-origin: left top;
    transition: transform 0.1s ease;
    opacity: 0.8;
    display: block;
    top: 0;
    left: 0;
}

.remote-cursor::before {
    content: '';
    position: absolute;
    top: -6px;
    left: -4px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: currentColor;
    opacity: 0.9;
}

/* Remove the old label styles */
.remote-cursor-label {
    display: none;
}

.tooltip {
    position: absolute;
    background-color: var(--secondary-color);
    color: var(--text-color);
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 1000;
    /* Ensure it's above other elements */
}

.tooltip.show {
    visibility: visible;
    opacity: 1;
}

.settings-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
    /* margin-bottom: 1.5rem; */
}

.settings-label {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.settings-row-title {
    color: var(--text-color);
    font-size: 14px;
    font-weight: 700;
}

.settings-row-subtitle {
    margin-top: 4px;
    color: var(--muted-text);
    font-size: 12px;
    line-height: 1.4;
}

.settings-icon-button {
    width: 40px;
    height: 40px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--textarea-bg);
    color: var(--text-color);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.settings-icon-button:hover {
    background-color: var(--secondary-color);
}

.settings-conflict-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: color-mix(in srgb, var(--textarea-bg) 88%, var(--warning-color, #f59e0b) 12%);
}

.settings-conflict-section:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.settings-sync-state-row {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 2px;
    min-height: 24px;
}

.settings-sync-state-row .startup-sync-status {
    flex: 0 0 auto;
}

.settings-sync-summary {
    display: inline-flex;
    align-self: center;
    align-items: center;
    min-height: 24px;
    padding: 3px 9px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--primary-color) 10%, transparent);
    color: var(--text-color);
    font-size: 12px;
    font-weight: 700;
}

.settings-sync-summary[data-kind="synced"] {
    background: color-mix(in srgb, #16a34a 13%, transparent);
    color: #166534;
}

.settings-sync-summary[data-kind="dirty"],
.settings-sync-summary[data-kind="conflict"] {
    background: color-mix(in srgb, #f59e0b 16%, transparent);
    color: #92400e;
}

.settings-sync-summary[data-kind="offline"],
.settings-sync-summary[data-kind="error"] {
    background: color-mix(in srgb, #dc2626 13%, transparent);
    color: #991b1b;
}

.settings-sync-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    color: var(--muted-text);
    font-size: 12px;
}

.settings-sync-meta span {
    min-width: 0;
    padding: 7px 8px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--textarea-bg);
}

.settings-sync-meta strong {
    display: block;
    margin-top: 2px;
    color: var(--text-color);
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.settings-dirty-notes {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.settings-dirty-notes-title {
    color: var(--muted-text);
    font-size: 12px;
    font-weight: 700;
}

.settings-dirty-note-item {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--textarea-bg);
    color: var(--text-color);
    padding: 8px 10px;
    text-align: left;
    cursor: pointer;
}

.settings-dirty-note-item:hover {
    border-color: color-mix(in srgb, var(--primary-color) 45%, var(--border-color));
    background: color-mix(in srgb, var(--primary-color) 6%, var(--textarea-bg));
}

.settings-dirty-note-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 700;
}

.settings-dirty-note-state {
    color: var(--muted-text);
    font-size: 12px;
    white-space: nowrap;
}

.settings-conflict-section.is-clean .settings-conflict-content {
    display: none;
}

.settings-conflict-section.is-clean .settings-conflict-actions {
    justify-content: flex-start;
}

.settings-conflict-section.is-clean #settings-copy-local-content,
.settings-conflict-section.is-clean #settings-discard-local-content {
    display: none;
}

.settings-conflict-actions button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.settings-conflict-content {
    width: 100%;
    min-height: 112px;
    max-height: 220px;
    resize: vertical;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--textarea-bg);
    color: var(--text-color);
    padding: 10px;
    font: 13px/1.55 var(--font-code);
    box-sizing: border-box;
}

.settings-conflict-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.settings-conflict-actions button {
    border: 0;
    border-radius: 8px;
    padding: 9px 12px;
    background: var(--secondary-color);
    color: var(--text-color);
    cursor: pointer;
    font-weight: 600;
}

.settings-conflict-actions button.danger {
    background: #dc2626;
    color: #fff;
}

.settings-data-cloud-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: color-mix(in srgb, var(--textarea-bg) 94%, var(--primary-color) 6%);
}

.settings-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.settings-cloud-status {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.settings-cloud-stat {
    min-width: 0;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: color-mix(in srgb, var(--modal-bg) 78%, transparent);
}

.settings-cloud-stat span {
    display: block;
    color: var(--muted-text);
    font-size: 11px;
    line-height: 1.3;
}

.settings-cloud-stat strong {
    display: block;
    overflow: hidden;
    color: var(--text-color);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.4;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.settings-space-panel {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px;
    border: 1px solid color-mix(in srgb, var(--border-color) 82%, var(--primary-color) 18%);
    border-radius: 8px;
    background: color-mix(in srgb, var(--modal-bg) 76%, var(--primary-color) 7%);
}

.settings-space-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.settings-space-title {
    color: var(--text-color);
    font-size: 13px;
    font-weight: 800;
    line-height: 1.35;
}

.settings-space-subtitle {
    margin-top: 2px;
    color: var(--muted-text);
    font-size: 12px;
    line-height: 1.4;
}

.settings-space-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    max-height: 240px;
    overflow: auto;
    padding-right: 2px;
}

.settings-space-item,
.settings-space-empty {
    min-width: 0;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: color-mix(in srgb, var(--modal-bg) 86%, transparent);
    color: var(--text-color);
}

.settings-space-item {
    cursor: pointer;
    text-align: left;
    transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.settings-space-item:hover {
    border-color: color-mix(in srgb, var(--primary-color) 48%, var(--border-color));
    background: color-mix(in srgb, var(--modal-bg) 78%, var(--primary-color) 10%);
    transform: translateY(-1px);
}

.settings-space-item.is-active,
.settings-space-item:disabled {
    cursor: default;
    border-color: color-mix(in srgb, var(--primary-color) 58%, var(--border-color));
    background: color-mix(in srgb, var(--primary-color) 13%, var(--modal-bg));
    transform: none;
}

.settings-space-name,
.settings-space-path,
.settings-space-meta,
.settings-space-badges {
    display: block;
    min-width: 0;
}

.settings-space-name {
    overflow: hidden;
    color: var(--text-color);
    font-size: 13px;
    font-weight: 800;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.settings-space-path {
    margin-top: 2px;
    overflow: hidden;
    color: var(--muted-text);
    font-size: 11px;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.settings-space-meta {
    margin-top: 4px;
    overflow: hidden;
    color: var(--muted-text);
    font-size: 11px;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.settings-space-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 8px;
}

.settings-space-badges span,
.settings-space-badges strong,
.settings-space-badges em {
    padding: 2px 6px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--secondary-color) 80%, transparent);
    color: var(--muted-text);
    font-size: 10px;
    font-style: normal;
    font-weight: 700;
    line-height: 1.4;
}

.settings-space-badges strong {
    background: color-mix(in srgb, var(--primary-color) 20%, transparent);
    color: var(--primary-color);
}

.settings-space-empty {
    grid-column: 1 / -1;
    color: var(--muted-text);
    font-size: 12px;
    line-height: 1.45;
}

.settings-cloud-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.settings-cloud-main-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.settings-cloud-action {
    min-height: 76px;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: color-mix(in srgb, var(--modal-bg) 82%, var(--primary-color) 6%);
    color: var(--text-color);
    cursor: pointer;
    text-align: left;
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.settings-cloud-action:hover {
    border-color: color-mix(in srgb, var(--primary-color) 45%, var(--border-color));
    background: color-mix(in srgb, var(--modal-bg) 72%, var(--primary-color) 12%);
    transform: translateY(-1px);
}

.settings-cloud-action:disabled {
    cursor: wait;
    opacity: 0.6;
    transform: none;
}

.settings-cloud-action span,
.settings-cloud-action small {
    display: block;
    min-width: 0;
}

.settings-cloud-action span {
    font-size: 14px;
    font-weight: 800;
    line-height: 1.35;
}

.settings-cloud-action small {
    margin-top: 6px;
    color: var(--muted-text);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.35;
}

.settings-cloud-action.danger {
    border-color: color-mix(in srgb, #dc2626 34%, var(--border-color));
    background: color-mix(in srgb, var(--modal-bg) 80%, #dc2626 9%);
}

.settings-cloud-action.danger span {
    color: color-mix(in srgb, #dc2626 86%, var(--text-color));
}

.settings-cloud-advanced {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: color-mix(in srgb, var(--modal-bg) 86%, transparent);
}

.settings-cloud-advanced summary {
    padding: 10px 12px;
    color: var(--muted-text);
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    list-style-position: inside;
}

.settings-cloud-advanced[open] {
    padding-bottom: 12px;
}

.settings-cloud-advanced .settings-cloud-grid,
.settings-cloud-advanced .settings-cloud-actions {
    margin: 0 12px 10px;
}

.settings-cloud-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.settings-cloud-actions button {
    border: 0;
    border-radius: 8px;
    padding: 9px 12px;
    background: var(--secondary-color);
    color: var(--text-color);
    cursor: pointer;
    font-weight: 700;
}

.settings-cloud-actions button:hover {
    background: color-mix(in srgb, var(--secondary-color) 78%, var(--primary-color) 22%);
}

.settings-cloud-actions button:disabled {
    cursor: wait;
    opacity: 0.6;
}

.settings-cloud-actions button.danger {
    background: #dc2626;
    color: #fff;
}

.settings-cloud-result {
    min-height: 86px;
    max-height: 220px;
    overflow: auto;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: color-mix(in srgb, var(--bg-color) 82%, #000 6%);
    color: var(--text-color);
    font-family: var(--font-code);
    font-size: 12px;
    line-height: 1.5;
    white-space: pre-wrap;
}

@media (max-width: 560px) {
    .settings-sync-meta {
        grid-template-columns: 1fr;
    }

    .settings-cloud-status,
    .settings-space-list,
    .settings-cloud-main-actions,
    .settings-cloud-grid {
        grid-template-columns: 1fr;
    }

    .settings-cloud-actions button {
        flex: 1 1 calc(50% - 8px);
    }
}

.settings-label input {
    margin-top: 0.5rem;
}

#settings-modal input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 40px;
    height: 20px;
    background-color: #ccc;
    border-radius: 10px;
    position: relative;
    cursor: pointer;
    transition: background-color 0.3s;
}

#settings-modal input[type="checkbox"]:after {
    content: "";
    position: absolute;
    left: 2px;
    top: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: white;
    transition: transform 0.3s;
}

#settings-modal input[type="checkbox"]:checked {
    background-color: var(--primary-color);
}

#settings-modal input[type="checkbox"]:checked:after {
    transform: translateX(20px);
}

#settings-modal input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid var(--secondary-color);
    border-radius: 50%;
    background-color: var(--textarea-bg);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

#settings-modal input[type="radio"]:checked {
    border-color: var(--primary-color);
    background-color: var(--primary-color);
}

#settings-modal input[type="radio"]:checked::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: white;
}


/* Prevent sidebar flash on load */
.sidebar {
    display: none !important;
}

@media (min-width: 981px) {
    .sidebar {
        display: flex !important;
    }
}

@media (max-width: 980px) {
    .sidebar-left.visible {
        display: flex !important;
        border-radius: 10px;
    }
}

/* Multi-line block styling */
.md-block-placeholder {
    font-family: monospace;
    opacity: 0.3;
    font-size: 11px;
    padding-left: 20px;
    font-style: italic;
}

.hybrid-line:has(.md-block-placeholder):hover {
    background-color: var(--button-hover);
}

table {
    border-collapse: collapse;
    margin: 8px 0;
    width: auto;
    max-width: 100%;
    overflow-x: auto;
    display: block;
}

th,
td {
    border: 1px solid var(--border-color);
    padding: 6px 12px;
    text-align: left;
}

tr:nth-child(even) {
    background-color: var(--surface-subtle);
}

blockquote {
    border-left: 4px solid var(--primary-color);
    margin: 8px 0;
    padding-left: 16px;
    color: var(--muted-text);
    font-style: italic;
}

.floating-actions {
    position: fixed;
    right: 20.5%;
    top: 55%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 1000;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.floating-actions.scrolling {
    opacity: 0;
    pointer-events: none;
}

.selection-menu {
    display: none;
    position: absolute;
    background: color-mix(in srgb, var(--modal-bg) 85%, transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(128, 128, 128, 0.1);
    border-radius: 12px;
    padding: 6px;
    flex-direction: column;
    gap: 6px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    animation: popIn 0.25s cubic-bezier(0.23, 1, 0.32, 1);
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

.floating-btn {
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0);
    backdrop-filter: blur(8px);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.dark-mode .floating-btn {
    background-color: rgba(30, 30, 30, 0.85);
    color: #e0e0e0;
    border-color: rgba(255, 255, 255, 0.1);
}

.floating-btn:hover {
    transform: scale(1.1);
    background-color: white;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.dark-mode .floating-btn:hover {
    background-color: #2a2a2a;
    border-color: var(--primary-color);
}

.floating-btn:active {
    transform: scale(0.92);
}

.is-jump-target {
    animation: jump-highlight 2s ease;
}

@keyframes jump-highlight {
    0% {
        background-color: rgba(var(--primary-rgb), 0.2);
    }

    100% {
        background-color: transparent;
    }
}

@media (max-width: 980px) {
    .floating-actions {
        right: 12px;
    }

    .floating-btn {
        width: 40px;
        height: 40px;
    }
}

/* Mermaid Diagrams */
.mermaid-block {
    margin: 1rem 0;
    padding: 1.5rem;
    background: var(--surface-color);
    border-radius: 12px;
    justify-content: center;
    overflow-x: auto;
}

.mermaid {
    background: transparent !important;
    font-family: inherit !important;
}

/* Ensure mermaid diagrams adapt to theme */
[data-theme="dark"] .mermaid svg {
    filter: brightness(0.9) contrast(1.1);
}

.is-active .mermaid-block {
    display: none;
}

.md-highlight {
    background-color: #ffffff;
    /* Bright yellow */
    color: #000;
    padding: 0 4px;
    border-bottom: 2px solid #ea4c89;
}

/* Mark styling */
.md-mark {
    background-color: #fcfdbf;
    /* Bright green */
    color: #000;
    padding: 0 4px;
    border-radius: 4px;
}

.has-annotation {
    position: relative;
    cursor: pointer;
    color: inherit;
}

.annotation-note {
    color: #e74c3c;
    font-size: 0.72em;
    vertical-align: super;
    cursor: default;
    user-select: none;
    white-space: nowrap;
}

.annotation-badge {
    position: absolute;
    right: -16px;
    bottom: -8px;
    width: 14px;
    height: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, #e74c3c 10%, transparent);
    border-radius: 50%;
    color: #e74c3c;
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 0.78;
}

.annotation-badge:hover {
    color: #ff4d4f;
    opacity: 1;
    transform: scale(1.08);
    filter: drop-shadow(0 0 8px rgba(255, 77, 79, 0.3));
}

.annotation-badge svg {
    width: 9px;
    height: 9px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

img.annotation-badge:hover {
    opacity: 1;
}

/* Mark Action Popover */
.mark-popover {
    position: absolute;
    z-index: 1100;
    background: color-mix(in srgb, var(--modal-bg) 85%, transparent);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    color: var(--text-color);
    padding: 0;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15),
        0 4px 10px rgba(0, 0, 0, 0.1);
    width: max-content;
    max-width: min(320px, calc(100vw - 24px));
    font-size: 13px;
    animation: popoverFloatIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.comment-only-popover,
.mark-popover-editing {
    flex-direction: column;
    align-items: stretch;
}

/* Perfect integrated arrow */
.mark-popover::after {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    background: inherit;
    clip-path: polygon(50% 100%, 0 0, 100% 0);
    bottom: -11px;
    left: calc(50% - 6px);
}

@keyframes popoverFloatIn {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.mark-popover-inline-content {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 10px 16px;
    box-sizing: border-box;
    width: 100%;
}

.mark-popover-icon-box {
    flex-shrink: 0;
    color: #ef4444;
    opacity: 0.8;
    display: flex;
    align-items: center;
}

.mark-popover-text {
    white-space: pre-wrap;
    word-break: break-word;
    color: var(--text-color);
    font-size: 14px;
    line-height: 1.5;
    font-weight: 500;
}

.mark-popover-edit-input {
    width: 100%;
    min-height: 58px;
    max-height: 140px;
    resize: none;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--textarea-bg);
    color: var(--text-color);
    padding: 9px 10px;
    font: inherit;
    font-size: 14px;
    line-height: 1.5;
    outline: none;
    box-sizing: border-box;
}

.mark-popover-edit-input:focus {
    border-color: color-mix(in srgb, var(--primary-color) 55%, var(--border-color));
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary-color) 14%, transparent);
}

/* If there are actions below content, add a divider */
.mark-popover-inline-content+.mark-popover-actions {
    border-top: 1px solid rgba(128, 128, 128, 0.1);
    padding: 4px;
}

.mark-popover-actions {
    display: flex;
    gap: 4px;
    justify-content: center;
    margin: 0;
    padding: 0;
    border: none;
    box-sizing: border-box;
    width: 100%;
}

.mark-popover-actions button {
    background: transparent;
    border: 0;
    color: var(--text-color);
    padding: 8px 16px;
    border-radius: 0;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: auto;
}

.mark-popover-actions button.delete-btn::before {
    content: '';
    display: none;
    width: 14px;
    height: 14px;
    background-size: contain;
    opacity: 0.6;
}

.mark-popover-actions button:hover {
    background: rgba(128, 128, 128, 0.08);
    color: var(--primary-color);
}

.mark-popover-actions .save-btn,
.mark-popover-actions .edit-btn {
    color: var(--text-color);
    background: transparent;
}

.mark-popover-actions .delete-btn {
    color: var(--text-color);
}

.mark-popover-actions button:active {
    opacity: 0.8;
}

.mark-popover-actions button.delete-btn:hover {
    background: color-mix(in srgb, #e74c3c 10%, transparent);
    color: #e74c3c;
}

.mark-popover-edit input:focus {
    border-color: var(--primary-color);
}

/* Hover-based Annotation Tooltip is managed by JS now, removing CSS after/before hacks */

/* Reading Mode Layout */
body.reading-mode-active .three-column-layout {
    background: transparent;
    border: none;
    box-shadow: none;
}

body.reading-mode-active .editor-main {
    padding: 10px 0;
}

body.reading-mode-active .sidebar-right {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Tablet Optimizations */
@media (min-width: 981px) and (max-width: 1200px) {
    .sidebar-right {
        display: none;
    }

    .sidebar-left {
        width: 220px;
    }
}

@media (max-width: 980px) {
    .three-column-layout {
        gap: 0;
    }

    .floating-actions {
        bottom: 80px;
        right: 20px;
    }
}

/* Dynamic Floating Actions Positioning */
body.toc-active .floating-actions {
    right: 290px;
    /* Moves buttons to the left of the ToC (30px + 240px + 20px gap) */
    transition: right 0.3s var(--ease-out-expo);
}

/* Mobile Polish */
@media (max-width: 768px) {
    .typora-source-toggle {
        right: 72px;
        bottom: 20px;
    }

    .floating-actions {
        right: 20px;
        bottom: 20px;
        top: auto;
        transform: none;
        flex-direction: column;
        gap: 8px;
    }

    .floating-btn {
        width: 38px;
        height: 38px;
        border-radius: 50%;
        background: var(--header-bg);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    }
}

/* On smaller screens where ToC is hidden, reset button position */
@media (max-width: 1200px) {
    body.toc-active .floating-actions {
        right: 20px;
    }
}

/* Block Selection in Reading Mode */
.hybrid-line.is-reading-selected {
    background-color: rgba(var(--primary-rgb), 0.05);
    border-radius: 8px;
    box-shadow: 0 0 0 2px rgba(var(--primary-rgb), 0.2);
}

/* Reading Block Toolbar */
.reading-block-toolbar {
    position: absolute;
    z-index: 1000;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    display: flex;
    padding: 4px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    animation: selectionFadeIn 0.2s ease-out;
}

.reading-block-toolbar button {
    background: transparent;
    border: none;
    color: var(--text-color);
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s;
}

.reading-block-toolbar button:hover {
    background: rgba(var(--primary-rgb), 0.1);
    color: var(--primary-color);
}

.is-reading-mode .hybrid-line {
    cursor: default;
}

.is-reading-mode .hybrid-line:hover {
    background: transparent;
}

#toggle-reading-mode.active {
    color: var(--primary-color);
    background-color: rgba(var(--primary-rgb), 0.1);
}

/* Selection Menu */
.selection-menu {
    position: absolute;
    z-index: 1000;
    background: color-mix(in srgb, var(--modal-bg) 85%, transparent);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    display: flex;
    flex-wrap: wrap;
    max-width: calc(100vw - 20px);
    padding: 4px;
    gap: 4px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.04);
    animation: selectionFadeIn 0.2s ease-out;
}

@keyframes selectionFadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.selection-menu button {
    background: transparent;
    border: none;
    color: var(--text-color);
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: background 0.2s;
    white-space: nowrap;
    min-width: 44px;
}

.selection-menu button:hover {
    background: rgba(var(--primary-rgb), 0.1);
    color: var(--primary-color);
}

.selection-menu button svg {
    opacity: 0.8;
}

/* Annotation Popover */
.annotation-popover {
    position: absolute;
    z-index: 1100;
    background: var(--bg-color);
    color: var(--text-color);
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    max-width: 300px;
    font-size: 14px;
    line-height: 1.6;
    animation: popoverScaleIn 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popoverScaleIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(10px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Selection Menu Improvements */
.menu-btn-group,
.menu-input-group {
    display: flex;
    align-items: center;
    gap: 4px;
}

.menu-input-group {
    padding: 2px 6px;
}

.menu-input-group input {
    background: transparent;
    border: none;
    color: var(--text-color);
    padding: 6px 8px;
    font-size: 13px;
    outline: none;
    width: 180px;
}

.save-anno-btn {
    color: var(--primary-color) !important;
    padding: 6px !important;
    min-width: 32px;
    justify-content: center;
}

.save-anno-btn:hover {
    background: rgba(var(--primary-rgb), 0.15) !important;
}

.menu-input-group textarea {
    background: transparent;
    border: none;
    color: var(--text-color);
    padding: 8px;
    font-size: 13px;
    outline: none;
    width: 220px;
    max-height: 150px;
    resize: none;
    font-family: inherit;
    line-height: 1.5;
}

@media (max-width: 720px) {
    .selection-menu.typora-selection-menu {
        position: absolute;
        width: max-content;
        max-width: calc(100vw - 20px);
        justify-content: center;
        padding: 2px;
        border-radius: 14px;
        z-index: 12000;
    }

    .selection-menu.typora-selection-menu .menu-btn-group,
    .selection-menu.typora-selection-menu .menu-input-group {
        width: 100%;
        justify-content: space-between;
    }

    .selection-menu.typora-selection-menu button {
        flex: 1 1 0;
        min-height: 40px;
    }

    .selection-menu.typora-selection-menu .menu-input-group textarea {
        flex: 1 1 auto;
        width: auto;
        min-height: 40px;
    }

    .selection-menu.typora-selection-menu .save-anno-btn {
        flex: 0 0 48px;
    }
}

/* --- Premium Universal Confirmation Modal --- */
.confirmation-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    z-index: 100000 !important;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.confirmation-modal-overlay.visible {
    display: flex !important;
    opacity: 1;
}

.confirmation-dialog {
    background: #ffffff !important;
    color: #1a1a1a !important;
    width: 95%;
    max-width: 360px;
    border-radius: 20px;
    padding: 28px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    transform: translateY(20px);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    border: none !important;
}

[data-theme="dark"] .confirmation-dialog {
    background: #1e1e1e !important;
    color: #ffffff !important;
}

.confirmation-modal-overlay.visible .confirmation-dialog {
    transform: translateY(0);
}

.confirmation-body {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    align-items: flex-start;
}

.confirmation-icon-wrapper {
    width: 40px;
    height: 40px;
    background: #fee2e2 !important;
    color: #ef4444 !important;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.confirmation-text h3 {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 6px 0;
    color: inherit;
}

.confirmation-text p {
    font-size: 14px;
    color: #666 !important;
    line-height: 1.5;
    margin: 0;
}

[data-theme="dark"] .confirmation-text p {
    color: #aaa !important;
}

.confirmation-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.conf-btn-secondary,
.danger-btn {
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none !important;
}

.conf-btn-secondary {
    background: #f3f4f6 !important;
    color: #374151 !important;
}

.danger-btn {
    background: #f3f4f6 !important;
    color: red;
}

[data-theme="dark"] .conf-btn-secondary {
    background: #333 !important;
    color: #ddd !important;
}

.conf-btn-danger {
    background: #ef4444 !important;
    color: white !important;
}

.conf-btn-danger:hover {
    background: #dc2626 !important;
}
