:root {
    color-scheme: light;
    --ink: #24362d;
    --subtle: #54655b;
    --canvas: #f6f5f0;
    --white: #fffefb;
    --line: #e0e4da;
    --forest: #263b33;
    --lime: #dce8bc;
    --moss: #3d593b;
    font: 16px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif;
    color: var(--ink);
    background: var(--canvas);
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 280px; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button { color: inherit; cursor: pointer; }
button:disabled { opacity: .55; cursor: wait; }
:focus-visible { outline: 2px solid #527b4d; outline-offset: 4px; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3, .task-detail, .notice { overflow-wrap: anywhere; }
h1, h2 { font-family: Georgia, serif; font-weight: 500; letter-spacing: -.04em; line-height: 1.08; }
h1 { font-size: clamp(2.45rem, 5.4vw, 4.55rem); }
h2 { font-size: clamp(1.8rem, 3vw, 2.55rem); }
h3 { font-size: 1rem; }
.eyebrow { color: var(--moss); font-size: .69rem; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; }
.muted, .hint { color: var(--subtle); }
.hint { font-size: .8rem; margin: .3rem 0 0; }
.skip-link { position: fixed; z-index: 2; top: .75rem; left: .75rem; background: var(--white); padding: .65rem; transform: translateY(-160%); }
.skip-link:focus { transform: none; }
.app { display: grid; grid-template-columns: 15.5rem minmax(0, 1fr); min-height: 100dvh; }
.sidebar { background: var(--forest); color: #f5f5e9; display: flex; flex-direction: column; align-self: start; gap: 2.65rem; padding: 1.75rem 1.15rem; position: sticky; top: 0; min-height: 100dvh; }
.sidebar :focus-visible { outline-color: var(--lime); }
.brand, .identity { display: flex; gap: .7rem; align-items: center; }
.brand img, .login-card img { border-radius: 24%; flex: none; }
.brand strong, .identity strong { display: block; font-size: .98rem; }
.brand small, .identity small, .nav-label { font-size: .61rem; letter-spacing: .13em; color: #c2cec1; font-weight: 720; }
.navigation { display: grid; gap: .3rem; }
.nav-label { padding: 0 .75rem .45rem; }
.navigation a, .logout, .install { display: flex; align-items: center; gap: .7rem; padding: .68rem .75rem; min-height: 44px; font-weight: 650; border-radius: .65rem; color: #eef0e7; }
.navigation a span { inline-size: 1rem; text-align: center; }
.navigation a[aria-current] { color: var(--forest); background: var(--lime); }
.navigation a:not([aria-current]):hover, .logout:hover, .install:hover { background: #3b5147; }
.account { display: grid; gap: .65rem; margin-top: auto; }
.identity { border-top: 1px solid #52655c; padding-top: .9rem; }
.avatar { display: grid; place-items: center; width: 37px; height: 37px; border-radius: 50%; background: #d9cda8; color: var(--ink); font-weight: 800; }
.logout, .install { text-align: left; border: 0; background: transparent; font-size: .85rem; }
.app main { min-width: 0; width: min(100%, 79rem); margin-inline: auto; padding: 0 clamp(1rem, 4.1vw, 4rem); }
.topbar { min-height: 4.5rem; display: flex; gap: .6rem; align-items: center; justify-content: space-between; }
.breadcrumb { font-size: .82rem; color: var(--subtle); }
.breadcrumb span { margin: 0 .2rem; }
.sync { display: inline-flex; white-space: nowrap; align-items: center; gap: .45rem; color: var(--ink); background: var(--white); border: 1px solid var(--line); border-radius: 10rem; padding: .45rem .75rem; font-size: .8rem; font-weight: 650; }
.dot { width: .55rem; height: .55rem; border-radius: 50%; background: #47764b; }
.sync[data-status=pending] .dot { background: #986521; }
.sync[data-status=error] .dot { background: #a54038; }
.hero { position: relative; overflow: hidden; isolation: isolate; border: 1px solid #dfe6d8; border-radius: 1.4rem; padding: clamp(1.45rem, 4.1vw, 3.2rem); background: #e7eddf; display: grid; gap: .85rem; justify-items: start; }
.hero::before, .hero::after { content: ''; position: absolute; z-index: -1; pointer-events: none; border-radius: 50%; }
.hero::before { inline-size: 27rem; block-size: 27rem; inset: -9rem -7rem auto auto; background: repeating-radial-gradient(circle at center, transparent 0 20px, #72896c35 21px 22px, transparent 23px 34px); mask-image: linear-gradient(105deg, transparent 6%, #000 75%); }
.hero::after { inline-size: 9rem; block-size: 9rem; inset: auto 7% -4.25rem auto; background: #d9e5cc; }
.hero-planning { background: #ece9f0; border-color: #e5dfeb; }
.hero-planning::after { background: #e0d8e8; }
.hero-expenses { background: #f3edde; border-color: #ebe2ce; }
.hero-expenses::after { background: #e9dfc3; }
.hero > p:not(.eyebrow) { color: #475b4e; max-width: 36ch; }
.hero .button { margin-top: .4rem; }
.button, .chip { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; min-height: 42px; background: var(--white); border: 1px solid #cbd3c7; border-radius: .65rem; padding: .55rem .9rem; font-size: .88rem; font-weight: 680; }
.button:hover, .chip:hover { background: #edf0e7; }
.button.primary { border-color: var(--forest); color: #fff; background: var(--forest); }
.button.primary:hover { background: #395346; }
.stats { display: grid; gap: .85rem; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 1.05rem; }
.stat, .panel { background: var(--white); border: 1px solid var(--line); border-radius: 1rem; }
.stat { min-width: 0; display: flex; align-items: center; gap: .75rem; padding: .9rem; }
.stat-icon { display: grid; place-items: center; flex: 0 0 2.3rem; height: 2.3rem; border-radius: .65rem; font-weight: 800; }
.green { background: #e2edd8; }.sand { background: #f2e9d5; }.lavender { background: #ece3ef; }
.stat p { font-size: .78rem; }
.stat strong { display: block; font-weight: 730; font-size: clamp(.95rem, 2vw, 1.25rem); overflow-wrap: anywhere; }
.panel { margin-top: 1.1rem; overflow: hidden; }
.panel-heading { padding: 1.2rem clamp(.85rem, 3vw, 1.5rem); display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: .6rem; }
.panel-heading .eyebrow { margin-bottom: .23rem; }
.segmented { display: flex; align-self: center; background: #eff0e9; border-radius: .65rem; padding: .22rem; }
.segmented button { border: 1px solid transparent; background: transparent; border-radius: .45rem; min-height: 35px; font-size: .83rem; padding: .35rem .65rem; font-weight: 700; }
.segmented button[aria-pressed=true] { background: var(--white); border-color: var(--line); }
.filter-area { border-block: 1px solid var(--line); padding: .65rem clamp(.85rem, 3vw, 1.5rem); display: flex; flex-wrap: wrap; align-items: start; gap: .4rem; }
.filters { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip { min-height: 34px; padding: .3rem .65rem; border-radius: 10rem; font-size: .78rem; overflow-wrap: anywhere; }
.chip[aria-pressed=true] { background: #e7efdc; border-color: #aabfa1; color: #2e4c32; }
.chip.add-category { border-style: dashed; }
.empty { display: grid; justify-items: center; text-align: center; gap: .45rem; padding: 1.65rem 1rem; }
.empty-mark { color: #526e4c; border-radius: .8rem; background: #e8eee0; display: grid; place-items: center; width: 2.4rem; height: 2.4rem; font-size: 1.3rem; }
.empty .button { margin-top: .3rem; }
.task-list, .expense-list { padding: 0; margin: 0; list-style: none; }
.task-row, .expense-row { display: flex; align-items: center; gap: .8rem; padding: .45rem clamp(.85rem, 3vw, 1.5rem); }
.task-row + .task-row, .expense-row + .expense-row { border-top: 1px solid var(--line); }
.check-task { display: grid; place-items: center; width: 38px; height: 38px; flex: 0 0 38px; border-radius: .6rem; border: 1px solid #9aab9d; background: var(--white); color: #2c5935; font-size: 1.15rem; font-weight: 750; }
.check-task:hover, .check-task.checked { background: #e3eed8; }
.task-detail { color: var(--ink); background: transparent; border: 0; border-radius: .4rem; padding: .55rem 1.1rem .55rem 0; text-align: left; min-width: 0; width: 100%; position: relative; }
.task-detail:hover strong { text-decoration: underline; text-underline-offset: 3px; }
.row-arrow { right: .15rem; top: 27%; position: absolute; color: var(--subtle); }
.tags { display: flex; align-items: center; flex-wrap: wrap; column-gap: .6rem; row-gap: .23rem; margin-top: .18rem; font-size: .77rem; color: var(--subtle); }
.tag { background: #edf0e8; padding: .1rem .4rem; border-radius: .3rem; }
.completion { color: #39613b; font-weight: 650; }
.timeline-group, .expense-group { padding-block: .85rem; border-bottom: 1px solid var(--line); }
.timeline-group:last-child, .expense-group:last-child { border-bottom: 0; }
.timeline-group h3, .expense-group > h3, .expense-group > p { padding-inline: clamp(.85rem, 3vw, 1.5rem); }
.timeline-group h3, .expense-group > h3 { color: var(--moss); margin-bottom: .25rem; }
.expense-row { justify-content: space-between; padding-block: .65rem; overflow-wrap: anywhere; }
.expense-row .amount { text-align: end; white-space: nowrap; }
.expense-row p { font-size: .78rem; }
footer { color: var(--subtle); font-size: .65rem; font-weight: 760; letter-spacing: .15em; padding: 1.8rem 0; }
.notice { position: fixed; inset: auto .9rem 1rem auto; z-index: 1; display: flex; align-items: center; gap: .5rem; max-width: min(31rem, calc(100% - 1.8rem)); background: #edf4e5; border: 1px solid #aebfa6; border-radius: .7rem; padding: .55rem .65rem .55rem .8rem; box-shadow: 0 8px 28px #20362d20; }
.notice.error, .error-text, .validation-message, .validation-errors { color: #8b302a; }
.notice.error { border-color: #d8b3aa; background: #faece9; }
.notice button, .close { display: grid; place-items: center; border: 0; border-radius: .5rem; background: transparent; width: 40px; min-height: 40px; font-size: 1.4rem; flex: none; }
.close:hover, .notice button:hover { background: #263b3312; }
.login-wrap { display: grid; min-height: 100dvh; place-items: center; padding: 1.3rem; background: radial-gradient(ellipse at 14% 10%, #dde8d3, transparent 65%), var(--canvas); }
.login-card, dialog { border: 1px solid var(--line); border-radius: 1.35rem; background: var(--white); color: var(--ink); padding: clamp(1.2rem, 4vw, 2.4rem); box-shadow: 0 18px 70px #233b3118; }
.login-card { max-width: 31rem; width: 100%; }
.login-card .eyebrow { margin-top: .9rem; }
.login-card h1 { margin: .35rem 0 .65rem; }
.login-card a, .login-card button[type=submit] { margin-top: .9rem; }
.login-card button[type=submit] { width: 100%; justify-content: space-between; }
.login-card .notice { position: static; margin-top: .8rem; }
.validation-errors { margin: .45rem 0; padding-left: 1.1rem; }
label { display: block; font-size: .88rem; font-weight: 700; margin: .95rem 0 .25rem; }
label.check { display: flex; align-items: start; gap: .45rem; }
input:not([type=checkbox]), select, textarea { display: block; min-width: 0; width: 100%; border: 1px solid #bdc8bd; border-radius: .55rem; background: #fff; padding: .55rem .65rem; color: var(--ink); }
input[type=checkbox] { accent-color: var(--forest); width: 1rem; height: 1rem; flex: none; }
textarea { resize: vertical; }
dialog { width: min(34rem, calc(100vw - 1.5rem)); max-height: calc(100dvh - 1.5rem); overscroll-behavior: contain; }
dialog::backdrop { background: #172b23a0; }
.dialog-header { display: flex; align-items: start; justify-content: space-between; gap: .5rem; margin-bottom: .55rem; }
.dialog-header .eyebrow { margin-bottom: .23rem; }
.fields { display: grid; gap: .7rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dialog-actions { display: flex; justify-content: end; flex-wrap: wrap; gap: .55rem; margin-top: 1.1rem; }
.form-error { margin-top: .65rem; }
#details-dialog > p, #details-dialog > h3, #details-dialog > button { margin: .75rem 0; }
.comment { background: #f4f5ee; border-radius: .5rem; padding: .6rem .7rem; margin-block: .35rem; overflow-wrap: anywhere; }
.comment p { white-space: pre-wrap; }
.comment strong { font-size: .8rem; }
@media (max-width: 820px) {
    .app { grid-template-columns: 1fr; }
    .sidebar { position: static; min-height: 0; display: grid; grid-template-columns: 1fr auto; align-items: center; padding: .65rem 1rem; gap: .4rem; }
    .navigation { grid-column: 1 / -1; grid-row: 2; grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .navigation a { justify-content: center; padding-inline: .25rem; }
    .nav-label, .identity small, .identity .avatar { display: none; }
    .account { display: flex; flex-wrap: wrap; justify-content: end; align-items: center; gap: 0; margin: 0; }
    .identity { border: 0; padding: 0 .15rem; }
    .identity strong { font-size: .78rem; }
    .logout, .install { padding: .3rem; font-size: .75rem; }
    .install { order: 1; }
    .topbar { min-height: 3.4rem; }
}
@media (max-width: 475px) {
    .brand { gap: .35rem; }
    .brand img { width: 33px; height: 33px; }
    .brand strong, .navigation a { font-size: .8rem; }
    .brand small { font-size: .57rem; }
    .stats { gap: .35rem; }
    .stat { align-items: start; flex-direction: column; gap: .25rem; padding: .5rem; }
    .stat-icon { flex: none; width: 1.5rem; height: 1.5rem; }
    .hero::before { opacity: .6; right: -14rem; }
}
@media (max-width: 345px) { .navigation a span, .identity { display: none; } }
@media (prefers-reduced-motion: no-preference) { button, a { transition: background-color 120ms linear; } }