/* ════════════════════════════════════════════════════════════
   EverFree — Web Client Styles
   ════════════════════════════════════════════════════════════ */

:root {
    --bg-body: #0f1117;
    --bg-sidebar: #161822;
    --bg-sidebar-hover: #1e2030;
    --bg-surface: #1a1c2a;
    --bg-editor: #12131e;
    --bg-input: #1e2030;
    --bg-modal: #1c1e2e;

    --border: #2a2d3e;
    --border-light: #353850;

    --text-primary: #e2e4f0;
    --text-secondary: #8b8faa;
    --text-muted: #5c5f78;

    --accent: #4fd1c5;
    --accent-hover: #38b2ac;
    --accent-glow: rgba(79, 209, 197, 0.15);
    --accent-subtle: rgba(79, 209, 197, 0.08);

    --danger: #f56565;
    --danger-hover: #e53e3e;

    --success: #68d391;
    --warning: #f6ad55;

    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;

    --sidebar-width: 280px;
    --radius: 8px;
    --radius-sm: 6px;

    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] {
    --bg-body: #f5f6fa;
    --bg-sidebar: #ffffff;
    --bg-sidebar-hover: #f0f1f5;
    --bg-surface: #ffffff;
    --bg-editor: #ffffff;
    --bg-input: #f0f1f5;
    --bg-modal: #ffffff;

    --border: #e2e4ec;
    --border-light: #d0d3df;

    --text-primary: #1a1c2a;
    --text-secondary: #5c5f78;
    --text-muted: #9b9eb8;

    --accent: #0d9488;
    --accent-hover: #0f766e;
    --accent-glow: rgba(13, 148, 136, 0.12);
    --accent-subtle: rgba(13, 148, 136, 0.07);

    --danger: #dc2626;
    --danger-hover: #b91c1c;
    --success: #16a34a;
    --warning: #d97706;
}

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

html, body {
    height: 100%;
    font-family: var(--font-sans);
    font-size: 14px;
    color: var(--text-primary);
    background: var(--bg-body);
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

/* ── Views ───────────────────────────────────────────────── */
.view { width: 100%; height: 100vh; }

.view-centered {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    overflow-y: auto;
}

.view-app {
    display: flex;
}

/* ── Public Landing ──────────────────────────────────────── */
.landing-view {
    align-items: flex-start;
    background:
        radial-gradient(circle at 12% 10%, rgba(79, 209, 197, 0.18), transparent 30%),
        radial-gradient(circle at 88% 0%, rgba(246, 173, 85, 0.12), transparent 28%),
        linear-gradient(135deg, #0b0f14 0%, var(--bg-body) 54%, #15120c 100%);
}

.landing-shell {
    width: min(1120px, 100%);
    margin: 0 auto;
    padding: 22px 0 40px;
}

.landing-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 54px;
}

.landing-logo {
    font-size: 18px;
}

.landing-logo .logo-mark {
    width: 30px;
    height: 30px;
}

.landing-nav-link {
    color: var(--text-secondary);
    font-weight: 600;
    text-decoration: none;
    transition: color var(--transition);
}

.landing-nav-link:hover {
    color: var(--accent);
}

.landing-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(340px, 0.65fr);
    gap: 48px;
    align-items: center;
}

.landing-copy {
    max-width: 680px;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    margin-bottom: 16px;
    padding: 7px 12px;
    border: 1px solid rgba(79, 209, 197, 0.3);
    border-radius: 999px;
    background: rgba(79, 209, 197, 0.08);
    color: var(--accent);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.landing-copy h2 {
    color: var(--text-primary);
    font-size: clamp(44px, 7vw, 76px);
    line-height: 0.94;
    letter-spacing: -0.07em;
    max-width: 800px;
    margin-bottom: 22px;
}

.landing-lede {
    max-width: 650px;
    color: var(--text-secondary);
    font-size: 18px;
    line-height: 1.65;
}

.landing-note {
    max-width: 620px;
    margin-top: 20px;
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.6;
}

.landing-auth-card {
    position: relative;
    overflow: hidden;
}

.landing-auth-card::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(135deg, rgba(79, 209, 197, 0.12), transparent 45%);
}

.landing-auth-card > * {
    position: relative;
}

.landing-actions {
    display: grid;
    gap: 10px;
}

.landing-actions .btn {
    min-height: 44px;
    justify-content: center;
    text-decoration: none;
}

.landing-download {
    font-weight: 700;
}

.landing-selfhost {
    border: 1px solid var(--border);
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-top: 52px;
}

.feature-card {
    min-height: 174px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    background: rgba(26, 28, 42, 0.72);
    box-shadow: 0 18px 54px rgba(0, 0, 0, 0.18);
}

.feature-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 26px;
    margin-bottom: 18px;
    padding: 0 9px;
    border-radius: 999px;
    background: rgba(79, 209, 197, 0.1);
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
}

.feature-card h3 {
    margin-bottom: 8px;
    color: var(--text-primary);
    font-size: 16px;
    letter-spacing: -0.02em;
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.55;
}

/* ── Auth Card ───────────────────────────────────────────── */
.auth-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 36px 32px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35);
    animation: slideUp 0.3s ease;
}

.auth-card-wide { max-width: 560px; }

.auth-card .logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
    justify-content: center;
}

.auth-card .logo-mark {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    flex-shrink: 0;
    box-shadow: 0 0 18px var(--accent-glow);
}

.auth-tagline {
    text-align: center;
    color: var(--text-secondary);
    font-size: 13px;
    margin-bottom: 24px;
    line-height: 1.5;
}

.auth-card-footer {
    margin-top: 16px;
    display: flex;
    justify-content: center;
}

.btn-auth {
    width: 100%;
    justify-content: center;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 600;
}

.btn-github {
    background: #24292f;
    color: #ffffff;
}
.btn-github:hover {
    background: #1a1f24;
}

/* ── Device Flow ─────────────────────────────────────────── */
.device-flow-card {
    text-align: center;
    padding: 16px 0;
}

.device-flow-label {
    color: var(--text-secondary);
    font-size: 13px;
    margin-bottom: 16px;
    line-height: 1.5;
}
.device-flow-label a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}
.device-flow-label a:hover { text-decoration: underline; }

.device-flow-code {
    font-family: var(--font-mono);
    font-size: 28px;
    letter-spacing: 0.25em;
    font-weight: 600;
    color: var(--accent);
    background: var(--accent-subtle);
    padding: 14px 16px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    user-select: all;
}

.device-flow-waiting {
    color: var(--text-muted);
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.spinner {
    width: 14px;
    height: 14px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
.spinner-sm { width: 12px; height: 12px; border-width: 2px; }

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

.error-box {
    background: rgba(245, 101, 101, 0.08);
    border: 1px solid rgba(245, 101, 101, 0.3);
    border-radius: var(--radius);
    padding: 16px;
    text-align: left;
}
.error-title {
    color: var(--danger);
    font-weight: 600;
    margin-bottom: 8px;
}
.error-detail {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-secondary);
    white-space: pre-wrap;
    word-break: break-word;
    margin-bottom: 12px;
    max-height: 160px;
    overflow-y: auto;
}

/* ── Repo Picker ─────────────────────────────────────────── */
.repo-search {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 13px;
    font-family: var(--font-sans);
    outline: none;
    transition: border-color var(--transition);
    margin-bottom: 12px;
}
.repo-search:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.repo-list {
    max-height: 360px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-body);
}

.repo-loading, .repo-empty {
    padding: 24px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

.repo-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background var(--transition);
    gap: 12px;
}
.repo-row:last-child { border-bottom: none; }
.repo-row:hover { background: var(--bg-sidebar-hover); }

.repo-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}
.repo-name {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.repo-meta {
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    gap: 8px;
}
.repo-private {
    background: var(--accent-subtle);
    color: var(--accent);
    padding: 1px 6px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 500;
}

/* ── Scrollbar ───────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-light); }

/* ── Sidebar ─────────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 16px 12px;
    border-bottom: 1px solid var(--border);
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}
.logo-mark {
    width: 24px;
    height: 24px;
    border-radius: 7px;
    flex-shrink: 0;
    box-shadow: 0 0 16px var(--accent-glow);
}

.sidebar-search { padding: 12px 16px; }

.sidebar-search input {
    width: 100%;
    padding: 8px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 13px;
    font-family: var(--font-sans);
    outline: none;
    transition: border-color var(--transition);
}
.sidebar-search input::placeholder { color: var(--text-muted); }
.sidebar-search input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.notebook-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

.notebook-loading {
    padding: 16px;
    text-align: center;
    color: var(--text-muted);
    font-size: 12px;
}

/* Notebook Accordion */
.notebook-item { margin: 0 8px 2px; }

.notebook-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    transition: all var(--transition);
    user-select: none;
}
.notebook-header:hover {
    background: var(--bg-sidebar-hover);
    color: var(--text-primary);
}
.notebook-header.active {
    color: var(--accent);
    background: var(--accent-subtle);
}

.notebook-chevron {
    transition: transform var(--transition);
    flex-shrink: 0;
    opacity: 0.5;
}
.notebook-header.expanded .notebook-chevron { transform: rotate(90deg); }

.notebook-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notebook-count {
    font-size: 11px;
    color: var(--text-muted);
    background: var(--bg-input);
    padding: 1px 6px;
    border-radius: 10px;
    font-weight: 400;
}

.notebook-add-note {
    opacity: 0;
    transition: opacity var(--transition);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 2px;
    border-radius: 4px;
    display: flex;
    align-items: center;
}
.notebook-header:hover .notebook-add-note { opacity: 1; }
.notebook-add-note:hover {
    color: var(--accent);
    background: var(--accent-glow);
}

.note-list {
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.3s ease-out;
}
.note-list.expanded {
    max-height: 2000px;
    transition: max-height 0.5s ease-in;
}

.note-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px 6px 32px;
    margin: 1px 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 13px;
    transition: all var(--transition);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.note-item:hover {
    background: var(--bg-sidebar-hover);
    color: var(--text-primary);
}
.note-item.active {
    background: var(--accent-subtle);
    color: var(--accent);
    font-weight: 500;
}
.note-item-icon {
    opacity: 0.4;
    flex-shrink: 0;
    font-size: 12px;
}

.search-results-header {
    padding: 10px 16px 6px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.search-result-item {
    align-items: flex-start;
    white-space: normal;
}

.search-result-body {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 2px;
}

.search-result-meta {
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 400;
}

.search-result-snippet {
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 400;
    line-height: 1.35;
}

/* ── Main Pane ───────────────────────────────────────────── */
.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg-body);
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    text-align: center;
    padding: 40px;
    animation: fadeIn 0.5s ease;
}
.empty-logo {
    width: 84px;
    height: 84px;
    border-radius: 22px;
    margin-bottom: 16px;
    opacity: 0.9;
    box-shadow: 0 18px 52px rgba(0, 0, 0, 0.28), 0 0 34px var(--accent-glow);
}
.empty-state h2 {
    font-size: 22px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}
.empty-state p {
    font-size: 14px;
    max-width: 320px;
    line-height: 1.5;
}

/* ── Editor ──────────────────────────────────────────────── */
.editor-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    animation: fadeIn 0.3s ease;
}

.editor-toolbar-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-surface);
    backdrop-filter: blur(8px);
}

.note-breadcrumb {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.editor-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.save-status {
    font-size: 12px;
    color: var(--text-muted);
    transition: all var(--transition);
    padding-right: 4px;
}
.save-status.saved { color: var(--success); }

/* Toast UI Editor */
.editor-container .toastui-editor-defaultUI {
    flex: 1;
    display: flex;
    flex-direction: column;
    border: none;
    background: var(--bg-editor);
}
.editor-container .toastui-editor-main { flex: 1; }
.toastui-editor-mode-switch { display: none !important; }

.toastui-editor-defaultUI .toastui-editor-toolbar {
    background: var(--bg-surface) !important;
    border-bottom: 1px solid var(--border) !important;
}
.toastui-editor-defaultUI .toastui-editor-toolbar-icons {
    background-color: transparent !important;
    border: none !important;
}
.toastui-editor-defaultUI .toastui-editor-toolbar-icons:hover {
    background-color: var(--bg-sidebar-hover) !important;
}
.toastui-editor-defaultUI .toastui-editor-toolbar-icons.active {
    background-color: var(--accent-subtle) !important;
}

.toastui-editor-ww-container,
.toastui-editor-ww-container .toastui-editor {
    background: var(--bg-editor) !important;
}
.toastui-editor-contents,
.toastui-editor-ww-container .ProseMirror {
    background: var(--bg-editor) !important;
    color: var(--text-primary) !important;
    font-family: var(--font-sans) !important;
    font-size: 15px !important;
    line-height: 1.75 !important;
}
.toastui-editor-contents p,
.toastui-editor-contents li,
.toastui-editor-contents h1,
.toastui-editor-contents h2,
.toastui-editor-contents h3,
.toastui-editor-contents h4,
.toastui-editor-contents h5,
.toastui-editor-contents h6 {
    color: var(--text-primary) !important;
}
.toastui-editor-contents pre {
    background: var(--bg-surface) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius) !important;
}
.toastui-editor-contents code {
    background: var(--bg-surface) !important;
    color: var(--accent) !important;
    font-family: var(--font-mono) !important;
}
.toastui-editor-contents blockquote {
    border-left: 3px solid var(--accent) !important;
    color: var(--text-secondary) !important;
}
.toastui-editor-contents a { color: var(--accent) !important; }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}
.btn-sm { padding: 4px 10px; font-size: 12px; }

.btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
}
.btn-icon:hover {
    background: var(--bg-sidebar-hover);
    color: var(--accent);
}

.btn-save { background: var(--accent); color: var(--bg-body); }
.btn-save:hover {
    background: var(--accent-hover);
    box-shadow: 0 2px 12px var(--accent-glow);
}

.btn-danger { background: transparent; color: var(--text-muted); }
.btn-danger:hover {
    background: rgba(245, 101, 101, 0.1);
    color: var(--danger);
}

.btn-primary { background: var(--accent); color: var(--bg-body); }
.btn-primary:hover { background: var(--accent-hover); }

.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover {
    background: var(--bg-sidebar-hover);
    color: var(--text-primary);
}

/* ── Modal ───────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    animation: fadeIn 0.15s ease;
}

.modal {
    background: var(--bg-modal);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    width: 380px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.2s ease;
}
.modal h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}
.modal input {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    font-family: var(--font-sans);
    outline: none;
    transition: border-color var(--transition);
    margin-bottom: 20px;
}
.modal input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}
.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* ── Sidebar Footer / Sync ───────────────────────────────── */
.sidebar-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    border-top: 1px solid var(--border);
    background: var(--bg-sidebar);
    gap: 8px;
}

.sync-status {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.sync-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    transition: background var(--transition);
}
.sync-dot.sync-ok {
    background: var(--success);
    box-shadow: 0 0 6px rgba(104, 211, 145, 0.4);
}
.sync-dot.sync-syncing {
    background: var(--accent);
    animation: pulse 1s ease-in-out infinite;
}
.sync-dot.sync-warn { background: var(--warning); }
.sync-dot.sync-error {
    background: var(--danger);
    box-shadow: 0 0 6px rgba(245, 101, 101, 0.4);
}
.sync-dot.sync-off { background: var(--text-muted); }

.sync-label {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Account Popover ─────────────────────────────────────── */
.popover {
    position: fixed;
    bottom: 56px;
    left: 16px;
    width: 240px;
    background: var(--bg-modal);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    z-index: 50;
    animation: slideUp 0.15s ease;
}

.popover-header {
    padding: 12px 14px 4px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}
.popover-meta {
    padding: 0 14px 10px;
    font-size: 11px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.popover-item {
    display: block;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    padding: 10px 14px;
    color: var(--text-secondary);
    font-size: 13px;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: background var(--transition);
}
.popover-item:hover {
    background: var(--bg-sidebar-hover);
    color: var(--text-primary);
}
.popover-item-danger { color: var(--danger); }
.popover-item-danger:hover {
    background: rgba(245, 101, 101, 0.08);
    color: var(--danger);
}

/* ── Animations ──────────────────────────────────────────── */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

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

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

/* ── Mobile ──────────────────────────────────────────────── */
@media (max-width: 720px) {
    :root { --sidebar-width: 240px; }
    .landing-shell { padding: 10px 0 28px; }
    .landing-nav { margin-bottom: 32px; }
    .landing-hero { grid-template-columns: 1fr; gap: 24px; }
    .landing-copy h2 { font-size: 42px; }
    .landing-lede { font-size: 16px; }
    .feature-grid { grid-template-columns: 1fr; margin-top: 28px; }
    .auth-card { padding: 28px 20px; }
    .device-flow-code { font-size: 22px; letter-spacing: 0.18em; }
}
