:root {
  color-scheme: light;
  --ink: #182b25;
  --muted: #586b61;
  --line: #dfe7e0;
  --paper: #fff;
  --ground: #f4f6f2;
  --green: #215b49;
  --dark: #153c35;
  --mint: #dff0e6;
  --gold: #e4a76d;
  --radius: 16px;
  font-family: "DM Sans", system-ui, sans-serif;
  color: var(--ink);
  background: var(--ground);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--green); text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 2px; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .68; }
:focus-visible { outline: 3px solid #408e79; outline-offset: 3px; }
h1, h2, p, dl { margin: 0; }
h1 { font-size: clamp(2rem, 4vw, 3.2rem); line-height: 1.02; letter-spacing: -.05em; overflow-wrap: anywhere; }
h2 { font-size: 1.14rem; line-height: 1.25; letter-spacing: -.025em; }
small { font-size: .82rem; color: var(--muted); }
code { overflow-wrap: anywhere; }
.shell { --rail: 70px; display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); min-height: 100dvh; }
.shell.nav-pinned { --rail: 232px; }
.sidebar { position: sticky; top: 0; align-self: start; height: 100dvh; z-index: 3; }
.sidebar-frame { background: var(--dark); color: #eef8f0; display: flex; flex-direction: column; width: 232px; height: 100%; overflow: auto; overscroll-behavior: contain; padding: 17px 12px max(16px, env(safe-area-inset-bottom)); }
.sidebar .sidebar-frame { width: var(--rail); overflow-x: hidden; transition: width .18s ease, box-shadow .18s ease; }
.sidebar:is(:hover, :focus-within) .sidebar-frame { width: 232px; box-shadow: 12px 0 35px #102e2526; }
.sidebar-top { display: flex; gap: 5px; align-items: center; justify-content: space-between; flex-shrink: 0; }
.brand { display: flex; align-items: center; gap: 9px; color: inherit; font-size: 1.07rem; font-weight: 750; line-height: 1.07; text-decoration: none; min-width: 0; letter-spacing: -.035em; }
.brand-mark { display: inline-grid; place-items: center; width: 45px; height: 45px; flex-shrink: 0; background: #dcf1e1; color: var(--dark); border-radius: 13px; font-size: 1.8rem; font-weight: 700; }
.sidebar-frame nav { display: grid; gap: 13px; margin-top: 27px; min-width: 0; }
.nav-group { display: grid; gap: 3px; }
.nav-heading { color: #a9c4b6; padding: 0 11px 4px; font-size: .68rem; text-transform: uppercase; letter-spacing: .12em; font-weight: 750; min-height: 16px; }
.sidebar-frame nav a, .signout button { display: flex; gap: 10px; align-items: center; padding: 9px 11px; color: #dceae1; text-decoration: none; border-radius: 9px; font-size: .91rem; min-height: 44px; overflow: hidden; }
.sidebar-frame nav a:hover, .sidebar-frame nav a[aria-current="page"], .signout button:hover { color: white; background: #2a5348; }
.sidebar-frame nav a[aria-current="page"] { font-weight: 700; }
.nav-icon { width: 24px; flex: 0 0 24px; text-align: center; font-size: 1.15rem; }
.nav-label { white-space: nowrap; }
.signout { margin-top: auto; padding-top: 19px; }
.signout button { background: none; border: 0; width: 100%; }
.nav-button { display: inline-grid; place-items: center; width: 44px; height: 44px; flex-shrink: 0; padding: 0; border: 1px solid #ffffff34; border-radius: 9px; background: transparent; color: white; font-size: 1.38rem; }
.nav-button:hover { background: #2a5348; }
.shell:not(.nav-pinned) .sidebar:not(:hover, :focus-within) :is(.nav-label, .nav-heading, .pin-menu) { opacity: 0; }
.mobile-bar, .mobile-menu { display: none; }
.workspace { width: 100%; max-width: 1460px; padding: 38px clamp(19px, 3.3vw, 58px) 52px; margin: 0 auto; }
.page-header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 18px; margin-bottom: 25px; }
.page-header > div { min-width: 0; }
.eyebrow { color: var(--green); font-size: .74rem; text-transform: uppercase; letter-spacing: .14em; font-weight: 800; margin-bottom: 8px; }
.subtitle { color: var(--muted); margin-top: 10px; overflow-wrap: anywhere; }
.button, .small-button { border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 42px; padding: 9px 15px; font-weight: 660; font-size: .91rem; line-height: 1.2; text-decoration: none; border: 1px solid transparent; }
.primary { background: var(--green); color: white; }
.primary:hover { background: #174434; }
.secondary, .small-button { background: var(--paper); color: var(--green); border-color: var(--line); }
.secondary:hover, .small-button:hover { border-color: #8eb29e; }
.small-button { min-width: 42px; font-size: 1rem; padding: 7px; }
.tiny { padding: 5px 9px; min-height: 34px; font-size: .78rem; }
.danger { background: #fff7f6; border-color: #efd6d2; color: #9a332b; }
.danger:hover { background: #fcebe8; }
.period-bar { display: flex; justify-content: space-between; align-items: end; gap: 12px; flex-wrap: wrap; margin-bottom: 19px; }
.month-picker { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.month-picker label { color: var(--muted); font-weight: 650; font-size: .86rem; margin-right: 3px; }
input:not([type="hidden"]), select { min-width: 0; padding: 9px 11px; border: 1px solid #cad8ce; border-radius: 8px; background: #fff; color: var(--ink); min-height: 42px; }
.stats, .dashboard-grid, .layout-grid { display: grid; gap: 15px; }
.stats { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 16px; }
.dashboard-grid { grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); margin-bottom: 16px; }
.layout-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.stat, .panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); min-width: 0; padding: clamp(16px, 2vw, 24px); }
.stat { padding: clamp(14px, 1.65vw, 23px); }
.stat.balance { background: var(--dark); border-color: var(--dark); color: white; }
.stat h2 { font-size: .9rem; font-weight: 650; margin: 13px 0 6px; }
.stat strong { font-size: clamp(1.25rem, 2.25vw, 2.15rem); line-height: 1.2; letter-spacing: -.05em; display: block; overflow-wrap: anywhere; }
.stat p { font-size: .8rem; margin-top: 8px; color: var(--muted); }
.stat.balance p { color: #c5ded2; }
.stat-icon, .empty-icon { width: 38px; height: 38px; border-radius: 10px; display: inline-grid; place-items: center; background: var(--mint); color: var(--green); font-size: 1.27rem; }
.balance .stat-icon { background: #356256; color: #e4f8eb; }
.expense-icon { background: #f8e8d9; color: #8c481b; }
.reserve-icon { background: #e9eef9; color: #3a547b; }
.section-header, .between { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.section-header { margin-bottom: 15px; }
.section-header a, .empty a { font-size: .87rem; font-weight: 650; }
.muted { color: var(--muted); }
.panel p + p { margin-top: 10px; }
.panel h2 + p, h2 + .notice { margin-top: 7px; }
.legend { display: flex; gap: 15px; margin: 10px 0; color: var(--muted); font-size: .82rem; }
.legend span::before { content: ""; width: 9px; height: 9px; display: inline-block; background: #498d72; border-radius: 3px; margin-right: 6px; }
.legend span + span::before { background: var(--gold); }
.chart { --plot-height: 124px; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); text-align: center; gap: 6px; background: repeating-linear-gradient(to top, transparent 0 30px, #edf1ed 30px 31px) top / 100% var(--plot-height) no-repeat; }
.chart-column { min-width: 0; }
.chart-bars { height: var(--plot-height); border-bottom: 1px solid var(--line); display: flex; align-items: end; justify-content: center; gap: 3px; }
.chart-bars meter { width: clamp(7px, 1.35vw, 17px); height: 100%; writing-mode: vertical-lr; direction: rtl; }
.chart-column small { display: block; margin-top: 6px; }
meter { appearance: none; display: block; background: transparent; border: 0; border-radius: 6px; }
meter::-webkit-meter-bar { background: #ecf1ed; border: 0; border-radius: 6px; height: 100%; width: 100%; }
meter::-webkit-meter-optimum-value { background: #498d72; border-radius: 5px; }
meter::-moz-meter-bar { background: #498d72; border-radius: 5px; }
.chart-bars meter::-webkit-meter-bar { background: transparent; }
.chart-expense::-webkit-meter-optimum-value { background: var(--gold); }
.chart-expense::-moz-meter-bar { background: var(--gold); }
.category-list { display: grid; gap: 14px; margin-top: 18px; font-size: .9rem; }
.category-list meter { width: 100%; height: 8px; margin-top: 6px; background: #ecf1ed; }
.empty { background: #f7f9f6; border: 1px dashed #d9e4da; border-radius: 11px; text-align: center; padding: 25px 12px; color: var(--muted); }
.empty.compact { min-height: 144px; display: grid; justify-items: center; align-content: center; gap: 8px; }
.empty p + a { display: inline-block; margin-top: 7px; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: .9rem; }
th { color: var(--muted); font-size: .8rem; font-weight: 650; }
th, td { padding: 11px 9px; border-bottom: 1px solid var(--line); }
td:first-child { min-width: 125px; overflow-wrap: anywhere; }
td a, .item-list a { font-weight: 680; }
td small, .item-list small { display: block; margin-top: 3px; }
.numeric { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; font-weight: 700; }
.positive { color: var(--green); }
.back { display: inline-block; margin-bottom: 12px; font-size: .87rem; font-weight: 650; }
.form-panel { max-width: 720px; }
.fields { display: grid; gap: 17px; }
h2 + .fields, .panel p + .fields { margin-top: 18px; }
.fields label { min-width: 0; display: grid; gap: 6px; font-weight: 650; font-size: .91rem; }
.fields label small { font-weight: 450; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.fields .upload { border: 1px dashed #a9c3b1; border-radius: 10px; padding: 16px; background: #f6faf6; }
.upload input { max-width: 100%; }
.item-list { list-style: none; padding: 0; margin: 0; }
.item-list li { display: flex; gap: 12px; justify-content: space-between; align-items: center; border-top: 1px solid var(--line); padding: 12px 0; overflow-wrap: anywhere; }
.status { border-radius: 20px; background: #f1f4ef; color: #456153; padding: 5px 9px; font-size: .78rem; white-space: nowrap; }
.paid { background: var(--mint); }
.charge-payment { display: grid; justify-items: end; gap: 5px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 17px; }
.danger-zone { border-top: 1px solid var(--line); margin-top: 24px; padding-top: 16px; }
.proposal { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 20px; margin: 15px 0; padding: 15px; border-radius: 9px; background: #f6f9f6; }
dt { color: var(--muted); font-size: .8rem; }
dd { margin: 4px 0 0; font-weight: 650; overflow-wrap: anywhere; }
.notice { padding: 10px 13px; border-radius: 8px; background: #edf4ee; color: #345e4d; font-size: .9rem; }
.notice.error { background: #fff0ed; color: #8a2b24; }
.notifications { display: grid; gap: 6px; margin-bottom: 16px; }
.result { margin-top: 16px; }
.prose { margin-top: 13px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; max-width: 76ch; }
.auth { min-height: 100dvh; display: grid; align-content: center; justify-items: center; padding: 24px; background: radial-gradient(ellipse at 15% 12%, #deeee3, #f4f6f2 60%); }
.auth .notifications, .login-card { width: min(100%, 430px); }
.login-card { background: white; border: 1px solid var(--line); border-radius: 20px; padding: clamp(22px, 5vw, 40px); box-shadow: 0 14px 45px #153c3512; }
.login-card h1 { font-size: 2.3rem; margin-top: 17px; }
.login-card p { margin: 9px 0 24px; }
@media (max-width: 1100px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .shell { display: block; }
  .sidebar { display: none; }
  .mobile-bar { position: sticky; top: 0; z-index: 3; display: flex; align-items: center; gap: 10px; background: var(--dark); color: white; padding: max(8px, env(safe-area-inset-top)) 12px 8px; }
  .mobile-brand { color: white; text-decoration: none; font-weight: 750; margin-right: auto; }
  .mobile-scan { background: var(--mint); color: var(--dark); min-height: 44px; padding: 0 10px; display: inline-flex; align-items: center; font-weight: 700; text-decoration: none; border-radius: 9px; white-space: nowrap; }
  .hamburger { width: 19px; height: 14px; border-block: 2px solid currentColor; position: relative; }
  .hamburger::after { content: ""; position: absolute; inset: 4px 0 auto; border-top: 2px solid currentColor; }
  .mobile-menu[open] { display: block; position: fixed; inset: 0 auto 0 0; width: min(310px, 89vw); max-width: none; height: 100dvh; max-height: none; margin: 0; padding: 0; border: 0; background: var(--dark); }
  .mobile-menu::backdrop { background: #112c24a0; }
  .mobile-menu .sidebar-frame { width: 100%; padding: max(12px, env(safe-area-inset-top)) 13px max(12px, env(safe-area-inset-bottom)); }
  body:has(.mobile-menu[open]) { overflow: hidden; }
  .workspace { padding: 23px 15px 32px; }
  .layout-grid, .dashboard-grid { grid-template-columns: minmax(0, 1fr); }
  .chart-bars meter { width: 13px; }
  input:not([type="hidden"]), select, textarea { font-size: 1rem; }
}
@media (prefers-reduced-motion: reduce) {
  .sidebar .sidebar-frame { transition: none; }
}
@media (max-width: 410px) {
  .form-grid { grid-template-columns: 1fr; }
  .page-header .button { width: 100%; }
}

.purchase-details { margin: 0; padding: 14px 0 0; border: 0; border-top: 1px solid var(--line); min-width: 0; }
.purchase-details[hidden] { display: none; }
.purchase-details legend { padding: 0 9px 0 0; font-weight: 700; }
.purchase-rows { display: grid; gap: 8px; }
.purchase-row { display: grid; grid-template-columns: 1fr 1fr minmax(115px, .65fr) auto; gap: 9px; align-items: end; background: var(--ground); padding: 9px; border-radius: 8px; }
.purchase-row > button { min-height: 42px; }
.purchase-row label { font-size: .79rem; }
.consumption-grid { align-items: stretch; }
.consumption-grid .empty { margin-top: 12px; }
.share { color: var(--green); font-size: 1.5rem; }
.summary-list { display: grid; margin-top: 13px; }
.summary-list > div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; border-top: 1px solid var(--line); padding: 8px 0; }
.summary-list dd { white-space: nowrap; }
.habits-list { margin-top: 12px; }
.check-item { display: flex; align-items: center; gap: 8px; }
.check-item input[type="checkbox"] { min-height: 0; accent-color: var(--green); width: 17px; height: 17px; }
.check-item:has(input:checked) { text-decoration: line-through; color: var(--muted); }
.calendar-navigation { display: flex; gap: 5px; }
.calendar { table-layout: fixed; border-collapse: separate; border-spacing: 1px; background: var(--line); }
.calendar td, .calendar th { min-width: 0; border: 0; background: white; overflow-wrap: normal; }
.calendar td { height: 95px; vertical-align: top; }
.calendar td > time { display: inline-grid; place-items: center; width: 25px; height: 25px; border-radius: 50%; }
.calendar td.today > time { background: var(--dark); color: white; }
.calendar td.other-month { background: var(--ground); }
.calendar td > a { display: block; margin-top: 4px; padding: 3px 5px; color: var(--green); background: var(--mint); border-radius: 4px; font-size: .76rem; overflow-wrap: anywhere; }
.agenda { margin-top: 18px; }
.agenda h3 { font-size: .88rem; margin: 16px 0 7px; }
.agenda .empty { margin-top: 10px; }
@media (max-width: 650px) {
  .purchase-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .calendar { display: none; }
}

.charge-payment { min-width: 0; }
.charge-payment-form { display: grid; gap: 7px; justify-items: end; max-width: 100%; }
.charge-payment-form label { display: grid; gap: 3px; max-width: 100%; color: var(--muted); font-size: .78rem; }
.charge-payment-form select { max-width: 100%; min-height: 34px; padding: 5px; }

.header-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.bank-notice { margin-bottom: 14px; max-width: 720px; }
.statement-list { margin: 13px 0; }
.statement-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }
.statement-choice { display: grid; gap: 5px; color: var(--muted); font-size: .82rem; min-width: 0; }
.statement-choice label { display: grid; gap: 5px; }
.statement-choice label[hidden] { display: none; }
.statement-choice select { width: 100%; }
@media (max-width: 650px) {
  .statement-list li { grid-template-columns: minmax(0, 1fr) auto; }
  .statement-choice { grid-column: 1 / -1; }
}

#importer { scroll-margin-top: 78px; }
.upload-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.fields .upload-choice { position: relative; cursor: pointer; align-content: start; padding: 13px; border: 1px solid var(--line); background: #f6faf6; border-radius: 10px; }
.upload-choice:focus-within { outline: 3px solid #408e79; outline-offset: 2px; }
.upload-choice input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.file-selection { overflow-wrap: anywhere; }

.garage-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.garage-list li > div:first-child { min-width: 0; }
.garage-status { display: grid; justify-items: end; gap: 4px; }
.garage-movements { margin-top: 16px; }
.fields .garage-checkbox { display: flex; align-items: center; }
.garage-checkbox input[type="checkbox"] { min-height: 0; width: 18px; height: 18px; accent-color: var(--green); }
@media (max-width: 450px) {
  .garage-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .garage-stats .balance { grid-column: 1 / -1; }
}
.fields [data-garage-options][hidden] { display: none; }

.mobile-scan[hidden], .quick-scan[hidden] { display: none; }
.quick-scan-button { position: relative; }
.quick-scan-button:focus-within { outline: 3px solid #a3d3b6; outline-offset: 2px; }
.quick-scan-button input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.scan-review { width: min(420px, calc(100% - 32px)); padding: 19px; border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); }
.scan-review::backdrop { background: #112c24a0; }
.scan-review .subtitle { overflow-wrap: anywhere; }
.scan-fields { margin-top: 15px; }
.scan-fields .actions { margin-top: 0; }
body:has(.scan-review[open]) { overflow: hidden; }

.refund-details { margin: 0; border: 0; padding: 0; min-width: 0; }
.refund-details[hidden] { display: none; }
.health-list li > div:first-child { min-width: 0; }

.fields [data-support-status][hidden] { display: none; }
.support-heading { margin-top: 16px; }
#year { width: 7.5rem; }

.fields [data-refund-policy][hidden] { display: none; }
.contract-tabs { margin-bottom: 16px; }
.contract-grid { margin-top: 16px; }
.contract-link { margin-top: 12px; }

.passkey-details { margin-top: 14px; }
.passkey-details summary { color: var(--green); font-weight: 700; cursor: pointer; }
.passkey-details .fields { margin-top: 14px; }
.login-card .passkey-message { margin: 0; color: var(--ink); font-size: .9rem; }
