@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700;800&family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
  color-scheme: light;
  --green: #174c3d;
  --deep: #123d32;
  --lime: #d5f1b7;
  --pale: #eaf4e3;
  --peach: #e99b71;
  --cream: #faede4;
  --canvas: #f6f7f2;
  --ink: #18352d;
  --muted: #73827a;
  --border: #e4e9e1;
  --white: #fff;
  --shadow: 0 16px 45px rgb(24 53 45 / 7%);
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 300px; min-height: 100vh; background: var(--canvas); }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid color-mix(in srgb, var(--green) 28%, transparent); outline-offset: 2px; }
[hidden] { display: none !important; }

.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 34px; background: radial-gradient(ellipse at 15% 8%, #dcebd8 0, transparent 36%), #f3f5ef; }
.auth-card { width: min(1020px, 100%); min-height: 640px; display: grid; grid-template-columns: 1fr .88fr; overflow: hidden; border-radius: 28px; background: var(--white); box-shadow: 0 28px 80px rgb(18 61 50 / 14%); }
.auth-brand-panel { position: relative; isolation: isolate; overflow: hidden; display: flex; flex-direction: column; padding: 36px 42px; color: white; background: var(--green); }
.auth-brand-panel::before, .auth-brand-panel::after { content: ''; position: absolute; z-index: -1; width: 440px; height: 440px; border: 1px solid rgb(255 255 255 / 12%); border-radius: 50%; }
.auth-brand-panel::before { right: -145px; bottom: -170px; box-shadow: 0 0 0 45px rgb(255 255 255 / 4%), 0 0 0 100px rgb(255 255 255 / 3%); }
.auth-brand-panel::after { left: -300px; top: 250px; }
.brand { width: fit-content; display: inline-flex; align-items: center; gap: 9px; color: var(--ink); text-decoration: none; font: 800 27px/1 'Manrope', sans-serif; letter-spacing: -1.5px; }
.brand img { width: 36px; height: 36px; object-fit: contain; }
.auth-brand { color: white; font-size: 30px; }
.auth-brand img { width: 43px; height: 43px; }
.auth-copy { margin: auto 0; max-width: 390px; position: relative; z-index: 1; }
.eyebrow { display: block; color: #8b9a90; font-size: 10px; font-weight: 800; letter-spacing: 1.55px; }
.eyebrow.light { color: #bdd8c7; }
.auth-copy h1 { margin: 17px 0 15px; font: 800 clamp(34px, 4.3vw, 48px)/1.12 'Manrope', sans-serif; letter-spacing: -2.2px; }
.auth-copy p { max-width: 350px; color: #c6dccf; font-size: 15px; line-height: 1.7; }
.auth-mascot { width: 160px; height: 160px; position: absolute; right: 31px; bottom: 28px; object-fit: contain; opacity: .88; filter: drop-shadow(0 16px 26px rgb(0 0 0 / 12%)); }
.auth-orbit { position: absolute; right: -75px; bottom: -270px; width: 500px; height: 500px; border: 1px solid rgb(213 241 183 / 26%); border-radius: 50%; box-shadow: 0 0 0 55px rgb(213 241 183 / 4%), 0 0 0 120px rgb(213 241 183 / 3%); }
.auth-footnote { position: relative; z-index: 1; color: #bdd8c7; font-size: 11px; letter-spacing: .3px; }
.auth-form-panel { display: flex; align-items: center; padding: 50px clamp(28px, 5vw, 58px); }
.auth-heading h2 { margin: 13px 0 7px; font: 800 27px/1.2 'Manrope', sans-serif; letter-spacing: -1px; }
.auth-heading p, .verification-view > p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.7; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin: 28px 0 22px; padding: 5px; border-radius: 12px; background: #f0f3ee; }
.auth-tab { border: 0; border-radius: 9px; padding: 10px; color: var(--muted); background: transparent; font-size: 12px; font-weight: 700; }
.auth-tab.active { color: var(--green); background: white; box-shadow: 0 2px 8px rgb(24 53 45 / 8%); }
.field { min-width: 0; display: grid; gap: 7px; margin: 14px 0; }
.field > span { color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: 1.1px; }
.field input, .field select, .filter-row select, .search-field { width: 100%; min-height: 45px; border: 1px solid var(--border); border-radius: 11px; padding: 0 13px; color: var(--ink); background: white; font-size: 13px; transition: border-color .18s, box-shadow .18s; }
.field input:focus, .field select:focus, .filter-row select:focus, .search-field:focus-within { border-color: color-mix(in srgb, var(--green) 50%, var(--border)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 9%, transparent); outline: 0; }
.field input::placeholder, .search-field input::placeholder { color: #a0aaa4; }
.button { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 11px; padding: 0 16px; font-size: 12px; font-weight: 800; text-decoration: none; transition: background .18s, transform .18s, box-shadow .18s; }
.button:hover { transform: translateY(-1px); }
.button.primary { color: white; background: var(--green); box-shadow: 0 7px 16px color-mix(in srgb, var(--green) 18%, transparent); }
.button.primary:hover { background: var(--deep); }
.button.secondary { color: var(--green); border-color: #cfdbd0; background: white; }
.button.secondary:hover { background: var(--pale); }
.button.full { width: 100%; }
.text-button { margin-top: 5px; color: var(--green); background: transparent; }
.auth-switch { margin: 20px 0 0; text-align: center; color: var(--muted); font-size: 12px; }
.auth-switch button, .link-button { border: 0; padding: 0; color: var(--green); background: none; font-size: inherit; font-weight: 800; }
.forgot-password { display: block; margin: -5px 0 12px auto; border: 0; padding: 0; color: var(--green); background: none; font-size: 10px; font-weight: 700; }
.secure-note { margin: 25px 0 0; text-align: center; color: #96a29a; font-size: 11px; }
.secure-note span { margin-right: 5px; color: #77a67d; font-size: 8px; }
.form-message { margin: 13px 0; padding: 10px 12px; border: 1px solid #f1c9bd; border-radius: 10px; color: #a64b36; background: #fff5f0; font-size: 12px; line-height: 1.5; }
.form-message.success { border-color: #d8e9cc; color: #315c3e; background: #f0f7eb; }
.verification-view { width: 100%; text-align: center; }
.verification-icon { width: 64px; height: 64px; display: grid; place-items: center; margin: 0 auto 24px; border-radius: 22px; color: var(--green); background: var(--pale); font-size: 26px; }
.verification-view h2 { margin: 12px 0; font: 800 28px 'Manrope', sans-serif; letter-spacing: -1px; }
.verification-view strong { overflow-wrap: anywhere; color: var(--ink); }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 245px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 28px 16px 16px; border-right: 1px solid var(--border); background: white; }
.sidebar .brand { padding: 0 12px 29px; }
.side-caption { margin: 4px 13px 9px; color: #98a49d; font-size: 9px; font-weight: 800; letter-spacing: 1.35px; }
.household-card { display: flex; align-items: center; gap: 9px; margin: 0 4px 20px; padding: 11px; border: 1px solid var(--border); border-radius: 13px; background: #fbfcfa; }
.household-icon { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; color: var(--green); background: var(--pale); font-size: 18px; }
.household-copy { min-width: 0; display: grid; gap: 2px; flex: 1; }
.household-copy strong { overflow: hidden; color: var(--ink); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.household-copy span { overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.online-dot { width: 7px; height: 7px; border-radius: 50%; background: #6ca578; box-shadow: 0 0 0 3px #e8f4e8; }
.side-nav { display: grid; gap: 4px; }
.nav-item { width: 100%; min-height: 43px; display: flex; align-items: center; gap: 12px; border: 0; border-radius: 11px; padding: 0 13px; color: #718078; background: transparent; text-align: left; font-size: 12px; font-weight: 650; transition: background .18s, color .18s; }
.nav-item span { width: 19px; text-align: center; font-size: 18px; line-height: 1; }
.nav-item:hover { color: var(--green); background: #f4f7f2; }
.nav-item.active { color: var(--green); background: var(--pale); font-weight: 800; }
.sidebar-bottom { margin-top: auto; }
.invite-mini { margin: 0 3px 13px; padding: 14px; border-radius: 14px; background: #f7f9f5; }
.invite-mini-icon { width: 29px; height: 29px; display: grid; place-items: center; margin-bottom: 11px; border-radius: 9px; color: var(--green); background: white; }
.invite-mini strong { font-size: 11px; }
.invite-mini p { margin: 5px 0 9px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.link-button { font-size: 11px; }
.link-button span { margin-left: 3px; }
.logout-button { color: #7b8881; }
.sidebar-foot { padding: 14px 12px 0; color: #a0aaa3; font-size: 10px; }
.main-content { width: 100%; max-width: 1440px; margin: 0 auto; padding: 30px clamp(20px, 4vw, 52px) 60px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 24px; }
.topbar h1 { margin: 5px 0 3px; font: 800 25px/1.2 'Manrope', sans-serif; letter-spacing: -.9px; }
.topbar p, .page-intro p { margin: 0; color: var(--muted); font-size: 12px; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.date-pill { padding: 9px 12px; border: 1px solid var(--border); border-radius: 10px; color: var(--muted); background: white; font-size: 11px; }
.profile-chip, .profile-avatar { display: grid; place-items: center; border: 1px solid #c8d9cc; border-radius: 50%; color: var(--green); background: var(--pale); font-weight: 800; }
.profile-chip { width: 38px; height: 38px; font-size: 14px; }
.data-banner { margin: 0 0 16px; padding: 12px 15px; border: 1px solid #f1c9bd; border-radius: 12px; color: #a64b36; background: #fff6f2; font-size: 12px; }
.loading-line { margin: 0 0 12px; color: #87958c; font-size: 11px; }
.loading-line span { width: 7px; height: 7px; display: inline-block; margin-right: 6px; border-radius: 50%; background: #8abb83; animation: pulse 1s ease-in-out infinite alternate; }
@keyframes pulse { to { opacity: .28; transform: scale(.7); } }
.screen { animation: screen-in .2s ease-out both; }
@keyframes screen-in { from { opacity: .35; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
.hero-card { position: relative; isolation: isolate; overflow: hidden; min-height: 185px; display: flex; align-items: center; justify-content: space-between; gap: 22px; padding: 26px 32px; border-radius: 19px; color: white; background: var(--green); }
.hero-card::after { content: ''; position: absolute; z-index: -1; right: -100px; top: -185px; width: 430px; height: 430px; border: 1px solid rgb(255 255 255 / 15%); border-radius: 50%; box-shadow: 0 0 0 60px rgb(255 255 255 / 4%), 0 0 0 130px rgb(255 255 255 / 3%); }
.hero-copy, .hero-balance { position: relative; z-index: 1; }
.hero-copy h2 { margin: 9px 0; font: 800 26px/1.2 'Manrope', sans-serif; letter-spacing: -1px; }
.hero-copy p { margin: 0; color: #c9ddd1; font-size: 12px; }
.hero-balance { text-align: right; }
.hero-balance span { display: block; color: #c1d9ca; font-size: 9px; font-weight: 800; letter-spacing: 1.25px; }
.hero-balance strong { display: block; margin: 8px 0 3px; font: 800 30px 'Manrope', sans-serif; letter-spacing: -1.2px; }
.hero-balance small { color: #c1d9ca; font-size: 10px; }
.hero-decoration { position: absolute; right: 29%; bottom: 3px; color: rgb(213 241 183 / 11%); font-size: 110px; transform: rotate(10deg); }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 15px; margin: 26px 0 13px; }
.section-heading h2, .page-intro h2 { margin: 5px 0 0; font: 800 20px/1.25 'Manrope', sans-serif; letter-spacing: -.65px; }
.section-heading.compact { margin-top: 27px; }
.month-pill { padding: 6px 11px; border-radius: 30px; color: var(--green); background: var(--pale); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.metric-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.metric-card { min-height: 128px; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 16px 18px; border: 1px solid var(--border); border-radius: 16px; background: white; }
.metric-card strong { margin-top: 6px; font: 800 22px 'Manrope', sans-serif; letter-spacing: -.8px; }
.metric-card small { color: #8e9b94; font-size: 10px; }
.metric-label { color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: 1.15px; }
.metric-icon { width: 29px; height: 29px; display: grid; place-items: center; margin-bottom: 2px; border-radius: 9px; color: var(--green); background: var(--pale); font-size: 16px; }
.saved-card { background: #f7fbf3; }
.spent-card { background: #fff8f4; }
.spent-card .metric-icon { color: #b7704f; background: #fbe4d7; }
.income-card { background: #f3f8fa; }
.income-card .metric-icon { color: #5f8e9c; background: #e2eff3; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(255px, .8fr); gap: 14px; margin-top: 14px; }
.panel { min-width: 0; padding: 19px; border: 1px solid var(--border); border-radius: 16px; background: white; box-shadow: 0 4px 14px rgb(24 53 45 / 2%); }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.panel-heading h3, .profile-heading h3 { margin: 0; font: 800 14px 'Manrope', sans-serif; letter-spacing: -.35px; }
.panel-heading p, .profile-heading p { margin: 4px 0 0; color: #91a098; font-size: 10px; line-height: 1.5; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 9px; color: var(--muted); font-size: 9px; }
.chart-legend span { white-space: nowrap; }
.chart-legend i { width: 7px; height: 7px; display: inline-block; margin: 0 4px 1px 0; border-radius: 50%; }
.legend-income { background: #d6a73a; }
.legend-saved { background: var(--green); }
.legend-spent { background: var(--peach); }
.chart-wrap { display: grid; grid-template-columns: 31px 1fr; gap: 4px; margin: 18px 2px 1px; }
.chart-y-labels { display: flex; flex-direction: column; justify-content: space-between; height: 166px; padding-bottom: 18px; color: #9ba69f; font-size: 8px; }
.chart { height: 166px; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 7px; border-bottom: 1px solid var(--border); background: repeating-linear-gradient(to top, transparent 0, transparent calc(33.333% - 1px), #edf1eb calc(33.333% - 1px), #edf1eb 33.333%); }
.chart-col { min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; position: relative; }
.barset { width: 100%; height: 140px; display: flex; justify-content: center; align-items: flex-end; gap: 3px; }
.bar { width: min(12px, 25%); min-height: 2px; border-radius: 4px 4px 1px 1px; transition: height .25s ease; }
.bar.income { background: #d6a73a; }
.bar.saved { background: var(--green); }
.bar.spent { background: var(--peach); }
.chart-month { position: absolute; bottom: -20px; color: #829188; font-size: 8px; font-weight: 700; }
.goal-panel { display: flex; flex-direction: column; }
.panel-symbol { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 9px; color: var(--green); background: var(--pale); font-size: 19px; }
.goal-panel .button { margin-top: auto; }
.goal-progress-card { margin: 22px 0 16px; padding: 15px; border-radius: 13px; background: #f7f9f5; }
.goal-name { font-size: 12px; font-weight: 800; }
.goal-description { margin: 4px 0 12px; color: var(--muted); font-size: 10px; }
.progress-bar { width: 100%; height: 8px; overflow: hidden; border-radius: 8px; background: #e4ecdf; }
.progress-bar span { height: 100%; display: block; border-radius: inherit; background: var(--green); transition: width .25s ease; }
.progress-caption { display: flex; justify-content: space-between; gap: 5px; margin-top: 7px; color: var(--muted); font-size: 9px; }
.empty-note { margin: auto 0; padding: 25px 5px; color: var(--muted); text-align: center; font-size: 11px; line-height: 1.6; }
.recent-panel { margin-top: 14px; }
.transaction-list { margin-top: 8px; }
.transaction-row { display: flex; align-items: center; gap: 11px; padding: 11px 0; border-bottom: 1px solid #edf1ed; }
.transaction-row:last-child { border-bottom: 0; }
.transaction-icon { width: 35px; height: 35px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 11px; color: #ad765b; background: var(--cream); font-size: 17px; }
.transaction-icon.saving { color: var(--green); background: var(--pale); }
.transaction-icon.income { color: #5f8e9c; background: #e2eff3; }
.transaction-copy { min-width: 0; flex: 1; }
.transaction-copy strong { overflow: hidden; display: block; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.transaction-copy small { display: block; margin-top: 3px; color: #95a199; font-size: 9px; }
.transaction-amount { display: flex; align-items: center; gap: 9px; white-space: nowrap; font-size: 11px; font-weight: 800; }
.transaction-amount.expense { color: #b87351; }
.transaction-amount.income, .transaction-amount.saving { color: var(--green); }
.row-actions { display: flex; gap: 4px; }
.tiny-button { width: 27px; height: 27px; border: 0; border-radius: 8px; color: #87958c; background: #f5f7f3; font-size: 12px; }
.tiny-button:hover { color: var(--green); background: var(--pale); }
.page-intro { margin: 10px 0 20px; }
.page-intro h2 { margin: 6px 0; font-size: 24px; }
.page-intro p { font-size: 12px; }
.page-intro-row { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.page-intro-row .page-intro { margin: 0; }
.filter-row { display: flex; gap: 10px; margin-bottom: 9px; }
.search-field { display: flex; align-items: center; gap: 8px; max-width: 420px; padding: 0 12px; }
.search-field span { color: #89968f; font-size: 19px; }
.search-field input { width: 100%; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 12px; }
.filter-row select { width: 170px; min-height: 43px; padding: 0 11px; color: var(--muted); font-size: 11px; }
.full-list { margin-top: 0; }
.empty-state { padding: 38px 15px; text-align: center; }
.empty-state > span { width: 45px; height: 45px; display: grid; place-items: center; margin: 0 auto 12px; border-radius: 14px; color: var(--green); background: var(--pale); font-size: 21px; }
.empty-state strong { display: block; font: 800 13px 'Manrope', sans-serif; }
.empty-state p { margin: 6px 0 14px; color: var(--muted); font-size: 11px; }
.achievement-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.achievement-card { display: flex; align-items: center; gap: 11px; padding: 14px; border: 1px solid var(--border); border-radius: 13px; background: white; }
.achievement-medal { width: 37px; height: 37px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 12px; color: #94a099; background: #f2f4f1; font-size: 18px; }
.achievement-card.unlocked .achievement-medal { color: var(--green); background: var(--pale); }
.achievement-card strong { display: block; font-size: 11px; }
.achievement-card small { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; line-height: 1.45; }
.subtle { color: #98a49d; font-size: 10px; }
.goal-feature { min-height: 210px; }
.goal-feature-inner { max-width: 650px; margin: 4px auto; text-align: center; }
.goal-feature-inner .goal-mark { width: 54px; height: 54px; display: grid; place-items: center; margin: 0 auto 12px; border-radius: 18px; color: var(--green); background: var(--pale); font-size: 25px; }
.goal-feature-inner h3 { margin: 0; font: 800 19px 'Manrope', sans-serif; }
.goal-feature-inner p { margin: 6px 0 15px; color: var(--muted); font-size: 11px; }
.goal-feature-inner .progress-bar { height: 10px; }
.goal-feature-inner .progress-caption { margin-top: 9px; font-size: 10px; }
.bill-summary-row { display: grid; grid-template-columns: 220px 1fr; gap: 13px; margin: 19px 0 14px; }
.bill-summary-row .metric-card { min-height: 106px; }
.bill-note { display: flex; align-items: center; gap: 12px; }
.bill-note .note-icon { width: 37px; height: 37px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 12px; color: var(--green); background: var(--pale); font-size: 18px; }
.bill-note strong { font-size: 11px; }
.bill-note p { margin: 5px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.bill-list { margin-top: 6px; }
.bill-group-title { margin: 18px 0 5px; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; }
.bill-row { display: flex; align-items: center; gap: 11px; padding: 12px 0; border-bottom: 1px solid #edf1ed; }
.bill-row:last-child { border-bottom: 0; }
.bill-date { width: 43px; flex: 0 0 auto; display: grid; place-items: center; padding: 5px 0; border: 1px solid var(--border); border-radius: 10px; color: var(--muted); background: #fbfcfa; font-size: 8px; font-weight: 700; line-height: 1.5; text-align: center; }
.bill-date strong { display: block; color: var(--ink); font-size: 14px; }
.bill-copy { min-width: 0; flex: 1; }
.bill-copy strong { display: block; font-size: 11px; }
.bill-copy small { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; }
.bill-status { padding: 4px 8px; border-radius: 99px; color: #a8753d; background: #fff3dc; font-size: 8px; font-weight: 800; }
.bill-status.paid { color: var(--green); background: var(--pale); }
.bill-row .button { min-height: 32px; padding: 0 11px; font-size: 10px; }
.account-grid { display: grid; grid-template-columns: 1fr 1.12fr; gap: 13px; }
.profile-panel, .invite-panel, .financial-panel, .theme-panel { padding: 18px; }
.profile-heading { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.profile-avatar { width: 48px; height: 48px; flex: 0 0 auto; font-size: 18px; }
.profile-heading h3 { font-size: 14px; }
.profile-heading p { font-size: 10px; }
.member-row { display: flex; align-items: center; gap: 9px; padding: 9px 0; border-top: 1px solid #edf1ed; }
.member-initial { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 50%; color: var(--green); background: var(--pale); font-size: 10px; font-weight: 800; }
.member-row strong { display: block; font-size: 10px; }
.member-row small { display: block; color: var(--muted); font-size: 8px; }
.invite-panel .inline-form { margin-top: 8px; }
.inline-form { display: flex; align-items: end; gap: 9px; }
.inline-form .field { flex: 1; margin: 9px 0; }
.inline-form .button { flex: 0 0 auto; margin-bottom: 9px; }
.accept-form { padding-top: 8px; border-top: 1px solid #edf1ed; }
.financial-panel, .theme-panel { grid-column: 1 / -1; }
.financial-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 14px; }
.financial-grid .field { margin: 10px 0; }
.financial-panel .panel-heading { align-items: center; margin-bottom: 7px; }
.financial-panel .button { min-height: 35px; }
.theme-options { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 16px; }
.theme-option { min-width: 118px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--border); border-radius: 11px; padding: 9px 11px; color: var(--muted); background: white; font-size: 10px; font-weight: 700; }
.theme-option.active { border-color: color-mix(in srgb, var(--green) 55%, var(--border)); color: var(--green); background: var(--pale); }
.theme-option i { width: 17px; height: 17px; border-radius: 6px; background: var(--theme-swatch); }
.theme-option[data-theme="forest"] { --theme-swatch: #174c3d; }
.theme-option[data-theme="lavender"] { --theme-swatch: #7045b5; }
.theme-option[data-theme="ocean"] { --theme-swatch: #246a82; }
.theme-option[data-theme="rose"] { --theme-swatch: #a4486d; }
.theme-option[data-theme="midnight"] { --theme-swatch: #20152b; }
.mobile-nav { display: none; }
.modal-backdrop { position: fixed; z-index: 50; inset: 0; display: grid; place-items: center; overflow-y: auto; padding: 20px; background: rgb(10 29 23 / 52%); backdrop-filter: blur(3px); }
.modal-card { width: min(430px, 100%); max-height: min(90vh, 750px); overflow: auto; padding: 22px; border-radius: 19px; background: white; box-shadow: 0 24px 75px rgb(0 0 0 / 20%); animation: screen-in .16s ease-out both; }
.modal-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.modal-heading h2 { margin: 6px 0 0; font: 800 19px 'Manrope', sans-serif; letter-spacing: -.65px; }
.icon-button { width: 31px; height: 31px; border: 0; border-radius: 9px; color: var(--ink); background: #f1f4ef; font-size: 20px; line-height: 1; }
.modal-card .field { margin: 13px 0; }
.field-pair { display: grid; grid-template-columns: 1fr .75fr; gap: 10px; }
.check-field { display: flex; align-items: center; gap: 8px; margin: 14px 0; color: var(--muted); font-size: 11px; }
.check-field input { accent-color: var(--green); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.toast { position: fixed; z-index: 100; right: 22px; bottom: 22px; max-width: min(420px, calc(100vw - 32px)); padding: 13px 16px; border-radius: 12px; color: white; background: var(--deep); box-shadow: 0 12px 35px rgb(18 61 50 / 25%); font-size: 12px; opacity: 0; pointer-events: none; transform: translateY(8px); transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: translateY(0); }

:root[data-theme="midnight"] {
  color-scheme: dark;
  --green: #b48bef;
  --deep: #19111f;
  --lime: #d1b6ff;
  --pale: #30223f;
  --peach: #e99b71;
  --cream: #392631;
  --canvas: #120f16;
  --ink: #f4eff8;
  --muted: #b4a9bd;
  --border: #352d3b;
  --white: #1c1721;
  --shadow: 0 16px 45px rgb(0 0 0 / 20%);
}
:root[data-theme="midnight"] .auth-shell { background: radial-gradient(ellipse at 15% 8%, #30213e 0, transparent 36%), #120f16; }
:root[data-theme="midnight"] .auth-card,
:root[data-theme="midnight"] .auth-tab.active,
:root[data-theme="midnight"] .field input,
:root[data-theme="midnight"] .field select,
:root[data-theme="midnight"] .filter-row select,
:root[data-theme="midnight"] .panel,
:root[data-theme="midnight"] .metric-card,
:root[data-theme="midnight"] .sidebar,
:root[data-theme="midnight"] .household-card,
:root[data-theme="midnight"] .theme-option,
:root[data-theme="midnight"] .bill-date,
:root[data-theme="midnight"] .achievement-card,
:root[data-theme="midnight"] .search-field,
:root[data-theme="midnight"] .modal-card { color: var(--ink); border-color: var(--border); background-color: var(--white); }
:root[data-theme="midnight"] .auth-tabs,
:root[data-theme="midnight"] .invite-mini,
:root[data-theme="midnight"] .goal-progress-card,
:root[data-theme="midnight"] .household-icon,
:root[data-theme="midnight"] .profile-chip,
:root[data-theme="midnight"] .profile-avatar,
:root[data-theme="midnight"] .nav-item.active,
:root[data-theme="midnight"] .achievement-card.unlocked .achievement-medal { background-color: var(--pale); }
:root[data-theme="midnight"] .auth-form-panel,
:root[data-theme="midnight"] .mobile-nav { background: rgb(28 23 33 / 95%); }
:root[data-theme="midnight"] .hero-card { background: #30213e; }
:root[data-theme="midnight"] .saved-card { background: #211b29; }
:root[data-theme="midnight"] .spent-card { background: #2c2029; }
:root[data-theme="midnight"] .income-card { background: #1d2429; }
:root[data-theme="midnight"] .transaction-row,
:root[data-theme="midnight"] .bill-row,
:root[data-theme="midnight"] .member-row { border-color: #352d3b; }
:root[data-theme="midnight"] .chart { background: repeating-linear-gradient(to top, transparent 0, transparent calc(33.333% - 1px), #302a35 calc(33.333% - 1px), #302a35 33.333%); }
:root[data-theme="midnight"] .icon-button,
:root[data-theme="midnight"] .tiny-button,
:root[data-theme="midnight"] .secondary { color: var(--ink); border-color: var(--border); background: #27202e; }
:root[data-theme="midnight"] .theme-option.active { color: #d1b6ff; background: #30223f; }
:root[data-theme="midnight"] .modal-backdrop { background: rgb(3 1 5 / 70%); }

@media (max-width: 980px) {
  .app-shell { grid-template-columns: 205px minmax(0, 1fr); }
  .sidebar { padding-right: 11px; padding-left: 11px; }
  .main-content { padding-right: 23px; padding-left: 23px; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .goal-panel { min-height: 185px; }
  .account-grid { grid-template-columns: 1fr; }
  .financial-panel, .theme-panel { grid-column: auto; }
}
@media (max-width: 720px) {
  .auth-shell { display: block; padding: 0; background: white; }
  .auth-card { min-height: 100vh; display: flex; flex-direction: column; border-radius: 0; box-shadow: none; }
  .auth-brand-panel { min-height: 250px; flex: 0 0 auto; padding: 25px 27px; }
  .auth-brand { font-size: 25px; }
  .auth-brand img { width: 36px; height: 36px; }
  .auth-copy { max-width: calc(100% - 100px); margin: 22px 0 8px; }
  .auth-copy h1 { margin: 10px 0 6px; font-size: 20px; letter-spacing: -1.2px; }
  .auth-copy p { max-width: none; font-size: 10px; }
  .auth-mascot { right: 19px; bottom: 10px; width: 105px; height: 105px; }
  .auth-footnote { display: none; }
  .auth-form-panel { align-items: flex-start; flex: 1; padding: 28px 25px 35px; }
  .auth-form-panel > div { width: 100%; }
  .auth-heading h2 { font-size: 23px; }
  .auth-tabs { margin: 20px 0 16px; }
  .auth-switch { margin-top: 15px; }
  .secure-note { margin-top: 18px; }
  .app-shell { min-height: 100vh; display: block; padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
  .sidebar { display: none; }
  .main-content { padding: 22px 16px 28px; }
  .topbar { align-items: flex-start; margin-bottom: 18px; }
  .topbar h1 { font-size: 21px; }
  .topbar p { max-width: 210px; font-size: 10px; }
  .top-actions { gap: 6px; }
  .top-actions .date-pill { display: none; }
  .top-actions .button { min-height: 36px; padding: 0 10px; font-size: 10px; }
  .top-actions .profile-chip { display: none; }
  .hero-card { min-height: 156px; align-items: flex-start; flex-direction: column; gap: 15px; padding: 20px; border-radius: 17px; }
  .hero-copy h2 { font-size: 21px; }
  .hero-copy p { max-width: 235px; font-size: 10px; }
  .hero-balance { text-align: left; }
  .hero-balance strong { margin: 4px 0 1px; font-size: 23px; }
  .hero-balance span { font-size: 8px; }
  .hero-balance small { font-size: 9px; }
  .hero-decoration { right: -1px; bottom: 5px; font-size: 84px; }
  .section-heading { margin: 20px 0 11px; }
  .section-heading h2 { font-size: 17px; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .metric-card { min-height: 111px; padding: 12px; }
  .metric-grid .metric-card:last-child { grid-column: 1 / -1; min-height: 76px; display: grid; grid-template-columns: 29px 1fr auto; grid-template-rows: 1fr 1fr; align-items: center; column-gap: 9px; }
  .metric-grid .metric-card:last-child .metric-icon { grid-row: 1 / 3; margin: 0; }
  .metric-grid .metric-card:last-child .metric-label { align-self: end; }
  .metric-grid .metric-card:last-child strong { grid-column: 3; grid-row: 1 / 3; margin: 0; font-size: 17px; }
  .metric-grid .metric-card:last-child small { align-self: start; }
  .metric-card strong { font-size: 17px; }
  .dashboard-grid { gap: 10px; margin-top: 10px; }
  .panel { padding: 15px; border-radius: 14px; }
  .panel-heading { gap: 7px; }
  .panel-heading h3 { font-size: 12px; }
  .panel-heading p { font-size: 9px; }
  .chart-legend { max-width: 100px; display: grid; gap: 5px; font-size: 8px; }
  .chart-wrap { grid-template-columns: 23px 1fr; margin-top: 15px; }
  .chart { height: 145px; gap: 3px; }
  .barset { height: 119px; gap: 2px; }
  .chart-y-labels { height: 145px; font-size: 7px; }
  .chart-month { font-size: 7px; }
  .recent-panel { margin-top: 10px; }
  .page-intro { margin: 7px 0 15px; }
  .page-intro h2 { font-size: 21px; }
  .page-intro p { font-size: 10px; }
  .page-intro-row { align-items: flex-start; }
  .page-intro-row > .button { min-height: 36px; padding: 0 10px; font-size: 10px; }
  .filter-row { flex-direction: column; }
  .search-field { max-width: none; }
  .filter-row select { width: 100%; }
  .transaction-row { gap: 8px; padding: 10px 0; }
  .transaction-icon { width: 31px; height: 31px; }
  .transaction-copy strong { font-size: 10px; }
  .transaction-copy small { font-size: 8px; }
  .transaction-amount { gap: 5px; font-size: 9px; }
  .row-actions { gap: 2px; }
  .tiny-button { width: 24px; height: 24px; }
  .achievement-grid { grid-template-columns: 1fr; gap: 7px; }
  .achievement-card { padding: 11px; }
  .bill-summary-row { grid-template-columns: 1fr; gap: 8px; margin: 12px 0; }
  .bill-summary-row .metric-card { min-height: 91px; }
  .bill-row { gap: 7px; }
  .bill-date { width: 36px; }
  .bill-row .button { min-height: 30px; padding: 0 8px; font-size: 9px; }
  .bill-status { display: none; }
  .account-grid { gap: 9px; }
  .inline-form { align-items: stretch; flex-direction: column; gap: 0; }
  .inline-form .button { width: 100%; margin: 0 0 10px; }
  .financial-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 8px; }
  .financial-grid .field > span { font-size: 8px; letter-spacing: .6px; }
  .financial-panel .panel-heading { align-items: flex-start; flex-direction: column; }
  .theme-options { display: grid; grid-template-columns: 1fr 1fr; }
  .theme-option { min-width: 0; }
  .mobile-nav { position: fixed; z-index: 30; right: 9px; bottom: calc(7px + env(safe-area-inset-bottom)); left: 9px; display: grid; grid-template-columns: repeat(5, 1fr); padding: 7px 5px 5px; border: 1px solid rgb(222 229 220 / 92%); border-radius: 18px; background: rgb(255 255 255 / 95%); box-shadow: 0 8px 25px rgb(22 48 38 / 12%); backdrop-filter: blur(16px); }
  .mobile-nav button { min-height: 49px; display: grid; place-items: center; gap: 0; border: 0; border-radius: 12px; color: #87948c; background: transparent; }
  .mobile-nav button span { font-size: 19px; line-height: 1; }
  .mobile-nav button small { font-size: 8px; font-weight: 700; }
  .mobile-nav button.active { color: var(--green); background: transparent; }
  .mobile-nav button.active span { width: 32px; height: 26px; display: grid; place-items: center; border-radius: 9px; color: white; background: var(--green); }
  .modal-backdrop { align-items: end; padding: 10px; }
  .modal-card { max-height: calc(91vh - env(safe-area-inset-bottom)); padding: 18px; border-radius: 20px 20px 14px 14px; }
  .toast { right: 12px; bottom: calc(84px + env(safe-area-inset-bottom)); left: 12px; max-width: none; text-align: center; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
