:root {
    --bg: #f5f7fb;
    --panel: #ffffff;
    --panel-soft: #f9fbfd;
    --text: #172033;
    --muted: #667085;
    --line: #e3eaf2;
    --line-strong: #d1dce8;
    --accent: #2563eb;
    --accent-dark: #1d4ed8;
    --danger: #b42318;
    --shadow: 0 20px 44px rgba(15, 23, 42, .12);
    --soft-shadow: 0 9px 22px rgba(15, 23, 42, .07);
    --radius: 18px;
    --speed: 135ms;
    --note-font: 15px;
    --reader-font: 18px;
    --editor-font: 16px;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, .07), transparent 31rem),
        radial-gradient(circle at bottom right, rgba(15, 118, 110, .06), transparent 32rem),
        var(--bg);
    color: var(--text);
    text-rendering: optimizeLegibility;
}
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .65; cursor: wait; }
::selection { background: rgba(37, 99, 235, .18); }

.login-screen { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card {
    width: min(470px, 100%);
    background: rgba(255, 255, 255, .94);
    border: 1px solid var(--line);
    border-radius: 28px;
    padding: 34px;
    box-shadow: var(--shadow);
    animation: rise .22s ease both;
}
.login-mark, .brand-icon {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: #e8f3ff;
    display: grid;
    place-items: center;
    color: #1d4ed8;
    font-size: 20px;
    font-weight: 950;
}
.login-card h1 { margin: 18px 0 8px; font-size: 28px; }
.login-card p { margin: 0 0 24px; color: var(--muted); line-height: 1.5; }
.login-form { display: grid; gap: 10px; }
.login-form label { color: #344054; font-weight: 750; }
.login-form input, .login-form button { width: 100%; border-radius: 14px; padding: 13px 14px; }
.login-form input { border: 1px solid var(--line-strong); background: #fff; }
.login-form button { border: 0; background: var(--accent); color: #fff; font-weight: 850; }
.login-error { min-height: 22px; color: var(--danger); font-weight: 700; }

.auth-card { overflow: hidden; }
.auth-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    background: #eef3f8;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 5px;
    margin: 0 0 18px;
}
.auth-tab {
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--muted);
    padding: 10px 12px;
    font-weight: 850;
    transition: background var(--speed) ease, color var(--speed) ease, box-shadow var(--speed) ease;
}
.auth-tab.active {
    background: #fff;
    color: var(--text);
    box-shadow: 0 5px 14px rgba(15,23,42,.07);
}
.auth-form { animation: rise .16s ease both; }
.auth-note {
    margin: 4px 0 0 !important;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.4;
}

.app-shell {
    display: grid;
    grid-template-columns: 292px minmax(0, 1fr);
    min-height: 100vh;
    opacity: 1;
    transition: opacity var(--speed) ease;
}
.app-shell.is-loading { opacity: .72; }
.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 20px;
    border-right: 1px solid var(--line);
    background: rgba(255,255,255,.80);
    backdrop-filter: blur(18px);
    display: flex;
    flex-direction: column;
    gap: 15px;
    overflow-y: auto;
}
.brand-row { display: flex; gap: 12px; align-items: center; width: 100%; border: 0; background: transparent; padding: 0; text-align: left; color: inherit; border-radius: 16px; }
.brand-row:hover { background: rgba(37,99,235,.06); }
.brand-title { font-size: 18px; font-weight: 850; letter-spacing: -.02em; line-height: 1.1; }
.brand-subtitle { color: var(--muted); font-size: 13px; margin-top: 3px; }
.primary-action {
    width: 100%;
    border: 0;
    background: #172033;
    color: white;
    font-weight: 850;
    padding: 13px 15px;
    border-radius: 16px;
    box-shadow: 0 12px 26px rgba(23, 32, 51, .18);
    transition: transform var(--speed) ease, box-shadow var(--speed) ease, background var(--speed) ease;
}
.primary-action:hover { transform: translateY(-1px); box-shadow: 0 16px 32px rgba(23, 32, 51, .22); background: #0f172a; }
.nav-block, .category-list { display: grid; gap: 8px; }
.nav-item, .category-item {
    border: 1px solid transparent;
    background: transparent;
    color: var(--text);
    min-height: 44px;
    padding: 9px 10px;
    border-radius: 14px;
    display: grid;
    grid-template-columns: 15px 1fr auto;
    gap: 9px;
    align-items: center;
    text-align: left;
    transition: background var(--speed) ease, border-color var(--speed) ease, transform var(--speed) ease;
}
.nav-item:hover, .category-item:hover, .category-item.drop-target { background: #f3f7fb; border-color: var(--line); }
.nav-item.active, .category-item.active { background: #eef5ff; border-color: #c8defe; }
.category-item.drag-over { outline: 2px solid rgba(37, 99, 235, .38); background: #eef5ff; transform: translateX(2px); }
.nav-item strong, .category-item strong {
    color: var(--muted);
    font-size: 12px;
    background: rgba(255,255,255,.72);
    border-radius: 999px;
    padding: 3px 7px;
}
.dot { width: 11px; height: 11px; border-radius: 999px; background: #a7b2c4; box-shadow: inset 0 0 0 1px rgba(0,0,0,.05); }
.dot-all { background: #94a3b8; }
.dot-pin { background: #f59e0b; }
.side-title { color: #475467; font-size: 12px; font-weight: 850; text-transform: uppercase; letter-spacing: .08em; margin-top: 4px; }
.shortcuts-card {
    display: grid;
    gap: 5px;
    color: var(--muted);
    background: rgba(255,255,255,.62);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 12px;
    font-size: 12px;
}
.shortcuts-card b { color: #344054; font-size: 12px; }
.side-footer { margin-top: auto; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.ghost-button, .soft-button, .icon-button, .danger-button, .primary-small, .mini-button, .tiny-button {
    border-radius: 12px;
    border: 1px solid var(--line-strong);
    background: #fff;
    color: var(--text);
    padding: 9px 12px;
    font-weight: 750;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    transition: transform var(--speed) ease, background var(--speed) ease, border-color var(--speed) ease, box-shadow var(--speed) ease;
}
.ghost-button:hover, .soft-button:hover, .icon-button:hover, .mini-button:hover, .tiny-button:hover {
    background: #f7fafc;
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(15,23,42,.06);
}
.primary-small { background: var(--accent); border-color: var(--accent); color: #fff; }
.primary-small:hover { background: var(--accent-dark); transform: translateY(-1px); }
.danger-button { color: var(--danger); border-color: #ffd8cf; background: #fff; }
.danger-button:hover { background: #fff5f2; transform: translateY(-1px); }
.tiny-button { padding: 7px 9px; font-size: 12px; }

.workspace { min-width: 0; padding: 26px clamp(16px, 3vw, 38px) 60px; }
.topbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
}
.title-area { min-width: 180px; }
.topbar h1 { margin: 0; font-size: clamp(28px, 4vw, 42px); letter-spacing: -.045em; }
.topbar p { margin: 6px 0 0; color: var(--muted); }
.top-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.search-wrap {
    min-width: min(430px, 37vw);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 0 12px;
    height: 46px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, .04);
}
.search-wrap span { color: var(--muted); font-size: 21px; }
.search-wrap input { border: 0; outline: 0; width: 100%; background: transparent; color: var(--text); }
.text-size-control { display: inline-flex; gap: 6px; background: rgba(255,255,255,.72); border: 1px solid var(--line); border-radius: 15px; padding: 4px; }
.mini-button { min-height: 36px; padding: 6px 9px; font-size: 13px; border-radius: 11px; }

.quick-card {
    background: rgba(255,255,255,.84);
    border: 1px solid var(--line);
    box-shadow: var(--soft-shadow);
    border-radius: 24px;
    padding: 14px;
    display: grid;
    gap: 10px;
    margin-bottom: 24px;
    animation: rise .22s ease both;
}
.quick-top, .quick-bottom { display: grid; grid-template-columns: 1fr 220px; gap: 10px; align-items: center; }
.quick-bottom { grid-template-columns: 1fr auto; }
.quick-actions { display: flex; gap: 8px; }
.quick-card input, .quick-card select, .quick-card textarea,
.modal-card input, .modal-card select, .modal-card textarea {
    border: 1px solid var(--line-strong);
    border-radius: 14px;
    background: #fff;
    padding: 11px 12px;
    outline: none;
    color: var(--text);
}
.quick-card input:focus, .quick-card select:focus, .quick-card textarea:focus,
.modal-card input:focus, .modal-card select:focus, .modal-card textarea:focus {
    border-color: #9bc0f7;
    box-shadow: 0 0 0 4px rgba(37,99,235,.10);
}
.quick-card textarea, .modal-card textarea {
    width: 100%;
    resize: vertical;
    min-height: 94px;
    line-height: 1.5;
    font-size: var(--editor-font);
}
.checkline { display: inline-flex; align-items: center; gap: 8px; color: #475467; font-weight: 700; }
.note-section { margin-top: 18px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 12px; }
.section-head h2 { margin: 0; font-size: 17px; }
.section-head span { color: var(--muted); font-size: 13px; }
.notes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(254px, 1fr));
    gap: 14px;
    align-items: stretch;
    min-height: 34px;
    border-radius: 20px;
    transition: background var(--speed) ease, outline var(--speed) ease;
}
.notes-grid.grid-over { outline: 2px dashed rgba(37, 99, 235, .35); background: rgba(37,99,235,.035); }
.note-card {
    position: relative;
    border-radius: 17px;
    border: 1px solid rgba(15, 23, 42, .08);
    background: var(--note-color, #fff);
    min-height: 172px;
    padding: 14px;
    box-shadow: 0 8px 18px rgba(15,23,42,.06);
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: transform var(--speed) ease, box-shadow var(--speed) ease, opacity var(--speed) ease, border-color var(--speed) ease;
    contain: layout paint style;
    user-select: text;
    animation: pop .18s ease both;
}
.note-card:hover { transform: translateY(-2px); box-shadow: 0 14px 26px rgba(15,23,42,.09); border-color: rgba(15, 23, 42, .16); }
.note-card.just-added { animation: newNotePulse .72s ease both; }
.note-card.dragging { opacity: .42; transform: scale(.985); box-shadow: none; }
.note-card.drag-over-before::before, .note-card.drag-over-after::after {
    content: "";
    position: absolute;
    left: 8px;
    right: 8px;
    height: 4px;
    border-radius: 99px;
    background: var(--accent);
    box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.note-card.drag-over-before::before { top: -8px; }
.note-card.drag-over-after::after { bottom: -8px; }
.note-card .card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.note-card h3 { margin: 0; font-size: calc(var(--note-font) + 2px); letter-spacing: -.02em; line-height: 1.24; }
.note-card .card-body {
    color: #344054;
    font-size: var(--note-font);
    line-height: 1.46;
    white-space: pre-wrap;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
    word-break: break-word;
    flex: 1;
}
.card-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; color: var(--muted); font-size: 12px; }
.card-meta .cat-chip, .pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border-radius: 999px;
    padding: 4px 8px;
    background: rgba(255,255,255,.7);
    border: 1px solid rgba(15,23,42,.06);
    color: #344054;
    font-weight: 750;
}
.pin-mark { color: #b7791f; font-weight: 900; }
.card-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.card-actions button { border-radius: 10px; border: 1px solid rgba(15,23,42,.09); background: rgba(255,255,255,.68); padding: 7px 9px; font-size: 12px; font-weight: 800; }
.card-actions button:hover { background: rgba(255,255,255,.95); }
.drag-handle { cursor: grab; color: var(--muted); user-select: none; font-size: 20px; line-height: 1; padding: 0 2px; }
.drag-handle:active { cursor: grabbing; }

.empty-state {
    margin-top: 12px;
    background: rgba(255,255,255,.72);
    border: 1px dashed var(--line-strong);
    border-radius: 24px;
    padding: 40px;
    text-align: center;
    color: var(--muted);
}
.empty-state div { font-size: 42px; color: #94a3b8; }
.empty-state h3 { margin: 8px 0 4px; color: var(--text); }
.empty-state p { margin: 0; }

.reader, .modal { position: fixed; inset: 0; z-index: 40; display: none; }
.reader.open, .modal.open { display: block; }
.reader-backdrop, .modal-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, .28); backdrop-filter: blur(5px); animation: fade .14s ease both; }
.reader-panel {
    position: absolute;
    top: 16px;
    right: 16px;
    bottom: 16px;
    width: min(820px, calc(100vw - 32px));
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 26px;
    box-shadow: var(--shadow);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    animation: slideIn .18s cubic-bezier(.2,.8,.2,1) both;
}
.reader-toolbar { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.reader-edit-head { flex: 1; min-width: 0; display: grid; gap: 8px; }
.reader-toolbar p { margin: 0; color: var(--muted); }
.reader-title-input {
    width: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text);
    font-size: clamp(26px, 4vw, 42px);
    letter-spacing: -.04em;
    font-weight: 900;
    padding: 2px 0;
}
.reader-category-select {
    width: max-content;
    max-width: 240px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #f8fafc;
    padding: 7px 10px;
    color: #344054;
    font-weight: 800;
    outline: 0;
}
.reader-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.reader-pin-line {
    border: 1px solid var(--line-strong);
    background: #fff;
    padding: 8px 11px;
    border-radius: 12px;
}
.save-status {
    color: var(--muted);
    font-weight: 800;
    font-size: 13px;
    padding: 8px 10px;
    border-radius: 999px;
    background: #f8fafc;
    border: 1px solid var(--line);
}
.save-status.saving { color: #1d4ed8; background: #eef5ff; }
.save-status.dirty { color: #9a6700; background: #fff8df; }
.reader-body-edit {
    margin: 0;
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 20px;
    overflow: auto;
    resize: none;
    line-height: 1.62;
    font-size: var(--reader-font);
    flex: 1;
    color: #1f2937;
    outline: none;
    min-height: 360px;
    white-space: pre-wrap;
}
.reader-body-edit:focus, .reader-title-input:focus, .reader-category-select:focus {
    border-color: #9bc0f7;
    box-shadow: 0 0 0 4px rgba(37,99,235,.10);
}
.icon-round {
    width: 38px;
    height: 38px;
    border-radius: 999px;
    border: 1px solid var(--line-strong);
    background: #fff;
    font-size: 22px;
    line-height: 1;
}
.icon-round:hover { background: #f7fafc; }

.modal-card {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(640px, calc(100vw - 28px));
    max-height: calc(100vh - 28px);
    overflow: auto;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 26px;
    box-shadow: var(--shadow);
    padding: 20px;
    display: grid;
    gap: 14px;
    animation: modalPop .16s ease both;
}
.modal-card.wide { width: min(900px, calc(100vw - 28px)); }
.settings-card { width: min(820px, calc(100vw - 28px)); }
.modal-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.modal-head h2 { margin: 0; font-size: 24px; letter-spacing: -.025em; }
.form-grid, .settings-grid { display: grid; grid-template-columns: 1fr 220px; gap: 12px; align-items: end; }
.modal-card label { display: grid; gap: 7px; color: #344054; font-weight: 750; }
.textarea-label { display: grid; gap: 7px; }
.modal-actions { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.modal-actions > div { display: flex; gap: 8px; }
.category-editor { display: grid; gap: 8px; }
.category-edit-row {
    display: grid;
    grid-template-columns: minmax(150px, 1fr) 72px auto;
    gap: 8px;
    align-items: center;
    padding: 10px;
    border: 1px solid var(--line);
    background: var(--panel-soft);
    border-radius: 16px;
}
.category-edit-row.dragging { opacity: .52; }
.add-category-form { display: grid; grid-template-columns: 1fr 72px auto; gap: 8px; align-items: center; }
.utility-row { display: flex; gap: 8px; flex-wrap: wrap; }

.selection-copy {
    position: fixed;
    z-index: 70;
    border: 0;
    border-radius: 999px;
    background: #172033;
    color: #fff;
    font-weight: 850;
    padding: 10px 14px;
    box-shadow: 0 12px 26px rgba(15,23,42,.22);
    animation: pop .12s ease both;
}
.toast {
    position: fixed;
    left: 50%;
    bottom: 22px;
    transform: translateX(-50%);
    z-index: 80;
    background: #172033;
    color: white;
    border-radius: 999px;
    padding: 11px 16px;
    font-weight: 850;
    box-shadow: 0 12px 30px rgba(15,23,42,.22);
    animation: toastIn .16s ease both;
}

body.compact .quick-card { padding: 11px; margin-bottom: 14px; }
body.compact .notes-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
body.compact .note-card { min-height: 136px; padding: 11px; gap: 7px; }
body.compact .note-card .card-body { -webkit-line-clamp: 3; line-height: 1.38; }
body.compact .card-actions button { padding: 6px 8px; }

@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pop { from { opacity: .8; transform: scale(.985); } to { opacity: 1; transform: scale(1); } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideIn { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: translateX(0); } }
@keyframes modalPop { from { opacity: 0; transform: translate(-50%, -48%) scale(.985); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes newNotePulse { 0% { transform: scale(.985); box-shadow: 0 0 0 0 rgba(37,99,235,.28); } 45% { transform: scale(1.01); box-shadow: 0 0 0 7px rgba(37,99,235,.12); } 100% { transform: scale(1); box-shadow: 0 8px 18px rgba(15,23,42,.06); } }

@media (max-width: 900px) {
    .app-shell { grid-template-columns: 1fr; }
    .sidebar { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
    .side-footer { margin-top: 0; }
    .topbar { flex-direction: column; }
    .top-actions { width: 100%; justify-content: stretch; }
    .search-wrap { min-width: 100%; flex: 1 0 100%; }
    .quick-top, .quick-bottom, .form-grid, .settings-grid, .add-category-form, .category-edit-row { grid-template-columns: 1fr; }
    .reader-panel { inset: 8px; width: auto; border-radius: 20px; }
    .reader-body-edit { min-height: 300px; }
    .modal-actions { flex-direction: column; align-items: stretch; }
    .modal-actions > div { justify-content: flex-end; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

.vault-modal.open { display: block; }
.vault-card { width: min(520px, calc(100vw - 28px)); text-align: left; }
.vault-card .login-mark { margin: 0 auto 4px; }
.small-muted { color: #667085; font-size: 13px; line-height: 1.45; margin: 0; }
.user-admin-panel {
    border: 1px solid var(--line);
    background: #F8FAFC;
    border-radius: 20px;
    padding: 14px;
    display: grid;
    gap: 10px;
}
.users-list { display: grid; gap: 8px; }
.user-row {
    display: grid;
    grid-template-columns: minmax(160px, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff;
}
.user-row strong { display: block; color: #101828; }
.user-row span { display: block; color: #667085; font-size: 13px; margin-top: 2px; }
.add-user-form {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr auto auto;
    gap: 8px;
    align-items: center;
}
.danger-mini { color: #B42318 !important; }
#userBadge { color: #475467; }

@media (max-width: 900px) {
    .user-row, .add-user-form { grid-template-columns: 1fr; }
}

/* Performance + anti-CLS refinements */
body { overflow-anchor: none; }
.note-card {
    min-height: 188px;
    contain: layout paint style;
    content-visibility: auto;
    contain-intrinsic-size: 188px;
}
.note-card .card-top { min-height: 42px; }
.note-card h3 {
    min-height: 2.48em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.card-meta {
    min-height: 28px;
    font-variant-numeric: tabular-nums;
}
.save-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 62px;
    height: 24px;
    opacity: 0;
    visibility: hidden;
    background: rgba(255,255,255,.68);
    border: 1px solid rgba(15,23,42,.06);
    border-radius: 999px;
    color: #2563eb;
    font-weight: 850;
}
.save-pill.is-visible { opacity: 1; visibility: visible; }
.card-actions {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    min-height: 36px;
}
.card-actions button {
    width: 100%;
    min-height: 34px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
}
.reader-actions {
    min-height: 44px;
    align-items: stretch;
}
.reader-actions .soft-button,
.reader-actions .primary-small,
.reader-actions .danger-button,
.reader-pin-line {
    min-height: 40px;
    white-space: nowrap;
}
.save-status {
    min-width: 142px;
    text-align: center;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    font-variant-numeric: tabular-nums;
}
.reader-meta, #readerMeta { min-height: 20px; }
.reader-title-input { min-height: 54px; }
.reader-category-select { min-height: 38px; }
.notes-grid { transform: translateZ(0); }
.note-card, .reader-panel, .modal-card { will-change: transform; }
@keyframes pop { from { opacity: .92; transform: translateY(3px); } to { opacity: 1; transform: translateY(0); } }
@keyframes newNotePulse { 0% { transform: translateY(3px); box-shadow: 0 0 0 0 rgba(37,99,235,.18); } 55% { transform: translateY(0); box-shadow: 0 0 0 5px rgba(37,99,235,.10); } 100% { transform: translateY(0); box-shadow: 0 8px 18px rgba(15,23,42,.06); } }
body.compact .note-card { min-height: 150px; contain-intrinsic-size: 150px; }
body.compact .note-card .card-top { min-height: 36px; }
body.compact .note-card h3 { min-height: 2.3em; }
@media (max-width: 620px) {
    .card-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .save-status { min-width: 118px; }
}
