:root {
  --ink: #20202a;
  --muted: #74717e;
  --line: #e8e4ec;
  --surface: #ffffff;
  --surface-alt: #f7f4f8;
  --canvas: #f1edf3;
  --primary: #6f4a78;
  --primary-dark: #52345a;
  --primary-soft: #eee5f0;
  --teal: #2f766f;
  --rose: #a04f6e;
  --amber: #9b6a23;
  --danger: #a53a45;
  --shadow: 0 18px 45px rgba(55, 36, 61, 0.09);
  --radius: 18px;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--canvas); }
body {
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 250px minmax(0, 1fr); }
.sidebar {
  position: sticky; top: 0; height: 100vh; padding: 28px 20px;
  background: #25222a; color: white; display: flex; flex-direction: column; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 28px; }
.brand-copy { min-width: 0; }
.sidebar-close { display: none; margin-left: auto; color: #d8d1dc; background: rgba(255,255,255,.08); flex: 0 0 auto; }
.sidebar-close:hover { color: white; background: rgba(255,255,255,.14); }
.brand-mark {
  width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center;
  background: linear-gradient(145deg, #a579ab, #694170); color: white; font-weight: 800; letter-spacing: .04em;
}
.brand strong, .brand span { display: block; }
.brand strong { font-size: 15px; }
.brand span { color: #aaa3af; font-size: 12px; margin-top: 2px; }
.nav { display: grid; gap: 5px; }
.nav-item {
  border: 0; background: transparent; color: #c7c1cb; padding: 11px 12px; border-radius: 11px;
  display: flex; width: 100%; align-items: center; gap: 11px; text-align: left; text-decoration: none; transition: .18s ease;
}
.nav-item span { width: 19px; text-align: center; font-size: 17px; }
.nav-item:hover { color: white; background: #302c34; }
.nav-item.active { color: white; background: #6e4a76; box-shadow: inset 0 0 0 1px rgba(255,255,255,.06); }
.nav { min-height: 0; overflow-y: auto; }
.nav-more { margin-top: 7px; border-top: 1px solid rgba(255,255,255,.12); padding-top: 7px; }
.nav-more summary { display: flex; align-items: center; gap: 11px; padding: 11px 12px; border-radius: 11px; color: #c7c1cb; cursor: pointer; list-style: none; }
.nav-more summary::-webkit-details-marker { display: none; }
.nav-more summary span { width: 19px; text-align: center; font-size: 18px; }
.nav-more summary:hover, .nav-more:has(.nav-item.active) summary { color: white; background: #302c34; }
.nav-more summary:focus-visible, .nav-item:focus-visible { outline: 2px solid #d5a8df; outline-offset: 2px; }
.nav-more-items { display: grid; gap: 3px; padding: 5px 0 0 10px; }
.nb-d-weekly .panel-title { gap: 14px; flex-wrap: wrap; }
.nb-d-weekly-comparison { margin: 15px 0 0; padding-top: 13px; border-top: 1px solid var(--line); color: var(--muted); font-size: .82rem; line-height: 1.5; }
.reminder-options { display: grid; gap: 11px; margin: 14px 0 0; padding: 0; border: 0; }
.reminder-options label { display: flex; align-items: center; gap: 8px; font-size: .83rem; line-height: 1.4; }
.reminder-options input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--primary); }
.reminder-options select { min-height: 34px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); }
.nb-d-reminders { display: grid; gap: 7px; margin-top: 15px; padding-top: 13px; border-top: 1px solid var(--line); }
.nb-d-reminders strong { font-size: .8rem; }
.nb-d-reminders p { margin: 0; font-size: .8rem; line-height: 1.45; }
.accounts-react-frame {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 0;
  background: #f7f4f8;
}

body:has(.accounts-react-frame) {
  overflow: hidden;
}

body:has(.accounts-react-frame) .workspace {
  display: flex;
  height: 100dvh;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
}

body:has(.accounts-react-frame) .topbar {
  flex: 0 0 auto;
}

body:has(.accounts-react-frame) .main-content {
  width: 100%;
  max-width: none;
  min-height: 0;
  flex: 1 1 auto;
  margin: 0;
  padding: 0;
  overflow: hidden;
}
.sidebar-foot { margin-top: auto; padding: 18px 8px 2px; color: #9f98a4; }
.sidebar-foot small { display: block; margin-top: 8px; line-height: 1.5; }
.local-pill { display: flex; gap: 8px; align-items: center; color: #d9d3dc; font-size: 12px; }
.local-pill span { width: 8px; height: 8px; border-radius: 50%; background: #71b7a4; box-shadow: 0 0 0 4px rgba(113,183,164,.12); }

.workspace { min-width: 0; }
.topbar {
  min-height: 102px; padding: 22px 34px; background: rgba(247,244,248,.92); backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 20px; position: sticky; top: 0; z-index: 10;
}
.page-heading { min-width: 210px; margin-right: auto; }
.page-heading p { margin: 0 0 3px; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.page-heading h1 { margin: 0; font-family: Georgia, 'Times New Roman', serif; font-size: clamp(24px, 3vw, 34px); font-weight: 500; }
.top-actions { display: flex; align-items: end; gap: 10px; }
.filter-control { display: grid; gap: 4px; color: var(--muted); font-size: 11px; font-weight: 700; }
.filter-control select { min-width: 132px; }
select, input, textarea {
  border: 1px solid #dcd6df; background: white; color: var(--ink); border-radius: 10px; padding: 10px 11px; outline: none;
}
select:focus, input:focus, textarea:focus { border-color: #8c6594; box-shadow: 0 0 0 3px rgba(111,74,120,.1); }
textarea { resize: vertical; min-height: 92px; }
.primary-button, .secondary-button, .danger-button, .icon-button {
  border: 0; border-radius: 10px; min-height: 40px; padding: 0 15px; font-weight: 750;
}
.primary-button { background: var(--primary); color: white; box-shadow: 0 7px 16px rgba(111,74,120,.16); }
.primary-button:hover { background: var(--primary-dark); }
.secondary-button { background: #eee9f0; color: #514b55; }
.danger-button { color: var(--danger); background: #f7e7e9; }
.icon-button { width: 39px; padding: 0; background: transparent; color: var(--muted); font-size: 22px; }
.mobile-menu { display: none; }
.reset-filters { white-space: nowrap; }

.main-content { padding: 30px 34px 54px; max-width: 1600px; margin: 0 auto; }
.loading-card, .empty-state {
  padding: 55px 25px; text-align: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); color: var(--muted);
}
.section-stack { display: grid; gap: 26px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; }
.section-head h2, .section-head h3 { margin: 0; font-family: Georgia, 'Times New Roman', serif; font-weight: 500; }
.section-head h2 { font-size: 25px; }
.section-head h3 { font-size: 21px; }
.section-head p { margin: 5px 0 0; color: var(--muted); max-width: 720px; line-height: 1.55; }
.text-button { border: 0; background: transparent; color: var(--primary); font-weight: 800; padding: 6px; }

.hero-strip {
  display: grid; grid-template-columns: 1.25fr .75fr; gap: 18px; padding: 26px; border-radius: 23px;
  background: linear-gradient(125deg, #2e2932, #58425d); color: white; box-shadow: var(--shadow); overflow: hidden; position: relative;
}
.hero-strip::after { content: ''; position: absolute; width: 310px; height: 310px; border: 1px solid rgba(255,255,255,.12); border-radius: 50%; right: -80px; top: -165px; }
.hero-copy { position: relative; z-index: 1; }
.hero-copy p { color: #d8d0dc; margin: 0 0 12px; }
.hero-copy h2 { font-family: Georgia, 'Times New Roman', serif; font-size: clamp(28px, 4vw, 45px); font-weight: 400; margin: 0 0 12px; }
.hero-copy small { color: #c6beca; line-height: 1.6; }
.hero-side { display: grid; align-content: center; grid-template-columns: repeat(2, 1fr); gap: 12px; position: relative; z-index: 1; }
.hero-stat { background: rgba(255,255,255,.09); border: 1px solid rgba(255,255,255,.1); border-radius: 15px; padding: 15px; }
.hero-stat span, .hero-stat strong { display: block; }
.hero-stat span { color: #cfc7d2; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.hero-stat strong { font-size: 20px; margin-top: 4px; }

.overview-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 17px; }
.category-card, .panel, .data-card, .project-card, .person-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 10px 30px rgba(55,36,61,.045);
}
.category-card { padding: 21px; position: relative; overflow: hidden; }
.category-card::after { content: ''; position: absolute; width: 85px; height: 85px; right: -28px; top: -32px; border-radius: 50%; background: var(--primary-soft); }
.card-label { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--muted); font-weight: 750; }
.card-icon { width: 34px; height: 34px; border-radius: 11px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; }
.card-value { margin: 20px 0 2px; font-size: 29px; font-weight: 800; letter-spacing: -.03em; }
.card-sub { color: var(--muted); margin-bottom: 17px; min-height: 20px; }
.progress { height: 7px; border-radius: 99px; background: #ede9ef; overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: inherit; background: var(--primary); min-width: 2px; }
.progress.teal > span { background: var(--teal); }
.progress.rose > span { background: var(--rose); }
.card-foot { display: flex; justify-content: space-between; gap: 8px; margin-top: 9px; font-size: 12px; color: var(--muted); }

.two-column { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(300px, .75fr); gap: 18px; }
.panel { padding: 22px; }
.panel-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 17px; }
.panel-title h3 { margin: 0; font-size: 17px; }
.panel-title span { color: var(--muted); font-size: 12px; }

.upcoming-list, .mini-list { display: grid; gap: 9px; }
.upcoming-row, .mini-row {
  display: grid; grid-template-columns: 46px minmax(0,1fr) auto; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid #eeeaf0;
}
.upcoming-row:last-child, .mini-row:last-child { border-bottom: 0; }
.date-badge { width: 42px; height: 42px; border-radius: 12px; background: var(--surface-alt); display: grid; place-items: center; line-height: 1; }
.date-badge strong { font-size: 16px; }
.date-badge span { color: var(--muted); font-size: 9px; text-transform: uppercase; }
.row-main strong, .row-main span { display: block; }
.row-main span { color: var(--muted); font-size: 12px; margin-top: 3px; }
.row-amount { font-weight: 800; white-space: nowrap; }
.workflow-row { display: grid; grid-template-columns: 42px minmax(0, 1fr); align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid #eeeaf0; }
.workflow-row:last-child { border-bottom: 0; }
.workflow-step { width: 42px; height: 42px; border-radius: 12px; background: var(--surface-alt); display: grid; place-items: center; font-weight: 800; }

.metric-list { display: grid; gap: 14px; }
.metric-row { display: grid; gap: 7px; }
.metric-row-head { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.metric-row-head span:last-child { font-weight: 800; }

.group-section { display: grid; gap: 14px; }
.group-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.group-heading h3 { margin: 0; font-size: 18px; }
.group-heading span { color: var(--muted); font-size: 13px; }
.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.data-card { padding: 18px; transition: transform .16s ease, box-shadow .16s ease; }
.data-card:hover, .project-card:hover, .person-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.data-card-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.data-card h4 { margin: 0; font-size: 16px; }
.data-card .muted { margin-top: 4px; }
.pill { display: inline-flex; align-items: center; min-height: 24px; padding: 0 8px; border-radius: 99px; background: var(--surface-alt); color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
.pill.active, .pill.paid { background: #e4f2ed; color: #276a5f; }
.pill.planning, .pill.planned { background: #f5eddb; color: #85611d; }
.pill.negotiating { background: #f6e6ea; color: #944159; }
.big-number { font-size: 25px; font-weight: 850; margin: 17px 0 4px; }
.muted { color: var(--muted); font-size: 12px; }
.card-meta { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 9px; margin-top: 15px; }
.card-meta div { background: var(--surface-alt); border-radius: 10px; padding: 9px; }
.card-meta span, .card-meta strong { display: block; }
.card-meta span { color: var(--muted); font-size: 10px; text-transform: uppercase; }
.card-meta strong { margin-top: 3px; font-size: 13px; }
.card-owner { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; margin-top: 14px; }
.owner-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--owner, var(--primary)); }
.card-actions { display: flex; justify-content: flex-end; margin-top: 12px; }
.edit-button { border: 0; border-radius: 8px; background: #f0ebf2; color: var(--primary); font-weight: 800; padding: 7px 10px; font-size: 12px; }

.table-wrap { overflow-x: auto; background: white; border: 1px solid var(--line); border-radius: var(--radius); }
.data-table { width: 100%; border-collapse: collapse; min-width: 820px; }
.data-table th { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .07em; text-align: left; background: var(--surface-alt); }
.data-table th, .data-table td { padding: 13px 15px; border-bottom: 1px solid #eeeaf0; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table td strong { display: block; }
.data-table td small { color: var(--muted); }
.amount-cell { font-weight: 850; white-space: nowrap; }

.project-grid, .people-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; }
.project-card, .person-card { padding: 21px; }
.project-card-top, .person-card-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.project-card h3, .person-card h3 { margin: 0; font-size: 18px; }
.project-card p { color: var(--muted); min-height: 42px; line-height: 1.5; }
.project-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; margin: 16px 0; }
.project-stats div { padding: 10px; background: var(--surface-alt); border-radius: 10px; }
.project-stats span, .project-stats strong { display: block; }
.project-stats span { color: var(--muted); font-size: 10px; text-transform: uppercase; }
.project-stats strong { margin-top: 3px; }
.person-avatar { width: 44px; height: 44px; border-radius: 14px; color: white; display: grid; place-items: center; font-weight: 850; background: var(--owner, var(--primary)); }
.person-summary { margin-top: 18px; display: grid; gap: 10px; }
.person-summary-row { display: flex; justify-content: space-between; gap: 10px; padding-bottom: 9px; border-bottom: 1px solid #eeeaf0; }
.person-summary-row:last-child { border-bottom: 0; }

.insight-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; }
.insight-card { background: white; border: 1px solid var(--line); border-radius: 15px; padding: 18px; }
.insight-card span, .insight-card strong { display: block; }
.insight-card span { color: var(--muted); font-size: 12px; }
.insight-card strong { font-size: 23px; margin: 8px 0 4px; }
.insight-card small { color: var(--muted); }

.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 17px; }
.settings-card { padding: 22px; background: white; border: 1px solid var(--line); border-radius: var(--radius); }
.settings-card h3 { margin: 0 0 8px; }
.settings-card p { color: var(--muted); line-height: 1.55; min-height: 46px; }
.settings-card .button-row { display: flex; flex-wrap: wrap; gap: 9px; }
.path-box { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; background: #f4f0f5; border-radius: 10px; padding: 12px; color: #5b5260; word-break: break-all; }

.record-dialog, .quick-dialog { border: 0; border-radius: 20px; padding: 0; width: min(760px, calc(100vw - 30px)); color: var(--ink); box-shadow: 0 28px 80px rgba(32,22,35,.25); }
.record-dialog::backdrop, .quick-dialog::backdrop { background: rgba(30,25,32,.58); backdrop-filter: blur(3px); }
.dialog-shell { padding: 24px; background: white; }
.compact-dialog { max-width: 620px; }
.dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; margin-bottom: 20px; }
.dialog-header p { margin: 0 0 3px; color: var(--muted); text-transform: uppercase; font-size: 10px; font-weight: 800; letter-spacing: .08em; }
.dialog-header h2 { margin: 0; font-family: Georgia, 'Times New Roman', serif; font-weight: 500; font-size: 26px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; max-height: 64vh; overflow: auto; padding-right: 3px; }
.form-field { display: grid; gap: 6px; }
.form-field.full { grid-column: 1 / -1; }
.form-field label { font-weight: 750; font-size: 12px; }
.checkbox-field { display: flex; align-items: center; gap: 9px; min-height: 43px; padding-top: 21px; }
.checkbox-field input { width: 18px; height: 18px; }
.dialog-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 23px; padding-top: 18px; border-top: 1px solid var(--line); }
.dialog-actions-right { display: flex; gap: 9px; margin-left: auto; }
.quick-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.quick-grid button { border: 1px solid var(--line); background: var(--surface-alt); border-radius: 13px; padding: 16px; text-align: left; }
.quick-grid button:hover { border-color: #ab8caf; background: #f2eaf4; }
body[data-hosted="true"] [data-add="households"] { display: none !important; }
.quick-grid strong, .quick-grid span { display: block; }
.quick-grid span { color: var(--muted); font-size: 12px; margin-top: 4px; }
.toast { position: fixed; z-index: 100; right: 22px; bottom: 22px; background: #2b2730; color: white; padding: 12px 16px; border-radius: 10px; box-shadow: var(--shadow); opacity: 0; transform: translateY(10px); pointer-events: none; transition: .2s ease; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { background: var(--danger); }

@media (max-width: 1120px) {
  .overview-grid, .card-grid, .project-grid, .people-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .insight-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .topbar { align-items: flex-start; }
  .top-actions { flex-wrap: wrap; justify-content: flex-end; }
}
@media (max-width: 850px) {
  .app-shell { display: block; }
  .sidebar { position: fixed; left: -270px; transition: left .2s ease; width: 250px; box-shadow: 20px 0 50px rgba(0,0,0,.18); }
  .sidebar.open { left: 0; }
  .mobile-menu, .sidebar-close { display: block; }
  .topbar { padding: 18px 20px; flex-wrap: wrap; }
  .top-actions { width: 100%; justify-content: flex-start; }
  .page-heading { margin-right: 0; flex: 1; }
  .main-content { padding: 22px 20px 45px; }
  .hero-strip, .two-column { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .top-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; }
  .top-actions .filter-control { min-width: 0; }
  .top-actions select { width: 100%; min-width: 0; }
  .top-actions .primary-button, .top-actions .reset-filters, .top-actions .nb-page-guide-button { width: 100%; }
  .top-actions #quickAdd { grid-column: 1 / -1; }
  .overview-grid, .card-grid, .project-grid, .people-grid, .insight-grid, .settings-grid { grid-template-columns: 1fr; }
  .hero-side { grid-template-columns: 1fr 1fr; }
  .form-grid, .quick-grid { grid-template-columns: 1fr; }
  .form-field.full { grid-column: auto; }
  .dialog-actions { align-items: stretch; flex-direction: column; }
  .dialog-actions-right { width: 100%; margin: 0; }
  .dialog-actions-right button, .dialog-actions > button { flex: 1; }
}

.section-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 9px; }
.household-banner {
  display: grid; grid-template-columns: minmax(260px, .8fr) minmax(0, 1.2fr); gap: 20px;
  padding: 25px; border-radius: 22px; color: white;
  background: linear-gradient(125deg, #2f3f45, #3c6864); box-shadow: var(--shadow);
}
.household-banner > div:first-child { display: grid; align-content: center; }
.household-banner span, .household-banner strong, .household-banner small { display: block; }
.household-banner > div:first-child > span { color: #c8d9d6; font-size: 12px; text-transform: uppercase; letter-spacing: .07em; font-weight: 800; }
.household-banner > div:first-child > strong { font-family: Georgia, 'Times New Roman', serif; font-weight: 400; font-size: clamp(30px, 4vw, 45px); margin: 8px 0; }
.household-banner small { color: #c8d9d6; line-height: 1.5; }
.household-banner-stats { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
.household-banner-stats div { padding: 14px; border-radius: 14px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.1); }
.household-banner-stats span { color: #c8d9d6; font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }
.household-banner-stats strong { margin-top: 4px; font-size: 19px; }
.allocation-field { padding: 14px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-alt); }
.allocation-editor { display: grid; gap: 8px; margin-top: 3px; }
.allocation-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid #e8e1eb; }
.allocation-row:last-child { border-bottom: 0; }
.allocation-row > span:first-child { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.percentage-input { display: flex; align-items: center; gap: 5px; }
.percentage-input input { width: 95px; text-align: right; }
.percentage-input em { font-style: normal; color: var(--muted); }
.allocation-total { margin-top: 9px; text-align: right; color: var(--muted); font-size: 12px; }
.invalid-total { color: var(--danger); }
.form-help { color: var(--muted); line-height: 1.5; font-size: 12px; padding: 6px 0; }
.amount-cell small { display: block; margin-top: 3px; font-weight: 500; color: var(--muted); }
.person-notes { line-height: 1.5; margin: 15px 0 0; }
.record-dialog { width: min(840px, calc(100vw - 30px)); }

@media (max-width: 850px) {
  .household-banner { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .section-head { align-items: stretch; flex-direction: column; }
  .section-actions { justify-content: flex-start; }
  .section-actions button { width: 100%; }
  .household-banner-stats { grid-template-columns: 1fr 1fr; }
}

/* ==============================
   V3 Stats and reporting center
   ============================== */
.stats-page { --chart-0: #5d50a6; --chart-1: #75d5dc; --chart-2: #dc8a75; --chart-3: #b27a2b; --chart-4: #4c6f9d; --chart-5: #8b7a54; }
.stats-toolbar {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px;
  box-shadow: 0 9px 28px rgba(55,36,61,.045); display: grid; gap: 14px;
}
.stats-filter-grid { display: grid; grid-template-columns: repeat(5, minmax(120px, 1fr)); gap: 10px; }
.stats-filter-grid label, .payoff-control label, .target-grid label { display: grid; gap: 5px; color: var(--muted); font-size: 11px; font-weight: 800; }
.stats-filter-grid select, .stats-filter-grid input { width: 100%; }
.stats-toolbar-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.stats-toolbar > small { color: var(--muted); line-height: 1.5; }

.health-hero {
  display: grid; grid-template-columns: minmax(310px,.8fr) minmax(0,1.2fr); gap: 20px; padding: 25px;
  border-radius: 24px; color: white; background: linear-gradient(130deg,#292530,#624c68); box-shadow: var(--shadow);
}
.health-score-block { display: flex; align-items: center; gap: 20px; }
.health-score-block p { margin: 0 0 5px; color: #d6cdda; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; font-weight: 800; }
.health-score-block h2 { margin: 0 0 8px; font-family: Georgia,'Times New Roman',serif; font-size: clamp(25px,3vw,37px); font-weight: 400; }
.health-score-block span { color: #d3cad6; line-height: 1.55; font-size: 12px; }
.health-factors { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 9px; align-content: center; }
.health-factor { padding: 12px; border: 1px solid rgba(255,255,255,.1); border-radius: 13px; background: rgba(255,255,255,.08); }
.health-factor span,.health-factor strong,.health-factor small { display: block; }
.health-factor span { color: #d4cbd8; font-size: 10px; text-transform: uppercase; letter-spacing: .05em; }
.health-factor strong { margin-top: 5px; font-size: 19px; }
.health-factor small { margin-top: 3px; color: #c7bdcb; }
.health-factor.good { box-shadow: inset 3px 0 #62b29e; }
.health-factor.warn { box-shadow: inset 3px 0 #d2a253; }
.health-factor.bad { box-shadow: inset 3px 0 #da7380; }

.progress-ring {
  --progress: 0; width: 126px; height: 126px; flex: 0 0 126px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(#b997c0 calc(var(--progress) * 1%), rgba(255,255,255,.14) 0); position: relative;
}
.progress-ring::before { content:''; position:absolute; inset: 10px; border-radius:50%; background:#3c313f; }
.progress-ring > div { position:relative; z-index:1; text-align:center; }
.progress-ring strong,.progress-ring span { display:block; }
.progress-ring strong { font-size:25px; }
.progress-ring span { max-width:78px; margin-top:3px; color:#d4cbd7; font-size:10px; line-height:1.25; }

.stat-metric-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:13px; }
.stat-metric { min-width:0; background:white; border:1px solid var(--line); border-radius:16px; padding:17px; box-shadow:0 8px 24px rgba(55,36,61,.04); }
.stat-metric-top { display:flex; align-items:center; gap:8px; color:var(--muted); font-size:12px; font-weight:750; }
.stat-icon { width:29px; height:29px; border-radius:9px; display:grid; place-items:center; color:var(--primary); background:var(--primary-soft); }
.stat-metric > strong { display:block; margin:14px 0 4px; font-size:25px; letter-spacing:-.03em; }
.stat-metric > small { display:block; color:var(--muted); line-height:1.45; min-height:34px; }
.stat-metric.positive { box-shadow: inset 0 3px var(--teal), 0 8px 24px rgba(55,36,61,.04); }
.stat-metric.danger { box-shadow: inset 0 3px var(--danger), 0 8px 24px rgba(55,36,61,.04); }
.metric-delta { display:block; margin-top:9px; font-size:10px; font-style:normal; font-weight:800; }
.metric-delta.good { color:var(--teal); }.metric-delta.bad { color:var(--danger); }.metric-delta.neutral { color:var(--muted); }

.stats-section-title { display:flex; justify-content:space-between; align-items:end; border-bottom:1px solid var(--line); padding-bottom:12px; margin-top:8px; }
.stats-section-title p { margin:0 0 4px; color:var(--primary); font-size:10px; text-transform:uppercase; letter-spacing:.1em; font-weight:850; }
.stats-section-title h2 { margin:0; font-family:Georgia,'Times New Roman',serif; font-size:25px; font-weight:500; }
.stats-chart-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }
.stat-chart-card { min-width:0; background:white; border:1px solid var(--line); border-radius:var(--radius); overflow:hidden; box-shadow:0 9px 28px rgba(55,36,61,.04); }
.stat-chart-card.wide { grid-column:1/-1; }
.stat-chart-head { padding:18px 20px 4px; }
.stat-chart-head h3 { margin:0; font-size:16px; }
.stat-chart-head p { margin:5px 0 0; color:var(--muted); font-size:12px; line-height:1.5; }
.stat-chart-body { min-height:235px; padding:15px 20px 20px; display:grid; align-items:center; }
.stat-chart-foot { border-top:1px solid var(--line); padding:11px 20px; color:var(--muted); font-size:11px; }
.stat-chart-foot strong { color:var(--ink); }
.chart-empty { min-height:180px; display:flex; flex-direction:column; justify-content:center; align-items:center; gap:7px; color:var(--muted); text-align:center; padding:24px; border:1px dashed #ded7e2; border-radius:13px; }
.chart-empty strong { color:var(--ink); }
.chart-empty .secondary-button { margin-top:5px; }

.svg-chart { width:100%; overflow:hidden; }
.svg-chart svg { display:block; width:100%; height:auto; min-height:245px; overflow:visible; }
.chart-grid { stroke:#e9edf2; stroke-width:1; }
.chart-axis-label { fill:#8b95a5; font-size:10px; font-weight:500; }
.chart-line { fill:none; stroke-width:3; stroke-linecap:round; stroke-linejoin:round; vector-effect:non-scaling-stroke; }
.chart-line.series-0 { fill:none; filter:drop-shadow(0 3px 4px rgba(93,80,166,.12)); }
.chart-line.series-1 { fill:none; filter:drop-shadow(0 3px 4px rgba(117,213,220,.1)); }
.chart-line.series-2,.chart-line.series-3,.chart-line.series-4,.chart-line.series-5 { fill:none; }
.chart-dot { stroke:white; stroke-width:2; opacity:0; vector-effect:non-scaling-stroke; }
.chart-point { cursor:crosshair; outline:none; }
.chart-point-hit { fill:transparent; }
.chart-hover-guide { stroke:#cdd4de; stroke-width:1; stroke-dasharray:3 4; opacity:0; pointer-events:none; vector-effect:non-scaling-stroke; }
.chart-point .chart-dot { transition:r .16s ease,opacity .16s ease,filter .16s ease; }
.chart-point:hover .chart-dot,.chart-point:focus .chart-dot,.chart-point.chart-series-active .chart-dot { r:6; opacity:1; filter:drop-shadow(0 3px 5px rgba(55,36,61,.24)); }
.chart-point:hover .chart-hover-guide,.chart-point:focus .chart-hover-guide,.chart-point.chart-series-active .chart-hover-guide { opacity:.8; }
.chart-area { pointer-events:none; opacity:.5; }
.chart-gradient-start.series-0 { stop-color:#8f83d0; stop-opacity:.32; }
.chart-gradient-start.series-1 { stop-color:var(--teal); stop-opacity:.22; }
.chart-gradient-start.series-2 { stop-color:var(--rose); stop-opacity:.18; }
.chart-gradient-start.series-3 { stop-color:var(--amber); stop-opacity:.18; }
.chart-gradient-end { stop-color:white; stop-opacity:0; }
.series-0 { stroke:var(--chart-0); fill:var(--chart-0); background:var(--chart-0); }
.series-1 { stroke:var(--chart-1); fill:var(--chart-1); background:var(--chart-1); }
.series-2 { stroke:var(--chart-2); fill:var(--chart-2); background:var(--chart-2); }
.series-3 { stroke:var(--chart-3); fill:var(--chart-3); background:var(--chart-3); }
.series-4 { stroke:var(--chart-4); fill:var(--chart-4); background:var(--chart-4); }
.series-5 { stroke:var(--chart-5); fill:var(--chart-5); background:var(--chart-5); }
.chart-legend { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:6px; margin-bottom:4px; color:#687384; font-size:10px; }
.chart-legend span { display:flex; align-items:center; gap:6px; padding:5px 7px; border:1px solid #e6eaf0; border-radius:6px; background:#fff; }
.legend-dot { width:8px; height:8px; border-radius:2px; display:inline-block; }

.bar-chart { display:grid; gap:13px; width:100%; }
.bar-row { display:grid; gap:5px; }
.bar-label { display:flex; justify-content:space-between; gap:12px; font-size:12px; }
.bar-label span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }.bar-label strong { white-space:nowrap; }
.bar-track { height:8px; background:#eeeaf0; border-radius:99px; overflow:hidden; }
.bar-fill { height:100%; width:var(--bar-width); border-radius:inherit; transform-origin:left center; }
.bar-row small { color:var(--muted); font-size:10px; }
.grouped-bars { display:grid; gap:18px; }
.grouped-row { display:grid; grid-template-columns:150px minmax(0,1fr); gap:15px; }
.grouped-label strong,.grouped-label small { display:block; }.grouped-label small { color:var(--muted); margin-top:4px; line-height:1.4; }
.grouped-values { display:grid; gap:8px; }.grouped-value span { display:block; color:var(--muted); font-size:10px; margin-bottom:3px; }

.donut-layout { display:grid; grid-template-columns:200px minmax(0,1fr); align-items:center; gap:15px; }
.donut-svg { width:190px; height:190px; transform:rotate(-90deg); overflow:visible; }
.donut-base,.donut-segment { fill:none; stroke-width:20; }
.donut-base { stroke:#eeeaf0; }.donut-segment { stroke-linecap:butt; cursor:pointer; outline:none; transform-origin:90px 90px; transition:stroke-width .18s ease,opacity .18s ease,filter .18s ease; }
.donut-segment:hover,.donut-segment:focus,.donut-segment.chart-series-active { stroke-width:25; filter:drop-shadow(0 4px 5px rgba(55,36,61,.18)); }
.donut-center-label,.donut-center-value { transform:rotate(90deg); transform-origin:90px 90px; fill:var(--muted); font-size:10px; }
.donut-center-value { fill:var(--ink); font-size:16px; font-weight:800; }
.donut-legend { display:grid; gap:9px; }
.donut-legend > button { display:grid; grid-template-columns:10px minmax(0,1fr) auto; gap:8px; align-items:center; width:100%; padding:7px 6px; border:0; border-bottom:1px solid #eeeaf0; border-radius:8px; color:inherit; background:transparent; text-align:left; font-size:11px; transition:background .16s ease,color .16s ease; }
.donut-legend > button:hover,.donut-legend > button:focus,.donut-legend > button.chart-series-active { color:var(--primary); background:var(--surface-alt); }
.donut-legend > button:last-child { border-bottom:0; }.donut-legend span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

.upcoming-list button,.data-center-list button { width:100%; border:0; background:transparent; display:flex; justify-content:space-between; align-items:center; gap:12px; padding:10px 0; border-bottom:1px solid #eeeaf0; text-align:left; }
.upcoming-list button:last-child,.data-center-list button:last-child { border-bottom:0; }
.upcoming-list button:hover,.data-center-list button:hover { color:var(--primary); }
.upcoming-list span,.upcoming-list strong,.upcoming-list small,.data-center-list span,.data-center-list strong,.data-center-list small { display:block; }
.upcoming-list small,.data-center-list small { margin-top:3px; color:var(--muted); }
.upcoming-list b,.data-center-list b { white-space:nowrap; }

.budget-list,.debt-progress-list,.goal-list { display:grid; gap:12px; width:100%; }
.budget-row { padding:12px; border:1px solid var(--line); border-radius:12px; }
.budget-row > div:first-child { display:flex; justify-content:space-between; gap:10px; }
.budget-row span,.budget-row strong { font-size:12px; }.budget-row > small { display:block; margin-top:6px; color:var(--muted); }
.budget-row.over > small { color:var(--danger); font-weight:750; }
.budget-track,.mini-progress { height:7px; margin-top:9px; background:#eeeaf0; border-radius:99px; overflow:hidden; }
.budget-track i,.mini-progress i { display:block; width:var(--budget,var(--progress)); height:100%; border-radius:inherit; background:var(--primary); }
.budget-row.over .budget-track i { background:var(--danger); }
.debt-progress-list button,.goal-list button { border:1px solid var(--line); border-radius:12px; background:var(--surface-alt); padding:13px; text-align:left; }
.debt-progress-list button:hover,.goal-list button:hover { border-color:#ad91b2; }
.debt-progress-list strong,.debt-progress-list span,.debt-progress-list small,.goal-list strong,.goal-list span,.goal-list small { display:block; }
.debt-progress-list span,.goal-list span { color:var(--muted); margin-top:3px; font-size:11px; }
.debt-progress-list small,.goal-list small { margin-top:5px; color:var(--muted); }

.number-list { display:grid; gap:0; width:100%; }
.number-list > div { display:flex; justify-content:space-between; gap:12px; padding:12px 0; border-bottom:1px solid #eeeaf0; }
.number-list > div:last-child { border-bottom:0; }.number-list span { color:var(--muted); }.number-list strong { white-space:nowrap; }
.payoff-control { display:flex; justify-content:flex-end; margin-bottom:13px; }.payoff-control input { width:130px; }
.strategy-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:12px; }
.strategy-grid > div { background:var(--surface-alt); border:1px solid var(--line); border-radius:13px; padding:16px; }
.strategy-grid span,.strategy-grid strong,.strategy-grid small { display:block; }.strategy-grid span { color:var(--muted); font-size:11px; }.strategy-grid strong { font-size:23px; margin:7px 0 3px; }.strategy-grid small { color:var(--muted); }
.emergency-card { display:flex; align-items:center; justify-content:center; gap:20px; }.emergency-card .progress-ring { width:115px;height:115px;flex-basis:115px; }.emergency-card strong,.emergency-card span,.emergency-card small { display:block; }.emergency-card strong { font-size:26px; }.emergency-card span { margin-top:4px; }.emergency-card small { margin-top:4px;color:var(--muted); }

.project-stats-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:15px; }
.project-stat-card { background:white; border:1px solid var(--line); border-radius:var(--radius); padding:19px; }
.project-stat-card > div:first-child span { color:var(--primary); font-size:10px; text-transform:uppercase; font-weight:800; letter-spacing:.07em; }
.project-stat-card h3 { margin:5px 0 4px; }.project-stat-card small { color:var(--muted); }
.project-stat-numbers { display:grid; grid-template-columns:repeat(2,1fr); gap:8px; margin:16px 0; }
.project-stat-numbers div { background:var(--surface-alt); border-radius:10px; padding:10px; }.project-stat-numbers span,.project-stat-numbers strong { display:block; }.project-stat-numbers span { color:var(--muted); font-size:9px; text-transform:uppercase; }.project-stat-numbers strong { margin-top:3px; }
.project-stat-card > button { width:100%; margin-top:13px; }.negative-text { color:var(--danger); }.positive-text { color:var(--teal); }

.ratio-grid { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:12px; }
.ratio-card { background:white; border:1px solid var(--line); border-radius:15px; padding:15px; box-shadow:0 7px 20px rgba(55,36,61,.035); }
.ratio-card > div:first-child { display:flex; justify-content:space-between; gap:8px; align-items:start; }.ratio-card span { color:var(--muted); font-size:11px; }.ratio-card strong { font-size:18px; white-space:nowrap; }
.ratio-meter { height:6px; background:#eeeaf0; border-radius:99px; margin:12px 0; overflow:hidden; }.ratio-meter i { display:block;width:var(--ratio);height:100%;background:var(--primary);border-radius:inherit; }
.ratio-card.good .ratio-meter i { background:var(--teal); }.ratio-card.warn .ratio-meter i { background:var(--amber); }
.ratio-card p { color:var(--muted); font-size:10px; line-height:1.5; min-height:45px; }.ratio-card small { color:var(--muted); }
.target-settings { display:grid; grid-template-columns:minmax(230px,.6fr) minmax(0,1.4fr) auto; gap:18px; align-items:end; background:white; border:1px solid var(--line); border-radius:var(--radius); padding:20px; }
.target-settings h3 { margin:0 0 6px; }.target-settings p { margin:0;color:var(--muted);font-size:12px;line-height:1.5; }
.target-grid { display:grid; grid-template-columns:repeat(3,minmax(100px,1fr)); gap:9px; }.target-grid label > div { display:flex; align-items:center; border:1px solid #dcd6df; border-radius:10px; background:white; overflow:hidden; }.target-grid input { min-width:0;width:100%;border:0;box-shadow:none;text-align:right; }.target-grid b { padding:0 8px;color:var(--muted);font-size:11px; }

.stats-page .insight-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
.stats-page .insight-card { display:flex; gap:12px; align-items:flex-start; min-height:120px; }
.stats-page .insight-card i { width:9px;height:9px;border-radius:50%;margin-top:5px;flex:0 0 9px;background:var(--primary); }
.stats-page .insight-card.good i { background:var(--teal); }.stats-page .insight-card.warn i { background:var(--amber); }.stats-page .insight-card.bad i { background:var(--danger); }.stats-page .insight-card.info i { background:#4c6f9d; }
.stats-page .insight-card h3 { margin:0 0 6px;font-size:14px; }.stats-page .insight-card p { margin:0;color:var(--muted);line-height:1.55;font-size:12px; }

.quality-panel { background:white;border:1px solid var(--line);border-radius:var(--radius);padding:20px;display:grid;grid-template-columns:300px minmax(0,1fr);gap:24px; }
.quality-score { display:flex;align-items:center;gap:16px; }.quality-score .progress-ring { background:conic-gradient(var(--primary) calc(var(--progress) * 1%), #e8e1ea 0); }.quality-score .progress-ring::before { background:white; }.quality-score .progress-ring span { color:var(--muted); }.quality-score h3 { margin:0 0 7px; }.quality-score p { margin:0;color:var(--muted);font-size:12px;line-height:1.5; }
.quality-checks { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px; }.quality-checks > div { border:1px solid var(--line);border-radius:12px;padding:11px; }.quality-checks span,.quality-checks strong,.quality-checks small { display:block; }.quality-checks span { font-weight:750;font-size:11px; }.quality-checks strong { margin-top:6px;font-size:11px; }.quality-checks small { margin-top:4px;color:var(--muted);line-height:1.4;font-size:10px; }

.data-center-grid { display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px; }.data-center-card { background:white;border:1px solid var(--line);border-radius:var(--radius);padding:17px; }.data-center-head { display:flex;justify-content:space-between;gap:10px;align-items:center;margin-bottom:9px; }.data-center-head h3 { margin:0 0 3px;font-size:14px; }.data-center-head span { color:var(--muted);font-size:10px; }

/* Subtle load/re-filter animation. DOM is rebuilt after each filter change, so these replay. */
@keyframes stat-card-in { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:translateY(0); } }
@keyframes stat-line-reveal { from { opacity:.2; } to { opacity:1; } }
@keyframes stat-bar-grow { from { transform:scaleX(0); opacity:.45; } to { transform:scaleX(1); opacity:1; } }
@keyframes stat-donut-in { from { opacity:0; stroke-width:8; } to { opacity:1; stroke-width:20; } }
.animate-stat { animation:stat-card-in .42s cubic-bezier(.2,.7,.2,1) both; }
.stat-metric:nth-child(2),.stat-chart-card:nth-child(2),.insight-card:nth-child(2) { animation-delay:45ms; }
.stat-metric:nth-child(3),.stat-chart-card:nth-child(3),.insight-card:nth-child(3) { animation-delay:85ms; }
.stat-metric:nth-child(4),.stat-chart-card:nth-child(4),.insight-card:nth-child(4) { animation-delay:120ms; }
.chart-line { stroke-dasharray:none; stroke-dashoffset:0; animation:stat-line-reveal .42s ease-out var(--series-delay,0ms) both; }
.bar-fill { animation:stat-bar-grow .58s cubic-bezier(.2,.8,.2,1) var(--bar-delay,0ms) both; }
.donut-segment { animation:stat-donut-in .55s ease-out var(--donut-delay,0ms) both; }
.budget-track i,.mini-progress i,.ratio-meter i { transform-origin:left center;animation:stat-bar-grow .55s ease-out both; }

@media (max-width:1250px) {
  .stats-filter-grid { grid-template-columns:repeat(3,minmax(130px,1fr)); }
  .health-factors { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .stat-metric-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .ratio-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .project-stats-grid,.data-center-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .target-settings { grid-template-columns:1fr; }.target-settings > button { width:max-content; }
}
@media (max-width:850px) {
  .health-hero,.quality-panel { grid-template-columns:1fr; }
  .health-score-block { align-items:flex-start; }
  .stats-chart-grid { grid-template-columns:1fr; }.stat-chart-card.wide { grid-column:auto; }
  .stats-page .insight-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .ratio-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width:620px) {
  .stats-filter-grid { grid-template-columns:1fr 1fr; }.stats-toolbar-actions button { flex:1; }
  .health-score-block { flex-direction:column; }.health-factors { grid-template-columns:1fr 1fr; }
  .stat-metric-grid,.project-stats-grid,.data-center-grid,.stats-page .insight-grid,.quality-checks,.ratio-grid { grid-template-columns:1fr; }
  .donut-layout { grid-template-columns:1fr;justify-items:center; }.donut-legend { width:100%; }
  .grouped-row { grid-template-columns:1fr; }.strategy-grid { grid-template-columns:1fr; }.emergency-card { flex-direction:column;text-align:center; }
  .target-grid { grid-template-columns:1fr 1fr; }.stats-section-title h2 { font-size:21px; }
  .stat-chart-body { padding-left:14px;padding-right:14px; }.svg-chart { overflow-x:auto; }.svg-chart svg { min-width:640px; }
}
@media (prefers-reduced-motion: reduce) {
  .animate-stat,.chart-line,.bar-fill,.donut-segment,.budget-track i,.mini-progress i,.ratio-meter i { animation:none !important; }
  .chart-line { opacity:1 !important; stroke-dasharray:none !important; stroke-dashoffset:0 !important; }
}

@media print {
  body { background:white; font-size:11px; }
  .sidebar,.topbar,.stats-toolbar-actions,.stats-filter-grid,.target-settings button,.data-center-grid,.mobile-menu { display:none !important; }
  .app-shell { display:block; }.main-content { padding:0;max-width:none; }.stats-toolbar { box-shadow:none;padding:10px; }
  .stat-chart-card,.stat-metric,.health-hero,.quality-panel,.project-stat-card,.ratio-card,.insight-card { box-shadow:none;break-inside:avoid; }
  .stats-chart-grid { grid-template-columns:1fr 1fr; }.stat-metric-grid { grid-template-columns:repeat(4,1fr); }.health-hero { color:#222;background:#f4f0f5; }
  .health-score-block span,.health-score-block p,.health-factor span,.health-factor small { color:#555; }.health-factor { background:white;border-color:#ddd; }
  .progress-ring::before { background:white; }.progress-ring span { color:#555; }
}
:where(button, input, select, textarea) { touch-action: manipulation; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
:where(button, [role="button"]) { min-height: 44px; }
.text-button, .edit-button { min-height: 40px; }
.nb-d-weekly { border:1px solid #ded4e5; background:linear-gradient(135deg,#fff 0%,#fbf8fd 100%); }
.nb-d-weekly-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:1px; overflow:hidden; border:1px solid #e8e0eb; border-radius:14px; background:#e8e0eb; }
.nb-d-weekly-grid > div { min-width:0; padding:18px; background:#fff; }
.nb-d-weekly-grid span { display:block; color:#6e5775; font-size:11px; font-weight:800; letter-spacing:.08em; text-transform:uppercase; }
.nb-d-weekly-grid strong { display:block; margin-top:7px; color:#32253a; font-size:20px; line-height:1.2; }
.nb-d-weekly-grid p { margin:8px 0 0; color:#65586c; font-size:13px; line-height:1.55; }
.nb-d-weekly-grid a { display:inline-block; margin-top:10px; color:#633986; font-size:13px; font-weight:700; text-decoration:underline; text-underline-offset:3px; }
@media(max-width:760px) { .nb-d-weekly-grid { grid-template-columns:1fr; } }
