:root {
    --font-sans: 'DM Sans', system-ui, -apple-system, sans-serif;
    --font-serif: 'Source Serif 4', Georgia, serif;
    --accent: #5b6eae;
    --accent-hover: #4a5d9a;
    --accent-soft: rgba(91, 110, 174, 0.12);
    --bg: #f6f4f1;
    --bg-elevated: #ffffff;
    --bg-muted: #ece8e3;
    --text: #1f2428;
    --text-muted: #5f676f;
    --border: #ddd7cf;
    --shadow: 0 1px 3px rgba(20, 24, 28, 0.06), 0 8px 24px rgba(20, 24, 28, 0.04);
    --radius: 14px;
    --radius-sm: 8px;
    --sidebar-width: 260px;
    --topbar-height: 64px;
    --success: #2f7a4f;
    --warning: #9a6b1f;
    --danger: #b04444;
    --type-address: #4a7c59;
    --type-employment: #5b6eae;
    --type-person: #6b5b95;
    --type-life_event: #9b4d7a;
    --type-note: #5f676f;
}

[data-theme="dark"] {
    --accent: #8da0db;
    --accent-hover: #a4b3e8;
    --accent-soft: rgba(141, 160, 219, 0.15);
    --bg: #14171b;
    --bg-elevated: #1d2228;
    --bg-muted: #2a3038;
    --text: #edf0f3;
    --text-muted: #a4adb8;
    --border: #343b45;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.25), 0 8px 24px rgba(0, 0, 0, 0.18);
    --success: #5cb87a;
    --warning: #d4a44a;
    --danger: #e07070;
}

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

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.55;
    color: var(--text);
    background: var(--bg);
    min-height: 100vh;
}

img, svg { display: block; max-width: 100%; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

.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;
}

.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-elevated);
    border-right: 1px solid var(--border);
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 200;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    display: flex;
    flex-direction: column;
}

.sidebar.open { transform: translateX(0); }

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 150;
}

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

.sidebar-brand {
    padding: 1.25rem 1.25rem 1rem;
    border-bottom: 1px solid var(--border);
}

.brand-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text);
    font-weight: 700;
    font-size: 1.1rem;
}

.brand-icon {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 10px;
    background: var(--accent-soft);
    color: var(--accent);
    display: grid;
    place-items: center;
}

.sidebar-nav {
    padding: 1rem 0.75rem 2rem;
    overflow-y: auto;
    flex: 1;
}

.nav-section {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    padding: 1rem 0.75rem 0.35rem;
    font-weight: 600;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 0.85rem;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    margin-bottom: 0.15rem;
    transition: background 0.15s, color 0.15s;
}

.nav-link:hover {
    background: var(--accent-soft);
    color: var(--text);
}

.nav-link.active {
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 600;
}

.nav-link i { width: 1.1rem; text-align: center; }

.app-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.topbar {
    height: var(--topbar-height);
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.menu-toggle {
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    width: 2.5rem;
    height: 2.5rem;
    color: var(--text);
    cursor: pointer;
    display: grid;
    place-items: center;
}

.global-search {
    flex: 1;
    position: relative;
    max-width: 520px;
}

.global-search .search-icon {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.global-search input {
    width: 100%;
    padding: 0.65rem 0.85rem 0.65rem 2.35rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--bg);
    color: var(--text);
    font: inherit;
}

.global-search input:focus {
    outline: 2px solid var(--accent-soft);
    border-color: var(--accent);
}

.topbar-actions {
    display: flex;
    gap: 0.35rem;
}

.topbar-btn {
    width: 2.5rem;
    height: 2.5rem;
    display: grid;
    place-items: center;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    border: 1px solid transparent;
}

.topbar-btn:hover {
    background: var(--bg-muted);
    color: var(--text);
}

.content {
    flex: 1;
    padding: 1.25rem 1rem 2rem;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.app-footer {
    padding: 1rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    border-top: 1px solid var(--border);
}

.page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.page-header h1 {
    margin: 0;
    font-family: var(--font-serif);
    font-size: clamp(1.6rem, 4vw, 2rem);
    font-weight: 600;
    line-height: 1.2;
}

.page-header p {
    margin: 0.35rem 0 0;
    color: var(--text-muted);
}

.page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.25rem;
}

.card + .card { margin-top: 1rem; }

.card-title {
    margin: 0 0 1rem;
    font-size: 1rem;
    font-weight: 600;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.1rem;
    box-shadow: var(--shadow);
}

.stat-card .stat-label {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    font-family: var(--font-serif);
    line-height: 1;
}

.stat-card .stat-link {
    display: inline-block;
    margin-top: 0.5rem;
    font-size: 0.85rem;
}

.quick-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
}

.quick-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.85rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px dashed var(--border);
    color: var(--text);
    background: var(--bg);
    transition: border-color 0.15s, background 0.15s;
}

.quick-link:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.grid-2 {
    display: grid;
    gap: 1rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.65rem 1.1rem;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}

.btn-primary:hover {
    background: var(--accent-hover);
    color: #fff;
}

.btn-secondary {
    background: var(--bg-muted);
    color: var(--text);
    border-color: var(--border);
}

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

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    border-color: var(--border);
}

.btn-ghost:hover {
    background: var(--bg-muted);
    color: var(--text);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-danger:hover { filter: brightness(1.05); }

.btn-sm { padding: 0.45rem 0.75rem; font-size: 0.875rem; }

.btn-block { width: 100%; }

.form-card { max-width: 780px; }

.form-group {
    margin-bottom: 1rem;
}

.form-group label,
fieldset legend {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.35rem;
}

.form-group input,
.form-group select,
.form-group textarea,
.filter-bar input,
.filter-bar select {
    width: 100%;
    padding: 0.65rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--text);
    font: inherit;
}

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

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: 2px solid var(--accent-soft);
    border-color: var(--accent);
}

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

.form-hint {
    margin: 0.35rem 0 0;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.form-error {
    color: var(--danger);
    font-size: 0.85rem;
    margin-top: 0.35rem;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.checkbox-group input { width: auto; }

.date-field-group {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1rem;
    margin-bottom: 1rem;
}

.date-field-group legend { padding: 0 0.25rem; }

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.form-actions-sticky {
    position: sticky;
    bottom: 0;
    background: var(--bg-elevated);
    padding: 1rem;
    margin: 1.5rem -1.25rem -1.25rem;
    border-top: 1px solid var(--border);
    border-radius: 0 0 var(--radius) var(--radius);
}

.alert {
    padding: 0.85rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    border: 1px solid transparent;
}

.alert-success { background: rgba(47, 122, 79, 0.12); border-color: rgba(47, 122, 79, 0.25); color: var(--success); }
.alert-error { background: rgba(176, 68, 68, 0.12); border-color: rgba(176, 68, 68, 0.25); color: var(--danger); }
.alert-info { background: var(--accent-soft); border-color: rgba(91, 110, 174, 0.25); color: var(--accent); }

.flash-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: rgba(20, 24, 28, 0.45);
    opacity: 0;
    animation: flashOverlayIn 0.3s ease forwards;
}

.flash-modal-overlay.flash-modal-out {
    animation: flashOverlayOut 0.35s ease forwards;
}

.flash-modal {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 16px 48px rgba(20, 24, 28, 0.18);
    padding: 2rem 2.25rem;
    max-width: 380px;
    width: 100%;
    text-align: center;
    transform: scale(0.92) translateY(12px);
    opacity: 0;
    animation: flashModalIn 0.35s ease 0.05s forwards;
}

.flash-modal-overlay.flash-modal-out .flash-modal {
    animation: flashModalOut 0.3s ease forwards;
}

.flash-modal-icon {
    width: 3.25rem;
    height: 3.25rem;
    margin: 0 auto 1rem;
    border-radius: 50%;
    background: rgba(47, 122, 79, 0.12);
    color: var(--success);
    display: grid;
    place-items: center;
    font-size: 1.5rem;
}

.flash-modal-message {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.45;
}

.flash-banner {
    position: fixed;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    padding: 0.85rem 1.25rem;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    box-shadow: var(--shadow);
    max-width: min(90vw, 480px);
    animation: flashBannerIn 0.3s ease;
}

.flash-banner-error {
    background: rgba(176, 68, 68, 0.95);
    border-color: rgba(176, 68, 68, 1);
    color: #fff;
}

.flash-banner-info {
    background: var(--bg-elevated);
    border-color: var(--border);
    color: var(--text);
}

@keyframes flashOverlayIn {
    to { opacity: 1; }
}

@keyframes flashOverlayOut {
    to { opacity: 0; }
}

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

@keyframes flashModalOut {
    to {
        opacity: 0;
        transform: scale(0.96) translateY(8px);
    }
}

@keyframes flashBannerIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.record-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.people-groups {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.record-group-heading {
    margin: 0 0 0.65rem;
}

.record-group-heading .relationship-pill {
    font-size: 0.75rem;
}

.record-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.7rem 0.9rem;
    transition: border-color 0.15s, background 0.15s;
}

.record-card:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.record-content {
    flex: 1;
    min-width: 0;
}

.record-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem 0.6rem;
    margin-bottom: 0.15rem;
}

.record-title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: var(--font-sans);
    line-height: 1.3;
    color: var(--text);
}

.record-title-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.45rem 0.6rem;
}

.relationship-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    background: rgba(107, 91, 149, 0.12);
    color: var(--type-person);
    line-height: 1.2;
}

.record-card .record-meta {
    margin: 0;
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.35;
}

.record-date {
    margin: 0.2rem 0 0;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text);
    line-height: 1.35;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.record-date i {
    color: var(--accent);
    font-size: 0.8rem;
    flex-shrink: 0;
}

.record-service-length {
    font-size: 0.78rem;
    color: #9aa3ad;
    font-style: italic;
    font-weight: 400;
}

[data-theme="dark"] .record-service-length {
    color: #7f8791;
}

.record-excerpt {
    margin: 0.25rem 0 0;
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.35;
}

.record-actions {
    display: flex;
    gap: 0.4rem;
    flex-shrink: 0;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.record-card .tag-list {
    margin-top: 0.35rem;
    gap: 0.25rem;
}

.record-card .tag-chip {
    font-size: 0.68rem;
    padding: 0.08rem 0.38rem;
}

.record-card .status-badge {
    font-size: 0.68rem;
    padding: 0.08rem 0.4rem;
}

.record-card .importance-dots {
    gap: 0.12rem;
}

.record-card .importance-dots span {
    width: 0.35rem;
    height: 0.35rem;
}

.record-card--stacked {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.record-card--stacked .record-status-top {
    display: inline-flex;
    margin-bottom: 0.65rem;
}

.record-card--stacked .record-title {
    margin-bottom: 0.15rem;
}

.record-card--stacked .record-actions {
    flex-direction: column;
    align-items: stretch;
    align-self: flex-start;
    gap: 0.35rem;
    min-width: 5.5rem;
}

.record-card--stacked .record-actions .btn,
.record-card--stacked .record-actions .delete-form .btn {
    width: 100%;
    justify-content: center;
}

.record-card--stacked .record-actions .delete-form {
    display: block;
    width: 100%;
}

@media (max-width: 640px) {
    .record-card--stacked {
        flex-direction: row;
        align-items: flex-start;
    }

    .record-card--stacked .record-actions {
        flex-direction: column;
        align-self: flex-start;
        min-width: 5rem;
    }

    .record-card--stacked .record-actions .btn,
    .record-card--stacked .record-actions .delete-form .btn {
        width: 100%;
    }

    .record-card:not(.record-card--stacked) {
        flex-direction: column;
        align-items: stretch;
        gap: 0.65rem;
    }

    .record-card:not(.record-card--stacked) .record-actions {
        justify-content: flex-start;
        padding-top: 0.35rem;
        border-top: 1px solid var(--border);
    }
}

.record-card-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.record-card h2, .record-card h3 {
    margin: 0;
    font-size: 1.05rem;
    font-family: var(--font-serif);
}

.record-meta {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.record-body {
    color: var(--text);
    font-size: 0.95rem;
}

.btn-icon {
    width: 1.85rem;
    height: 1.85rem;
    padding: 0;
    min-width: 1.85rem;
}

.btn-icon-danger {
    color: var(--text-muted);
}

.btn-icon-danger:hover {
    background: rgba(176, 68, 68, 0.12);
    color: var(--danger);
}

.badge, .type-badge, .tag-chip, .status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.type-badge.type-address { background: rgba(74, 124, 89, 0.15); color: var(--type-address); }
.type-badge.type-employment { background: rgba(91, 110, 174, 0.15); color: var(--type-employment); }
.type-badge.type-person { background: rgba(107, 91, 149, 0.15); color: var(--type-person); }
.type-badge.type-life_event { background: rgba(155, 77, 122, 0.15); color: var(--type-life_event); }
.type-badge.type-note { background: rgba(95, 103, 111, 0.15); color: var(--type-note); }

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.65rem;
}

.tag-chip {
    background: var(--bg-muted);
    color: var(--text-muted);
}

.status-badge.current { background: rgba(47, 122, 79, 0.15); color: var(--success); }
.status-badge.past { background: var(--bg-muted); color: var(--text-muted); }

.filter-bar { margin-bottom: 1.25rem; }

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.85rem;
}

.filter-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.85rem;
}

.table-wrap { overflow-x: auto; }

table.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}

table.data-table th,
table.data-table td {
    padding: 0.75rem 0.85rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

table.data-table th {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}

table.data-table tr:hover td { background: var(--accent-soft); }

.timeline-controls {
    margin-bottom: 1.25rem;
}

.timeline-type-filters {
    border: none;
    margin: 0;
    padding: 0;
}

.timeline-type-filters legend {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.timeline-type-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
}

.timeline-type-checkboxes .checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.92rem;
    cursor: pointer;
    user-select: none;
}

.timeline-type-checkboxes input {
    width: auto;
    margin: 0;
}

.timeline {
    position: relative;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0.45rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border);
    z-index: 0;
}

.timeline-item {
    position: relative;
    padding-left: 2rem;
    margin-bottom: 1.25rem;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-item::before {
    display: none;
}

.timeline-dot {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 0.95rem;
    height: 0.95rem;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid var(--bg-elevated);
    box-shadow: 0 0 0 2px var(--border);
    z-index: 1;
}

.timeline-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    box-shadow: var(--shadow);
}

.timeline-card-header {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.35rem;
}

.timeline-card h3 {
    margin: 0;
    font-size: 1rem;
    font-family: var(--font-serif);
}

.timeline-card h3 a { color: var(--text); }
.timeline-card h3 a:hover { color: var(--accent); }

.search-results { display: grid; gap: 0.85rem; }

.search-result mark {
    background: rgba(91, 110, 174, 0.25);
    color: inherit;
    padding: 0 0.1em;
    border-radius: 2px;
}

.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 2rem;
    margin-bottom: 0.75rem;
    opacity: 0.5;
}

.auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1.5rem;
    background:
        radial-gradient(circle at top right, var(--accent-soft), transparent 40%),
        var(--bg);
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) + 4px);
    box-shadow: var(--shadow);
    padding: 2rem 1.75rem;
}

.auth-brand {
    text-align: center;
    margin-bottom: 1.75rem;
}

.auth-brand h1 {
    margin: 0.75rem 0 0.35rem;
    font-family: var(--font-serif);
    font-size: 1.75rem;
}

.auth-brand p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.auth-icon {
    width: 3.5rem;
    height: 3.5rem;
    margin: 0 auto;
    border-radius: 16px;
    background: var(--accent-soft);
    color: var(--accent);
    display: grid;
    place-items: center;
    font-size: 1.35rem;
}

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

.activity-list li {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.92rem;
}

.activity-list li:last-child { border-bottom: 0; }

.activity-time {
    display: block;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

.settings-section + .settings-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.settings-section h2 {
    margin: 0 0 1rem;
    font-size: 1.05rem;
}

.code-block {
    font-family: ui-monospace, monospace;
    font-size: 0.85rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    word-break: break-all;
}

.inline-form { display: inline; }

.importance-dots {
    display: inline-flex;
    gap: 0.15rem;
}

.importance-dots span {
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 50%;
    background: var(--border);
}

.importance-dots span.active { background: var(--accent); }

@media (min-width: 900px) {
    .sidebar {
        transform: none;
        position: sticky;
        top: 0;
        height: 100vh;
    }

    .menu-toggle,
    .sidebar-overlay { display: none; }

    .app-main { margin-left: 0; }

    .content { padding: 1.75rem 2rem 2.5rem; }

    .grid-2 { grid-template-columns: 1fr 1fr; }

    .form-row { grid-template-columns: 1fr 1fr; }

    .timeline-item { padding-left: 2.5rem; }
}

@media (max-width: 599px) {
    .page-header { flex-direction: column; }
    .form-actions-sticky { position: sticky; bottom: 0; z-index: 10; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
