/* CrossBank visual system: calm, domestic, and a little more editorial. */
@view-transition { navigation: auto; }

::view-transition-group(crossbank-sidebar),
::view-transition-group(crossbank-topbar) { animation-duration: 220ms; }

::view-transition-old(crossbank-sidebar),
::view-transition-new(crossbank-sidebar),
::view-transition-old(crossbank-topbar),
::view-transition-new(crossbank-topbar) { animation-duration: 220ms; }

.view.active-view { view-transition-name: crossbank-content; }
.view[hidden] { display: none !important; }
::view-transition-group(crossbank-content) { animation-duration: 220ms; }
::view-transition-old(crossbank-content) { animation: crossbank-content-out 150ms ease both; }
::view-transition-new(crossbank-content) { animation: crossbank-content-in 220ms cubic-bezier(.2,.8,.2,1) both; }
@keyframes crossbank-content-out { to { opacity: 0; transform: translateY(4px); } }
@keyframes crossbank-content-in { from { opacity: 0; transform: translateY(8px); } }

@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(crossbank-content),
  ::view-transition-old(crossbank-content),
  ::view-transition-new(crossbank-content) { animation-duration: 1ms; }
}

:root {
  --ink: #19312b;
  --ink-soft: #4e665c;
  --muted: #819189;
  --paper: #f5f3ee;
  --card: #fffdf9;
  --line: rgba(20, 42, 37, .12);
  --forest: #142a25;
  --forest-2: #2d6b55;
  --mint: #dcebe0;
  --mint-strong: #78a98b;
  --peach: #d1836e;
  --peach-pale: #f5e0d7;
  --shadow: 0 18px 55px rgba(20, 42, 37, .09);
  --radius: 18px;

  /* Platform roles: pages consume these semantic tokens rather than
     inventing another colour or spacing language. Theme files replace the
     atmosphere variables above while these meanings remain stable. */
  --cb-background: var(--paper);
  --cb-surface: var(--card);
  --cb-text: var(--ink);
  --cb-text-muted: var(--ink-soft);
  --cb-border: var(--line);
  --cb-action: var(--forest);
  --cb-action-strong: var(--forest-2);
  --cb-positive: #4b8763;
  --cb-warning: #8d7340;
  --cb-critical: #aa5946;
  --cb-info: #4e7490;
  --cb-focus: var(--forest-2);
  --cb-radius-sm: 9px;
  --cb-radius-md: 14px;
  --cb-radius-lg: var(--radius);
  --cb-motion-fast: 160ms;
  --cb-motion-standard: 220ms;
}

body {
  background:
    radial-gradient(circle at 94% -5%, rgba(217, 233, 220, .8), transparent 27rem),
    var(--paper);
}

.app-shell {
  background: linear-gradient(90deg, #eceae4 0 250px, transparent 250px);
}

.sidebar {
  view-transition-name: crossbank-sidebar;
  width: 250px;
  background: rgba(238, 236, 231, .88);
  box-shadow: 12px 0 38px rgba(20, 42, 37, .035);
}

.sidebar .brand-lockup {
  padding: 7px 8px;
}

.brand-chip {
  border: 1px solid rgba(255, 255, 255, .12);
  box-shadow: 0 7px 17px rgba(20, 42, 37, .16);
  text-indent: -999px;
  overflow: hidden;
}

.brand-lockup strong::after {
  letter-spacing: .3px;
}

.sidebar nav {
  gap: 6px;
}

.nav-item {
  border: 1px solid transparent;
  transition: background .2s ease, border-color .2s ease, color .2s ease, transform .2s ease;
}

.nav-item:hover {
  transform: translateX(2px);
  border-color: rgba(45, 107, 85, .12);
}

.nav-item.active {
  border-color: rgba(45, 107, 85, .13);
  background: #e0ebe1;
  box-shadow: 0 6px 15px rgba(45, 107, 85, .08);
}

.main-content {
  max-width: 1440px;
  padding: 30px 58px 56px;
}

.topbar {
  view-transition-name: crossbank-topbar;
  position: sticky;
  top: 0;
  z-index: 5;
  padding: 10px 0 18px;
  background: linear-gradient(to bottom, rgba(245, 243, 238, .96) 60%, rgba(245, 243, 238, 0));
  backdrop-filter: blur(12px);
}

@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(crossbank-sidebar),
  ::view-transition-group(crossbank-topbar),
  ::view-transition-old(crossbank-sidebar),
  ::view-transition-new(crossbank-sidebar),
  ::view-transition-old(crossbank-topbar),
  ::view-transition-new(crossbank-topbar) { animation-duration: 1ms; }
}

.current-profile {
  padding: 5px 10px 5px 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 253, 249, .72);
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.current-profile:hover {
  border-color: rgba(45, 107, 85, .28);
  box-shadow: 0 8px 20px rgba(20, 42, 37, .07);
  transform: translateY(-1px);
}

.current-profile > span:first-child,
.profile-avatar-large,
.profile-avatar-stage {
  overflow: hidden;
  isolation: isolate;
}

.current-profile > span:first-child {
  position: relative;
}

.profile-avatar-large {
  position: relative;
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  flex: 0 0 auto;
  border-radius: 22px;
  background: var(--mint);
  color: var(--forest);
  font: 800 16px 'DM Mono', monospace;
}

.current-profile > span:first-child img,
.profile-avatar-large img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transform-origin: center;
}

.current-profile > span:first-child img { border-radius: inherit; }

.profile-avatar-card {
  margin-top: 14px;
  padding: 24px;
}

.profile-avatar-editor {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  align-items: start;
  gap: 22px;
  margin-top: 22px;
}

.profile-avatar-stage {
  position: relative;
  display: grid;
  place-items: center;
  width: 128px;
  height: 128px;
  border: 1px solid rgba(45, 107, 85, .14);
  border-radius: 34px;
  background: var(--mint);
  color: var(--forest);
  font: 800 27px 'DM Mono', monospace;
  box-shadow: 0 15px 28px rgba(20, 42, 37, .1);
}

.profile-avatar-stage img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform-origin: center;
}

.profile-avatar-controls {
  min-width: 0;
}

.profile-avatar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.profile-avatar-actions .small-action {
  min-height: 38px;
  padding: 8px 11px;
}

.profile-avatar-controls .field-help {
  display: block;
  margin: 12px 0 0;
}

.profile-avatar-adjustments {
  display: grid;
  gap: 11px;
  max-width: 470px;
  margin-top: 16px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8f6f1;
}

.profile-avatar-adjustments label {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 7px 12px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 800;
}

.profile-avatar-adjustments output {
  color: var(--forest-2);
  font: 500 10px 'DM Mono', monospace;
}

.profile-avatar-adjustments input[type="range"] {
  grid-column: 1 / -1;
  width: 100%;
  accent-color: var(--forest-2);
}

.profile-avatar-adjustments .primary-btn {
  justify-self: start;
  margin-top: 3px;
  min-height: 40px;
}

@media (max-width: 560px) {
  .profile-avatar-card { padding: 20px; }
  .profile-avatar-editor { grid-template-columns: 1fr; gap: 16px; }
  .profile-avatar-stage { width: 112px; height: 112px; border-radius: 29px; }
  .profile-avatar-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .profile-avatar-actions .small-action { width: 100%; }
  .profile-avatar-actions .danger-text { grid-column: 1 / -1; }
}

.login-art {
  background:
    radial-gradient(circle at 54% 42%, rgba(55, 105, 84, .98) 0, rgba(34, 75, 62, .98) 39%, rgba(20, 42, 37, 1) 76%),
    var(--forest);
}

.art-badge {
  background: var(--forest) url("assets/branding/crossbank-icon.png") center / 152px no-repeat;
  border: 1px solid rgba(255, 255, 255, .16);
  box-shadow: 0 0 0 17px rgba(209, 131, 110, .08), 0 0 0 46px rgba(209, 131, 110, .04), 0 20px 55px rgba(0, 0, 0, .16);
}

.art-badge > * {
  display: none;
}

.login-panel {
  background: linear-gradient(145deg, #f7f5f0, #f3f1eb);
}

.login-panel > .eyebrow {
  color: #788b81;
  font-size: 0;
}

.login-panel > .eyebrow::after,
.sidebar-label::after {
  content: "PRIVATE HOUSEHOLD WORKSPACE";
  font: 500 10px 'DM Mono', monospace;
  letter-spacing: 1.35px;
}

.login-panel h1 {
  font-size: clamp(48px, 5vw, 72px);
  line-height: .91;
}

.login-form {
  gap: 16px;
}

.login-form input {
  min-height: 48px;
  border-radius: 10px;
  box-shadow: 0 4px 13px rgba(20, 42, 37, .025);
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

.login-form input:focus {
  border-color: rgba(45, 107, 85, .55);
  background: #fffefa;
  box-shadow: 0 0 0 4px rgba(120, 169, 139, .14);
}

.login-submit {
  min-height: 48px;
  box-shadow: 0 12px 25px rgba(20, 42, 37, .14);
}

.login-submit:hover,
.primary-btn:hover {
  background: #1d4739;
  box-shadow: 0 15px 28px rgba(20, 42, 37, .17);
  transform: translateY(-1px);
}

.login-foot {
  font-size: 0;
}

.login-foot::after {
  content: "Private household workspace · CrossBank";
  font-size: 10px;
}

.sidebar-label {
  font-size: 0;
}

footer {
  font-size: 0;
}

footer::before {
  content: "CrossBank · Private household workspace";
  font: 500 9px 'DM Mono', monospace;
}

footer span {
  display: none;
}

.view-connections .page-title > div > p:last-child {
  font-size: 0;
}

.view-connections .page-title > div > p:last-child::after {
  content: "Small bridges between CrossBank and the tools you already use.";
  font-size: 12px;
}

.view-connections .connection-card:nth-child(3) p:not(.eyebrow) {
  font-size: 0;
}

.view-connections .connection-card:nth-child(3) p:not(.eyebrow)::after {
  content: "CrossBank can be installed like an app once it is running over HTTPS on your domain.";
  font-size: 11px;
}

.welcome-banner {
  min-height: 270px;
  border: 1px solid rgba(255, 255, 255, .08);
  box-shadow: 0 22px 58px rgba(20, 42, 37, .16);
  background:
    radial-gradient(circle at 86% 25%, rgba(75, 132, 103, .34), transparent 17rem),
    linear-gradient(135deg, #142a25, #1c4437);
}

.welcome-banner::after {
  content: "";
  position: absolute;
  inset: auto -8% -55% 34%;
  height: 250px;
  border: 1px solid rgba(217, 233, 220, .16);
  border-radius: 50%;
  transform: rotate(-12deg);
  pointer-events: none;
}

.banner-art {
  width: 210px;
  height: 210px;
  top: 39px;
  right: 60px;
  border: 0;
  background: url("assets/branding/crossbank-icon.png") center / 156px no-repeat;
  transform: none;
  opacity: .92;
}

.banner-art > *,
.banner-art::before,
.banner-art::after {
  display: none;
}

.home-snapshot {
  position: absolute;
  z-index: 1;
  top: 31px;
  right: 56px;
  width: min(285px, 39%);
  min-height: 214px;
  padding: 22px 22px 19px;
  border: 1px solid rgba(20, 42, 37, .12);
  border-radius: 17px 17px 17px 5px;
  background: #fff8ee;
  color: var(--ink);
  box-shadow: 0 18px 35px rgba(10, 29, 23, .18);
  transform: rotate(1.5deg);
}

.home-snapshot::before {
  content: "";
  position: absolute;
  top: -7px;
  right: 22px;
  width: 43px;
  height: 14px;
  border: 1px solid rgba(209, 131, 110, .35);
  background: rgba(242, 179, 152, .48);
  transform: rotate(4deg);
}

.home-snapshot .eyebrow {
  margin-bottom: 12px;
  color: #a76552;
}

.home-snapshot h3 {
  margin: 0;
  font: 600 20px/1.05 Georgia, 'Times New Roman', serif;
  letter-spacing: -.6px;
}

.home-snapshot-intro {
  display: block;
  margin-top: 8px;
  color: #7f8c84;
  font-size: 10px;
  line-height: 1.45;
}

.home-snapshot-list {
  display: grid;
  gap: 9px;
  margin-top: 17px;
}

.home-snapshot-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 9px;
  border-top: 1px solid rgba(20, 42, 37, .1);
}

.home-snapshot-date {
  flex: 0 0 47px;
  color: #a76552;
  font: 500 9px 'DM Mono', monospace;
  letter-spacing: .2px;
}

.home-snapshot-row strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-snapshot-empty {
  margin: 0;
  padding-top: 10px;
  border-top: 1px solid rgba(20, 42, 37, .1);
  color: #7f8c84;
  font: 400 16px/1.2 Georgia, 'Times New Roman', serif;
}

.metric-grid,
.dashboard-grid,
.money-hero,
.money-columns,
.foundation-summary,
.foundation-columns,
.connection-grid {
  gap: 16px;
}

.metric-card,
.surface,
.budget-detail,
.pulse-card,
.next-strip,
.calendar-toolbar,
.money-hero article,
.privacy-card,
.birthday-row,
.record-card,
.person-card,
.bin-card {
  border-color: var(--line);
  box-shadow: 0 10px 30px rgba(20, 42, 37, .035);
}

.metric-card,
.surface,
.birthday-row,
.record-card,
.person-card,
.bin-card {
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.metric-card:hover,
.surface:hover,
.birthday-row:hover,
.record-card:hover,
.person-card:hover,
.bin-card:hover {
  border-color: rgba(45, 107, 85, .2);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.metric-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: var(--mint-strong);
}

.metric-expenses::before {
  background: var(--peach);
}

.metric-room::before {
  background: #a899b8;
}

.primary-btn {
  transition: background .2s ease, box-shadow .2s ease, transform .2s ease;
}

.text-btn,
.surface-link,
.switch-profile,
.row-edit,
.category-edit {
  transition: color .2s ease, opacity .2s ease;
}

.text-btn:hover,
.surface-link:hover,
.switch-profile:hover,
.row-edit:hover,
.category-edit:hover {
  color: #1d8063;
}

.page-title {
  margin-top: 52px;
}

.page-title h1,
.section-head h3 {
  letter-spacing: -1.8px;
}

.view.active-view {
  animation: crossbank-enter .32s ease both;
}

@keyframes crossbank-enter {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}

.modal-card,
.foundation-modal {
  box-shadow: 0 28px 90px rgba(20, 42, 37, .23);
}

@media (max-width: 1050px) {
  .main-content { padding-right: 28px; padding-left: 28px; }
  .banner-art { right: 24px; }
  .home-snapshot { right: 28px; }
}

@media (max-width: 780px) {
  .app-shell { background: var(--paper); }
  .sidebar { width: 100%; box-shadow: none; }
  .main-content { padding: 18px 18px 38px; }
  .topbar { position: relative; padding-bottom: 8px; }
  .welcome-banner { min-height: 355px; padding: 30px 25px; }
  .welcome-banner::after { inset: auto -18% -29% 12%; }
  .banner-art { right: -25px; top: 143px; width: 205px; height: 205px; opacity: .72; }
  .home-snapshot { top: 141px; right: 22px; width: min(290px, calc(100% - 44px)); }
  .page-title { margin-top: 42px; }
}

@media (max-width: 560px) {
  .sidebar { padding: 14px 15px 12px; }
  .sidebar .brand-lockup { padding: 4px 2px; }
  .sidebar nav { margin-top: 14px; padding-bottom: 3px; }
  .nav-item { padding: 9px 10px; }
  .main-content { padding-right: 15px; padding-left: 15px; }
  .topbar h2 { font-size: 18px; }
  .current-profile { padding-right: 7px; }
  .welcome-banner { margin-top: 21px; min-height: 365px; padding: 27px 22px; }
  .welcome-banner h1 { font-size: 35px; }
  .welcome-banner p:last-child { max-width: 245px; }
  .banner-art { right: -39px; top: 153px; width: 190px; height: 190px; }
  .home-snapshot { top: 144px; right: 18px; width: calc(100% - 36px); }
  .metric-card { min-height: 124px; }
  .section-head { align-items: start; gap: 15px; }
  .section-head .text-btn { white-space: nowrap; }
  footer { margin-top: 40px; }
}

.remember-me{display:grid!important;grid-template-columns:18px 1fr;align-items:center;gap:2px 9px;color:var(--ink-soft);font-size:11px!important;font-weight:600}.remember-me input{grid-row:span 2;width:18px!important;min-height:18px!important;margin:0;border-radius:5px;accent-color:var(--forest-2)}.remember-me span{line-height:1.4}.remember-me small{grid-column:2;color:var(--muted);font-size:9px;font-weight:500;line-height:1.35}

/* Mobile-first interaction layer: the dashboard is designed for thumbs first,
   with desktop space treated as an enhancement rather than a requirement. */
@media (max-width: 780px) {
  .app-shell { flex-direction: column; min-width: 0; }
  .sidebar { position: sticky; top: 0; z-index: 10; flex: 0 0 auto; }
  .main-content { width: 100%; min-width: 0; }
  .topbar { min-height: 48px; }
  .nav-item { min-height: 44px; flex: 0 0 auto; }
  .calendar-toolbar { align-items: flex-start; flex-wrap: wrap; gap: 8px 14px; }
  .calendar-toolbar > div { min-width: 0; }
  .calendar-note { width: 100%; }
  .calendar-layout { display: block; }
  .calendar-surface { padding: 12px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .calendar-side { display: block; margin-top: 12px; }
  .calendar-help { display: block; }
  .calendar-actions { justify-content: stretch; }
  .calendar-actions input, .calendar-actions select, .calendar-actions button { min-height: 44px; }
  .foundation-overlay { align-items: start; padding: max(10px, env(safe-area-inset-top)) 10px max(10px, env(safe-area-inset-bottom)); }
  .foundation-modal, .modal-card { width: 100%; max-height: calc(100dvh - 20px); padding: 20px; border-radius: 14px; }
  .foundation-modal .modal-head, .modal-card .modal-head { position: sticky; top: -20px; z-index: 1; padding-bottom: 14px; background: var(--card); }
  .form-grid input, .form-grid select, .form-grid textarea, .modal input { min-height: 44px; font-size: 16px; }
  .form-grid textarea { min-height: 100px; }
  .primary-btn, .small-action, .text-btn, .row-edit, .category-edit { min-height: 44px; }
  .primary-btn { padding: 11px 15px; }
  .page-title .primary-btn { width: 100%; }
  .linked-callout .text-btn { width: 100%; text-align: left; }
  .bill-card-wide { gap: 12px; }
  .bill-actions { flex-wrap: wrap; gap: 8px 14px; }
  .activity-row, .attention-row { align-items: flex-start; }
}

@media (max-width: 560px) {
  .sidebar { padding-top: max(14px, env(safe-area-inset-top)); }
  .sidebar nav { scrollbar-width: none; }
  .sidebar nav::-webkit-scrollbar { display: none; }
  .main-content { padding-bottom: max(38px, env(safe-area-inset-bottom)); }
  .topbar { padding-top: 4px; }
  .current-profile { min-height: 42px; }
  .welcome-banner { min-height: 350px; }
  .section-head { flex-wrap: wrap; }
  .section-head .text-btn { min-height: 38px; }
  .metric-card strong, .money-hero strong, .foundation-summary strong { font-size: 22px; }
  .calendar-week, .calendar-grid { min-width: 620px; }
  .calendar-day { min-height: 88px; padding: 8px; }
  .calendar-event { margin-top: 7px; font-size: 9px; }
  .calendar-side { padding: 16px; }
  .subscribe-row { align-items: stretch; }
  .subscribe-row input { min-height: 44px; font-size: 10px; }
  .subscribe-row .small-action { min-width: 60px; }
  .money-row { grid-template-columns: 1fr auto; gap: 5px 10px; }
  .money-row .number { text-align: left; }
  .money-row .row-edit { grid-column: 2; grid-row: 1 / span 2; }
  .foundation-row { grid-template-columns: 1fr; }
  .foundation-row > button, .foundation-row > .status-pill { justify-self: start; }
  .bill-summary { grid-template-columns: 1fr 1fr; }
  .category-manager-row { align-items: flex-start; flex-wrap: wrap; }
  .category-manager-row .bill-category { flex-basis: 100%; }
  .history-row { gap: 6px; padding: 13px 0; }
}

/* On a phone, action comes before the brand story: show the household's
   financial signal first, then the supporting dashboard content. */
@media (max-width: 560px) {
  #view-overview { display: flex; flex-direction: column; }
  #view-overview .metric-grid { order: 1; }
  #view-overview > .section-head:not(.compact-head) { order: 2; }
  #view-overview .dashboard-grid { order: 3; }
  #view-overview > .section-head.compact-head { order: 4; }
  #view-overview .pulse-card { order: 5; }
  #view-overview .next-strip { order: 6; }
  #view-overview .welcome-banner { order: 7; min-height: 235px; margin-top: 28px; }
  #view-overview .welcome-banner h1 { font-size: 30px; }
  #view-overview .welcome-banner .banner-art { top: 86px; width: 150px; height: 150px; }
}

/* Missing data is an invitation to complete the plan, never a zero-value assumption. */
.summary-missing {
  background: linear-gradient(180deg, var(--card) 0%, #f7fbf7 100%);
  border-color: #d4e3d7;
}

.status-pill.status-overdue {
  background: #f8ddd0;
  color: #9b5942;
}

.summary-missing::before {
  background: var(--forest-2);
  opacity: .72;
}

.metric-card .summary-value-missing,
.money-hero article .summary-value-missing,
.pulse-card .summary-value-missing {
  color: var(--forest-2);
  font-family: Manrope, Arial, sans-serif;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -.7px;
}

.pulse-empty {
  align-self: center;
  max-width: 250px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

/* Keep the 12-month pulse inside the phone viewport. The bars are informative,
   so they may compress on small screens instead of expanding the page. */
.pulse-card,
.pulse-copy,
.pulse-bars {
  min-width: 0;
}

@media (max-width: 780px) {
  .pulse-card { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 560px) {
  .pulse-bars .pulse-bar { min-width: 18px; }
}

@media (max-width: 560px) {
  .metric-card .summary-value-missing,
  .money-hero article .summary-value-missing,
  .pulse-card .summary-value-missing {
    font-size: 17px;
  }
}

.settings-spreadsheets .spreadsheet-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.settings-spreadsheets select,
.settings-spreadsheets input[type="file"] {
  width: 100%;
  margin-top: 7px;
}

.settings-spreadsheets .backup-file-label {
  display: block;
  margin-top: 12px;
}

.settings-spreadsheets .settings-security-status {
  display: block;
  margin-top: 10px;
}

/* Phase 2 billing command centre: make the money surface feel decisive at first glance. */
.billing-command {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  overflow: hidden;
  margin: 0 0 14px;
  padding: 26px 28px;
  border: 0;
  background: linear-gradient(135deg, #17372d 0%, #275c49 66%, #38745b 100%);
  color: #f8fcf7;
  box-shadow: 0 22px 50px rgba(20, 42, 37, .16);
}

.billing-command::after {
  position: absolute;
  right: -54px;
  bottom: -96px;
  width: 250px;
  height: 250px;
  border: 1px solid rgba(232, 248, 235, .17);
  border-radius: 50%;
  box-shadow: 0 0 0 26px rgba(232, 248, 235, .04), 0 0 0 52px rgba(232, 248, 235, .035);
  content: '';
  pointer-events: none;
}

.billing-command .eyebrow { color: rgba(229, 246, 231, .66); }
.billing-command-main { position: relative; z-index: 1; min-width: 0; }
.billing-command-heading { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; }
.billing-command h2 { margin: 5px 0 0; color: #fff; font-size: clamp(22px, 3vw, 31px); letter-spacing: -1.2px; }
.billing-command p:not(.eyebrow) { max-width: 640px; margin: 8px 0 0; color: rgba(239, 249, 240, .78); font-size: 11px; line-height: 1.55; }
.billing-command-state { display: inline-flex; align-items: center; min-height: 26px; padding: 6px 9px; border: 1px solid rgba(255, 255, 255, .18); border-radius: 999px; color: #e7f5e8; font: 500 9px 'DM Mono', monospace; white-space: nowrap; }
.billing-command-state::before { width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: #a8d1b1; content: ''; }
.billing-command-state.is-urgent { background: rgba(213, 126, 105, .18); color: #ffe6df; }
.billing-command-state.is-urgent::before { background: #efae98; }
.billing-command-state.is-open { background: rgba(247, 218, 158, .12); color: #fff1cb; }
.billing-command-state.is-open::before { background: #efd391; }
.billing-progress { max-width: 630px; margin-top: 21px; }
.billing-progress-meta { display: flex; align-items: center; justify-content: space-between; gap: 14px; color: rgba(229, 246, 231, .7); font: 500 9px 'DM Mono', monospace; }
.billing-progress-meta strong { color: #fff; font-size: 11px; }
.billing-progress-track { height: 7px; margin-top: 9px; overflow: hidden; border-radius: 999px; background: rgba(236, 249, 238, .17); }
.billing-progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #c8e3ce, #f4d8a0); transition: width .35s ease; }
.billing-command-actions { position: relative; z-index: 1; display: flex; align-items: flex-end; justify-content: flex-end; flex-wrap: wrap; gap: 8px; min-width: 145px; }
.billing-command-actions .small-action { border-color: rgba(255, 255, 255, .2); background: rgba(255, 255, 255, .08); color: #f4fbf5; }
.billing-command-actions .small-action:hover { border-color: rgba(255, 255, 255, .4); background: rgba(255, 255, 255, .14); }
.billing-command-actions .primary-btn { border-color: #fff; background: #fff; color: #1b4838; box-shadow: 0 8px 18px rgba(7, 31, 23, .16); }
.bill-controls { margin-bottom: 14px; padding: 15px; }
.bill-filter-row { display: grid; grid-template-columns: minmax(180px, 1.5fr) minmax(140px, .8fr) minmax(140px, .8fr) 130px auto; align-items: center; gap: 8px; }
.bill-filter-row input, .bill-filter-row select { min-width: 0; min-height: 40px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; background: #fbfaf6; color: var(--ink); font-size: 11px; }
.bill-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 14px; }
.bill-summary article { display: grid; gap: 5px; min-width: 0; padding: 13px 14px; border: 1px solid #e7ebe4; border-radius: 11px; background: linear-gradient(180deg, #fffefa, #f5f8f3); }
.bill-summary article span, .bill-summary article small { color: #91a098; font-size: 9px; }
.bill-summary article strong { overflow: hidden; color: var(--forest); font: 500 19px 'DM Mono', monospace; text-overflow: ellipsis; white-space: nowrap; }
.bill-summary .bill-over { color: #aa5946; }
.bill-summary .bill-under { color: #4b8763; }
.bill-attention-head { display: flex; align-items: baseline; gap: 9px; margin-top: 15px; padding-top: 14px; border-top: 1px solid #edf0eb; }
.bill-attention-head .eyebrow { margin: 0; color: var(--peach); }
.bill-attention-head strong { color: var(--ink); font-size: 11px; }
.bill-attention { display: grid; gap: 6px; margin-top: 8px; }
.attention-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid #f0e2dc; border-radius: 10px; background: #fff8f3; }
.attention-row > div { display: grid; gap: 4px; min-width: 0; }
.attention-row strong { overflow: hidden; color: #754d40; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.attention-row small { color: #a27d70; font-size: 9px; }
.attention-clear { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border-radius: 10px; background: #f2f7f1; color: #6d8874; font-size: 9px; }
.attention-clear strong { color: #4e765d; }
#bills-list { display: grid; gap: 11px; }
#bills-list .bill-card-wide { display: grid; margin: 0; padding: 20px; border: 1px solid #e4e9e2; border-radius: 15px; background: linear-gradient(180deg, #fffefa 0%, #fafbf7 100%); box-shadow: 0 8px 23px rgba(20, 42, 37, .045); }
#bills-list .bill-card-wide:last-child { border-bottom: 1px solid #e4e9e2; }
#bills-list .bill-card-wide:hover { border-color: #bdd5c2; box-shadow: 0 14px 30px rgba(20, 42, 37, .08); }
#bills-list .bill-card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
#bills-list .bill-card-heading h3 { font-size: 17px; letter-spacing: -.35px; }
#bills-list .bill-card-heading > div:first-child { min-width: 0; }
#bills-list .bill-amount { display: grid; gap: 4px; flex: 0 0 auto; text-align: right; }
#bills-list .bill-amount strong { color: var(--forest); font: 500 23px 'DM Mono', monospace; }
#bills-list .bill-amount small { color: #9aa69e; font-size: 9px; }
#bills-list .bill-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
#bills-list .bill-comparison { display: flex; gap: 22px; padding: 12px 0 2px; border-top: 1px solid #edf0eb; color: #98a39b; font-size: 9px; }
#bills-list .bill-comparison strong { margin-left: 5px; color: var(--ink-soft); font: 500 10px 'DM Mono', monospace; }
#bills-list .bill-actions { gap: 12px; }
#bills-list .bill-actions .text-btn:first-child { color: var(--forest-2); font-weight: 800; }

@media (max-width: 900px) {
  .bill-filter-row { grid-template-columns: 1fr 1fr; }
  .bill-filter-row input[type="search"] { grid-column: 1 / -1; }
  .bill-filter-row .small-action { justify-self: start; }
}

@media (max-width: 560px) {
  .billing-command { grid-template-columns: 1fr; gap: 18px; padding: 21px; }
  .billing-command h2 { font-size: 24px; }
  .billing-command-actions { justify-content: flex-start; min-width: 0; }
  .billing-command-actions .primary-btn, .billing-command-actions .small-action { flex: 1; min-width: 0; }
  .bill-filter-row, .bill-summary { grid-template-columns: 1fr 1fr; }
  .bill-filter-row input[type="search"], .bill-filter-row .small-action { grid-column: 1 / -1; width: 100%; }
  .bill-filter-row input[type="month"] { grid-column: 1 / -1; width: 100%; }
  .bill-summary article { padding: 11px; }
  .bill-summary article strong { font-size: 16px; }
  #bills-list .bill-card-wide { padding: 17px; }
  #bills-list .bill-card-heading { display: grid; gap: 12px; }
  #bills-list .bill-amount { text-align: left; }
  .attention-row { align-items: flex-start; flex-direction: column; }
  .attention-row .small-action { width: 100%; }
}

/* A connected Overview moment: the same billing truth, reduced to one confident next action. */
.overview-command {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, .7fr);
  gap: 24px;
  margin: 0 0 20px;
  padding: 25px 27px;
  border-color: #d7e5d9;
  background: linear-gradient(135deg, #f8fcf7 0%, #edf6ee 72%, #e8f0e7 100%);
  box-shadow: 0 15px 35px rgba(45, 107, 85, .07);
}
.overview-command-copy { min-width: 0; }
.overview-command-copy .eyebrow { color: var(--forest-2); }
.overview-command-heading { display: flex; align-items: center; flex-wrap: wrap; gap: 9px 13px; }
.overview-command h2 { margin: 4px 0 0; color: var(--forest); font-size: clamp(22px, 3vw, 30px); letter-spacing: -1.2px; }
.overview-command-copy > p:not(.eyebrow) { max-width: 615px; margin: 9px 0 0; color: #60776a; font-size: 11px; line-height: 1.6; }
.overview-command-state { display: inline-flex; align-items: center; min-height: 25px; padding: 6px 9px; border: 1px solid #c9ddcd; border-radius: 999px; color: #4f795f; font: 500 9px 'DM Mono', monospace; white-space: nowrap; }
.overview-command-state::before { width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: #79ae87; content: ''; }
.overview-command-state.is-urgent { border-color: #eccbc0; background: #fff4ef; color: #a35c4b; }
.overview-command-state.is-urgent::before { background: #df8b75; }
.overview-command-state.is-open { border-color: #ead9aa; background: #fffaf0; color: #8d7340; }
.overview-command-state.is-open::before { background: #d6b965; }
.overview-command-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.overview-command-actions .primary-btn { min-height: 38px; }
.overview-command-actions .small-action { min-height: 38px; background: rgba(255, 255, 255, .58); }
.foundation-toast { position: fixed; z-index: 80; right: 22px; bottom: calc(22px + env(safe-area-inset-bottom)); max-width: min(360px, calc(100vw - 44px)); padding: 12px 15px; border: 1px solid #b9d9c0; border-radius: 11px; background: #eff8f0; color: #3c6f4d; box-shadow: 0 14px 35px rgba(20, 42, 37, .16); font-size: 10px; font-weight: 800; opacity: 0; transform: translateY(10px); pointer-events: none; transition: opacity .2s ease, transform .2s ease; }
.foundation-toast.is-visible { opacity: 1; transform: translateY(0); }
.foundation-toast.is-error { border-color: #ebc6bb; background: #fff3ef; color: #9b594a; }
.overview-command-glance { display: grid; grid-template-columns: 1fr; align-content: center; gap: 8px; min-width: 0; }
.overview-command-glance > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 5px 12px; padding: 13px 15px; border: 1px solid rgba(45, 107, 85, .12); border-radius: 11px; background: rgba(255, 255, 255, .65); }
.overview-command-glance span, .overview-command-glance small { color: #8ba093; font-size: 9px; }
.overview-command-glance strong { overflow: hidden; color: var(--forest); font: 500 17px 'DM Mono', monospace; text-overflow: ellipsis; white-space: nowrap; text-align: right; }
.overview-command-glance small { grid-column: 1 / -1; }
.dashboard-grid .bill-card { border: 0; background: linear-gradient(145deg, #18382e, #2d6b55); color: #f6fbf6; box-shadow: 0 18px 38px rgba(20, 42, 37, .14); }
.dashboard-grid .bill-card .eyebrow { color: rgba(229, 246, 231, .64); }
.dashboard-grid .bill-card h3 { color: #fff; }
.dashboard-grid .bill-card .compact-row { border-color: rgba(236, 249, 238, .14); }
.dashboard-grid .bill-card .compact-row strong { color: #fff; }
.dashboard-grid .bill-card .compact-row small, .dashboard-grid .bill-card .compact-date small { color: rgba(229, 246, 231, .65); }
.dashboard-grid .bill-card .compact-date { background: rgba(255, 255, 255, .12); color: #fff; }
.dashboard-grid .bill-card .amount { color: #f6e0ad; }
.dashboard-grid .bill-card .compact-row .status-pill { grid-column: 2 / -1; justify-self: start; margin-top: -3px; border-color: rgba(255, 255, 255, .16); background: rgba(255, 255, 255, .1); color: #e5f3e7; }
.dashboard-grid .bill-card .compact-row .overview-mark-paid { grid-column: 2 / -1; justify-self: start; padding: 0; color: #f3dfaa; font-size: 9px; }
.dashboard-grid .bill-card .surface-link { color: #e5f3e7; }
.dashboard-grid .bill-card .surface-icon { background: rgba(255, 255, 255, .13); color: #e5f3e7; }

@media (max-width: 780px) {
  .overview-command { grid-template-columns: 1fr; gap: 18px; }
  .overview-command-glance { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 560px) {
  #view-overview .overview-command { order: 2; }
  #view-overview > .section-head:not(.compact-head) { order: 3; }
  #view-overview .dashboard-grid { order: 4; }
  #view-overview > .section-head.compact-head { order: 5; }
  #view-overview .pulse-card { order: 6; }
  #view-overview .next-strip { order: 7; }
  #view-overview .welcome-banner { order: 8; }
  .overview-command { padding: 21px; }
  .overview-command h2 { font-size: 23px; }
  .overview-command-glance { grid-template-columns: 1fr; }
  .overview-command-actions .primary-btn, .overview-command-actions .small-action { flex: 1; }
  .foundation-toast { right: 14px; left: 14px; max-width: none; }
}

/* Keep the mobile overview in the same reading order as the product promise:
   quote first, then money, then the household follow-through. This final
   block intentionally wins over the earlier progressive enhancement rules. */
@media (max-width: 560px) {
  #view-overview { display: flex; flex-direction: column; }
  #view-overview .welcome-banner { order: 1; margin-top: 0; min-height: 235px; }
  #view-overview .metric-grid { order: 2; }
  #view-overview .overview-command { order: 3; }
  #view-overview #household-insights { order: 4; }
  #view-overview > .section-head:not(.compact-head) { order: 5; }
  #view-overview .dashboard-grid { order: 6; }
  #view-overview > .section-head.compact-head { order: 7; }
  #view-overview .pulse-card { order: 8; }
  #view-overview #household-activity { order: 9; }
  #view-overview .next-strip { order: 10; }
  #view-overview .welcome-banner h1 { font-size: 30px; }
  #view-overview .welcome-banner .banner-art { top: 86px; width: 150px; height: 150px; }
}

/* Billing workspaces: read the important truth first, then enter edit mode. */
.bill-workspace-overlay,
.bill-editor-overlay { align-items: stretch; justify-items: end; padding: 0; background: rgba(20, 45, 38, .3); backdrop-filter: blur(4px); }
.bill-workspace-overlay .bill-workspace,
.bill-editor-overlay .foundation-modal { width: min(820px, 100%); max-width: 100%; height: 100dvh; max-height: none; overflow: auto; padding: 30px 32px calc(30px + env(safe-area-inset-bottom)); border-radius: 22px 0 0 22px; box-shadow: -20px 0 65px rgba(20, 45, 38, .15); animation: billing-workspace-in .24s ease both; }
.bill-editor-overlay .foundation-modal { width: min(900px, 100%); }
@keyframes billing-workspace-in { from { opacity: .3; transform: translateX(24px); } to { opacity: 1; transform: translateX(0); } }
.bill-workspace .modal-head { align-items: flex-start; margin-bottom: 20px; }
.bill-workspace .modal-head h2 { max-width: 600px; font-size: clamp(25px, 4vw, 34px); }
.bill-workspace-subtitle { margin: 7px 0 0; color: #8a9990; font-size: 10px; }
.bill-workspace-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(180px, .65fr); gap: 16px; margin-bottom: 18px; padding: 20px; border: 1px solid #d7e6d9; border-radius: 15px; background: linear-gradient(135deg, #f4faf4, #e8f2e9); }
.bill-workspace-hero > div:first-child { display: grid; align-content: center; gap: 4px; }
.bill-workspace-kicker { color: #6e8b78; font: 700 9px 'DM Mono', monospace; letter-spacing: .08em; text-transform: uppercase; }
.bill-workspace-hero strong { color: var(--forest); font: 500 30px 'DM Mono', monospace; letter-spacing: -1px; }
.bill-workspace-hero small { color: #78907f; font-size: 10px; }
.bill-workspace-hero-meta { display: grid; grid-template-columns: 1fr auto; align-content: center; gap: 6px 12px; padding-left: 16px; border-left: 1px solid #d3e2d5; }
.bill-workspace-hero-meta span { color: #8ea298; font-size: 9px; }
.bill-workspace-hero-meta strong { overflow: hidden; font-size: 11px; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.bill-workspace-section { margin-top: 15px; padding: 19px 20px; border: 1px solid #e2e9e2; border-radius: 14px; background: #fffefa; }
.bill-workspace-section .surface-head { margin-bottom: 14px; }
.bill-workspace-section .surface-head h3 { margin: 4px 0 0; font-size: 17px; letter-spacing: -.4px; }
.bill-fact-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.bill-fact-grid > div { display: grid; gap: 4px; min-width: 0; padding: 12px 13px; border: 1px solid #edf0eb; border-radius: 10px; background: #fbfcf8; }
.bill-fact-grid span { color: #93a097; font-size: 9px; }
.bill-fact-grid strong { overflow: hidden; color: var(--ink); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.bill-fact-grid strong em { color: #a87968; font-size: 11px; font-style: normal; font-weight: 700; }
.bill-fact-grid small { color: #9aa69e; font-size: 9px; line-height: 1.4; }
.bill-workspace-attention { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 15px; padding: 16px 18px; border: 1px solid #ead9ad; border-radius: 14px; background: #fffaf0; }
.bill-workspace-attention > div { display: grid; gap: 5px; min-width: 0; }
.bill-workspace-attention .eyebrow { margin: 0; color: #9a7c40; }
.bill-workspace-attention strong { color: #6d5a38; font-size: 11px; }
.bill-workspace-attention span { color: #9b8968; font-size: 9px; }
.bill-workspace-notes p:last-child { margin: 5px 0 0; color: #6d7d72; font-size: 11px; line-height: 1.6; white-space: pre-wrap; }
.bill-workspace-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; padding-top: 18px; border-top: 1px solid #e9eee8; }
.bill-workspace-actions .primary-btn, .bill-workspace-actions .small-action { min-height: 42px; }
.bill-workspace-actions .primary-btn { flex: 0 0 auto; }
.bill-supplier-link { display: inline-flex; align-items: center; text-decoration: none; }
.bill-editor-overlay .foundation-modal .modal-head { position: sticky; top: -30px; z-index: 3; padding-bottom: 16px; background: var(--card); }
.bill-editor-overlay .foundation-modal .foundation-edit-form > .primary-btn { position: sticky; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 2; box-shadow: 0 8px 20px rgba(20, 45, 38, .14); }
.field-managed input[readonly] { border-color: #cbded0; background: #f0f7f0; color: #637a6a; }
.managed-field-note { color: #62806b!important; }
.split-unit-field { display: grid; gap: 7px; margin-top: 10px; color: #65756b; font-size: 10px; font-weight: 800; }
.split-unit-field select { width: 100%; }
.split-member .percent-input input { font-variant-numeric: tabular-nums; }

@media (max-width: 780px) {
  .bill-workspace-overlay,
  .bill-editor-overlay { align-items: stretch; justify-items: stretch; padding: 0; }
  .bill-workspace-overlay .bill-workspace,
  .bill-editor-overlay .foundation-modal { width: 100%; height: 100dvh; padding: max(20px, env(safe-area-inset-top)) 18px calc(22px + env(safe-area-inset-bottom)); border-radius: 0; }
  .bill-editor-overlay .foundation-modal .modal-head { top: calc(-1 * max(20px, env(safe-area-inset-top))); padding-top: max(20px, env(safe-area-inset-top)); }
  .bill-editor-overlay .foundation-edit-form input,
  .bill-editor-overlay .foundation-edit-form select,
  .bill-editor-overlay .foundation-edit-form textarea { font-size: 16px; }
  .bill-workspace-hero { grid-template-columns: 1fr; }
  .bill-workspace-hero-meta { padding-top: 13px; padding-left: 0; border-top: 1px solid #d3e2d5; border-left: 0; }
  .bill-fact-grid { grid-template-columns: 1fr; }
  .bill-workspace-attention { align-items: stretch; flex-direction: column; }
  .bill-workspace-attention .small-action { width: 100%; }
}

/* Phase 2: finish only the missing bill essentials without forcing the full editor. */
.bill-missing-pill { border-color: #ead9ad; background: #fff8e7; color: #987840; }
.bill-setup-help { color: #9b8968; font-size: 9px; line-height: 1.45; }
.bill-completion-overlay { align-items: stretch; justify-items: end; padding: 0; background: rgba(20, 45, 38, .3); backdrop-filter: blur(4px); }
.bill-completion-overlay .bill-completion-flow { display: flex; width: min(560px, 100%); max-width: 100%; height: 100dvh; max-height: none; flex-direction: column; padding: 30px 32px calc(30px + env(safe-area-inset-bottom)); border-radius: 22px 0 0 22px; box-shadow: -20px 0 65px rgba(20, 45, 38, .15); animation: billing-workspace-in .24s ease both; }
.bill-completion-flow .modal-head { align-items: flex-start; margin-bottom: 26px; }
.bill-completion-flow .modal-head h2 { max-width: 410px; font-size: clamp(25px, 4vw, 34px); }
.bill-completion-body { display: flex; min-height: 0; flex: 1; flex-direction: column; }
.bill-flow-progress { position: relative; display: grid; grid-template-columns: 1fr auto; gap: 8px; padding-bottom: 12px; border-bottom: 1px solid #e6ece6; color: #78927f; font: 500 9px 'DM Mono', monospace; letter-spacing: .08em; }
.bill-flow-progress strong { color: #4c7e5e; font-weight: 500; }
.bill-flow-progress i { position: absolute; bottom: -2px; left: 0; display: block; height: 3px; border-radius: 99px; background: var(--forest-2); transition: width .2s ease; }
.bill-flow-context { margin: 24px 0 0; color: #91a098; font: 500 10px 'DM Mono', monospace; }
.bill-flow-question { display: grid; align-content: center; flex: 1; gap: 9px; padding: 18px 0 30px; }
.bill-flow-question .eyebrow { margin: 0; color: var(--peach); }
.bill-flow-question h3 { max-width: 430px; margin: 0; color: var(--forest); font-size: clamp(24px, 4vw, 32px); letter-spacing: -1px; }
.bill-flow-question > p:not(.eyebrow) { max-width: 410px; margin: 0 0 10px; color: #82948a; font-size: 11px; line-height: 1.6; }
.bill-flow-field { display: grid; gap: 8px; max-width: 430px; margin-top: 13px; color: #4f6659; font-size: 11px; font-weight: 800; }
.bill-flow-field input, .bill-flow-field select { min-height: 48px; padding: 12px 13px; border: 1px solid #dce5dc; border-radius: 11px; background: #fffefa; color: var(--ink); font-size: 14px; }
.bill-flow-field input:focus, .bill-flow-field select:focus { border-color: #77a88a; outline: 3px solid rgba(119, 168, 138, .16); }
.bill-flow-field .currency-input { display: flex; align-items: center; min-height: 48px; border: 1px solid #dce5dc; border-radius: 11px; background: #fffefa; }
.bill-flow-field .currency-input > span { padding-left: 13px; color: #78927f; font: 500 14px 'DM Mono', monospace; }
.bill-flow-field .currency-input input { width: 100%; min-height: 46px; border: 0; background: transparent; }
.bill-flow-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; padding-top: 18px; border-top: 1px solid #e6ece6; }
.bill-flow-actions .primary-btn { margin-left: auto; min-height: 43px; }
.bill-flow-actions .small-action, .bill-flow-actions .text-btn { min-height: 40px; }

@media (max-width: 780px) {
  .bill-completion-overlay { align-items: stretch; justify-items: stretch; }
  .bill-completion-overlay .bill-completion-flow { width: 100%; height: 100dvh; padding: max(20px, env(safe-area-inset-top)) 18px calc(22px + env(safe-area-inset-bottom)); border-radius: 0; }
  .bill-completion-flow .modal-head { margin-bottom: 20px; }
  .bill-flow-question { align-content: start; padding-top: 28px; }
  .bill-flow-actions { align-items: stretch; }
  .bill-flow-actions .primary-btn { flex: 1 1 100%; order: -1; margin-left: 0; }
  .bill-flow-actions .small-action, .bill-flow-actions .text-btn { flex: 1; }
}
.modal-error {
  margin: 14px 0 0;
  padding: 12px 14px;
  border: 1px solid rgba(190, 94, 68, .35);
  border-radius: 12px;
  background: #fff2ee;
  color: #9b4d3b;
  font-size: .9rem;
  line-height: 1.45;
}

.modal-error[hidden] { display: none; }

.bill-form-section {
  display: block;
  margin: 0;
  padding: 20px;
  border: 1px solid #dbe5dc;
  border-radius: 18px;
  background: rgba(248, 251, 247, .72);
}
.bill-form-section legend { padding: 0 8px; color: var(--ink); font-size: 1.05rem; font-weight: 750; }
.bill-form-section .section-intro { max-width: 680px; margin: 0 0 16px; }
.bill-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.bill-form-grid > label, .bill-form-grid > .payment-method-details { min-width: 0; }
.bill-form-grid .span-2, .bill-form-grid > .payment-method-details { grid-column: 1 / -1; }
.bill-form-section .field-help { display: block; }
.bill-linked-amounts { align-self: end; }
.bill-linked-amounts input { accent-color: #2b7563; }
.currency-input { display: flex; align-items: center; min-height: 48px; border: 1px solid var(--line, #dbe5dc); border-radius: 11px; background: #fffefa; }
.currency-input > span { padding-left: 13px; color: #78927f; font: 500 14px 'DM Mono', monospace; }
.currency-input input { width: 100%; min-height: 46px; border: 0; background: transparent; }
.currency-input input:focus { outline: none; }
.payment-method-details { padding: 14px; border: 1px dashed #c8d9cc; border-radius: 14px; background: rgba(235, 245, 235, .64); }
.payment-method-details[hidden], .split-custom-fields[hidden] { display: none; }
.payment-method-details .bill-form-grid { margin-top: 10px; }
.split-custom-fields { padding-top: 4px; }
.split-unit-field[hidden] { display: none; }
.bill-workspace-updates p { margin: 8px 0; color: var(--muted, #6f8178); white-space: pre-wrap; }
.bill-workspace-updates .activity-row { align-items: flex-start; }

@media (max-width: 780px) {
  .bill-form-section { padding: 16px; border-radius: 15px; }
  .bill-form-grid { grid-template-columns: 1fr; gap: 13px; }
  .bill-form-grid .span-2, .bill-form-grid > .payment-method-details { grid-column: auto; }
  .login-form input { font-size: 16px; }
}

/* Today is the iPhone home-screen root: attention, the next seven days,
   this month's plan, then low-priority shared history. */
#view-overview.overview-today {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, .85fr);
  gap: 30px 24px;
  width: min(100%, 1060px);
  margin: 0 auto;
}

#view-overview.overview-today > * { min-width: 0; margin: 0; order: initial; }

.home-status-card {
  grid-column: 1 / -1;
  position: relative;
  padding: 20px 22px;
  border: 1px solid rgba(45, 107, 85, .16);
  border-radius: 17px;
  background: rgba(247, 251, 246, .82);
  box-shadow: 0 10px 28px rgba(20, 42, 37, .045);
}

.home-status-card::before {
  position: absolute;
  inset: 15px auto 15px 0;
  width: 3px;
  border-radius: 0 6px 6px 0;
  background: #7eac8d;
  content: '';
}

.home-status-card.is-urgent { border-color: rgba(190, 94, 68, .28); background: #fff8f4; }
.home-status-card.is-urgent::before { background: var(--cb-critical); }
.home-status-card.is-open { border-color: rgba(164, 126, 47, .25); background: #fffbf1; }
.home-status-card.is-open::before { background: #c5a04d; }
.home-status-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.home-status-heading .eyebrow { margin: 0; color: var(--forest-2); }
.home-status-card h1 { margin: 9px 0 0; color: var(--ink); font-size: clamp(20px, 3vw, 25px); line-height: 1.18; letter-spacing: -.65px; }
.home-status-card > p:not(.eyebrow) { max-width: 680px; margin: 7px 0 0; color: var(--ink-soft); font-size: 14px; line-height: 1.5; }
.home-status-action {
  min-height: 44px;
  margin-top: 15px;
  padding: 9px 0;
  border: 0;
  background: transparent;
  color: var(--forest-2);
  font: 800 14px Manrope, sans-serif;
  text-align: left;
  cursor: pointer;
}
.home-status-action span { display: inline-block; margin-left: 4px; font-size: 21px; line-height: 0; transform: translateY(2px); }

.home-section { min-width: 0; }
.home-section-head { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 12px; }
.home-section-head .eyebrow { margin: 0 0 3px; }
.home-section-head h2, .home-activity h2 { margin: 0; color: var(--ink); font-size: 22px; line-height: 1.16; letter-spacing: -.55px; }
.home-section-head .text-btn { min-height: 44px; padding: 8px 0 7px 12px; font-size: 13px; white-space: nowrap; }
.home-section-head .text-btn span { margin-left: 2px; font-size: 19px; line-height: 0; }

.home-agenda-list {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--card);
  box-shadow: 0 12px 34px rgba(20, 42, 37, .055);
}
.home-agenda-row {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 18px;
  align-items: center;
  width: 100%;
  min-height: 78px;
  padding: 11px 14px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.home-agenda-row:last-child { border-bottom: 0; }
.home-agenda-row:active { background: rgba(45, 107, 85, .08); }
.home-agenda-row:focus-visible, .home-status-action:focus-visible { outline: 3px solid rgba(45, 107, 85, .28); outline-offset: -3px; }
.home-agenda-date { display: grid; align-content: center; align-self: stretch; padding-right: 12px; border-right: 1px solid var(--line); }
.home-agenda-date strong { color: var(--forest-2); font-size: 12px; line-height: 1.2; }
.home-agenda-date small { margin-top: 3px; color: var(--muted); font: 500 11px 'DM Mono', monospace; }
.home-agenda-copy { display: grid; gap: 2px; min-width: 0; padding: 0 13px; }
.home-agenda-copy > span { color: var(--muted); font: 600 10px 'DM Mono', monospace; text-transform: uppercase; }
.home-agenda-copy strong { overflow: hidden; color: var(--ink); font-size: 15px; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.home-agenda-copy small { overflow: hidden; color: var(--ink-soft); font-size: 13px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.home-row-chevron { color: #9aac9f; font-size: 25px; font-weight: 400; }
.home-agenda-bill .home-agenda-date strong { color: #a16c35; }
.home-agenda-birthday .home-agenda-date strong { color: #b86452; }
.home-agenda-event .home-agenda-date strong { color: #4e7490; }
.home-agenda-empty { display: grid; gap: 4px; padding: 20px; }
.home-agenda-empty strong { color: var(--ink); font-size: 15px; }
.home-agenda-empty span { color: var(--ink-soft); font-size: 13px; line-height: 1.5; }

.home-money-section { align-self: start; }
#view-overview .home-money-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: linear-gradient(145deg, #18382e, #2d6b55);
  box-shadow: 0 15px 38px rgba(20, 42, 37, .12);
}
#view-overview .home-money-grid .metric-card {
  min-height: 112px;
  padding: 17px 15px;
  border: 0;
  border-right: 1px solid rgba(255, 255, 255, .13);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: #f5fbf6;
}
#view-overview .home-money-grid .metric-card:last-child { border-right: 0; }
#view-overview .home-money-grid .metric-card .eyebrow { color: rgba(235, 247, 237, .62); }
#view-overview .home-money-grid .metric-card strong { margin-top: 8px; color: #fff; font-size: clamp(16px, 2.3vw, 22px); letter-spacing: -.6px; }
#view-overview .home-money-grid .metric-card > span { margin-top: 5px; color: rgba(235, 247, 237, .68); font-size: 11px; line-height: 1.35; }
#view-overview .home-money-grid .metric-card.summary-missing strong { color: #f4dda8; font: 700 14px Manrope, sans-serif; letter-spacing: 0; }
.home-money-note { margin: 9px 2px 0; color: var(--muted); font-size: 12px; line-height: 1.45; }

#view-overview .home-activity { grid-column: 1 / -1; padding: 20px 22px 4px; border-radius: 17px; box-shadow: 0 10px 28px rgba(20, 42, 37, .045); }
#view-overview .home-activity .surface-head { margin-bottom: 6px; }
#view-overview .home-activity .activity-row { min-height: 62px; padding: 10px 0; }
#view-overview .home-activity .activity-row-copy strong { font-size: 14px; }
#view-overview .home-activity .activity-row-copy small { font-size: 12px; }

@media (max-width: 780px) {
  #view-overview.overview-today { display: flex; flex-direction: column; gap: 28px; width: 100%; }
  #view-overview.overview-today > * { order: initial !important; }
  .home-status-card { padding: 17px 18px; }
  .home-status-card h1 { font-size: 20px; }
  .home-status-card > p:not(.eyebrow) { font-size: 14px; }
  .home-section-head h2, .home-activity h2 { font-size: 21px; }
  #view-overview .home-money-grid .metric-card { min-height: 105px; padding: 15px 12px; }
  #view-overview .home-money-grid .metric-card strong { font-size: 18px; }
  #view-overview .home-activity { padding: 18px 18px 3px; }
}

@media (max-width: 390px) {
  .home-agenda-row { grid-template-columns: 58px minmax(0, 1fr) 16px; padding-right: 11px; padding-left: 11px; }
  .home-agenda-copy { padding-right: 8px; padding-left: 11px; }
  #view-overview .home-money-grid .metric-card { padding-right: 9px; padding-left: 9px; }
  #view-overview .home-money-grid .metric-card strong { font-size: 16px; }
  #view-overview .home-money-grid .metric-card > span { font-size: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .home-agenda-row, .home-status-action { transition: none; }
}
