/* Ritmo: composição comum e adaptação dos componentes existentes. */
:root { --font-body: 16px; --font-control: 15px; --font-label: 14px; --font-caption: 13px; --control-height: 44px; }
body { font-size: var(--font-body); }
a { text-underline-offset: 3px; }
button, input, select { accent-color: var(--accent); }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.navbar { background: var(--accent); border: 0; color: #fff; }
.navbar-inner { max-width: 1296px; height: 88px; gap: 26px; padding: 0 28px; }
.brand { font-size: 25px; font-weight: 740; letter-spacing: -.035em; gap: 10px; }
.brand-mark { background: #edc45b; color: #25413c; border-radius: 7px; width: 32px; height: 33px; font-size: 23px; font-weight: 650; }
.nav-links { gap: 3px; }
.nav-link { color: #e2eeeb; padding: 11px 12px; font-size: 14px; font-weight: 500; }
.nav-link.active, .nav-link:hover { background: rgba(255,255,255,.14); color: #fff; }
.navbar .btn-primary { background: #edc45b; color: #25413c; border-color: transparent; }
.navbar a:focus-visible, .navbar button:focus-visible { outline-color: #edc45b; }
.navbar .sync-pill { background: transparent; color: #e2eeeb; border-color: rgba(255,255,255,.25); font-size: 13px; }
.navbar .sync-dot { background: #dce9bc; box-shadow: none; }
.navbar .sync-dot-off { background: #edc45b; }
.avatar { border-left-color: rgba(255,255,255,.2); padding-left: 18px; }
.avatar-toggle { display: flex; align-items: center; gap: 10px; background: none; border: 0; color: #fff; padding: 0; text-align: left; }
.avatar-circle { background: #d8eae7; color: var(--accent); width: 32px; height: 32px; font-size: 14px; }
.avatar-name { color: #fff; font-size: 14px; }
.avatar-role { color: #e2eeeb; font-size: 13px; }
.avatar-menu { color: var(--text-primary); box-shadow: 0 8px 28px rgba(21,56,54,.14); z-index: 40; }
.ritmo-context { display: flex; justify-content: space-between; align-items: center; max-width: 1240px; min-height: 65px; margin: 0 auto; border-bottom: 1px solid var(--border); font-size: 14px; color: var(--text-muted); }
.ritmo-context strong { font-weight: 600; color: var(--text-primary); }
.ritmo-context a { font-size: 14px; }
.context-divider { margin: 0 12px; color: var(--border-strong); }
.page { max-width: 1296px; padding: 34px 28px 64px; }
.page-title { font-size: 32px; font-weight: 630; line-height: 1.2; letter-spacing: -.035em; }
.page-header { margin-bottom: 26px; }
.page-sub { font-size: 15px; line-height: 1.65; max-width: 65ch; }
.eyebrow { display: none; }
.btn { border-radius: 6px; min-height: var(--control-height); padding: 10px 16px; font: inherit; font-size: var(--font-control); line-height: 1.4; font-weight: 580; text-align: center; text-decoration: none; justify-content: center; }
.btn-sm { min-height: 44px; padding: 8px 12px; font-size: 14px; }
.btn:active { transform: none; }
.btn-ghost { background: transparent; }
.btn-danger-ghost:hover { background: #f4d9d7; }
.icon-btn { min-height: 44px; min-width: 44px; border-radius: 6px; }
.card { border: 0; border-radius: 12px; padding: 25px; }
.summary-grid { display: flex; flex-wrap: wrap; gap: 36px; margin-bottom: 26px; border-block: 1px solid var(--border); padding: 18px 0; }
.summary-grid .summary-card { border: 0; padding: 0; background: none; border-radius: 0; min-width: 130px; }
.summary-icon { display: none; }
.summary-label { font-size: 14px; font-weight: 450; text-transform: none; letter-spacing: normal; margin-bottom: 4px; }
.summary-value { font-size: 22px; font-weight: 610; letter-spacing: -.02em; }
.field-label { font-size: var(--font-label); font-weight: 550; text-transform: none; letter-spacing: normal; color: var(--text-primary); }
.field-input { background-color: var(--surface); min-height: 44px; padding: 11px 12px; font-size: 16px; border-color: var(--border); }
.field-input::placeholder { color: var(--text-muted); opacity: 1; }
.input-suffix { background: var(--surface); border-color: var(--border); }
.input-suffix input { min-height: 44px; font-size: 16px; }
.field-hint { font-size: 14px; line-height: 1.6; }
.badge, .tag-pill, .cat-pill { font-size: 13px; font-weight: 550; border-radius: 4px; }
.badge-paid, .badge-ok { background: #e8f2eb; color: #226345; }
.spinner { border-color: #a7bfba; border-top-color: currentColor; }
.modal { box-shadow: 0 20px 65px rgba(21,56,54,.2); border: 0; }
.modal-header { padding: 22px 24px 16px; border-bottom: 1px solid var(--border); }
.modal-header h2 { font-size: 20px; font-weight: 600; }
.modal-body { padding: 22px 24px; gap: 18px; }
.modal-footer { padding: 17px 24px; flex-wrap: wrap; }
.modal-close { width: 44px; height: 44px; flex-shrink: 0; }
.modal-overlay { background: rgba(14,39,40,.48); }
.date-picker-panel, .split-dropdown { box-shadow: 0 10px 30px rgba(21,56,54,.16); }
.va-tour-tooltip { box-shadow: 0 12px 35px rgba(21,56,54,.2); }
.va-tour-exit { font-size: 14px; min-height: 30px; }
.bottom-nav { display: none; }
.mobile-nav-drawer { background: var(--surface); color: var(--text-primary); }
.mobile-nav-drawer .brand-mark { background: #edc45b; }
.mobile-nav-link { font-size: 16px; min-height: 44px; font-weight: 500; }
.mobile-nav-link.active { background: var(--accent-soft); color: var(--accent); font-weight: 650; }

/* Agenda: a lista usa os mesmos dados e formulários do calendário. */
.ritmo-agenda-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 22px; }
.agenda-view-switch { display: inline-flex; background: var(--surface-2); border-radius: 6px; padding: 3px; gap: 3px; }
.agenda-view-switch button { border: 0; background: transparent; color: var(--text-secondary); padding: 8px 15px; font: inherit; font-size: 14px; border-radius: 4px; min-height: 44px; }
.agenda-view-switch button[aria-pressed=true] { background: var(--surface); color: var(--text-primary); box-shadow: 0 2px 5px rgba(21,56,54,.08); }
.cal-layout { grid-template-columns: minmax(0,1fr) 360px; grid-template-areas: "list calendar" "list detail"; gap: 24px 28px; }
.ritmo-agenda-list { grid-area: list; min-width: 0; padding: 10px 30px; }
.cal-card { grid-area: calendar; min-width: 0; }
.ritmo-day-detail { grid-area: detail; min-width: 0; }
.cal-layout[data-view=calendar] { grid-template-areas: "calendar detail"; grid-template-columns: minmax(0,1fr) 320px; }
.cal-layout[data-view=calendar] .ritmo-agenda-list { display: none; }
.cal-layout[data-view=list] .cal-card { padding: 20px; }
.cal-layout[data-view=list] .cal-card .page-header { gap: 6px; margin-bottom: 15px; }
.cal-layout[data-view=list] .cal-card .page-header h2 { display: none; }
.cal-layout[data-view=list] .month-nav { justify-content: space-between; width: 100%; gap: 5px; }
.cal-layout[data-view=list] .month-nav-label { min-width: 0; font-size: 14px; }
.cal-layout[data-view=list] .cal-day-legend { display: none; }
.cal-layout[data-view=list] .cal-cell { height: 31px; border: 0; padding: 4px; border-radius: 50%; background: none; align-items: center; justify-content: center; }
.cal-layout[data-view=list] .cal-chip, .cal-layout[data-view=list] .cal-more { display: none; }
.cal-layout[data-view=list] .cal-cell { position: relative; }
.cal-layout[data-view=list] .cal-cell.has-expenses::after { content: ''; position: absolute; bottom: 1px; width: 3px; height: 3px; border-radius: 50%; background: var(--accent); }
.cal-layout[data-view=list] .cal-cell.has-expenses.is-selected::after { background: white; }
.cal-layout[data-view=list] .cal-cell.is-selected { background: var(--accent); color: white; }
.cal-layout[data-view=list] .cal-cell.is-selected .cal-date { color: white; }
.cal-weekday { font-size: 13px; font-weight: 550; letter-spacing: normal; text-transform: none; }
.cal-cell { background: var(--surface-3); border-radius: 6px; }
.cal-chip { font-size: 13px; }
.cal-chip-bell { background: transparent; }
.ritmo-day-group { display: grid; grid-template-columns: 75px minmax(0,1fr); gap: 25px; padding: 26px 0; border-bottom: 1px solid var(--border); }
.ritmo-day-group:last-child { border: 0; }
.ritmo-day-stamp { font-size: 14px; color: var(--text-muted); }
.ritmo-day-stamp strong { display: block; font-size: 31px; font-weight: 550; color: var(--text-primary); line-height: 1.3; }
.ritmo-day-stamp small { display: block; color: var(--accent); font-size: 13px; margin-top: 5px; }
.ritmo-list-row { display: flex; align-items: center; gap: 15px; width: 100%; border: 0; border-bottom: 1px solid var(--border); background: none; color: var(--text-primary); font: inherit; text-align: left; padding: 18px 0; cursor: pointer; }
.ritmo-list-row:first-child { padding-top: 7px; }
.ritmo-list-row:last-child { border: 0; padding-bottom: 5px; }
.ritmo-list-icon { display: grid; place-items: center; width: 36px; height: 36px; background: var(--surface-2); border-radius: 9px; color: var(--accent); flex-shrink: 0; }
.ritmo-list-main { flex: 1; min-width: 0; }
.ritmo-list-main strong { display: block; font-size: 16px; font-weight: 580; overflow-wrap: anywhere; }
.ritmo-list-main small { display: block; font-size: 14px; color: var(--text-muted); margin-top: 5px; }
.ritmo-list-value { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex-shrink: 0; font-size: 16px; }
.ritmo-list-value strong { font-weight: 630; font-variant-numeric: tabular-nums; }
.ritmo-list-row.is-paid .ritmo-list-main strong { text-decoration: line-through; color: var(--text-muted); }
.ritmo-list-row:hover .ritmo-list-main strong { color: var(--accent); }
.ritmo-agenda-empty { padding: 45px 10px; text-align: center; color: var(--text-muted); }
.ritmo-agenda-empty h2 { font-size: 19px; font-weight: 600; color: var(--text-primary); }
.ritmo-agenda-empty p { font-size: 15px; max-width: 42ch; margin: 10px auto 22px; }
.event-card { border-inline: 0; border-radius: 0; }
.event-card-list { gap: 0; }
.event-card-row { padding: 15px 0; }
.event-card-body-inner { padding: 15px 0; }
.event-card-title, .event-card-amount { font-size: 15px; font-weight: 580; }
.detail-count, .legend-title { text-transform: none; letter-spacing: normal; font-size: 14px; font-weight: 500; }

/* Telas de consulta: superfície única, valores e contexto separados. */
.expense-table th { background: var(--surface-2); text-transform: none; letter-spacing: normal; font-size: 14px; font-weight: 550; }
.expense-table td { padding-block: 17px; font-size: 15px; }
.history-section { background: var(--surface); border-radius: 12px; padding: 24px; }
.import-card { background: var(--surface-2); border-radius: 8px; padding: 20px 24px; }
.multi-filter-menu { box-shadow: 0 12px 30px rgba(21,56,54,.16); }
.cell-cat { color: var(--text-primary); }
.cat-budget-label, .cat-budget-value { font-size: 14px; }
.repasse-layout { grid-template-columns: 255px minmax(0,1fr); gap: 26px; }
.repasse-connection.is-active { box-shadow: none; background: var(--accent-soft); border-color: var(--accent); }
.repasse-connection { grid-template-columns: 40px minmax(0,1fr); }
.repasse-connection-name { white-space: normal; overflow-wrap: anywhere; }
.repasse-connection-value { grid-column: 2; display: flex; align-items: baseline; gap: 5px; text-align: left; }
.repasse-avatar, .repasse-avatar.tone-1, .repasse-avatar.tone-2 { color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.repasse-send { color: var(--danger); }
.repasse-connection-meta, .repasse-connection-value, .repasse-connection-value strong, .repasse-detail-status, .repasse-explanation { font-size: 13px; }
.repasse-detail { background: transparent; overflow: visible; }
.repasse-detail-head { border: 0; padding: 0 0 24px; }
.repasse-detail-body { padding: 0; }
.repasse-month-note { background: var(--accent-soft); color: var(--accent); border: 0; border-radius: 4px; font-size: 13px; }
.repasse-totals { grid-template-columns: 1fr 1fr; padding: 24px; background: var(--accent); color: white; border-radius: 12px; gap: 18px 28px; }
.repasse-total { border: 0; padding: 0; background: transparent; }
.repasse-total-label { color: #e2eeeb; font-size: 14px; text-transform: none; letter-spacing: normal; font-weight: 450; }
.repasse-total-value { font-size: 21px; font-weight: 580; }
.repasse-total.is-result, .repasse-total.is-result.is-send, .repasse-total.is-result.is-even { grid-column: 1 / -1; background: transparent; border: 0; border-top: 1px solid rgba(255,255,255,.25); padding-top: 17px; }
.repasse-total.is-result .repasse-total-value, .repasse-total.is-result.is-send .repasse-total-value, .repasse-total.is-result.is-even .repasse-total-value { color: white; font-size: 20px; font-weight: 550; }
.repasse-expenses { border: 0; background: var(--surface); border-radius: 12px; }
.repasse-expenses-head { background: transparent; padding: 17px 20px; }
.fuel-history-row { padding: 17px 20px; }
.fuel-history-meta, .repasse-expense-date, .repasse-expense-payer { font-size: 14px; }
.fuel-history-title, .fuel-history-cost { font-size: 15px; font-weight: 600; }
.repasse-settlement { border: 0; background: var(--surface-2); padding: 17px; }
.repasse-settlement-copy strong, .repasse-settlement-copy span { font-size: 14px; }
.repasse-explanation { border: 0; background: var(--surface-2); }
.repasse-expense-count { font-size: 14px; }
.fuel-result-card, .fuel-result-card.is-ready { background: var(--accent); border: 0; color: white; }
.fuel-result-card .fuel-result-status, .fuel-result-card.is-ready .fuel-result-status, .fuel-result-card.is-ready .fuel-result-cost, .fuel-result-card .fuel-result-note, .fuel-result-card .fuel-result-stat span { color: #e2eeeb; }
.fuel-result-card .fuel-result-cost { color: white; font-weight: 580; }
.fuel-result-card .fuel-result-stat { background: transparent; border: 0; border-top: 1px solid rgba(255,255,255,.25); border-radius: 0; padding-inline: 0; }
.fuel-result-card .fuel-result-stat strong { color: white; }
.fuel-result-card .btn-primary { background: white; color: var(--accent); }
.fuel-history-cost { color: var(--accent); }
.fuel-history-card .fuel-history-row { padding-inline: 0; }
.profile-section-title { font-weight: 600; font-size: 18px; }
.profile-section-caption { line-height: 1.7; font-size: 15px; }
.fuel-result-stat span, .fuel-result-status { font-size: 14px; text-transform: none; letter-spacing: normal; font-weight: 450; }
.fuel-option-detail { font-size: 13px; }
.expense-stack, .expense-stack>.card, .table-wrap { min-width: 0; max-width: 100%; }
.expense-stack>.card { width: 100%; }
.table-wrap { position: relative; }
.import-intro { display: flex; align-items: center; gap: 22px; background: var(--surface-2); border-radius: 8px; }
.import-intro .section-head { flex: 1; margin: 0; }
.import-intro .section-caption { max-width: 65ch; font-size: 14px; }
.import-intro .btn { flex-shrink: 0; }
.filter-expand { display: none; }
.cat-grid { display: block; padding: 0 25px; background: var(--surface); border-radius: 12px; }
.cat-grid>[data-cat-card] { display: grid; grid-template-columns: minmax(200px,.8fr) minmax(0,1.6fr); gap: 10px 40px; padding: 25px 0; border-radius: 0; border-bottom: 1px solid var(--border); }
.cat-grid>[data-cat-card]:last-child { border-bottom: 0; }
.cat-card-top { grid-column: 1; grid-row: 1 / 4; margin: 0; }
.cat-card-name { font-weight: 580; }
.cat-amounts { grid-column: 2; grid-row: 1; margin: 0; justify-content: space-between; font-size: 14px; }
.cat-spent { font-size: 17px; font-weight: 600; }
.cat-bar-track { grid-column: 2; grid-row: 2; height: 5px; margin: 0; }
.cat-card-footer { grid-column: 2; grid-row: 3; flex-wrap: wrap; }
.cat-budget-edit { grid-column: 2; grid-row: 1; flex-wrap: wrap; margin: 0; }
.cat-edit-btn { min-width: 44px; min-height: 44px; }
.repasse-expenses .fuel-history-row { grid-template-columns: 70px minmax(0,1fr) 110px 95px auto; }

/* Autenticação segue a mesma identidade, sem alterar os formulários. */
.auth-shell { display: grid; grid-template-columns: 1fr 1fr; min-height: 100dvh; padding: 0; background: var(--surface); }
.auth-story { align-self: stretch; background: var(--accent); color: white; display: flex; flex-direction: column; justify-content: space-between; padding: 55px 12%; }
.auth-story .brand { color: white; text-decoration: none; }
.auth-story h2 { font-size: 36px; font-weight: 550; line-height: 1.25; letter-spacing: -.035em; max-width: 15ch; }
.auth-story p { font-size: 16px; color: #e2eeeb; max-width: 35ch; line-height: 1.75; }
.auth-story .auth-story-foot { font-size: 14px; }
.auth-card { width: 100%; max-width: 410px; justify-self: center; padding: 40px 25px; }
.auth-card>.card { padding: 0; }
.auth-brand { display: none; }
.auth-title { font-size: 28px; font-weight: 610; text-align: left; letter-spacing: -.03em; margin-bottom: 10px; }
.auth-sub { text-align: left; font-size: 15px; line-height: 1.6; margin-bottom: 30px; }
.auth-form { gap: 20px; }
.auth-check { font-size: 15px; }
.auth-links { font-size: 15px; }
.auth-footer { font-size: 14px; }

/* Mesma escala de leitura e área de ação em todas as telas. */
button, input, select, textarea { font-family: inherit; }
.section-caption, .empty-note, .toggle-row-label, .input-suffix span,
.cat-budget-label, .cat-budget-value, .cat-breakdown-amount,
.simple-row-sub, .fuel-tool-head p, .fuel-history-date, .fuel-history-count,
.fuel-result-note, .fuel-result-stat strong, .expense-origin, .cell-pay-sub,
.filter-status, .multi-filter-option, .repasse-archived summary,
.repasse-archived-link { font-size: var(--font-caption); line-height: 1.5; }
.cat-breakdown-name, .simple-row-title, .simple-row-amount,
.repasse-connection-name, .cell-pay-main { font-size: var(--font-control); line-height: 1.5; }
.cat-breakdown-pct, .results-meta, .file-picker-name { font-size: var(--font-caption); }
.cat-usage { font-size: var(--font-caption); color: var(--text-muted); }
.expense-table .expense-title { font-size: var(--font-control); }
.field-input, .input-suffix input, .table-input, .table-select { font-size: var(--font-body); height: auto; min-height: var(--control-height); }
.field-label { line-height: 1.5; }
.form-error, .auth-error, .auth-status { font-size: var(--font-label); line-height: 1.5; }
.split-dropdown-empty, .split-dropdown-option { font-size: var(--font-label); }
.split-dropdown-option { min-height: var(--control-height); }
.va-tour-tooltip h3 { font-size: 16px; }
.va-tour-tooltip p { font-size: 14px; }
.va-tour-exit { min-height: var(--control-height); }
.header-actions, .repasse-detail-actions, .fuel-actions, .filter-actions, .review-actions { align-items: stretch; flex-wrap: wrap; }
.page-header { align-items: center; }
.modal-footer { justify-content: flex-end; align-items: stretch; }
.modal-footer .btn { flex-shrink: 0; }
.avatar-toggle { min-width: var(--control-height); min-height: var(--control-height); justify-content: center; }
.sync-pill { min-height: var(--control-height); }
.month-nav-btn { width: var(--control-height); height: var(--control-height); flex-shrink: 0; }
.split-percent-remove, .stepper-btn { min-width: var(--control-height); min-height: var(--control-height); }
.stepper { min-height: var(--control-height); }
.icon-option { min-width: var(--control-height); min-height: var(--control-height); }
.multi-filter-option { min-height: var(--control-height); }
.bank-option { min-height: var(--control-height); font-size: var(--font-control); }
.btn > svg, .icon-btn > svg, .modal-close > svg, .month-nav-btn > svg,
.cat-edit-btn > svg, .nav-toggle > svg, .split-percent-remove > svg { display: block; flex: 0 0 20px; width: 20px; height: 20px; }
.navbar .sync-pill .nav-icon { display: none; }
.bottom-nav svg, .nav-icon { display: block; flex-shrink: 0; }
.cell-cat-icon { width: 32px; height: 32px; }
.cell-cat-icon svg, .simple-row-icon svg, .ritmo-list-icon svg,
.cat-card-icon svg, .icon-option svg { display: block; width: 20px; height: 20px; flex-shrink: 0; }
.cal-chip svg { display: block; flex-shrink: 0; }
.date-field-display { padding-right: 48px; }
.date-field-icon-btn { width: 44px; height: 44px; right: 0; }
.date-field-icon-btn svg { width: 20px; height: 20px; }
.date-picker-panel { width: 344px; max-width: calc(100vw - 36px); padding: 10px; }
.modal .date-picker-panel { max-width: 100%; }
.date-picker-panel .month-nav-btn { width: 44px; height: 44px; }
.date-picker-day { height: 44px; font-size: 14px; padding: 0; }
.date-picker-day.is-muted { opacity: 1; }
.date-picker-weekday { font-size: 13px; text-transform: none; }
.date-picker-link, .month-picker-cell { min-height: 44px; font-size: 14px; }
.cal-layout[data-view=list] .cal-cell { height: 44px; }
.cal-layout[data-view=list] .cal-grid, .cal-layout[data-view=list] .cal-weekdays { gap: 2px; }
.cal-date { font-size: 14px; }
.cal-cell.is-muted { opacity: 1; color: var(--text-muted); }
.detail-sub, .cal-more { font-size: 13px; }
.event-card-actions { flex-wrap: wrap; }
.event-card-actions .btn { font-size: 14px; min-width: 100px; white-space: normal; }
.cat-amounts .tabular { font-size: 17px; }
.repasse-avatar { font-size: 13px; }
.toggle-switch, .toggle-switch.is-on { width: 44px; height: 44px; border: 0; background: none; border-radius: 6px; }
.toggle-switch::before { content: ''; position: absolute; width: 34px; height: 20px; top: 12px; left: 5px; border: 1px solid var(--border-strong); border-radius: 999px; background: var(--surface-3); }
.toggle-switch.is-on::before { background: var(--accent-soft); border-color: var(--accent); }
.toggle-switch .knob { top: 15px; left: 8px; width: 14px; height: 14px; }
.toggle-switch.is-on .knob { transform: translateX(14px); }
.cal-layout[data-view=list] .month-nav { gap: 2px; }
.cal-layout[data-view=list] .month-nav-label { font-size: 14px; }
.cal-layout[data-view=list] .cal-card { padding-inline: 15px; }
.fuel-form-footer { align-items: flex-start; flex-wrap: wrap; }
.fuel-actions { margin-left: auto; }
.fuel-history-title { white-space: normal; overflow-wrap: anywhere; }
.fuel-history-row, .repasse-detail-title, .cat-breakdown-name { min-width: 0; }
.repasse-connection-value { flex-wrap: wrap; }
.split-percent-name, .split-percent-sign, .split-total-note { font-size: 14px; }
.repasse-detail-head { flex-wrap: wrap; }
.repasse-month-row { flex-wrap: wrap; gap: 12px; }
.cat-card-name { white-space: normal; overflow-wrap: anywhere; }
.cat-budget-edit .stepper { max-width: 100%; }

@media (max-width: 680px) {
  .header-actions .btn { flex: 1 1 150px; }
  .summary-value { font-size: 20px; }
  .history-table .expense-title { min-width: 0; }
  .fuel-actions { margin-left: 0; width: 100%; }
  .fuel-actions .btn { flex: 1 1 110px; }
  .split-percent-row { display: grid; grid-template-columns: minmax(0,1fr) auto 44px; gap: 8px; }
  .split-percent-name { grid-column: 1 / -1; }
  .split-percent-row > .stepper { justify-self: start; }
  .modal-footer .btn { flex: 1 1 120px; }
  .repasse-detail-actions .btn, .repasse-expenses-head .btn { font-size: 14px; }
}

@media (max-width: 1296px) {
  .ritmo-context { margin-inline: 28px; }
  .navbar-inner { gap: 18px; }
  .avatar-meta { display: none; }
}
@media (max-width: 1050px) {
  .navbar .sync-pill-label { display: none; }
  .navbar .sync-pill { position: relative; width: 44px; padding: 0; justify-content: center; }
  .navbar .sync-pill .nav-icon { display: block; }
  .navbar .sync-pill .sync-dot { position: absolute; top: 6px; right: 5px; width: 5px; height: 5px; }
  .nav-link { padding-inline: 9px; }
  .repasse-layout { grid-template-columns: 1fr; }
  .repasse-connection-list { display: grid; grid-auto-flow: column; grid-auto-columns: 250px; overflow-x: auto; }
  .repasse-detail-head { padding-top: 8px; }
  .filter-bar { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .cat-grid>[data-cat-card] { grid-template-columns: minmax(150px,1fr) minmax(150px,1.1fr); }
  .cat-card-footer { grid-column: 2; grid-row: 3; }
  .cat-budget-edit { grid-column: 2; }
}
@media (max-width: 920px) {
  .cal-layout { grid-template-columns: minmax(0,1fr); grid-template-areas: "list" "calendar" "detail"; gap: 20px; }
  .cal-layout[data-view=calendar] { grid-template-columns: minmax(0,1fr); grid-template-areas: "calendar" "detail"; }
  .cal-layout[data-view=list] .ritmo-day-group { grid-template-columns: 55px minmax(0,1fr); gap: 15px; }
  .ritmo-agenda-list { padding-inline: 22px; }
}
@media (max-width: 1050px) {
  .nav-toggle { display: flex; color: white; border-color: rgba(255,255,255,.3); min-width: 44px; min-height: 44px; }
  .nav-links { display: none; }
  .mobile-nav-overlay:not([hidden]) { display: block; }
  .navbar-inner { height: 72px; }
}
@media (max-width: 680px) {
  .navbar-inner { min-height: 64px; height: auto; padding: 14px 18px; gap: 12px; }
  .brand, .brand span:last-child { display: flex; font-size: 23px; }
  .brand-mark { width: 29px; height: 30px; }
  .nav-toggle { color: white; border-color: rgba(255,255,255,.3); min-width: 44px; min-height: 44px; }
  .navbar-right { margin-left: auto; gap: 10px; }
  .navbar-right>.btn { display: none; }
  .avatar { border: 0; padding-left: 0; }
  .ritmo-context { margin-inline: 18px; min-height: 45px; font-size: 13px; gap: 12px; }
  .ritmo-context a { font-size: 13px; white-space: nowrap; }
  .context-divider { margin-inline: 7px; }
  .page { padding: 25px 18px 110px; }
  .page-title { font-size: 27px; }
  .page-header { align-items: flex-start; margin-bottom: 24px; gap: 13px; }
  .page-sub { font-size: 14px; }
  .header-actions { flex-wrap: wrap; }
  .header-actions .btn { font-size: 14px; }
  .summary-grid { gap: 18px; justify-content: space-between; flex-wrap: wrap; padding-block: 15px; }
  .summary-grid .summary-card { min-width: 120px; flex: 1; }
  .summary-label { font-size: 13px; }
  .summary-value { font-size: 20px; }
  .card { padding: 20px 17px; }
  .field-input, .input-suffix input, .stepper-input { font-size: 16px; }
  .bottom-nav { display: flex; position: fixed; bottom: 0; inset-inline: 0; z-index: 35; justify-content: space-around; padding: 8px 6px max(8px, env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--border); }
  .bottom-nav a, .bottom-nav button { min-width: 52px; min-height: 45px; display: flex; flex-direction: column; align-items: center; gap: 4px; text-decoration: none; background: none; border: 0; color: var(--text-muted); font-size: 13px; padding: 3px 6px; }
  .bottom-nav [aria-current=page] { color: var(--accent); font-weight: 650; }
  .mobile-nav-overlay { z-index: 70; }
  .mobile-nav-drawer { width: min(330px, calc(100vw - 35px)); padding-bottom: max(25px, env(safe-area-inset-bottom)); }
  .ritmo-agenda-toolbar { flex-wrap: wrap; gap: 14px; }
  .month-nav-label { font-size: 16px; min-width: 0; }
  .month-nav-btn { width: 44px; height: 44px; }
  .cal-layout, .cal-layout[data-view=calendar] { display: flex; flex-direction: column; gap: 20px; }
  .cal-layout>* { width: 100%; }
  .cal-layout[data-view=list] .cal-card, .cal-layout[data-view=list] .ritmo-day-detail { display: none; }
  .cal-layout[data-view=calendar] .cal-card { padding: 17px 10px; }
  .cal-layout[data-view=calendar] .cal-cell { height: 64px; }
  .cal-layout[data-view=calendar] .cal-card>.page-header h2 { display: none; }
  .cal-layout[data-view=calendar] .month-nav { justify-content: space-between; width: 100%; }
  .cal-chip-label { font-size: 13px; }
  .cal-chip-bell { display: none; }
  .ritmo-day-group, .cal-layout[data-view=list] .ritmo-day-group { display: block; padding-block: 20px; }
  .ritmo-day-stamp { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
  .ritmo-day-stamp strong { font-size: 16px; font-weight: 650; }
  .ritmo-day-stamp small { margin: 0; }
  .ritmo-list-row { gap: 12px; padding-block: 16px; }
  .ritmo-list-icon { display: none; }
  .ritmo-list-main strong { font-size: 15px; }
  .ritmo-list-main small { font-size: 13px; }
  .ritmo-list-value { font-size: 15px; }
  .modal-overlay { padding: 12px; z-index: 80; }
  .modal { max-height: calc(100dvh - 24px); }
  .modal.modal-lg { height: min(720px, calc(100dvh - 24px)); }
  .modal-header { padding: 17px 18px; }
  .modal-body { padding: 20px 18px; }
  .modal-footer { padding: 14px 18px; gap: 8px; }
  .history-section { padding: 20px 0; }
  .import-intro { flex-wrap: wrap; padding: 18px; gap: 15px; }
  .import-intro .section-head { flex-basis: 100%; }
  .filter-expand { display: inline-flex; }
  #expense-filter-form { display: grid; grid-template-columns: minmax(0,1fr); }
  #expense-filter-form[data-expanded=false]>:not(:first-child) { display: none; }
  #expense-filter-form .filter-actions, #expense-filter-form .filter-date-range { grid-column: 1; }
  .cat-grid { padding-inline: 17px; }
  .cat-grid>[data-cat-card] { display: flex; flex-direction: column; gap: 13px; padding-block: 23px; }
  .cat-card-top { width: 100%; }
  .cat-amounts { justify-content: space-between; }
  .cat-budget-edit { width: 100%; }
  .history-section>.section-head, .history-section>.results-meta, .history-section>.filters { margin-inline: 17px; }
  .history-table, .history-table tbody { display: block; width: 100%; min-width: 0; }
  .history-table thead { display: none; }
  .history-table tr { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 6px 12px; padding: 17px; border-bottom: 1px solid var(--border); }
  .history-table td { border: 0; padding: 0; font-size: 14px; min-width: 0; }
  .history-table td:nth-child(2) { grid-column: 1; grid-row: 1; }
  .history-table td:nth-child(3) { grid-column: 1; grid-row: 2; }
  .history-table td:nth-child(4) { grid-column: 1; grid-row: 3; }
  .history-table .date { grid-column: 1; grid-row: 4; font-size: 13px; }
  .history-table .amount { grid-column: 2; grid-row: 1; font-weight: 650; white-space: nowrap; }
  .history-table .expense-actions { grid-column: 2; grid-row: 2 / 5; align-self: center; }
  .history-table .cell-pay { flex-wrap: wrap; }
  .history-table .expense-title { white-space: normal; overflow-wrap: anywhere; }
  .repasse-connections, .repasse-detail { margin-inline: 0; border-radius: 12px; }
  .repasse-detail-head { padding: 0 0 20px; flex-wrap: wrap; }
  .repasse-detail-actions { margin-left: 0; flex-basis: 100%; }
  .repasse-detail-actions .btn { font-size: 14px; width: auto; padding: 8px 12px; }
  .repasse-detail-actions .btn::after { content: none; }
  .repasse-detail-body { padding: 0; }
  .repasse-totals { grid-template-columns: 1fr 1fr; padding: 22px; }
  .repasse-total.is-result { grid-column: 1 / -1; }
  .repasse-expenses-head { flex-wrap: wrap; padding-inline: 17px; }
  .repasse-expenses-head h3 { flex: auto; font-size: 16px; }
  .repasse-expenses-head .btn { font-size: 14px; }
  .repasse-expenses .fuel-history-row { grid-template-columns: minmax(0,1fr) auto; padding: 18px 17px; gap: 8px 14px; }
  .repasse-expense-date { grid-column: 1; grid-row: 4; font-size: 13px; }
  .repasse-expenses .fuel-history-main { grid-column: 1; grid-row: 1; }
  .repasse-expenses .fuel-history-title { white-space: normal; overflow-wrap: anywhere; }
  .repasse-expense-payer { display: flex; grid-column: 1; grid-row: 2; font-size: 13px; }
  .repasse-expenses .fuel-history-cost { grid-column: 2; grid-row: 1; }
  .repasse-row-actions { display: flex; flex-wrap: wrap; grid-column: 2; grid-row: 2 / 5; justify-content: flex-end; max-width: 96px; }
  .repasse-row-actions .icon-btn { width: 44px; min-width: 44px; min-height: 44px; }
  .repasse-settlement { align-items: flex-start; }
  .repasse-settlement-copy span { font-size: 13px; }
  .repasse-connections-divider, .repasse-archived { display: block; }
  .auth-shell { display: flex; min-height: 100dvh; background: var(--bg); padding: 35px 24px; }
  .auth-story { display: none; }
  .auth-card { max-width: 380px; padding: 0; }
  .auth-brand { display: flex; justify-content: flex-start; margin-bottom: 38px; font-size: 25px; letter-spacing: -.035em; }
  .auth-title { font-size: 27px; }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}
