:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f3f4f6;
    --bg-tertiary: #e5e7eb;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --border: #d1d5db;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --shadow: rgba(0, 0, 0, 0.1);
}

@media (max-width: 900px) {
    .site-header {
        align-items: flex-start;
        flex-direction: column;
        margin-bottom: 34px;
    }

    .site-nav {
        flex-wrap: wrap;
    }

    .site-hero,
    .site-split {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .site-feature-grid {
        grid-template-columns: 1fr;
    }

    .tool-nav {
        position: fixed !important;
        left: 14px !important;
        right: 14px !important;
        top: auto !important;
        bottom: 8px !important;
        bottom: calc(env(safe-area-inset-bottom, 0px) + 8px) !important;
        width: auto !important;
        height: 64px !important;
        min-height: 64px !important;
        z-index: 50 !important;
        border: 1px solid rgba(209, 213, 219, 0.72) !important;
        border-radius: 28px !important;
        border-bottom: 1px solid rgba(209, 213, 219, 0.72) !important;
        background-color: rgba(255, 255, 255, 0.9) !important;
        box-shadow: 0 14px 34px rgba(0, 0, 0, 0.14) !important;
        backdrop-filter: blur(18px);
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: flex-start !important;
        gap: 4px !important;
        padding: 8px !important;
        overflow: hidden !important;
    }

    [data-theme="dark"] .tool-nav {
        background-color: rgba(31, 41, 55, 0.92) !important;
        border-color: rgba(75, 85, 99, 0.72) !important;
    }

    .tool-nav-spacer {
        display: none !important;
    }

    .tool-nav-item {
        flex: 1 0 46px !important;
        width: auto !important;
        height: 46px !important;
        border-radius: 20px !important;
    }

    .tool-nav-avatar {
        order: 0 !important;
        margin-top: 0 !important;
        margin-bottom: 0 !important;
    }
}

[data-theme="dark"] {
    --bg-primary: #111827;
    --bg-secondary: #1f2937;
    --bg-tertiary: #374151;
    --text-primary: #f9fafb;
    --text-secondary: #9ca3af;
    --border: #4b5563;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --shadow: rgba(0, 0, 0, 0.5);
}

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

html {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
    margin: 0;
    padding: 0;
    height: 100vh;
    overflow: hidden;
}

.auth-page {
    min-height: 100dvh;
    display: grid;
    place-items: center;
    padding: 24px;
    background: var(--bg-primary);
}

.auth-card {
    width: min(420px, 100%);
    padding: 28px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg-secondary);
    box-shadow: 0 14px 36px var(--shadow);
}

.auth-card h1 {
    margin-bottom: 8px;
    color: var(--text-primary);
    font-size: 30px;
}

.auth-card p,
.auth-switch {
    color: var(--text-secondary);
}

.auth-form {
    display: grid;
    gap: 16px;
    margin-top: 22px;
}

.auth-form label {
    display: grid;
    gap: 8px;
    color: var(--text-primary);
    font-weight: 700;
}

.auth-form .btn {
    margin-top: 4px;
}

.auth-error {
    margin-top: 18px;
    padding: 12px;
    border: 1px solid rgba(239, 68, 68, 0.35);
    border-radius: 8px;
    background: rgba(239, 68, 68, 0.12);
    color: var(--danger);
}

.auth-switch {
    margin-top: 18px;
    text-align: center;
}

.auth-switch a {
    color: var(--accent);
    font-weight: 700;
}

.site-page {
    height: 100dvh;
    overflow-y: auto;
    padding: 24px clamp(18px, 4vw, 56px) 56px;
    background:
        radial-gradient(circle at 12% 8%, rgba(16, 185, 129, 0.16), transparent 28%),
        radial-gradient(circle at 86% 14%, rgba(59, 130, 246, 0.16), transparent 30%),
        var(--bg-primary);
}

.site-header {
    max-width: 1180px;
    margin: 0 auto 54px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.site-logo {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 20px;
    font-weight: 900;
}

.site-nav,
.site-actions,
.site-hero-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.site-nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 700;
}

.site-nav a:hover {
    color: var(--accent);
}

.site-hero,
.site-section {
    max-width: 1180px;
    margin: 0 auto;
}

.site-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
    align-items: center;
    gap: clamp(28px, 6vw, 72px);
    min-height: 560px;
}

.site-kicker {
    margin-bottom: 12px;
    color: var(--success);
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
}

.site-hero h1 {
    max-width: 780px;
    color: var(--text-primary);
    font-size: clamp(42px, 7vw, 78px);
    line-height: 0.98;
    letter-spacing: 0;
}

.site-hero-text {
    max-width: 650px;
    margin-top: 22px;
    color: var(--text-secondary);
    font-size: 19px;
}

.site-hero-actions {
    margin-top: 30px;
    flex-wrap: wrap;
}

.site-hero-panel {
    display: grid;
    gap: 14px;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background-color: color-mix(in srgb, var(--bg-secondary) 92%, transparent);
    box-shadow: 0 20px 60px var(--shadow);
}

.site-metric {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    gap: 2px 14px;
    align-items: center;
    padding: 16px;
    border-radius: 8px;
    background-color: var(--bg-primary);
}

.site-metric-link {
    color: inherit;
    text-decoration: none;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.site-metric-link:hover {
    transform: translateY(-2px);
}

.site-metric span {
    grid-row: span 2;
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background-color: var(--bg-tertiary);
    font-size: 22px;
}

.site-metric strong {
    color: var(--text-primary);
    font-size: 18px;
}

.site-metric small,
.site-muted {
    color: var(--text-secondary);
}

.site-section {
    padding: 70px 0 0;
}

.site-section h2 {
    max-width: 760px;
    color: var(--text-primary);
    font-size: clamp(30px, 4vw, 46px);
    line-height: 1.08;
}

.site-section p {
    max-width: 720px;
    margin-top: 14px;
    color: var(--text-secondary);
    font-size: 17px;
}

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

.site-feature {
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background-color: var(--bg-secondary);
}

.site-feature span {
    font-size: 28px;
}

.site-feature h3 {
    margin-top: 16px;
    color: var(--text-primary);
    font-size: 20px;
}

.site-feature p {
    margin-top: 8px;
    font-size: 15px;
}

.site-split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
    gap: 28px;
    align-items: start;
}

.site-roadmap {
    display: grid;
    gap: 10px;
}

.site-roadmap div {
    display: grid;
    gap: 4px;
    padding: 16px;
    border-left: 4px solid var(--success);
    border-radius: 8px;
    background-color: var(--bg-secondary);
}

.site-roadmap strong {
    color: var(--text-primary);
}

.site-roadmap span {
    color: var(--text-secondary);
}

.marathon-hero {
    min-height: 520px;
}

.marathon-day-card {
    align-content: start;
}

.marathon-day-label {
    width: fit-content;
    padding: 6px 10px;
    border-radius: 999px;
    background-color: rgba(16, 185, 129, 0.14);
    color: var(--success);
    font-weight: 900;
}

.marathon-day-card h2 {
    margin-top: 6px;
    color: var(--text-primary);
    font-size: 28px;
    line-height: 1.12;
}

.marathon-day-card p {
    color: var(--text-secondary);
}

.marathon-checklist {
    display: grid;
    gap: 10px;
    margin-top: 8px;
    list-style: none;
}

.marathon-checklist li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border-radius: 8px;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-weight: 800;
}

.marathon-checklist span {
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 50%;
    background-color: var(--success);
    color: white;
    font-size: 14px;
}

.marathon-lock-note {
    margin-top: 6px;
    padding: 12px;
    border: 1px dashed var(--border);
    border-radius: 8px;
    color: var(--text-secondary);
    font-weight: 700;
}

.marathon-status-section {
    padding-bottom: 30px;
}

.app-marathon-page {
    min-height: 100dvh;
}

.app-marathon-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(240px, 320px);
    gap: 24px;
    align-items: end;
    padding: 24px 0 10px;
}

.app-marathon-header h1 {
    max-width: 760px;
    color: var(--text-primary);
    font-size: clamp(38px, 5vw, 64px);
    line-height: 1;
}

.app-marathon-progress-card,
.app-marathon-day,
.app-marathon-sidebar,
.app-marathon-empty {
    border: 1px solid var(--border);
    border-radius: 14px;
    background-color: var(--bg-secondary);
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
}

.app-marathon-progress-card {
    display: grid;
    gap: 8px;
    padding: 18px;
}

.app-marathon-progress-card span {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 800;
}

.app-marathon-progress-card strong {
    color: var(--success);
    font-size: 36px;
    line-height: 1;
}

.app-marathon-progress-track {
    height: 9px;
    overflow: hidden;
    border-radius: 999px;
    background-color: var(--border-light);
}

.app-marathon-progress-track div {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--success), var(--accent));
}

.app-marathon-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(250px, 340px);
    gap: 20px;
    align-items: start;
    padding: 20px 0 40px;
}

.app-marathon-day {
    padding: clamp(20px, 4vw, 34px);
}

.app-marathon-day-top {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: space-between;
    color: var(--success);
    font-size: 14px;
    font-weight: 900;
}

.app-marathon-day h2 {
    margin-top: 12px;
    color: var(--text-primary);
    font-size: clamp(28px, 4vw, 44px);
    line-height: 1.08;
}

.app-marathon-content {
    display: grid;
    gap: 12px;
    margin-top: 20px;
}

.app-marathon-content p {
    color: var(--text-secondary);
    font-size: 17px;
    line-height: 1.65;
}

.app-marathon-task-list {
    display: grid;
    gap: 10px;
    margin-top: 28px;
}

.app-marathon-task-list h3,
.app-marathon-sidebar h3 {
    color: var(--text-primary);
    font-size: 22px;
}

.app-marathon-task-form {
    margin: 0;
}

.app-marathon-task {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    cursor: pointer;
    transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.app-marathon-task:hover {
    transform: translateY(-1px);
    border-color: rgba(16, 185, 129, 0.55);
    box-shadow: 0 10px 24px rgba(16, 185, 129, 0.12);
}

.app-marathon-task-readonly {
    cursor: default;
}

.app-marathon-task-readonly:hover {
    transform: none;
    border-color: var(--border);
    box-shadow: none;
}

.app-marathon-task input {
    width: 22px;
    height: 22px;
    flex: 0 0 auto;
    margin-top: 1px;
    accent-color: var(--success);
}

.app-marathon-task span {
    font-weight: 800;
    line-height: 1.35;
}

.app-marathon-sidebar {
    position: sticky;
    top: 18px;
    display: grid;
    gap: 14px;
    padding: 18px;
}

.app-marathon-day-list {
    display: grid;
    gap: 8px;
}

.app-marathon-notice {
    display: grid;
    gap: 4px;
    margin-bottom: 18px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background-color: var(--bg-primary);
}

.app-marathon-notice strong {
    color: var(--text-primary);
    font-size: 16px;
}

.app-marathon-notice span {
    color: var(--text-secondary);
    line-height: 1.45;
}

.app-marathon-notice-success {
    border-color: rgba(16, 185, 129, 0.42);
    background-color: rgba(16, 185, 129, 0.08);
}

.app-marathon-notice-waiting {
    border-color: rgba(245, 158, 11, 0.48);
    background-color: rgba(245, 158, 11, 0.1);
}

.app-marathon-day-state {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background-color: var(--bg-primary);
    text-decoration: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

a.app-marathon-day-state:hover {
    transform: translateY(-1px);
    border-color: rgba(16, 185, 129, 0.45);
    box-shadow: 0 8px 18px rgba(16, 185, 129, 0.12);
}

.app-marathon-day-state > span {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background-color: var(--border-light);
    color: var(--text-secondary);
    font-weight: 900;
}

.app-marathon-day-state strong,
.app-marathon-day-state small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-marathon-day-state strong {
    color: var(--text-primary);
}

.app-marathon-day-state small {
    color: var(--text-secondary);
}

.app-marathon-day-state-done > span {
    background-color: var(--success);
    color: white;
}

.app-marathon-day-state-current {
    border-color: rgba(16, 185, 129, 0.62);
    background-color: rgba(16, 185, 129, 0.11);
}

.app-marathon-day-state-current > span {
    background-color: var(--success);
    color: white;
}

.app-marathon-day-state-selected {
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.18);
}

.app-marathon-day-state-waiting {
    border-color: rgba(245, 158, 11, 0.55);
    background-color: rgba(245, 158, 11, 0.1);
}

.app-marathon-day-state-waiting > span {
    background-color: var(--warning);
    color: white;
}

.app-marathon-empty {
    display: grid;
    justify-items: start;
    gap: 12px;
    margin: 24px 0 40px;
    padding: clamp(22px, 4vw, 36px);
}

.app-marathon-empty h2 {
    color: var(--text-primary);
    font-size: clamp(28px, 4vw, 44px);
}

.app-marathon-empty p {
    max-width: 720px;
    color: var(--text-secondary);
}

.app-marathon-complete span {
    width: 56px;
    height: 56px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background-color: var(--success);
    color: white;
    font-size: 28px;
    font-weight: 900;
}

.site-section-first {
    padding-top: 18px;
}

.site-page-title,
.site-article-page h1 {
    max-width: 860px;
    color: var(--text-primary);
    font-size: clamp(40px, 6vw, 70px);
    line-height: 1;
    letter-spacing: 0;
}

.site-article-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin-top: 28px;
}

.site-article-grid-compact {
    max-width: none;
}

.site-article-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-height: 220px;
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background-color: var(--bg-secondary);
}

.site-article-card h2,
.site-article-card h3 {
    margin-top: 8px;
    color: var(--text-primary);
    line-height: 1.15;
}

.site-article-card a {
    color: inherit;
    text-decoration: none;
}

.site-article-card h2 a:hover,
.site-article-card h3 a:hover,
.site-read-link:hover {
    color: var(--accent);
}

.site-article-card p {
    margin-bottom: 18px;
    font-size: 15px;
}

.site-article-meta {
    color: var(--success);
    font-size: 13px;
    font-weight: 900;
}

.site-read-link {
    margin-top: auto;
    color: var(--accent);
    font-weight: 800;
    text-decoration: none;
}

.site-section-action {
    margin-top: 22px;
    text-decoration: none;
}

.site-article-page {
    max-width: 860px;
    margin: 0 auto;
    padding: 26px 0 80px;
}

.site-article-page .site-read-link {
    display: inline-flex;
    margin-bottom: 26px;
}

.site-article-lead {
    margin-top: 20px;
    color: var(--text-secondary);
    font-size: 21px;
}

.site-article-content {
    margin-top: 34px;
}

.site-article-content p {
    margin-bottom: 18px;
    color: var(--text-primary);
    font-size: 18px;
    line-height: 1.75;
}

@media (max-width: 900px) {
    .site-header {
        align-items: flex-start;
        flex-direction: column;
        margin-bottom: 34px;
    }

    .site-nav,
    .site-actions {
        flex-wrap: wrap;
    }

    .site-hero,
    .site-split {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .site-hero h1 {
        font-size: 42px;
    }

    .site-feature-grid,
    .site-article-grid {
        grid-template-columns: 1fr;
    }

    .app-marathon-header,
    .app-marathon-layout {
        grid-template-columns: 1fr;
    }

    .app-marathon-sidebar {
        position: static;
        order: -1;
    }
}

.admin-page {
    height: 100dvh;
    min-height: 100dvh;
    overflow-y: auto;
    padding: 28px;
    background: var(--bg-primary);
    color: var(--text-primary);
}

.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 24px;
}

.admin-header h1 {
    font-size: 32px;
    margin-bottom: 6px;
}

.admin-header p {
    color: var(--text-secondary);
}

.admin-actions,
.admin-row-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.admin-layout {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

.admin-sidebar {
    position: sticky;
    top: 24px;
    min-height: calc(100dvh - 168px);
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg-secondary);
}

.admin-nav-main {
    display: grid;
    gap: 8px;
}

.admin-nav-item {
    width: 100%;
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 11px 12px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 800;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
}

.admin-nav-settings {
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}

.admin-nav-settings summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 44px;
    padding: 11px 12px;
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 900;
    cursor: pointer;
    list-style: none;
}

.admin-nav-settings summary::-webkit-details-marker {
    display: none;
}

.admin-nav-settings summary::after {
    content: "▾";
    color: var(--text-secondary);
    font-size: 12px;
    transition: transform 0.2s ease;
}

.admin-nav-settings[open] summary::after {
    transform: rotate(180deg);
}

.admin-nav-settings summary:hover {
    background: var(--bg-tertiary);
}

.admin-nav-subitem {
    margin-top: 6px;
    padding-left: 22px;
    color: var(--text-secondary);
}

.admin-nav-item:hover,
.admin-nav-item.active {
    border-color: var(--accent);
    background: rgba(59, 130, 246, 0.12);
    color: var(--accent);
}

.admin-content {
    min-width: 0;
}

.admin-single-page {
    max-width: 1120px;
    margin: 0 auto;
}

.admin-section {
    display: none;
}

.admin-section.active {
    display: block;
}

.admin-section-header {
    margin-bottom: 16px;
}

.admin-section-header h2 {
    margin-bottom: 6px;
    font-size: 24px;
}

.admin-section-header p {
    color: var(--text-secondary);
}

.admin-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg-secondary);
}

.admin-settings-grid {
    display: grid;
    gap: 16px;
    margin-bottom: 24px;
}

.admin-settings-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg-secondary);
}

.admin-card-title {
    margin-bottom: 16px;
    font-size: 20px;
}

.admin-article-create-card {
    align-items: stretch;
    flex-direction: column;
    margin-bottom: 22px;
}

.admin-marathon-day-list {
    display: grid;
    gap: 10px;
}

.admin-marathon-day-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg-secondary);
}

.admin-marathon-day-main {
    min-width: 0;
    display: grid;
    grid-template-columns: 84px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
}

.admin-marathon-day-number {
    display: inline-grid;
    place-items: center;
    min-height: 34px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.12);
    color: var(--accent);
    font-size: 13px;
    font-weight: 900;
}

.admin-marathon-day-main h3 {
    overflow: hidden;
    color: var(--text-primary);
    font-size: 18px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-marathon-day-main p {
    margin-top: 3px;
    color: var(--text-secondary);
    font-size: 14px;
}

.admin-marathon-content-textarea {
    min-height: 360px;
}

.admin-section-subheader {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 24px 0 12px;
}

.admin-section-subheader h3 {
    color: var(--text-primary);
    font-size: 22px;
}

.admin-section-subheader p {
    color: var(--text-secondary);
}

.admin-count-badge {
    min-width: 34px;
    min-height: 34px;
    display: inline-grid;
    place-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-weight: 900;
}

.admin-article-form {
    width: 100%;
    display: grid;
    gap: 14px;
}

.admin-article-form label {
    display: grid;
    gap: 7px;
    color: var(--text-primary);
    font-weight: 800;
}

.admin-form-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(180px, 320px);
    gap: 14px;
}

.admin-textarea-small {
    min-height: 72px;
}

.admin-textarea-large {
    min-height: 132px;
}

.admin-form-footer,
.admin-article-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}

.admin-status-select {
    min-width: 180px;
}

.admin-field-disabled {
    opacity: 0.48;
}

.admin-field-disabled input {
    cursor: not-allowed;
}

.admin-article-list {
    display: grid;
    gap: 16px;
    margin-top: 16px;
}

.admin-article-card {
    align-items: stretch;
    flex-direction: column;
}

.admin-article-card-header h3 {
    color: var(--text-primary);
    font-size: 20px;
}

.admin-article-card-header p,
.admin-empty-text {
    color: var(--text-secondary);
}

.admin-delete-article-form {
    display: flex;
    justify-content: flex-end;
}

.admin-settings-card h2 {
    margin-bottom: 6px;
    font-size: 20px;
}

.admin-settings-card p {
    color: var(--text-secondary);
    line-height: 1.45;
}

.favicon-settings {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.favicon-preview {
    width: 56px;
    height: 56px;
    display: grid;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg-primary);
    overflow: hidden;
    color: var(--accent);
    font-size: 24px;
    font-weight: 800;
}

.favicon-preview img {
    width: 36px;
    height: 36px;
    object-fit: contain;
}

.favicon-form {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.favicon-file-input {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 10px 14px;
    border: 1px dashed var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-weight: 700;
    cursor: pointer;
}

.favicon-file-input input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

@media (max-width: 800px) {
    .admin-page {
        padding: 18px;
    }

    .admin-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .admin-layout {
        grid-template-columns: 1fr;
    }

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

    .admin-sidebar {
        position: static;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .admin-settings-card,
    .favicon-settings,
    .favicon-form {
        align-items: stretch;
        flex-direction: column;
    }
}

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

.admin-table th,
.admin-table td {
    padding: 14px;
    border-bottom: 1px solid var(--border);
    text-align: left;
}

.admin-table th {
    color: var(--text-secondary);
    font-size: 13px;
    text-transform: uppercase;
}

.admin-table td span {
    display: block;
    margin-top: 4px;
    color: var(--text-secondary);
    font-size: 13px;
}

.admin-self {
    color: var(--text-secondary);
}

.mobile-topbar,
.mobile-drawer-overlay,
.mobile-drawer-profile,
.mobile-fab-stack,
.mobile-fab {
    display: none;
}

.stats-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background-color: var(--bg-secondary);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px var(--shadow);
    border: 1px solid var(--border);
}

.stat-label {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.stat-value {
    font-size: 32px;
    font-weight: bold;
    color: var(--accent);
}

.stat-icon {
    font-size: 24px;
    margin-bottom: 10px;
}

.section {
    background-color: var(--bg-secondary);
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px var(--shadow);
    border: 1px solid var(--border);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header:not(:first-child) {
    margin-top: 20px;
}

.section-title {
    font-size: 24px;
    font-weight: bold;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

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

.btn-primary:hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow);
}

.btn-success {
    background-color: var(--success);
    color: white;
}

.btn-success:hover {
    background-color: #059669;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow);
}

.btn-warning {
    background-color: var(--warning);
    color: white;
}

.btn-warning:hover {
    background-color: #d97706;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow);
}

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

.btn-secondary {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.task-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.task-item {
    background-color: var(--bg-primary);
    padding: 16px;
    border-radius: 8px;
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s;
    cursor: grab;
    position: relative;
}

.task-item:hover {
    border-color: var(--accent);
    box-shadow: 0 4px 12px var(--shadow);
}

.task-item:active {
    cursor: grabbing;
}

.task-item:not(.dragging):hover {
    cursor: pointer;
}

.task-item.dragging {
    opacity: 0.5;
    transform: scale(0.98);
    cursor: grabbing;
    box-shadow: 0 8px 16px var(--shadow);
}

.task-drag-preview {
    position: fixed;
    top: -1000px;
    left: -1000px;
    max-width: 240px;
    padding: 8px 12px;
    border-radius: 999px;
    background-color: var(--accent);
    color: white;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    box-shadow: 0 10px 24px var(--shadow);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    pointer-events: none;
    z-index: 9999;
}

.task-item.completed {
    opacity: 0.6;
}

.task-item.running {
    border-color: var(--success) !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2), 0 10px 28px var(--shadow);
    animation: activeTaskPulse 1.2s ease-in-out infinite;
}

.task-item.running:hover {
    border-color: var(--success) !important;
}

.task-item.running::after {
    content: "";
    position: absolute;
    inset: -5px;
    border: 2px solid var(--success);
    border-radius: 12px;
    pointer-events: none;
    animation: activeTaskRing 1.2s ease-in-out infinite;
}

.task-item.focus-highlight {
    border-color: var(--success);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.22), 0 8px 24px var(--shadow);
}

.task-timer-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 3px solid var(--accent);
    background-color: var(--bg-primary);
    color: var(--accent);
    font-size: 24px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    user-select: none;
}

.task-timer-btn:hover {
    background-color: var(--accent);
    color: white;
    transform: scale(1.1);
}

.task-timer-btn.running {
    background-color: var(--success);
    border-color: var(--success);
    color: white;
    animation: pulse 2s infinite;
}

.task-timer-btn.paused {
    background-color: var(--warning);
    border-color: var(--warning);
    color: white;
}

.task-timer-btn.completing {
    background-color: var(--accent);
    border-color: var(--accent);
    color: white;
    transform: scale(0.9);
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 var(--success);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
    }
}

@keyframes activeTaskPulse {
    0%, 100% {
        box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.24), 0 8px 22px var(--shadow);
    }
    50% {
        box-shadow: 0 0 0 9px rgba(16, 185, 129, 0.08), 0 14px 34px var(--shadow);
    }
}

@keyframes activeTaskRing {
    0%, 100% {
        opacity: 0.95;
        transform: scale(1);
    }
    50% {
        opacity: 0.35;
        transform: scale(1.015);
    }
}

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

.task-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 4px;
    overflow-wrap: anywhere;
}

.task-meta {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    font-size: 14px;
    color: var(--text-secondary);
}

.task-category {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.task-recurrence,
.task-overdue {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
}

.task-recurrence {
    background-color: rgba(59, 130, 246, 0.12);
    color: var(--accent);
}

.task-overdue {
    background-color: rgba(239, 68, 68, 0.12);
    color: var(--danger);
}

.task-time {
    display: flex;
    align-items: center;
    gap: 4px;
}

.task-actions {
    display: flex;
    gap: 8px;
}

.task-date-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.task-date-filter {
    border: 1px solid var(--border);
    background-color: var(--bg-primary);
    color: var(--text-secondary);
    border-radius: 8px;
    padding: 8px 12px;
    cursor: pointer;
    font-weight: 700;
    transition: all 0.2s ease;
}

.task-date-filter:hover,
.task-date-filter.active {
    border-color: var(--accent);
    color: var(--accent);
    background-color: rgba(59, 130, 246, 0.1);
}

.task-date-filter span {
    display: inline-flex;
    min-width: 22px;
    justify-content: center;
    margin-left: 6px;
    padding: 2px 6px;
    border-radius: 999px;
    background-color: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 12px;
}

.task-date {
    padding: 4px 8px;
    border-radius: 4px;
    background-color: rgba(16, 185, 129, 0.12);
    color: var(--success);
    font-size: 12px;
    font-weight: 700;
}

.task-date.overdue {
    background-color: rgba(239, 68, 68, 0.12);
    color: var(--danger);
}

.task-date.future {
    background-color: rgba(245, 158, 11, 0.14);
    color: var(--warning);
}

.task-date.tomorrow {
    background-color: rgba(59, 130, 246, 0.12);
    color: var(--accent);
}

.recurrence-options {
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background-color: var(--bg-primary);
    margin-bottom: 20px;
}

.recurring-edit-panel {
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background-color: var(--bg-primary);
    margin-bottom: 20px;
}

.recurring-edit-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.recurring-edit-header p {
    margin: 6px 0 0;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.4;
}

.recurring-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    white-space: nowrap;
    color: var(--text-primary);
    font-weight: 600;
}

.task-repeat-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 36px;
    cursor: pointer;
    color: var(--text-primary);
    font-weight: 700;
    line-height: 1.25;
}

.task-repeat-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.task-repeat-toggle .checkmark {
    position: relative;
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    background-color: var(--bg-primary);
    border: 2px solid var(--border);
    border-radius: 6px;
    transition: all 0.2s;
}

.task-repeat-toggle:hover .checkmark {
    border-color: var(--accent);
    box-shadow: 0 2px 8px var(--shadow);
}

.task-repeat-toggle input:checked ~ .checkmark {
    background-color: var(--accent);
    border-color: var(--accent);
}

.task-repeat-toggle .checkmark:after {
    content: "";
    position: absolute;
    left: 10px;
    top: 6px;
    width: 8px;
    height: 14px;
    border: solid white;
    border-width: 0 2px 2px 0;
    display: none;
    transform: rotate(45deg);
}

.task-repeat-toggle input:checked ~ .checkmark:after {
    display: block;
}

.inline-input-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.inline-input-group .form-input {
    max-width: 120px;
}

.weekday-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.weekday-picker label {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    background-color: var(--bg-secondary);
}

.recurrence-year-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.recurrence-limit {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

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

.note-card {
    background-color: var(--bg-primary);
    border: 2px solid var(--border);
    border-left: 5px solid var(--success);
    border-radius: 8px;
    padding: 16px;
    transition: all 0.2s;
    width: 100%;
    cursor: pointer;
}

.note-card:hover,
.note-card:focus {
    border-color: var(--success);
    box-shadow: 0 4px 12px var(--shadow);
    outline: none;
}

.note-card.dragging {
    opacity: 0.5;
    transform: scale(0.98);
    cursor: grabbing;
    box-shadow: 0 8px 16px var(--shadow);
}

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

.note-title {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.note-delete-btn {
    flex-shrink: 0;
}

.note-content {
    color: var(--text-primary);
    font-size: 14px;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-height: 4.8em;
}

.note-content.empty {
    color: var(--text-secondary);
    font-style: italic;
}

.note-project {
    margin-top: 12px;
    color: var(--text-secondary);
    font-size: 13px;
}

.note-textarea {
    min-height: 180px;
}

.modal-content.task-modal-content {
    width: 90vw;
    max-width: none;
    height: 90vh;
    max-height: 90dvh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.task-modal-content form {
    display: flex;
    flex: 1;
    min-height: 0;
    flex-direction: column;
    overflow: hidden;
}

.task-modal-scroll {
    flex: 1;
    width: 100%;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 4px 8px 4px 4px;
    overscroll-behavior: contain;
}

.task-modal-content .form-group,
.task-modal-content .recurring-edit-panel,
.task-modal-content .recurrence-options,
.task-modal-content .inline-input-group,
.task-modal-content .recurrence-limit {
    min-width: 0;
    max-width: 100%;
}

.task-modal-content .form-input,
.task-modal-content .form-textarea,
.task-modal-content .form-select {
    display: block;
    inline-size: 100%;
    min-width: 0;
    min-inline-size: 0;
    max-width: 100%;
    max-inline-size: 100%;
}

.task-modal-content input[type="date"] {
    width: 100%;
    inline-size: 100%;
    min-width: 0;
    min-inline-size: 0;
    max-width: 100%;
    max-inline-size: 100%;
    -webkit-appearance: none;
    appearance: none;
}

.task-modal-content input[type="date"]::-webkit-date-and-time-value {
    min-width: 0;
    text-align: left;
}

.task-modal-content input[type="date"]::-webkit-datetime-edit {
    min-width: 0;
}

.task-modal-content input[type="date"]::-webkit-calendar-picker-indicator {
    flex-shrink: 0;
    margin-left: 0;
}

.task-modal-content #editTaskDescription {
    min-height: 96px;
    max-height: none;
}

.copyable-field {
    position: relative;
}

.copyable-field .form-input,
.copyable-field .form-textarea {
    padding-right: 44px;
}

.copyable-field .form-textarea {
    min-height: 64px;
}

.copyable-field.has-scrollbar .form-textarea {
    padding-right: 58px;
}

.field-copy-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background-color: var(--bg-secondary);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 1;
}

.copyable-field.has-scrollbar .form-textarea + .field-copy-btn {
    right: 22px;
}

.field-copy-btn:hover,
.field-copy-btn.copied {
    border-color: var(--accent);
    background-color: var(--accent);
    color: white;
}

.task-modal-content .form-actions {
    position: sticky;
    bottom: 0;
    z-index: 2;
    flex-shrink: 0;
    padding-top: 16px;
    margin-top: 16px;
    border-top: 1px solid var(--border);
    background-color: var(--bg-secondary);
}

@media (max-width: 900px) {
    .note-list {
        grid-template-columns: 1fr;
    }
}

.modal-content.note-modal-content {
    width: 80vw;
    max-width: none;
    height: 80vh;
    max-height: 80dvh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.note-modal-content form {
    display: flex;
    flex: 1;
    min-height: 0;
    flex-direction: column;
}

.note-modal-content .form-group:has(.note-textarea) {
    display: flex;
    flex: 1;
    min-height: 0;
    flex-direction: column;
}

.note-modal-content .form-group:has(.note-textarea) .copyable-field {
    display: flex;
    flex: 1;
    min-height: 0;
}

.note-modal-content .note-textarea {
    flex: 1;
    min-height: 64px;
    max-height: none;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    min-height: 100dvh;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 16px;
    overflow-y: auto;
}

.modal.active {
    display: flex;
}

.modal-content {
    background-color: var(--bg-secondary);
    padding: 30px;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    max-height: calc(100dvh - 32px);
    overflow-y: auto;
    box-shadow: 0 10px 40px var(--shadow);
}

.modal.confirm-modal {
    align-items: center !important;
    justify-content: center !important;
    padding: 16px !important;
    overflow: hidden !important;
}

.confirm-modal .compact-confirm-content {
    width: auto !important;
    min-width: min(320px, calc(100vw - 32px));
    max-width: min(400px, calc(100vw - 32px)) !important;
    height: auto !important;
    max-height: calc(100dvh - 32px) !important;
    padding: 26px !important;
    overflow: visible !important;
}

.confirm-modal .compact-confirm-content-wide {
    max-width: min(460px, calc(100vw - 32px)) !important;
}

.modal-header {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 20px;
}

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

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border);
    border-radius: 8px;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-size: 16px;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.16);
}

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

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* Контейнер для стекирования уведомлений */
.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.notification {
    background-color: var(--bg-secondary);
    padding: 16px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px var(--shadow);
    border-left: 4px solid var(--accent);
    animation: slideIn 0.3s ease;
    max-width: 400px;
    pointer-events: auto;
}

.notification-close {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 6px;
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    flex-shrink: 0;
    transition: all 0.2s;
}

.notification-close:hover {
    background-color: var(--border);
    transform: scale(1.05);
}

.notification.success {
    border-left-color: var(--success);
}

.notification.warning {
    border-left-color: var(--warning);
}

.notification.error {
    border-left-color: var(--danger);
}

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

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

.chart-container {
    position: relative;
    height: 300px;
    margin: 20px 0;
}

.leaderboard-item {
    background-color: var(--bg-primary);
    padding: 16px;
    border-radius: 8px;
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
    transition: all 0.2s;
}

.leaderboard-item:hover {
    border-color: var(--accent);
}

.leaderboard-item.user {
    border-color: var(--accent);
    background-color: var(--bg-tertiary);
    box-shadow: 0 4px 12px var(--shadow);
}

.leaderboard-rank {
    font-size: 24px;
    font-weight: bold;
    color: var(--text-secondary);
    min-width: 40px;
}

.leaderboard-rank.top-1 {
    color: #ffd700;
    font-size: 32px;
}

.leaderboard-rank.top-2 {
    color: #c0c0c0;
}

.leaderboard-rank.top-3 {
    color: #cd7f32;
}

.leaderboard-avatar {
    font-size: 32px;
}

.leaderboard-info {
    flex: 1;
    min-width: 0;
}

.leaderboard-name {
    font-size: 18px;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.leaderboard-time {
    font-size: 20px;
    font-weight: bold;
    color: var(--accent);
}

.badge-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
}

.badge-filter-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.badge-card {
    background-color: var(--bg-primary);
    padding: 20px;
    border-radius: 12px;
    border: 2px solid var(--border);
    text-align: center;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    min-height: 270px;
}

.badge-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px var(--shadow);
}

.badge-card.earned {
    border-color: var(--success);
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.14), var(--bg-primary));
}

.badge-card.in-progress {
    border-color: var(--warning);
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), var(--bg-primary));
}

.badge-card.locked {
    opacity: 0.72;
    filter: grayscale(70%);
}

.badge-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.badge-name {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 8px;
}

.badge-description {
    font-size: 14px;
    color: var(--text-secondary);
    min-height: 40px;
}

.badge-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    padding: 3px 10px;
    margin-bottom: 12px;
    border-radius: 999px;
    background-color: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 700;
}

.badge-card.earned .badge-status {
    background-color: rgba(34, 197, 94, 0.16);
    color: var(--success);
}

.badge-card.in-progress .badge-status {
    background-color: rgba(245, 158, 11, 0.16);
    color: var(--warning);
}

.badge-requirement,
.badge-earned-date {
    margin-top: 10px;
    font-size: 12px;
    color: var(--text-secondary);
}

.badge-footer {
    margin-top: auto;
    padding-top: 14px;
}

.badge-earned-date {
    color: var(--success);
    font-weight: 700;
}

.badge-progress {
    height: 8px;
    margin-top: 14px;
    overflow: hidden;
    border-radius: 999px;
    background-color: var(--bg-tertiary);
}

.badge-progress-fill {
    height: 100%;
    min-width: 0;
    border-radius: inherit;
    background-color: var(--accent);
    transition: width 0.25s ease;
}

.badge-card.earned .badge-progress-fill {
    background-color: var(--success);
}

.badge-card.in-progress .badge-progress-fill {
    background-color: var(--warning);
}

.badge-card.locked .badge-progress-fill {
    background-color: var(--text-secondary);
}

.badge-progress-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 8px;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 700;
}

.loading {
    text-align: center;
    padding: 40px;
    font-size: 18px;
    color: var(--text-secondary);
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.empty-state-text {
    font-size: 18px;
}

/* Sidebar & Projects */
/* Контейнер для всего приложения с навигацией */
.app-container {
    display: flex;
    height: 100vh;
    height: 100dvh;
    min-width: 0;
    overflow: hidden;
}

/* Левая узкая панель навигации инструментов */
.tool-nav {
    width: 60px;
    height: 100vh;
    background-color: var(--bg-secondary);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 20px 0;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
    overflow: hidden;
    position: sticky;
    top: 0;
}

.tool-nav-spacer {
    display: none;
}

.tool-nav-item {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    border-radius: 8px;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tool-nav-item:hover {
    background-color: var(--bg-tertiary);
    transform: scale(1.1);
}

.tool-nav-item.active {
    background-color: var(--accent);
    color: white;
}

.tool-nav-avatar {
    order: 10;
    margin-top: auto;
    margin-bottom: 0;
    padding: 0;
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 22px;
    font-weight: 800;
    text-decoration: none;
    box-shadow: 0 4px 12px var(--shadow);
}

.tool-nav-avatar:hover {
    background-color: var(--accent);
    color: white;
}

.tool-nav-avatar img {
    width: 100%;
    height: 100%;
    display: block;
    border-radius: inherit;
    object-fit: cover;
}

.app-layout {
    display: flex;
    gap: 20px;
    padding: 20px;
    flex: 1;
    height: 100vh;
    height: 100dvh;
    min-width: 0;
    overflow-y: auto;
}

/* Контейнер для контента страниц без app-layout */
.page-content {
    flex: 1;
    height: 100vh;
    height: 100dvh;
    min-width: 0;
    overflow-y: auto;
    padding: 20px;
}

.sidebar {
    width: 280px;
    flex-shrink: 0;
    background-color: var(--bg-secondary);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid var(--border);
    height: fit-content;
    position: sticky;
    top: 20px;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

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

.sidebar-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.sidebar-icon-btn svg {
    display: block;
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.sidebar-title {
    font-size: 18px;
    font-weight: bold;
    color: var(--text-primary);
}

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

.project-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s;
    position: relative;
    user-select: none;
    overflow: hidden;
}

.project-item:hover {
    background-color: var(--bg-tertiary);
}

.project-item.active {
    background-color: var(--accent);
    color: white;
}

.project-item.active .project-name,
.project-item.active .project-count {
    color: white;
}

.project-item.favorite {
    font-weight: 600;
}

.project-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.project-name {
    flex: 1;
    font-size: 14px;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.project-count {
    font-size: 12px;
    color: var(--text-secondary);
    background-color: var(--bg-tertiary);
    padding: 2px 8px;
    border-radius: 12px;
    min-width: 24px;
    text-align: center;
}

.project-item.active .project-count {
    background-color: rgba(255, 255, 255, 0.2);
}

.project-favorite-icon {
    color: #F59E0B;
    font-size: 14px;
    flex-shrink: 0;
}

.project-actions {
    position: absolute;
    right: 12px;
    display: none;
    gap: 4px;
}

.project-item:hover .project-actions {
    display: flex;
}

.project-item:hover .project-favorite-icon,
.project-item:hover .project-count {
    display: none;
}

.project-action-btn {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    font-size: 14px;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.project-action-btn:hover {
    opacity: 1;
}

.project-divider {
    height: 1px;
    background-color: var(--border);
    margin: 12px 0;
}

.sidebar-footer {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.show-archived-btn {
    width: 100%;
    padding: 8px;
    background: none;
    border: 1px dashed var(--border);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.show-archived-btn:hover {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

.project-item.dragging {
    opacity: 0.5;
}

.project-item.drag-over {
    border-top: 2px solid var(--accent);
}

.project-item.drop-target {
    background-color: rgba(245, 158, 11, 0.14);
    color: var(--text-primary);
    transform: translateX(6px) scale(1.015);
    box-shadow: inset 0 0 0 2px var(--warning), 0 8px 20px var(--shadow);
    animation: projectDropTargetPulse 0.8s ease-in-out infinite alternate;
}

.project-item.drop-target::before {
    content: "";
    position: absolute;
    inset: 4px;
    border-radius: 6px;
    border: 1px dashed rgba(245, 158, 11, 0.75);
    pointer-events: none;
}

.project-item.drop-target::after {
    content: attr(data-drop-label);
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    padding: 3px 8px;
    border-radius: 999px;
    background-color: var(--warning);
    color: white;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
    box-shadow: 0 4px 10px rgba(245, 158, 11, 0.28);
}

.project-item.drop-target .project-name,
.project-item.drop-target .project-count {
    color: var(--text-primary);
}

.project-item.drop-target .project-name {
    padding-right: 104px;
}

.project-item.drop-target .project-count,
.project-item.drop-target .project-actions,
.project-item.drop-target .project-favorite-icon {
    display: none;
}

@keyframes projectDropTargetPulse {
    from {
        box-shadow: inset 0 0 0 2px var(--warning), 0 8px 20px var(--shadow);
    }

    to {
        box-shadow: inset 0 0 0 3px var(--warning), 0 10px 26px rgba(245, 158, 11, 0.24);
    }
}

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

/* Color Picker */
.color-picker {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 8px;
    margin-top: 8px;
}

.color-option {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: transform 0.2s;
}

.color-option:hover {
    transform: scale(1.1);
}

.color-option.selected {
    border-color: var(--text-primary);
    transform: scale(1.15);
}

@media (max-width: 1024px) {
    .app-layout {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        position: static;
    }
}

@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }
    
    .tool-nav {
        width: 100%;
        height: auto;
        min-height: 60px;
        flex-direction: row;
        padding: 10px 0;
        border-right: none;
        border-bottom: 1px solid var(--border);
        position: static;
        overflow-x: auto;
        overflow-y: hidden;
    }

    .tool-nav-spacer {
        flex: 1 0 16px;
    }
    
    .header-content {
        flex-direction: column;
        gap: 20px;
    }

    .nav {
        flex-wrap: wrap;
        justify-content: center;
    }

    .stats-bar {
        grid-template-columns: 1fr;
    }

    .task-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .task-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .sidebar {
        padding: 16px;
    }

    .project-item {
        font-size: 13px;
    }

    .color-picker {
        grid-template-columns: repeat(6, 1fr);
    }
}

/* Shopping Page Styles */
.shopping-page {
    width: 100%;
}

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

.shopping-header .page-title {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 4px;
}

.shopping-subtitle {
    color: var(--text-secondary);
    font-size: 15px;
}

.shopping-summary {
    display: flex;
    gap: 12px;
}

.shopping-summary-card {
    min-width: 110px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 16px;
    box-shadow: 0 2px 8px var(--shadow);
}

.shopping-summary-value {
    display: block;
    color: var(--accent);
    font-size: 28px;
    font-weight: 800;
    line-height: 1;
}

.shopping-summary-label {
    color: var(--text-secondary);
    font-size: 13px;
}

.shopping-section {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px var(--shadow);
}

.shopping-quick-form {
    display: grid;
    grid-template-columns: minmax(220px, 1.4fr) minmax(120px, 0.5fr) minmax(180px, 1fr) auto;
    gap: 12px;
    align-items: center;
    margin-bottom: 18px;
}

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

.shopping-filter-group {
    display: flex;
    gap: 6px;
    padding: 4px;
    background-color: var(--bg-tertiary);
    border-radius: 10px;
}

.shopping-filter {
    border: none;
    border-radius: 8px;
    padding: 8px 12px;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

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

.shopping-filter.active {
    background-color: var(--accent);
    color: white;
}

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

.shopping-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    background-color: var(--bg-primary);
    border: 2px solid var(--border);
    border-radius: 8px;
    padding: 14px 16px;
    transition: all 0.2s;
}

.shopping-item:hover {
    border-color: var(--accent);
    box-shadow: 0 4px 12px var(--shadow);
}

.shopping-item.purchased {
    opacity: 0.72;
}

.shopping-item.purchased .shopping-item-name {
    text-decoration: line-through;
    color: var(--text-secondary);
}

.shopping-check {
    position: relative;
    width: 34px;
    height: 34px;
    cursor: pointer;
}

.shopping-check input {
    opacity: 0;
    width: 0;
    height: 0;
}

.shopping-check span {
    position: absolute;
    inset: 0;
    border: 2px solid var(--border);
    border-radius: 50%;
    background-color: var(--bg-primary);
    transition: all 0.2s;
}

.shopping-check:hover span {
    border-color: var(--success);
    box-shadow: 0 2px 8px var(--shadow);
}

.shopping-check input:checked + span {
    background-color: var(--success);
    border-color: var(--success);
}

.shopping-check input:checked + span::after {
    content: "";
    position: absolute;
    left: 11px;
    top: 6px;
    width: 8px;
    height: 16px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.shopping-item-content {
    min-width: 0;
}

.shopping-item-main {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.shopping-item-name {
    font-size: 17px;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.shopping-item-quantity {
    flex-shrink: 0;
    padding: 3px 8px;
    border-radius: 999px;
    background-color: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 700;
}

.shopping-item-note {
    margin-top: 4px;
    color: var(--text-secondary);
    font-size: 14px;
    overflow-wrap: anywhere;
}

.shopping-item-actions {
    display: flex;
    gap: 4px;
}

/* Settings Page */
.settings-sidebar {
    width: 300px;
}

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

.settings-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 11px 12px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 14px;
    text-align: left;
    transition: all 0.2s;
}

.settings-nav-item:hover {
    background-color: var(--bg-tertiary);
}

.settings-nav-item.active {
    background-color: var(--accent);
    color: white;
}

.settings-content {
    min-width: 0;
}

.settings-panel {
    display: none;
}

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

.settings-description {
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 4px;
}

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

.settings-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background-color: var(--bg-primary);
    border: 2px solid var(--border);
    border-radius: 8px;
    transition: all 0.2s;
}

.settings-row:hover {
    border-color: var(--accent);
    box-shadow: 0 4px 12px var(--shadow);
}

.settings-row-title {
    font-size: 16px;
    font-weight: 700;
}

.settings-row-description {
    color: var(--text-secondary);
    font-size: 13px;
    margin-top: 2px;
}

.admin-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

.admin-table th,
.admin-table td {
    padding: 12px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: middle;
    font-size: 14px;
}

.admin-table th {
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.admin-user-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-user-cell small {
    display: block;
    color: var(--text-secondary);
    margin-top: 2px;
}

.admin-user-avatar,
.admin-favicon-preview {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background-color: var(--bg-tertiary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.admin-user-avatar img,
.admin-favicon-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.admin-favicon-row {
    align-items: flex-start;
}

.admin-sound-row {
    align-items: flex-start;
}

.admin-favicon-control {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 10px;
    width: min(520px, 100%);
}

.admin-sound-control {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    width: min(640px, 100%);
}

.admin-sound-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background-color: var(--bg-tertiary);
    color: var(--accent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 800;
    flex-shrink: 0;
}

.admin-sound-empty {
    min-height: 36px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-secondary);
    background-color: var(--bg-primary);
    display: inline-flex;
    align-items: center;
}

.admin-audio-preview {
    width: min(320px, 100%);
    height: 36px;
}

.admin-upload-btn {
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    flex-shrink: 0;
}

.admin-upload-btn input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

@media (max-width: 760px) {
    .admin-favicon-control,
    .admin-sound-control {
        width: 100%;
        gap: 8px;
        justify-content: flex-start;
    }

    .admin-favicon-control .btn,
    .admin-sound-control .btn {
        padding-inline: 10px;
        font-size: 13px;
    }

    .admin-audio-preview {
        flex-basis: 100%;
        max-width: 100%;
        order: 4;
    }
}

.settings-segmented {
    display: inline-flex;
    padding: 4px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background-color: var(--bg-secondary);
}

.settings-segment {
    min-height: 34px;
    padding: 7px 12px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--text-primary);
    font-weight: 700;
    cursor: pointer;
}

.settings-segment.active {
    background-color: var(--accent);
    color: white;
}

.settings-nav-avatar {
    width: 20px;
    height: 20px;
    display: block;
    border-radius: 50%;
    object-fit: cover;
}

.profile-avatar-row {
    align-items: flex-start;
}

.profile-inline-form {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    min-width: 0;
}

.profile-name-input {
    width: min(280px, 42vw);
}

.profile-action-link {
    text-decoration: none;
}

.avatar-settings-form {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.avatar-preview {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 10px;
    background-color: var(--bg-secondary);
    font-size: 24px;
    overflow: hidden;
    flex: 0 0 auto;
}

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

.avatar-file-input {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border: 2px dashed var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.avatar-file-input:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.avatar-file-input input {
    display: none;
}

.avatar-delete-form {
    margin-left: auto;
}

@media (max-width: 900px) {
    .shopping-quick-form {
        grid-template-columns: 1fr 1fr;
    }

    .shopping-note-input {
        grid-column: 1 / -1;
    }
}

@media (max-width: 768px) {
    .settings-sidebar {
        width: 100%;
    }

    .settings-row {
        align-items: stretch;
        flex-direction: column;
    }

    .avatar-settings-form,
    .avatar-delete-form,
    .profile-inline-form,
    .settings-segmented {
        width: 100%;
    }

    .profile-inline-form {
        align-items: stretch;
        flex-direction: column;
    }

    .profile-name-input {
        width: 100%;
    }

    .avatar-delete-form {
        margin-left: 0;
    }

    .avatar-delete-form .btn,
    .profile-inline-form .btn,
    .profile-action-link,
    .avatar-file-input {
        width: 100%;
    }

    .settings-segment {
        flex: 1;
    }
}

@media (max-width: 768px) {
    .shopping-header,
    .shopping-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .shopping-summary {
        width: 100%;
    }

    .shopping-summary-card {
        flex: 1;
    }

    .shopping-section {
        padding: 16px;
    }

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

    .shopping-item {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .shopping-item-actions {
        grid-column: 2;
        justify-content: flex-end;
    }
}

/* Habits Page Styles */
.habits-page {
    width: 100%;
    max-width: none;
    margin: 0;
}

.habits-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 16px;
}

.habits-header .page-title {
    font-size: 32px;
    font-weight: 800;
    color: var(--text-primary);
}

/* Calendar Styles */
.calendar-section {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    margin-top: 24px;
    box-shadow: 0 2px 8px var(--shadow);
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.calendar-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    text-align: center;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    max-width: 560px;
}

.calendar-day-header {
    text-align: center;
    font-weight: 600;
    font-size: 11px;
    color: var(--text-secondary);
    padding: 4px;
}

.calendar-day {
    width: 100%;
    max-width: 64px;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    border-radius: 8px;
    background-color: var(--bg-primary);
    border: 1px solid var(--border);
    position: relative;
    transition: all 0.2s;
}

.calendar-day:not(.empty):hover {
    border-color: var(--accent);
    box-shadow: 0 4px 12px var(--shadow);
}

.calendar-day.today {
    outline: 1px solid var(--accent);
    outline-offset: 1px;
}

.calendar-day.empty {
    background: transparent;
}

.calendar-progress {
    width: 42px;
    height: 42px;
}

.calendar-day-number {
    font-size: 11px;
    font-weight: 600;
    fill: var(--text-primary);
    text-anchor: middle;
    dominant-baseline: middle;
}

/* Habits Table Styles */
.habits-section {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px var(--shadow);
}

.habits-section .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.habits-section .section-header h2 {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 4px;
}

.week-range {
    color: var(--text-secondary);
    font-size: 14px;
    white-space: nowrap;
}

.habits-table-container {
    margin-top: 20px;
    overflow-x: auto;
}

.habits-table-header {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto 88px;
    gap: 16px;
    padding: 12px 16px;
    background-color: var(--bg-tertiary);
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.habit-days-col {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: flex-end;
}

.day-header {
    width: 32px;
    text-align: center;
}

.habit-actions-col {
    width: 88px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 4px;
}

.habit-row {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto 88px;
    gap: 16px;
    padding: 16px;
    background-color: var(--bg-primary);
    border: 2px solid var(--border);
    border-radius: 8px;
    margin-bottom: 8px;
    border-left: 5px solid var(--habit-color, var(--accent));
    transition: all 0.2s;
}

.habit-row:hover {
    border-color: var(--accent);
    box-shadow: 0 4px 12px var(--shadow);
}

.habit-name-col {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.habit-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    overflow-wrap: anywhere;
}

.habit-description {
    font-size: 14px;
    color: var(--text-secondary);
    overflow-wrap: anywhere;
}

.habit-checkbox {
    position: relative;
    display: inline-block;
    width: 32px;
    height: 32px;
    cursor: pointer;
}

.habit-checkbox input {
    opacity: 0;
    width: 0;
    height: 0;
}

.habit-checkbox .checkmark {
    position: absolute;
    top: 0;
    left: 0;
    height: 32px;
    width: 32px;
    background-color: var(--bg-primary);
    border: 2px solid var(--border);
    border-radius: 6px;
    transition: all 0.2s;
}

.habit-checkbox:hover .checkmark {
    border-color: var(--habit-color, var(--accent));
    box-shadow: 0 2px 8px var(--shadow);
}

.habit-checkbox input:checked ~ .checkmark {
    background-color: var(--habit-color, var(--accent));
    border-color: var(--habit-color, var(--accent));
}

.habit-checkbox .checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.habit-checkbox input:checked ~ .checkmark:after {
    display: block;
}

.habit-checkbox .checkmark:after {
    left: 10px;
    top: 6px;
    width: 8px;
    height: 14px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.habit-actions-col .btn-icon,
.shopping-item-actions .btn-icon {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 6px;
    transition: all 0.2s;
}

.habit-actions-col .btn-icon:hover,
.shopping-item-actions .btn-icon:hover {
    background-color: var(--bg-tertiary);
    transform: scale(1.1);
}

.form-control-color {
    width: 100%;
    height: 48px;
    border: 2px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    padding: 4px;
    background-color: var(--bg-primary);
}

.form-control-color:hover {
    border-color: var(--accent);
}

.habit-delete-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 24px;
}

.habit-delete-actions .btn {
    min-width: 110px;
    padding: 12px 32px;
    font-size: 16px;
}

.delete-confirm-option {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 18px;
}

.delete-confirm-option input {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.delete-confirm-option label {
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 14px;
    user-select: none;
}

.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-secondary);
}

.empty-state p {
    font-size: 16px;
    margin: 0;
}

@media (max-width: 768px) {
    .habits-header {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
    }
    
    .calendar-grid {
        gap: 4px;
    }

    .calendar-section,
    .habits-section {
        padding: 12px;
    }
    
    .calendar-day-number {
        font-size: 10px;
    }

    .calendar-progress {
        width: 34px;
        height: 34px;
    }

    .habits-section .section-header {
        align-items: flex-start;
        flex-direction: column;
    }
    
    .habit-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .habits-table-header {
        display: none;
    }
    
    .habit-days-col {
        justify-content: space-between;
    }
    
    .habit-actions-col {
        display: flex;
        justify-content: flex-end;
        width: 100%;
    }
}

/* Responsive hardening */
@media (max-width: 1200px) {
    .stats-bar {
        grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
        gap: 14px;
    }

    .stat-card {
        padding: 16px;
    }

    .section {
        padding: 22px;
    }
}

@media (max-width: 1024px) {
    .app-layout,
    .page-content {
        padding: 16px;
    }

    .sidebar {
        top: 16px;
    }

    .project-list,
    .settings-nav {
        max-height: 260px;
        overflow-y: auto;
    }

    .app-layout > .sidebar:not(.settings-sidebar) .project-list {
        max-height: none;
    }

    .badge-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }
}

@media (max-width: 768px) {
    html,
    body {
        height: 100%;
        overflow: hidden;
    }

    .app-container {
        height: 100dvh;
        min-height: 100dvh;
        background: linear-gradient(180deg, rgba(59, 130, 246, 0.04), var(--bg-primary) 180px);
    }

    .mobile-topbar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        flex-shrink: 0;
        padding: calc(env(safe-area-inset-top, 0px) + 28px) 18px 16px;
        background-color: rgba(243, 244, 246, 0.88);
        backdrop-filter: blur(18px);
        border-bottom: 1px solid rgba(209, 213, 219, 0.58);
        position: relative;
        z-index: 45;
    }

    [data-theme="dark"] .mobile-topbar {
        background-color: rgba(31, 41, 55, 0.88);
        border-bottom-color: rgba(75, 85, 99, 0.58);
    }

    .mobile-topbar-title {
        min-width: 0;
        flex: 1;
        text-align: center;
        font-size: 20px;
        font-weight: 800;
        color: var(--text-primary);
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

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

    .mobile-topbar-btn {
        width: 48px;
        height: 48px;
        border: none;
        border-radius: 18px;
        background-color: var(--bg-primary);
        color: var(--text-primary);
        box-shadow: 0 6px 20px var(--shadow);
        display: inline-flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 5px;
        cursor: pointer;
        flex-shrink: 0;
    }

    .mobile-topbar-btn span {
        width: 22px;
        height: 2px;
        border-radius: 999px;
        background-color: currentColor;
    }

    .mobile-topbar-btn.icon-only {
        font-size: 22px;
        gap: 0;
        font-weight: 800;
    }

    .tool-nav {
        position: fixed;
        left: 14px;
        right: 14px;
        bottom: 8px;
        bottom: calc(env(safe-area-inset-bottom, 0px) + 8px);
        width: auto;
        height: 64px;
        min-height: 64px;
        z-index: 50;
        border: 1px solid rgba(209, 213, 219, 0.72);
        border-radius: 28px;
        background-color: rgba(255, 255, 255, 0.9);
        box-shadow: 0 14px 34px rgba(0, 0, 0, 0.14);
        backdrop-filter: blur(18px);
        flex-shrink: 0;
        justify-content: flex-start;
        gap: 4px;
        padding: 8px;
        scrollbar-width: thin;
    }

    [data-theme="dark"] .tool-nav {
        background-color: rgba(31, 41, 55, 0.92);
        border-color: rgba(75, 85, 99, 0.72);
    }

    .tool-nav-item {
        flex: 1 0 46px;
        height: 46px;
        border-radius: 20px;
        font-size: 21px;
    }

    .tool-nav-avatar {
        display: none;
    }

    .tool-nav-spacer {
        display: none;
    }

    .tool-nav-item:hover {
        transform: none;
    }

    .tool-nav-item.active {
        box-shadow: 0 8px 18px rgba(59, 130, 246, 0.24);
    }

    .app-layout,
    .page-content {
        flex: 1;
        height: auto;
        min-height: 0;
        overflow-y: auto;
        padding: 14px 14px calc(84px + env(safe-area-inset-bottom, 0px));
    }

    .app-layout {
        gap: 14px;
    }

    .section,
    .shopping-section,
    .calendar-section,
    .habits-section {
        padding: 16px;
        border-radius: 22px;
        margin-bottom: 16px;
        box-shadow: 0 8px 24px rgba(17, 24, 39, 0.08);
    }

    .app-layout > .sidebar:not(.settings-sidebar) {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        z-index: 70;
        width: min(86vw, 360px);
        height: 100dvh;
        max-height: none;
        padding: calc(env(safe-area-inset-top, 0px) + 22px) 18px calc(env(safe-area-inset-bottom, 0px) + 22px);
        border-radius: 0 26px 26px 0;
        border-left: none;
        transform: translateX(-104%);
        transition: transform 0.24s ease;
        overflow-y: auto;
        box-shadow: 20px 0 50px rgba(0, 0, 0, 0.22);
        display: flex;
        flex-direction: column;
    }

    .mobile-drawer-profile {
        width: 100%;
        display: flex;
        align-items: center;
        gap: 14px;
        min-height: 58px;
        margin-bottom: 18px;
        color: var(--text-primary);
        text-decoration: none;
    }

    .mobile-drawer-avatar {
        width: 48px;
        height: 48px;
        display: grid;
        place-items: center;
        flex: 0 0 auto;
        border-radius: 50%;
        background-color: var(--bg-tertiary);
        box-shadow: 0 8px 22px var(--shadow);
        overflow: hidden;
        font-size: 23px;
        font-weight: 800;
    }

    .mobile-drawer-avatar img {
        width: 100%;
        height: 100%;
        display: block;
        object-fit: cover;
    }

    .mobile-drawer-username {
        min-width: 0;
        flex: 1;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 20px;
        font-weight: 800;
    }

    .app-layout > .sidebar:not(.settings-sidebar) .project-list {
        flex: 1;
        min-height: 0;
        overflow-y: auto;
        padding-bottom: 12px;
    }

    .app-layout > .sidebar:not(.settings-sidebar) .sidebar-footer {
        flex-shrink: 0;
    }

    .app-layout > .sidebar:not(.settings-sidebar) .sidebar-actions {
        display: none;
    }

    .app-layout > .sidebar:not(.settings-sidebar) .project-actions {
        position: static;
        display: flex;
        flex-shrink: 0;
        margin-left: auto;
    }

    .app-layout > .sidebar:not(.settings-sidebar) .project-item:hover .project-favorite-icon,
    .app-layout > .sidebar:not(.settings-sidebar) .project-item:hover .project-count {
        display: inline-flex;
    }

    .app-layout > .sidebar:not(.settings-sidebar) .project-action-btn {
        opacity: 0.72;
        font-size: 15px;
    }

    .mobile-project-menu-open .app-layout > .sidebar:not(.settings-sidebar) {
        transform: translateX(0);
    }

    .mobile-drawer-overlay {
        position: fixed;
        inset: 0;
        z-index: 65;
        background-color: rgba(17, 24, 39, 0.54);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.22s ease;
    }

    .mobile-project-menu-open .mobile-drawer-overlay {
        display: block;
        opacity: 1;
        pointer-events: auto;
    }

    .mobile-project-menu-open {
        overflow: hidden;
    }

    .mobile-fab-stack {
        position: fixed;
        right: 24px;
        bottom: 72px;
        bottom: calc(env(safe-area-inset-bottom, 0px) + 72px);
        z-index: 55;
        display: flex;
        flex-direction: column;
        gap: 12px;
        align-items: center;
    }

    .mobile-fab {
        width: 64px;
        height: 64px;
        border: none;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        line-height: 1;
        cursor: pointer;
    }

    .mobile-fab svg {
        width: 30px;
        height: 30px;
        display: block;
        fill: none;
        stroke: currentColor;
        stroke-width: 2.4;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

    .mobile-fab {
        background-color: var(--accent);
        color: white;
        box-shadow: 0 16px 34px rgba(59, 130, 246, 0.36);
    }

    .section-header,
    .shopping-header,
    .habits-header,
    .calendar-header {
        gap: 12px;
    }

    .section-header {
        flex-direction: column;
        align-items: stretch;
    }

    .section-header > div {
        flex-wrap: wrap;
    }

    .section-title,
    .habits-section .section-header h2 {
        font-size: 21px;
    }

    .stats-bar {
        grid-template-columns: repeat(4, minmax(86px, 1fr));
        gap: 8px;
        margin-bottom: 16px;
        overflow-x: auto;
        padding-bottom: 4px;
        scrollbar-width: thin;
    }

    .stat-card {
        min-width: 86px;
        padding: 10px 8px;
        min-width: 0;
        border-radius: 16px;
        box-shadow: none;
        text-align: center;
    }

    .stat-label {
        font-size: 10px;
        line-height: 1.2;
        margin-bottom: 4px;
    }

    .stat-value {
        font-size: 16px;
        line-height: 1.15;
        overflow-wrap: anywhere;
    }

    .stat-icon {
        font-size: 16px;
        margin-bottom: 4px;
    }

    .task-date-filters,
    .badge-filter-row,
    .shopping-filter-group {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 4px;
        scrollbar-width: thin;
    }

    .task-date-filter,
    .shopping-filter,
    .badge-filter-row .btn {
        flex: 0 0 auto;
        white-space: nowrap;
    }

    .task-item {
        display: grid;
        grid-template-columns: 40px minmax(0, 1fr) 34px;
        align-items: start;
        gap: 10px;
        padding: 12px;
        border-width: 1px;
        border-radius: 14px;
        cursor: pointer;
        box-shadow: none;
    }

    .task-timer-btn {
        width: 40px;
        height: 40px;
        border-width: 2px;
        font-size: 18px;
    }

    .task-actions {
        width: auto;
        justify-content: flex-end;
        align-self: start;
    }

    .task-actions .btn-icon {
        width: 34px;
        height: 34px;
        border-radius: 10px;
        background-color: transparent;
        color: var(--danger);
        font-size: 17px;
        box-shadow: none;
    }

    .task-actions .btn-icon:hover {
        background-color: rgba(239, 68, 68, 0.1);
        transform: none;
    }

    .task-title {
        display: -webkit-box;
        overflow: hidden;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        margin-bottom: 8px;
        line-height: 1.25;
    }

    .task-meta {
        gap: 6px;
        font-size: 12px;
        line-height: 1.2;
    }

    .task-category,
    .task-recurrence,
    .task-overdue,
    .task-date {
        padding: 3px 6px;
        border-radius: 6px;
        font-size: 11px;
    }

    .note-list,
    .badge-grid {
        grid-template-columns: 1fr;
    }

    .shopping-summary {
        gap: 8px;
    }

    .shopping-summary-card {
        min-width: 0;
        padding: 12px;
    }

    .shopping-summary-value {
        font-size: 24px;
    }

    .calendar-grid {
        max-width: none;
        width: 100%;
    }

    .calendar-day {
        max-width: none;
    }

    .modal {
        align-items: stretch;
        padding: 10px;
        overflow-x: hidden;
    }

    .modal-content {
        width: 100%;
        max-width: none;
        max-height: calc(100dvh - 20px);
        padding: 18px;
        border-radius: 10px;
        overflow-x: hidden;
    }

    .confirm-modal .compact-confirm-content {
        width: auto !important;
        min-width: min(320px, calc(100vw - 32px));
        max-width: min(400px, calc(100vw - 32px)) !important;
    }

    .modal-content.task-modal-content,
    .modal-content.note-modal-content {
        width: 100%;
        height: calc(100dvh - 20px);
        max-height: calc(100dvh - 20px);
    }

    .modal-content.task-modal-content {
        padding: 16px;
    }

    .task-modal-content .modal-header {
        font-size: 24px;
        line-height: 1.15;
        margin-bottom: 14px;
    }

    .task-modal-scroll {
        padding: 3px 6px 3px 3px;
    }

    .task-modal-content .form-group {
        margin-bottom: 14px;
    }

    .task-modal-content .form-label {
        margin-bottom: 6px;
        font-size: 14px;
        font-weight: 700;
    }

    .task-modal-content .form-input,
    .task-modal-content .form-textarea,
    .task-modal-content .form-select {
        min-height: 44px;
        padding: 10px 12px;
        border-width: 1px;
        border-radius: 8px;
        font-size: 15px;
    }

    .task-modal-content #editTaskDescription {
        min-height: 78px;
    }

    .task-modal-content .recurring-edit-panel {
        padding: 12px;
        margin-bottom: 12px;
        border-radius: 10px;
    }

    .task-modal-content .recurring-edit-header {
        align-items: flex-start;
        gap: 10px;
        margin-bottom: 0;
    }

    .task-modal-content .recurring-edit-header p {
        display: none;
    }

    .task-modal-content .recurring-toggle {
        gap: 7px;
        white-space: normal;
        font-size: 14px;
        line-height: 1.2;
    }

    .task-modal-content .recurrence-options {
        padding: 10px;
        margin-top: 12px;
        margin-bottom: 12px;
        border-radius: 10px;
    }

    .task-modal-content .form-actions {
        gap: 10px;
        padding-top: 12px;
        margin-top: 10px;
        padding-bottom: max(0px, env(safe-area-inset-bottom));
        flex-wrap: nowrap;
    }

    .form-actions,
    .modal-footer {
        flex-wrap: wrap;
    }

    .form-actions .btn,
    .modal-footer .btn {
        min-width: 120px;
    }

    .notification-container {
        left: 12px;
        right: 12px;
        top: 12px;
    }

    .notification {
        max-width: none;
    }

    .chart-container {
        height: 240px;
        margin: 12px 0;
    }

    .leaderboard-item {
        gap: 10px;
        padding: 14px;
    }

    .leaderboard-rank {
        min-width: 34px;
        font-size: 20px;
    }

    .leaderboard-avatar {
        font-size: 26px;
    }

    .leaderboard-name {
        font-size: 16px;
    }

    .leaderboard-time {
        font-size: 17px;
        white-space: nowrap;
    }
}

@media (max-width: 520px) {
    .app-layout,
    .page-content {
        padding: 10px;
    }

    .stats-bar {
        grid-template-columns: repeat(4, minmax(78px, 1fr));
        gap: 6px;
    }

    .stat-card {
        min-width: 78px;
        padding: 9px 6px;
    }

    .section,
    .shopping-section,
    .calendar-section,
    .habits-section {
        padding: 12px;
    }

    .btn {
        padding: 9px 12px;
        font-size: 14px;
    }

    .task-item {
        grid-template-columns: 38px minmax(0, 1fr) 32px;
    }

    .task-actions {
        grid-column: auto;
        justify-content: flex-end;
    }

    .task-timer-btn {
        width: 38px;
        height: 38px;
        font-size: 17px;
    }

    .task-actions .btn-icon {
        width: 32px;
        height: 32px;
    }

    .task-title,
    .habit-name {
        font-size: 16px;
    }

    .shopping-item-main {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }

    .settings-row {
        padding: 12px;
    }

    .leaderboard-item {
        grid-template-columns: auto auto minmax(0, 1fr);
        display: grid;
    }

    .leaderboard-time {
        grid-column: 3;
        justify-self: start;
    }

    .calendar-header {
        flex-wrap: wrap;
    }

    .calendar-header h2 {
        order: -1;
        width: 100%;
    }

    .calendar-progress {
        width: 30px;
        height: 30px;
    }

    .habit-days-col {
        gap: 6px;
    }

    .habit-checkbox,
    .habit-checkbox .checkmark {
        width: 30px;
        height: 30px;
    }

    .modal-content {
        padding: 14px;
    }

    .modal-content.task-modal-content {
        padding: 14px;
    }

    .task-modal-content .modal-header {
        font-size: 22px;
    }

    .task-modal-content .form-group {
        margin-bottom: 12px;
    }

    .task-modal-content .form-input,
    .task-modal-content .form-textarea,
    .task-modal-content .form-select {
        min-height: 42px;
        padding: 9px 11px;
    }

    .task-modal-content #editTaskDescription {
        min-height: 68px;
    }

    .task-modal-content .recurring-edit-header {
        flex-direction: column;
    }

    .task-modal-content .form-actions .btn {
        flex: 1;
        min-width: 0;
    }
}

@media (max-width: 1200px) {
    .tool-nav {
        position: fixed !important;
        left: 14px !important;
        right: 14px !important;
        top: auto !important;
        bottom: 8px !important;
        bottom: calc(env(safe-area-inset-bottom, 0px) + 8px) !important;
        width: auto !important;
        height: 64px !important;
        min-height: 64px !important;
        z-index: 50 !important;
        border: 1px solid rgba(209, 213, 219, 0.72) !important;
        border-radius: 28px !important;
        background-color: rgba(255, 255, 255, 0.9) !important;
        box-shadow: 0 14px 34px rgba(0, 0, 0, 0.14) !important;
        backdrop-filter: blur(18px);
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: flex-start !important;
        gap: 4px !important;
        padding: 8px !important;
        overflow: hidden !important;
    }

    [data-theme="dark"] .tool-nav {
        background-color: rgba(31, 41, 55, 0.92) !important;
        border-color: rgba(75, 85, 99, 0.72) !important;
    }

    .tool-nav-spacer {
        display: none !important;
    }

    .tool-nav-item {
        flex: 1 0 46px !important;
        width: auto !important;
        height: 46px !important;
        border-radius: 20px !important;
    }

    .tool-nav-avatar {
        order: 0 !important;
        margin-top: 0 !important;
        margin-bottom: 0 !important;
    }

    .app-layout,
    .page-content {
        padding-bottom: calc(92px + env(safe-area-inset-bottom, 0px)) !important;
    }
}
