﻿:root {
    --primary: #7c5cfc;
    --primary-light: #ede9fe;
    --primary-lighter: #f5f3ff;
    --primary-hover: #6a4be0;
    --primary-dark: #5b3fd4;

    --bg-page: #f3f0ff;
    --bg-panel: #ffffff;
    --bg-sidebar: #ffffff;
    --bg-hover: #f9f8ff;

    --text-primary: #1a1a2e;
    --text-secondary: #6b7280;
    --text-tertiary: #9ca3af;
    --text-inverse: #ffffff;

    --border: #eee9f5;
    --border-light: #f3f0fa;

    --shadow-sm: 0 1px 3px rgba(100, 70, 180, 0.04);
    --shadow-md: 0 4px 24px rgba(100, 70, 180, 0.07);
    --shadow-lg: 0 8px 40px rgba(100, 70, 180, 0.10);
    --shadow-card: 0 2px 8px rgba(100, 70, 180, 0.05);
    --shadow-card-hover: 0 8px 24px rgba(100, 70, 180, 0.10);

    --radius-xs: 6px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-pill: 999px;

    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    --sidebar-width: 260px;
    --topbar-height: 68px;
    
    --page-inline-gutter: 20px;
    
    --note-border-flow-duration: 1.1s;

    --accent-purple-bg: #ede9fe;
    --accent-purple-text: #7c5cfc;
    --accent-blue-bg: #dbeafe;
    --accent-blue-text: #3b82f6;
    --accent-orange-bg: #ffedd5;
    --accent-orange-text: #ea580c;
    --accent-green-bg: #d1fae5;
    --accent-green-text: #059669;
    --accent-pink-bg: #fce7f3;
    --accent-pink-text: #db2777;
    --accent-teal-bg: #ccfbf1;
    --accent-teal-text: #0d9488;
    --accent-indigo-bg: #e0e7ff;
    --accent-indigo-text: #4f46e5;
    --accent-amber-bg: #fef3c7;
    --accent-amber-text: #d97706;

    --accent: #7c5cfc;
    --text: #1a1a2e;
    --text-muted: #9ca3af;

    /* Compact type scale (comfortable “step back” from the screen) */
    --fs-body: 12px;
    --fs-body-sm: 11px;
    --fs-label: 11px;
    --fs-btn: 12px;
    --fs-btn-sm: 11px;
    --fs-title-page: 20px;
    --fs-title-card: 13px;
    --fs-title-row: 12px;
    --fs-input: 14px;
    --fs-nav: 12px;
    --fs-logo: 17px;
    --fs-panel-title: 14px;
    --fs-modal-title: 16px;

    /* Site wordmark img (logo.webp); favicon ayrı dosya */
    --site-logo-h: 26px;
    --site-logo-max-w: 198px;
}

.site-logo {
    height: var(--site-logo-h);
    width: auto;
    max-width: var(--site-logo-max-w);
    object-fit: contain;
    object-position: left center;
    display: block;
    flex-shrink: 0;
}

/* Dark mode: wordmark tek renk beyaz (logo.webp renkli olsa bile) */
html[data-theme="dark"] .site-logo {
    filter: brightness(0) invert(1);
}

html[data-theme="dark"] {
    color-scheme: dark;

    --primary: #9b87ff;
    --primary-light: #2f2650;
    --primary-lighter: #241d3d;
    --primary-hover: #b09cff;
    --primary-dark: #c4b5fd;

    --bg-page: #0c0a14;
    --bg-panel: #15121f;
    --bg-sidebar: #12101c;
    --bg-hover: #252135;

    --text-primary: #f0eef6;
    --text-secondary: #aaa5bc;
    --text-tertiary: #7f788e;
    --text-inverse: #0f0b18;

    --border: #2a2538;
    --border-light: #1f1b2c;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 4px 28px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 8px 48px rgba(0, 0, 0, 0.55);
    --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.35);
    --shadow-card-hover: 0 8px 28px rgba(80, 60, 140, 0.28);

    --accent-purple-bg: #2d2650;
    --accent-purple-text: #c4b5fd;
    --accent-blue-bg: #1e3a5f;
    --accent-blue-text: #93c5fd;
    --accent-orange-bg: #422006;
    --accent-orange-text: #fdba74;
    --accent-green-bg: #052e16;
    --accent-green-text: #6ee7b7;
    --accent-pink-bg: #3d0a24;
    --accent-pink-text: #f9a8d4;
    --accent-teal-bg: #042f2e;
    --accent-teal-text: #5eead4;
    --accent-indigo-bg: #1e1b4b;
    --accent-indigo-text: #a5b4fc;
    --accent-amber-bg: #361c00;
    --accent-amber-text: #fcd34d;

    --accent: #a78bfa;
    --text: #f0eef6;
    --text-muted: #8b8499;

    --nf-surface: #161321;
    --nf-surface-2: #1e1a2c;
    --nf-text-muted: #9ca3b8;
    --nf-accent: #a78bfa;
}

html[data-theme="light"] {
    color-scheme: light;
}

html[data-theme="dark"] .form-input:focus,
html[data-theme="dark"] .form-select:focus,
html[data-theme="dark"] .form-textarea:focus {
    box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.22);
}

html[data-theme="dark"] .btn--danger {
    background: #3f1518;
    color: #fca5a5;
    border-color: #5c2025;
}

html[data-theme="dark"] .btn--danger:hover {
    background: #522026;
}

html[data-theme="dark"] .btn--ghost:hover {
    background: var(--primary-lighter);
}

html[data-theme="dark"] .note-composer__errors {
    background: rgba(239, 68, 68, 0.14);
    border-color: rgba(239, 68, 68, 0.32);
    color: #fca5a5;
}

html[data-theme="dark"] .note-composer__editor {
    border-color: rgba(148, 163, 184, 0.22);
}

html[data-theme="dark"] .note-composer__editor .ProseMirror {
    color: var(--text-primary);
}

html[data-theme="dark"] .note-composer__vite-banner {
    background: rgba(251, 191, 36, 0.1);
    border-color: rgba(245, 158, 11, 0.28);
    color: #fcd34d;
}

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
    height: 100%;
    width: 100%;
    font-size: 90%;
}

body {
    font-family: var(--font);
    font-size: var(--fs-body);
    line-height: 1.5;
    color: var(--text-primary);
    background-color: var(--bg-page);
    height: 100%;
    min-height: 100%;
    width: 100%;
    min-width: 0;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- Custom brand cursor (enabled when JS adds html.has-nf-cursor) --- */
html.has-nf-cursor,
html.has-nf-cursor * {
    cursor: none !important;
}

/* Kod parçacığı canlı önizlemesi: özel imlek yok, normal sistem imleci */
html.has-nf-cursor .code-workspace__preview,
html.has-nf-cursor .code-workspace__preview * {
    cursor: auto !important;
}

/* body overflow:hidden fixed imleç + bloom’u kırpıyor; kaydırma #app-root / .main-content’te */
html.has-nf-cursor body:not(.auth-page) {
    overflow: visible !important;
}

.nf-cursor {
    position: fixed;
    left: 0;
    top: 0;
    width: 18px;
    height: 18px;
    margin: 0;
    z-index: 99999;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.22s ease;
    will-change: transform, opacity;
    transform: translate3d(-9999px, -9999px, 0);
    overflow: visible;
}

/* Tek yumuşak gölge katmanı (ring’den ayrı); hareket transform ile GPU’da */
.nf-cursor__bloom {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    z-index: 0;
    pointer-events: none;
    opacity: 0.95;
    transform: translateZ(0);
    box-shadow:
        0 0 20px 5px rgba(124, 92, 252, 0.28),
        0 6px 28px rgba(124, 92, 252, 0.22);
    transition: opacity 0.18s ease, box-shadow 0.2s ease;
}

html[data-theme="dark"] .nf-cursor__bloom {
    box-shadow:
        0 0 22px 5px rgba(155, 135, 255, 0.26),
        0 6px 30px rgba(155, 135, 255, 0.2);
}

.nf-cursor--hover .nf-cursor__bloom {
    opacity: 1;
    box-shadow:
        0 0 26px 6px rgba(124, 92, 252, 0.34),
        0 8px 36px rgba(124, 92, 252, 0.26);
}

html[data-theme="dark"] .nf-cursor--hover .nf-cursor__bloom {
    box-shadow:
        0 0 28px 6px rgba(155, 135, 255, 0.32),
        0 8px 38px rgba(155, 135, 255, 0.24);
}

.nf-cursor--text .nf-cursor__bloom {
    opacity: 0.45;
    box-shadow:
        0 0 14px 3px rgba(124, 92, 252, 0.2),
        0 4px 18px rgba(124, 92, 252, 0.14);
}

html[data-theme="dark"] .nf-cursor--text .nf-cursor__bloom {
    box-shadow:
        0 0 14px 3px rgba(155, 135, 255, 0.2),
        0 4px 18px rgba(155, 135, 255, 0.14);
}

.nf-cursor__ring {
    position: absolute;
    inset: 0;
    z-index: 1;
    border-radius: 50%;
    border: 1.5px solid var(--primary);
    box-shadow:
        0 0 0 1px rgba(124, 92, 252, 0.18),
        0 0 8px rgba(124, 92, 252, 0.24);
    transition:
        transform 0.11s cubic-bezier(0.25, 0.82, 0.3, 1),
        box-shadow 0.18s ease,
        border-color 0.18s ease,
        opacity 0.14s ease;
}

html[data-theme="dark"] .nf-cursor__ring {
    box-shadow:
        0 0 0 1px rgba(155, 135, 255, 0.18),
        0 0 7px rgba(155, 135, 255, 0.22);
}

/* Dot + caret: gerçek imleç konumu (nfTx/nfTy); ring/bloom biraz geriden gelir — tek katman transform */
.nf-cursor__core {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
    transform: translate3d(0, 0, 0);
}

.nf-cursor__dot {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 2;
    width: 3px;
    height: 3px;
    margin: -1.5px 0 0 -1.5px;
    border-radius: 50%;
    background: var(--primary);
    opacity: 1;
    transition: transform 0.11s cubic-bezier(0.25, 0.82, 0.3, 1), opacity 0.14s ease;
}

/* Metin düzenleme: sistem I-beam yerine ince dikey caret */
.nf-cursor__textcaret {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 2;
    width: 1.5px;
    height: 10px;
    margin: -5px 0 0 -0.75px;
    border-radius: 1px;
    background: var(--primary);
    box-shadow: 0 0 5px rgba(124, 92, 252, 0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.14s ease, transform 0.16s ease, height 0.16s ease;
}

html[data-theme="dark"] .nf-cursor__textcaret {
    box-shadow: 0 0 6px rgba(155, 135, 255, 0.42);
}

.nf-cursor--text .nf-cursor__ring,
.nf-cursor--text .nf-cursor__dot {
    opacity: 0;
    transform: scale(0.55);
    pointer-events: none;
}

.nf-cursor--text .nf-cursor__textcaret {
    opacity: 1;
    animation: nf-cursor-text-blink 1.05s steps(1, end) infinite;
}

.nf-cursor--text.nf-cursor--hover .nf-cursor__textcaret {
    height: 12px;
    margin-top: -6px;
}

@keyframes nf-cursor-text-blink {
    0%,
    45% {
        opacity: 1;
    }
    50%,
    100% {
        opacity: 0.12;
    }
}

.nf-cursor--hover .nf-cursor__ring {
    transform: scale(1.18);
    box-shadow:
        0 0 0 1px rgba(124, 92, 252, 0.22),
        0 0 8px rgba(124, 92, 252, 0.26);
}

html[data-theme="dark"] .nf-cursor--hover .nf-cursor__ring {
    box-shadow:
        0 0 0 1px rgba(155, 135, 255, 0.26),
        0 0 9px rgba(155, 135, 255, 0.28);
}

.nf-cursor--hover .nf-cursor__dot {
    transform: scale(0.82);
    opacity: 1;
}

.nf-cursor--press .nf-cursor__ring {
    transform: scale(0.97);
}

.nf-cursor--press.nf-cursor--hover .nf-cursor__ring {
    transform: scale(1.03);
}

.nf-cursor-ripple {
    position: fixed;
    left: 0;
    top: 0;
    width: 14px;
    height: 14px;
    margin-left: -7px;
    margin-top: -7px;
    border-radius: 50%;
    border: 1px solid rgba(124, 92, 252, 0.55);
    pointer-events: none;
    z-index: 99998;
    animation: nf-cursor-ripple-out 0.48s ease-out forwards;
}

html[data-theme="dark"] .nf-cursor-ripple {
    border-color: rgba(155, 135, 255, 0.55);
}

@keyframes nf-cursor-ripple-out {
    0% {
        transform: scale(0.65);
        opacity: 0.65;
    }
    100% {
        transform: scale(1.85);
        opacity: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    html.has-nf-cursor .nf-cursor__core {
        transform: none !important;
    }

    html.has-nf-cursor .nf-cursor__bloom {
        transition: none !important;
    }

    html.has-nf-cursor .nf-cursor__ring,
    html.has-nf-cursor .nf-cursor__dot {
        transition: none !important;
    }

    html.has-nf-cursor .nf-cursor--hover .nf-cursor__ring {
        transform: scale(1.04);
    }

    html.has-nf-cursor .nf-cursor--press .nf-cursor__ring {
        transform: scale(0.94);
    }

    html.has-nf-cursor .nf-cursor--press.nf-cursor--hover .nf-cursor__ring {
        transform: scale(1.02);
    }

    html.has-nf-cursor .nf-cursor--text .nf-cursor__textcaret {
        animation: none;
        opacity: 1;
    }

    .nf-cursor-ripple {
        animation: none;
        opacity: 0;
    }
}

::selection {
    background: var(--primary-light);
    color: var(--text-primary);
}

::-moz-selection {
    background: var(--primary-light);
    color: var(--text-primary);
}

#app-root {
    width: 100%;
    max-width: none;
    min-width: 0;
    min-height: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

button {
    font-family: inherit;
    font-size: inherit;
    border: none;
    background: none;
    cursor: pointer;
    color: inherit;
    outline: none;
}

input {
    font-family: inherit;
    font-size: inherit;
    border: none;
    background: none;
    outline: none;
    color: inherit;
}

a,
a:hover,
a:focus,
a:active {
    text-decoration: none;
}

.app-shell {
    display: flex;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 0;
    flex: 1;
    height: 100%;
    background: var(--bg-panel);
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
}

/* --- Sidebar konumu (data-sidebar-position on body; mobil ≤640 hariç) --- */
@media (min-width: 641px) {
    body[data-sidebar-position="right"] .app-shell {
        flex-direction: row-reverse;
    }

    body[data-sidebar-position="right"] .sidebar {
        border-right: none;
        border-left: 1px solid var(--border);
    }

    body[data-sidebar-position="right"]:not(.sidebar-mini) .sidebar-logo {
        padding-left: 22px;
        padding-right: 16px;
    }

    body[data-sidebar-position="right"] .sidebar-mini-toggle {
        left: 0;
        right: auto;
        transform: translateX(calc(-50% - 14px));
    }

    body[data-sidebar-position="top"] .app-shell,
    body[data-sidebar-position="bottom"] .app-shell {
        flex-direction: column;
    }

    body[data-sidebar-position="top"] .main-content,
    body[data-sidebar-position="bottom"] .main-content {
        flex: 1;
        min-height: 0;
    }

    body[data-sidebar-position="bottom"] .sidebar {
        order: 2;
    }

    body[data-sidebar-position="bottom"] .main-content {
        order: 1;
    }

    body[data-sidebar-position="top"] .sidebar,
    body[data-sidebar-position="bottom"] .sidebar {
        width: 100%;
        height: auto;
        min-height: 0;
        max-height: none;
        align-self: stretch;
        position: sticky;
        flex: 0 0 auto;
        border-right: none;
        flex-direction: row;
        align-items: stretch;
        padding: 10px 14px;
    }

    body[data-sidebar-position="top"] .sidebar {
        top: 0;
        border-bottom: 1px solid var(--border);
    }

    body[data-sidebar-position="bottom"] .sidebar {
        top: auto;
        bottom: 0;
        border-top: 1px solid var(--border);
        border-bottom: none;
    }

    body[data-sidebar-position="top"] .sidebar__header,
    body[data-sidebar-position="bottom"] .sidebar__header {
        flex: 0 0 auto;
        width: auto;
        min-width: 0;
        margin: 0;
        align-self: center;
    }

    /* overflow kırpma yok: üstte menü aşağı, altta yukarı taşsın. */
    body[data-sidebar-position="top"] .sidebar__body,
    body[data-sidebar-position="bottom"] .sidebar__body {
        flex: 1;
        min-width: 0;
        display: flex;
        flex-direction: row;
        align-items: center;
        overflow: visible;
    }

    body[data-sidebar-position="top"] .sidebar-nav,
    body[data-sidebar-position="bottom"] .sidebar-nav {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        align-content: center;
        gap: 4px 8px;
        flex: 1;
        width: 100%;
        min-width: 0;
    }

    body[data-sidebar-position="top"] .sidebar-nav > a,
    body[data-sidebar-position="bottom"] .sidebar-nav > a,
    body[data-sidebar-position="top"] .sidebar-nav > .sidebar-nav-group,
    body[data-sidebar-position="bottom"] .sidebar-nav > .sidebar-nav-group {
        width: auto;
    }

    body[data-sidebar-position="top"] .sidebar-nav__item,
    body[data-sidebar-position="bottom"] .sidebar-nav__item {
        width: auto;
        padding: 8px 12px;
        white-space: nowrap;
    }

    body[data-sidebar-position="top"] .sidebar-nav-group,
    body[data-sidebar-position="bottom"] .sidebar-nav-group {
        width: auto;
        min-width: 0;
    }

    body[data-sidebar-position="top"] .sidebar-nav-group__row,
    body[data-sidebar-position="bottom"] .sidebar-nav-group__row {
        width: auto;
        min-width: 0;
    }

    body[data-sidebar-position="top"] .sidebar-nav-group__sub,
    body[data-sidebar-position="bottom"] .sidebar-nav-group__sub {
        position: absolute;
        left: 0;
        top: 100%;
        margin-top: 4px;
        padding: 6px;
        min-width: 200px;
        background: var(--bg-panel);
        border: 1px solid var(--border);
        border-radius: var(--radius-md);
        box-shadow: var(--shadow-md);
        z-index: 620;
        display: none;
    }

    /* Alt yatay çubuk: menü satırın üstüne (içerik yönüne) açılır */
    body[data-sidebar-position="bottom"] .sidebar-nav-group__sub {
        top: auto;
        right: auto;
        bottom: 100%;
        left: 0;
        margin-top: 0;
        margin-bottom: 4px;
    }

    body[data-sidebar-position="top"] .sidebar-nav-group.is-open .sidebar-nav-group__sub,
    body[data-sidebar-position="bottom"] .sidebar-nav-group.is-open .sidebar-nav-group__sub {
        display: flex;
    }

    body[data-sidebar-position="top"] .sidebar-footer,
    body[data-sidebar-position="bottom"] .sidebar-footer {
        flex: 0 0 auto;
        padding-top: 0;
        padding-left: 8px;
        align-self: center;
    }

    body[data-sidebar-position="top"] .sidebar-logo,
    body[data-sidebar-position="bottom"] .sidebar-logo {
        margin-bottom: 0;
        padding-left: 8px;
        padding-right: 28px;
    }

    /* Üst / alt yatay dock: mini yok — daraltma düğmesi yok */
    body[data-sidebar-position="top"] .sidebar__header .sidebar-mini-toggle,
    body[data-sidebar-position="bottom"] .sidebar__header .sidebar-mini-toggle {
        display: none !important;
    }
}

.sidebar {
    z-index: 200;
    width: var(--sidebar-width);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    align-self: flex-start;
    min-height: 0;
    height: 100vh;
    height: 100dvh;
    /* Kaydırma .sidebar__body’de: header + taşan toggle yatay kırpılmaz */
    overflow: visible;
    border-right: 1px solid var(--border);
    padding: 18px 14px 16px;
    background: var(--bg-sidebar);
    transition: width 0.22s ease, padding 0.22s ease;
}

.sidebar__body {
    flex: 1;
    min-height: 0;
    overflow-x: visible;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

body.sidebar-mini {
    --sidebar-width: 72px;
}

body.sidebar-mini .sidebar {
    position: relative;
    z-index: 220;
    padding: 20px 10px 16px;
    overflow: visible;
}

body.sidebar-mini .sidebar-logo {
    position: relative;
    justify-content: center;
    padding: 0;
    margin-bottom: 20px;
    gap: 0;
    max-width: 100%;
}

body.sidebar-mini .sidebar-logo .site-logo {
    display: none;
}

body.sidebar-mini .sidebar-nav__item {
    position: relative;
    justify-content: center;
    padding: 10px 8px;
    gap: 0;
}

body.sidebar-mini .sidebar-nav__item > span {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

body.sidebar-mini .sidebar-mini-toggle-wrap {
    padding: 6px 0 2px;
    margin-top: 2px;
}

body.sidebar-mini .sidebar-footer {
    padding-top: 8px;
}

body.sidebar-mini .sidebar [data-sidebar-tooltip]::after {
    content: attr(data-sidebar-tooltip);
    position: absolute;
    left: calc(100% + 10px);
    top: 50%;
    transform: translateY(-50%) translateX(-4px);
    padding: 6px 11px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.35;
    white-space: nowrap;
    color: var(--text-primary);
    background: var(--bg-panel);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.14s ease, transform 0.14s ease, visibility 0.14s ease;
    z-index: 500;
}

body.sidebar-mini .sidebar [data-sidebar-tooltip]:hover::after,
body.sidebar-mini .sidebar [data-sidebar-tooltip]:focus-visible::after {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(0);
}

/* Sol/sağ sütun + mini: ipuçları ve flyout yana taşsın; .sidebar__body overflow kırpmasın */
body[data-sidebar-position="left"].sidebar-mini .sidebar__body,
body[data-sidebar-position="right"].sidebar-mini .sidebar__body {
    overflow: visible;
}

/* Sağ + mini: tooltip tam sola (translate, right:100% taşma kırpmasına karşı) */
body[data-sidebar-position="right"].sidebar-mini .sidebar [data-sidebar-tooltip]::after {
    left: 0;
    right: auto;
    margin-right: 0;
    margin-left: 0;
    transform: translateX(calc(-100% - 10px)) translateY(-50%) translateX(4px);
}

body[data-sidebar-position="right"].sidebar-mini .sidebar [data-sidebar-tooltip]:hover::after,
body[data-sidebar-position="right"].sidebar-mini .sidebar [data-sidebar-tooltip]:focus-visible::after {
    transform: translateX(calc(-100% - 10px)) translateY(-50%) translateX(0);
}

@media (prefers-reduced-motion: reduce) {
    body.sidebar-mini .sidebar [data-sidebar-tooltip]::after {
        transition: none;
        transform: translateY(-50%);
    }

    body.sidebar-mini .sidebar [data-sidebar-tooltip]:hover::after,
    body.sidebar-mini .sidebar [data-sidebar-tooltip]:focus-visible::after {
        transform: translateY(-50%);
    }

    body[data-sidebar-position="right"].sidebar-mini .sidebar [data-sidebar-tooltip]::after {
        transform: translateX(calc(-100% - 10px)) translateY(-50%);
    }

    body[data-sidebar-position="right"].sidebar-mini .sidebar [data-sidebar-tooltip]:hover::after,
    body[data-sidebar-position="right"].sidebar-mini .sidebar [data-sidebar-tooltip]:focus-visible::after {
        transform: translateX(calc(-100% - 10px)) translateY(-50%);
    }
}

.sidebar__header {
    position: relative;
    z-index: 3;
    flex-shrink: 0;
    min-height: 34px;
    margin: 0 -2px 0 0;
    overflow: visible;
}

/* Geniş mod: logo nav ile aynı hizada kalsın; toggle absolute — max-width kaldırıldı (sola kayma) */
body:not(.sidebar-mini) .sidebar__header {
    padding-right: 0;
}

body:not(.sidebar-mini) .sidebar-logo {
    width: 100%;
    max-width: none;
    box-sizing: border-box;
    /* .sidebar-nav__item ile aynı yatay iç boşluk (10px 16px) — sol hiza */
    padding-left: 16px;
    /* Yuvarlak toggle yarım taşan; sağda nav’dan biraz fazla nefes */
    padding-right: 22px;
}

.sidebar-logo__mini-block {
    display: none;
    position: relative;
    width: 38px;
    height: 38px;
    flex-shrink: 0;
}

body.sidebar-mini .sidebar-logo__mini-block {
    display: block;
}

body.sidebar-mini .sidebar-logo__favicon {
    position: relative;
    z-index: 0;
    transition: opacity 0.16s ease;
}

body.sidebar-mini .sidebar-logo__expand-hint {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.16s ease;
    pointer-events: none;
    color: var(--text-secondary);
}

body.sidebar-mini .sidebar-logo__expand-hint-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

body.sidebar-mini .sidebar-logo:hover .sidebar-logo__favicon,
body.sidebar-mini .sidebar-logo:focus-visible .sidebar-logo__favicon {
    opacity: 0;
}

body.sidebar-mini .sidebar-logo:hover .sidebar-logo__expand-hint,
body.sidebar-mini .sidebar-logo:focus-visible .sidebar-logo__expand-hint {
    opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
    body.sidebar-mini .sidebar-logo__favicon,
    body.sidebar-mini .sidebar-logo__expand-hint {
        transition: none;
    }
}

.sidebar-mini-toggle-wrap {
    padding: 10px 0 6px;
    margin-top: 8px;
    border-top: 1px solid var(--border);
}

.sidebar-mini-toggle {
    position: absolute;
    top: 2px;
    right: 0;
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    margin: 0;
    padding: 0;
    border-radius: 50%;
    border: 1px solid var(--border);
    color: var(--text-tertiary);
    background: var(--bg-sidebar);
    box-shadow: 0 1px 2px color-mix(in srgb, var(--text-primary) 8%, transparent);
    /* 50%: merkez içerik sağ sınırı; +14px: .sidebar yatay padding = sütun sınırı; yarım içeride yarım dışarıda */
    transform: translateX(calc(50% + 14px));
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

/* Mini modda yuvarlak toggle gizli: genişletme yalnızca logo alanında (çift kontrol görünümü olmasın) */
body.sidebar-mini .sidebar__header .sidebar-mini-toggle {
    display: none !important;
}

.sidebar-mini-toggle:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    box-shadow: 0 1px 3px color-mix(in srgb, var(--text-primary) 12%, transparent);
}

.sidebar-mini-toggle:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.sidebar-mini-toggle__icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* İkon görünürlüğü: yalnızca doğrudan buton çocuğu; flex/override çakışmasını önler */
body:not(.sidebar-mini) .sidebar-mini-toggle > .sidebar-mini-toggle__icon--expand {
    display: none !important;
}

body:not(.sidebar-mini) .sidebar-mini-toggle > .sidebar-mini-toggle__icon--collapse {
    display: block !important;
}

body.sidebar-mini .sidebar-mini-toggle > .sidebar-mini-toggle__icon--collapse {
    display: none !important;
}

body.sidebar-mini .sidebar-mini-toggle > .sidebar-mini-toggle__icon--expand {
    display: block !important;
}

/* Sağda sidebar: merkezdeki “daralt/genişlet” ok yönü ayna (panel sağa dayandığı için) */
body[data-sidebar-position="right"]:not(.sidebar-mini) .sidebar-mini-toggle > .sidebar-mini-toggle__icon--expand {
    display: block !important;
}

body[data-sidebar-position="right"]:not(.sidebar-mini) .sidebar-mini-toggle > .sidebar-mini-toggle__icon--collapse {
    display: none !important;
}

/* Sağ + mini: “genişlet” çift ok içeriğe (sola) baksın — logo ipucu + (görünürse) aynı ikon */
body[data-sidebar-position="right"].sidebar-mini .sidebar-logo__expand-hint-icon,
body[data-sidebar-position="right"].sidebar-mini .sidebar-mini-toggle__icon--expand {
    transform: scaleX(-1);
}

/* Yeni header varken eski "nav altı" toggle sarmalayıcısındaki ikinci butonu gizle (birleşik/yüksüz DOM) */
aside.sidebar:has(.sidebar__header) .sidebar-mini-toggle-wrap {
    display: none !important;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 0 2px;
    margin-bottom: 22px;
    text-decoration: none;
    color: inherit;
}

.sidebar-logo .site-logo {
    height: clamp(24px, 2.65vmin, 31px);
    max-width: min(var(--site-logo-max-w), calc(var(--sidebar-width) - 20px));
    width: auto;
}

.sidebar-logo__favicon {
    display: block;
    width: 38px;
    height: 38px;
    object-fit: contain;
    flex-shrink: 0;
}

.sidebar-logo__icon {
    flex-shrink: 0;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar-nav__item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-radius: var(--radius-md);
    font-size: var(--fs-nav);
    font-weight: 500;
    color: var(--text-secondary);
    text-align: left;
    width: 100%;
    text-decoration: none;
    border: 2px solid transparent;
    background-color: var(--bg-sidebar);
    transition: color 0.2s ease;
}

.sidebar-nav__item:hover:not(.is-active) {
    color: var(--text-primary);
    background:
        linear-gradient(var(--bg-hover), var(--bg-hover)) padding-box,
        linear-gradient(
            90deg,
            var(--primary),
            #9b7efd,
            #c4b5fd,
            #ede9fe,
            var(--primary),
            #9b7efd,
            #c4b5fd,
            #ede9fe,
            var(--primary)
        ) border-box;
    background-size: auto, 200% 100%;
    background-clip: padding-box, border-box;
    animation: note-pinned-border-flow var(--note-border-flow-duration) linear infinite;
}

.sidebar-nav__item.is-active {
    background: var(--primary);
    color: var(--text-inverse);
}

.sidebar-nav__item.is-active:hover {
    background:
        linear-gradient(var(--primary), var(--primary)) padding-box,
        linear-gradient(
            90deg,
            var(--primary),
            #9b7efd,
            #c4b5fd,
            #ede9fe,
            var(--primary),
            #9b7efd,
            #c4b5fd,
            #ede9fe,
            var(--primary)
        ) border-box;
    background-size: auto, 200% 100%;
    background-clip: padding-box, border-box;
    animation: note-pinned-border-flow var(--note-border-flow-duration) linear infinite;
}

.sidebar-nav__item.is-active .sidebar-nav__icon {
    stroke: var(--text-inverse);
}

.sidebar-nav__icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    display: block;
}

/* İndirilenler nav: ikon alanı diğer menülerle aynı 20×20; mini önizleme içeride */
.sidebar-nav__library-visual {
    position: relative;
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    align-self: center;
    overflow: visible;
}

.sidebar-nav__library-icon-wrap,
.sidebar-nav__library-peek {
    position: absolute;
    inset: 0;
    transition: opacity 0.35s ease, transform 0.35s ease, visibility 0.35s ease;
}

.sidebar-nav__library-icon-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

.sidebar-nav__item[data-library-peek-button].is-library-peek-active .sidebar-nav__library-icon-wrap {
    opacity: 0;
    visibility: hidden;
    transform: scale(0.9);
    pointer-events: none;
}

.sidebar-nav__library-peek {
    display: block;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.88) translateY(0.5px);
}

.sidebar-nav__item[data-library-peek-button].is-library-peek-active .sidebar-nav__library-peek {
    opacity: 1;
    visibility: visible;
    transform: scale(1) translateY(0);
}

/* Slot 20×20; görseller taşarak büyür — hizadaki 20px sütun aynı kalır */
.sidebar-nav__library-peek-img {
    position: absolute;
    width: 16px;
    height: 16px;
    object-fit: cover;
    border-radius: 3px;
    border: 1px solid rgba(255, 255, 255, 0.65);
    box-shadow: 0 2px 4px rgba(15, 23, 42, 0.2);
    background: var(--bg-panel, #fff);
    transition: transform 0.4s ease;
}

.sidebar-nav__library-peek-img--a {
    left: -3px;
    top: 1px;
    z-index: 2;
    transform: rotate(-22deg);
}

.sidebar-nav__library-peek-img--b {
    left: 4px;
    top: -1px;
    z-index: 1;
    transform: rotate(20deg);
}

.sidebar-nav__item[data-library-peek-button].is-library-peek-active .sidebar-nav__library-peek-img--a {
    transform: rotate(-18deg) translate(-0.5px, -0.5px);
}

.sidebar-nav__item[data-library-peek-button].is-library-peek-active .sidebar-nav__library-peek-img--b {
    transform: rotate(18deg) translate(0.5px, 0.5px);
}

/* Sürükle-bırak modunda sadece klasik ikon */
.sidebar-nav__item.is-drop-active .sidebar-nav__library-peek {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none;
}

.sidebar-nav__item.is-drop-active .sidebar-nav__library-icon-wrap {
    opacity: 1 !important;
    visibility: visible !important;
    transform: none;
}

html[data-theme="dark"] .sidebar-nav__library-peek-img {
    border-color: rgba(148, 163, 184, 0.35);
    background: #1e293b;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

@media (prefers-reduced-motion: reduce) {
    .sidebar-nav__library-peek {
        display: none !important;
    }

    .sidebar-nav__library-icon-wrap,
    .sidebar-nav__library-peek {
        transition: none;
    }
}

/* Aktif İndirilenler yükleme havuzu — sidebar item içinde küçük badge + spinner */
.sidebar-nav__upload-badge {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 8px 2px 6px;
    border-radius: 999px;
    background: rgba(124, 92, 252, 0.15);
    color: var(--primary);
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    flex-shrink: 0;
}

/* `display: inline-flex` UA `[hidden] { display: none }` kuralını ezdiği için
 * sayım 0 olunca badge görünür kalıyordu. Açıkça gizle. */
.sidebar-nav__upload-badge[hidden] {
    display: none !important;
}

.sidebar-nav__item.is-active .sidebar-nav__upload-badge {
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-inverse);
}

.sidebar-nav__upload-spinner {
    width: 10px;
    height: 10px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: nf-uploads-spin 0.7s linear infinite;
    display: inline-block;
}

@keyframes nf-uploads-spin {
    to { transform: rotate(360deg); }
}

.sidebar-nav__upload-count {
    font-variant-numeric: tabular-nums;
}

/* Mini-sidebar (collapsed): badge'i ikonun sağ üst köşesine konumlandır */
body.sidebar-mini .sidebar-nav__item {
    position: relative;
}
body.sidebar-mini .sidebar-nav__upload-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    margin-left: 0;
    padding: 1px 5px 1px 4px;
    gap: 3px;
    font-size: 0.6rem;
    background: var(--primary);
    color: var(--text-inverse);
    box-shadow: 0 0 0 2px var(--bg-sidebar);
}
body.sidebar-mini .sidebar-nav__upload-spinner {
    width: 8px;
    height: 8px;
    border-width: 1.5px;
}

html[data-theme="dark"] .sidebar-nav__upload-badge {
    background: rgba(124, 92, 252, 0.25);
    color: #c4b5fd;
}
html[data-theme="dark"] .sidebar-nav__item.is-active .sidebar-nav__upload-badge {
    background: rgba(255, 255, 255, 0.18);
    color: var(--text-inverse);
}
html[data-theme="dark"] body.sidebar-mini .sidebar-nav__upload-badge {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 0 0 2px var(--bg-sidebar);
}

/* "Yüklendi" pill — upload bittikten sonra 5 saniye boyunca aynı yuvada görünür */
.sidebar-nav__upload-done {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px 2px 6px;
    border-radius: 999px;
    background: rgba(124, 92, 252, 0.15);
    color: var(--primary);
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    flex-shrink: 0;
    animation: nf-uploads-done-in 220ms ease-out;
}
.sidebar-nav__upload-done svg {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
}
.sidebar-nav__upload-done[hidden] {
    display: none !important;
}
.sidebar-nav__item.is-active .sidebar-nav__upload-done {
    background: rgba(255, 255, 255, 0.22);
    color: var(--text-inverse);
}
@keyframes nf-uploads-done-in {
    from { opacity: 0; transform: translateY(-2px) scale(0.92); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Mini-sidebar: done pili da spinner badge gibi köşeye otursun */
body.sidebar-mini .sidebar-nav__upload-done {
    position: absolute;
    top: 2px;
    right: 2px;
    margin-left: 0;
    padding: 2px 4px;
    gap: 0;
    font-size: 0;
    background: var(--primary);
    color: var(--text-inverse);
    box-shadow: 0 0 0 2px var(--bg-sidebar);
}
body.sidebar-mini .sidebar-nav__upload-done svg {
    width: 10px;
    height: 10px;
}
body.sidebar-mini .sidebar-nav__upload-done > span {
    display: none;
}

html[data-theme="dark"] .sidebar-nav__upload-done {
    background: rgba(124, 92, 252, 0.25);
    color: #c4b5fd;
}
html[data-theme="dark"] .sidebar-nav__item.is-active .sidebar-nav__upload-done {
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-inverse);
}
html[data-theme="dark"] body.sidebar-mini .sidebar-nav__upload-done {
    background: var(--primary);
    color: var(--text-inverse);
    box-shadow: 0 0 0 2px var(--bg-sidebar);
}

/* Drag & drop — sayfa üzerinde dosya sürüklenirken sidebar item'ı drop hedefi olarak göster */
.sidebar-nav__drop-hint {
    display: none;
    margin-left: 0;
    color: var(--primary);
    font-weight: 700;
    font-size: 0.85rem;
    white-space: nowrap;
}

.sidebar-nav__item.is-drop-active {
    position: relative;
}
.sidebar-nav__item.is-drop-active .sidebar-nav__label,
.sidebar-nav__item.is-drop-active .sidebar-nav__upload-badge,
.sidebar-nav__item.is-drop-active .sidebar-nav__upload-done {
    display: none !important;
}
.sidebar-nav__item.is-drop-active .sidebar-nav__drop-hint {
    display: inline;
}

/* Drop target çerçevesi — SVG `stroke-dashoffset` animasyonu kullanılır.
 * Bu animasyon compositor seviyesinde çalışır, paint tetiklemez ve sonsuz döngüde
 * dikiş izi (kesilme) bırakmadan kayar. */
.sidebar-nav__drop-frame {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: visible;
    color: var(--primary);
    opacity: 0;
    transition: opacity 120ms ease-out;
}
.sidebar-nav__drop-frame rect {
    will-change: stroke-dashoffset;
}

.sidebar-nav__item.is-drop-active .sidebar-nav__drop-frame {
    opacity: 1;
}
.sidebar-nav__item.is-drop-active .sidebar-nav__drop-frame rect {
    animation: nf-svg-march 600ms linear infinite;
}

.sidebar-nav__item.is-drop-active.is-drop-hot {
    background: rgba(124, 92, 252, 0.12);
    box-shadow: 0 0 0 3px rgba(124, 92, 252, 0.16);
}
.sidebar-nav__item.is-drop-active.is-drop-hot .sidebar-nav__drop-frame {
    color: var(--primary);
    filter: drop-shadow(0 0 4px rgba(124, 92, 252, 0.5));
}
.sidebar-nav__item.is-drop-active.is-drop-hot .sidebar-nav__drop-frame rect {
    animation-duration: 380ms;
    stroke-width: 1.75;
}

/* `is-active` (örn. /library açıkken) item arka planı mor olduğundan,
 * mor üstüne mor stroke / metin görünmüyordu. Bu durumda kontrast için
 * çerçeveyi ve "Buraya sürükleyin" yazısını ters renge (text-inverse) çevir. */
.sidebar-nav__item.is-active.is-drop-active .sidebar-nav__drop-frame {
    color: var(--text-inverse);
}
.sidebar-nav__item.is-active.is-drop-active .sidebar-nav__drop-hint {
    color: var(--text-inverse);
}
/* Aktif item'ın mor arka planını koru; üstüne hafif beyaz inset highlight ekle.
 * `is-drop-active.is-drop-hot` kuralı (3 sınıf) `.is-active` zeminini ezdiği için
 * burada açıkça `var(--primary)` set ediyoruz. */
.sidebar-nav__item.is-active.is-drop-active.is-drop-hot {
    background: var(--primary);
    box-shadow:
        0 0 0 3px rgba(255, 255, 255, 0.32),
        0 4px 12px rgba(124, 92, 252, 0.3),
        inset 0 0 0 999px rgba(255, 255, 255, 0.10);
}
.sidebar-nav__item.is-active.is-drop-active.is-drop-hot .sidebar-nav__drop-frame {
    filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.55));
}

/* Dark mode — drop target çerçevesi/yazısı için kontrast ayarları */
html[data-theme="dark"] .sidebar-nav__item.is-drop-active .sidebar-nav__drop-frame {
    color: #c4b5fd;
}
html[data-theme="dark"] .sidebar-nav__item.is-drop-active .sidebar-nav__drop-hint {
    color: #c4b5fd;
}
html[data-theme="dark"] .sidebar-nav__item.is-active.is-drop-active .sidebar-nav__drop-frame,
html[data-theme="dark"] .sidebar-nav__item.is-active.is-drop-active .sidebar-nav__drop-hint {
    color: var(--text-inverse);
}
html[data-theme="dark"] .sidebar-nav__item.is-active.is-drop-active.is-drop-hot {
    background: var(--primary);
    box-shadow:
        0 0 0 3px rgba(196, 181, 253, 0.4),
        0 4px 12px rgba(124, 92, 252, 0.5),
        inset 0 0 0 999px rgba(255, 255, 255, 0.08);
}

/* Dasharray = "5 4" → bir döngü 9 birim. pathLength=200 ile dashoffset
 * görsel olarak konum kaymasıdır; -9 vermek dikişsiz tam bir döngü tamamlar. */
@keyframes nf-svg-march {
    from { stroke-dashoffset: 0; }
    to   { stroke-dashoffset: -9; }
}

@media (prefers-reduced-motion: reduce) {
    .sidebar-nav__item.is-drop-active .sidebar-nav__drop-frame rect {
        animation: none;
    }
}

/* Mini-sidebar drop hint — etiket yerine sadece animasyonlu çerçeve göster */
body.sidebar-mini .sidebar-nav__item.is-drop-active .sidebar-nav__drop-hint {
    display: none;
}

html[data-theme="dark"] .sidebar-nav__drop-hint {
    color: #c4b5fd;
}
html[data-theme="dark"] .sidebar-nav__item.is-drop-active.is-drop-hot {
    background: rgba(124, 92, 252, 0.2);
}

.sidebar-nav-group {
    display: flex;
    flex-direction: column;
    gap: 0;
    position: relative;
    width: 100%;
}

.sidebar-nav-group__row {
    display: flex;
    align-items: stretch;
    width: 100%;
    min-width: 0;
    gap: 0;
    border-radius: var(--radius-md);
}

.sidebar-nav__item--workspace-shell {
    flex: 1;
    min-width: 0;
    gap: 0;
}

.sidebar-nav__item-hit {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
    padding: 0;
    margin: 0;
    border: none;
    background: transparent;
    text-decoration: none;
    color: inherit;
    font: inherit;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
}

.sidebar-nav__item-text-stack {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    min-width: 0;
    gap: 1px;
}

.sidebar-nav__item-eyebrow {
    font-size: 10px;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 0.01em;
    color: var(--text-tertiary);
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-nav__item--workspace-shell.is-active .sidebar-nav__item-eyebrow {
    color: rgba(255, 255, 255, 0.75);
}

.sidebar-nav__item-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.sidebar-nav__item--workspace-shell.is-active .sidebar-nav-group__toggle {
    color: rgba(255, 255, 255, 0.88);
}

.sidebar-nav__item--workspace-shell.is-active .sidebar-nav-group__toggle:hover {
    color: var(--text-inverse);
    background: rgba(255, 255, 255, 0.14);
}

.sidebar-nav-group__toggle {
    flex: 0 0 32px;
    margin-left: auto;
    margin-right: -4px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: none;
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--text-tertiary);
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease;
}

.sidebar-nav-group__toggle:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.sidebar-nav-group__toggle:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.sidebar-nav-group__chev {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    transition: transform 0.18s ease;
}

.sidebar-nav-group.is-open .sidebar-nav-group__chev {
    transform: rotate(180deg);
}

.sidebar-nav-group__sub {
    display: none;
    flex-direction: column;
    gap: 2px;
    padding: 4px 0 2px 8px;
}

body:not(.sidebar-mini) .sidebar-nav-group.is-open .sidebar-nav-group__sub {
    display: flex;
}

.sidebar-nav__item--sub {
    padding: 8px 12px 8px 10px;
    font-size: calc(var(--fs-nav) - 1px);
    gap: 14px;
}

.sidebar-nav__item--sub .sidebar-nav__icon {
    width: 18px;
    height: 18px;
}

body.sidebar-mini .sidebar-nav-group__toggle {
    display: none;
}

body.sidebar-mini .sidebar-nav-group__row {
    width: 100%;
}

body.sidebar-mini .sidebar-nav__item--workspace-shell {
    width: 100%;
}

body.sidebar-mini .sidebar-nav__item--workspace-shell .sidebar-nav__item-text-stack {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

body.sidebar-mini .sidebar-nav__item--workspace-shell .sidebar-nav__item-hit {
    justify-content: center;
}

body.sidebar-mini .sidebar-nav-group__sub {
    position: absolute;
    left: calc(100% + 8px);
    top: 0;
    margin: 0;
    padding: 6px;
    min-width: 188px;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    z-index: 620;
    display: none;
}

/* Hover köprüsü: imleç kenar boşluğundan kayınca menü kapanmasın */
body.sidebar-mini .sidebar-nav-group__sub::before {
    content: '';
    position: absolute;
    right: 100%;
    top: 0;
    bottom: 0;
    width: 12px;
}

body[data-sidebar-position="right"].sidebar-mini .sidebar-nav-group__sub {
    left: auto;
    right: 100%;
    margin-right: 8px;
}

body[data-sidebar-position="right"].sidebar-mini .sidebar-nav-group__sub::before {
    right: auto;
    left: 100%;
}

body.sidebar-mini .sidebar-nav-group:hover .sidebar-nav-group__sub,
body.sidebar-mini .sidebar-nav-group:focus-within .sidebar-nav-group__sub {
    display: flex;
}

body.sidebar-mini .sidebar-nav-group__sub .sidebar-nav__item {
    justify-content: flex-start;
    width: 100%;
    padding: 9px 12px;
    gap: 14px;
}

body.sidebar-mini .sidebar-nav-group__sub .sidebar-nav__item > span {
    position: static;
    width: auto;
    height: auto;
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: nowrap;
    border: 0;
    padding: 0;
}

@media (prefers-reduced-motion: reduce) {
    .sidebar-nav-group__chev {
        transition: none;
    }
}

.sidebar-footer {
    padding-top: 12px;
}

.sidebar-footer form {
    margin: 0;
}

.sidebar-nav__item--logout {
    color: var(--text-tertiary);
}

/* Çıkış: kırmızı akan border; 300% genişlik + üç özdeş segment → 0→100% kaydırma döngüde kesilmez */
#sidebarAuthBtn.sidebar-nav__item--logout:hover {
    color: #e11d48;
    background:
        linear-gradient(#fff5f5, #fff5f5) padding-box,
        linear-gradient(
            90deg,
            #ffe4e6,
            #fecdd3,
            #fda4af,
            #fb7185,
            #fda4af,
            #fecdd3,
            #ffe4e6,
            #ffe4e6,
            #fecdd3,
            #fda4af,
            #fb7185,
            #fda4af,
            #fecdd3,
            #ffe4e6,
            #ffe4e6,
            #fecdd3,
            #fda4af,
            #fb7185,
            #fda4af,
            #fecdd3,
            #ffe4e6
        ) border-box;
    background-size: auto, 300% 100%;
    background-clip: padding-box, border-box;
    animation: sidebar-auth-border-flow 2.5s linear infinite;
}

@keyframes sidebar-auth-border-flow {
    0% { background-position: 0 0, 0 0; }
    100% { background-position: 0 0, 100% 0; }
}

html[data-theme="dark"] #sidebarAuthBtn.sidebar-nav__item--logout:hover {
    color: #fda4af;
    background:
        linear-gradient(#26161a, #26161a) padding-box,
        linear-gradient(
            90deg,
            #3b141c,
            #4c1d24,
            #5c1f27,
            #7f1d1d,
            #9f1239,
            #be123c,
            #e11d48,
            #fb7185,
            #e11d48,
            #be123c,
            #9f1239,
            #7f1d1d,
            #5c1f27,
            #4c1d24,
            #3b141c,
            #3b141c,
            #4c1d24,
            #5c1f27,
            #7f1d1d,
            #9f1239,
            #be123c,
            #e11d48,
            #fb7185,
            #e11d48,
            #be123c,
            #9f1239,
            #7f1d1d,
            #5c1f27,
            #4c1d24,
            #3b141c,
            #3b141c,
            #4c1d24,
            #5c1f27,
            #7f1d1d,
            #9f1239,
            #be123c,
            #e11d48,
            #fb7185,
            #e11d48,
            #be123c,
            #9f1239,
            #7f1d1d,
            #5c1f27,
            #4c1d24,
            #3b141c
        ) border-box;
    background-size: auto, 300% 100%;
    background-clip: padding-box, border-box;
    animation: sidebar-auth-border-flow 2.5s linear infinite;
}

.main-content {
    position: relative;
    z-index: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    height: 100%;
    overflow: hidden;
    margin: 0;
    padding: 0;
}

.main-content > .layout-flash {
    margin-left: var(--page-inline-gutter);
    margin-right: var(--page-inline-gutter);
    max-width: 100%;
    box-sizing: border-box;
    flex-shrink: 0;
}

.layout-flash {
    margin-top: 12px;
    margin-bottom: 16px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: var(--fs-input);
    font-weight: 500;
    line-height: 1.45;
    border: 1px solid transparent;
    animation: nf-flash-enter 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.layout-flash--status {
    background: var(--primary-lighter);
    color: var(--text-primary);
    border-color: rgba(124, 92, 252, 0.15);
}

.layout-flash--error {
    background: #fef2f2;
    border-color: #fecaca;
    color: #b91c1c;
    font-size: var(--fs-body-sm);
    font-weight: 500;
}

.layout-flash__list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.layout-flash__list li + li {
    margin-top: 6px;
}

@keyframes nf-flash-enter {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .layout-flash,
    .auth-info-banner,
    .auth-inline-success,
    .auth-error-message,
    .auth-match-hint--ok,
    .auth-match-hint--bad {
        animation: none !important;
    }
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 16px;
    height: var(--topbar-height);
    padding: 0 var(--page-inline-gutter);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.topbar__search-wrap {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
    max-width: none;
}

.topbar__search {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-width: 0;
    max-width: none;
}

.topbar__search-icon {
    width: 18px;
    height: 18px;
    color: var(--text-tertiary);
    flex-shrink: 0;
}

.topbar__search-input {
    width: 100%;
    font-size: var(--fs-input);
    color: var(--text-primary);
}

.topbar__search-input::placeholder {
    color: var(--text-tertiary);
    font-weight: 400;
}

.topbar__search-input:focus::placeholder {
    color: var(--border);
}

/* Hızlı arama öneri paneli (topbar) */
/* [hidden] + display:flex: sınıf aksi halde native gizlemeyi ezer; kapalıyken gizle */
.search-suggest[hidden] {
    display: none !important;
}

.search-suggest {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 200;
    margin-top: 6px;
    max-height: min(60vh, 360px);
    display: flex;
    flex-direction: column;
    border-radius: var(--radius-md);
    background: var(--bg-panel);
    border: 1px solid var(--border);
    box-shadow:
        0 0 0 1px color-mix(in srgb, var(--text-primary) 4%, transparent),
        0 16px 40px color-mix(in srgb, var(--text-primary) 12%, transparent);
    overflow: hidden;
}

.search-suggest__scroller {
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    padding: 4px 0;
    max-height: min(50vh, 300px);
}

.search-suggest__item {
    display: block;
    padding: 10px 14px;
    font-size: var(--fs-input);
    font-weight: 500;
    color: var(--text-primary);
    text-decoration: none;
    line-height: 1.35;
    border-radius: 0;
    min-height: 44px;
    box-sizing: border-box;
}

.search-suggest__item:hover,
.search-suggest__item:focus-visible {
    background: var(--bg-hover);
    outline: none;
}

.search-suggest__state {
    margin: 0;
    padding: 14px 16px;
    font-size: var(--fs-body-sm);
    color: var(--text-secondary);
    line-height: 1.45;
}

.search-suggest__state--err {
    color: var(--danger, #b91c1c);
}

.search-suggest__all {
    display: block;
    padding: 10px 14px 12px;
    font-size: var(--fs-body-sm);
    font-weight: 600;
    color: var(--primary);
    text-align: center;
    text-decoration: none;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
    min-height: 44px;
    box-sizing: border-box;
}

.search-suggest__all:hover,
.search-suggest__all:focus-visible {
    background: var(--bg-hover);
    outline: none;
}

.search-suggest--mobile {
    position: relative;
    top: 0;
    left: 0;
    right: 0;
    margin-top: 0;
    z-index: 1;
    max-height: min(50vh, 400px);
}

.search-suggest--mobile .search-suggest__scroller {
    max-height: min(40vh, 320px);
}

.topbar__actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    margin-left: auto;
}

/* Üst çubuk: dil kutusu içeriğe sığsın, açılır menü TR düğmesine hizalansın */
.topbar .topbar__actions > .lang-dropdown {
    display: inline-flex;
    flex-direction: column;
    flex: 0 0 auto;
    width: auto;
    max-width: 100%;
    min-width: 0;
    align-items: stretch;
}

.lang-dropdown {
    position: relative;
}

.lang-dropdown__flag {
    display: flex;
    align-items: center;
    width: 26px;
    justify-content: center;
}

.lang-dropdown__flag .lang-flag {
    width: 24px;
    height: 18px;
    border-radius: 4px;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06);
}

.lang-dropdown__code {
    min-width: 22px;
    letter-spacing: 0.04em;
}

.lang-dropdown__menu {
    left: auto;
    right: 0;
    min-width: 220px;
}

.topbar__theme-btn {
    position: relative;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
    transition: background 0.2s ease, color 0.2s ease;
}

.topbar__theme-btn:hover {
    background: var(--primary-lighter);
}

.topbar__theme-icon {
    width: 20px;
    height: 20px;
    color: var(--text-secondary);
}

.topbar__theme-btn:hover .topbar__theme-icon {
    color: var(--primary);
}

.topbar__theme-icon--sun {
    display: none;
}

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

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

.topbar__notification-wrap {
    position: relative;
}

.topbar__notification {
    position: relative;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.topbar__notification svg {
    width: 20px;
    height: 20px;
    color: var(--text-secondary);
}

.topbar__notification:hover {
    background: var(--primary-lighter);
}

.topbar__notification:hover svg {
    color: var(--primary);
}

.topbar__notification-dot {
    position: absolute;
    top: 9px;
    right: 10px;
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    border: 2px solid var(--bg-panel);
    box-sizing: border-box;
}

@keyframes topbar-notif-bell-swing {
    0% {
        transform: rotate(0deg);
    }
    12% {
        transform: rotate(16deg);
    }
    28% {
        transform: rotate(-14deg);
    }
    44% {
        transform: rotate(10deg);
    }
    60% {
        transform: rotate(-6deg);
    }
    76% {
        transform: rotate(3deg);
    }
    100% {
        transform: rotate(0deg);
    }
}

@keyframes topbar-notif-dot-pulse {
    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 color-mix(in srgb, var(--primary) 55%, transparent);
    }
    45% {
        transform: scale(1.12);
        box-shadow: 0 0 0 6px color-mix(in srgb, var(--primary) 0%, transparent);
    }
}

.topbar__notification-wrap--new .topbar__notification > svg {
    transform-origin: 12px 5px;
    animation: topbar-notif-bell-swing 1.15s ease-in-out 1;
}

.topbar__notification-wrap--new .topbar__notification-dot {
    animation: topbar-notif-dot-pulse 0.9s ease-out 2;
}

@media (prefers-reduced-motion: reduce) {
    .topbar__notification-wrap--new .topbar__notification > svg,
    .topbar__notification-wrap--new .topbar__notification-dot {
        animation: none !important;
    }
}

.topbar__user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 6px 6px 14px;
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: all 0.2s ease;
}

.topbar__user:hover {
    background: var(--primary-lighter);
}

.topbar__user-name {
    font-size: var(--fs-input);
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
}

.topbar__user-chevron {
    width: 16px;
    height: 16px;
    color: var(--text-tertiary);
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.topbar__user-wrap:has(> .topbar__user-menu.is-open) .topbar__user-chevron {
    transform: rotate(180deg);
}

.topbar__avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--text-inverse);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--fs-body-sm);
    font-weight: 600;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.topbar__auth-guest {
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar__email-login {
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
    white-space: nowrap;
}

.topbar__guest-hint {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-tertiary);
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    background: var(--bg-hover);
}

.topbar__btn-login {
    padding: 8px 16px;
    font-size: 13px;
    white-space: nowrap;
}

.btn--google-signin {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.btn--google-signin .google-g-logo {
    flex-shrink: 0;
    display: block;
}

.topbar__notif-panel {
    left: auto;
    right: 0;
    min-width: 300px;
    max-width: min(360px, 92vw);
    max-height: 380px;
    display: flex;
    flex-direction: column;
    padding: 0;
    text-align: left;
}

.topbar__notif-head {
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border);
}

.topbar__notif-body {
    max-height: 320px;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 8px 6px;
    overscroll-behavior: contain;
}

.topbar__notif-section {
    margin-bottom: 12px;
}

.topbar__notif-section:last-child {
    margin-bottom: 0;
}

.topbar__notif-section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-tertiary);
    padding: 4px 10px 8px;
}

.topbar__notif-subl {
    font-size: 12px;
    color: var(--text-tertiary);
    padding: 8px 12px 10px;
}

.topbar__notif-empty {
    padding: 20px 16px;
    font-size: 13px;
    color: var(--text-tertiary);
    text-align: center;
}

.topbar__notif-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: inherit;
    transition: background 0.15s ease;
}

.topbar__notif-item:hover {
    background: var(--primary-lighter);
}

.topbar__notif-item-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    word-break: break-word;
    max-width: 100%;
}

.topbar__notif-item-meta {
    font-size: 12px;
    color: var(--text-tertiary);
}

.topbar__notif-footer-row {
    display: flex;
    border-top: 1px solid var(--border);
}

.topbar__notif-footer-link {
    flex: 1;
    padding: 10px 12px;
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
    text-align: center;
    border-right: 1px solid var(--border);
    transition: background 0.15s ease;
}

.topbar__notif-footer-link:last-child {
    border-right: none;
}

.topbar__notif-footer-link:hover {
    background: var(--primary-lighter);
}

.topbar__user-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    border-radius: var(--radius-md);
    border: 2px solid transparent;
    background:
        linear-gradient(var(--bg-panel), var(--bg-panel)) padding-box,
        linear-gradient(
            90deg,
            var(--primary),
            #9b7efd,
            #c4b5fd,
            #ede9fe,
            var(--primary),
            #9b7efd,
            #c4b5fd,
            #ede9fe,
            var(--primary)
        ) border-box;
    background-size: auto, 200% 100%;
    background-clip: padding-box, border-box;
    animation: note-pinned-border-flow var(--note-border-flow-duration) linear infinite;
}

.topbar__user.topbar__user--authed {
    gap: 8px;
    min-height: 44px;
    padding: 4px 10px 4px 12px;
    border: none;
    border-radius: calc(var(--radius-md) - 2px);
    background: var(--bg-panel);
    font: inherit;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.topbar__user.topbar__user--authed:hover {
    color: var(--text-primary);
    box-shadow: none;
    background: var(--primary-lighter);
}

.topbar__user-wrap:has(> .topbar__user-menu.is-open) .topbar__user--authed {
    box-shadow: none;
    background: var(--primary-lighter);
}

.topbar__user-photo {
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid var(--border);
}

.topbar__user-menu {
    left: auto;
    right: 0;
    min-width: min(280px, calc(100vw - 24px));
    max-width: min(320px, calc(100vw - 24px));
    box-sizing: border-box;
}

.topbar__user-menu .dropdown-menu__item {
    text-decoration: none;
    border: none;
    background: transparent;
    font: inherit;
    cursor: pointer;
    white-space: normal;
    overflow-wrap: break-word;
    word-break: normal;
    line-height: 1.35;
    padding: 10px 14px;
}

.topbar__user-menu .dropdown-menu__item.is-active {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
}

.topbar__user-menu .dropdown-menu__item.is-active:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.topbar__user-menu .inline-form {
    margin: 0;
    display: block;
}

.topbar__user-menu .inline-form .dropdown-menu__item {
    width: 100%;
}

.topbar__user-menu .dropdown-menu__item--danger {
    color: #dc2626;
}

.note-detail__body--rich blockquote {
    margin: 1em 0;
    padding: 14px 16px;
    border-left: 4px solid rgba(124, 92, 252, 0.35);
    border-radius: 12px;
    background: rgba(124, 92, 252, 0.05);
}

.note-detail__body--rich pre {
    margin: 1em 0;
    padding: 14px 16px;
    overflow: auto;
    border-radius: 14px;
    background: #111827;
    color: #f8fafc;
}

.note-detail__body--rich table {
    width: 100%;
    margin: 1em 0;
    border-collapse: collapse;
}

.note-detail__body--rich td,
.note-detail__body--rich th {
    border: 1px solid var(--border);
    padding: 10px 12px;
    text-align: left;
}

.note-detail__body--rich mark {
    background: #fef3c7;
    color: #854d0e;
    border-radius: 6px;
    padding: 0 3px;
}
.topbar__user-menu .dropdown-menu__item--danger:hover {
    background: #fef2f2;
    color: #b91c1c;
}

.dashboard-welcome {
    margin-top: -12px;
    margin-bottom: 20px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    background: var(--primary-lighter);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    border: 1px solid rgba(124, 92, 252, 0.15);
}

.auth-modal__body {
    max-width: 440px;
}

.auth-modal__lead {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.55;
    margin-bottom: 20px;
}

.auth-modal__gis {
    min-height: 44px;
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.auth-modal__hint {
    font-size: 13px;
    color: var(--text-tertiary);
    margin: 0;
    line-height: 1.45;
}

.auth-modal__demo-hint {
    font-size: 12px;
    color: var(--text-tertiary);
    margin: 0 0 8px;
}

.btn--block {
    width: 100%;
    justify-content: center;
}

.settings-panel__lead {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: -8px 0 20px;
}

.account-linked-rows {
    margin-bottom: 8px;
}

.account-card {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    padding: 16px;
    border-radius: var(--radius-md);
    background: var(--bg-hover);
    border: 1px solid var(--border);
}

.account-card__avatar-wrap {
    flex-shrink: 0;
}

.account-card__avatar {
    border-radius: var(--radius-md);
    object-fit: cover;
    border: 1px solid var(--border);
}

.account-card__dl {
    margin: 0;
    flex: 1;
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(100px, 140px) 1fr;
    gap: 8px 16px;
    font-size: 13px;
}

.account-card__dl dt {
    color: var(--text-tertiary);
    font-weight: 500;
}

.account-card__dl dd {
    margin: 0;
    color: var(--text-primary);
    font-weight: 500;
    word-break: break-word;
}

.account-card__token {
    font-family: ui-monospace, monospace;
    font-size: 12px;
    font-weight: 400;
    color: var(--text-secondary);
}

.account-panel__actions {
    margin-top: 20px;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: flex-start;
}

@media (max-width: 960px) {
    .topbar {
        height: auto;
        min-height: var(--topbar-height);
        flex-wrap: wrap;
        padding: 12px 20px;
        gap: 12px;
    }

    .topbar__search {
        order: 3;
        flex: 1 1 100%;
        max-width: none;
    }

    .topbar__actions {
        flex-wrap: wrap;
        justify-content: flex-end;
        gap: 12px;
        margin-left: auto;
    }

    .topbar__actions .topbar-workspace-switcher {
        flex: 1 1 100%;
    }

    .topbar__btn-login span {
        white-space: normal;
        text-align: center;
    }

    .auth-modal__body {
        max-width: none;
    }

    .account-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .account-card__dl {
        grid-template-columns: 1fr;
        text-align: left;
        width: 100%;
    }
}

.page-content {
    flex: 1;
    min-height: 0;
    padding: 28px var(--page-inline-gutter) 36px;
    overflow-y: auto;
    overflow-x: hidden;
}

@media (min-width: 721px) {
    :root {
        --page-inline-gutter: 32px;
    }
}

.page-title {
    font-size: var(--fs-title-page);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 24px;
    letter-spacing: -0.3px;
}

.page-lead {
    margin: -12px 0 20px;
    max-width: 52rem;
    font-size: 0.95rem;
    line-height: 1.55;
    color: var(--text-secondary);
}

.page-lead--dashboard {
    margin-top: -16px;
}

.filters-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.filters-bar__search {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-panel);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0 16px;
    height: 44px;
    transition: border-color 0.2s ease;
}

.filters-bar__search:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(124, 92, 252, 0.1);
}

.filters-bar__search-icon {
    width: 18px;
    height: 18px;
    color: var(--text-tertiary);
    flex-shrink: 0;
}

.filters-bar__search-input {
    width: 100%;
    height: 100%;
    font-size: var(--fs-input);
}

.filters-bar__search-input::placeholder {
    color: var(--text-tertiary);
}

.filters-bar__dropdown {
    position: relative;
}

.filters-bar__dropdown-btn,
.lang-dropdown__trigger,
.notes-toolbar__sort-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 44px;
    padding: 0 14px;
    background: var(--bg-panel);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    font-size: var(--fs-input);
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
    transition: all 0.2s ease;
    cursor: pointer;
    font: inherit;
}

.lang-dropdown__trigger {
    font-size: 0.8125rem;
    font-weight: 500;
}

.filters-bar__dropdown-btn:hover,
.lang-dropdown__trigger:hover,
.notes-toolbar__sort-btn:hover {
    border-color: var(--primary);
    color: var(--text-primary);
    box-shadow: 0 0 0 3px rgba(124, 92, 252, 0.1);
}

.filters-bar__dropdown.is-open .filters-bar__dropdown-btn,
.notes-toolbar__sort-dropdown.is-open .notes-toolbar__sort-btn,
.lang-dropdown:has(> .lang-dropdown__menu.is-open) .lang-dropdown__trigger {
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 0 0 3px rgba(124, 92, 252, 0.1);
}

.filters-bar__dropdown-chevron,
.lang-dropdown__chevron,
.notes-toolbar__sort-chevron {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: var(--text-tertiary);
    transition: transform 0.2s ease;
}

.filters-bar__dropdown-btn > span:first-of-type,
.lang-dropdown__trigger > span:first-of-type,
.notes-toolbar__sort-btn > span:first-of-type {
    flex: 1 1 auto;
    min-width: 0;
    text-align: left;
}

.filters-bar__dropdown.is-open .filters-bar__dropdown-chevron,
.notes-toolbar__sort-dropdown.is-open .notes-toolbar__sort-chevron,
.lang-dropdown:has(> .lang-dropdown__menu.is-open) .lang-dropdown__chevron {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 100%;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    padding: 6px;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: all 0.15s ease;
}

.dropdown-menu--right {
    left: auto;
    right: 0;
}

.filters-bar__dropdown.is-open .dropdown-menu,
.notes-toolbar__sort-dropdown.is-open .dropdown-menu,
.lang-dropdown > .lang-dropdown__menu.dropdown-menu.is-open,
.topbar__user-menu.dropdown-menu.is-open,
.topbar__notif-panel.dropdown-menu.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.topbar__notification-wrap > .topbar__notif-panel.dropdown-menu {
    min-width: min(300px, calc(100vw - 32px));
    width: min(300px, calc(100vw - 32px));
    max-width: min(380px, calc(100vw - 24px));
    box-sizing: border-box;
    padding: 0;
    left: auto;
    right: 0;
}

.lang-dropdown > .lang-dropdown__menu.dropdown-menu {
    /* Override .dropdown-menu { left: 0 } so the menu aligns to the trigger’s right edge and does not clip off-screen */
    left: auto;
    right: 0;
    min-width: 220px;
    width: max-content;
    max-width: min(300px, calc(100vw - 24px));
    box-sizing: border-box;
}

/* Üst çubuk: tetikleyicinin solundan aç (auth’taki right hizası aynı kalsın) */
.topbar .topbar__actions > .lang-dropdown > .lang-dropdown__menu.dropdown-menu {
    left: 0;
    right: auto;
}

.dropdown-menu__item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: var(--fs-body-sm);
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.15s ease;
    white-space: nowrap;
}

.dropdown-menu__item:hover {
    background: var(--primary-lighter);
    color: var(--primary);
}

.dropdown-menu__item.is-active {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
}

.lang-dropdown__menu .dropdown-menu__item.lang-dropdown__option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 8px;
    min-height: 44px;
    box-sizing: border-box;
    width: 100%;
    border: none;
    background: transparent;
    font: inherit;
    cursor: pointer;
    text-align: left;
}

.lang-dropdown__menu .dropdown-menu__item.lang-dropdown__option .lang-flag {
    display: block;
    flex-shrink: 0;
    width: 24px;
    height: 18px;
    border-radius: 4px;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.lang-dropdown__menu .dropdown-menu__item.lang-dropdown__option > span {
    flex: 1;
    min-width: 0;
    line-height: 1.4;
    font-size: 12px;
    font-weight: 500;
}

.lang-dropdown__menu .dropdown-menu__item.lang-dropdown__option.is-active > span {
    font-weight: 600;
}

.filters-bar__filter-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 44px;
    padding: 0 16px;
    background: var(--bg-panel);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
    transition: all 0.2s ease;
}

.filters-bar__filter-btn:hover {
    border-color: var(--primary);
    color: var(--text-primary);
}

.filters-bar__filter-icon {
    width: 16px;
    height: 16px;
}

.filters-bar__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    background: var(--primary);
    color: var(--text-inverse);
    border-radius: 50%;
    font-size: 11px;
    font-weight: 700;
    padding: 0 5px;
}

.filter-chips {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px 6px 10px;
    background: var(--primary-lighter);
    border: 1px solid var(--primary-light);
    border-radius: var(--radius-pill);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    transition: all 0.2s ease;
    cursor: default;
}

.chip:hover {
    background: var(--primary-light);
    border-color: var(--primary);
}

.chip__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    transition: all 0.15s ease;
    color: var(--text-tertiary);
}

.chip__close svg {
    width: 10px;
    height: 10px;
}

.chip__close:hover {
    background: var(--primary);
    color: var(--text-inverse);
}

.chip.is-removing {
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.2s ease;
}

.filter-chips__clear {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-tertiary);
    padding: 6px 8px;
    transition: color 0.2s ease;
}

.filter-chips__clear:hover {
    color: var(--primary);
}

.notes-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 12px 20px;
    margin-bottom: 16px;
    padding: 0 2px;
}

.notes-toolbar__count {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
    flex: 0 1 auto;
    min-width: 0;
    padding-right: 4px;
}

.notes-toolbar__count strong {
    color: var(--primary);
    font-weight: 700;
}

.notes-toolbar__sort {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
    flex-shrink: 0;
}

.notes-toolbar__sort-label {
    font-size: 13px;
    color: var(--text-tertiary);
    font-weight: 500;
}

.notes-toolbar__sort-dropdown {
    position: relative;
}

.notes-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.note-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: var(--bg-panel);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.note-card:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-1px);
}

.note-card.is-selected {
    border-color: var(--primary);
    background: var(--primary-lighter);
    box-shadow: 0 0 0 3px rgba(124, 92, 252, 0.08), var(--shadow-card);
    padding-right: 64px;
}

.note-card.note-card--pinned {
    border: 2px solid transparent;
    background:
        linear-gradient(var(--bg-panel), var(--bg-panel)) padding-box,
        linear-gradient(
            90deg,
            var(--primary),
            #9b7efd,
            #c4b5fd,
            #ede9fe,
            var(--primary),
            #9b7efd,
            #c4b5fd,
            #ede9fe,
            var(--primary)
        ) border-box;
    background-size: auto, 200% 100%;
    background-clip: padding-box, border-box;
    animation: note-pinned-border-flow var(--note-border-flow-duration) linear infinite;
}

.note-card.note-card--pinned:hover {
    border-color: transparent;
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-1px);
}

@keyframes note-pinned-border-flow {
    0% { background-position: 0 0, 0 0; }
    100% { background-position: 0 0, 100% 0; }
}

@keyframes note-scrollbar-border-flow {
    0% { background-position: 0 0, 0 0; }
    100% { background-position: 0 0, 0 100%; }
}

@media (prefers-reduced-motion: reduce) {
    .note-card.note-card--pinned {
        animation: none;
        border-color: var(--primary);
        background: var(--bg-panel);
        background-size: auto;
    }

    .sidebar-nav__item:hover:not(.is-active),
    .sidebar-nav__item.is-active:hover,
    .dashboard-stat-card:hover {
        animation: none;
        background: var(--bg-hover);
        background-size: auto;
        border-color: var(--primary);
    }

    .sidebar-nav__item.is-active:hover {
        background: var(--primary);
        border-color: #c4b5fd;
    }

    .settings-page-sidebar__btn:hover:not(.is-active) {
        animation: none;
        background: var(--bg-hover);
        background-size: auto;
        border-color: var(--primary);
    }

    .settings-page-sidebar__btn.is-active:hover {
        animation: none;
        background: var(--primary);
        border-color: #c4b5fd;
    }

    .workspace-settings-sidebar__link:hover:not(.is-active) {
        animation: none;
        background: var(--bg-hover);
        background-size: auto;
        border-color: var(--primary);
    }

    .workspace-settings-sidebar__link.is-active:hover {
        animation: none;
        background: var(--primary);
        border-color: #c4b5fd;
    }

    .note-action-btn--active,
    .note-action-btn--active:hover {
        animation: none;
        background: var(--primary);
        background-size: auto;
        border-color: #c4b5fd;
        box-shadow: 0 4px 12px rgba(124, 92, 252, 0.3);
    }

    #sidebarAuthBtn.sidebar-nav__item--logout:hover {
        animation: none;
        background: #fff5f5;
        border-color: #fb7185;
        background-size: auto;
    }

    html[data-theme="dark"] #sidebarAuthBtn.sidebar-nav__item--logout:hover {
        animation: none;
        background: #26161a;
        border-color: #e11d48;
        color: #fda4af;
        background-size: auto;
    }

    .topbar__user-wrap {
        animation: none;
        border-color: var(--primary);
        background: var(--bg-panel);
        background-size: auto;
    }

    html::-webkit-scrollbar-thumb,
    .page-content::-webkit-scrollbar-thumb,
    .sidebar::-webkit-scrollbar-thumb,
    .sidebar__body::-webkit-scrollbar-thumb,
    .topbar__notif-body::-webkit-scrollbar-thumb,
    .modal::-webkit-scrollbar-thumb {
        animation: none;
        background: var(--primary);
        background-size: auto;
        border-color: transparent;
    }
}

.note-card__icon {
    width: 46px;
    height: 46px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.note-card__media {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.note-card__preview-list {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.note-card__preview {
    width: 46px;
    height: 46px;
    border-radius: var(--radius-md);
    overflow: hidden;
    flex-shrink: 0;
    border: 1px solid var(--border-light);
    background: var(--bg-secondary);
    padding: 0;
    cursor: pointer;
    appearance: none;
}

.note-card__preview img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.note-card__preview-pdf {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: var(--primary);
    background: linear-gradient(180deg, #ffffff, #f8fafc);
}

.note-card__preview-pdf svg {
    width: 18px;
    height: 18px;
}

.note-card__preview-pdf span {
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.06em;
}

.note-card__icon svg {
    width: 22px;
    height: 22px;
}

.note-card__icon.accent-purple,
.note-row__icon.accent-purple {
    background: var(--accent-purple-bg);
    color: var(--accent-purple-text);
}

.note-card__icon.accent-blue,
.note-row__icon.accent-blue {
    background: var(--accent-blue-bg);
    color: var(--accent-blue-text);
}

.note-card__icon.accent-orange,
.note-row__icon.accent-orange {
    background: var(--accent-orange-bg);
    color: var(--accent-orange-text);
}

.note-card__icon.accent-green,
.note-row__icon.accent-green {
    background: var(--accent-green-bg);
    color: var(--accent-green-text);
}

.note-card__icon.accent-pink,
.note-row__icon.accent-pink {
    background: var(--accent-pink-bg);
    color: var(--accent-pink-text);
}

.note-card__icon.accent-teal,
.note-row__icon.accent-teal {
    background: var(--accent-teal-bg);
    color: var(--accent-teal-text);
}

.note-card__icon.accent-indigo,
.note-row__icon.accent-indigo {
    background: var(--accent-indigo-bg);
    color: var(--accent-indigo-text);
}

.note-card__icon.accent-amber,
.note-row__icon.accent-amber {
    background: var(--accent-amber-bg);
    color: var(--accent-amber-text);
}

.note-card__body {
    flex: 1;
    min-width: 0;
}

.note-card__header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}

.note-card__title {
    font-size: var(--fs-title-card);
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.note-card__meta {
    font-size: var(--fs-body-sm);
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.note-card__right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
    white-space: nowrap;
}

.note-card__status {
    font-size: var(--fs-input);
    font-weight: 600;
    color: var(--primary);
}

.note-card__time {
    font-size: var(--fs-body-sm);
    color: var(--text-tertiary);
}

.note-card__action {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--text-inverse);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(124, 92, 252, 0.35);
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

.note-card__action svg {
    width: 16px;
    height: 16px;
}

.note-card.is-selected .note-card__action {
    opacity: 1;
    visibility: visible;
}

.note-card__action:hover {
    background: var(--primary-hover);
    transform: translateY(-50%) scale(1.08);
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: var(--radius-pill);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.2px;
    white-space: nowrap;
    flex-shrink: 0;
}

.badge--pinned {
    background: var(--primary);
    color: var(--text-inverse);
}

.badge--shared {
    background: var(--accent-teal-bg);
    color: var(--accent-teal-text);
}

.badge--draft {
    background: var(--accent-amber-bg);
    color: var(--accent-amber-text);
}

.badge--private {
    background: #374151;
    color: var(--text-inverse);
}

.badge--meeting {
    background: var(--accent-blue-bg);
    color: var(--accent-blue-text);
}

.badge--design {
    background: var(--accent-orange-bg);
    color: var(--accent-orange-text);
}

.badge--planning {
    background: var(--accent-green-bg);
    color: var(--accent-green-text);
}

html,
.page-content,
.sidebar,
.sidebar__body,
.topbar__notif-body,
.modal {
    scrollbar-width: thin;
    scrollbar-color: var(--primary) transparent;
}

html::-webkit-scrollbar,
.page-content::-webkit-scrollbar,
.sidebar::-webkit-scrollbar,
.sidebar__body::-webkit-scrollbar,
.topbar__notif-body::-webkit-scrollbar,
.modal::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}

html::-webkit-scrollbar-track,
.page-content::-webkit-scrollbar-track,
.sidebar::-webkit-scrollbar-track,
.sidebar__body::-webkit-scrollbar-track,
.topbar__notif-body::-webkit-scrollbar-track,
.modal::-webkit-scrollbar-track {
    background: transparent;
}

html::-webkit-scrollbar-thumb,
.page-content::-webkit-scrollbar-thumb,
.sidebar::-webkit-scrollbar-thumb,
.sidebar__body::-webkit-scrollbar-thumb,
.topbar__notif-body::-webkit-scrollbar-thumb,
.modal::-webkit-scrollbar-thumb {
    border-radius: 99px;
    border: 1px solid transparent;
    background:
        linear-gradient(transparent, transparent) padding-box,
        linear-gradient(
            180deg,
            var(--primary),
            #9b7efd,
            #c4b5fd,
            #ede9fe,
            var(--primary),
            #9b7efd,
            #c4b5fd,
            #ede9fe,
            var(--primary)
        ) border-box;
    background-size: auto, 100% 200%;
    background-clip: padding-box, border-box;
    animation: note-scrollbar-border-flow var(--note-border-flow-duration) linear infinite;
}

.sidebar-nav__item,
.chip,
.note-card,
.lang-dropdown__trigger,
.topbar__theme-btn,
.topbar__notification,
.topbar__user,
.topbar__user--authed,
.topbar__btn-login,
.filters-bar__dropdown-btn,
.filters-bar__filter-btn,
.notes-toolbar__sort-btn,
.view-toggle__btn,
.settings-page-sidebar__btn,
.workspace-settings-sidebar__link,
.reminder-card,
.tag-table__row,
.btn {
    transition: all 0.2s ease;
}

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 8px;
}

.page-header .page-title {
    margin-bottom: 0;
}

.page-header__actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.page-subtitle {
    font-size: var(--fs-input);
    color: var(--text-secondary);
    margin-top: 8px;
    margin-bottom: 24px;
    max-width: 640px;
    line-height: 1.55;
}

.page-header--dashboard {
    margin-bottom: 2px;
}

.page-subtitle--dashboard {
    margin-top: 6px;
    margin-bottom: 20px;
    max-width: 28rem;
    font-size: 0.9375rem;
    line-height: 1.45;
}

@media (max-width: 720px) {
    .page-header--dashboard .page-header__actions {
        width: 100%;
    }

    .page-header--dashboard .page-header__actions .btn {
        width: 100%;
        justify-content: center;
    }
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 40px;
    padding: 0 18px;
    border-radius: var(--radius-md);
    font-size: var(--fs-btn);
    font-weight: 600;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn--primary {
    background: var(--primary);
    color: var(--text-inverse);
    box-shadow: 0 2px 8px rgba(124, 92, 252, 0.25);
}

.btn--primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 4px 14px rgba(124, 92, 252, 0.35);
}

.btn--secondary {
    background: var(--bg-panel);
    border: 1.5px solid var(--border);
    color: var(--text-secondary);
}

.btn--secondary:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn--ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1.5px solid transparent;
}

.btn--ghost:hover {
    background: var(--primary-lighter);
    color: var(--primary);
}

.btn--danger {
    background: #fef2f2;
    color: #dc2626;
    border: 1.5px solid #fecaca;
}

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

.btn--sm {
    height: 34px;
    padding: 0 12px;
    font-size: var(--fs-btn-sm);
}

.btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.view-toggle {
    display: flex;
    align-items: center;
    background: var(--primary-lighter);
    border-radius: var(--radius-sm);
    padding: 3px;
    gap: 2px;
}

.view-toggle__btn {
    padding: 6px 14px;
    border-radius: var(--radius-xs);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.view-toggle__btn:hover {
    color: var(--primary);
}

.view-toggle__btn.is-active {
    background: var(--bg-panel);
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.notes-list--grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.notes-list--grid .note-card {
    flex-direction: column;
    align-items: flex-start;
    padding: 18px;
}

.notes-list--grid .note-card__right {
    align-items: flex-start;
    flex-direction: row;
    gap: 12px;
    width: 100%;
    margin-top: 8px;
}

.note-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 14px 20px;
    padding: 14px 18px;
    background: var(--bg-panel);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.note-row:hover,
.note-row:focus-within {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-card-hover);
    padding-right: max(240px, 14px);
}

.note-row.is-selected {
    border-color: var(--primary);
    background: var(--primary-lighter);
    box-shadow: 0 0 0 3px rgba(124, 92, 252, 0.08);
}

.note-row.note-row--pinned {
    border: 2px solid transparent;
    background:
        linear-gradient(var(--bg-panel), var(--bg-panel)) padding-box,
        linear-gradient(
            90deg,
            var(--primary),
            #9b7efd,
            #c4b5fd,
            #ede9fe,
            var(--primary),
            #9b7efd,
            #c4b5fd,
            #ede9fe,
            var(--primary)
        ) border-box;
    background-size: auto, 200% 100%;
    background-clip: padding-box, border-box;
    animation: note-pinned-border-flow var(--note-border-flow-duration) linear infinite;
}

.note-row.note-row--pinned:hover {
    border-color: transparent;
    box-shadow: var(--shadow-card-hover);
}

@media (prefers-reduced-motion: reduce) {
    .note-row.note-row--pinned {
        animation: none;
        border-color: var(--primary);
        background: var(--bg-panel);
        background-size: auto;
    }
}

.note-row__icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.note-row__icon svg {
    width: 18px;
    height: 18px;
}

.note-row__media {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    min-width: 0;
}

.note-row .note-card__preview {
    width: 40px;
    height: 40px;
}

.note-row .note-card__preview-pdf svg {
    width: 16px;
    height: 16px;
}

.note-row__body {
    min-width: 0;
}

.note-row__topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px 16px;
    min-width: 0;
}

.note-row__topline-main {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    flex: 1 1 0;
    min-width: 0;
}

.note-row__topline-main .note-row__header {
    width: 100%;
    min-width: 0;
}

.note-row__header {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    min-width: 0;
    margin-bottom: 0;
}

.note-row__title {
    flex: 1;
    min-width: 0;
    font-size: var(--fs-title-row);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0;
}

.note-row__title .note-row__title-link {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.note-row__tags {
    font-size: 12px;
    color: var(--text-tertiary);
    line-height: 1.35;
    max-width: 100%;
}

.note-row__meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
    white-space: nowrap;
    text-align: right;
}

.note-row__meta .badge {
    align-self: flex-end;
    margin-bottom: 2px;
}

.note-row__status {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
}

.note-row__time {
    font-size: 12px;
    color: var(--text-tertiary);
}

/* Çöp kutusu liste satırı: başlık solda, rozet+durum+zaman sağda; hover’da az boşluk */
.note-row--trash:hover,
.note-row--trash:focus-within {
    padding-right: 14px;
}

.note-row.note-row--pinned.note-row--trash:hover,
.note-row.note-row--pinned.note-row--trash:focus-within {
    padding-right: 14px;
}

.note-row--trash .note-row__header--title-only .note-row__title {
    flex: 1 1 0;
    min-width: 0;
}

.note-row--trash .note-row__trail {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px 10px;
    flex-shrink: 0;
    margin-left: auto;
    transition: margin-right 0.2s ease;
}

.note-row--trash:hover .note-row__trail,
.note-row--trash:focus-within .note-row__trail {
    margin-right: 72px;
}

@media (prefers-reduced-motion: reduce) {
    .note-row--trash .note-row__trail {
        transition: none;
    }
}

.note-row--trash .note-row__meta--trash-trail {
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    text-align: right;
    white-space: nowrap;
}

.note-row--trash .note-row__meta--trash-trail .note-row__status {
    line-height: 1.25;
}

.note-row--trash .note-row__meta--trash-trail .note-row__time {
    line-height: 1.25;
}

.notes-list--rows {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.note-card--favorite:not(.note-card--pinned) {
    border-color: var(--primary-light);
}

.note-card--favorite:not(.note-card--pinned):hover {
    border-color: var(--primary);
}

.archive-card__actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.note-card--archive {
    flex-wrap: nowrap;
}

.note-card--archive .note-card__right {
    margin-right: 8px;
}

.note-card--archive .archive-card__actions {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
}

.badge--favorite {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #b45309;
    border: 1px solid #fcd34d;
}

.badge--archived {
    background: var(--text-tertiary);
    color: var(--text-inverse);
}

.badge--upcoming {
    background: var(--primary-light);
    color: var(--primary);
}

.badge--done {
    background: var(--accent-green-bg);
    color: var(--accent-green-text);
}

.reminder-section {
    margin-bottom: 28px;
}

.reminder-section__title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 12px;
}

.reminder-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 18px;
    background: var(--bg-panel);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: 10px;
    transition: all 0.2s ease;
}

.reminder-card:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-card);
}

.reminder-card__icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: var(--primary-lighter);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.reminder-card__icon svg {
    width: 20px;
    height: 20px;
}

.reminder-card__body {
    flex: 1;
    min-width: 0;
}

.reminder-card__title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.reminder-card__note {
    font-size: 13px;
    color: var(--text-secondary);
}

.reminder-card__meta {
    text-align: right;
    flex-shrink: 0;
}

.reminder-card__date {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.reminder-card__time {
    font-size: 13px;
    color: var(--text-tertiary);
}

.reminder-card__badges {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
    margin-top: 6px;
    flex-wrap: wrap;
}

.tags-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.tags-toolbar__search {
    flex: 1;
    max-width: 320px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0 14px;
    height: 42px;
}

.tags-toolbar__search:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(124, 92, 252, 0.1);
}

.tags-popular {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}

.chip--tag-popular {
    cursor: pointer;
}

.tag-table {
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-panel);
}

.tag-table__body {
    display: flex;
    flex-direction: column;
}

.tag-table__head,
.tag-table__row {
    display: grid;
    grid-template-columns: 1fr 120px 100px 100px;
    align-items: center;
    gap: 16px;
    padding: 14px 20px;
}

.tag-table__muted {
    color: var(--text-tertiary);
    font-size: 14px;
}

.tag-table__head {
    background: var(--primary-lighter);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.tag-table__row {
    border-top: 1px solid var(--border);
    transition: background 0.15s ease;
}

.tag-table__row:hover {
    background: var(--bg-hover);
}

.tag-table__name {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 14px;
}

.tag-table__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.tag-table__dot--purple { background: var(--primary); }
.tag-table__dot--blue { background: var(--accent-blue-text); }
.tag-table__dot--green { background: var(--accent-green-text); }
.tag-table__dot--orange { background: var(--accent-orange-text); }
.tag-table__dot--pink { background: var(--accent-pink-text); }
.tag-table__dot--teal { background: var(--accent-teal-text); }
.tag-table__dot--indigo { background: var(--accent-indigo-text); }
.tag-table__dot--amber { background: var(--accent-amber-text); }

.tag-table__count {
    font-size: 14px;
    color: var(--text-secondary);
}

.tag-table__actions {
    display: flex;
    justify-content: flex-end;
}

.settings-page {
    display: flex;
    gap: 28px;
    align-items: flex-start;
}

.settings-sidebar-pos {
    margin: 0 0 20px;
    border: 0;
    padding: 0;
}

.settings-sidebar-pos__legend {
    margin-bottom: 8px;
}

.settings-sidebar-pos__sub {
    margin: 0 0 14px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-secondary);
}

.settings-sidebar-pos-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    max-width: 520px;
}

@media (max-width: 520px) {
    .settings-sidebar-pos-grid {
        grid-template-columns: 1fr;
        max-width: none;
    }
}

.settings-sidebar-pos__opt {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    margin: 0;
    cursor: pointer;
    padding: 14px 14px 12px;
    border-radius: var(--radius-lg);
    border: 1.5px solid var(--border);
    background:
        linear-gradient(165deg, color-mix(in srgb, var(--bg-panel) 88%, var(--primary) 4%) 0%, var(--bg-panel) 48%, var(--bg-hover) 100%);
    box-shadow: 0 1px 0 color-mix(in srgb, var(--text-primary) 4%, transparent);
    transition:
        border-color 0.2s ease,
        box-shadow 0.22s ease,
        background 0.22s ease,
        transform 0.18s ease;
}

.settings-sidebar-pos__opt:hover {
    border-color: color-mix(in srgb, var(--primary) 38%, var(--border));
    box-shadow:
        0 4px 18px color-mix(in srgb, var(--text-primary) 7%, transparent),
        0 1px 0 color-mix(in srgb, var(--text-primary) 5%, transparent);
}

.settings-sidebar-pos__opt:has(input:checked) {
    border-color: var(--primary);
    background:
        linear-gradient(165deg, var(--primary-lighter) 0%, color-mix(in srgb, var(--bg-panel) 92%, var(--primary) 6%) 55%, var(--bg-panel) 100%);
    box-shadow:
        0 0 0 3px rgba(124, 92, 252, 0.14),
        0 6px 20px color-mix(in srgb, var(--primary) 18%, transparent);
}

.settings-sidebar-pos__opt:has(input:focus-visible) {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

html[data-theme="dark"] .settings-sidebar-pos__opt:has(input:checked) {
    background: linear-gradient(
        165deg,
        rgba(124, 92, 252, 0.18) 0%,
        color-mix(in srgb, var(--bg-panel) 94%, var(--primary) 4%) 100%
    );
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--primary) 45%, transparent), 0 8px 28px rgba(0, 0, 0, 0.35);
}

.settings-sidebar-pos__opt input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Mini ekran şeması: menü şeridi (mor) + içerik alanı */
.settings-sidebar-pos__mock {
    display: flex;
    width: 100%;
    aspect-ratio: 5 / 3;
    max-height: 88px;
    padding: 4px;
    gap: 3px;
    box-sizing: border-box;
    border-radius: var(--radius-md);
    background: color-mix(in srgb, var(--bg-hover) 85%, var(--bg-panel));
    border: 1px solid color-mix(in srgb, var(--border) 80%, var(--text-primary) 3%);
    transition: background 0.2s ease, border-color 0.2s ease;
}

.settings-sidebar-pos__opt:hover .settings-sidebar-pos__mock,
.settings-sidebar-pos__opt:has(input:checked) .settings-sidebar-pos__mock {
    background: color-mix(in srgb, var(--bg-hover) 70%, var(--bg-panel));
    border-color: color-mix(in srgb, var(--primary) 25%, var(--border));
}

.settings-sidebar-pos__mock-nav {
    flex-shrink: 0;
    border-radius: 4px;
    background: linear-gradient(180deg, color-mix(in srgb, var(--primary) 88%, #fff) 0%, var(--primary) 100%);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 30%, transparent);
}

.settings-sidebar-pos__mock-main {
    flex: 1;
    min-width: 0;
    min-height: 0;
    border-radius: 4px;
    background: var(--bg-panel);
    border: 1px dashed color-mix(in srgb, var(--border) 90%, var(--text-tertiary) 15%);
    box-shadow: inset 0 1px 2px color-mix(in srgb, var(--text-primary) 4%, transparent);
}

/* Konum: sol / sağ / üst / alt */
.settings-sidebar-pos__opt[data-sidebar-pos='left'] .settings-sidebar-pos__mock {
    flex-direction: row;
    align-items: stretch;
}

.settings-sidebar-pos__opt[data-sidebar-pos='left'] .settings-sidebar-pos__mock-nav {
    width: 32%;
    height: auto;
}

.settings-sidebar-pos__opt[data-sidebar-pos='right'] .settings-sidebar-pos__mock {
    flex-direction: row-reverse;
    align-items: stretch;
}

.settings-sidebar-pos__opt[data-sidebar-pos='right'] .settings-sidebar-pos__mock-nav {
    width: 32%;
    height: auto;
}

.settings-sidebar-pos__opt[data-sidebar-pos='top'] .settings-sidebar-pos__mock {
    flex-direction: column;
    align-items: stretch;
}

.settings-sidebar-pos__opt[data-sidebar-pos='top'] .settings-sidebar-pos__mock-nav {
    width: auto;
    height: 32%;
}

.settings-sidebar-pos__opt[data-sidebar-pos='bottom'] .settings-sidebar-pos__mock {
    flex-direction: column-reverse;
    align-items: stretch;
}

.settings-sidebar-pos__opt[data-sidebar-pos='bottom'] .settings-sidebar-pos__mock-nav {
    width: auto;
    height: 32%;
}

.settings-sidebar-pos__text {
    display: block;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.01em;
    text-align: center;
    color: var(--text-primary);
    line-height: 1.3;
}

.settings-page-sidebar {
    width: 220px;
    flex-shrink: 0;
    position: sticky;
    top: 12px;
    align-self: flex-start;
    max-height: calc(100dvh - 48px);
    overflow-y: auto;
    padding: 14px 12px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: var(--bg-sidebar);
    box-shadow: var(--shadow-sm);
}

.settings-page-sidebar__nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.settings-page-sidebar__btn {
    display: flex;
    align-items: center;
    width: 100%;
    text-align: left;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    font-size: var(--fs-nav);
    font-weight: 500;
    color: var(--text-secondary);
    border: 2px solid transparent;
    background-color: transparent;
    cursor: pointer;
    transition: color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.settings-page-sidebar__btn:hover:not(.is-active) {
    color: var(--text-primary);
    background:
        linear-gradient(var(--bg-hover), var(--bg-hover)) padding-box,
        linear-gradient(
            90deg,
            var(--primary),
            #9b7efd,
            #c4b5fd,
            #ede9fe,
            var(--primary),
            #9b7efd,
            #c4b5fd,
            #ede9fe,
            var(--primary)
        ) border-box;
    background-size: auto, 200% 100%;
    background-clip: padding-box, border-box;
    animation: note-pinned-border-flow var(--note-border-flow-duration) linear infinite;
}

.settings-page-sidebar__btn.is-active {
    background: var(--primary);
    color: var(--text-inverse);
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(124, 92, 252, 0.3);
}

.settings-page-sidebar__btn.is-active:hover {
    background:
        linear-gradient(var(--primary), var(--primary)) padding-box,
        linear-gradient(
            90deg,
            var(--primary),
            #9b7efd,
            #c4b5fd,
            #ede9fe,
            var(--primary),
            #9b7efd,
            #c4b5fd,
            #ede9fe,
            var(--primary)
        ) border-box;
    background-size: auto, 200% 100%;
    background-clip: padding-box, border-box;
    animation: note-pinned-border-flow var(--note-border-flow-duration) linear infinite;
    box-shadow: 0 4px 12px rgba(124, 92, 252, 0.35);
}

@media (max-width: 900px) {
    .settings-page {
        flex-direction: column;
    }

    .settings-page-sidebar {
        position: relative;
        top: auto;
        width: 100%;
        max-height: none;
    }
}

.workspace-settings-page {
    display: flex;
    gap: 28px;
    align-items: flex-start;
}

.workspace-settings-sidebar {
    width: 220px;
    flex-shrink: 0;
    position: sticky;
    top: 12px;
    align-self: flex-start;
    max-height: calc(100dvh - 48px);
    overflow-y: auto;
    padding: 14px 12px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: var(--bg-sidebar);
    box-shadow: var(--shadow-sm);
}

.workspace-settings-sidebar__nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.workspace-settings-sidebar__link {
    display: flex;
    align-items: center;
    width: 100%;
    text-align: left;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    font-size: var(--fs-nav);
    font-weight: 500;
    color: var(--text-secondary);
    border: 2px solid transparent;
    background-color: transparent;
    text-decoration: none;
    transition: color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.workspace-settings-sidebar__link:hover:not(.is-active) {
    color: var(--text-primary);
    background:
        linear-gradient(var(--bg-hover), var(--bg-hover)) padding-box,
        linear-gradient(
            90deg,
            var(--primary),
            #9b7efd,
            #c4b5fd,
            #ede9fe,
            var(--primary),
            #9b7efd,
            #c4b5fd,
            #ede9fe,
            var(--primary)
        ) border-box;
    background-size: auto, 200% 100%;
    background-clip: padding-box, border-box;
    animation: note-pinned-border-flow var(--note-border-flow-duration) linear infinite;
}

.workspace-settings-sidebar__link.is-active {
    background: var(--primary);
    color: var(--text-inverse);
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(124, 92, 252, 0.3);
}

.workspace-settings-sidebar__link.is-active:hover {
    background:
        linear-gradient(var(--primary), var(--primary)) padding-box,
        linear-gradient(
            90deg,
            var(--primary),
            #9b7efd,
            #c4b5fd,
            #ede9fe,
            var(--primary),
            #9b7efd,
            #c4b5fd,
            #ede9fe,
            var(--primary)
        ) border-box;
    background-size: auto, 200% 100%;
    background-clip: padding-box, border-box;
    animation: note-pinned-border-flow var(--note-border-flow-duration) linear infinite;
    box-shadow: 0 4px 12px rgba(124, 92, 252, 0.35);
}

.workspace-settings-page__main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.workspace-activity-date-picker {
    width: 100%;
    max-width: none;
}

@media (max-width: 900px) {
    .workspace-settings-page {
        flex-direction: column;
    }

    .workspace-settings-sidebar {
        position: relative;
        top: auto;
        width: 100%;
        max-height: none;
    }
}

.settings-panels {
    flex: 1;
    min-width: 0;
}

.settings-panel {
    display: none;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px 28px;
    background: var(--bg-panel);
}

.settings-panel.is-active {
    display: block;
}

.settings-panel__title {
    font-size: var(--fs-panel-title);
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text-primary);
}

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

.form-label {
    display: block;
    font-size: var(--fs-label);
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    font-size: var(--fs-input);
    line-height: 1.45;
    background: var(--bg-panel);
    transition: border-color 0.2s ease;
}

.form-input,
.form-select {
    min-height: 44px;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(124, 92, 252, 0.1);
}

.form-textarea {
    min-height: 112px;
    resize: vertical;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

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

.toggle-row:last-child {
    border-bottom: none;
}

.toggle-row__text strong {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.toggle-row__text span {
    display: block;
    font-size: 12px;
    color: var(--text-tertiary);
    margin-top: 2px;
}

.toggle {
    width: 44px;
    height: 24px;
    border-radius: var(--radius-pill);
    background: var(--border);
    position: relative;
    cursor: pointer;
    transition: background 0.2s ease;
    flex-shrink: 0;
}

.toggle.is-on {
    background: var(--primary);
}

.toggle::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: white;
    top: 3px;
    left: 3px;
    transition: transform 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.toggle.is-on::after {
    transform: translateX(20px);
}

.lang-pills {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.lang-pills .lang-dropdown {
    padding: 4px;
}

.settings-save-bar {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.filters-bar--wrap {
    flex-wrap: wrap;
}

.toolbar-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.toolbar-row .notes-toolbar {
    flex: 1;
    min-width: min(100%, 260px);
}

.topbar__search[role='search'] {
    border: none;
    margin: 0;
    padding: 0;
    background: transparent;
}

.note-card__title-link,
.note-row__title-link {
    color: inherit;
    text-decoration: none;
}

.note-card__title-link:hover,
.note-row__title-link:hover {
    color: var(--accent);
}

.note-detail-page .note-detail__back {
    margin: 0 0 8px;
}

.note-detail__back-link {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--accent);
    text-decoration: none;
}

.note-detail__crumb {
    margin: 0 0 20px;
    font-size: 0.8125rem;
}

.note-detail__crumb a {
    color: var(--text-muted);
    text-decoration: none;
}

.note-detail__crumb a:hover {
    color: var(--accent);
}

.note-detail__hero {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    margin-bottom: 12px;
}

.note-detail__icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.note-detail__icon svg {
    width: 28px;
    height: 28px;
}

.note-detail__title {
    margin-bottom: 4px;
}

.note-detail__statusline {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin: 0 0 16px;
}

.note-detail__lead {
    margin: 0 0 20px;
    color: var(--text-secondary);
    font-size: 0.9375rem;
}

.note-detail__body {
    max-width: 720px;
    line-height: 1.65;
    color: var(--text);
}

.note-detail__body p {
    margin: 0 0 14px;
}

.note-detail__body--rich img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 12px 0;
}

.note-detail__body--rich img.note-image {
    display: block;
}

.note-detail__body--rich img.note-image--sm {
    width: min(32%, 220px);
}

.note-detail__body--rich img.note-image--md {
    width: min(50%, 360px);
}

.note-detail__body--rich img.note-image--lg {
    width: min(72%, 560px);
}

.note-detail__body--rich img.note-image--full {
    width: 100%;
}

.note-detail__body--rich iframe.note-embed__iframe {
    display: block;
    width: 100%;
    min-height: 380px;
    max-height: min(560px, 70vh);
    margin: 12px 0 16px;
    border: 0;
    border-radius: 12px;
    background: #e2e8f0;
}

.note-detail__body--rich a {
    color: var(--accent, #7c5cfc);
}

.search-hint {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin: 0 0 16px;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(30, 20, 60, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    animation: modalFadeIn 0.2s ease;
}

.modal-overlay[hidden] {
    display: none !important;
}

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

.modal {
    background: var(--bg-panel);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 540px;
    max-height: calc(100vh - 48px);
    display: flex;
    flex-direction: column;
    animation: modalSlideIn 0.25s ease;
    overflow-x: hidden;
    overflow-y: auto;
}

.modal:has(.filters-bar__dropdown.is-open) {
    overflow: visible;
}

@keyframes modalSlideIn {
    from { opacity: 0; transform: translateY(16px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal--sm { max-width: 400px; }

.modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 0;
}

.modal__title {
    font-size: var(--fs-modal-title);
    font-weight: 700;
    color: var(--text-primary);
}

.modal__close {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: background 0.15s, color 0.15s;
}

.modal__close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.modal__close svg {
    width: 18px;
    height: 18px;
}

.modal__body {
    padding: 20px 24px;
    overflow: visible;
    flex: 1;
    min-height: 0;
}

.modal__footer {
    padding: 0 24px 20px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.confirm-modal__desc {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-secondary);
}

.reminder-card,
.note-card,
.note-row,
.tag-table__row,
.note-detail {
    transition: opacity 0.28s ease, transform 0.28s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.reminder-card.is-removing,
.note-card.is-removing,
.note-row.is-removing,
.tag-table__row.is-removing,
.note-detail.is-removing {
    opacity: 0;
    transform: translateX(14px);
    pointer-events: none;
}

.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1100;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    background: var(--bg-panel);
    color: var(--text-primary);
    padding: 12px 20px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    font-size: var(--fs-body-sm);
    font-weight: 500;
    border-left: 4px solid var(--primary);
    animation: toastIn 0.3s ease, toastOut 0.3s ease 2.7s forwards;
    max-width: 360px;
}

.toast--success { border-left-color: #059669; }
.toast--error   { border-left-color: #ef4444; }
.toast--info    { border-left-color: #3b82f6; }

@keyframes toastIn {
    from { opacity: 0; transform: translateX(40px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
    from { opacity: 1; transform: translateX(0); }
    to   { opacity: 0; transform: translateX(40px); }
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 24px;
    text-align: center;
}

.empty-state__icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.empty-state__icon svg {
    width: 28px;
    height: 28px;
    color: var(--primary);
}

.empty-state__title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.empty-state__desc {
    font-size: 13px;
    color: var(--text-secondary);
    max-width: 320px;
}

.note-card {
    position: relative;
}

.note-card__actions {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 2px;
    overflow: visible;
    opacity: 0;
    transition: opacity 0.15s;
    z-index: 4;
}

.note-card:hover .note-card__actions {
    opacity: 1;
}

.note-card__actions:has(.note-card__email-wrap.is-open) {
    opacity: 1;
}

.note-row__actions:has(.note-card__email-wrap.is-open) {
    opacity: 1;
}

.note-action-btn {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-xs);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    background: var(--bg-panel);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    transition: color 0.15s, background 0.15s;
}

a.note-action-btn {
    text-decoration: none;
    box-sizing: border-box;
}

.note-action-btn:hover {
    color: var(--primary);
    background: var(--primary-lighter);
}

.note-action-btn--danger:hover {
    color: #ef4444;
    background: #fef2f2;
}

.note-action-btn--active {
    color: var(--text-inverse);
    border: 2px solid transparent;
    background:
        linear-gradient(var(--primary), var(--primary)) padding-box,
        linear-gradient(
            90deg,
            var(--primary),
            #9b7efd,
            #c4b5fd,
            #ede9fe,
            var(--primary),
            #9b7efd,
            #c4b5fd,
            #ede9fe,
            var(--primary)
        ) border-box;
    background-size: auto, 200% 100%;
    background-clip: padding-box, border-box;
    animation: note-pinned-border-flow var(--note-border-flow-duration) linear infinite;
    box-shadow: 0 4px 12px rgba(124, 92, 252, 0.35);
}

.note-action-btn--active:hover {
    color: var(--text-inverse);
    background:
        linear-gradient(var(--primary), var(--primary)) padding-box,
        linear-gradient(
            90deg,
            var(--primary),
            #9b7efd,
            #c4b5fd,
            #ede9fe,
            var(--primary),
            #9b7efd,
            #c4b5fd,
            #ede9fe,
            var(--primary)
        ) border-box;
    background-size: auto, 200% 100%;
    background-clip: padding-box, border-box;
    animation: note-pinned-border-flow var(--note-border-flow-duration) linear infinite;
    box-shadow: 0 4px 12px rgba(124, 92, 252, 0.35);
}

.inline-form {
    display: inline;
    margin: 0;
    padding: 0;
}

.note-card__actions .inline-form {
    display: contents;
}

.note-card__email-wrap {
    position: relative;
    display: inline-flex;
}

.note-card__email-popover {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: min(240px, calc(100vw - 32px));
    padding: 12px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--bg-panel);
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 8;
}

.note-card__email-popover[hidden] {
    display: none !important;
}

.note-card__email-label {
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.note-card__email-input {
    width: 100%;
}

.note-card__email-wrap.is-open .note-card__email-popover {
    display: flex;
}

.note-preview-lightbox {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(15, 23, 42, 0.72);
    backdrop-filter: blur(8px);
}

.note-preview-lightbox[hidden] {
    display: none !important;
}

.note-preview-lightbox__dialog {
    width: min(960px, 100%);
    max-height: min(90vh, 900px);
    border-radius: 20px;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.note-preview-lightbox__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--border);
}

.topbar-workspace-switcher {
    min-width: 0;
    flex: 1 1 auto;
    width: auto;
    max-width: 100%;
}

.topbar-workspace-switcher .filters-bar__dropdown-btn {
    min-height: 46px;
    width: 100%;
    padding: 10px 14px;
}

.topbar-workspace-switcher .filters-bar__dropdown-btn span {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

.topbar-workspace-switcher .filters-bar__dropdown-btn small,
.dropdown-menu__item small {
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* --- Workspace pulse: trigger sol noktası + sol-dış canlı mesaj balonu --- */
.topbar-workspace-switcher {
    position: relative;
}

.topbar-workspace-switcher .filters-bar__dropdown-btn {
    position: relative;
}

/**
 * Canlı bildirim balonu — tasarımı `.filters-bar__dropdown-btn` ile birebir aynı.
 * (yükseklik, padding, border, radius, font, transition).
 */
.topbar-workspace-switcher__feed {
    position: absolute;
    top: 50%;
    right: calc(100% + 10px);
    transform: translateY(-50%) translateX(8px);
    display: flex;
    align-items: center;
    gap: 8px;
    height: 44px;
    padding: 0 14px;
    max-width: min(320px, 36vw);
    background: var(--bg-panel);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    font-size: var(--fs-input);
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: all 0.2s ease, opacity 0.22s ease, transform 0.22s ease;
    z-index: 5;
}

.topbar-workspace-switcher__feed[hidden] {
    display: none;
}

.topbar-workspace-switcher__feed.is-visible {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
    border-color: var(--primary);
    color: var(--text-primary);
    box-shadow: 0 0 0 3px rgba(124, 92, 252, 0.1);
}

.topbar-workspace-switcher__feed-avatar {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    align-self: center;
    border: 2px solid var(--border);
    background: var(--bg-muted, rgba(124, 92, 252, 0.06));
    box-shadow:
        0 0 0 2px var(--bg-panel),
        0 2px 10px rgba(124, 92, 252, 0.12);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.topbar-workspace-switcher__feed.is-visible .topbar-workspace-switcher__feed-avatar {
    border-color: rgba(124, 92, 252, 0.42);
    box-shadow:
        0 0 0 2px var(--bg-panel),
        0 2px 12px rgba(124, 92, 252, 0.2);
}

.topbar-workspace-switcher__feed-avatar-inner {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    overflow: hidden;
}

.topbar-workspace-switcher__feed-avatar-inner img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.topbar-workspace-switcher__feed-avatar-inner--fallback {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--primary);
    background: linear-gradient(
        145deg,
        rgba(124, 92, 252, 0.18) 0%,
        rgba(124, 92, 252, 0.06) 100%
    );
}

html[data-theme="dark"] .topbar-workspace-switcher__feed-avatar {
    box-shadow:
        0 0 0 2px var(--bg-panel),
        0 2px 14px rgba(0, 0, 0, 0.35);
}

html[data-theme="dark"] .topbar-workspace-switcher__feed.is-visible .topbar-workspace-switcher__feed-avatar {
    border-color: rgba(155, 135, 255, 0.45);
}

.topbar-workspace-switcher__feed-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    min-width: 0;
    overflow: hidden;
}

.topbar-workspace-switcher__feed-msg {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.2;
}

.topbar-workspace-switcher__feed-meta {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    line-height: 1.1;
}

@media (max-width: 720px) {
    .topbar-workspace-switcher__feed {
        max-width: min(220px, 50vw);
    }
    .topbar-workspace-switcher__feed-meta { display: none; }
}

@media (max-width: 480px) {
    .topbar-workspace-switcher__feed { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
    .topbar-workspace-switcher__feed { transition: none; }
}

/* --- Dropdown item: workspace satırı düzeni (item iç yerleşim) --- */
.dropdown-menu__item--workspace {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 220px;
    max-width: 320px;
    border: 2px solid transparent;
    background: transparent;
}

.dropdown-menu__item--workspace .dropdown-menu__item-label {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    overflow: hidden;
}

.dropdown-menu__item--workspace .dropdown-menu__item-label > strong {
    display: block;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
    font-size: 0.875rem;
    line-height: 1.2;
}

.dropdown-menu__item--workspace .dropdown-menu__item-label > small {
    display: block;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-muted);
    font-size: 0.72rem;
}

/* Aktivite anı: sürekli akan border (note-pinned-border-flow ile aynı keyframes) */
.dropdown-menu__item--workspace.dropdown-menu__item--has-activity {
    border: 2px solid transparent;
    background:
        linear-gradient(var(--bg-panel), var(--bg-panel)) padding-box,
        linear-gradient(
            90deg,
            var(--primary),
            #9b7efd,
            #c4b5fd,
            #ede9fe,
            var(--primary),
            #9b7efd,
            #c4b5fd,
            #ede9fe,
            var(--primary)
        ) border-box;
    background-size: auto, 200% 100%;
    background-clip: padding-box, border-box;
    animation: note-pinned-border-flow var(--note-border-flow-duration) linear infinite;
}

.dropdown-menu__item--workspace.dropdown-menu__item--has-activity:hover {
    background:
        linear-gradient(var(--primary-lighter), var(--primary-lighter)) padding-box,
        linear-gradient(
            90deg,
            var(--primary),
            #9b7efd,
            #c4b5fd,
            #ede9fe,
            var(--primary),
            #9b7efd,
            #c4b5fd,
            #ede9fe,
            var(--primary)
        ) border-box;
    background-size: auto, 200% 100%;
    background-clip: padding-box, border-box;
}

/* Workspace aç\u0131l\u0131r men\u00fc: alt sat\u0131r tooltiplerini k\u0131rpmas\u0131n */
.topbar-workspace-switcher > .dropdown-menu {
    overflow: visible;
}

/* --- Sağdaki "online" avatar yığını (overflow guard) --- */
.dropdown-menu__item-presence {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    max-width: 96px;
    min-width: 0;
    overflow: visible;
    padding-left: 4px;
}

.dropdown-menu__item-presence:empty {
    display: none;
}

/**
 * Dış kutu: overflow visible — yoksa ::after tooltip kırpılır.
 * Yuvarlak kırpma ve kenarlık .ws-presence-avatar__inner içinde.
 */
.ws-presence-avatar {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    margin-left: -8px;
    flex: 0 0 auto;
    z-index: 0;
    overflow: visible;
}

.ws-presence-avatar__inner {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    overflow: hidden;
    background: var(--bg-elev, var(--bg-panel));
    border: 2px solid var(--bg-panel);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.ws-presence-avatar__inner > img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/** Hover tooltip (data-tooltip); z-index ile \u00fcstte, k\u0131rp\u0131lmamas\u0131 i\u00e7in item-presence overflow: visible */
.ws-presence-avatar[data-tooltip] {
    cursor: default;
}

.ws-presence-avatar[data-tooltip]:hover,
.ws-presence-avatar[data-tooltip]:focus-visible {
    z-index: 20;
}

.ws-presence-avatar[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    top: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 30;
    padding: 5px 9px;
    border-radius: var(--radius-sm, 6px);
    font-size: 0.6875rem;
    font-weight: 500;
    line-height: 1.25;
    color: var(--text-primary);
    background: var(--bg-panel);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    white-space: nowrap;
    max-width: min(200px, 48vw);
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.14s ease, visibility 0.14s ease;
}

.ws-presence-avatar--more[data-tooltip]::after {
    white-space: normal;
    word-break: break-word;
    text-align: center;
}

.ws-presence-avatar[data-tooltip]:hover::after,
.ws-presence-avatar[data-tooltip]:focus-visible::after {
    opacity: 1;
    visibility: visible;
}

html[data-theme="dark"] .ws-presence-avatar[data-tooltip]::after {
    background: rgba(30, 30, 47, 0.98);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

@media (prefers-reduced-motion: reduce) {
    .ws-presence-avatar[data-tooltip]::after {
        transition: none;
    }
}

.ws-presence-avatar:first-child {
    margin-left: 0;
}

.ws-presence-avatar__fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: var(--primary-lighter);
    color: var(--primary);
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.ws-presence-avatar--more .ws-presence-avatar__inner {
    background: var(--primary-light);
    color: var(--primary);
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
}

html[data-theme="dark"] .ws-presence-avatar__inner {
    border-color: var(--bg-panel);
    background: rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .ws-presence-avatar__fallback {
    background: rgba(155, 135, 255, 0.18);
    color: #d8cfff;
}

html[data-theme="dark"] .ws-presence-avatar--more .ws-presence-avatar__inner {
    background: rgba(155, 135, 255, 0.28);
    color: #ece6ff;
}

/* Editor composer/snippet: live collaborators strip (HTTP presence) */
.editor-live-presence {
    font-size: 0.75rem;
    line-height: 1.3;
    color: var(--text-secondary);
    text-align: right;
}

.editor-live-presence[hidden],
.editor-live-presence:not(.is-visible) {
    display: none !important;
}

.editor-live-presence.is-visible {
    display: inline-flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0;
    overflow: visible;
    max-width: 100%;
    vertical-align: middle;
}

.editor-live-presence__peers {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    overflow: visible;
    flex: 0 1 auto;
    max-width: 100%;
    min-width: 0;
    padding: 4px 0;
}

.editor-live-presence__peer {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    cursor: default;
    border-radius: 999px;
    overflow: visible;
    z-index: 0;
}

.editor-live-presence__peer[data-tooltip]:hover,
.editor-live-presence__peer[data-tooltip]:focus-visible {
    z-index: 50 !important;
}

.editor-live-presence__peer[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    top: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 30;
    box-sizing: border-box;
    padding: 5px 9px;
    border-radius: var(--radius-sm, 6px);
    font-size: 0.6875rem;
    font-weight: 500;
    line-height: 1.25;
    color: var(--text-primary);
    background: var(--bg-panel);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    /* Dar containing block (28px avatar) shrink-to-fit ile harf sütunu üretmesin */
    width: max-content;
    max-width: min(260px, calc(100vw - 24px));
    white-space: nowrap;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.14s ease, visibility 0.14s ease;
}

.editor-live-presence__peer[data-tooltip]:hover::after,
.editor-live-presence__peer[data-tooltip]:focus-visible::after {
    opacity: 1;
    visibility: visible;
}

html[data-theme="dark"] .editor-live-presence__peer[data-tooltip]::after {
    background: rgba(30, 30, 47, 0.98);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.editor-live-presence__peer:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.editor-live-presence__avatar {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    overflow: hidden;
    border: 2px solid #fff;
    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.1),
        0 0 0 1px color-mix(in srgb, var(--border) 55%, transparent);
    background: var(--bg-elev, var(--bg-panel));
    display: block;
}

.editor-live-presence__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.editor-live-presence__avatar-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    background: color-mix(in srgb, var(--primary) 16%, transparent);
    color: var(--primary);
}

html[data-theme="dark"] .editor-live-presence__avatar {
    border-color: var(--bg-panel, #1e2130);
    box-shadow:
        0 1px 3px rgba(0, 0, 0, 0.35),
        0 0 0 1px rgba(255, 255, 255, 0.12);
}

html[data-theme="dark"] .editor-live-presence__avatar-fallback {
    background: rgba(155, 135, 255, 0.22);
    color: #e8e0ff;
}

@media (prefers-reduced-motion: reduce) {
    .editor-live-presence__peer[data-tooltip]::after {
        transition: none;
    }
    .topbar-workspace-switcher__pulse { animation: none; }
    .dropdown-menu__item--workspace.dropdown-menu__item--has-activity {
        animation: none;
        border-color: var(--primary);
        background: var(--bg-panel);
        background-size: auto;
    }
}

.collab-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-top: 20px;
}

.comment-thread {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 16px;
}

.comment-card,
.timeline-item {
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--bg-panel);
    padding: 16px;
}

/* ==========================================================================
   Note detail page — premium layout (collab grid replacement)
   ========================================================================== */

.note-detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: 24px;
    margin-top: 28px;
    align-items: start;
}

.note-detail-grid__main,
.note-detail-grid__side {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.note-detail-grid__side {
    position: sticky;
    top: 96px;
}

.note-panel {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--bg-panel);
    box-shadow: var(--shadow-sm);
    padding: 22px 24px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.note-panel:hover {
    box-shadow: var(--shadow-card);
}

.note-panel__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

.note-panel__head--with-status {
    align-items: center;
}

.note-panel__eyebrow {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.note-panel__title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.25;
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
}

.note-panel__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    border-radius: 999px;
    background: var(--primary-lighter);
    color: var(--primary);
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1;
}

.note-panel__empty {
    margin: 0;
    padding: 22px 18px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.88rem;
    border: 1px dashed var(--border);
    border-radius: 14px;
    background: var(--bg-secondary, transparent);
}

/* Status pill --------------------------------------------------------------*/
.note-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    background: rgba(148, 163, 184, 0.14);
    color: #475569;
}

.note-status-pill::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}

.note-status-pill--draft {
    background: rgba(148, 163, 184, 0.14);
    color: #64748b;
}

.note-status-pill--in_review,
.note-status-pill--changes_requested {
    background: var(--accent-orange-bg);
    color: var(--accent-orange-text);
}

.note-status-pill--approved,
.note-status-pill--success {
    background: var(--accent-green-bg);
    color: var(--accent-green-text);
}

html[data-theme="dark"] .note-status-pill--draft {
    background: rgba(148, 163, 184, 0.18);
    color: #cbd5e1;
}

/* Comments -----------------------------------------------------------------*/
.note-comment-composer {
    margin-bottom: 22px;
}

.note-comment-composer .form-textarea {
    border-radius: 12px;
    min-height: 84px;
}

.note-comment-composer__actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 10px;
}

.note-comment-composer--reply {
    margin: 12px 0 0;
}

.note-comment-thread {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.note-comment {
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--bg-panel);
    padding: 16px 18px;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.note-comment:hover {
    border-color: var(--border-light, var(--border));
    box-shadow: var(--shadow-sm);
}

.note-comment.is-resolved {
    opacity: 0.78;
    background: rgba(124, 92, 252, 0.04);
}

.note-comment__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.note-comment__author {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.note-comment__avatar {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary), #9b87ff);
    color: #fff;
    font-weight: 700;
    font-size: 0.82rem;
    letter-spacing: 0.02em;
    box-shadow: 0 2px 8px rgba(124, 92, 252, 0.25);
}

.note-comment__avatar--sm {
    width: 26px;
    height: 26px;
    font-size: 0.72rem;
    box-shadow: none;
}

.note-comment__name {
    display: block;
    font-size: 0.92rem;
    color: var(--text-primary);
    line-height: 1.2;
}

.note-comment__time {
    display: block;
    font-size: 0.74rem;
    color: var(--text-muted);
    line-height: 1.2;
    margin-top: 2px;
}

.note-comment__body {
    margin: 0 0 10px;
    color: var(--text-secondary);
    font-size: 0.93rem;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}

.note-comment__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding-top: 4px;
}

.note-comment__delete {
    color: #ef4444;
}

.note-comment__delete:hover {
    background: #fef2f2;
    color: #dc2626;
}

html[data-theme="dark"] .note-comment__delete:hover {
    background: rgba(239, 68, 68, 0.12);
}

.note-comment__replies {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px dashed var(--border);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.note-comment-reply {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.note-comment-reply__body {
    flex: 1 1 auto;
    min-width: 0;
}

.note-comment-reply__meta {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 2px;
}

.note-comment-reply__meta strong {
    font-size: 0.86rem;
    color: var(--text-primary);
}

.note-comment-reply__body p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.87rem;
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-word;
}

.note-comment__reply-toggle {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px dashed var(--border);
}

.note-comment__reply-toggle > summary {
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--primary);
    list-style: none;
    user-select: none;
    padding: 4px 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.note-comment__reply-toggle > summary::-webkit-details-marker {
    display: none;
}

.note-comment__reply-toggle > summary::before {
    content: '+';
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary-lighter);
    color: var(--primary);
    font-weight: 700;
    line-height: 1;
}

.note-comment__reply-toggle[open] > summary::before {
    content: '−';
}

/* Approval & Activity ------------------------------------------------------*/
.note-review-form {
    margin-bottom: 14px;
}

.note-review-form .form-textarea {
    border-radius: 12px;
    min-height: 76px;
}

.note-review-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
    padding-bottom: 14px;
    border-bottom: 1px dashed var(--border);
}

.note-review-actions:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.note-history {
    margin-top: 6px;
}

.note-history__summary {
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
    list-style: none;
    user-select: none;
    padding: 8px 0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.note-history__summary::-webkit-details-marker {
    display: none;
}

.note-history__summary::after {
    content: '';
    width: 8px;
    height: 8px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform 0.2s ease;
}

.note-history[open] > .note-history__summary::after {
    transform: rotate(-135deg);
}

.note-timeline {
    list-style: none;
    margin: 12px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
    position: relative;
}

.note-timeline::before {
    content: '';
    position: absolute;
    left: 5px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: linear-gradient(to bottom, var(--border), transparent 92%);
    pointer-events: none;
}

.note-timeline__item {
    position: relative;
    padding-left: 22px;
}

.note-timeline__dot {
    position: absolute;
    left: 0;
    top: 6px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--bg-panel);
    border: 2px solid var(--primary);
    box-shadow: 0 0 0 3px rgba(124, 92, 252, 0.08);
}

.note-timeline__item--approved .note-timeline__dot {
    border-color: var(--accent-green-text);
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.12);
}

.note-timeline__item--changes_requested .note-timeline__dot,
.note-timeline__item--in_review .note-timeline__dot {
    border-color: var(--accent-orange-text);
    box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.12);
}

.note-timeline__body {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.note-timeline__title {
    font-size: 0.92rem;
    color: var(--text-primary);
    font-weight: 600;
    line-height: 1.4;
}

.note-timeline__meta {
    font-size: 0.76rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.note-timeline__copy {
    margin: 6px 0 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.55;
    padding: 8px 12px;
    background: var(--primary-lighter);
    border-radius: 10px;
    white-space: pre-wrap;
}

@media (max-width: 1100px) {
    .note-detail-grid {
        grid-template-columns: 1fr;
        margin-top: 22px;
    }

    .note-detail-grid__side {
        position: static;
    }
}

@media (max-width: 640px) {
    .note-panel {
        padding: 18px;
    }

    .note-comment {
        padding: 14px;
    }

    .note-comment__avatar {
        width: 30px;
        height: 30px;
        font-size: 0.78rem;
    }
}

.badge--success {
    background: var(--accent-green-bg);
    color: var(--accent-green-text);
}

.workspace-page__stack {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.workspace-page__stack--narrow {
    max-width: 880px;
}

.workspace-hero {
    overflow: hidden;
    padding: 24px 28px;
    background:
        radial-gradient(circle at top right, rgba(124, 92, 252, 0.16), transparent 32%),
        linear-gradient(135deg, rgba(124, 92, 252, 0.08), rgba(59, 130, 246, 0.04)),
        var(--bg-panel);
}

.workspace-hero--compact {
    padding: 20px 24px;
}

.workspace-hero__content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.workspace-hero__eyebrow {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: var(--radius-pill);
    background: rgba(124, 92, 252, 0.12);
    color: var(--primary);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.workspace-hero__title {
    margin: 10px 0 6px;
    font-size: 1.6rem;
    line-height: 1.15;
    letter-spacing: -0.03em;
}

.workspace-hero__copy,
.workspace-card__copy {
    color: var(--text-secondary);
    line-height: 1.6;
}

.workspace-card__copy {
    margin: 10px 0 0;
}

.workspace-card__copy--tight {
    margin-top: 6px;
}

.workspace-hero__actions,
.workspace-card__actions,
.workspace-table-actions,
.workspace-filter-form__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.workspace-filter-form__actions {
    margin-top: 18px;
}

.workspace-subnav {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 6px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--bg-panel);
    box-shadow: var(--shadow-sm);
    width: fit-content;
    max-width: 100%;
}

.workspace-subnav__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 16px;
    border-radius: 14px;
    color: var(--text-secondary);
    font-weight: 600;
    transition: all 0.2s ease;
}

.workspace-subnav__link:hover {
    background: var(--primary-lighter);
    color: var(--primary);
}

.workspace-subnav__link.is-active {
    background: var(--primary);
    color: var(--text-inverse);
    box-shadow: 0 8px 20px rgba(124, 92, 252, 0.18);
}

.workspace-card-grid {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.workspace-summary-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.workspace-card,
.workspace-member-card {
    min-height: 100%;
}

.workspace-member-card {
    position: relative;
    overflow: visible;
}

.workspace-member-card__main {
    min-width: 0;
    flex: 1 1 auto;
}

.workspace-member-card__email-row {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    margin-top: 6px;
}

.workspace-member-card__email-row .workspace-member-card__email,
.workspace-member-card__email-row .workspace-card__copy--tight {
    margin: 0;
}

.workspace-member-card__email {
    flex: 1 1 auto;
    min-width: 0;
    word-break: break-word;
}

.workspace-member-card__avatar-wrap {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--bg-hover);
    border: 2px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.workspace-member-card__avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.workspace-member-card:has(.filters-bar__dropdown.is-open) {
    z-index: 4;
}

.workspace-card.is-current {
    border-color: rgba(124, 92, 252, 0.28);
    box-shadow: 0 12px 28px rgba(124, 92, 252, 0.12);
}

.workspace-card:not(.is-current) {
    position: relative;
}

.workspace-card__head,
.workspace-activity-card__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.workspace-card__title {
    display: block;
    font-size: 1rem;
    line-height: 1.35;
    color: var(--text-primary);
}

.workspace-card__actions {
    margin-top: auto;
    padding-top: 14px;
}

.workspace-card__quick-switch {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 2;
}

.workspace-card__hover-btn {
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    box-shadow: 0 10px 24px rgba(124, 92, 252, 0.2);
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
}

.workspace-card:hover .workspace-card__hover-btn,
.workspace-card:focus-within .workspace-card__hover-btn {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.workspace-card__inline-form {
    flex: 1 1 180px;
}

.workspace-card__inline-form .form-input {
    min-width: 0;
}

.workspace-section {
    overflow: visible;
}

.workspace-panel__body {
    padding: 0 24px 24px;
    overflow: visible;
}

.workspace-invite-form .form-row {
    align-items: end;
}

.workspace-invite-email-input-wrap {
    position: relative;
    width: 100%;
    max-width: 100%;
}

.workspace-invite-email-input-wrap .workspace-invite-email-input {
    height: 44px;
    padding: 0 14px;
    line-height: 41px;
    min-width: 0;
}

.workspace-invite-email-input-wrap:has(.workspace-invite-email-preview:not([hidden])) .workspace-invite-email-input {
    padding-left: 48px;
}

.workspace-invite-email-preview {
    position: absolute;
    left: 10px;
    right: auto;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 1;
    width: 32px;
    height: 32px;
}

.workspace-invite-email-preview[hidden] {
    display: none !important;
}

.workspace-invite-email-preview__avatar {
    width: 32px;
    height: 32px;
    max-width: 100%;
    max-height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    background: var(--bg-hover);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
}

html[data-theme="dark"] .workspace-invite-email-preview__avatar {
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.workspace-member-grid,
.workspace-activity-feed {
    display: grid;
    gap: 16px;
    overflow: visible;
}

.workspace-member-grid {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.workspace-meta-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    margin-top: 12px;
    color: var(--text-secondary);
    font-size: 0.86rem;
}

.workspace-shared-library-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 999px;
}
.workspace-shared-library-status--on {
    background: rgba(124, 92, 252, 0.12);
    color: var(--primary, #7c5cfc);
}
.workspace-shared-library-status--off {
    background: rgba(148, 163, 184, 0.18);
    color: var(--text-secondary, #64748b);
}
html[data-theme="dark"] .workspace-shared-library-status--on {
    background: rgba(124, 92, 252, 0.22);
    color: #c4b5fd;
}
html[data-theme="dark"] .workspace-shared-library-status--off {
    background: rgba(148, 163, 184, 0.16);
    color: #cbd5e1;
}

.workspace-shared-library-toggle {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    margin: 8px 0 16px;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 12px;
    background: rgba(124, 92, 252, 0.04);
    cursor: pointer;
    transition: background 140ms ease, border-color 140ms ease;
}
.workspace-shared-library-toggle:hover {
    background: rgba(124, 92, 252, 0.08);
    border-color: rgba(124, 92, 252, 0.3);
}
.workspace-shared-library-toggle input[type="checkbox"] {
    margin-top: 3px;
    accent-color: var(--primary, #7c5cfc);
    flex-shrink: 0;
}
.workspace-shared-library-toggle__text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 0.9rem;
    color: var(--text, #0f172a);
}
.workspace-shared-library-toggle__text small {
    font-weight: 400;
    color: var(--text-secondary, #64748b);
    line-height: 1.4;
}
html[data-theme="dark"] .workspace-shared-library-toggle {
    background: rgba(124, 92, 252, 0.08);
    border-color: rgba(255, 255, 255, 0.08);
}
html[data-theme="dark"] .workspace-shared-library-toggle:hover {
    background: rgba(124, 92, 252, 0.14);
    border-color: rgba(196, 181, 253, 0.4);
}

.workspace-filter-form .form-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 0;
    align-items: end;
}

.workspace-filter-form .form-row > .form-group {
    min-width: 0;
    margin-bottom: 0;
}

.workspace-filter-form .workspace-activity-date-picker.filters-bar__dropdown,
.workspace-filter-form .note-composer__reminder.filters-bar__dropdown {
    width: 100%;
    min-width: 0;
}

.workspace-filter-form .workspace-activity-date-picker .filters-bar__dropdown-btn,
.workspace-filter-form .note-composer__reminder .filters-bar__dropdown-btn {
    width: 100%;
    max-width: 100%;
}

@media (max-width: 768px) {
    .workspace-filter-form .form-row {
        grid-template-columns: 1fr;
    }
}

.settings-panel .form-row > .form-group {
    min-width: 0;
}

.settings-panel .form-row > .form-group + .form-group {
    margin-top: 0;
}

.settings-drive-block {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid rgba(148, 163, 184, 0.25);
}

.settings-drive-block__head {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 10px;
}

.settings-drive-block__logo {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: block;
    object-fit: contain;
}

.settings-drive-block__title {
    font-size: 1rem;
    margin-bottom: 0;
}

.workspace-activity-card__time {
    color: var(--text-tertiary);
    font-size: 0.82rem;
    white-space: nowrap;
}

.workspace-activity-card--empty {
    text-align: center;
}

.workspace-pagination {
    display: flex;
    justify-content: flex-end;
    margin-top: -4px;
}

.workspace-form-panel {
    display: block;
}

.workspace-page-switcher {
    min-width: 240px;
}

.workspace-page-switcher .filters-bar__dropdown-btn {
    min-height: 46px;
    padding: 10px 14px;
}

.workspace-page-switcher .filters-bar__dropdown-btn span {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

.workspace-form-panel .form-field-dropdown.filters-bar__dropdown,
.workspace-section .form-field-dropdown.filters-bar__dropdown,
.workspace-card__inline-form .form-field-dropdown.filters-bar__dropdown {
    width: 100%;
    min-width: 0;
}

.workspace-form-panel .form-field-dropdown .filters-bar__dropdown-btn,
.workspace-section .form-field-dropdown .filters-bar__dropdown-btn,
.workspace-card__inline-form .form-field-dropdown .filters-bar__dropdown-btn {
    width: 100%;
    max-width: 100%;
}

.workspace-color-picker {
    padding-top: 2px;
}

.workspace-toggle-row {
    margin-top: 2px;
    border-top: 1px solid var(--border);
}

.workspace-picker-field {
    position: relative;
    display: block;
}

.workspace-picker-field__icon {
    position: absolute;
    left: 14px;
    top: 50%;
    width: 18px;
    height: 18px;
    color: var(--text-tertiary);
    transform: translateY(-50%);
    pointer-events: none;
    z-index: 1;
}

.workspace-picker-field__input {
    position: relative;
    padding-left: 42px;
    min-height: 44px;
    appearance: none;
    -webkit-appearance: none;
}

.workspace-picker-field__input::-webkit-calendar-picker-indicator {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.comment-card.is-resolved {
    opacity: 0.88;
}

.comment-reply {
    margin-top: 12px;
    margin-left: 18px;
    padding-left: 14px;
    border-left: 2px solid var(--border);
}

.note-card__presence,
.note-row__presence {
    margin-top: 8px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(124, 92, 252, 0.12);
    color: var(--accent-primary, #7c5cfc);
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.2;
}

.note-card__presence[hidden],
.note-row__presence[hidden] {
    display: none !important;
}

.note-presence-draft-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.note-presence-draft-card {
    padding: 16px 18px;
    border-radius: 20px;
    border: 1px solid rgba(124, 92, 252, 0.18);
    background: linear-gradient(135deg, rgba(124, 92, 252, 0.1), rgba(255, 255, 255, 0.92));
    box-shadow: var(--shadow-sm);
}

.note-presence-draft-card__eyebrow {
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.note-presence-draft-card__title {
    display: block;
    color: var(--text-primary);
    font-size: 0.98rem;
    line-height: 1.4;
}

@media (max-width: 1100px) {
    .collab-grid {
        grid-template-columns: 1fr;
    }

    .topbar-workspace-switcher {
        min-width: 0;
        flex: 1 1 auto;
        width: auto;
        max-width: 100%;
    }
}

.note-preview-lightbox__title {
    min-width: 0;
    font-size: 0.95rem;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.note-preview-lightbox__close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border-light);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 1.35rem;
    cursor: pointer;
}

.note-preview-lightbox__body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 220px;
    max-height: calc(90vh - 72px);
    padding: 20px;
    overflow: auto;
}

.note-preview-lightbox__image {
    display: block;
    max-width: 100%;
    max-height: calc(90vh - 120px);
    border-radius: 14px;
}

.note-preview-lightbox__frame {
    width: min(820px, 100%);
    height: min(72vh, 860px);
    border: 0;
    border-radius: 14px;
    background: #e2e8f0;
}

.note-action-btn svg {
    width: 14px;
    height: 14px;
}

.note-row__actions {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    z-index: 3;
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 2px;
    opacity: 0;
    transition: opacity 0.15s;
    overflow: visible;
}

.note-row__actions .inline-form {
    display: contents;
}

.note-row:hover .note-row__actions {
    opacity: 1;
}

.note-row__actions .note-action-btn[data-action-tooltip],
.note-card__actions .note-action-btn[data-action-tooltip] {
    position: relative;
}

.note-row__actions .note-action-btn[data-action-tooltip]::after,
.note-card__actions .note-action-btn[data-action-tooltip]::after {
    content: attr(data-action-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.25;
    color: var(--text-primary);
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 8px;
    white-space: nowrap;
    max-width: min(240px, 70vw);
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.12s ease, visibility 0.12s ease;
    z-index: 50;
    box-shadow: var(--shadow-md);
}

.note-row:hover .note-row__actions .note-action-btn[data-action-tooltip]:is(:hover, :focus-visible)::after,
.note-row:focus-within .note-row__actions .note-action-btn[data-action-tooltip]:focus-visible::after,
.note-card:hover .note-card__actions .note-action-btn[data-action-tooltip]:is(:hover, :focus-visible)::after,
.note-card:focus-within .note-card__actions .note-action-btn[data-action-tooltip]:focus-visible::after {
    opacity: 1;
    visibility: visible;
}

@media (prefers-reduced-motion: reduce) {
    .note-row__actions .note-action-btn[data-action-tooltip]::after,
    .note-card__actions .note-action-btn[data-action-tooltip]::after {
        transition: none;
    }
}

.form-group--error .form-input,
.form-group--error .form-textarea,
.form-group--error .form-select {
    border-color: #ef4444;
}

.form-error-msg {
    font-size: 12px;
    color: #ef4444;
    margin-top: 4px;
}

.form-select {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-panel);
    font-family: var(--font);
    font-size: 14px;
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.2s;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.form-select:focus {
    border-color: var(--primary);
}

.color-picker {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding: 4px 0;
}

.color-swatch {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform 0.15s, border-color 0.15s;
}

.color-swatch:hover {
    transform: scale(1.15);
}

.color-swatch.is-active {
    border-color: var(--text-primary);
    transform: scale(1.15);
}

.color-swatch--purple  { background: var(--accent-purple-text); }
.color-swatch--indigo  { background: var(--accent-indigo-text); }
.color-swatch--blue    { background: var(--accent-blue-text); }
.color-swatch--green   { background: var(--accent-green-text); }
.color-swatch--pink    { background: var(--accent-pink-text); }
.color-swatch--orange  { background: var(--accent-orange-text); }
.color-swatch--amber   { background: var(--accent-amber-text); }
.color-swatch--teal    { background: var(--accent-teal-text); }

.tag-check-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 4px 0;
}

.tag-check {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    border: 1.5px solid var(--border);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    user-select: none;
}

.tag-check:hover {
    border-color: var(--primary);
}

.tag-check.is-active {
    border-color: var(--primary);
    background: var(--primary-lighter);
    color: var(--primary);
}

.tag-check input { display: none; }

body.compact-view .note-card {
    padding: 10px 14px;
    gap: 10px;
}

body.compact-view .note-row {
    padding: 8px 16px;
}

body.compact-view .note-row:hover,
body.compact-view .note-row:focus-within {
    padding-right: max(240px, 16px);
}

body.compact-view .note-row--trash:hover,
body.compact-view .note-row--trash:focus-within {
    padding-right: 14px;
}

body.compact-view .note-card__icon {
    width: 36px;
    height: 36px;
}

.reminder-card__check {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid var(--border);
    flex-shrink: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.15s, background 0.15s;
}

.reminder-card__check:hover {
    border-color: var(--primary);
}

.reminder-card__check.is-done {
    border-color: #059669;
    background: #059669;
}

.reminder-card__check.is-done svg {
    color: white;
    width: 12px;
    height: 12px;
}

.reminder-card.is-completed {
    opacity: 0.55;
}

.reminder-card.is-completed .reminder-card__title {
    text-decoration: line-through;
}

.reminder-card .inline-form {
    display: contents;
}

.note-detail__actions {
    display: flex;
    gap: 8px;
    margin: 16px 0 24px;
    flex-wrap: wrap;
}

.note-detail__actions .btn svg {
    width: 16px;
    height: 16px;
    margin-right: 6px;
    vertical-align: -2px;
}

.tags-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.tags-page-header .page-title {
    margin-bottom: 4px;
}

.form-group + .form-group {
    margin-top: 14px;
}

.modal__body .form-row {
    display: flex;
    gap: 14px;
}

.modal__body .form-row .form-group {
    flex: 1;
    margin-top: 0;
    min-width: 0;
}

.modal__body .modal-field-dropdown.filters-bar__dropdown,
.note-composer__panel .form-field-dropdown.filters-bar__dropdown,
.settings-panel .form-field-dropdown.filters-bar__dropdown {
    width: 100%;
    min-width: 0;
}

.modal__body .modal-field-dropdown .filters-bar__dropdown-btn,
.note-composer__panel .form-field-dropdown .filters-bar__dropdown-btn,
.settings-panel .form-field-dropdown .filters-bar__dropdown-btn {
    width: 100%;
    max-width: 100%;
}

.modal__body .toggle-inline {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
}

.modal__body .toggle-inline .form-label {
    margin-bottom: 0;
    font-weight: 500;
}

.modal__body .toggle-sm {
    width: 36px;
    height: 20px;
    border-radius: 10px;
    background: var(--border);
    position: relative;
    cursor: pointer;
    transition: background 0.2s;
    flex-shrink: 0;
}

.modal__body .toggle-sm::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: white;
    transition: transform 0.2s;
    box-shadow: var(--shadow-sm);
}

.modal__body .toggle-sm.is-on {
    background: var(--primary);
}

.modal__body .toggle-sm.is-on::after {
    transform: translateX(16px);
}

body.auth-page {
    align-items: stretch;
    justify-content: flex-start;
    padding: 0;
    margin: 0;
    min-width: 0;
    min-height: 100vh;
    height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
    box-sizing: border-box;
}

body.auth-page #auth-root.auth-page__root {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
    width: 100%;
    max-width: none;
}

.auth-shell {
    display: grid;
    grid-template-columns: minmax(300px, 1fr) minmax(380px, 1.05fr);
    min-height: 520px;
    background: var(--bg-panel);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-light);
    overflow: hidden;
}

/* Auth: full viewport, no outer gutters; shell fills #auth-root */
body.auth-page .auth-shell {
    overflow: visible;
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    height: 100%;
    border-radius: 0;
    box-shadow: none;
    border: none;
    grid-template-rows: 1fr;
}

/* Split auth: hero column + form (all auth pages with @section auth_hero) */
body.auth-page--split {
    padding: 0;
    min-height: 100vh;
    height: 100vh;
    background: linear-gradient(165deg, #e8e0f8 0%, var(--bg-page) 42%, #efe8ff 100%);
    transition: background 0.28s ease;
}

html[data-theme="dark"] body.auth-page--split {
    background: linear-gradient(165deg, #14101f 0%, var(--bg-page) 45%, #0f0b18 100%);
}

body.auth-page--split #auth-root.auth-page__root {
    max-width: none;
}

body.auth-page--split .auth-shell {
    grid-template-columns: minmax(300px, 1.42fr) minmax(260px, 0.78fr);
    min-height: 0;
    border-radius: 0;
    box-shadow: none;
    border: none;
}

.auth-hero {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 520px;
    border-radius: 40px 0 0 40px;
    overflow: hidden;
    isolation: isolate;
}

body.auth-page .auth-hero {
    min-height: 0;
    height: 100%;
    align-self: stretch;
    border-radius: 0;
}

.auth-hero__bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
}

.auth-hero__bg-slides {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.auth-hero__bg-slide {
    position: absolute;
    inset: 0;
    z-index: 0;
    background-color: #1a1530;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0;
    transition: opacity 0.55s ease;
    pointer-events: none;
}

.auth-hero__bg-slide.is-active {
    z-index: 1;
    opacity: 1;
}

.auth-hero__overlay {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    flex: 1;
    min-height: 520px;
    padding: 0;
}

body.auth-page .auth-hero__overlay {
    min-height: 0;
    flex: 1 1 auto;
}

.auth-hero__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 26px 24px 16px;
}

.auth-hero__top-link {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.88);
    text-decoration: none;
    text-shadow: 0 1px 10px rgba(0, 0, 0, 0.65);
}

.auth-hero__top-link:hover {
    color: #fff;
}

.auth-hero__top-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.auth-hero__text-link {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.92);
    text-decoration: none;
    text-shadow: 0 1px 10px rgba(0, 0, 0, 0.65);
}

.auth-hero__text-link:hover {
    color: #fff;
}

.auth-hero__pill-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 18px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #fff;
    text-decoration: none;
    border-radius: 999px;
    border: 1.5px solid rgba(255, 255, 255, 0.55);
    background: rgba(255, 255, 255, 0.08);
    transition: background 0.2s ease, border-color 0.2s ease;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5);
}

.auth-hero__pill-btn:hover {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.75);
}

body.auth-page--split .auth-form-panel {
    padding: 28px 44px 32px;
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
    align-self: stretch;
    border-radius: 0;
    overflow: visible;
}

body.auth-page--split .auth-form-panel__toolbar.auth-form-panel__topbar {
    margin-bottom: 28px;
    position: relative;
    z-index: 5;
    overflow: visible;
}

.auth-form-panel__brand {
    display: inline-flex;
    align-items: center;
    gap: 0;
    text-decoration: none;
    color: var(--primary);
}

.auth-form-panel__brand:hover {
    color: var(--primary-hover);
}

body.auth-page--split #authFormPrimary {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 0;
    width: 100%;
    padding: 12px 0;
    box-sizing: border-box;
}

body.auth-page--split #authFormPrimary > * {
    width: 100%;
    max-width: 440px;
}

body.auth-page--split .auth-form-panel > .auth-info-banner {
    align-self: center;
    width: 100%;
    max-width: 440px;
    box-sizing: border-box;
}

body.auth-page--split .auth-form-panel__social {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 22px;
    margin-top: auto;
    padding-top: 28px;
    color: var(--text-tertiary);
}

.auth-form-panel__social-icon {
    display: flex;
    opacity: 0.55;
}

body.auth-page--split .auth-header {
    margin-bottom: 26px;
    text-align: center;
}

body.auth-page--split .auth-header__title {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -0.6px;
    line-height: 1.15;
    margin-bottom: 6px;
}

body.auth-page--split .auth-header__subtitle {
    font-size: 15px;
    color: var(--text-secondary);
    max-width: none;
}

body.auth-page--split .auth-forgot-only {
    display: flex;
    justify-content: flex-end;
    margin: -8px 0 18px;
}

body.auth-page--split .auth-forgot-only .auth-inline-link {
    font-size: 13px;
}

body.auth-page--split .auth-remember-row--compact {
    margin-top: 4px;
    margin-bottom: 16px;
}

body.auth-page--split .auth-divider {
    margin: 8px 0 18px;
}

body.auth-page--split .auth-google-zone {
    margin-bottom: 16px;
}

body.auth-page--split .auth-google-zone .btn--block {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 48px;
    border-radius: 12px;
    font-weight: 600;
}

body.auth-page--split .auth-google-zone .btn--block svg {
    order: 2;
}

body.auth-page--split .btn--auth-submit {
    height: 52px;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 700;
    margin-top: 4px;
}

body.auth-page--split .auth-footer-links {
    border-top: none;
    padding-top: 8px;
    margin-top: 22px;
    text-align: center;
}

body.auth-page--split .auth-footer-links a {
    color: var(--primary);
}

@media (max-width: 900px) {
    body.auth-page--split .auth-shell {
        grid-template-columns: 1fr;
        grid-template-rows: minmax(200px, 34vh) 1fr;
        border-radius: 0;
    }

    .auth-hero {
        min-height: 280px;
        border-radius: 28px 28px 0 0;
    }

    body.auth-page .auth-hero {
        min-height: 0;
        height: auto;
        border-radius: 0;
    }

    .auth-hero__overlay {
        min-height: 280px;
    }

    body.auth-page .auth-hero__overlay {
        min-height: 0;
    }

    body.auth-page--split .auth-form-panel {
        padding: 24px 22px 28px;
        border-radius: 0;
        min-height: 0;
        height: auto;
        flex: 1 1 auto;
    }
}

@media (max-width: 520px) {
    body.auth-page {
        padding: 0;
    }

    body.auth-page--split .auth-header__title {
        font-size: 26px;
    }
}

.auth-brand-panel {
    padding: 40px 36px 36px;
    background: linear-gradient(165deg, var(--primary-lighter) 0%, var(--primary-light) 48%, #f0ebff 100%);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: relative;
}

.auth-brand-panel__logo {
    display: inline-flex;
    align-items: center;
    gap: 0;
    text-decoration: none;
    color: var(--text-primary);
    margin-bottom: 28px;
}

.auth-brand-panel__tagline {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.35;
    margin-bottom: 12px;
    letter-spacing: -0.2px;
}

.auth-brand-panel__lead {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    max-width: 320px;
    margin-bottom: 24px;
}

.auth-brand-panel__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 28px;
}

.auth-brand-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: var(--radius-pill);
    font-size: 12px;
    font-weight: 600;
    color: var(--primary-dark);
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.auth-brand-panel__features {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin: 0;
    padding: 0;
}

.auth-brand-feature {
    display: flex;
    align-items: center;
    gap: 12px;
}

.auth-brand-feature__icon {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(124, 92, 252, 0.15);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
}

.auth-brand-feature__text {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    line-height: 1.4;
}

.auth-brand-panel__art {
    margin-top: auto;
    height: 138px;
    border-radius: var(--radius-lg);
    position: relative;
    overflow: hidden;
    background: linear-gradient(155deg, rgba(124, 92, 252, 0.06) 0%, rgba(124, 92, 252, 0.02) 100%);
}

.auth-brand-art__card {
    position: absolute;
    left: 50%;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(124, 92, 252, 0.12);
    box-shadow: 0 2px 8px rgba(124, 92, 252, 0.06);
}

.auth-brand-art__card::before,
.auth-brand-art__card::after {
    content: '';
    display: block;
    border-radius: var(--radius-pill);
    background: rgba(124, 92, 252, 0.12);
}

.auth-brand-art__card::before {
    height: 6px;
    width: 55%;
    margin-bottom: 7px;
}

.auth-brand-art__card::after {
    height: 6px;
    width: 38%;
}

.auth-brand-art__card--1 {
    width: 154px;
    height: 60px;
    padding: 13px 16px;
    bottom: 32px;
    z-index: 1;
    transform: translate(calc(-50% - 52px), 0) rotate(-5deg);
}

.auth-brand-art__card--2 {
    width: 150px;
    height: 58px;
    padding: 13px 15px;
    bottom: 14px;
    z-index: 3;
    transform: translate(-50%, 0) rotate(1deg);
    background: rgba(255, 255, 255, 0.88);
    border-color: rgba(124, 92, 252, 0.18);
    box-shadow: 0 3px 12px rgba(124, 92, 252, 0.08);
}

.auth-brand-art__card--2::before { width: 60%; }
.auth-brand-art__card--2::after  { width: 42%; }

.auth-brand-art__card--3 {
    width: 140px;
    height: 54px;
    padding: 12px 14px;
    bottom: 34px;
    z-index: 2;
    transform: translate(calc(-50% + 46px), 0) rotate(5deg);
    background: rgba(255, 255, 255, 0.62);
    border-color: rgba(124, 92, 252, 0.10);
}

.auth-brand-art__card--3::before { width: 50%; background: rgba(124, 92, 252, 0.09); }
.auth-brand-art__card--3::after  { width: 35%; background: rgba(124, 92, 252, 0.07); }

.auth-form-panel {
    padding: 28px 40px 36px;
    display: flex;
    flex-direction: column;
    position: relative;
    background: var(--bg-panel);
    transition: background-color 0.24s ease, border-color 0.24s ease;
}

.auth-form-panel__toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.auth-form-panel__toolbar-actions {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}

.auth-form-panel__back {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none;
}

.auth-form-panel__back:hover {
    color: var(--primary);
}

.auth-header {
    margin-bottom: 22px;
}

.auth-header__title {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.4px;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.auth-header__typewriter.is-typing::after {
    content: '';
    display: inline-block;
    width: 2px;
    height: 0.95em;
    margin-left: 3px;
    vertical-align: -0.08em;
    background: currentColor;
    opacity: 0.9;
    animation: nf-auth-caret-blink 0.76s steps(1, end) infinite;
}

@keyframes nf-auth-caret-blink {
    0%,
    45% {
        opacity: 0.9;
    }
    50%,
    100% {
        opacity: 0.08;
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-header__typewriter.is-typing::after {
        animation: none;
        opacity: 0;
    }
}

.auth-header__subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.55;
    max-width: 400px;
}

.auth-google-zone {
    margin-bottom: 18px;
}

.auth-google-zone .auth-modal__gis {
    min-height: 44px;
    margin-bottom: 8px;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 6px 0 20px;
    color: var(--text-tertiary);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.auth-form {
    max-width: 420px;
}

.auth-form .form-group {
    margin-bottom: 16px;
}

.auth-password-field__wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.auth-password-field__wrap .form-input {
    padding-right: 100px;
}

.auth-password-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
    border-radius: var(--radius-sm);
    background: var(--primary-lighter);
}

.auth-password-toggle:hover {
    background: var(--primary-light);
}

.auth-remember-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
}

.auth-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}

.auth-checkbox input {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
}

.auth-inline-link {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
}

.auth-inline-link--center {
    display: block;
    text-align: center;
    margin-top: 12px;
}

.auth-footer-links {
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    font-size: 13px;
    color: var(--text-secondary);
}

.auth-footer-links a {
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
}

.auth-footer-note {
    margin-top: 14px;
    font-size: 12px;
    color: var(--text-tertiary);
    line-height: 1.5;
    max-width: 400px;
}

.btn--auth-submit {
    height: 44px;
    font-size: 14px;
    border-radius: var(--radius-md);
}

.btn.is-loading {
    opacity: 0.72;
    pointer-events: none;
    cursor: wait;
}

.auth-field--error .form-input {
    border-color: #f87171;
}

.auth-field__error:not([hidden]) {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #dc2626;
}

.auth-form-hint {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-top: 6px;
    line-height: 1.45;
}

.auth-password-strength {
    margin-top: 10px;
    font-size: 12px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.auth-password-strength__label {
    color: var(--text-tertiary);
    font-weight: 500;
}

.auth-password-strength__value {
    font-weight: 700;
    color: var(--text-secondary);
}

.auth-password-strength__track {
    width: 100%;
    flex-basis: 100%;
    height: 6px;
    border-radius: var(--radius-pill);
    background: var(--border);
    overflow: hidden;
}

.auth-password-strength__fill {
    display: block;
    height: 100%;
    width: 33%;
    border-radius: var(--radius-pill);
    background: #f59e0b;
    transition: width 0.2s ease, background 0.2s ease;
}

.auth-password-strength.is-medium .auth-password-strength__fill {
    background: #eab308;
}

.auth-password-strength.is-strong .auth-password-strength__fill {
    background: var(--accent-green-text);
}

.auth-password-strength.is-strong .auth-password-strength__value {
    color: var(--accent-green-text);
}

.auth-logged-banner {
    text-align: center;
    padding: 32px 8px 8px;
    max-width: 400px;
    margin: 0 auto;
}

.auth-logged-banner__icon {
    width: 52px;
    height: 52px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: var(--accent-green-bg);
    color: var(--accent-green-text);
    font-size: 24px;
    line-height: 52px;
    font-weight: 700;
}

.auth-logged-banner__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-top: 22px;
}

.auth-success-state {
    text-align: center;
    padding: 24px 8px 8px;
    max-width: 420px;
}

.auth-success-state__icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 18px;
    border-radius: 50%;
    background: var(--primary-lighter);
    color: var(--primary);
    font-size: 26px;
    line-height: 56px;
    font-weight: 700;
}

.auth-success-state .btn {
    margin-top: 20px;
}

.auth-error-message {
    padding: 12px 14px;
    border-radius: var(--radius-md);
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    font-size: var(--fs-input);
    margin-bottom: 16px;
    line-height: 1.45;
    animation: nf-flash-enter 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.auth-verify-email {
    margin-top: 12px;
    font-size: 14px;
    color: var(--text-secondary);
}

.auth-verify-email strong {
    color: var(--text-primary);
}

.auth-verify-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 420px;
}

.modal__footer--stack {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
}

.auth-modal__email-link {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
    text-align: center;
}

body.auth-page .auth-form-panel .lang-dropdown {
    position: relative;
    z-index: 30;
}

body.auth-page .auth-form-panel .lang-dropdown > .lang-dropdown__menu.dropdown-menu {
    z-index: 400;
}

.auth-info-banner {
    max-width: 420px;
    padding: 12px 16px;
    margin-bottom: 18px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.45;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    background: var(--bg-hover);
    color: var(--text-primary);
    animation: nf-flash-enter 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.auth-info-banner--info {
    border-color: rgba(59, 130, 246, 0.25);
    background: var(--accent-blue-bg);
    color: #1e40af;
}

.auth-info-banner--success {
    border-color: rgba(124, 92, 252, 0.15);
    background: var(--primary-lighter);
    color: var(--text-primary);
}

.auth-google-zone__title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin: 0 0 10px;
}

.auth-brand-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 4px;
}

.auth-brand-stat {
    padding: 10px 14px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    line-height: 1.35;
}

.auth-brand-stat__label {
    display: block;
}

.auth-trust-note {
    font-size: 12px;
    color: var(--text-tertiary);
    margin: 12px 0 0;
    line-height: 1.45;
}

.auth-gis-loading {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
    padding: 10px 0;
    text-align: center;
}

.auth-caps-hint {
    font-size: 12px;
    color: #b45309;
    margin-top: 8px;
    padding: 6px 10px;
    border-radius: var(--radius-xs);
    background: var(--accent-amber-bg);
    border: 1px solid rgba(217, 119, 6, 0.2);
}

.auth-match-hint {
    font-size: 12px;
    margin-top: 8px;
    padding: 6px 10px;
    border-radius: var(--radius-xs);
    font-weight: 500;
}

.auth-match-hint--ok {
    color: var(--text-primary);
    background: var(--primary-lighter);
    border: 1px solid rgba(124, 92, 252, 0.15);
    animation: nf-flash-enter 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.auth-match-hint--bad {
    color: #b91c1c;
    background: #fef2f2;
    border: 1px solid #fecaca;
    animation: nf-flash-enter 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.auth-password-strength.is-weak .auth-password-strength__fill {
    background: #ef4444;
}

.auth-password-strength.is-weak .auth-password-strength__value {
    color: #dc2626;
}

.auth-verify-card {
    padding: 20px 20px 4px;
    border-radius: var(--radius-lg);
    background: var(--bg-hover);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-card);
    max-width: 420px;
}

.auth-inline-success {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    padding: 10px 12px;
    margin-bottom: 14px;
    border-radius: var(--radius-md);
    background: var(--primary-lighter);
    border: 1px solid rgba(124, 92, 252, 0.15);
    animation: nf-flash-enter 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.topbar__register-link {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none;
    white-space: nowrap;
}

.topbar__register-link:hover {
    color: var(--primary);
}

.dashboard-board {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-bottom: 8px;
}

.dashboard-welcome-wrap {
    margin-top: -12px;
    margin-bottom: 20px;
}

.dashboard-welcome-wrap .dashboard-welcome {
    margin-top: 0;
    margin-bottom: 6px;
}

.dashboard-welcome__activity {
    font-size: 13px;
    font-weight: 500;
    color: var(--primary-dark);
    margin: 0 0 0 2px;
    padding-left: 14px;
    border-left: 3px solid rgba(124, 92, 252, 0.35);
}

.dashboard-kpis {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.dashboard-kpis .dashboard-stat-card {
    padding: 14px 14px 16px;
    gap: 6px;
}

.dashboard-kpis .dashboard-stat-card__value {
    font-size: 1.65rem;
}

@media (max-width: 1200px) {
    .dashboard-kpis {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .dashboard-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.dashboard-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.dashboard-metric-tile {
    padding: 16px 18px;
    border-radius: var(--radius-lg);
    background: var(--bg-panel);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.dashboard-metric-tile__label {
    color: var(--text-secondary);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.dashboard-metric-tile__value {
    font-size: 1.65rem;
    line-height: 1;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text-primary);
}

.dashboard-metric-tile__hint {
    color: var(--text-tertiary);
    font-size: 0.82rem;
    line-height: 1.35;
}

.dashboard-panel {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.dashboard-stat-card {
    background: var(--bg-panel);
    border: 2px solid transparent;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: color 0.2s ease, box-shadow 0.2s ease;
}

.dashboard-stat-card:hover {
    background:
        linear-gradient(var(--bg-hover), var(--bg-hover)) padding-box,
        linear-gradient(
            90deg,
            var(--primary),
            #9b7efd,
            #c4b5fd,
            #ede9fe,
            var(--primary),
            #9b7efd,
            #c4b5fd,
            #ede9fe,
            var(--primary)
        ) border-box;
    background-size: auto, 200% 100%;
    background-clip: padding-box, border-box;
    animation: note-pinned-border-flow var(--note-border-flow-duration) linear infinite;
}

.dashboard-stat-card__label {
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.dashboard-stat-card__value {
    font-size: 2rem;
    line-height: 1;
    letter-spacing: -0.04em;
}

.dashboard-stat-card__hint {
    color: var(--text-tertiary);
    font-size: 0.88rem;
}

.dashboard-analytics {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(320px, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

.dashboard-panel {
    padding: 20px;
}

.dashboard-panel__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.dashboard-panel__head--tight {
    margin-bottom: 12px;
    align-items: center;
}

.dashboard-panel__head--tight .dashboard-panel__title {
    margin-bottom: 0;
}

.dashboard-panel__title {
    margin: 0 0 6px;
    font-size: 1rem;
    font-weight: 700;
}

.dashboard-panel__copy,
.dashboard-panel__empty {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

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

.dashboard-panel--chart {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

.dashboard-panel--chart .dashboard-trend-chart {
    width: 100%;
    max-width: 100%;
    margin-bottom: 16px;
    box-sizing: border-box;
}

.dashboard-trend-chart {
    width: 100%;
    max-width: 100%;
    position: relative;
    border-radius: 14px;
    overflow: visible;
    background: var(--bg-panel);
    background: color-mix(in srgb, var(--bg-panel) 92%, var(--primary-lighter) 8%);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.dashboard-trend-chart__plot {
    width: 100%;
    max-width: 100%;
    padding: 12px 14px 0;
    box-sizing: border-box;
}

.dashboard-trend-chart__svg {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    min-height: 200px;
    max-height: 260px;
}

.dashboard-trend-chart__lg-stop-a {
    stop-color: var(--primary);
}

.dashboard-trend-chart__lg-stop-b {
    stop-color: var(--primary-dark);
}

.dashboard-trend-chart__fill-stop-a {
    stop-color: var(--primary);
    stop-opacity: 0.2;
}

.dashboard-trend-chart__fill-stop-b {
    stop-color: var(--primary);
    stop-opacity: 0;
}

.dashboard-trend-chart__ylabel {
    fill: var(--text-tertiary);
    font-size: 11px;
    font-weight: 500;
    font-family: var(--font);
}

.dashboard-trend-chart__grid-v {
    stroke: var(--border);
    stroke-width: 1;
    opacity: 0.85;
}

.dashboard-trend-chart__baseline {
    stroke: var(--border-light);
    stroke-width: 1;
    shape-rendering: crispEdges;
}

.dashboard-trend-chart__area {
    pointer-events: none;
}

.dashboard-trend-chart__line {
    stroke: url(#nfTrendStroke);
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
    vector-effect: non-scaling-stroke;
}

.dashboard-trend-chart__dot-wrap {
    cursor: default;
}

.dashboard-trend-chart__dot-hit {
    fill: transparent;
    pointer-events: all;
}

.dashboard-trend-chart__dot {
    fill: var(--primary);
    stroke: var(--primary-dark);
    stroke-width: 1.35;
    pointer-events: none;
}

.dashboard-trend-chart__dot-wrap:hover .dashboard-trend-chart__dot {
    fill: var(--primary-hover);
    stroke: var(--primary-dark);
}

.dashboard-trend-chart__xlabel {
    fill: var(--text-tertiary);
    font-size: 11px;
    font-weight: 500;
    font-family: var(--font);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
    pointer-events: none;
}

.dashboard-trend-tooltip {
    position: fixed;
    z-index: 10050;
    left: 0;
    top: 0;
    margin: 0;
    transform: translateX(-50%);
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.35;
    color: var(--text-primary);
    background: var(--bg-panel);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    pointer-events: none;
    white-space: nowrap;
    max-width: min(280px, calc(100vw - 24px));
    text-overflow: ellipsis;
    overflow: visible;
}

.dashboard-chart {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 12px;
    min-height: 220px;
    align-items: end;
}

.dashboard-chart__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.dashboard-chart__value {
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
}

.dashboard-chart__bar-wrap {
    width: 100%;
    height: 150px;
    display: flex;
    align-items: flex-end;
    padding: 0 6px;
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(124, 92, 252, 0.06), rgba(124, 92, 252, 0.01));
}

.dashboard-chart__bar {
    width: 100%;
    min-height: 8px;
    border-radius: 12px 12px 6px 6px;
    background: linear-gradient(180deg, #8b5cf6, #7c5cfc);
}

.dashboard-chart__label {
    color: var(--text-tertiary);
    font-size: 0.78rem;
    font-weight: 600;
}

.dashboard-breakdown {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.dashboard-breakdown__row {
    display: grid;
    grid-template-columns: minmax(110px, 1fr) minmax(120px, 1.6fr) auto;
    align-items: center;
    gap: 12px;
}

.dashboard-breakdown__meta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    font-size: 0.9rem;
    font-weight: 500;
}

.dashboard-breakdown__bar {
    height: 10px;
    border-radius: 999px;
    background: var(--bg-secondary);
    overflow: hidden;
}

.dashboard-breakdown__bar > span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #7c5cfc, #a78bfa);
}

.dashboard-breakdown__count {
    font-size: 0.86rem;
}

.dashboard-panel--table {
    margin-bottom: 24px;
}

.dashboard-table-wrap {
    width: 100%;
    overflow-x: auto;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--bg-hover);
}

.dashboard-data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.dashboard-data-table thead th {
    text-align: left;
    padding: 12px 14px;
    color: var(--text-tertiary);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border-bottom: 1px solid var(--border);
    background: var(--bg-panel);
    white-space: nowrap;
}

.dashboard-data-table tbody td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-secondary);
    vertical-align: middle;
}

.dashboard-data-table tbody tr:last-child td {
    border-bottom: none;
}

.dashboard-data-table tbody tr:hover td {
    background: var(--bg-hover);
}

.dashboard-data-table__link {
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    display: inline-block;
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-data-table__link:hover {
    color: var(--primary);
    text-decoration: underline;
}

.dashboard-data-table__empty {
    text-align: center;
    padding: 20px 14px !important;
    color: var(--text-secondary);
}

@media (max-width: 1180px) {
    .dashboard-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-analytics {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .dashboard-stats {
        grid-template-columns: 1fr;
    }

    .dashboard-metrics {
        grid-template-columns: 1fr;
    }

    .dashboard-chart {
        gap: 8px;
    }

    .dashboard-data-table thead {
        display: none;
    }

    .dashboard-data-table tbody tr {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 4px 12px;
        padding: 14px 12px;
        border-bottom: 1px solid var(--border);
    }

    .dashboard-data-table tbody tr:hover td {
        background: transparent;
    }

    .dashboard-data-table tbody td {
        display: block;
        padding: 4px 0;
        border: none;
    }

    .dashboard-data-table tbody td:first-child {
        grid-column: 1 / -1;
    }

    .dashboard-data-table__link {
        max-width: none;
        white-space: normal;
    }

    .dashboard-data-table tbody tr:last-child:not(:only-child) {
        border-bottom: none;
    }

    .dashboard-data-table tbody tr.dashboard-data-table__row--empty {
        display: table-row;
        padding: 0;
    }

    .dashboard-data-table tbody tr.dashboard-data-table__row--empty td {
        display: table-cell;
        grid-column: auto;
    }
}

.settings-guest-lock-mount:not([hidden]) {
    margin-bottom: 24px;
}

.guest-lock-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 48px 32px;
    border-radius: var(--radius-lg);
    background: var(--bg-panel);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-card);
    max-width: 440px;
    margin: 24px auto 32px;
}

.guest-lock-card__icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary-lighter);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
}

.guest-lock-card__title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    letter-spacing: -0.2px;
}

.guest-lock-card__desc {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.55;
    max-width: 360px;
    margin-bottom: 22px;
}

.guest-lock-card__cta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.toast--warning {
    border-left-color: var(--accent-amber-text);
}

/* ===========================================
   Two-Factor Authentication
   =========================================== */
.two-factor-shell {
    width: 100%;
}

.two-factor-form {
    margin-top: 4px;
}

.two-factor-field {
    margin-bottom: 12px;
}

.two-factor-code-input {
    font-family: ui-monospace, "SF Mono", Menlo, Monaco, Consolas, monospace;
    font-size: 22px;
    letter-spacing: 0.4em;
    text-align: center;
    font-weight: 600;
    padding-block: 14px;
}

.two-factor-code-input--recovery {
    font-size: 18px;
    letter-spacing: 0.18em;
}

.two-factor-actions {
    margin-top: 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.two-factor-cancel-form {
    margin: 0;
}

.auth-inline-link--muted {
    color: var(--text-tertiary);
    background: transparent;
    border: 0;
    cursor: pointer;
    font-size: 13px;
}

.auth-inline-link--muted:hover {
    color: var(--text-secondary);
}

/* Settings panel — 2FA card */
.two-factor-card {
    margin-top: 28px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-panel);
    padding: 20px 22px;
    box-shadow: var(--shadow-sm);
}

.two-factor-card__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 6px;
}

.two-factor-card__title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 6px;
}

.two-factor-card__hint {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.5;
    margin: 0;
}

.two-factor-card__lead {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.55;
    margin: 14px 0 18px;
}

.two-factor-card__body {
    margin-top: 14px;
}

.two-factor-card__status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid var(--border);
    background: var(--bg-soft);
    color: var(--text-secondary);
    flex-shrink: 0;
}

.two-factor-card__status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-tertiary);
}

.two-factor-card__status--on {
    background: rgba(34, 197, 94, 0.12);
    border-color: rgba(34, 197, 94, 0.35);
    color: rgb(21, 128, 61);
}
.two-factor-card__status--on .two-factor-card__status-dot {
    background: rgb(34, 197, 94);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
}

.two-factor-card__status--off {
    background: rgba(148, 163, 184, 0.14);
    border-color: rgba(148, 163, 184, 0.35);
}

.two-factor-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
}

/* Setup */
.two-factor-setup {
    display: flex;
    gap: 22px;
    align-items: flex-start;
    flex-wrap: wrap;
    padding: 18px;
    border: 1px dashed var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-soft);
    margin-bottom: 18px;
}

.two-factor-qr {
    flex: 0 0 auto;
    background: #ffffff;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid var(--border);
    line-height: 0;
}

.two-factor-qr svg {
    display: block;
    width: 200px;
    height: 200px;
}

.two-factor-setup__details {
    flex: 1 1 240px;
    min-width: 220px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.two-factor-secret {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 10px 12px;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.two-factor-secret code {
    font-family: ui-monospace, "SF Mono", Menlo, Monaco, Consolas, monospace;
    font-size: 14px;
    color: var(--text-primary);
    word-break: break-all;
    flex: 1 1 auto;
}

.two-factor-confirm-form {
    margin-top: 4px;
}

.two-factor-confirm-form .settings-save-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    margin-top: 14px;
}

.two-factor-confirm-form .settings-save-bar form.inline-form {
    margin: 0;
}

/* Recovery codes banner */
.two-factor-recovery-banner {
    margin: 4px 0 18px;
    padding: 16px 18px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(245, 158, 11, 0.4);
    background: rgba(254, 243, 199, 0.55);
}

.two-factor-recovery-banner h4 {
    margin: 0 0 6px;
    font-size: 14px;
    font-weight: 700;
    color: rgb(120, 53, 15);
}

.two-factor-recovery-banner p {
    margin: 0 0 12px;
    color: rgb(120, 53, 15);
    font-size: 13px;
    line-height: 1.55;
}

.two-factor-recovery-codes {
    list-style: none;
    margin: 0 0 12px;
    padding: 12px 14px;
    background: #ffffff;
    border-radius: 10px;
    border: 1px solid rgba(245, 158, 11, 0.35);
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px 18px;
}

.two-factor-recovery-codes code {
    font-family: ui-monospace, "SF Mono", Menlo, Monaco, Consolas, monospace;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.06em;
    color: var(--text-primary);
}

.two-factor-recovery-banner__actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Disable details/summary */
.two-factor-disable {
    margin-top: 8px;
}

.two-factor-disable__summary {
    list-style: none;
    cursor: pointer;
}

.two-factor-disable__summary::-webkit-details-marker { display: none; }

.two-factor-disable[open] .two-factor-disable__summary {
    margin-bottom: 14px;
}

.two-factor-disable__form {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
    background: var(--bg-soft);
}

.two-factor-disable__form .settings-save-bar {
    display: flex;
    justify-content: flex-end;
    margin-top: 14px;
}

/* Trusted devices */
.two-factor-trusted-devices {
    margin-top: 24px;
    border-top: 1px solid var(--border);
    padding-top: 18px;
}

.two-factor-trusted-devices__title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 10px;
}

.two-factor-trusted-devices__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.two-factor-trusted-devices__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg-panel);
    flex-wrap: wrap;
}

.two-factor-trusted-devices__item strong {
    display: block;
    font-size: 13px;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.two-factor-trusted-devices__meta {
    display: block;
    font-size: 12px;
    color: var(--text-tertiary);
    line-height: 1.5;
}

.two-factor-trusted-devices__item .inline-form { margin: 0; }

/* Dark mode */
html[data-theme="dark"] .two-factor-qr {
    background: #1f2937;
    border-color: rgba(148, 163, 184, 0.3);
}

html[data-theme="dark"] .two-factor-card__status--on {
    background: rgba(34, 197, 94, 0.18);
    border-color: rgba(34, 197, 94, 0.4);
    color: rgb(134, 239, 172);
}

html[data-theme="dark"] .two-factor-card__status--off {
    background: rgba(148, 163, 184, 0.18);
    color: var(--text-secondary);
}

html[data-theme="dark"] .two-factor-recovery-banner {
    background: rgba(120, 53, 15, 0.25);
    border-color: rgba(245, 158, 11, 0.5);
}
html[data-theme="dark"] .two-factor-recovery-banner h4,
html[data-theme="dark"] .two-factor-recovery-banner p {
    color: rgb(254, 215, 170);
}
html[data-theme="dark"] .two-factor-recovery-codes {
    background: rgba(15, 23, 42, 0.65);
    border-color: rgba(245, 158, 11, 0.45);
}

html[data-theme="dark"] .two-factor-setup {
    background: rgba(148, 163, 184, 0.08);
    border-color: rgba(148, 163, 184, 0.3);
}

@media (max-width: 640px) {
    .two-factor-setup { flex-direction: column; align-items: stretch; }
    .two-factor-qr { align-self: center; }
    .two-factor-recovery-codes { grid-template-columns: 1fr; }
    .two-factor-card__head { flex-direction: column; align-items: flex-start; }
}

/* ============================================================
   Spotify integration (topbar chip + settings + workspace member)
   ============================================================ */

/* Topbar chip — wrapper matches .topbar__user-wrap pattern (padding-box + border-box) */
.topbar-spotify {
    position: relative;
    display: inline-flex;
    align-items: center;
    max-width: 280px;
    margin-right: 8px;
    border-radius: var(--radius-md);
    border: 2px solid transparent;
    background:
        linear-gradient(var(--bg-panel), var(--bg-panel)) padding-box,
        linear-gradient(
            90deg,
            #1ED760,
            #1FDF7C,
            #66f0a3,
            #c5f8d8,
            #1ED760,
            #1FDF7C,
            #66f0a3,
            #c5f8d8,
            #1ED760
        ) border-box;
    background-size: auto, 200% 100%;
    background-clip: padding-box, border-box;
}
.topbar-spotify.is-playing {
    animation: note-pinned-border-flow var(--note-border-flow-duration) linear infinite;
}
.topbar-spotify[hidden] { display: none !important; }
.topbar-spotify__inner {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 4px 12px 4px 10px;
    border-radius: calc(var(--radius-md) - 2px);
    background: var(--bg-panel);
    color: var(--text-primary);
    text-decoration: none;
    font-size: 12px;
    line-height: 1.15;
    transition: background 0.2s ease;
    max-width: 100%;
}
.topbar-spotify__inner:hover {
    background: rgba(30, 215, 96, 0.08);
}
.topbar-spotify__cover {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(30, 215, 96, 0.12);
    flex: 0 0 auto;
    transition: border-radius 0.45s ease;
}
.topbar-spotify__cover.is-album { border-radius: 5px; }
.topbar-spotify__cover-logo,
.topbar-spotify__cover-album {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    transition: opacity 0.45s ease, transform 0.45s ease;
}
.topbar-spotify__cover-logo {
    padding: 4px;
    box-sizing: border-box;
    opacity: 1;
    transform: scale(1);
}
.topbar-spotify__cover-album {
    object-fit: cover;
    border-radius: 5px;
    opacity: 0;
    transform: scale(1.05);
    pointer-events: none;
}
.topbar-spotify__cover.is-album .topbar-spotify__cover-logo {
    opacity: 0;
    transform: scale(0.85);
}
.topbar-spotify__cover.is-album .topbar-spotify__cover-album {
    opacity: 1;
    transform: scale(1);
}
.topbar-spotify__cover-album:not([src]),
.topbar-spotify__cover-album[src=""] {
    display: none;
}
.topbar-spotify__device {
    position: absolute;
    right: -4px;
    bottom: -4px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #1ED760;
    color: #0b0b0b;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 2px var(--bg-panel);
    pointer-events: auto;
    z-index: 2;
}
.topbar-spotify__device[hidden] { display: none !important; }
.topbar-spotify__device svg {
    width: 9px;
    height: 9px;
    display: block;
}
html[data-theme="dark"] .topbar-spotify__device {
    box-shadow: 0 0 0 2px var(--bg-panel);
}
.topbar-spotify__bars {
    display: inline-flex;
    align-items: flex-end;
    gap: 2px;
    height: 14px;
    flex: 0 0 auto;
}
.topbar-spotify__bars i {
    width: 3px;
    height: 100%;
    background: #1ED760;
    border-radius: 2px;
    transform-origin: bottom;
    animation: topbarSpotifyBars 1s ease-in-out infinite;
}
.topbar-spotify__bars i:nth-child(2) { animation-delay: 0.15s; }
.topbar-spotify__bars i:nth-child(3) { animation-delay: 0.3s; }
.topbar-spotify:not(.is-playing) .topbar-spotify__bars i,
.topbar-spotify__bars.is-paused i {
    animation-play-state: paused;
    transform: scaleY(0.4);
    opacity: 0.6;
}
@keyframes topbarSpotifyBars {
    0%, 100% { transform: scaleY(0.35); }
    50%      { transform: scaleY(1); }
}
.topbar-spotify__text {
    display: inline-flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}
.topbar-spotify__title {
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}
.topbar-spotify__artist {
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}
html[data-theme="dark"] .topbar-spotify__inner { background: var(--bg-panel); }
html[data-theme="dark"] .topbar-spotify__inner:hover { background: rgba(30, 215, 96, 0.14); }
html[data-theme="dark"] .topbar-spotify__cover { background: rgba(30, 215, 96, 0.18); }

@media (prefers-reduced-motion: reduce) {
    .topbar-spotify { animation: none; }
}

@media (max-width: 720px) {
    .topbar-spotify { display: none !important; }
}

/* Topbar playback controls (popover, only on hover while playing) */
.topbar-spotify__controls {
    position: absolute;
    top: calc(100% + 6px);
    left: 50%;
    transform: translate(-50%, -4px);
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 4px 6px;
    background: var(--bg-panel);
    border-radius: var(--radius-md);
    border: 1px solid rgba(30, 215, 96, 0.28);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    transition: opacity 0.18s ease 0.12s, transform 0.18s ease 0.12s, visibility 0s linear 0.3s;
    z-index: 25;
}
.topbar-spotify__controls::before {
    content: '';
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 8px;
    height: 8px;
    background: var(--bg-panel);
    border-left: 1px solid rgba(30, 215, 96, 0.28);
    border-top: 1px solid rgba(30, 215, 96, 0.28);
}
/* Invisible hover bridge so cursor can travel from the chip to the popover
   without losing :hover over the 6px visual gap. */
.topbar-spotify__controls::after {
    content: '';
    position: absolute;
    left: -8px;
    right: -8px;
    top: -12px;
    height: 12px;
    background: transparent;
}
.topbar-spotify:hover .topbar-spotify__controls,
.topbar-spotify:focus-within .topbar-spotify__controls {
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
    transform: translate(-50%, 0);
    transition: opacity 0.15s ease 0s, transform 0.15s ease 0s, visibility 0s linear 0s;
}
.topbar-spotify__btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.topbar-spotify__btn:hover { background: rgba(30, 215, 96, 0.14); color: #1ED760; }
.topbar-spotify__btn:active { transform: scale(0.92); }
.topbar-spotify__btn[disabled],
.topbar-spotify__btn.is-busy {
    opacity: 0.5;
    cursor: progress;
}
.topbar-spotify__btn--toggle .topbar-spotify__icon-pause { display: none; }
.topbar-spotify__btn--toggle.is-playing .topbar-spotify__icon-play { display: none; }
.topbar-spotify__btn--toggle.is-playing .topbar-spotify__icon-pause { display: inline; }
.topbar-spotify__btn[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    top: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-popup, #222);
    color: #fff;
    font-size: 11px;
    line-height: 1;
    padding: 4px 7px;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
    z-index: 30;
}
.topbar-spotify__btn[data-tooltip]:hover::after,
.topbar-spotify__btn[data-tooltip]:focus-visible::after { opacity: 1; }
html[data-theme="dark"] .topbar-spotify__controls { background: var(--bg-panel); border-left-color: rgba(30, 215, 96, 0.28); }
html[data-theme="dark"] .topbar-spotify__btn:hover { background: rgba(30, 215, 96, 0.22); }

/* Settings playback controls + reconsent */
.settings-spotify__controls {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    margin: 8px 0 12px;
    border-radius: var(--radius-md);
    background: rgba(30, 215, 96, 0.08);
    border: 1px solid rgba(30, 215, 96, 0.22);
    width: max-content;
}
.settings-spotify__btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(30, 215, 96, 0.15);
    color: #1ED760;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease, color 0.15s ease;
}
.settings-spotify__btn:hover { background: #1ED760; color: #fff; }
.settings-spotify__btn:active { transform: scale(0.92); }
.settings-spotify__btn[disabled],
.settings-spotify__btn.is-busy { opacity: 0.55; cursor: progress; }
.settings-spotify__btn--toggle { width: 42px; height: 42px; }
.settings-spotify__btn--toggle .settings-spotify__icon-pause { display: none; }
.settings-spotify__btn--toggle.is-playing .settings-spotify__icon-play { display: none; }
.settings-spotify__btn--toggle.is-playing .settings-spotify__icon-pause { display: inline; }
.settings-spotify__btn[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-popup, #222);
    color: #fff;
    font-size: 11px;
    line-height: 1;
    padding: 4px 7px;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
    z-index: 5;
}
.settings-spotify__btn[data-tooltip]:hover::after,
.settings-spotify__btn[data-tooltip]:focus-visible::after { opacity: 1; }

.settings-spotify__reconsent {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 10px 12px;
    margin-bottom: 12px;
    border-radius: var(--radius-md);
    background: rgba(255, 196, 0, 0.08);
    border: 1px solid rgba(255, 196, 0, 0.35);
    color: var(--text-primary);
    font-size: 13px;
    line-height: 1.4;
}
.settings-spotify__reconsent-text { flex: 1 1 240px; }
.settings-spotify__reconsent-btn { white-space: nowrap; }
html[data-theme="dark"] .settings-spotify__reconsent {
    background: rgba(255, 196, 0, 0.10);
    border-color: rgba(255, 196, 0, 0.40);
}

/* Settings card */
.settings-spotify-block .settings-drive-block__head { gap: 10px; }
.settings-spotify-block__logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(30, 215, 96, 0.12);
}
.settings-spotify__connect-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #1ED760;
    border-color: #1ED760;
    color: #052e1b;
}
.settings-spotify__connect-btn:hover {
    background: #1bc257;
    border-color: #1bc257;
}
.settings-spotify__connected {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.settings-spotify__account {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(30, 215, 96, 0.08);
    border: 1px solid rgba(30, 215, 96, 0.25);
}
.settings-spotify__account-name { font-weight: 600; }
.settings-spotify__account-meta { font-size: 12px; color: var(--color-text-secondary, #64748b); }

.settings-spotify-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    background: var(--color-bg-elevated, #ffffff);
    border: 1px solid var(--color-border, #e2e8f0);
}
.settings-spotify-card.is-playing {
    border-color: rgba(30, 215, 96, 0.55);
    box-shadow: 0 0 0 3px rgba(30, 215, 96, 0.12);
}
.settings-spotify-card--idle { opacity: 0.85; }
.settings-spotify-card__cover {
    width: 56px; height: 56px;
    border-radius: 8px;
    object-fit: cover;
    flex: 0 0 auto;
    background: rgba(0,0,0,0.05);
}
.settings-spotify-card__cover-wrap {
    position: relative;
    display: inline-flex;
    flex: 0 0 auto;
}
.settings-spotify-card__device {
    position: absolute;
    right: -4px;
    bottom: -4px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #1ED760;
    color: #0b0b0b;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 2px var(--color-bg-elevated, #ffffff);
    z-index: 2;
}
.settings-spotify-card__device svg {
    width: 12px;
    height: 12px;
    display: block;
}
html[data-theme="dark"] .settings-spotify-card__device {
    box-shadow: 0 0 0 2px rgba(30, 30, 30, 1);
}
.settings-spotify-card__body { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.settings-spotify-card__label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-secondary, #64748b);
    margin-bottom: 2px;
}
.settings-spotify-card.is-playing .settings-spotify-card__label { color: #1ED760; }
.settings-spotify-card__pulse {
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #1ED760;
    box-shadow: 0 0 0 0 rgba(30, 215, 96, 0.6);
    animation: spotifyPulse 1.4s ease-out infinite;
}
@keyframes spotifyPulse {
    0%   { box-shadow: 0 0 0 0 rgba(30, 215, 96, 0.6); }
    70%  { box-shadow: 0 0 0 8px rgba(30, 215, 96, 0); }
    100% { box-shadow: 0 0 0 0 rgba(30, 215, 96, 0); }
}
.settings-spotify-card__title {
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.settings-spotify-card__artist {
    color: var(--color-text-secondary, #64748b);
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.settings-spotify-card__open {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px; height: 28px;
    border-radius: 6px;
    color: var(--color-text-secondary, #64748b);
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
    flex: 0 0 auto;
}
.settings-spotify-card__open:hover {
    background: rgba(30, 215, 96, 0.12);
    color: #1ED760;
}
.settings-spotify__privacy { margin: 0; }

html[data-theme="dark"] .settings-spotify-card {
    background: rgba(148, 163, 184, 0.06);
    border-color: rgba(148, 163, 184, 0.25);
}
html[data-theme="dark"] .settings-spotify__account {
    background: rgba(30, 215, 96, 0.1);
    border-color: rgba(30, 215, 96, 0.35);
}

/* Workspace member spotify card — wrapper carries the animated Spotify-green border */
.workspace-member-card__spotify {
    margin-top: 12px;
    position: relative;
    border-radius: var(--radius-md);
    border: 2px solid transparent;
    background:
        linear-gradient(var(--bg-panel), var(--bg-panel)) padding-box,
        linear-gradient(
            90deg,
            #1ED760,
            #1FDF7C,
            #66f0a3,
            #c5f8d8,
            #1ED760,
            #1FDF7C,
            #66f0a3,
            #c5f8d8,
            #1ED760
        ) border-box;
    background-size: auto, 200% 100%;
    background-clip: padding-box, border-box;
}
.workspace-member-card__spotify:has(.workspace-member-spotify.is-playing) {
    animation: note-pinned-border-flow var(--note-border-flow-duration) linear infinite;
}
.workspace-member-card__spotify.is-empty { display: none; }

.workspace-member-spotify {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: calc(var(--radius-md) - 2px);
    background: var(--bg-panel);
    border: none;
    text-decoration: none;
    color: var(--text-primary);
    transition: background 0.2s ease;
}
.workspace-member-spotify:hover {
    background: rgba(30, 215, 96, 0.08);
}

@media (prefers-reduced-motion: reduce) {
    .workspace-member-card__spotify { animation: none; }
}
.workspace-member-spotify__cover-wrap {
    position: relative;
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
}
.workspace-member-spotify__cover {
    width: 40px; height: 40px;
    border-radius: 8px;
    object-fit: cover;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.6);
}
.workspace-member-spotify .topbar-spotify__device {
    width: 15px;
    height: 15px;
    right: -3px;
    bottom: -3px;
    pointer-events: none;
    box-shadow: 0 0 0 2px var(--bg-panel, #fff);
}
.workspace-member-spotify .topbar-spotify__device svg {
    width: 9px;
    height: 9px;
}
html[data-theme="dark"] .workspace-member-spotify .topbar-spotify__device {
    box-shadow: 0 0 0 2px var(--bg-panel, #1e1e1e);
}
.workspace-member-spotify__text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.workspace-member-spotify__label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #1ED760;
}
.workspace-member-spotify__pulse {
    display: inline-block;
    width: 6px; height: 6px;
    border-radius: 50%;
    background: #1ED760;
    box-shadow: 0 0 0 0 rgba(30, 215, 96, 0.6);
    animation: spotifyPulse 1.4s ease-out infinite;
}
.workspace-member-spotify__title {
    font-weight: 600;
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.workspace-member-spotify__artist {
    font-size: 12px;
    color: var(--color-text-secondary, #64748b);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
html[data-theme="dark"] .workspace-member-spotify {
    background: rgba(30, 215, 96, 0.12);
    border-color: rgba(30, 215, 96, 0.35);
}
html[data-theme="dark"] .workspace-member-spotify__cover {
    background: rgba(255, 255, 255, 0.08);
}

/* ===== Admin Panel ===== */
.admin-page .page-header {
    align-items: flex-start;
}
.admin-back-link {
    display: inline-block;
    font-size: 13px;
    color: var(--text-secondary);
    text-decoration: none;
    margin-bottom: 6px;
}
.admin-back-link:hover { color: var(--primary); }

.admin-tabs {
    display: flex;
    gap: 6px;
    border-bottom: 1px solid var(--border);
    margin: 8px 0 22px;
    overflow-x: auto;
    padding-bottom: 0;
}
.admin-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    border-radius: 6px 6px 0 0;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    white-space: nowrap;
}
.admin-tab:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}
.admin-tab.is-active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: transparent;
}

.admin-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}
.admin-stat-card {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px 18px;
    box-shadow: var(--shadow-card);
}
.admin-stat-card__label {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-tertiary);
    margin-bottom: 6px;
}
.admin-stat-card__value {
    font-size: 26px;
    font-weight: 700;
    color: var(--text-primary);
}
.admin-stat-card__value--accent { color: var(--primary); }
.admin-stat-card__value--danger { color: #e11d48; }

.admin-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 18px;
}
.admin-card {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: var(--shadow-card);
}
.admin-card--wide { grid-column: 1 / -1; }
.admin-card--table { padding: 0; }
.admin-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-light);
}
.admin-card__title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}
.admin-card__link {
    font-size: 12px;
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}
.admin-card__link:hover { color: var(--primary-hover); }

.admin-user-list {
    list-style: none;
    margin: 0;
    padding: 6px 0;
}
.admin-user-list__item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 18px;
    border-bottom: 1px solid var(--border-light);
}
.admin-user-list__item:last-child { border-bottom: none; }
.admin-user-list__body { flex: 1; min-width: 0; }
.admin-user-list__name {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary);
    text-decoration: none;
    display: block;
}
.admin-user-list__name:hover { color: var(--primary); }
.admin-user-list__email {
    font-size: 12px;
    color: var(--text-tertiary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.admin-user-list__meta {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.admin-user-list__time {
    font-size: 11px;
    color: var(--text-tertiary);
}

.admin-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--bg-hover);
}
.admin-avatar--xl { width: 72px; height: 72px; }

.admin-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 8px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--bg-hover);
    color: var(--text-secondary);
}
.admin-badge--online {
    color: #16a34a;
    background: rgba(22, 163, 74, 0.08);
    border-color: rgba(22, 163, 74, 0.3);
}
.admin-badge--admin {
    color: var(--primary);
    background: var(--primary-lighter);
    border-color: var(--primary-light);
}
.admin-badge--banned {
    color: #dc2626;
    background: rgba(220, 38, 38, 0.08);
    border-color: rgba(220, 38, 38, 0.3);
}
.admin-badge--muted { color: var(--text-tertiary); }

.admin-live-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #16a34a;
    box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.6);
    animation: adminPulse 1.6s ease-out infinite;
}
.admin-live-dot--lg { width: 12px; height: 12px; }
@keyframes adminPulse {
    0%   { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.55); }
    70%  { box-shadow: 0 0 0 8px rgba(22, 163, 74, 0); }
    100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); }
}
.admin-live-counter {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(22, 163, 74, 0.1);
    color: #16a34a;
    font-weight: 700;
    font-size: 14px;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.admin-table th,
.admin-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-light);
    text-align: left;
    vertical-align: middle;
}
.admin-table th {
    background: var(--bg-panel);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-tertiary);
}
.admin-table tbody tr:hover { background: var(--bg-hover); }
.admin-table__muted { color: var(--text-tertiary); }
.admin-table__ua {
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.admin-table__actions-col { text-align: right; white-space: nowrap; }

.admin-user-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}
.admin-user-cell__name {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.admin-user-cell__name:hover { color: var(--primary); }
.admin-user-cell__email {
    font-size: 11px;
    color: var(--text-tertiary);
}

.admin-empty {
    padding: 22px;
    text-align: center;
    color: var(--text-tertiary);
    font-size: 13px;
}

.admin-chip {
    display: inline-block;
    padding: 2px 8px;
    font-size: 11px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    background: var(--bg-hover);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-secondary);
}

.admin-filter-bar {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin: 0 0 18px;
    padding: 12px 14px;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 12px;
}
.admin-filter-bar__search {
    position: relative;
    flex: 1 1 240px;
    display: flex;
    align-items: center;
}
.admin-filter-bar__search svg {
    position: absolute;
    left: 10px;
    color: var(--text-tertiary);
}
.admin-filter-bar__input {
    width: 100%;
    padding: 8px 10px 8px 34px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-page);
    color: var(--text-primary);
    font-size: 13px;
}
.admin-filter-bar__input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(107, 79, 255, 0.12);
}
.admin-filter-bar__chips {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.admin-chip-btn {
    padding: 6px 11px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--bg-page);
    color: var(--text-secondary);
    text-decoration: none;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.admin-chip-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.admin-chip-btn.is-active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.admin-filter-bar__select {
    padding: 7px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-page);
    color: var(--text-primary);
    font-size: 12px;
}

.admin-row-actions {
    display: inline-flex;
    gap: 6px;
    justify-content: flex-end;
}
.admin-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 11px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-page);
    color: var(--text-primary);
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.admin-btn:hover { background: var(--bg-hover); }
.admin-btn--ghost {
    background: transparent;
    border-color: var(--border);
    color: var(--text-secondary);
}
.admin-btn--primary {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.admin-btn--primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.admin-btn--success {
    background: #16a34a;
    color: #fff;
    border-color: #16a34a;
}
.admin-btn--success:hover { background: #15803d; border-color: #15803d; }
.admin-btn--danger {
    background: #dc2626;
    color: #fff;
    border-color: #dc2626;
}
.admin-btn--danger:hover { background: #b91c1c; border-color: #b91c1c; }
.admin-btn--danger-outline {
    background: transparent;
    color: #dc2626;
    border-color: rgba(220, 38, 38, 0.4);
}
.admin-btn--danger-outline:hover {
    background: rgba(220, 38, 38, 0.08);
    border-color: #dc2626;
}

.admin-pagination {
    margin-top: 20px;
    display: flex;
    justify-content: center;
}

.admin-flash {
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 13px;
    margin-bottom: 14px;
    border: 1px solid var(--border);
}
.admin-flash--success {
    background: rgba(22, 163, 74, 0.08);
    border-color: rgba(22, 163, 74, 0.3);
    color: #166534;
}
.admin-flash--error {
    background: rgba(220, 38, 38, 0.08);
    border-color: rgba(220, 38, 38, 0.3);
    color: #991b1b;
}
html[data-theme="dark"] .admin-flash--success { color: #86efac; }
html[data-theme="dark"] .admin-flash--error { color: #fecaca; }

.admin-user-header {
    display: flex;
    gap: 20px;
    padding: 18px;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 14px;
    margin-bottom: 16px;
}
.admin-user-header__meta { flex: 1; }
.admin-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 12px 18px;
}
.admin-meta-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.admin-meta-value {
    display: block;
    font-size: 13px;
    color: var(--text-primary);
    margin-top: 2px;
}
.admin-ban-note {
    margin-top: 14px;
    padding: 10px 12px;
    background: rgba(220, 38, 38, 0.08);
    border: 1px solid rgba(220, 38, 38, 0.3);
    border-radius: 8px;
    font-size: 12px;
    color: #991b1b;
}
.admin-ban-note--info {
    background: var(--primary-lighter);
    border-color: var(--primary-light);
    color: var(--primary);
}
html[data-theme="dark"] .admin-ban-note { color: #fecaca; }

.admin-action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.admin-helper-text {
    margin-top: 12px;
    font-size: 12px;
    color: var(--text-tertiary);
    text-align: center;
}

/* ============================================================
   ============================================================
   MOBILE SHELL — responsive breakpoints
   tablet: 641–1024px (sidebar mini zorla, topbar kompakt)
   mobile: ≤640px (sidebar+topbar gizle, mobil header + bottom nav)
   ============================================================ */

:root {
    --mobile-header-h: 56px;
    --mobile-bottom-nav-h: 64px;
    --mobile-bottom-nav-gap: 8px;
    --mobile-safe-bottom: env(safe-area-inset-bottom, 0px);
    --mobile-safe-top: env(safe-area-inset-top, 0px);
}

/* --------------- Desktop defaults: hide mobile-only widgets --------------- */
.mobile-header,
.mobile-bottom-nav,
.mobile-sheet,
.mobile-search-overlay {
    display: none;
}

/* =================== TABLET: 641–1024px =================== */
@media (min-width: 641px) and (max-width: 1024px) {
    :root {
        --sidebar-width: 72px;
        --topbar-height: 60px;
        --page-inline-gutter: 20px;
    }

    body {
        /* Tablet: force mini sidebar regardless of saved preference */
    }

    .topbar {
        gap: 10px;
        padding: 0 16px;
    }

    .topbar__search {
        max-width: 260px;
    }

    .topbar-workspace-switcher .filters-bar__dropdown-btn {
        padding: 0 10px;
    }

    .topbar-workspace-switcher .filters-bar__dropdown-btn small {
        display: none;
    }

    .topbar-spotify__text {
        display: none;
    }

    .topbar__user-name {
        display: none;
    }

    .topbar__user-chevron {
        display: none;
    }

    /* Stack settings / workspace-settings */
    .settings-page,
    .workspace-settings-page {
        flex-direction: column;
    }

    .settings-page-sidebar,
    .workspace-settings-sidebar {
        position: relative;
        top: auto;
        width: 100%;
        max-height: none;
    }
}

/* =================== MOBILE: ≤640px =================== */
@media (max-width: 640px) {
    :root {
        --page-inline-gutter: 16px;
        --topbar-height: 56px;
        --fs-title-page: 18px;
    }

    /* Allow native body scroll on mobile (desktop locks it at body/#app-root) */
    html {
        overflow-x: hidden;
        overflow-y: auto;
        height: auto;
        min-height: 100%;
    }

    body {
        display: block;
        overflow: visible;
        height: auto;
        min-height: 100vh;
        min-height: 100dvh;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-y: contain;
    }

    #app-root {
        display: block;
        height: auto;
        min-height: 100vh;
        min-height: 100dvh;
        overflow: visible;
        flex: initial;
    }

    /* Hide desktop shell */
    .sidebar,
    .topbar {
        display: none !important;
    }

    /* Flatten shell to single column and allow body scroll */
    .app-shell {
        display: block;
        flex-direction: column;
        height: auto;
        min-height: 100vh;
        min-height: 100dvh;
        overflow: visible;
    }

    .main-content {
        display: block;
        height: auto;
        min-height: calc(100vh - var(--mobile-header-h));
        min-height: calc(100dvh - var(--mobile-header-h));
        overflow: visible;
    }

    .page-content {
        padding: 16px var(--page-inline-gutter)
            calc(var(--mobile-bottom-nav-h) + var(--mobile-safe-bottom) + 24px);
        overflow: visible;
        height: auto;
        min-height: 0;
    }

    /* Mobile shell widgets visible */
    .mobile-header {
        display: flex;
    }

    .mobile-bottom-nav {
        display: flex;
    }

    /* -------- Page content: tighter spacing -------- */
    .page-title {
        font-size: var(--fs-title-page);
        margin-bottom: 16px;
    }

    .page-lead {
        font-size: 0.9rem;
        margin: -8px 0 16px;
    }

    /* Flash/toast margins match the new gutter */
    .main-content > .layout-flash {
        margin-left: var(--page-inline-gutter);
        margin-right: var(--page-inline-gutter);
    }

    /* -------- Filters / toolbars wrap nicely -------- */
    .filters-bar {
        flex-wrap: wrap;
        gap: 8px;
    }

    .filters-bar__search {
        flex: 1 1 100%;
        order: -1;
    }

    .filters-bar__dropdown,
    .notes-toolbar__sort-dropdown {
        flex: 1 1 calc(50% - 4px);
        min-width: 0;
    }

    .filters-bar__dropdown-btn,
    .lang-dropdown__trigger,
    .notes-toolbar__sort-btn {
        width: 100%;
        height: 40px;
    }

    /* Dropdown menus become bottom-anchored full-width */
    .dropdown-menu {
        min-width: 0 !important;
    }

    /* -------- Grids to single column -------- */
    .notes-grid,
    .library-grid,
    .dashboard-stats,
    .dashboard-metrics,
    .dashboard-analytics,
    .notes-list--grid {
        grid-template-columns: 1fr !important;
        gap: 12px;
    }

    /* -------- Page header stacks -------- */
    .page-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        margin-bottom: 12px;
    }

    .page-header__actions {
        flex-wrap: wrap;
        justify-content: flex-start !important;
        gap: 8px;
    }

    .page-header__actions > .btn,
    .page-header__actions > form > .btn {
        flex: 1 1 auto;
        min-width: 0;
        height: 42px;
        padding: 0 12px;
    }

    .toolbar-row {
        gap: 8px;
        margin-bottom: 12px;
    }

    .toolbar-row .notes-toolbar {
        min-width: 100%;
    }

    .view-toggle {
        width: 100%;
    }

    .view-toggle__btn {
        flex: 1 1 0;
        text-align: center;
    }

    /* Buttons: tap target improvements */
    .btn {
        min-height: 40px;
    }

    /* -------- Settings / workspace-settings stack -------- */
    .settings-page,
    .workspace-settings-page {
        flex-direction: column;
        gap: 16px;
    }

    .settings-page-sidebar,
    .workspace-settings-sidebar {
        position: relative;
        top: auto;
        width: 100%;
        max-height: none;
        padding: 10px;
    }

    .workspace-settings-sidebar__nav {
        flex-direction: row;
        overflow-x: auto;
        gap: 6px;
        padding-bottom: 4px;
        scrollbar-width: none;
    }

    .workspace-settings-sidebar__nav::-webkit-scrollbar {
        display: none;
    }

    .workspace-settings-sidebar__link {
        flex-shrink: 0;
        white-space: nowrap;
    }

    .settings-panel {
        padding: 16px;
    }

    .settings-section-title {
        font-size: 14px;
    }

    /* -------- Modals become bottom-sheet / full-screen -------- */
    .modal-overlay.is-open,
    .modal-overlay[open] {
        align-items: flex-end !important;
        padding: 0;
    }

    .modal {
        max-width: 100% !important;
        width: 100% !important;
        border-radius: 16px 16px 0 0 !important;
        max-height: 92dvh;
        padding-bottom: calc(16px + var(--mobile-safe-bottom));
    }

    /* -------- Tables: generic card stack for admin/activity -------- */
    .admin-table {
        display: block;
    }

    .admin-table thead {
        display: none;
    }

    .admin-table tbody,
    .admin-table tr,
    .admin-table td {
        display: block;
        width: 100%;
    }

    .admin-table tbody tr {
        padding: 12px 14px;
        border: 1px solid var(--border);
        border-radius: var(--radius-md);
        margin-bottom: 10px;
        background: var(--bg-panel);
    }

    .admin-table tbody tr:hover {
        background: var(--bg-panel);
    }

    .admin-table td {
        padding: 4px 0;
        border: 0;
    }

    .admin-table__ua {
        max-width: none;
        white-space: normal;
    }

    .admin-filter-bar {
        padding: 10px;
        gap: 8px;
    }

    .admin-filter-bar__search {
        flex: 1 1 100%;
    }

    .admin-action-row {
        gap: 6px;
    }

    /* -------- Workspace cards / members list stack -------- */
    .workspace-members-table,
    .workspace-activity-list {
        font-size: 12px;
    }

    /* -------- Tag table card stack -------- */
    .tag-table__head {
        display: none;
    }

    .tag-table__row {
        grid-template-columns: 1fr auto;
        gap: 6px 12px;
        padding: 12px 14px;
        border-top: 1px solid var(--border);
    }

    .tag-table__name {
        grid-column: 1 / -1;
    }

    .tag-table__count,
    .tag-table__color {
        font-size: 12px;
        color: var(--text-tertiary);
    }

    .tag-table__actions {
        grid-column: 2;
        grid-row: 2;
    }

    /* -------- Reminder card -------- */
    .reminder-card {
        flex-wrap: wrap;
        padding: 12px 14px;
        gap: 10px;
    }

    .reminder-card__icon {
        width: 36px;
        height: 36px;
    }

    .reminder-card__meta {
        flex: 1 1 100%;
        font-size: 12px;
        color: var(--text-tertiary);
        margin-left: 46px;
    }

    /* -------- Topbar spotify (shouldn't show, but just in case) -------- */
    .topbar-spotify {
        display: none !important;
    }

    /* -------- Welcome/landing hero padding -------- */
    .welcome-hero,
    .welcome-section {
        padding-left: 16px;
        padding-right: 16px;
    }

    /* -------- Forms: inputs comfy tap target -------- */
    .form-input,
    .form-select,
    .form-textarea {
        font-size: 16px;
    }

    /* Buttons primary actions become full width on narrow */
    .settings-save-bar,
    .account-panel__actions {
        flex-direction: column;
        align-items: stretch !important;
        gap: 10px;
    }

    .settings-save-bar > .btn,
    .account-panel__actions > .btn {
        width: 100%;
        justify-content: center;
    }

    /* Notes toolbar: wrap, view toggle compact */
    .notes-toolbar {
        flex-wrap: wrap;
        gap: 8px;
    }

    .notes-toolbar__view-group,
    .notes-toolbar__sort-dropdown {
        flex: 1 1 calc(50% - 4px);
    }

    /* Lang / theme / auth items */
    .topbar__auth-guest {
        flex-wrap: wrap;
        gap: 8px;
    }
}

/* ============================================================
   MOBILE HEADER
   ============================================================ */
.mobile-header {
    position: sticky;
    top: 0;
    z-index: 40;
    flex-shrink: 0;
    align-items: center;
    gap: 10px;
    height: var(--mobile-header-h);
    padding: 0 12px;
    padding-top: var(--mobile-safe-top);
    background: var(--bg-panel);
    border-bottom: 1px solid var(--border);
    backdrop-filter: saturate(180%) blur(6px);
    -webkit-backdrop-filter: saturate(180%) blur(6px);
}

.mobile-header__logo {
    display: flex;
    align-items: center;
    flex: 1 1 auto;
    min-width: 0;
    padding: 0 4px;
    text-decoration: none;
    color: inherit;
}

.mobile-header__logo-img {
    max-height: 24px;
    width: auto;
    max-width: 140px;
    object-fit: contain;
}

.mobile-header__actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.mobile-header__btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 0;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.mobile-header__btn:hover,
.mobile-header__btn:focus-visible {
    background: var(--bg-hover);
    color: var(--text-primary);
    outline: none;
}

.mobile-header__btn svg {
    width: 20px;
    height: 20px;
}

.mobile-header__notif-dot {
    position: absolute;
    top: 9px;
    right: 10px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ef4444;
    border: 2px solid var(--bg-panel);
}

.mobile-header__avatar-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1.5px solid var(--border);
    background: var(--primary-lighter);
    color: var(--primary);
    padding: 0;
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.15s ease, transform 0.15s ease;
}

.mobile-header__avatar-btn:hover,
.mobile-header__avatar-btn:focus-visible {
    border-color: var(--primary);
    outline: none;
}

.mobile-header__avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mobile-header__avatar-initials {
    font-weight: 700;
    font-size: 13px;
    line-height: 1;
}

.mobile-header__login {
    display: inline-flex;
    align-items: center;
    height: 36px;
    padding: 0 14px;
    border-radius: 999px;
    background: var(--primary);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}

/* ============================================================
   MOBILE BOTTOM NAV
   ============================================================ */
.mobile-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 35;
    align-items: stretch;
    justify-content: space-around;
    height: calc(var(--mobile-bottom-nav-h) + var(--mobile-safe-bottom));
    padding-bottom: var(--mobile-safe-bottom);
    padding-left: 4px;
    padding-right: 4px;
    background: var(--bg-panel);
    border-top: 1px solid var(--border);
    box-shadow: 0 -6px 20px rgba(20, 16, 40, 0.05);
}

.mobile-bottom-nav__item {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 6px 4px 8px;
    font-size: 10px;
    font-weight: 500;
    line-height: 1.1;
    text-decoration: none;
    color: var(--text-tertiary);
    background: transparent;
    border: 0;
    cursor: pointer;
    transition: color 0.15s ease;
    min-width: 0;
}

.mobile-bottom-nav__item svg {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    transition: transform 0.15s ease;
}

.mobile-bottom-nav__item span {
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mobile-bottom-nav__item:hover,
.mobile-bottom-nav__item:focus-visible {
    color: var(--text-secondary);
    outline: none;
}

.mobile-bottom-nav__item.is-active {
    color: var(--primary);
}

.mobile-bottom-nav__item.is-active svg {
    transform: translateY(-1px);
}

/* Center FAB */
.mobile-bottom-nav__fab-wrap {
    flex: 1 1 0;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    min-width: 0;
    position: relative;
    padding-top: 2px;
}

.mobile-bottom-nav__fab {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: #fff;
    border: 0;
    text-decoration: none;
    box-shadow: 0 8px 20px rgba(124, 92, 252, 0.35);
    transform: translateY(-14px);
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.mobile-bottom-nav__fab:hover,
.mobile-bottom-nav__fab:focus-visible {
    background: var(--primary-hover);
    transform: translateY(-16px);
    outline: none;
}

.mobile-bottom-nav__fab:active {
    transform: translateY(-12px);
}

.mobile-bottom-nav__fab svg {
    width: 24px;
    height: 24px;
}

/* ============================================================
   BOTTOM SHEET (More / User / Notifications)
   ============================================================ */
.mobile-sheet {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    pointer-events: none;
    visibility: hidden;
}

.mobile-sheet.is-open {
    visibility: visible;
    pointer-events: auto;
}

.mobile-sheet__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 8, 20, 0.5);
    opacity: 0;
    transition: opacity 0.2s ease;
    cursor: pointer;
}

.mobile-sheet.is-open .mobile-sheet__backdrop {
    opacity: 1;
}

.mobile-sheet__panel {
    position: relative;
    background: var(--bg-panel);
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.25);
    max-height: 92dvh;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
    padding-bottom: var(--mobile-safe-bottom);
}

.mobile-sheet.is-open .mobile-sheet__panel {
    transform: translateY(0);
}

.mobile-sheet__grabber {
    display: block;
    width: 44px;
    height: 4px;
    border-radius: 2px;
    background: var(--border);
    margin: 8px auto 6px;
    flex-shrink: 0;
}

.mobile-sheet__header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 16px 12px;
    border-bottom: 1px solid var(--border-light);
    flex-shrink: 0;
}

.mobile-sheet__title {
    flex: 1;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.2;
}

.mobile-sheet__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 0;
    background: var(--bg-hover);
    color: var(--text-secondary);
    cursor: pointer;
}

.mobile-sheet__close:hover,
.mobile-sheet__close:focus-visible {
    background: var(--border);
    color: var(--text-primary);
    outline: none;
}

.mobile-sheet__close svg {
    width: 18px;
    height: 18px;
}

.mobile-sheet__body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 12px 12px 20px;
}

.mobile-sheet__section + .mobile-sheet__section {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border-light);
}

.mobile-sheet__section-title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-tertiary);
    margin: 0 10px 6px;
}

.mobile-sheet__link {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 12px;
    border-radius: 12px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    background: transparent;
    border: 0;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s ease;
}

.mobile-sheet__link:hover,
.mobile-sheet__link:focus-visible {
    background: var(--bg-hover);
    outline: none;
}

.mobile-sheet__link.is-active {
    background: var(--primary-lighter);
    color: var(--primary);
    font-weight: 600;
}

.mobile-sheet__link-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: var(--text-secondary);
}

.mobile-sheet__link.is-active .mobile-sheet__link-icon {
    color: var(--primary);
}

.mobile-sheet__link--danger {
    color: #dc2626;
}

.mobile-sheet__link--danger .mobile-sheet__link-icon {
    color: #dc2626;
}

.mobile-sheet__link-meta {
    margin-left: auto;
    font-size: 11px;
    color: var(--text-tertiary);
    font-weight: 500;
}

.mobile-sheet__user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 8px 14px;
}

.mobile-sheet__user-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--primary-lighter);
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    flex-shrink: 0;
}

.mobile-sheet__user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mobile-sheet__user-info {
    min-width: 0;
}

.mobile-sheet__user-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mobile-sheet__user-email {
    font-size: 12px;
    color: var(--text-tertiary);
    line-height: 1.3;
    margin: 2px 0 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Inline chip row (language, theme) */
.mobile-sheet__chip-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 6px 10px 2px;
}

.mobile-sheet__chip-row > form {
    flex: 1 1 auto;
    min-width: 0;
}

.mobile-sheet__chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    justify-content: center;
    padding: 8px 10px;
    border-radius: 10px;
    background: var(--bg-hover);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.mobile-sheet__chip.is-active {
    border-color: var(--primary);
    background: var(--primary-lighter);
    color: var(--primary);
}

/* Workspace switcher accordion inside sheet */
.mobile-sheet__workspace-accordion {
    margin: 0 0 8px;
}

.mobile-sheet__workspace-accordion > summary {
    list-style: none;
    cursor: pointer;
}

.mobile-sheet__workspace-accordion > summary::-webkit-details-marker {
    display: none;
}

.mobile-sheet__workspace {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 14px;
    border-radius: 12px;
    background: var(--bg-hover);
    border: 1px solid var(--border);
    transition: border-color 0.15s ease, background 0.15s ease;
}

.mobile-sheet__workspace:hover,
.mobile-sheet__workspace-accordion > summary:focus-visible .mobile-sheet__workspace {
    border-color: var(--primary-light);
    background: var(--primary-lighter);
}

.mobile-sheet__workspace-accordion > summary:focus-visible {
    outline: none;
}

.mobile-sheet__workspace-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--primary-lighter);
    color: var(--primary);
    flex-shrink: 0;
}

.mobile-sheet__workspace-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1 1 auto;
    gap: 2px;
}

.mobile-sheet__workspace-text strong {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.2;
}

.mobile-sheet__workspace-text small {
    font-size: 11px;
    color: var(--text-tertiary);
    line-height: 1.2;
}

.mobile-sheet__workspace-chevron {
    color: var(--text-tertiary);
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.mobile-sheet__workspace-accordion[open] .mobile-sheet__workspace-chevron {
    transform: rotate(180deg);
    color: var(--primary);
}

.mobile-sheet__workspace-accordion[open] .mobile-sheet__workspace {
    border-color: var(--primary);
    background: var(--primary-lighter);
}

.mobile-sheet__workspace-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 6px;
    padding: 6px;
    border-radius: 12px;
    background: var(--bg-soft, var(--bg-hover));
    border: 1px solid var(--border-light, var(--border));
    animation: nf-ms-ws-slide 0.18s ease-out;
}

@keyframes nf-ms-ws-slide {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.mobile-sheet__link-check {
    margin-left: auto;
    color: var(--primary);
    flex-shrink: 0;
}

.mobile-sheet__link--accent {
    color: var(--primary);
    font-weight: 600;
}

.mobile-sheet__link--accent .mobile-sheet__link-icon {
    color: var(--primary);
}

/* ============================================================
   MOBILE SEARCH OVERLAY
   ============================================================ */
.mobile-search-overlay {
    position: fixed;
    inset: 0;
    z-index: 90;
    background: var(--bg-page);
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.18s ease, visibility 0.18s ease;
}

.mobile-search-overlay.is-open {
    display: flex;
    opacity: 1;
    visibility: visible;
}

.mobile-search-overlay__bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: calc(var(--mobile-safe-top) + 8px) 10px 10px;
    background: var(--bg-panel);
    border-bottom: 1px solid var(--border);
}

.mobile-search-overlay__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: transparent;
    border: 0;
    color: var(--text-secondary);
    cursor: pointer;
    flex-shrink: 0;
}

.mobile-search-overlay__close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.mobile-search-overlay__close svg {
    width: 20px;
    height: 20px;
}

.mobile-search-overlay__form {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 14px;
    height: 44px;
    border-radius: 14px;
    background: var(--bg-hover);
    border: 1.5px solid var(--border);
    min-width: 0;
}

.mobile-search-overlay__form:focus-within {
    border-color: var(--primary);
    background: var(--bg-panel);
}

.mobile-search-overlay__icon {
    width: 18px;
    height: 18px;
    color: var(--text-tertiary);
    flex-shrink: 0;
}

.mobile-search-overlay__input {
    flex: 1 1 auto;
    background: transparent;
    border: 0;
    outline: 0;
    font-size: 15px;
    color: var(--text-primary);
    min-width: 0;
}

.mobile-search-overlay__input::placeholder {
    color: var(--text-tertiary);
}

.mobile-search-overlay__submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 38px;
    padding: 0 14px;
    border-radius: 10px;
    background: var(--primary);
    color: #fff;
    border: 0;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    flex-shrink: 0;
}

.mobile-search-overlay__body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 16px;
    -webkit-overflow-scrolling: touch;
}

.mobile-search-overlay__hint {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    text-align: center;
    padding: 40px 20px;
}

/* ============================================================
   Body-lock helper when any sheet/overlay open
   ============================================================ */
body.mobile-sheet-open {
    overflow: hidden;
    touch-action: none;
}

/* ============================================================
   Reduced motion
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
    .mobile-sheet__panel,
    .mobile-sheet__backdrop,
    .mobile-search-overlay,
    .mobile-bottom-nav__fab {
        transition: none !important;
    }

    .mobile-bottom-nav__fab {
        transform: translateY(-14px) !important;
    }
}

/* ============================================================
   Dark mode tweaks
   ============================================================ */
html[data-theme="dark"] .mobile-bottom-nav {
    box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.4);
}

html[data-theme="dark"] .mobile-header__notif-dot {
    border-color: var(--bg-panel);
}

html[data-theme="dark"] .mobile-sheet__backdrop {
    background: rgba(0, 0, 0, 0.6);
}

/* ============================================================
   Library dock (sidebar zone / mobile slide-over)
   ============================================================ */
.library-dock {
    position: fixed;
    z-index: 10050;
    top: 0;
    left: 0;
    height: 100vh;
    height: 100dvh;
    width: min(400px, 100vw);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    background: var(--bg-panel, #fff);
    border-right: 1px solid var(--border);
    box-shadow: 8px 0 32px rgba(15, 23, 42, 0.08);
}

.library-dock[hidden] {
    display: none !important;
}

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

.library-dock__title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
}

.library-dock__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
}

.library-dock__close:hover,
.library-dock__close:focus-visible {
    background: var(--bg-muted, rgba(0, 0, 0, 0.05));
    color: var(--text-primary);
    outline: none;
}

.library-dock__tabs {
    display: flex;
    gap: 6px;
    padding: 8px 12px 10px;
    border-bottom: 1px solid var(--border);
    flex: 0 0 auto;
}

.library-dock__tab {
    flex: 1 1 50%;
    min-height: 40px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg-page, #f8fafc);
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
}

.library-dock__tab.is-active {
    border-color: var(--primary, #6d28d9);
    background: color-mix(in srgb, var(--primary) 12%, transparent);
    color: var(--text-primary);
}

.library-dock__scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 10px 12px 16px;
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0));
}

.library-dock__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    align-content: start;
}

.library-dock__card {
    position: relative;
    aspect-ratio: 1;
    border-radius: 10px;
    border: 1px solid var(--border);
    overflow: hidden;
    background: var(--bg-muted, #f1f5f9);
    cursor: pointer;
    box-sizing: border-box;
}

.library-dock__card:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.library-dock__card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.library-dock__card-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.library-dock__sentinel {
    height: 1px;
    width: 100%;
    margin-top: 8px;
}

.library-dock__empty {
    margin: 24px 8px 0;
    font-size: 0.9rem;
    text-align: center;
    color: var(--text-secondary);
    line-height: 1.4;
}

html[data-theme="dark"] .library-dock {
    box-shadow: 8px 0 32px rgba(0, 0, 0, 0.45);
}

@media (max-width: 640px) {
    .library-dock {
        width: 100%;
        max-width: none;
        border-right: 0;
    }

    body.library-dock-open {
        overflow: hidden;
        touch-action: none;
    }
}

/* ---------- Editor: link, spoiler ve blur işaretleri ---------- */

/*
 * Editör + okuma görünümlerinde link'ler primary renkte ve belirgin alt
 * çizgili render edilir. Aksi halde "düz metin" izlenimi vererek kullanıcı
 * link eklediğini fark edemiyordu.
 */
.note-composer__editor a,
.note-composer__editor .ProseMirror a,
.note-render-surface__text a,
.note-detail__body a {
    color: var(--primary);
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
    text-decoration-color: color-mix(in srgb, var(--primary) 65%, transparent);
    transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

.note-composer__editor a:hover,
.note-composer__editor .ProseMirror a:hover,
.note-render-surface__text a:hover,
.note-detail__body a:hover {
    color: var(--primary-hover);
    text-decoration-color: var(--primary-hover);
}

/*
 * Spoiler: hover veya tıklamayla netleşen "gizli içerik". Editörde caret
 * mark'ın içine girince note-composer.js otomatik olarak .is-revealed ekler.
 * Görüntü tarafında app.js'teki tıklama listener'ı ile kalıcı toggle olur.
 */
.note-spoiler {
    background: color-mix(in srgb, var(--text-primary) 18%, transparent);
    color: transparent;
    filter: blur(6px);
    border-radius: 4px;
    padding: 0 2px;
    cursor: pointer;
    transition: filter 0.2s ease, color 0.2s ease, background 0.2s ease;
    user-select: none;
}

.note-spoiler:hover,
.note-spoiler.is-revealed {
    filter: none;
    color: inherit;
    background: transparent;
    user-select: text;
}

/*
 * Kalıcı blur: hover'da netleşmez, sadece tıklamayla toggle olur.
 * Hassas bilgileri gizlemek/sansürlemek için.
 */
.note-blur {
    filter: blur(5px);
    cursor: pointer;
    user-select: none;
    transition: filter 0.2s ease;
}

.note-blur.is-revealed {
    filter: none;
    user-select: text;
}

/*
 * Editör içinde yazarken spoiler/blur span'ı caret altındaysa
 * (note-composer.js .is-revealed ekler) bulanıklık kalkar; ayrıca
 * cursor metin imleci olur ki yazma akışı bozulmasın.
 */
.note-composer__editor .note-spoiler,
.note-composer__editor .note-blur,
.note-composer__editor .ProseMirror .note-spoiler,
.note-composer__editor .ProseMirror .note-blur {
    cursor: text;
}

/* Kod snippet oluştur / düzenle — aksiyon satırı (Kaydet, İptal, Sil) */
.code-snippet-form__actions {
    flex-direction: row !important;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-top: 1.25rem;
}

.code-snippet-form__actions .inline-form {
    display: contents;
}

/* ---------- Code Workspace (Monaco): not içinde kod bölümü ---------- */

.code-workspace {
    position: relative;
    z-index: 55;
    margin: 16px 0 24px;
    padding: 16px 18px 18px;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl, 16px);
    box-shadow:
        0 1px 2px color-mix(in srgb, var(--text-primary) 4%, transparent),
        0 8px 24px color-mix(in srgb, var(--text-primary) 6%, transparent);
}

.code-workspace__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px 16px;
    flex-wrap: wrap;
    margin-bottom: 4px;
    overflow: visible;
}

.code-workspace__head-main {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1 1 200px;
    min-width: 0;
}

.code-workspace__head-main .code-workspace__filename {
    margin-left: auto;
}

.code-workspace__live-presence {
    flex: 0 1 auto;
    max-width: min(340px, 100%);
    overflow: visible;
}

.code-workspace__title {
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: -0.005em;
    margin: 0;
}

.code-workspace__filename {
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
    font-size: 0.78rem;
    padding: 3px 9px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--primary) 12%, transparent);
    color: var(--primary);
    border: 1px solid color-mix(in srgb, var(--primary) 25%, var(--border));
    white-space: nowrap;
    margin-left: auto;
}

.code-workspace__lead {
    margin: 6px 0 14px;
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.45;
}

.code-workspace__body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.code-workspace__bar {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.code-workspace__field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 0 1 200px;
    min-width: 0;
}

.code-workspace__field-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-tertiary);
}

.code-workspace__field-dropdown {
    width: 100%;
    min-width: 0;
}

.code-workspace__select {
    height: 36px;
    padding: 0 30px 0 12px;
    font-size: 0.88rem;
    background-image:
        linear-gradient(45deg, transparent 50%, var(--text-secondary) 50%),
        linear-gradient(135deg, var(--text-secondary) 50%, transparent 50%);
    background-position:
        calc(100% - 16px) 50%,
        calc(100% - 11px) 50%;
    background-size: 5px 5px;
    background-repeat: no-repeat;
    appearance: none;
    -webkit-appearance: none;
}

.code-workspace__actions {
    display: flex;
    gap: 8px;
    margin-left: auto;
    flex-wrap: wrap;
}

.code-workspace__btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.code-workspace__split {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    min-width: 0;
}

@media (min-width: 960px) {
    .code-workspace__split.is-live-preview {
        grid-template-columns: 1fr 1fr;
        align-items: stretch;
    }
}

.code-workspace__preview {
    display: flex;
    flex-direction: column;
    min-height: 320px;
    min-width: 0;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    background: #ffffff;
}

.code-workspace__preview-bar {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-panel);
    border-bottom: 1px solid var(--border);
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-tertiary);
}

.code-workspace__preview-label {
    display: block;
    min-width: 0;
}

.code-workspace__preview-fullscreen {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    margin: -4px -6px -4px 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.code-workspace__preview-fullscreen:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.code-workspace__preview-fullscreen.is-active {
    background: color-mix(in srgb, var(--primary) 14%, transparent);
    color: var(--primary);
}

.code-workspace__preview-fs-icon.is-hidden {
    display: none !important;
}

.code-workspace__preview:fullscreen,
.code-workspace__preview:-webkit-full-screen {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    max-height: 100%;
    border-radius: 0;
    border: none;
    background: #ffffff;
}

.code-workspace__preview:fullscreen .code-workspace__preview-frame,
.code-workspace__preview:-webkit-full-screen .code-workspace__preview-frame {
    flex: 1;
    min-height: 0;
}

.code-workspace__preview-frame {
    flex: 1;
    width: 100%;
    min-height: 280px;
    border: 0;
    background: #ffffff;
}

.code-workspace__editor {
    width: 100%;
    height: 450px;
    min-height: 320px;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    background: #1e1e1e;
    isolation: isolate;
}

/* Taşan Monaco widget host: context menu, suggest, parameter hints — tema + opak zemin + üst katman */
.code-workspace .monaco-code-workspace-overflow {
    position: relative;
    z-index: 200;
    pointer-events: none;
    isolation: isolate;
}

.code-workspace .monaco-code-workspace-overflow > * {
    pointer-events: auto;
}

/* Uygulama temasından bağımsız: kod alanı tema seçicisi (Monaco vs / vs-dark) ile uyumlu */
.code-workspace .monaco-code-workspace-overflow.vs-dark {
    --vscode-menu-background: #2d2d2d;
    --vscode-menu-foreground: #f0f0f0;
    --vscode-menu-border: #3e3e42;
    --vscode-menu-separatorBackground: #454545;
    --vscode-menu-selectionBackground: color-mix(in srgb, var(--primary) 45%, transparent);
    --vscode-menu-selectionForeground: #ffffff;
    --vscode-widget-shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
    --vscode-editorHoverWidget-background: #252526;
    --vscode-editorHoverWidget-foreground: #e8e8e8;
    --vscode-editorHoverWidget-border: #454545;
    --vscode-editorWidget-background: #252526;
    --vscode-editorWidget-foreground: #e8e8e8;
    --vscode-editorWidget-border: #454545;
    --vscode-foreground: #e8e8e8;
    --vscode-keybindingLabel-background: rgba(128, 128, 128, 0.25);
    --vscode-keybindingLabel-foreground: #cccccc;
}

.code-workspace .monaco-code-workspace-overflow.vs {
    --vscode-menu-background: #ffffff;
    --vscode-menu-foreground: #1f1f1f;
    --vscode-menu-border: #d0d0d0;
    --vscode-menu-separatorBackground: #e5e5e5;
    --vscode-menu-selectionBackground: color-mix(in srgb, var(--primary) 22%, #ffffff);
    --vscode-menu-selectionForeground: #0f0f0f;
    --vscode-widget-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
    --vscode-editorHoverWidget-background: #ffffff;
    --vscode-editorHoverWidget-foreground: #1f1f1f;
    --vscode-editorHoverWidget-border: #d0d0d0;
    --vscode-editorWidget-background: #ffffff;
    --vscode-editorWidget-foreground: #1f1f1f;
    --vscode-editorWidget-border: #d0d0d0;
    --vscode-foreground: #1f1f1f;
    --vscode-keybindingLabel-background: rgba(0, 0, 0, 0.06);
    --vscode-keybindingLabel-foreground: #555555;
}

.code-workspace .monaco-code-workspace-overflow .context-view.monaco-component,
.code-workspace .monaco-code-workspace-overflow .monaco-menu-container,
.code-workspace .monaco-code-workspace-overflow .monaco-menu {
    background-color: var(--vscode-menu-background) !important;
    color: var(--vscode-menu-foreground) !important;
    border: 1px solid var(--vscode-menu-border) !important;
    box-shadow: var(--vscode-widget-shadow) !important;
    border-radius: var(--radius-md);
}

.code-workspace .monaco-code-workspace-overflow .action-item .action-label,
.code-workspace .monaco-code-workspace-overflow .monaco-action-bar .action-label {
    color: inherit !important;
}

.code-workspace .monaco-code-workspace-overflow .monaco-list:focus .monaco-list-row.focused {
    outline: none;
}

/**
 * Monaco tamamlama listesi — sitedeki .dropdown-menu ile aynı tasarım dili (token’lar).
 */
.code-workspace .suggest-widget {
    --vscode-editorSuggestWidget-background: var(--bg-panel);
    --vscode-editorSuggestWidget-border: var(--border);
    --vscode-editorSuggestWidget-foreground: var(--text-secondary);
    --vscode-editorSuggestWidget-selectedForeground: #ffffff;
    --vscode-editorSuggestWidget-selectedIconForeground: #ffffff;
    --vscode-editorSuggestWidget-highlightForeground: #ffffff;
    --vscode-editorSuggestWidget-focusHighlightForeground: #ffffff;
    --vscode-editorSuggestWidgetStatus-foreground: var(--text-tertiary);
    --vscode-list-focusBackground: var(--primary);
    --vscode-list-focusForeground: #ffffff;
    --vscode-list-inactiveFocusBackground: var(--primary-light);
    --vscode-list-inactiveFocusForeground: var(--primary);
    --vscode-list-hoverBackground: var(--primary-lighter);
    --vscode-list-hoverForeground: var(--primary);
    --vscode-list-activeSelectionBackground: var(--primary);
    --vscode-list-activeSelectionForeground: #ffffff;
    --vscode-focusBorder: var(--primary);

    z-index: 250 !important;
    border-radius: var(--radius-md) !important;
    border: 1px solid var(--border) !important;
    background-color: var(--bg-panel) !important;
    box-shadow: var(--shadow-md) !important;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    font-size: var(--fs-body-sm);
}

.code-workspace .suggest-widget > .tree {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    padding: 4px !important;
    box-sizing: border-box;
}

.code-workspace .suggest-widget .monaco-list .monaco-list-row {
    padding: 2px 8px 2px 4px !important;
    margin: 0 !important;
    min-height: 0 !important;
    box-sizing: border-box;
    border-radius: var(--radius-xs) !important;
    align-items: center;
}

.code-workspace .suggest-widget .monaco-list .monaco-list-row:not(.focused) .monaco-icon-label {
    color: var(--text-secondary) !important;
}

.code-workspace .suggest-widget .monaco-list .monaco-list-row:not(.focused) .codicon {
    color: var(--text-tertiary) !important;
}

.code-workspace .monaco-code-workspace-overflow .suggest-widget .monaco-list:focus .monaco-list-row.focused,
.code-workspace .suggest-widget .monaco-list:focus .monaco-list-row.focused {
    background-color: var(--primary) !important;
    background: var(--primary) !important;
    color: #ffffff !important;
    outline: none !important;
}

/* Seçili satırda tüm metin / ikon / eşleşme vurgusu — Monaco enjekte rengini ezmek için */
.code-workspace .monaco-code-workspace-overflow .suggest-widget .monaco-list:focus .monaco-list-row.focused .monaco-icon-label,
.code-workspace .monaco-code-workspace-overflow .suggest-widget .monaco-list:focus .monaco-list-row.focused .codicon,
.code-workspace .monaco-code-workspace-overflow .suggest-widget .monaco-list:focus .monaco-list-row.focused .monaco-highlighted-label,
.code-workspace .monaco-code-workspace-overflow .suggest-widget .monaco-list:focus .monaco-list-row.focused .monaco-highlighted-label .highlight,
.code-workspace .monaco-code-workspace-overflow .suggest-widget .monaco-list:focus .monaco-list-row.focused .label-name,
.code-workspace .monaco-code-workspace-overflow .suggest-widget .monaco-list:focus .monaco-list-row.focused .monaco-icon-name-container,
.code-workspace .monaco-code-workspace-overflow .suggest-widget .monaco-list:focus .monaco-list-row.focused .monaco-icon-label-container,
.code-workspace .monaco-code-workspace-overflow .suggest-widget .monaco-list:focus .monaco-list-row.focused .details-label,
.code-workspace .suggest-widget .monaco-list:focus .monaco-list-row.focused .monaco-icon-label,
.code-workspace .suggest-widget .monaco-list:focus .monaco-list-row.focused .codicon,
.code-workspace .suggest-widget .monaco-list:focus .monaco-list-row.focused .monaco-highlighted-label,
.code-workspace .suggest-widget .monaco-list:focus .monaco-list-row.focused .monaco-highlighted-label .highlight,
.code-workspace .suggest-widget .monaco-list:focus .monaco-list-row.focused .label-name,
.code-workspace .suggest-widget .monaco-list:focus .monaco-list-row.focused .monaco-icon-name-container,
.code-workspace .suggest-widget .monaco-list:focus .monaco-list-row.focused .monaco-icon-label-container,
.code-workspace .suggest-widget .monaco-list:focus .monaco-list-row.focused .details-label {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

.code-workspace .monaco-code-workspace-overflow .suggest-widget .monaco-list:focus .monaco-list-row.focused .monaco-icon-label,
.code-workspace .suggest-widget .monaco-list:focus .monaco-list-row.focused .monaco-icon-label {
    font-weight: 600;
}

/* Liste odağı başka yere gidince: açık mor zemin + koyu mor yazı (dropdown .is-active ile aynı) */
.code-workspace .monaco-code-workspace-overflow .suggest-widget .monaco-list:not(:focus) .monaco-list-row.focused,
.code-workspace .suggest-widget .monaco-list:not(:focus) .monaco-list-row.focused {
    background-color: var(--primary-light) !important;
    background: var(--primary-light) !important;
    color: var(--primary) !important;
}

.code-workspace .monaco-code-workspace-overflow .suggest-widget .monaco-list:not(:focus) .monaco-list-row.focused .monaco-icon-label,
.code-workspace .monaco-code-workspace-overflow .suggest-widget .monaco-list:not(:focus) .monaco-list-row.focused .codicon,
.code-workspace .monaco-code-workspace-overflow .suggest-widget .monaco-list:not(:focus) .monaco-list-row.focused .monaco-highlighted-label,
.code-workspace .monaco-code-workspace-overflow .suggest-widget .monaco-list:not(:focus) .monaco-list-row.focused .monaco-highlighted-label .highlight,
.code-workspace .monaco-code-workspace-overflow .suggest-widget .monaco-list:not(:focus) .monaco-list-row.focused .details-label,
.code-workspace .suggest-widget .monaco-list:not(:focus) .monaco-list-row.focused .monaco-icon-label,
.code-workspace .suggest-widget .monaco-list:not(:focus) .monaco-list-row.focused .codicon,
.code-workspace .suggest-widget .monaco-list:not(:focus) .monaco-list-row.focused .monaco-highlighted-label,
.code-workspace .suggest-widget .monaco-list:not(:focus) .monaco-list-row.focused .monaco-highlighted-label .highlight,
.code-workspace .suggest-widget .monaco-list:not(:focus) .monaco-list-row.focused .details-label {
    color: var(--primary) !important;
    -webkit-text-fill-color: var(--primary) !important;
}

.code-workspace .suggest-widget .monaco-list.mouse-support .monaco-list-row:hover:not(.focused),
.code-workspace .suggest-widget .monaco-list .monaco-list-row:hover:not(.focused) {
    background-color: var(--primary-lighter) !important;
}

.code-workspace .suggest-widget .monaco-list.mouse-support .monaco-list-row:hover:not(.focused) .monaco-icon-label {
    color: var(--primary) !important;
}

.code-workspace .suggest-widget .suggest-status-bar {
    border-top-color: var(--border) !important;
    background: var(--bg-panel) !important;
    font-size: var(--fs-body-sm);
}

.code-workspace .suggest-details {
    --vscode-editorSuggestWidget-foreground: var(--text-secondary);
    border-radius: var(--radius-md) !important;
    border: 1px solid var(--border) !important;
    background-color: var(--bg-panel) !important;
    color: var(--text-secondary) !important;
    box-shadow: var(--shadow-md) !important;
}

.code-workspace .suggest-details:focus {
    border-color: var(--primary) !important;
    outline: none;
}

/* Editör gövdesi içinde kalan satır içi öneri çubuğu (Insert / Show More) */
.code-workspace .monaco-editor .inlineSuggestionsHints.withBorder {
    z-index: 180 !important;
    background-color: var(--bg-panel) !important;
    color: var(--text-secondary) !important;
    border: 1px solid var(--border) !important;
    box-shadow: var(--shadow-md) !important;
    border-radius: var(--radius-md);
}

.code-workspace .monaco-editor .inlineSuggestionsHints.withBorder a {
    color: var(--primary) !important;
}

.code-workspace .monaco-editor .inlineSuggestionsHints.withBorder a:hover {
    color: var(--primary-hover) !important;
}

.code-workspace .monaco-editor .suggest-widget,
.code-workspace .monaco-editor .parameter-hints-widget,
.code-workspace .monaco-editor .monaco-hover {
    z-index: 180 !important;
}

html[data-theme="light"] .code-workspace__editor {
    background: #ffffff;
}

.code-workspace__foot {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 0.78rem;
    color: var(--text-tertiary);
}

.code-workspace__metric strong {
    font-weight: 600;
    color: var(--text-secondary);
    margin-right: 2px;
}

.code-workspace__status {
    flex: 1;
    min-height: 18px;
    color: var(--primary);
    font-weight: 500;
    opacity: 0;
    transform: translateY(-2px);
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.code-workspace__status.is-visible {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 640px) {
    .code-workspace {
        padding: 14px 14px 16px;
        margin: 12px 0 20px;
        border-radius: 14px;
    }

    .code-workspace__head {
        gap: 8px;
    }

    .code-workspace__filename {
        margin-left: 0;
    }

    .code-workspace__bar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .code-workspace__field {
        flex: 1 1 auto;
        width: 100%;
    }

    .code-workspace__actions {
        margin-left: 0;
        justify-content: stretch;
    }

    .code-workspace__btn {
        flex: 1 1 auto;
        justify-content: center;
    }

    .code-workspace__editor {
        height: 340px;
    }

    .code-workspace__foot {
        font-size: 0.74rem;
        gap: 10px;
    }
}

/* notes/show salt-okunur kod snapshot blogu */
.note-detail__code {
    margin: 18px 0 22px;
    padding: 14px 16px 16px;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl, 16px);
    box-shadow: 0 1px 2px color-mix(in srgb, var(--text-primary) 3%, transparent);
}

.note-detail__code-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}

.note-detail__code-head strong {
    font-size: 0.9rem;
}

.note-detail__code-lang {
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
    font-size: 0.72rem;
    padding: 3px 9px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--primary) 10%, transparent);
    color: var(--primary);
    border: 1px solid color-mix(in srgb, var(--primary) 22%, var(--border));
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.code-snapshot {
    margin: 0;
    padding: 14px 16px;
    border-radius: 12px;
    background: color-mix(in srgb, var(--text-primary) 6%, var(--bg-panel));
    border: 1px solid var(--border);
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
    font-size: 0.85rem;
    line-height: 1.55;
    color: var(--text-primary);
    overflow: auto;
    white-space: pre;
    word-wrap: normal;
    max-height: 560px;
}

.code-snapshot code {
    font: inherit;
    color: inherit;
    background: transparent;
    padding: 0;
}
