:root {
    --bg: #f7f3ee;
    --bg-accent: radial-gradient(circle at top left, rgba(233, 198, 167, 0.35), transparent 28%);
    --panel: #ffffff;
    --panel-soft: #f2ece5;
    --panel-muted: #fcfaf7;
    --line: #ddd3c8;
    --ink: #2c241d;
    --muted: #726457;
    --accent: #8c5b2c;
    --accent-strong: #6f451f;
    --accent-soft: #efe1d0;
    --success: #2f7d4b;
    --shadow: 0 10px 26px rgba(73, 51, 34, 0.08);
    --radius: 16px;
    --radius-lg: 20px;
    --level-2: #f3e4d2;
    --level-3: #dff0ff;
    --level-3-active: #88c1f2;
    --theme-button: #efe4d7;
    --toolbar-bg: rgba(255, 255, 255, 0.8);
    --rainbow-gradient: linear-gradient(90deg, #ff5f6d 0%, #ffb347 16%, #ffe066 32%, #7ddf64 48%, #49c6e5 64%, #5b7cfa 82%, #c77dff 100%);
    --chart-red: #ff6b6b;
    --chart-yellow: #f6c453;
    --chart-green: #38b37b;
    --chart-blue: #4f8df6;
}

body[data-theme="dark"] {
    --bg: #14181d;
    --bg-accent: radial-gradient(circle at top left, rgba(66, 93, 132, 0.35), transparent 30%);
    --panel: #1b222a;
    --panel-soft: #202933;
    --panel-muted: #222d38;
    --line: #32404d;
    --ink: #e7edf3;
    --muted: #a9b8c6;
    --accent: #f3b46b;
    --accent-strong: #ffd29c;
    --accent-soft: rgba(243, 180, 107, 0.12);
    --success: #79d89a;
    --shadow: 0 16px 30px rgba(0, 0, 0, 0.28);
    --level-2: rgba(243, 180, 107, 0.12);
    --level-3: rgba(107, 176, 243, 0.18);
    --level-3-active: #4e84b9;
    --theme-button: #2a3541;
    --toolbar-bg: rgba(27, 34, 42, 0.82);
}

body[data-theme="colorful"] {
    --bg: #fff8fb;
    --bg-accent:
        radial-gradient(circle at 8% 12%, rgba(255, 95, 109, 0.22), transparent 22%),
        radial-gradient(circle at 30% 0%, rgba(255, 179, 71, 0.24), transparent 24%),
        radial-gradient(circle at 58% 18%, rgba(255, 224, 102, 0.26), transparent 26%),
        radial-gradient(circle at 82% 20%, rgba(125, 223, 100, 0.2), transparent 20%),
        radial-gradient(circle at 76% 70%, rgba(73, 198, 229, 0.22), transparent 24%),
        radial-gradient(circle at 42% 88%, rgba(91, 124, 250, 0.2), transparent 24%),
        radial-gradient(circle at 12% 80%, rgba(199, 125, 255, 0.22), transparent 22%),
        linear-gradient(135deg, #fff9fc 0%, #fffaf0 28%, #f8fffc 54%, #f9f6ff 100%);
    --panel: rgba(255, 255, 255, 0.86);
    --panel-soft: rgba(255, 245, 236, 0.88);
    --panel-muted: rgba(255, 255, 255, 0.82);
    --line: rgba(214, 162, 121, 0.34);
    --ink: #3e2b37;
    --muted: #84667a;
    --accent: #ff5f6d;
    --accent-strong: #7c4dff;
    --accent-soft: rgba(255, 95, 109, 0.14);
    --success: #1e9d6f;
    --shadow: 0 18px 42px rgba(158, 105, 186, 0.18);
    --level-2: linear-gradient(135deg, rgba(255, 179, 71, 0.18), rgba(255, 240, 223, 0.92));
    --level-3: linear-gradient(135deg, rgba(73, 198, 229, 0.18), rgba(226, 241, 255, 0.95));
    --level-3-active: #7fb8ff;
    --theme-button: rgba(255, 255, 255, 0.74);
    --toolbar-bg: rgba(255, 255, 255, 0.76);
    --rainbow-gradient: linear-gradient(90deg, #ff5f6d 0%, #ff9a44 14%, #ffd93d 28%, #7ddf64 42%, #2ec4b6 58%, #5b7cfa 78%, #c77dff 100%);
    --chart-red: #ff5f6d;
    --chart-yellow: #ffd93d;
    --chart-green: #7ddf64;
    --chart-blue: #5b7cfa;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    font-family: "Noto Sans SC", sans-serif;
    color: var(--ink);
    background: var(--bg-accent), var(--bg);
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

.app-shell {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar-backdrop,
.mobile-header {
    display: none;
}

.sidebar {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    gap: 18px;
    height: 100vh;
    padding: 20px 16px;
    background: var(--panel-soft);
    border-right: 1px solid var(--line);
}

.sidebar-title h1 {
    margin: 0;
    font-size: 22px;
}

.sidebar-title p {
    margin: 8px 0 0;
    font-size: 14px;
    line-height: 1.5;
    color: var(--muted);
}

.tree-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 4px;
}

.nav-group + .nav-group {
    margin-top: 18px;
}

.nav-label {
    margin-bottom: 8px;
    padding: 0 8px;
    font-size: 13px;
    font-weight: 700;
    color: var(--muted);
}

.nav-entry + .nav-entry {
    margin-top: 6px;
}

.nav-item-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-item,
.nav-toggle,
.menu-toggle,
.primary-button,
.secondary-button,
.day-button,
.calendar-arrow,
.theme-button {
    border: 0;
    border-radius: 12px;
}

.nav-item {
    flex: 1;
    width: 100%;
    padding: 10px 12px;
    text-align: left;
    color: var(--ink);
    background: transparent;
    transition: background 160ms ease, transform 160ms ease;
}

.nav-item.depth-2 {
    background: var(--level-2);
}

.nav-item.depth-3 {
    background: var(--level-3);
}

.nav-item:hover,
.nav-toggle:hover,
.menu-toggle:hover,
.primary-button:hover,
.secondary-button:hover,
.day-button:hover,
.calendar-arrow:hover,
.theme-button:hover {
    transform: translateY(-1px);
}

.nav-item.active {
    color: var(--accent-strong);
    font-weight: 700;
    box-shadow: var(--shadow);
}

.nav-item.depth-2.active {
    background: linear-gradient(135deg, var(--accent-soft), var(--panel));
}

.nav-item.depth-3.active {
    background: linear-gradient(135deg, var(--level-3-active), var(--panel));
}

.nav-item-title {
    white-space: normal;
    word-break: break-word;
    line-height: 1.4;
}

.nav-toggle {
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    color: var(--muted);
    background: var(--theme-button);
}

.nav-children {
    margin: 6px 0 0 12px;
    padding-left: 10px;
    border-left: 1px solid var(--line);
}

.nav-children.depth-3 {
    border-left-style: dashed;
}

.main-layout {
    padding: 24px;
}

.view-panel {
    min-height: calc(100vh - 48px);
    padding: 24px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.view-header {
    margin-bottom: 20px;
}

.view-toolbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 12px;
}

.header-tools {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
    width: 100%;
}

.theme-switcher,
.mobile-theme-switcher {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.theme-button {
    padding: 8px 12px;
    color: var(--ink);
    background: var(--theme-button);
}

.theme-button.is-active {
    color: #fff;
    background: var(--accent);
}

body[data-theme="colorful"] .theme-button.is-active {
    color: #2b1833;
    background: var(--rainbow-gradient);
}

.storage-status {
    display: flex;
    align-items: center;
}

.storage-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--toolbar-bg);
    color: var(--muted);
    backdrop-filter: blur(8px);
}

.storage-pill strong {
    color: var(--ink);
}

.storage-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #c89b73;
}

.storage-pill.cloud .storage-dot {
    background: var(--success);
}

.storage-pill.syncing .storage-dot {
    background: var(--accent);
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 14px;
    color: var(--muted);
}

.breadcrumb span:not(:last-child)::after {
    content: "/";
    margin-left: 8px;
}

.view-header h2 {
    margin: 0;
    font-size: 28px;
}

.page-summary,
.content-status,
.empty-state,
.record-hint,
.helper-text,
.muted {
    color: var(--muted);
}

.page-summary,
.content-status {
    margin: 10px 0 0;
    line-height: 1.7;
}

.view-body {
    min-height: 320px;
}

.markdown-body {
    line-height: 1.8;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3 {
    margin: 1.5em 0 0.6em;
    color: var(--accent-strong);
}

.markdown-body h1:first-child,
.markdown-body h2:first-child,
.markdown-body h3:first-child {
    margin-top: 0;
}

.markdown-body p,
.markdown-body ul,
.markdown-body ol,
.markdown-body blockquote {
    margin: 0 0 1em;
}

.markdown-body hr {
    margin: 1.8em 0;
    border: 0;
    border-top: 1px solid var(--line);
}

.markdown-body ul,
.markdown-body ol {
    padding-left: 1.4em;
}

.markdown-body blockquote {
    margin-left: 0;
    padding: 12px 14px;
    background: var(--accent-soft);
    border-left: 4px solid var(--accent);
    border-radius: 0 12px 12px 0;
}

.markdown-body code {
    padding: 2px 6px;
    border-radius: 6px;
    background: var(--panel-soft);
    font-family: Consolas, monospace;
}

.markdown-body pre {
    overflow: auto;
    padding: 14px;
    border-radius: 12px;
    background: #2f2924;
    color: #fff9f3;
}

.record-panel,
.calendar-panel,
.weekly-summary-panel {
    display: grid;
    gap: 18px;
}

.context-card,
.empty-state,
.record-item,
.summary-card,
.summary-section,
.week-day-card {
    padding: 16px;
    background: var(--panel-muted);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.poem-card {
    margin: 0 0 18px;
    padding: 22px;
    background:
        linear-gradient(180deg, rgba(255, 253, 247, 0.92), rgba(255, 249, 239, 0.86)),
        var(--panel-muted);
    border: 1px solid var(--line);
    border-radius: 26px;
    box-shadow: var(--shadow);
}

.poem-card-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 14px;
}

.poem-card-head h3 {
    margin: 0;
    color: var(--accent-strong);
    font-size: clamp(24px, 3vw, 30px);
    letter-spacing: 0.04em;
}

.poem-meta {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    letter-spacing: 0.04em;
}

.poem-card-body {
    display: grid;
    gap: 16px;
    grid-template-columns: minmax(240px, 0.9fr) minmax(0, 1.1fr);
}

.poem-block {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.82);
}

.poem-label {
    display: inline-flex;
    margin-bottom: 10px;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent-strong);
    font-size: 12px;
    letter-spacing: 0.08em;
}

.poem-lines {
    font-family: "ZCOOL XiaoWei", serif;
    font-size: clamp(22px, 2.8vw, 28px);
    line-height: 1.9;
    color: var(--ink);
    text-align: center;
    text-wrap: balance;
}

.poem-copy p:last-child {
    margin-bottom: 0;
}

.poem-empty,
.poem-audio-empty {
    color: var(--muted);
}

.poem-card-footer {
    display: grid;
    gap: 14px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.poem-footer-label {
    display: inline-flex;
    margin-bottom: 8px;
    color: var(--accent-strong);
    font-size: 12px;
    letter-spacing: 0.08em;
}

.poem-audio {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.poem-audio-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.poem-audio-player audio {
    display: none;
}

.poem-audio-link,
.poem-audio-play {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 999px;
    color: #fff;
    background: var(--accent);
    text-decoration: none;
    border: none;
    cursor: pointer;
    font: inherit;
}

.poem-audio-link:hover,
.poem-audio-play:hover {
    filter: brightness(1.05);
}

.poem-questions ol {
    margin: 0;
    padding-left: 1.2em;
}

.poem-questions li + li {
    margin-top: 6px;
}

.poem-question-item {
    line-height: 1.7;
}

.poem-answer {
    margin-top: 6px;
}

.poem-answer-note {
    margin-top: 4px;
    color: var(--muted);
    font-size: 13px;
}

.study-card .poem-card-head h3 {
    font-size: clamp(22px, 2.4vw, 28px);
}

.study-card-body p:last-child,
.study-card-body ul:last-child {
    margin-bottom: 0;
}

.study-card-actions {
    margin-top: 14px;
}

.study-card-link {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 999px;
    color: #fff;
    background: var(--accent);
    text-decoration: none;
}

.study-card-link:hover {
    filter: brightness(1.05);
}

body[data-theme="colorful"] .poem-card {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 250, 242, 0.88)),
        linear-gradient(135deg, rgba(255, 95, 109, 0.08), rgba(255, 179, 71, 0.08), rgba(125, 223, 100, 0.08), rgba(91, 124, 250, 0.08));
}

body[data-theme="dark"] .poem-card {
    background:
        linear-gradient(180deg, rgba(27, 34, 42, 0.98), rgba(20, 26, 33, 0.96)),
        var(--panel-muted);
    border-color: #415162;
}

body[data-theme="dark"] .poem-block {
    background: #18212a;
    border-color: #3b4a5a;
}

body[data-theme="dark"] .poem-card-footer {
    border-top-color: #3b4a5a;
}

body[data-theme="dark"] .poem-lines,
body[data-theme="dark"] .poem-copy,
body[data-theme="dark"] .poem-question-item,
body[data-theme="dark"] .poem-answer {
    color: #eef4fa;
}

body[data-theme="dark"] .poem-meta,
body[data-theme="dark"] .poem-answer-note,
body[data-theme="dark"] .poem-audio-empty {
    color: #c3cfdb;
}

body[data-theme="dark"] .poem-label,
body[data-theme="dark"] .poem-footer-label {
    background: rgba(243, 180, 107, 0.16);
    color: #ffd8ac;
}

.context-card h3,
.calendar-title,
.record-panel h3,
.summary-topbar h3,
.summary-section h4 {
    margin: 0 0 8px;
}

.record-form {
    display: grid;
    gap: 14px;
}

.form-grid,
.summary-card-grid,
.summary-two-column {
    display: grid;
    gap: 14px;
}

.form-grid,
.summary-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.summary-card-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.summary-two-column {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.summary-card span,
.summary-status-item span,
.summary-list-item span,
.week-day-meta span,
.week-day-top span {
    color: var(--muted);
}

.summary-card strong {
    display: block;
    margin-top: 8px;
    font-size: 24px;
}

.summary-hero-card {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(220px, 0.8fr);
    gap: 18px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.42)),
        var(--bg-accent);
    box-shadow: var(--shadow);
}

.summary-kicker {
    margin: 0 0 8px;
    font-size: 12px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent-strong);
}

.summary-hero-main h3 {
    margin: 0 0 10px;
    font-size: clamp(24px, 3vw, 34px);
    line-height: 1.15;
}

.summary-highlight-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 18px;
}

.summary-highlight-pill {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.6);
}

.summary-highlight-pill span {
    display: block;
    color: var(--muted);
    font-size: 13px;
}

.summary-highlight-pill strong {
    display: block;
    margin-top: 8px;
    color: var(--accent-strong);
}

.summary-hero-side {
    display: flex;
    align-items: center;
    justify-content: center;
}

.summary-ring-card {
    display: grid;
    place-items: center;
    width: 100%;
    min-height: 100%;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.66);
}

.summary-ring {
    position: relative;
    display: grid;
    place-items: center;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: conic-gradient(var(--chart-green) 0% 25%, var(--chart-blue) 25% 60%, var(--chart-yellow) 60% 80%, var(--chart-red) 80% 100%);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.summary-ring::before {
    content: "";
    position: absolute;
    inset: 18px;
    border-radius: 50%;
    background: var(--panel);
}

.summary-ring-core {
    position: relative;
    z-index: 1;
    display: grid;
    place-items: center;
    text-align: center;
}

.summary-ring-core strong {
    font-size: 34px;
    line-height: 1;
}

.summary-ring-core span {
    margin-top: 6px;
    color: var(--muted);
    font-size: 13px;
}

.record-form label {
    display: grid;
    gap: 8px;
}

.record-form textarea,
.record-form input,
.record-form select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--panel);
    color: var(--ink);
}

.primary-button,
.secondary-button,
.calendar-arrow {
    padding: 10px 14px;
}

.primary-button {
    color: #fff;
    background: var(--accent);
}

.secondary-button,
.calendar-arrow,
.menu-toggle {
    color: var(--ink);
    background: var(--theme-button);
}

.record-hint {
    min-height: 22px;
}

.calendar-topbar,
.summary-topbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.calendar-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.calendar-weekdays,
.calendar-grid,
.week-activity-grid,
.summary-status-grid {
    display: grid;
    gap: 8px;
}

.calendar-weekdays,
.calendar-grid {
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

.calendar-weekdays {
    font-size: 13px;
    color: var(--muted);
}

.day-button,
.day-placeholder {
    aspect-ratio: 1;
}

.day-button {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--panel);
}

.day-button.has-record::after {
    content: "";
    position: absolute;
    bottom: 8px;
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: var(--accent);
}

.day-button.selected {
    color: #fff;
    background: var(--accent);
}

.day-button.today {
    outline: 2px solid var(--accent-strong);
}

.day-records,
.summary-list {
    display: grid;
    gap: 12px;
}

.record-meta,
.summary-list-item,
.summary-status-item,
.week-day-top,
.week-day-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    color: var(--success);
    background: rgba(47, 125, 75, 0.12);
}

.week-activity-grid {
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

.week-day-card.has-record {
    border-color: var(--accent);
}

.heatmap-track {
    position: relative;
    background: linear-gradient(90deg, rgba(255, 95, 109, 0.12), rgba(255, 179, 71, 0.12), rgba(125, 223, 100, 0.12), rgba(91, 124, 250, 0.12));
}

.week-bar-track {
    height: 10px;
    margin: 10px 0;
    border-radius: 999px;
    background: var(--panel-soft);
    overflow: hidden;
}

.week-bar-fill {
    height: 100%;
    border-radius: 999px;
    background: var(--rainbow-gradient);
}

.summary-status-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.status-stack {
    display: flex;
    gap: 6px;
    height: 16px;
    margin-bottom: 14px;
}

.status-stack-segment {
    display: block;
    min-width: 0;
    border-radius: 999px;
}

.summary-status-name {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.status-swatch {
    display: inline-flex;
    width: 10px;
    height: 10px;
    border-radius: 999px;
}

.chart-list-item {
    display: grid;
    gap: 10px;
}

.chart-list-copy {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.chart-list-bar {
    height: 10px;
    border-radius: 999px;
    background: var(--panel-soft);
    overflow: hidden;
}

.chart-list-fill {
    height: 100%;
    border-radius: 999px;
    background: var(--rainbow-gradient);
}

body[data-theme="colorful"] .summary-hero-card {
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.4)),
        linear-gradient(125deg, rgba(255, 95, 109, 0.18), rgba(255, 179, 71, 0.18), rgba(255, 224, 102, 0.18), rgba(125, 223, 100, 0.18), rgba(73, 198, 229, 0.18), rgba(91, 124, 250, 0.18), rgba(199, 125, 255, 0.18));
}

body[data-theme="colorful"] .summary-highlight-pill,
body[data-theme="colorful"] .summary-ring-card,
body[data-theme="colorful"] .summary-card,
body[data-theme="colorful"] .summary-section,
body[data-theme="colorful"] .week-day-card {
    backdrop-filter: blur(12px);
}

.is-hidden {
    display: none !important;
}

@media (max-width: 980px) {
    .summary-hero-card {
        grid-template-columns: 1fr;
    }

    .summary-highlight-row {
        grid-template-columns: 1fr;
    }

    .summary-card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .summary-two-column {
        grid-template-columns: 1fr;
    }

    .poem-card-body {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 860px) {
    .app-shell {
        display: block;
    }

    .mobile-header {
        position: sticky;
        top: 0;
        z-index: 30;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 12px 16px;
        background: var(--toolbar-bg);
        border-bottom: 1px solid var(--line);
        backdrop-filter: blur(10px);
    }

    .sidebar-backdrop {
        position: fixed;
        inset: 0;
        z-index: 20;
        background: rgba(0, 0, 0, 0.25);
    }

    .sidebar-backdrop.is-open {
        display: block;
    }

    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        z-index: 40;
        width: min(84vw, 320px);
        transform: translateX(-100%);
        transition: transform 180ms ease;
    }

    .sidebar.is-open {
        transform: translateX(0);
    }

    .main-layout {
        padding: 16px;
    }

    .view-panel {
        min-height: auto;
        padding: 18px;
    }

    .view-toolbar {
        display: none;
    }
}

@media (max-width: 720px) {
    .form-grid,
    .summary-card-grid,
    .summary-status-grid,
    .week-activity-grid {
        grid-template-columns: 1fr;
    }

    .view-header h2 {
        font-size: 24px;
    }
}
