:root {
  color-scheme: dark;
  font-family: 'DM Sans', sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --page: #0d1425;
  --sidebar: #101a2e;
  --panel: #151f34;
  --panel-raised: #1a2740;
  --line: rgba(160, 179, 216, .12);
  --text: #f4f7ff;
  --muted: #8b99b5;
  --muted-2: #65728d;
  --teal: #11d8c0;
  --blue: #628cff;
  --green: #24d99b;
  --red: #ff7f8b;
  --orange: #ffac73;
  --radius: 18px;
  background: var(--page);
  color: var(--text);
}

* { box-sizing: border-box; }

html {
  width: 100%;
  min-height: 100%;
  overflow-x: hidden;
  scroll-padding-top: 105px;
  -webkit-text-size-adjust: 100%;
}

html.modal-open {
  height: 100% !important;
  overflow: hidden !important;
  overscroll-behavior: none !important;
}

body.modal-open {
  position: fixed !important;
  left: 0 !important;
  right: 0 !important;
  top: var(--locked-scroll-y, 0px) !important;
  width: 100% !important;
  height: 100% !important;
  overflow: hidden !important;
  overscroll-behavior: none !important;
}

.messenger-dialog,
.messenger-call-dialog,
.alert-dialog {
  overscroll-behavior: contain !important;
}

.messenger-shell,
.messenger-layout,
.messenger-list-pane,
.messenger-chat-list,
.messenger-conversation,
.messenger-messages,
.messenger-member-choices,
.smart-assistant-panel,
.smart-assistant-messages {
  overscroll-behavior: contain !important;
  touch-action: pan-y !important;
  -webkit-overflow-scrolling: touch;
}

body {
  width: 100%;
  max-width: 100%;
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  touch-action: pan-x pan-y;
  background:
    radial-gradient(ellipse at 78% 0%, rgba(38, 80, 126, .12), transparent 36%),
    var(--page);
  color: var(--text);
}

button, input, select { font: inherit; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
.hidden { display: none !important; }

.app-shell { min-height: 100vh; min-height: 100svh; }
.connection-status { position: fixed; z-index: 1000; right: 16px; bottom: 16px; max-width: min(420px, calc(100vw - 32px)); padding: 11px 14px; border: 1px solid #f59e0b; border-radius: 12px; background: #fffbeb; box-shadow: 0 12px 30px rgba(15,23,42,.16); color: #92400e; font-size: 13px; font-weight: 700; }
.connection-status.hidden { display: none !important; }

.sidebar {
  position: fixed;
  z-index: 5;
  inset: 0 auto 0 0;
  display: flex;
  flex-direction: column;
  width: 248px;
  padding: 34px 20px 22px;
  background: linear-gradient(180deg, #111b30 0%, #10192b 100%);
  border-right: 1px solid rgba(160, 179, 216, .08);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  width: fit-content;
  margin: 0 0 54px 8px;
  font-family: 'Manrope', sans-serif;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -.8px;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(17, 216, 192, .35);
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(17, 216, 192, .18), rgba(98, 140, 255, .12));
  color: var(--teal);
  font-size: 27px;
  line-height: 1;
}

.brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
}

.brand-accent { color: var(--teal); }
.brand-copy { display: grid; gap: 2px; line-height: 1.08; }
.brand-credit { color: var(--muted); font-family: 'DM Sans', sans-serif; font-size: 8px; font-weight: 600; letter-spacing: .45px; }
.mobile-brand { display: none; }
.mobile-account-shortcut { display: none; }
button.mobile-quick-add { display: none; }
.mobile-account-nav { display: none; }
.nav-caption, .eyebrow, .panel-kicker { color: var(--muted-2); font-size: 10px; font-weight: 800; letter-spacing: 1.35px; }
.nav-caption { margin: 0 0 13px 12px; }
.primary-nav { display: grid; gap: 8px; }

.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 48px;
  padding: 0 13px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: #94a1bb;
  font-size: 14px;
  font-weight: 600;
  transition: background .18s ease, color .18s ease, border-color .18s ease;
}

.nav-link:hover { background: rgba(255, 255, 255, .045); color: var(--text); }
.nav-link.active { border-color: rgba(17, 216, 192, .12); background: linear-gradient(100deg, #16a9c7, #0dd9c3); box-shadow: 0 8px 28px rgba(14, 211, 195, .18); color: #f5ffff; }
.nav-icon { display: inline-grid; width: 21px; place-items: center; font-size: 21px; line-height: 1; }
.nav-icon svg { display: block; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.nav-count { display: inline-grid; flex: 0 0 auto; min-width: 20px; height: 20px; place-items: center; margin-left: auto; padding: 0 4px; border: 1px solid rgba(255,255,255,.2); border-radius: 99px; background: #ff4355; color: #111318; text-align: center; font-size: 11px; font-weight: 900; line-height: 1; }
.sidebar-bottom { margin-top: auto; padding-top: 15px; border-top: 1px solid var(--line); }
.sidebar-footnote { margin: 12px 12px 0; color: var(--muted-2); font-size: 11px; }

.app-content { min-width: 0; margin-left: 248px; }
.app-content { position: relative; }
.dashboard-loading .sidebar { visibility: hidden; }
.dashboard-loading-state { position: fixed; z-index: 9998; inset: 0; display: flex; align-items: center; justify-content: center; width: 100vw; min-height: 100vh; min-height: 100dvh; padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); overflow: hidden; background: linear-gradient(160deg, #ecfdf5, #f5f7f8 50%, #e0f2fe); color: #0f172a; animation: dashboardLoaderFadeIn .42s cubic-bezier(.16, 1, .3, 1) both; }
.dashboard-loading-state.hidden { display: none !important; }
.dashboard-loading-state .splash-center { max-width: 90vw; }
.dashboard-loading-state .dashboard-loading-message { margin: 0; }
.dashboard-loading-state .dashboard-retry-button { position: relative; z-index: 3; margin: 18px auto 0; }
@keyframes dashboardLoaderFadeIn { from { opacity: 0; transform: scale(1.015); } to { opacity: 1; transform: none; } }
.data-skeleton-shell { width: min(100%, 980px); }
.data-skeleton-line, .data-skeleton-title, .data-skeleton-card, .data-skeleton-row { position: relative; overflow: hidden; background: #e2e8f0; }
.data-skeleton-line::after, .data-skeleton-title::after, .data-skeleton-card::after, .data-skeleton-row::after { position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.66), transparent); content: ""; transform: translateX(-100%); animation: data-skeleton-shimmer 1.35s ease-in-out infinite; }
.data-skeleton-line { width: 120px; height: 12px; margin-bottom: 12px; border-radius: 99px; }
.data-skeleton-line-short { width: 92px; }
.data-skeleton-title { width: min(310px, 70%); height: 30px; margin-bottom: 28px; border-radius: 9px; }
.data-skeleton-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
.data-skeleton-card { height: 132px; border-radius: 20px; }
.data-skeleton-list { display: grid; gap: 10px; }
.data-skeleton-row { height: 68px; border-radius: 16px; }
.data-skeleton-shell p { margin: 18px 0 0; color: #64748b; font-size: 14px; text-align: center; }
.dashboard-retry-button { display: block; margin: 10px auto 0; }
@keyframes data-skeleton-shimmer { 100% { transform: translateX(100%); } }
@media (max-width: 700px) { .dashboard-loading-state { padding: 0 16px; } .data-skeleton-grid { grid-template-columns: 1fr; } .data-skeleton-card { height: 86px; } }
@media (prefers-reduced-motion: reduce) {
  .dashboard-loading-state,
  .dashboard-loading-state .splash-blob,
  .dashboard-loading-state .splash-pulse-ring,
  .dashboard-loading-state .splash-logo-card,
  .dashboard-loading-state .splash-brand-title,
  .dashboard-loading-state .splash-tagline,
  .dashboard-loading-state .splash-credit,
  .dashboard-loading-state .splash-loader-area,
  .dashboard-loading-state .splash-dot { animation: none !important; }
}
.topbar {
  position: sticky;
  z-index: 4;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 92px;
  gap: 22px;
  padding: 16px clamp(22px, 3vw, 48px);
  border-bottom: 1px solid rgba(160, 179, 216, .08);
  background: rgba(13, 20, 37, .9);
  backdrop-filter: blur(18px);
}

.topbar-title .eyebrow { margin: 0 0 5px; }
.topbar h1 { margin: 0; color: var(--text); font-family: 'Manrope', sans-serif; font-size: 24px; letter-spacing: -.7px; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.search-box { display: flex; align-items: center; gap: 11px; width: min(265px, 25vw); height: 44px; margin: 0; padding: 0 13px; border: 1px solid rgba(107,151,220,.22); border-radius: 14px; background: linear-gradient(135deg, rgba(27,43,70,.88), rgba(18,30,51,.9)); box-shadow: inset 0 1px 0 rgba(255,255,255,.035), 0 6px 18px rgba(0,0,0,.12); color: #9badca; transition: border-color .18s ease, background .18s ease, box-shadow .18s ease; }
.search-box:focus-within { border-color: rgba(17,216,192,.68); background: linear-gradient(135deg, rgba(25,48,75,.98), rgba(18,35,56,.98)); box-shadow: 0 0 0 3px rgba(17,216,192,.1), 0 8px 24px rgba(0,0,0,.18); }
.search-box > span { display: grid; width: 28px; height: 28px; flex: 0 0 auto; place-items: center; border: 1px solid rgba(17,216,192,.17); border-radius: 9px; background: rgba(17,216,192,.08); color: #6ce7d7; }
.search-icon svg { display: block; width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-width: 2; }
.search-box input { width: 100%; min-width: 0; margin: 0; padding: 0; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 13px; box-shadow: none !important; }
.search-box input::placeholder { color: #9aa9c3; }
.search-box input::-webkit-search-cancel-button { filter: grayscale(1) brightness(1.7); cursor: pointer; }
.account-chip { display: flex; align-items: center; gap: 9px; white-space: nowrap; color: #dbe4f7; font-size: 13px; font-weight: 600; }
.avatar { display: inline-grid; flex: 0 0 auto; place-items: center; border-radius: 50%; font-weight: 800; }
.avatar img { display: block; width: 100%; height: 100%; border-radius: inherit; object-fit: cover; }
.avatar-large { width: 56px; height: 56px; border: 2px solid rgba(17,216,192,.6); background: #20344b; color: #cffff8; font-size: 16px; }
.avatar-current { width: 36px; height: 36px; border: 2px solid rgba(17,216,192,.8); background: #20344b; color: #cffff8; font-size: 12px; }
.avatar-small { width: 26px; height: 26px; border: 1px solid rgba(160,179,216,.15); font-size: 8px; }
.avatar-tone-0 { border-color: rgba(17,216,192,.42); background: rgba(17,216,192,.13); color: #8cf3e2; }
.avatar-tone-1 { border-color: rgba(255,127,139,.4); background: rgba(255,127,139,.12); color: #ffabb3; }
.avatar-tone-2 { border-color: rgba(98,140,255,.45); background: rgba(98,140,255,.14); color: #b4c7ff; }
.avatar-tone-3 { border-color: rgba(255,172,115,.42); background: rgba(255,172,115,.13); color: #ffd0a7; }

.button-primary, .button-secondary, .button-quiet, .icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  transition: transform .16s ease, background .16s ease, border-color .16s ease;
}

.button-primary { background: linear-gradient(100deg, #19b9c7, #0ed7bc); box-shadow: 0 6px 20px rgba(17,216,192,.13); color: #071622; }
.button-primary:hover { background: linear-gradient(100deg, #35cada, #31e6c8); transform: translateY(-1px); }
.button-secondary { border-color: rgba(17,216,192,.24); background: rgba(17,216,192,.08); color: #aaf7eb; }
.button-secondary:hover { background: rgba(17,216,192,.15); }
.button-quiet { border-color: var(--line); background: transparent; color: #aab6cc; }
.button-quiet:hover { background: rgba(255,255,255,.06); color: var(--text); }
.quick-add span { font-size: 19px; line-height: 0; }
.logout-button { min-height: 36px; padding-inline: 11px; }
.alert-sound-button, .ring-household-button { min-height: 40px; padding-inline: 11px; white-space: nowrap; }

.alert-dialog { width: min(440px, calc(100% - 28px)); padding: 0; overflow: hidden; border: 1px solid rgba(160,179,216,.2); border-radius: 18px; background: linear-gradient(145deg, #192640, #111b2f); color: var(--text); box-shadow: 0 28px 90px rgba(0,0,0,.5); }
.alert-dialog::backdrop { background: rgba(3,8,17,.72); backdrop-filter: blur(5px); }
.alert-dialog form { display: grid; gap: 12px; padding: 25px; }
.alert-dialog .panel-kicker { margin: 0; color: var(--teal); }
.alert-dialog h2 { margin: 0; color: #f4f7ff; font-family: 'Manrope', sans-serif; font-size: 20px; }
.alert-dialog-copy { margin: -4px 0 2px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.alert-dialog label { color: #c9d4e7; font-size: 11px; font-weight: 700; }
.alert-dialog textarea { width: 100%; resize: vertical; padding: 11px; border: 1px solid var(--line); border-radius: 10px; outline: 0; background: #0f192b; color: var(--text); font: inherit; font-size: 13px; }
.alert-dialog textarea:focus { border-color: rgba(17,216,192,.6); box-shadow: 0 0 0 3px rgba(17,216,192,.08); }
.alert-dialog .message { margin: 0; }
.alert-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }
.person-debt-details { display: grid; gap: 8px; max-height: 230px; overflow: auto; padding: 11px; border: 1px solid var(--line); border-radius: 12px; background: rgba(8,15,28,.22); }
.person-debt-details h3 { margin: 0; color: var(--text); font: 700 12px Manrope, sans-serif; }
.person-debt-balance-summary { display: grid; gap: 6px; }
.person-debt-balance-row { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 10px; line-height: 1.4; }
.person-debt-balance-row strong { color: var(--text); white-space: nowrap; }
.person-debt-balance-row strong.person-debt-amount-added { color: #31d698; }
.person-debt-balance-row strong.person-debt-amount-deducted { color: #ff7180; }
.person-debt-expense > strong.person-debt-amount-added { color: #31d698; }
.person-debt-expense > strong.person-debt-amount-deducted { color: #ff7180; }
.person-debt-balance-row.final { padding-top: 7px; border-top: 1px solid var(--line); color: var(--text); font-weight: 700; }
.person-debt-balance-row.final strong { color: var(--teal); }
.person-debt-expense-list { display: grid; gap: 7px; }
.person-debt-expense { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); }
.person-debt-expense > div:first-child { min-width: 0; }
.person-debt-expense strong { display: block; color: var(--text); font-size: 11px; }
.person-debt-expense p { margin: 3px 0 0; color: var(--muted); font-size: 10px; line-height: 1.4; }
.person-debt-expense-actions { display: flex; flex: 0 0 auto; gap: 8px; }
.person-debt-expense-actions { align-items: center; }
.person-debt-expense-actions button { min-height: 34px; padding: 0 11px; border-radius: 9px; font-size: 10px; white-space: nowrap; }
.person-debt-expense-actions .person-debt-edit-button { color: #aaf7eb; }
.person-debt-expense-actions .person-debt-delete-button { border-color: rgba(255,115,130,.28); background: rgba(255,115,130,.08); color: #ffadb5; }
.person-debt-expense-actions .person-debt-delete-button:hover { border-color: rgba(255,115,130,.52); background: rgba(255,115,130,.16); }
.person-debt-expense-actions button:focus-visible { outline: 2px solid #4de2cf; outline-offset: 2px; }
.person-debt-expense-actions button:disabled { cursor: wait; opacity: .58; }
@media (max-width: 480px) {
  .person-debt-expense { align-items: flex-start; flex-direction: column; }
  .person-debt-expense-actions { width: 100%; }
  .person-debt-expense-actions button { flex: 1; }
}
.alarm-settings-content { display: grid; gap: 12px; padding: 25px; }
.alarm-settings-content .panel-kicker, .alarm-settings-content h2 { margin: 0; }
.alarm-settings-content h2 { color: #f4f7ff; font-family: 'Manrope', sans-serif; font-size: 20px; }
.alarm-choice { display: flex; align-items: center; gap: 9px; padding: 11px; border: 1px solid var(--line); border-radius: 10px; background: rgba(8,15,28,.3); color: #dce6f7; cursor: pointer; font-size: 11px; }
.alarm-choice input { margin: 0; accent-color: #11d8c0; }
.custom-alarm-controls { display: grid; gap: 8px; }
.custom-alarm-controls label { color: #c9d4e7; font-size: 11px; font-weight: 700; }
.custom-alarm-controls input[type="file"] { width: 100%; color: var(--muted); font-size: 10px; }
.custom-alarm-note { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.alarm-dialog-actions { margin-top: 3px; }
.incoming-alert { position: fixed; z-index: 1000; inset: 0; display: grid; place-items: center; padding: clamp(18px, 4vw, 48px); background: rgba(13,20,37,.78); backdrop-filter: blur(12px) saturate(120%); }
.incoming-alert-card { position: relative; z-index: 1; display: grid; justify-items: center; width: min(600px, 100%); padding: clamp(25px, 5vw, 42px) clamp(22px, 6vw, 58px); border: 1px solid rgba(160,179,216,.18); border-radius: var(--radius); background: linear-gradient(145deg, rgba(25,37,59,.98), rgba(20,31,51,.98)); box-shadow: 0 24px 70px rgba(0,0,0,.36), inset 0 1px 0 rgba(255,255,255,.06); text-align: center; }
.incoming-alert-topline { display: flex; align-items: center; justify-content: space-between; width: 100%; gap: 18px; color: var(--muted); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.incoming-alert-brand { display: inline-flex; align-items: center; gap: 8px; color: var(--text); font-weight: 800; letter-spacing: -.02em; text-transform: none; }
.incoming-alert-brand img { width: 27px; height: 27px; border-radius: 9px; }
.incoming-alert-live { display: inline-flex; align-items: center; gap: 7px; color: var(--teal); font-weight: 800; }
.incoming-alert-live span { width: 7px; height: 7px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 10px rgba(17,216,192,.45); }
.incoming-alert-icon { display: grid; width: 78px; height: 78px; margin: 34px 0 20px; place-items: center; border: 1px solid rgba(17,216,192,.38); border-radius: 22px; background: linear-gradient(145deg, rgba(17,216,192,.16), rgba(17,216,192,.05)); font-size: 36px; box-shadow: 0 14px 30px rgba(0,0,0,.14), inset 0 1px 0 rgba(255,255,255,.08); animation: incoming-ring-pulse .9s ease-in-out infinite; }
.incoming-alert-kicker { margin: 0 0 10px; color: var(--teal); font-size: 9px; font-weight: 800; letter-spacing: 1.2px; }
.incoming-alert-copy { width: 100%; min-width: 0; }
.incoming-alert-copy strong { display: block; color: var(--text); font-family: 'Manrope', sans-serif; font-size: clamp(21px, 3.5vw, 29px); line-height: 1.2; }
.incoming-alert-copy p { margin: 14px auto 8px; max-width: 450px; color: #d7e2f4; font-size: clamp(15px, 2vw, 17px); line-height: 1.5; overflow-wrap: anywhere; }
.incoming-alert-time { color: var(--muted); font-size: 11px; }
.incoming-alert-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; width: 100%; margin-top: 26px; }
.incoming-alert-actions button { min-width: 160px; min-height: 45px; font-size: 13px; }
.incoming-alert-footnote { margin: 18px 0 0; color: var(--muted-2); font-size: 10px; }
@keyframes incoming-ring-pulse { 50% { transform: rotate(14deg) scale(1.08); box-shadow: 0 0 22px rgba(17,216,192,.25); } }
@media (prefers-reduced-motion: reduce) { .incoming-alert-icon { animation: none; } }
@media (max-width: 520px) { .incoming-alert-card { min-height: min(690px, calc(100dvh - 36px)); border-radius: 24px; } .incoming-alert-topline { align-items: flex-start; flex-direction: column; } .incoming-alert-live { align-self: flex-start; } .incoming-alert-actions { flex-direction: column; } .incoming-alert-actions button { width: 100%; } }

.dashboard-main { width: min(1580px, 100%); margin: 0 auto; padding: 28px clamp(22px, 3vw, 48px) 56px; }
.welcome-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0 0 20px; }
.welcome-row .eyebrow { margin: 0 0 5px; }
.welcome-row h2 { margin: 0; color: var(--text); font-family: 'Manrope', sans-serif; font-size: 23px; letter-spacing: -.6px; }
.role-note { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.admin-badge, .member-admin-badge { display: inline-flex; align-items: center; gap: 5px; padding: 6px 10px; border: 1px solid rgba(36,217,155,.2); border-radius: 99px; background: rgba(36,217,155,.1); color: #63e9ba; font-size: 11px; font-weight: 800; white-space: nowrap; }
.dashboard-message:empty { display: none; }
.dashboard-message { margin: 0 0 14px; color: var(--red); }

.panel { min-width: 0; padding: 21px; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(145deg, rgba(25,37,59,.96), rgba(20,31,51,.96)); box-shadow: 0 10px 30px rgba(0,0,0,.12); }
.panel h2 { margin: 0; color: #eff4ff; font-family: 'Manrope', sans-serif; font-size: 16px; font-weight: 700; letter-spacing: -.25px; }
.panel p { color: var(--muted); line-height: 1.55; }
.panel-kicker { margin: 0 0 7px; font-size: 9px; letter-spacing: 1.2px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 17px; }
.compact-heading { margin-bottom: 15px; }
.quiet-pill { display: inline-flex; align-items: center; min-height: 25px; padding: 0 9px; border: 1px solid var(--line); border-radius: 99px; color: #9caac3; font-size: 10px; font-weight: 700; white-space: nowrap; }

.dashboard-layout { display: grid; grid-template-columns: minmax(0, 1.72fr) minmax(280px, .84fr); align-items: start; gap: 18px; }
.dashboard-main-column, .dashboard-side-column { display: grid; min-width: 0; gap: 18px; }

.spend-panel { display: grid; grid-template-columns: 1fr; align-items: center; min-height: 156px; padding: 22px 25px; overflow: hidden; border-color: rgba(17,216,192,.3); background: radial-gradient(ellipse at 34% 40%, rgba(17,216,192,.13), transparent 48%), linear-gradient(120deg, #162d40, #1a2947 78%, #202c4e); box-shadow: 0 0 35px rgba(17,216,192,.055), 0 12px 35px rgba(0,0,0,.16); }
.spend-panel.over-budget { border-color: rgba(255,82,96,.7); background: radial-gradient(ellipse at 34% 40%, rgba(255,82,96,.2), transparent 52%), linear-gradient(120deg, #542331, #382039 78%, #30233e); box-shadow: 0 0 30px rgba(255,69,87,.16), 0 12px 35px rgba(0,0,0,.16); }
.spend-panel.over-budget .spend-copy h2, .spend-panel.over-budget .spend-total { color: #fff0f1; }
.spend-panel.over-budget .spend-caption { color: #ffd2d5; }
.budget-overrun-alert { margin: 11px 0 0; color: #ffb0b6; font-size: 13px; font-weight: 800; }
.spend-copy h2 { color: #d7e8f7; font-size: 15px; }
.spend-total { display: block; margin: 10px 0 2px; color: white; font-family: 'Manrope', sans-serif; font-size: clamp(29px, 3.4vw, 45px); font-weight: 800; letter-spacing: -1.7px; line-height: 1.05; }
.spend-caption { color: #92a6c0; font-size: 11px; }

.balance-list { display: grid; gap: 8px; }
.balance-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 58px; padding: 11px 13px; border: 1px solid rgba(160,179,216,.08); border-radius: 12px; background: rgba(8,15,28,.25); }
.balance-description { display: flex; align-items: center; gap: 10px; min-width: 0; }
.balance-description div { min-width: 0; }
.balance-description strong { display: block; overflow: hidden; color: #e7edf9; font-size: 12px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.balance-description span { color: var(--muted); font-size: 10px; }
.balance-amount { color: var(--green); font-size: 14px; font-weight: 800; white-space: nowrap; }
.balance-row.owes .balance-amount { color: var(--red); }
.balance-row.settled .balance-amount { color: var(--muted); }
.balance-note { margin: 13px 0 0; font-size: 10px; }
.balance-empty { padding: 13px; border: 1px dashed var(--line); border-radius: 11px; color: var(--muted); font-size: 12px; }

.transactions-panel { padding-bottom: 8px; }
.transaction-search-box { flex: 0 1 250px; width: min(250px, 32vw); margin-left: auto; }
.table-scroll { width: 100%; overflow-x: auto; }
.transactions-table { width: 100%; border-collapse: collapse; text-align: left; white-space: nowrap; }
.transactions-table th { padding: 10px 8px; border-bottom: 1px solid var(--line); color: #7785a0; font-size: 10px; font-weight: 700; }
.transactions-table td { padding: 12px 8px; border-bottom: 1px solid rgba(160,179,216,.075); color: #d8e0f0; font-size: 11px; }
.transactions-table tbody tr:last-child td { border-bottom: 0; }
.transactions-table tbody tr:hover { background: rgba(255,255,255,.025); }
.transaction-title { display: flex; align-items: center; flex-wrap: wrap; gap: 5px 9px; }
.transaction-icon { display: grid; width: 29px; height: 29px; flex: 0 0 auto; place-items: center; border: 1px solid rgba(160,179,216,.1); border-radius: 9px; background: rgba(255,255,255,.035); color: #aebbd2; font-size: 14px; }
.transaction-name { max-width: 240px; overflow: hidden; text-overflow: ellipsis; }
.transaction-admin-actions { display: flex; flex-basis: 100%; align-items: center; gap: 9px; margin: 0 0 0 38px; }
.transaction-admin-actions .text-button { font-size: 9px; }
.transaction-delete-button { padding: 0; border: 0; background: none; color: #ff9ca5; cursor: pointer; font: inherit; font-size: 9px; }
.transaction-person { display: flex; align-items: center; gap: 7px; }
.transaction-mobile-label { display: none; }
.avatar-small { width: 25px; height: 25px; font-size: 9px; }
.split-status { color: #9eabc1; }
.align-right { text-align: right !important; }
.empty-row td { padding: 25px 10px; color: var(--muted); text-align: center; }

.member-list { display: grid; gap: 8px; }
.member-row { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; min-height: 42px; padding: 4px 1px; color: #dbe4f5; font-size: 12px; }
.member-identity { display: flex; align-items: center; gap: 9px; min-width: 0; }
.member-name { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-admin-badge { padding: 4px 7px; font-size: 9px; }
.remove-member-button { margin-left: auto; padding: 6px 9px; border: 1px solid rgba(255,127,139,.22); border-radius: 8px; background: rgba(255,127,139,.08); color: #ff9ca5; cursor: pointer; font-size: 10px; font-weight: 700; }
.remove-member-button:hover { background: rgba(255,127,139,.16); }
.invite-box { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; padding: 11px 12px; border: 1px dashed rgba(17,216,192,.25); border-radius: 11px; background: rgba(17,216,192,.045); }
.invite-box .panel-kicker { margin-bottom: 3px; }
.invite-box strong { display: block; color: #d9fff8; font-family: 'Manrope', sans-serif; font-size: 14px; letter-spacing: 2px; }
.icon-button { width: 34px; min-height: 34px; padding: 0; border-color: var(--line); background: rgba(255,255,255,.045); color: #aebbd2; font-size: 18px; }
.icon-button:hover { border-color: rgba(17,216,192,.35); color: var(--teal); }
.top-message-button { width: 40px; min-height: 40px; padding: 0; }
.top-message-button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }

.messenger-dialog, .messenger-call-dialog { width: min(920px, calc(100% - 24px)); max-width: none; max-height: min(780px, calc(100dvh - 28px)); padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 24px; background: var(--panel); color: var(--text); box-shadow: 0 28px 90px rgba(0,0,0,.48); }
.messenger-dialog::backdrop, .messenger-call-dialog::backdrop { background: rgba(3,8,17,.72); backdrop-filter: blur(6px); }
.messenger-shell { display: flex; min-height: 620px; max-height: min(780px, calc(100dvh - 28px)); flex-direction: column; }
.messenger-header, .messenger-conversation-header, .messenger-call-shell > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 18px; border-bottom: 1px solid var(--line); }
.messenger-header h2, .messenger-call-shell h2 { margin: 0; font: 750 20px Manrope, sans-serif; }
.messenger-header .panel-kicker, .messenger-call-shell .panel-kicker { margin: 0 0 3px; }
.messenger-layout { display: grid; min-height: 0; flex: 1; grid-template-columns: minmax(220px, 30%) 1fr; }
.messenger-list-pane { display: flex; min-height: 0; flex-direction: column; gap: 10px; padding: 14px; border-right: 1px solid var(--line); }
.messenger-new-chat { width: 100%; }
.messenger-chat-list { display: grid; align-content: start; gap: 7px; overflow: auto; }
.messenger-chat-item { display: grid; gap: 4px; width: 100%; padding: 11px; border: 1px solid transparent; border-radius: 14px; background: transparent; color: var(--text); text-align: left; cursor: pointer; }
.messenger-chat-item.has-unread { position: relative; padding-right: 22px; }
.messenger-unread-dot { position: absolute; top: 17px; right: 10px; width: 8px; height: 8px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 10px rgba(17,216,192,.45); }
.messenger-chat-item:hover, .messenger-chat-item.active { border-color: var(--line); background: var(--panel-raised); }
.messenger-chat-item strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.messenger-chat-item small { overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.messenger-conversation { position: relative; display: flex; min-width: 0; min-height: 0; flex-direction: column; }
.messenger-conversation-header { min-height: 62px; padding: 10px 14px; }
.messenger-conversation-title { display: grid; gap: 3px; min-width: 0; }
.messenger-conversation-title strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.messenger-conversation-title small, .messenger-new-heading small { color: var(--muted); font-size: 10px; }
.messenger-call-actions { display: flex; gap: 7px; }
.messenger-call-actions .icon-button { width: 38px; min-height: 38px; font-size: 17px; }
.messenger-messages { display: flex; min-height: 0; flex: 1; flex-direction: column; gap: 9px; padding: 15px; overflow-y: auto; overscroll-behavior: contain; }
.messenger-bubble { max-width: min(82%, 520px); align-self: flex-start; padding: 9px 12px; border: 1px solid var(--line); border-radius: 15px 15px 15px 5px; background: var(--panel-raised); overflow-wrap: anywhere; white-space: pre-wrap; }
.messenger-bubble.mine { align-self: flex-end; border-color: rgba(17,216,192,.24); border-radius: 15px 15px 5px 15px; background: rgba(17,216,192,.12); }
.messenger-bubble strong { display: block; margin-bottom: 3px; color: var(--teal); font-size: 10px; }
.messenger-bubble p { margin: 0; font-size: 13px; line-height: 1.45; }
.messenger-bubble time { display: block; margin-top: 4px; color: var(--muted); text-align: right; font-size: 9px; }
.messenger-compose { display: flex; align-items: end; gap: 8px; padding: 10px; border-top: 1px solid var(--line); }
.messenger-compose textarea { min-height: 42px; max-height: 110px; flex: 1; resize: vertical; padding: 11px; border: 1px solid var(--line); border-radius: 13px; background: var(--page); color: var(--text); font: inherit; font-size: 13px; }
.messenger-empty { display: grid; flex: 1; align-content: center; justify-items: center; gap: 8px; padding: 22px; color: var(--muted); text-align: center; }
.messenger-empty span { color: var(--teal); font-size: 36px; }
.messenger-empty strong { color: var(--text); font-size: 15px; }
.messenger-empty p { margin: 0; font-size: 12px; }
.messenger-new-panel { position: absolute; z-index: 2; inset: 0; display: flex; flex-direction: column; gap: 14px; padding: 16px; background: var(--panel); }
.messenger-new-heading { display: flex; align-items: start; justify-content: space-between; gap: 10px; }
.messenger-new-heading > div { display: grid; gap: 5px; }
.messenger-member-choices { display: grid; gap: 8px; overflow-y: auto; }
.messenger-member-choice { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 13px; }
.messenger-member-choice input { accent-color: var(--teal); }
.messenger-member-choice .avatar { width: 36px; height: 36px; }
.messenger-call-dialog { width: min(760px, calc(100% - 24px)); }
.messenger-call-shell { display: grid; gap: 10px; padding-bottom: 16px; }
.call-timer { color: var(--muted); font-variant-numeric: tabular-nums; }
.call-video-grid { display: grid; min-height: 240px; max-height: 60dvh; grid-template-columns: repeat(auto-fit,minmax(180px,1fr)); gap: 8px; padding: 12px; background: #050914; }
.call-video-grid video { width: 100%; height: 100%; min-height: 220px; max-height: 54dvh; border-radius: 14px; background: #10182a; object-fit: cover; }
.call-status { min-height: 20px; margin: 0; padding: 0 16px; color: var(--muted); text-align: center; font-size: 11px; }
.call-controls { display: flex; justify-content: center; gap: 12px; }
.call-controls .icon-button { width: 48px; min-height: 48px; }
.call-controls .icon-button.is-muted { border-color: rgba(230,79,97,.55); background: rgba(230,79,97,.16); }
.call-end-button { width: 56px; min-height: 48px; border: 0; border-radius: 16px; background: #e64f61; color: white; font-size: 21px; transform: rotate(135deg); cursor: pointer; }
@media (max-width: 650px) {
  .messenger-dialog { width: calc(100% - 12px); height: calc(100dvh - 12px); max-height: none; border-radius: 18px; }
  .messenger-shell { min-height: 0; height: 100%; max-height: none; }
  .messenger-layout { grid-template-columns: 112px minmax(0,1fr); }
  .messenger-list-pane { padding: 8px 6px; }
  .messenger-chat-item { padding: 8px 6px; }
  .messenger-chat-item strong { font-size: 10px; }
  .messenger-chat-item small { font-size: 9px; }
  .messenger-new-chat { padding: 8px 4px; font-size: 10px; }
  .messenger-bubble { max-width: 92%; }
  .messenger-call-dialog { width: calc(100% - 16px); }
}

.category-content { display: grid; grid-template-columns: 126px minmax(0,1fr); align-items: center; gap: 16px; }
.category-donut { position: relative; width: 126px; aspect-ratio: 1; border-radius: 50%; background: conic-gradient(#11d8c0 0 45%, #ff7f8b 45% 70%, #ffac73 70% 85%, #628cff 85% 100%); }
.category-donut::after { position: absolute; inset: 21px; border: 1px solid rgba(160,179,216,.08); border-radius: 50%; background: #18243a; content: ''; }
.category-legend { display: grid; gap: 10px; min-width: 0; }
.legend-row { display: grid; grid-template-columns: 8px minmax(0,1fr) auto; align-items: center; gap: 8px; color: #aebad0; font-size: 10px; }
.legend-dot { width: 7px; height: 7px; border-radius: 50%; }
.legend-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.legend-value { display: grid; gap: 2px; color: #d9e2f1; font-weight: 700; text-align: right; }
.legend-value small { color: var(--muted); font-size: 9px; font-weight: 500; }
.category-empty { grid-column: 1 / -1; color: var(--muted); font-size: 11px; }
.flowchart-page { display: grid; width: min(1580px, 100%); gap: 18px; margin: 0 auto; }
.flowchart-slider-controls { display: grid; grid-template-columns: 44px minmax(120px, 220px) 44px; align-items: center; justify-content: center; gap: 14px; }
.flowchart-slider-controls > span { color: #f3f7ff; font-family: 'Manrope', sans-serif; font-size: 15px; font-weight: 800; text-align: center; }
.flowchart-slide-button { display: grid; width: 44px; height: 44px; place-items: center; border: 1px solid rgba(17,216,192,.3); border-radius: 13px; background: #172238; color: #65dec2; cursor: pointer; font-size: 30px; line-height: 1; transition: background .18s ease, transform .18s ease; }
.flowchart-slide-button:hover { transform: translateY(-1px); background: #20304a; }
.flowchart-slide-button:focus-visible { outline: 2px solid #65dec2; outline-offset: 3px; }
.flowchart-slider-viewport { min-width: 0; overflow: hidden; }
.flowchart-slider-track { display: flex; width: 200%; align-items: start; transition: transform .35s ease; }
.flowchart-section { display: grid; flex: 0 0 50%; width: 50%; min-width: 0; align-content: start; gap: 14px; padding: 0 1px; }
.flowchart-section-heading { padding: 2px 3px; }
.flowchart-section-heading .panel-kicker { margin-bottom: 5px; }
.flowchart-section-heading h2 { margin: 0; color: #f3f7ff; font-family: 'Manrope', sans-serif; font-size: 19px; }
.flowchart-section-heading > p:last-child { margin: 5px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.flowchart-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.month-comparison-panel { min-width: 0; }
.month-comparison-chart { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; min-height: 210px; padding: 18px 22px 4px; }
.month-comparison-column { display: grid; grid-template-rows: auto minmax(110px, 1fr) auto; justify-items: center; gap: 9px; min-width: 0; }
.month-comparison-amount { color: #e6edf9; font-size: 12px; font-variant-numeric: tabular-nums; }
.month-comparison-track { display: flex; width: min(100%, 110px); height: 100%; align-items: end; overflow: hidden; border-radius: 12px 12px 4px 4px; background: rgba(8,15,28,.34); }
.month-comparison-fill { display: block; width: 100%; min-height: 0; border-radius: 10px 10px 3px 3px; background: linear-gradient(180deg, #11d8c0, #628cff); transition: height .25s ease; }
.month-comparison-column.previous .month-comparison-fill { background: linear-gradient(180deg, #b38cff, #628cff); }
.month-comparison-label { color: var(--muted); font-size: 11px; text-align: center; }
.personal-flow-summary { display: grid; gap: 7px; padding: 18px; border: 1px solid var(--line); border-radius: 13px; background: radial-gradient(ellipse at 100% 0, rgba(17,216,192,.08), transparent 60%), #172238; }
.personal-flow-summary > span, .personal-flow-summary > small { color: var(--muted); font-size: 11px; }
.personal-flow-summary > strong { color: #f3f7ff; font-family: 'Manrope', sans-serif; font-size: clamp(22px, 3vw, 32px); }
.personal-flow-expense-list { display: grid; gap: 9px; max-height: 610px; overflow-y: auto; padding: 1px 3px 1px 0; }
.personal-flow-expense-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 11px; background: #172238; }
.personal-flow-expense-detail { display: grid; min-width: 0; gap: 4px; }
.personal-flow-expense-detail strong { overflow: hidden; color: #e9f0fc; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.personal-flow-expense-detail span { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.personal-flow-expense-row > strong { color: #65dec2; font-size: 12px; white-space: nowrap; }
.personal-flow-empty { margin: 0; padding: 18px 14px; border: 1px dashed var(--line); border-radius: 11px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.flow-metric-card { display: grid; align-content: space-between; min-height: 116px; gap: 9px; padding: 16px; border: 1px solid var(--line); border-radius: 13px; background: radial-gradient(ellipse at 100% 0, rgba(17,216,192,.08), transparent 60%), #172238; }
.flow-metric-card > span { color: var(--muted); font-size: 11px; }
.flow-metric-card > strong { overflow: hidden; color: #f3f7ff; font-family: 'Manrope', sans-serif; font-size: clamp(17px, 2vw, 24px); text-overflow: ellipsis; white-space: nowrap; }
.flow-metric-card > strong.over-budget { color: #ff7f8b; }
.flow-metric-card > small { color: #8d9bb4; font-size: 10px; }
.daily-spending-panel, .pace-panel { min-width: 0; }
.daily-chart-key { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 10px; white-space: nowrap; }
.daily-chart-key i { width: 16px; border-top: 2px dashed #ffae72; }
.daily-chart-key b { color: #dce6f7; font-weight: 700; }
.daily-chart-scroll { overflow-x: auto; padding-bottom: 5px; scrollbar-color: #35435e transparent; }
.daily-chart-inner { min-width: 760px; }
.daily-chart-plot { position: relative; height: 178px; padding: 0 2px; border-bottom: 1px solid rgba(160,179,216,.14); background: repeating-linear-gradient(to bottom, transparent 0, transparent 43px, rgba(160,179,216,.07) 44px, transparent 45px); }
.daily-spending-chart, .daily-spending-labels { display: grid; grid-template-columns: repeat(var(--day-count, 31), minmax(0, 1fr)); gap: 5px; }
.daily-spending-chart { position: relative; z-index: 1; align-items: end; height: 100%; }
.day-bar-column { position: relative; display: block; min-width: 0; height: 100%; }
.day-bar-value { position: absolute; z-index: 3; left: 50%; width: 100%; overflow: hidden; color: #94a4bf; font-size: 8px; text-align: center; text-overflow: ellipsis; transform: translateX(-50%); white-space: nowrap; }
.day-bar-track { position: absolute; bottom: 0; left: 50%; display: block; width: min(100%, 18px); height: 100%; overflow: hidden; border-radius: 5px 5px 2px 2px; background: rgba(160,179,216,.07); transform: translateX(-50%); }
.day-bar-fill { position: absolute; right: 0; bottom: 0; left: 0; display: block; min-height: 0; border-radius: inherit; background: linear-gradient(180deg, #25e0c5, #1385a4); box-shadow: 0 0 12px rgba(17,216,192,.18); }
.day-bar-column.over-target .day-bar-fill { background: linear-gradient(180deg, #ffc17e, #f07878); box-shadow: 0 0 12px rgba(255,127,139,.16); }
.day-bar-column.today .day-bar-track { outline: 1px solid rgba(98,140,255,.75); outline-offset: 2px; }
.day-bar-column.future .day-bar-fill { opacity: .32; }
.daily-budget-line { position: absolute; z-index: 2; right: 0; bottom: 0; left: 0; border-top: 1px dashed #ffae72; pointer-events: none; }
.daily-spending-labels { padding: 7px 2px 0; color: #7f8da8; font-size: 8px; text-align: center; }
.daily-chart-note { margin: 8px 0 0; color: var(--muted); font-size: 10px; }
.pace-comparison-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px; }
.pace-comparison-grid > div { display: grid; gap: 6px; padding: 12px; border-radius: 10px; background: rgba(8,15,28,.26); }
.pace-comparison-grid span { color: var(--muted); font-size: 10px; }
.pace-comparison-grid strong { color: #eaf1fc; font-size: 14px; }
.pace-progress { height: 7px; margin-top: 15px; overflow: hidden; border-radius: 9px; background: rgba(255,255,255,.08); }
.pace-progress span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #1ad2bc, #6b92ff); transition: width .25s ease; }
.pace-progress span.over-pace { background: linear-gradient(90deg, #ffc17e, #f07878); }
.pace-message { margin: 8px 0 0; color: var(--muted); font-size: 10px; }
.pending-page { display: grid; width: min(1180px, 100%); gap: 16px; margin: 0 auto; }
.pending-page .pending-panel { margin-top: 0; }
.pending-page-empty { margin: 0; color: var(--muted); }
.add-expense-page { display: grid; width: min(1280px, 100%); gap: 16px; margin: 0 auto; }
.add-expense-page .action-panel { margin-top: 0; }
.settings-page { display: grid; width: min(1250px, 100%); gap: 16px; margin: 0 auto; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); align-items: start; gap: 14px; }
.alert-preferences-panel > p { margin: -3px 0 15px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.push-alert-controls { display: grid; justify-items: start; gap: 7px; margin-bottom: 12px; }
.ios-push-install-hint { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: rgba(8,15,28,.2); color: var(--muted); font-size: 11px; line-height: 1.5; }
.ios-push-install-hint[hidden] { display: none; }
.ios-push-install-hint strong { color: var(--text); font-size: 12px; }
.ios-push-install-hint ol { display: grid; gap: 5px; margin: 8px 0; padding-left: 19px; }
.ios-push-install-hint b { color: var(--text); }
.ios-push-install-hint > span { display: block; font-size: 10px; }
.alarm-preference-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: rgba(8,15,28,.24); }
.alarm-preference-row > div { display: grid; gap: 4px; }
.alarm-preference-row strong { color: #e6edf9; font-size: 11px; }
.alarm-preference-row span { color: var(--muted); font-size: 10px; }
.alarm-preference-row .button-secondary { flex: 0 0 auto; }
.page-intro { margin: 0 0 2px; }
.page-intro .panel-kicker { margin: 0 0 5px; }
.page-intro h2 { margin: 0; color: var(--text); font-family: 'Manrope', sans-serif; font-size: 23px; }
.page-intro > p:last-child { margin: 7px 0 0; color: var(--muted); font-size: 12px; }
.flow-category-panel, .flow-roommate-panel { width: min(900px, 100%); }
.flow-category-panel .category-content { grid-template-columns: 155px minmax(150px, 340px); justify-content: center; gap: 20px; }
.flow-category-panel .category-donut { width: 155px; }
.roommate-chart-caption { color: var(--muted); font-size: 10px; }
.roommate-spending-chart { display: grid; gap: 13px; }
.roommate-spending-row { display: grid; grid-template-columns: minmax(112px, 160px) minmax(60px, 1fr) auto; align-items: center; gap: 12px; }
.roommate-spending-identity { display: flex; min-width: 0; align-items: center; gap: 8px; }
.roommate-spending-identity .avatar { flex: 0 0 auto; }
.roommate-spending-name { overflow: hidden; color: #e6edf9; font-size: 11px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.roommate-spending-track { height: 11px; overflow: hidden; border: 1px solid rgba(160,179,216,.08); border-radius: 99px; background: rgba(8,15,28,.42); }
.roommate-spending-bar { display: block; height: 100%; min-width: 0; border-radius: inherit; background: linear-gradient(90deg, #11d8c0, #628cff); transition: width .25s ease; }
.roommate-spending-bar-1 { background: linear-gradient(90deg, #628cff, #b38cff); }
.roommate-spending-bar-2 { background: linear-gradient(90deg, #ffac73, #ff7f8b); }
.roommate-spending-bar-3 { background: linear-gradient(90deg, #11d8c0, #71e9ce); }
.roommate-spending-amount { display: grid; gap: 2px; color: #e6edf9; font-size: 11px; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.roommate-spending-amount small { color: var(--muted); font-size: 9px; }
.roommate-chart-empty { margin: 0; color: var(--muted); font-size: 11px; }

.budget-total { display: block; margin: 4px 0; color: white; font-family: 'Manrope', sans-serif; font-size: 25px; font-weight: 800; letter-spacing: -.8px; }
.budget-used { margin: 0 0 11px; font-size: 11px; }
.budget-previous-usage { margin: -5px 0 11px; color: var(--muted); font-size: 10px; }
.budget-progress { height: 6px; overflow: hidden; border-radius: 9px; background: rgba(255,255,255,.09); }
.budget-progress span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--teal), var(--blue)); transition: width .25s ease; }
.budget-remaining { margin: 8px 0 14px !important; color: #71e9ce !important; font-size: 11px !important; }
.budget-panel.over-budget { border-color: rgba(255,82,96,.5); }
.budget-panel.over-budget .budget-remaining { color: #ff7f8b !important; }
.budget-progress span.over-budget { background: linear-gradient(90deg, #ffac73, #ff5260); }
.account-budget-summary { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 13px; background: rgba(8,15,28,.24); }
.account-budget-summary.over-budget { border-color: rgba(255,82,96,.48); background: rgba(255,82,96,.07); }
.account-budget-copy { display: grid; gap: 5px; min-width: 0; }
.account-budget-copy .panel-kicker, .account-budget-copy h3, .account-budget-copy p { margin: 0; }
.account-budget-copy h3 { color: #e6edf9; font-size: 13px; }
.account-budget-copy > p:not(.panel-kicker), .account-budget-payment-status { color: var(--muted); font-size: 10px; line-height: 1.45; }
.account-budget-share { color: #71e9ce; font-size: 12px; }
.account-budget-overage-share { color: #ff929b; font-size: 11px; font-weight: 700; }
.account-budget-summary.over-budget .account-budget-share { color: #ff929b; }
.account-budget-summary .button-primary { flex: 0 0 auto; }
.budget-form { padding-top: 12px; border-top: 1px solid var(--line); }
.budget-form label, .form-field label { margin: 0 0 6px; color: #9baac2; font-size: 10px; font-weight: 700; }
.inline-form-row { display: flex; gap: 7px; }
.inline-form-row input { min-width: 0; margin: 0; }
.inline-form-row button { min-width: 68px; padding: 0 11px; }
.budget-panel .message { margin-top: 8px; font-size: 10px; }
.personal-panel { display: grid; gap: 12px; }
.personal-panel .panel-kicker { margin-bottom: -2px; }
.personal-account-page { position: relative; display: grid; gap: 22px; max-width: 1050px; margin: 0 auto; }
.profile-page-title-row { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.profile-page-title-row > h2 { margin: 0; }
.profile-menu-button { display: inline-grid; width: 42px; height: 42px; place-content: center; gap: 4px; padding: 0; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.035); color: var(--text); cursor: pointer; }
.profile-menu-button:hover, .profile-menu-button[aria-expanded="true"] { border-color: rgba(17,216,192,.45); background: rgba(17,216,192,.1); }
.profile-menu-button span { display: block; width: 18px; height: 2px; border-radius: 2px; background: currentColor; }
.profile-menu-backdrop { position: fixed; z-index: 80; inset: 0; background: rgba(15,23,42,.34); opacity: 0; pointer-events: none; transition: opacity .24s ease; }
.profile-menu-backdrop.is-visible { opacity: 1; pointer-events: auto; }
.profile-menu-panel { position: fixed; z-index: 81; top: 0; bottom: 0; left: 0; display: flex; flex-direction: column; width: min(316px, 86vw); min-width: 280px; padding: 52px 12px 16px; border: 0; border-right: 1px solid #e2e8f0; border-radius: 0 24px 24px 0; background: #fff; box-shadow: 8px 0 32px rgba(15,23,42,.18); color: #0f172a; transform: translateX(-105%); visibility: hidden; pointer-events: none; transition: transform .45s cubic-bezier(.2,.8,.2,1), visibility 0s linear .45s; }
.profile-menu-panel.is-open { transform: translateX(0); visibility: visible; pointer-events: auto; transition-delay: 0s; }
.profile-menu-drawer-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 4px 0 6px; }
.profile-menu-brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.profile-menu-brand-mark { display: grid; width: 44px; height: 44px; flex: 0 0 44px; place-items: center; overflow: hidden; border-radius: 14px; background: #0f766e; }
.profile-menu-brand-mark img { width: 100%; height: 100%; object-fit: cover; }
.profile-menu-brand strong, .profile-menu-brand small { display: block; }
.profile-menu-brand strong { font-size: 20px; line-height: 1.15; }
.profile-menu-brand small { margin-top: 3px; color: #475569; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-menu-eyebrow { margin: 0 0 5px; color: #0f766e; font-size: 11px; font-weight: 800; letter-spacing: .14em; }
.profile-menu-drawer-header h3 { margin: 0; color: #0f172a; font-size: 26px; line-height: 1.1; }
.profile-menu-close { display: grid; width: 44px; height: 44px; flex: 0 0 44px; place-items: center; padding: 0; border: 0; border-radius: 50%; background: #f1f5f9; color: #0f172a; cursor: pointer; }
.profile-menu-close:hover { border-color: #0f766e; color: #0f766e; }
.profile-menu-account-card { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 64px; margin: 16px 0 0; padding: 10px 12px; border: 1px solid #e2e8f0; border-radius: 16px; background: #f5f7f8; color: #0f172a; cursor: pointer; text-align: left; }
.profile-menu-avatar { display: grid; width: 44px; height: 44px; flex: 0 0 44px; place-items: center; overflow: hidden; border-radius: 50%; background: #ccfbf1; color: #115e59; font-size: 18px; font-weight: 700; }
.profile-menu-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-menu-account-copy { display: grid; flex: 1; min-width: 0; gap: 3px; }
.profile-menu-account-copy strong { overflow: hidden; font-size: 16px; text-overflow: ellipsis; white-space: nowrap; }
.profile-menu-account-copy small { color: #475569; font-size: 14px; }
.profile-menu-account-card > svg { color: #475569; }
.profile-menu-page-list { display: flex; flex: 1; flex-direction: column; gap: 2px; padding-top: 16px; overflow-y: auto; }
.profile-menu-page-list button { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 52px; padding: 0 14px; border: 0; border-radius: 14px; background: transparent; color: #0f172a; cursor: pointer; text-align: left; font: 600 16px/1.2 Inter, sans-serif; }
.profile-menu-page-list button span { width: 22px; color: #0f766e; font-size: 21px; text-align: center; }
.profile-menu-page-list button:hover, .profile-menu-page-list button:focus-visible { background: #f0fdfa; color: #0f766e; outline: none; }
.profile-menu-section-label { margin: 16px 14px 4px; color: #475569; font-size: 13px; font-weight: 600; }
.profile-menu-page-list .profile-menu-logout { margin-top: auto; border-top: 1px solid #e2e8f0; border-radius: 0; color: #b91c1c; }
.profile-menu-page-list .profile-menu-logout span { color: #dc2626; }
.account-page-heading { display: flex; align-items: center; gap: 15px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.account-page-heading .panel-kicker { margin: 0 0 5px; }
.account-page-heading h2 { margin: 0; color: var(--text); font-family: 'Manrope', sans-serif; font-size: 22px; }
.account-page-avatar { width: 54px; height: 54px; border: 2px solid rgba(17,216,192,.6); background: rgba(17,216,192,.12); color: #a6f7e9; font-size: 16px; }
.account-name { margin: 5px 0 0; color: #e8eefb; font-size: 13px; font-weight: 700; }
.account-email { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.personal-account-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.personal-stat-card { display: grid; gap: 9px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: rgba(8,15,28,.24); }
.personal-stat-card span { color: var(--muted); font-size: 11px; }
.personal-stat-card strong { color: #e6edf9; font-size: 18px; }
.account-settlement-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.account-settlement-card { min-width: 0; padding: 15px; border: 1px solid var(--line); border-radius: 12px; background: rgba(8,15,28,.24); }
.payable-card { border-color: rgba(255,127,139,.18); }
.receivable-card { border-color: rgba(36,217,155,.18); }
.account-settlement-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.account-settlement-heading .panel-kicker { margin: 0 0 3px; }
.account-settlement-heading h3 { margin: 0; color: #e6edf9; font-size: 13px; }
.account-settlement-heading > strong { color: #ffabb3; font-size: 16px; white-space: nowrap; }
.receivable-card .account-settlement-heading > strong { color: #71e9ce; }
.account-settlement-list { display: grid; gap: 7px; }
.account-settlement-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 9px; border: 1px solid rgba(160,179,216,.09); border-radius: 9px; background: rgba(255,255,255,.02); }
.account-settlement-person { display: flex; align-items: center; gap: 8px; min-width: 0; color: #dce6f7; font-size: 10px; }
.account-settlement-person > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-settlement-row > strong { color: #ffabb3; font-size: 11px; white-space: nowrap; }
.receivable-card .account-settlement-row > strong { color: #71e9ce; }
.settlement-empty { margin: 0; padding: 7px 0; color: var(--muted); font-size: 10px; }
.account-settlement-person { padding: 0; border: 0; background: transparent; cursor: pointer; text-align: left; }
.account-settlement-person:hover > span:last-child { color: var(--teal); text-decoration: underline; }
.upi-profile-form { display: grid; gap: 8px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.025); }
.upi-profile-form h3 { margin: 0 0 4px; color: #e6edf9; font-size: 14px; }
.upi-profile-form label, .payment-proof-content label { color: #c9d4e7; font-size: 11px; font-weight: 700; }
.upi-profile-form input, .payment-proof-content input[type="number"] { min-width: 0; width: 100%; min-height: 40px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; outline: 0; background: #0e182a; color: white; }
.upi-profile-form .inline-form-row { display: flex; gap: 8px; }
.upi-profile-form .message { margin: 0; }
.upi-profile-form input[type="file"] { min-height: 38px; padding: 8px; color: #a5b2c8; font-size: 11px; }
.profile-edit-photo-row { display: flex; align-items: center; gap: 12px; }
.account-phone { display: inline-block; margin-top: 5px; color: var(--teal); font-size: 12px; font-weight: 700; text-decoration: underline; }
.account-upi-id { margin: 5px 0 0; color: #aaf7eb; font-size: 11px; font-weight: 600; }
.account-edit-button { flex: 0 0 auto; margin-left: auto; }
.profile-edit-page { display: grid; gap: 16px; width: min(700px, 100%); margin: 0 auto; }
.profile-edit-heading { display: grid; justify-items: start; gap: 8px; }
.profile-edit-heading > * { margin: 0; }
.profile-edit-page .upi-profile-form { gap: 12px; padding: clamp(18px, 4vw, 30px); }
.notification-prompt-content { display: grid; justify-items: center; gap: 12px; width: min(420px, calc(100vw - 40px)); padding: 30px; text-align: center; }
.notification-prompt-content h2 { margin: 0; color: var(--text); font-family: 'Manrope', sans-serif; font-size: 22px; }
.notification-prompt-content .alert-dialog-copy { margin: 0; max-width: 330px; }
.notification-prompt-content .message { width: 100%; margin: 0; }
.notification-prompt-icon { display: grid; width: 62px; height: 62px; place-items: center; border: 1px solid rgba(17,216,192,.35); border-radius: 18px; background: rgba(17,216,192,.1); font-size: 29px; }
.notification-prompt-dialog .alert-dialog-actions { width: 100%; justify-content: center; }
.payment-requests-panel { display: grid; gap: 10px; }
.payment-requests-list { display: grid; gap: 8px; }
.payment-request-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 11px; background: rgba(255,255,255,.025); }
.payment-request-main { display: grid; gap: 4px; min-width: 0; }
.payment-request-main strong { color: #e6edf9; font-size: 12px; }
.payment-request-main .transaction-person-link { color: #e6edf9; font-size: 12px; font-weight: 700; text-align: left; }
.payment-request-main span { color: var(--muted); font-size: 10px; }
.payment-request-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.payment-request-actions button { min-height: 32px; padding: 0 9px; font-size: 10px; }
.person-details-content, .payment-proof-content { display: grid; gap: 13px; padding: 24px; }
.person-details-heading { display: flex; align-items: center; gap: 13px; }
.person-details-heading h2, .payment-proof-content h2 { margin: 0; color: #f4f7ff; font-family: 'Manrope', sans-serif; font-size: 20px; }
.person-details-heading .panel-kicker { margin: 0 0 4px; }
.person-details-heading .account-email { margin: 4px 0 0; }
.person-details-amount { margin: 0; padding: 12px; border-radius: 10px; background: rgba(17,216,192,.08); color: #aaf7eb; font-size: 13px; font-weight: 700; }
.person-details-upi { margin: 0; color: #c9d4e7; font-size: 12px; overflow-wrap: anywhere; }
.upi-qr-wrap { display: grid; justify-items: center; gap: 7px; padding: 12px; border-radius: 12px; background: white; }
.upi-qr-wrap canvas { max-width: 100%; height: auto; }
.upi-qr-wrap small { color: #44516a; font-size: 10px; }
.upi-qr-toggle { width: fit-content; }
.upi-app-picker-label { margin: 0; color: var(--muted); font-size: 11px; font-weight: 650; }
.upi-app-picker { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.upi-app-link { display: grid; min-height: 42px; place-items: center; padding: 8px 5px; text-align: center; text-decoration: none; font-size: 11px; }
.payment-proof-content { max-height: min(90vh, 760px); overflow: auto; }
.payment-proof-content input[type="file"] { color: var(--muted); font-size: 11px; }
.payment-proof-preview { display: block; max-width: 100%; max-height: 220px; margin: 0 auto; border: 1px solid var(--line); border-radius: 9px; object-fit: contain; }
.person-details-dialog .alert-dialog-actions { flex-wrap: wrap; }
.payment-review-content { display: grid; gap: 12px; max-height: min(90vh, 760px); overflow: auto; padding: 24px; }
.payment-review-content h2 { margin: 0; color: #f4f7ff; font-family: 'Manrope', sans-serif; font-size: 20px; }
.payment-review-image { display: block; width: 100%; max-height: 55vh; border: 1px solid var(--line); border-radius: 10px; background: #fff; object-fit: contain; }
.payment-review-content .alert-dialog-actions { flex-wrap: wrap; }
.member-identity.person-link { padding: 0; border: 0; background: transparent; color: inherit; cursor: pointer; text-align: left; }
.member-identity.person-link:hover .member-name { color: var(--teal); text-decoration: underline; }
.balance-description.person-link { padding: 0; border: 0; background: transparent; color: inherit; cursor: pointer; text-align: left; }
.balance-description.person-link:hover strong { color: var(--teal); text-decoration: underline; }
.transaction-person-link { padding: 0; border: 0; background: transparent; color: inherit; cursor: pointer; font: inherit; }
.transaction-person-link:hover { color: var(--teal); text-decoration: underline; }
.admin-dashboard-qr { display: grid; grid-template-columns: minmax(0,1fr) minmax(260px, 340px); align-items: center; gap: 28px; margin-top: 20px; padding: clamp(22px, 4vw, 42px); border-color: rgba(17,216,192,.22); background: radial-gradient(circle at 82% 50%, rgba(17,216,192,.09), transparent 35%), linear-gradient(145deg, #17233a, #111b2e); }
.admin-dashboard-qr-copy { display: grid; justify-items: start; gap: 9px; }
.admin-dashboard-qr-copy .panel-kicker, .admin-dashboard-qr-copy h2, .admin-dashboard-qr-copy p { margin: 0; }
.admin-dashboard-qr-copy h2 { color: #f4f7ff; font-family: 'Manrope', sans-serif; font-size: clamp(20px, 2vw, 28px); }
.admin-dashboard-qr-name { color: #dce6f7; font-size: 15px; font-weight: 700; }
.admin-dashboard-qr-upi { color: var(--teal); font-size: 14px; font-weight: 700; overflow-wrap: anywhere; }
.admin-dashboard-share { margin: 0; color: #eff5ff; font-size: clamp(18px, 2vw, 25px); font-weight: 800; }
.household-member-shares { display: grid; width: min(100%, 460px); gap: 6px; }
.household-share-row { display: flex; justify-content: space-between; gap: 12px; padding: 7px 10px; border: 1px solid rgba(160,179,216,.1); border-radius: 8px; color: #c9d4e7; font-size: 11px; }
.household-share-row strong { color: #eff5ff; white-space: nowrap; }
.household-share-row span:last-child { color: var(--muted); text-align: right; }
.admin-dashboard-qr-help { color: var(--muted); font-size: 12px; line-height: 1.5; }
.admin-dashboard-qr-code { display: grid; place-items: center; padding: 15px; border-radius: 16px; background: white; box-shadow: 0 14px 40px rgba(0,0,0,.22); }
.admin-dashboard-qr-code canvas { display: block; width: min(300px, 100%); height: auto; image-rendering: pixelated; }
@media (max-width: 680px) {
  .account-page-heading { flex-wrap: wrap; }
  .account-edit-button { margin-left: auto; }
  .admin-dashboard-qr { grid-template-columns: 1fr; justify-items: center; gap: 18px; text-align: center; }
  .admin-dashboard-qr-copy { justify-items: center; }
  .admin-dashboard-qr-code { width: min(100%, 330px); }
}
.account-expense-list { max-height: none; }
.personal-stat { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 11px; }
.personal-stat strong { color: #e6edf9; font-size: 12px; }
.personal-ledger-heading { display: flex; justify-content: space-between; margin-top: 5px; padding-top: 11px; border-top: 1px solid var(--line); color: #dce6f7; font-size: 10px; font-weight: 700; }
.personal-ledger-heading span:last-child { color: var(--muted); }
.personal-expense-list { display: grid; gap: 9px; max-height: 270px; overflow: auto; }
.personal-expense-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px; border: 1px solid rgba(160,179,216,.1); border-radius: 9px; background: rgba(8,15,28,.24); }
.personal-expense-row > div { display: grid; min-width: 0; gap: 3px; }
.personal-expense-row > div:first-child strong { overflow: hidden; color: #e7eefb; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.personal-expense-row > div span, .personal-expense-empty { margin: 0; color: var(--muted); font-size: 9px; }
.personal-expense-row > .personal-expense-amounts { flex: 0 0 auto; justify-items: end; }
.personal-expense-paid, .personal-expense-owed, .personal-share { font-size: 10px; white-space: nowrap; }
.personal-expense-paid { color: #67e4c7; }
.personal-expense-owed { color: #ff8291; }
.personal-share { color: #dce6f7; }
.personal-share.excluded { color: var(--muted); }

.action-panel, .pending-panel { margin-top: 18px; }
.expense-form-grid { display: grid; grid-template-columns: 1.35fr .8fr .9fr .85fr .75fr auto; align-items: end; gap: 12px; }
.expense-type-picker { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; min-width: 0; margin: 0; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; }
.expense-type-picker legend { padding: 0 6px; color: #9baac2; font-size: 10px; font-weight: 700; }
.expense-type-option { display: flex; align-items: flex-start; gap: 9px; min-width: 0; padding: 10px; border: 1px solid rgba(160,179,216,.12); border-radius: 8px; background: rgba(16,26,45,.55); cursor: pointer; }
.expense-type-option input { flex: 0 0 auto; margin: 2px 0 0; accent-color: #11d8c0; }
.expense-type-option span { display: grid; gap: 4px; }
.expense-type-option strong { color: #edf3ff; font-size: 11px; }
.expense-type-option small { color: #9baac2; font-size: 10px; line-height: 1.45; }
.split-picker { grid-column: 1 / -1; min-width: 0; margin: 0; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; }
.split-picker legend { padding: 0 6px; color: #9baac2; font-size: 10px; font-weight: 700; }
.split-picker-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.split-picker-disabled { opacity: .48; }
.split-picker-disabled .split-picker-note { display: block; }
.split-picker-note { display: none; margin-top: 9px; color: #9baac2; font-size: 10px; }
.split-picker:disabled .split-member-option { cursor: not-allowed; }
.text-button { padding: 0; border: 0; background: none; color: #62dbd0; cursor: pointer; font: inherit; font-size: 10px; }
.split-preview { color: #b9c6dc; font-size: 10px; }
.split-member-list { display: flex; flex-wrap: wrap; gap: 8px; }
.split-member-option { display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 4px 9px; border: 1px solid rgba(160,179,216,.12); border-radius: 9px; background: rgba(8,15,28,.3); color: #dce6f7; cursor: pointer; font-size: 10px; }
.split-member-option:has(input:checked) { border-color: rgba(17,216,192,.35); background: rgba(17,216,192,.08); }
.split-member-option input { width: 14px; height: 14px; margin: 0; accent-color: #11d8c0; }
.form-field { min-width: 0; }
.form-field input, .form-field select, .form-stack input { width: 100%; min-height: 40px; margin: 0; padding: 0 11px; border: 1px solid rgba(160,179,216,.16); border-radius: 9px; outline: 0; background: #101a2d; color: #edf3ff; font-size: 12px; }
.form-field input:focus, .form-field select:focus, .form-stack input:focus, .inline-form-row input:focus { border-color: rgba(17,216,192,.6); box-shadow: 0 0 0 3px rgba(17,216,192,.08); }
.form-field select { color-scheme: dark; }
.expense-submit-field .button-primary { width: 100%; white-space: nowrap; }
.theme-preferences-panel label { display: block; margin: 0 0 6px; color: #9baac2; font-size: 10px; font-weight: 700; }
.theme-preferences-panel select { width: 100%; min-height: 40px; padding: 0 11px; border: 1px solid rgba(160,179,216,.16); border-radius: 9px; background: #101a2d; color: #edf3ff; font-size: 12px; }
.theme-preferences-panel .message { margin-bottom: 0; }
.action-panel .message { margin-top: 12px; }
.pending-list { display: grid; gap: 9px; }
.pending-list .expense-item { border-color: rgba(160,179,216,.1); background: rgba(8,15,28,.24); }
.approval-role-message { margin: -4px 0 12px; font-size: 11px; }
.expense-item { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-width: 0; padding: 13px; border: 1px solid var(--line); border-radius: 11px; background: rgba(8,15,28,.24); }
.expense-item > div:first-child { min-width: 0; }
.expense-item h3 { margin: 0 0 4px; color: #edf3ff; font-size: 12px; }
.expense-item p { margin: 0; font-size: 10px; }
.expense-amount { color: white; font-size: 12px; font-weight: 800; white-space: nowrap; }
.expense-actions { display: flex; gap: 7px; }
.expense-change-item { align-items: flex-start; }
.expense-change-item .expense-actions { flex: 0 0 auto; }
.expense-change-progress { margin-top: 5px !important; color: #80dfd2; }
.approve-expense, .reject-expense { min-height: 32px; padding: 0 10px; border: 1px solid transparent; border-radius: 8px; cursor: pointer; font-size: 10px; font-weight: 800; white-space: nowrap; }
.approve-expense { background: rgba(36,217,155,.15); color: #68e8bd; }
.approve-expense:hover { background: rgba(36,217,155,.24); }
.reject-expense { background: rgba(255,127,139,.13); color: #ff9ca5; }
.reject-expense:hover { background: rgba(255,127,139,.22); }

.message { min-height: 0; color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.message:empty { display: none; }

.setup-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(250px, .8fr); gap: 18px; }
.setup-panel h2 { margin: 6px 0; font-size: 22px; }
.setup-panel > p, .setup-aside p { font-size: 12px; }
.form-stack { display: grid; margin-top: 22px; }
.form-stack h3 { margin: 0 0 2px; color: var(--text); font-size: 14px; }
.form-stack label { margin: 10px 0 6px; color: #a1afc7; font-size: 11px; }
.form-stack input { min-height: 43px; }
.form-divider { display: flex; align-items: center; gap: 12px; margin: 17px 0; color: var(--muted-2); font-size: 9px; font-weight: 800; }
.form-divider::before, .form-divider::after { height: 1px; flex: 1; background: var(--line); content: ''; }
.setup-aside { display: flex; flex-direction: column; justify-content: center; min-height: 400px; padding: 28px; background: radial-gradient(circle at 70% 30%, rgba(17,216,192,.11), transparent 45%), linear-gradient(145deg, #172940, #151f34); }
.setup-art { position: relative; display: grid; width: 118px; height: 118px; place-items: center; margin-bottom: 30px; border: 1px solid rgba(17,216,192,.26); border-radius: 31px; background: linear-gradient(140deg, rgba(17,216,192,.13), rgba(98,140,255,.12)); color: var(--teal); font-size: 73px; }
.setup-art i { position: absolute; right: -8px; bottom: -6px; display: grid; width: 39px; height: 39px; place-items: center; border-radius: 50%; background: var(--orange); color: #212238; font-size: 19px; font-style: normal; font-weight: 800; }
.setup-aside h3 { margin: 0; color: var(--text); font-family: 'Manrope', sans-serif; font-size: 20px; }
.setup-aside p { max-width: 300px; }

.auth-screen { display: grid; min-height: 100vh; place-items: center; padding: 24px; background: radial-gradient(ellipse at 50% 10%, rgba(17,216,192,.09), transparent 45%), var(--page); }
.auth-card { width: min(430px, 100%); padding: 34px; border: 1px solid var(--line); border-radius: 20px; background: linear-gradient(145deg, #17233a, #121c2f); box-shadow: 0 24px 70px rgba(0,0,0,.3); }
.auth-brand { margin: 0 0 34px; }
.auth-card .eyebrow { margin: 0 0 8px; }
.auth-card h1 { margin: 0; color: white; font-family: 'Manrope', sans-serif; font-size: 29px; }
.public-landing-card { width: min(560px, 100%); }
.landing-intro { max-width: 440px; line-height: 1.7; }
.landing-benefits { display: grid; gap: 12px; margin: 22px 0; padding: 0; color: #c9d4e7; font-size: 13px; list-style: none; }
.landing-benefits li::before { margin-right: 10px; color: var(--teal); content: "✓"; font-weight: 800; }
.landing-actions { display: grid; gap: 10px; }
.landing-back { width: 100%; margin-top: 16px; }
.auth-intro { margin: 8px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin: 25px 0 20px; padding: 4px; border: 1px solid var(--line); border-radius: 11px; background: rgba(4,10,21,.35); }
.tabs button { min-height: 36px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; font-size: 11px; font-weight: 700; }
.tabs button.active { background: #22304a; color: #e5fff9; box-shadow: inset 0 0 0 1px rgba(17,216,192,.13); }
#authForm label { display: block; margin: 13px 0 6px; color: #a5b2c8; font-size: 11px; font-weight: 700; }
#authForm input { width: 100%; min-height: 43px; margin: 0; padding: 0 12px; border: 1px solid rgba(160,179,216,.16); border-radius: 9px; outline: 0; background: #0e182a; color: white; font-size: 12px; }
#authForm input:focus { border-color: rgba(17,216,192,.55); box-shadow: 0 0 0 3px rgba(17,216,192,.08); }
.profile-photo-field { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px 12px; }
.profile-photo-field label, .profile-photo-field input, .profile-photo-field small { grid-column: 1 / -1; }
.profile-photo-field input[type="file"] { min-height: 38px; padding: 8px; color: #a5b2c8; font-size: 11px; }
.profile-photo-field small { color: #8492aa; font-size: 10px; line-height: 1.4; }
.optional-label { color: #8492aa; font-weight: 500; }
.full-width { width: 100%; margin-top: 20px; }

@media (max-width: 1180px) {
  .dashboard-layout { grid-template-columns: minmax(0, 1.45fr) minmax(250px, .85fr); }
  .expense-form-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .expense-name-field { grid-column: span 2; }
}

@media (max-width: 900px) {
  .sidebar { position: sticky; inset: auto; width: 100%; height: auto; padding: 12px 16px 8px; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar .brand { margin: 0 0 10px 4px; font-size: 18px; }
  .sidebar .brand-mark { width: 31px; height: 31px; border-radius: 10px; font-size: 22px; }
  .nav-caption, .sidebar-bottom { display: none; }
  .primary-nav { display: flex; gap: 5px; overflow-x: auto; scrollbar-width: none; }
  .primary-nav::-webkit-scrollbar { display: none; }
  .nav-link { flex: 0 0 auto; min-height: 38px; padding: 0 10px; font-size: 11px; }
  .nav-icon { width: 17px; font-size: 17px; }
  .app-content { margin-left: 0; }
  .topbar { min-height: 77px; padding: 12px 20px; }
  .dashboard-main { padding: 22px 20px 45px; }
}

@media (max-width: 700px) {
  .topbar { display: grid; grid-template-columns: minmax(0,1fr); align-items: start; gap: 10px; padding: 12px 15px; }
  .topbar-title, .topbar-actions { min-width: 0; width: 100%; }
  .topbar h1 { font-size: 19px; }
  .topbar-title .eyebrow { font-size: 8px; }
  .topbar-actions { display: grid; grid-template-columns: minmax(0,1fr) auto auto; align-items: center; gap: 7px; }
  .search-box { grid-row: 2; grid-column: 1 / -1; order: initial; width: 100%; min-width: 0; height: 40px; }
  .quick-add { min-height: 40px; padding: 0 12px; font-size: 11px; }
  .alert-sound-button, .alarm-settings-button, .ring-household-button { min-height: 40px; padding-inline: 9px; font-size: 11px; }
  .account-chip { gap: 5px; font-size: 10px; }
  .avatar-current { width: 29px; height: 29px; }
  .logout-button { grid-column: 1 / -1; min-height: 40px; padding: 0 10px; font-size: 11px; }
  .dashboard-main { padding: 18px 13px 34px; }
  .dashboard-main, .app-content, .flowchart-page, .pending-page, .settings-page, .add-expense-page { min-width: 0; }
  .welcome-row { margin-bottom: 15px; }
  .welcome-row h2 { font-size: 19px; }
  .role-note { max-width: 280px; font-size: 10px; }
  .panel { min-width: 0; padding: 15px; border-radius: 15px; }
  .push-alert-controls { width: 100%; }
  .push-alert-controls > button { width: 100%; min-height: 48px; font-size: 13px; }
  .ios-push-install-hint { padding: 13px; font-size: 12px; }
  .ios-push-install-hint ol { gap: 7px; padding-left: 20px; }
  .ios-push-install-hint > span { font-size: 11px; }
  .section-heading { flex-wrap: wrap; align-items: flex-start; gap: 8px; }
  .dashboard-layout, .setup-grid { grid-template-columns: 1fr; gap: 13px; }
  .flowchart-metrics { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 9px; }
  .settings-grid { grid-template-columns: 1fr; gap: 12px; }
  .flow-metric-card { min-height: 100px; padding: 13px; }
  .pace-comparison-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .dashboard-main-column, .dashboard-side-column { gap: 13px; }
  .spend-panel { grid-template-columns: 1fr; gap: 7px; min-height: 0; padding: 20px 18px 14px; }
  .spend-total { font-size: 34px; }
  .category-content { grid-template-columns: 112px minmax(0,1fr); gap: 13px; }
  .personal-account-stats { grid-template-columns: 1fr; gap: 9px; }
  .account-budget-summary { align-items: stretch; flex-direction: column; }
  .account-budget-summary .button-primary { width: 100%; }
  .account-settlement-grid { grid-template-columns: 1fr; gap: 9px; }
  .category-donut { width: 112px; }
  .roommate-spending-row { grid-template-columns: minmax(92px, 120px) minmax(35px, 1fr) auto; gap: 8px; }
  .roommate-spending-name, .roommate-spending-amount { font-size: 10px; }
  .expense-form-grid { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 11px; }
  .expense-type-picker { grid-template-columns: 1fr; }
  .expense-name-field { grid-column: 1 / -1; }
  .expense-submit-field { grid-column: 1 / -1; }
  .transaction-name { max-width: 155px; }
  .transactions-table th, .transactions-table td { padding-inline: 6px; font-size: 10px; }
  .expense-item { flex-wrap: wrap; }
  .expense-actions { width: 100%; }
  .expense-actions button { flex: 1; }
  .expense-change-item > div:first-child { width: 100%; }
  .expense-change-item .expense-actions button { min-height: 40px; }
  .page-intro h2 { font-size: 21px; }
  .page-intro > p:last-child { font-size: 11px; line-height: 1.5; }
  .alert-dialog { max-height: calc(100dvh - 24px); overflow-y: auto; overscroll-behavior: contain; }
  .alert-dialog form, .person-details-content, .payment-proof-content { padding: 18px; }
  .alert-dialog-actions { flex-wrap: wrap; }
  .alert-dialog-actions > button { min-height: 40px; }
  .setup-aside { min-height: 260px; }
}

/* Final Messenger contrast pass: keep the inbox readable over every theme. */
.messenger-dialog.whatsapp-dialog .whatsapp-shell,
.messenger-dialog.whatsapp-dialog .whatsapp-list-pane,
.messenger-dialog.whatsapp-dialog .whatsapp-chat-list { background: #f5f7f8 !important; }
.messenger-dialog.whatsapp-dialog .whatsapp-main-header { background: #fff !important; }
.messenger-dialog.whatsapp-dialog .whatsapp-brand-title h2,
.messenger-dialog.whatsapp-dialog .messenger-chat-title-line strong { color: #0f172a !important; }
.messenger-dialog.whatsapp-dialog .messenger-chat-title-line time,
.messenger-dialog.whatsapp-dialog .messenger-chat-copy > small { color: #475569 !important; }
.messenger-dialog.whatsapp-dialog .messenger-chat-item { color: #0f172a !important; background: transparent !important; }
.messenger-dialog.whatsapp-dialog .messenger-chat-item::after { background: #e2e8f0 !important; }
.messenger-dialog.whatsapp-dialog .whatsapp-search-box { border-color: #e2e8f0 !important; background: #fff !important; color: #475569 !important; }
.messenger-dialog.whatsapp-dialog .whatsapp-search-box input { color: #0f172a !important; }
.messenger-dialog.whatsapp-dialog .whatsapp-search-box input::placeholder { color: #64748b !important; }
.messenger-dialog.whatsapp-dialog .messenger-filter-chip { color: #334155 !important; background: #fff !important; border-color: #cbd5e1 !important; }
.messenger-dialog.whatsapp-dialog .messenger-filter-chip.is-selected { color: #fff !important; background: #0f766e !important; border-color: #0f766e !important; }

/* Messenger chat list reference: calm light mobile inbox with compact filters. */
.messenger-filter-chips { display: flex; gap: 8px; overflow-x: auto; padding: 0 20px 12px; scrollbar-width: none; }
.messenger-filter-chips::-webkit-scrollbar { display: none; }
.messenger-filter-chip { min-height: 40px; padding: 0 17px; border: 1px solid #e2e8f0; border-radius: 999px; color: #475569; background: #fff; font: 600 14px/1 Inter, system-ui, sans-serif; white-space: nowrap; cursor: pointer; }
.messenger-filter-chip.is-selected { border-color: #0f766e; color: #fff; background: #0f766e; }
.messenger-group-avatar:not(.has-profile-photo) { background: #ede9fe !important; color: #5b21b6 !important; }
.messenger-direct-avatar:not(.has-profile-photo) { background: #fef3c7 !important; color: #92400e !important; }
.messenger-direct-avatar { position: relative; }
.messenger-direct-avatar::after { content: ""; position: absolute; right: 1px; bottom: 1px; width: 11px; height: 11px; border: 2px solid #fff; border-radius: 50%; background: #22c55e; }
.messenger-header-new-chat { display: none; }

@media (max-width: 700px) {
  .messenger-dialog.whatsapp-dialog { color: #0f172a; background: #f5f7f8; }
  .whatsapp-shell { background: #f5f7f8; }
  .whatsapp-main-header { flex: 0 0 104px; min-height: 104px; box-sizing: border-box; padding: max(52px, env(safe-area-inset-top)) 8px 8px; border-bottom: 0; background: #f5f7f8; }
  .whatsapp-brand { order: 0; flex: 1; gap: 14px; }
  .whatsapp-logo-mark, .whatsapp-badge, .whatsapp-main-header .panel-kicker { display: none; }
  .whatsapp-brand-title h2 { color: #0f172a; font-size: 22px; letter-spacing: -.5px; }
  .whatsapp-close-btn { width: 44px; height: 44px; order: -1; border: 0; border-radius: 22px; color: #0f172a; background: transparent; font-size: 0; box-shadow: none; }
  .whatsapp-close-btn svg { display: block; }
  .messenger-header-new-chat { display: grid; order: 1; width: 44px; height: 44px; flex-basis: 44px; border-radius: 22px; color: #0f766e; }
  .whatsapp-list-pane { background: #f5f7f8; }
  .whatsapp-list-header { display: none; }
  .whatsapp-search-bar { padding: 0 20px 12px; }
  .whatsapp-search-box { height: 48px; padding: 0 14px; border: 1px solid #e2e8f0; border-radius: 12px; color: #64748b; background: #fff; }
  .whatsapp-search-box input { color: #0f172a; font-size: 14px; }
  .whatsapp-search-box input::placeholder { color: #94a3b8; }
  .messenger-filter-chips { padding-bottom: 12px; }
  .whatsapp-chat-list { padding: 0 20px; background: #f5f7f8; }
  .messenger-chat-item { position: relative; min-height: 72px; padding: 12px 0; gap: 12px; border-bottom: 0; border-radius: 0; background: transparent; }
  .messenger-chat-item::after { content: ""; position: absolute; right: 0; bottom: 0; left: 56px; height: 1px; background: #e2e8f0; }
  .messenger-chat-item:hover, .messenger-chat-item.is-active { background: transparent; }
  .messenger-chat-avatar { width: 48px; height: 48px; flex-basis: 48px; }
  .messenger-chat-copy { gap: 4px; }
  .messenger-chat-title-line { gap: 8px; }
  .messenger-chat-title-line strong { color: #0f172a; font-size: 16px; font-weight: 650; }
  .messenger-chat-title-line time { color: #64748b; font-size: 14px; }
  .messenger-chat-copy > small { margin-top: 0; color: #64748b; font-size: 14px; line-height: 1.35; }
  .messenger-unread-dot { background: #0f766e; }
  .messenger-list-empty { margin: 16px 0; color: #64748b; background: #fff; }
  .whatsapp-list-pane > .message { padding-inline: 20px; }
}

/* Pending workflow: calm, stacked cards matching the mobile reference. */
#dashboard:has(#pendingExpensesPage:not(.hidden)) .app-content { background: #f5f7f8; }
#pendingExpensesPage {
  display: grid;
  width: min(100%, 640px);
  gap: 20px;
  margin: 0 auto;
  color: #0f172a;
  font: 400 16px/1.35 Inter, sans-serif;
}
#pendingExpensesPage .page-intro { display: grid; gap: 2px; margin: 0; }
#pendingExpensesPage .page-intro > * { margin: 0; }
#pendingExpensesPage .page-intro .panel-kicker { display: none; }
#pendingExpensesPage .page-intro h2 { color: #0f172a; font: 700 22px/1.2 Inter, sans-serif; }
#pendingExpensesPage .page-intro p:last-child { color: #475569; font-size: 14px; }
#pendingExpensesPage #approvalRoleMessage { display: none; }
#pendingExpensesPage .pending-panel { display: grid; gap: 8px; margin: 0; padding: 0; border: 0; background: transparent; box-shadow: none; }
#pendingExpensesPage .pending-panel .section-heading { align-items: baseline; margin: 0 4px; padding: 0; border: 0; }
#pendingExpensesPage .pending-panel .section-heading > div { display: contents; }
#pendingExpensesPage .pending-panel .section-heading .panel-kicker,
#pendingExpensesPage .pending-panel .section-heading .quiet-pill { display: none; }
#pendingExpensesPage .pending-panel .section-heading h2 { margin: 0; color: #0f172a; font: 600 16px/1.3 Inter, sans-serif; }
#pendingExpensesPage .pending-section-count { margin-left: auto; color: #475569; font-size: 14px; font-weight: 400; }
#pendingExpensesPage .pending-panel > .pending-list,
#pendingExpensesPage .pending-panel > .payment-requests-list,
#pendingExpensesPage .pending-panel > .expense-change-list { overflow: hidden; border: 1px solid #e2e8f0; border-radius: 20px; background: #fff; }
#pendingExpensesPage .pending-panel > .pending-list:empty,
#pendingExpensesPage .pending-panel > .payment-requests-list:empty { display: none; }
#pendingExpensesPage .pending-page-empty,
#pendingExpensesPage .pending-list > p,
#pendingExpensesPage .settlement-empty,
#pendingExpensesPage .approval-role-message { margin: 0; padding: 20px; border: 1px solid #e2e8f0; border-radius: 20px; background: #fff; color: #475569; font-size: 14px; }
#pendingExpensesPage .pending-empty-state { display: flex; align-items: center; gap: 14px; padding: 20px; border: 1px solid #e2e8f0; border-radius: 20px; background: #fff; }
#pendingExpensesPage .pending-empty-icon { display: grid; width: 40px; height: 40px; flex: none; place-items: center; border-radius: 50%; background: #f1f5f9; color: #475569; font-size: 20px; font-weight: 700; }
#pendingExpensesPage .pending-empty-state h3 { margin: 0; color: #0f172a; font-size: 16px; }
#pendingExpensesPage .pending-empty-state p { margin: 2px 0 0; color: #475569; font-size: 14px; }
#pendingExpensesPage .pending-list > .pending-empty-state { border: 0; border-radius: 0; }
#pendingExpensesPage .expense-item,
#pendingExpensesPage .payment-request-row { min-width: 0; padding: 12px 16px; border: 0; border-bottom: 1px solid #e2e8f0; border-radius: 0; background: #fff; box-shadow: none; }
#pendingExpensesPage .expense-item:last-child,
#pendingExpensesPage .payment-request-row:last-child { border-bottom: 0; }
#pendingExpensesPage .expense-item h3,
#pendingExpensesPage .payment-request-main strong,
#pendingExpensesPage .payment-request-main .transaction-person-link { color: #0f172a; font-size: 16px; }
#pendingExpensesPage .expense-item p,
#pendingExpensesPage .payment-request-main span { color: #475569; font-size: 14px; }
#pendingExpensesPage .expense-amount,
#pendingExpensesPage .payment-request-main > span:nth-child(2) { color: #0f172a; font-size: 16px; font-weight: 700; white-space: nowrap; }
#pendingExpensesPage .expense-actions { display: flex; flex-wrap: wrap; gap: 8px; }
#pendingExpensesPage .expense-actions button { min-height: 40px; border-radius: 10px; font-size: 14px; }
#pendingExpensesPage .approve-expense { background: #0f766e; color: #fff; }
#pendingExpensesPage .reject-expense { color: #b91c1c; }
#pendingExpensesPage .payment-requests-panel { gap: 8px; }
#pendingExpensesPage .payment-request-main { gap: 4px; flex: 1; min-width: 0; }
#pendingExpensesPage .pending-status-icon { display: grid; width: 40px; height: 40px; flex: none; place-items: center; border-radius: 50%; background: #f1f5f9; color: #475569; font-size: 20px; font-weight: 700; }
#pendingExpensesPage .pending-status-icon.is-approved { background: #d1fae5; color: #047857; }
#pendingExpensesPage .pending-status-icon.is-pending { background: #fef3c7; color: #b45309; }
#pendingExpensesPage .pending-status-icon.is-rejected { background: #fee2e2; color: #b91c1c; }
#pendingExpensesPage .payment-request-main > span:nth-child(2) { order: 3; }
#pendingExpensesPage .expense-change-item { display: flex; flex-wrap: wrap; gap: 12px; }
#pendingExpensesPage .expense-change-item > div:first-child { flex: 1; min-width: 0; }

@media (max-width: 700px) {
  #dashboard:has(#pendingExpensesPage:not(.hidden)) .app-content { min-height: calc(100dvh - 65px - max(28px, env(safe-area-inset-bottom))); }
  #dashboard:has(#pendingExpensesPage:not(.hidden)) .dashboard-main { padding: max(56px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) 32px max(20px, env(safe-area-inset-left)); }
  #dashboard:has(#pendingExpensesPage:not(.hidden)) :is(.topbar, .mobile-quick-add, .smart-assistant-toggle),
  #dashboard:has(#pendingExpensesPage:not(.hidden)) .smart-assistant-widget { display: none; }
  #pendingExpensesPage { width: 100%; gap: 20px; }
  #pendingExpensesPage .pending-panel .section-heading h2 { font-size: 16px; }
  #pendingExpensesPage .expense-item { grid-template-columns: minmax(0, 1fr) auto; }
  #pendingExpensesPage .expense-actions { width: 100%; }
  #pendingExpensesPage .expense-actions button { flex: 1; }
}

.find-friends-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 42px; padding-inline: 12px; white-space: nowrap; }
.topbar-social-actions { display: flex; align-items: center; gap: 7px; }
.friend-finder-dialog { width: min(520px, calc(100% - 28px)); max-height: min(760px, calc(100dvh - 28px)); overflow-y: auto; overscroll-behavior: contain; }
.friend-finder-content { display: grid; gap: 11px; padding: 24px; }
.friend-finder-content > .panel-kicker, .friend-finder-content > p { margin-block: 0; }
.friend-finder-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.friend-finder-title .button-quiet { min-height: 36px; padding: 0 10px; font-size: 11px; }
.friend-finder-content > input { width: 100%; min-height: 46px; padding-inline: 13px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-raised); color: var(--text); font-size: 16px; }
.friend-requests-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; padding-top: 13px; border-top: 1px solid var(--line); }
.friend-requests-heading h3 { margin: 0; color: var(--text); font-size: 15px; }
.friend-list { display: grid; gap: 8px; }
.friend-list-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; padding: 11px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.friend-list-row > strong { overflow: hidden; color: var(--text); font-size: 13px; text-overflow: ellipsis; }
.friend-row-action, .friend-request-actions > button { min-height: 36px; padding: 0 11px; font-size: 11px; white-space: nowrap; }
.friend-request-actions { display: flex; align-items: center; gap: 6px; }
.friend-status-pill, .friend-list-empty { color: var(--muted); font-size: 12px; }
.friend-list-empty { margin: 0; padding: 9px 2px; }
@media (max-width: 700px) {
  .topbar-actions { grid-template-columns: minmax(0, 1fr) auto auto auto; }
  .topbar-social-actions { position: absolute; z-index: 25; top: 15px; right: 64px; gap: 4px; }
  .topbar-social-actions .top-message-button { position: static; width: 40px; min-height: 40px; }
  .topbar-social-actions .logout-button { min-height: 40px; padding: 0 10px; font-size: 10px; white-space: nowrap; }
  .topbar-actions .logout-button { position: static; grid-column: 1; justify-self: start; }
  .find-friends-button { width: 40px; min-height: 40px; padding: 0; border-radius: 12px; }
  .find-friends-button span { display: none; }
  .friend-finder-dialog { width: calc(100% - 20px); max-height: calc(100dvh - 20px); }
  .friend-finder-content { gap: 9px; padding: 18px; }
  .friend-list-row { gap: 7px; padding: 9px; }
  .friend-list-row > strong { font-size: 12px; }
  .friend-row-action, .friend-request-actions > button { min-height: 36px; padding-inline: 8px; font-size: 10px; }
}

@media (max-width: 390px) {
  .topbar { padding-inline: 12px; }
  .topbar-actions { max-width: none; grid-template-columns: minmax(0,1fr) auto auto; }
  .account-chip > span:last-child { display: none; }
  .nav-link { gap: 6px; padding-inline: 8px; }
  .nav-icon { display: none; }
  .sidebar { padding-inline: 11px; }
  .primary-nav { gap: 4px; }
  .nav-link { min-height: 40px; }
  .expense-form-grid { grid-template-columns: 1fr; }
  .expense-name-field, .expense-submit-field { grid-column: auto; }
  .split-picker { grid-column: auto; }
  .expense-type-picker { grid-column: auto; }
  .flowchart-metrics { gap: 7px; }
  .flow-metric-card { min-width: 0; padding: 11px; }
  .flow-metric-card > span { font-size: 10px; }
  .flow-metric-card > strong { font-size: 16px; }
  .pace-comparison-grid { gap: 7px; }
  .pace-comparison-grid > div { min-width: 0; padding: 10px; }
  .pace-comparison-grid strong { font-size: 12px; }
  .roommate-spending-row { grid-template-columns: minmax(72px, 1fr) minmax(28px, 1fr) auto; gap: 6px; }
  .roommate-spending-row .avatar { width: 22px; height: 22px; }
  .roommate-spending-identity { gap: 5px; }
  .roommate-spending-amount { font-size: 9px; }
  .category-content { grid-template-columns: 96px minmax(0,1fr); gap: 10px; }
  .category-donut { width: 96px; }
  .flow-category-panel .category-content { grid-template-columns: 96px minmax(0,1fr); gap: 10px; }
  .flow-category-panel .category-donut { width: 96px; }
  .account-page-heading { gap: 10px; }
  .account-page-heading h2 { font-size: 18px; }
  .account-edit-button { min-height: 40px; }
}

@media (max-width: 700px) {
  .sidebar {
    position: fixed;
    z-index: 20;
    inset: auto 0 0;
    display: grid;
    grid-template-columns: minmax(0,1fr) 54px;
    align-items: stretch;
    width: 100%;
    padding: 7px 6px calc(7px + env(safe-area-inset-bottom));
    border: 0;
    border-top: 1px solid rgba(160,179,216,.16);
    background: var(--sidebar);
    box-shadow: 0 -8px 28px rgba(0,0,0,.25);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .sidebar .brand, .nav-caption { display: none; }
  .primary-nav {
    display: grid;
    grid-template-columns: repeat(5, minmax(0,1fr));
    align-items: stretch;
    gap: 2px;
    min-width: 0;
    overflow: visible;
  }
  .sidebar-bottom {
    display: grid;
    align-items: stretch;
    width: 54px;
    margin: 0;
    padding: 0;
    border: 0;
  }
  .nav-link, .sidebar-bottom .nav-link {
    display: flex;
    min-width: 0;
    min-height: 58px;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    padding: 5px 2px;
    border-radius: 12px;
    font-size: 9px;
    line-height: 1.05;
    text-align: center;
    white-space: normal;
  }
  .nav-link.active {
    border-color: transparent;
    background: rgba(17,216,192,.11);
    box-shadow: none;
    color: #71ebdc;
  }
  .nav-icon { display: inline-grid; width: auto; font-size: 21px; line-height: 1; }
  .nav-count { position: absolute; top: 1px; right: 2px; min-width: 19px; height: 19px; margin: 0; padding: 0 4px; font-size: 10px; }
  .app-content { margin-bottom: calc(73px + env(safe-area-inset-bottom)); }
  .dashboard-main { padding: 20px 16px 24px; }
  .topbar { padding: 14px 16px; }
  .topbar h1 { font-size: 22px; }
  .topbar-title .eyebrow { font-size: 9px; }
  .welcome-row h2 { font-size: 23px; }
  .role-note { max-width: none; font-size: 12px; line-height: 1.5; }
  .panel { padding: 19px; border-radius: 18px; box-shadow: 0 10px 28px rgba(0,0,0,.13); }
  .section-heading { margin-bottom: 16px; }
  .section-heading h2, .section-heading > div h2 { font-size: 16px; }
  .panel-kicker { font-size: 9px; }
  .page-intro h2 { font-size: 24px; }
  .page-intro > p:last-child { font-size: 13px; line-height: 1.55; }
  .flowchart-page { gap: 14px; }
  .flowchart-metrics { gap: 10px; }
  .flow-metric-card { min-height: 112px; padding: 15px; }
  .flow-metric-card > span { font-size: 12px; }
  .flow-metric-card > strong { font-size: 20px; }
  .flow-metric-card > small { font-size: 11px; line-height: 1.35; }
  .pace-comparison-grid span { font-size: 11px; line-height: 1.35; }
  .pace-comparison-grid strong { font-size: 15px; }
  .roommate-spending-chart { gap: 16px; }
  .roommate-spending-row { min-height: 34px; }
  .roommate-spending-name, .roommate-spending-amount { font-size: 12px; }
  .category-legend { gap: 12px; }
  .legend-row { font-size: 12px; }
  .button-primary, .button-secondary, .button-quiet, .icon-button { min-height: 44px; font-size: 13px; }
  .quick-add { min-height: 44px; font-size: 12px; }
  .form-field label, .form-stack label { font-size: 12px; }
  .form-field input, .form-field select, .form-stack input { min-height: 46px; font-size: 14px; }
  .split-member-option { min-height: 42px; font-size: 12px; }
  .expense-item { padding: 15px; }
  .expense-item h3 { font-size: 14px; }
  .expense-item p, .approval-role-message { font-size: 12px; line-height: 1.5; }
  .expense-actions button, .expense-change-item .expense-actions button { min-height: 44px; font-size: 12px; }
  .page-intro, .pending-page, .settings-page, .add-expense-page { gap: 14px; }
  .alert-dialog { border-radius: 20px; }
  .alert-dialog h2, .person-details-heading h2 { font-size: 22px; }
  .alert-dialog-copy, .alert-dialog label { font-size: 13px; line-height: 1.5; }
}

@media (max-width: 390px) {
  .sidebar { grid-template-columns: minmax(0,1fr) 48px; padding-inline: 4px; }
  .sidebar-bottom { width: 48px; }
  .nav-link, .sidebar-bottom .nav-link { min-height: 56px; font-size: 8px; }
  .nav-icon { display: inline-grid; font-size: 20px; }
  .app-content { margin-bottom: calc(70px + env(safe-area-inset-bottom)); }
  .dashboard-main { padding-inline: 13px; }
  .panel { padding: 16px; }
  .welcome-row h2 { font-size: 21px; }
  .flow-metric-card { min-height: 108px; padding: 12px; }
  .flow-metric-card > strong { font-size: 18px; }
}

:root[data-theme="white"] {
  color-scheme: light;
  --page: #f3f6fb;
  --sidebar: #ffffff;
  --panel: #ffffff;
  --panel-raised: #f6f8fc;
  --line: rgba(37, 56, 88, .14);
  --text: #172033;
  --muted: #59677d;
  --muted-2: #68768c;
  background: var(--page);
  color: var(--text);
}

:root[data-theme="white"] body {
  background: radial-gradient(ellipse at 78% 0%, rgba(38, 80, 126, .07), transparent 36%), var(--page);
  color: var(--text);
}

:root[data-theme="white"] .sidebar { background: linear-gradient(180deg, #fff, #f8faff); border-right-color: var(--line); }
:root[data-theme="white"] .nav-link { color: #536078; }
:root[data-theme="white"] .nav-link:hover { background: rgba(22, 42, 75, .06); color: var(--text); }
:root[data-theme="white"] .topbar { border-bottom-color: var(--line); background: rgba(255,255,255,.92); }
:root[data-theme="white"] .account-chip { color: #354158; }
:root[data-theme="white"] .panel,
:root[data-theme="white"] .alert-preferences-panel,
:root[data-theme="white"] .budget-panel,
:root[data-theme="white"] .personal-account-page,
:root[data-theme="white"] .transactions-panel,
:root[data-theme="white"] .roommates-panel,
:root[data-theme="white"] .balance-panel,
:root[data-theme="white"] .daily-spending-panel,
:root[data-theme="white"] .pace-panel,
:root[data-theme="white"] .roommate-spending-panel,
:root[data-theme="white"] .category-panel,
:root[data-theme="white"] .pending-panel,
:root[data-theme="white"] .action-panel {
  border-color: var(--line);
  background: #fff;
  box-shadow: 0 8px 26px rgba(34, 52, 82, .07);
}
:root[data-theme="white"] .spend-panel { background: radial-gradient(ellipse at 34% 40%, rgba(17,216,192,.12), transparent 48%), linear-gradient(120deg, #e8f7f8, #edf2ff 78%, #f0efff); }
:root[data-theme="white"] .spend-panel.over-budget { border-color: rgba(190,35,52,.65); background: radial-gradient(ellipse at 34% 40%, rgba(190,35,52,.12), transparent 52%), linear-gradient(120deg, #fff0f1, #ffe9ec 78%, #f7eaf1); }
:root[data-theme="white"] .spend-panel.over-budget .spend-copy h2,
:root[data-theme="white"] .spend-panel.over-budget .spend-total { color: #861d2b; }
:root[data-theme="white"] .spend-panel.over-budget .spend-caption,
:root[data-theme="white"] .budget-overrun-alert { color: #a42535; }
:root[data-theme="white"] .budget-panel.over-budget .budget-remaining { color: #a42535 !important; }
:root[data-theme="white"] .account-budget-summary { background: #f8faff; }
:root[data-theme="white"] .account-budget-copy h3 { color: #202b40; }
:root[data-theme="white"] .account-budget-summary.over-budget { border-color: rgba(190,35,52,.4); background: #fff3f4; }
:root[data-theme="white"] .account-budget-summary.over-budget .account-budget-share { color: #a42535; }
:root[data-theme="white"] .account-budget-overage-share { color: #a42535; }
:root[data-theme="white"] .flow-metric-card > strong.over-budget { color: #a42535; }
:root[data-theme="white"] .spend-copy h2,
:root[data-theme="white"] .spend-total { color: #172033; }
:root[data-theme="white"] .spend-caption { color: #53647b; }
:root[data-theme="white"] .panel h2,
:root[data-theme="white"] .balance-description strong,
:root[data-theme="white"] .transaction-name,
:root[data-theme="white"] .member-row,
:root[data-theme="white"] .roommate-spending-name,
:root[data-theme="white"] .roommate-spending-amount,
:root[data-theme="white"] .account-name,
:root[data-theme="white"] .personal-stat-card strong,
:root[data-theme="white"] .account-settlement-heading h3,
:root[data-theme="white"] .setup-panel h2,
:root[data-theme="white"] .setup-aside h3,
:root[data-theme="white"] .expense-item h3,
:root[data-theme="white"] .personal-expense-row > div:first-child strong,
:root[data-theme="white"] .theme-preferences-panel label { color: #202b40; }
:root[data-theme="white"] .quiet-pill,
:root[data-theme="white"] .transactions-table th,
:root[data-theme="white"] .split-status,
:root[data-theme="white"] .budget-form label,
:root[data-theme="white"] .form-field label,
:root[data-theme="white"] .form-stack label,
:root[data-theme="white"] .expense-type-picker legend,
:root[data-theme="white"] .split-picker legend,
:root[data-theme="white"] .split-picker-note,
:root[data-theme="white"] .theme-preferences-panel label { color: #5b6880; }
:root[data-theme="white"] .transactions-table td,
:root[data-theme="white"] .member-row,
:root[data-theme="white"] .account-settlement-person,
:root[data-theme="white"] .split-member-option,
:root[data-theme="white"] .expense-type-option strong,
:root[data-theme="white"] .balance-description strong { color: #344158; }
:root[data-theme="white"] .balance-row,
:root[data-theme="white"] .personal-stat-card,
:root[data-theme="white"] .account-settlement-card,
:root[data-theme="white"] .account-settlement-row,
:root[data-theme="white"] .alarm-preference-row,
:root[data-theme="white"] .expense-item,
:root[data-theme="white"] .pending-list .expense-item,
:root[data-theme="white"] .split-member-option,
:root[data-theme="white"] .expense-type-option,
:root[data-theme="white"] .form-field input,
:root[data-theme="white"] .form-field select,
:root[data-theme="white"] .form-stack input,
:root[data-theme="white"] .theme-preferences-panel select,
:root[data-theme="white"] .upi-profile-form input,
:root[data-theme="white"] .payment-proof-content input[type="number"] {
  border-color: rgba(37, 56, 88, .16);
  background-color: #f8faff;
  color: #202b40;
}
:root[data-theme="white"] .expense-type-option small { color: #59677d; }
:root[data-theme="white"] .split-member-option:has(input:checked) { background: rgba(17,216,192,.1); }
:root[data-theme="white"] .split-picker { border-color: var(--line); }
:root[data-theme="white"] .transactions-table tbody tr:hover,
:root[data-theme="white"] .account-settlement-row { background-color: rgba(37,56,88,.035); }
:root[data-theme="white"] .invite-box strong { color: #17675e; }
:root[data-theme="white"] .budget-total { color: #172033; }
:root[data-theme="white"] .budget-progress { background: rgba(37,56,88,.1); }
:root[data-theme="white"] .button-quiet { color: #49566c; }
:root[data-theme="white"] .button-quiet:hover { background: rgba(37,56,88,.06); color: #172033; }
:root[data-theme="white"] .search-box { border-color: rgba(37,56,88,.16); background: #f8faff; color: #526179; box-shadow: none; }
:root[data-theme="white"] .search-box input::placeholder { color: #68768c; }
:root[data-theme="white"] .auth-card,
:root[data-theme="white"] .alert-dialog,
:root[data-theme="white"] .person-details-content,
:root[data-theme="white"] .payment-proof-content,
:root[data-theme="white"] .payment-review-content {
  border-color: var(--line);
  background: linear-gradient(145deg, #fff, #f6f8fc);
  color: var(--text);
}
:root[data-theme="white"] .auth-card h1,
:root[data-theme="white"] .alert-dialog h2,
:root[data-theme="white"] .alarm-settings-content h2,
:root[data-theme="white"] .auth-card label,
:root[data-theme="white"] .alert-dialog label,
:root[data-theme="white"] .upi-profile-form label,
:root[data-theme="white"] .payment-proof-content label { color: #26334a; }
:root[data-theme="white"] #authForm input,
:root[data-theme="white"] .alert-dialog textarea { border-color: var(--line); background: #fff; color: #202b40; }
:root[data-theme="white"] .tabs,
:root[data-theme="white"] .alarm-choice { border-color: var(--line); background: #f1f4f9; color: #344158; }
:root[data-theme="white"] .tabs button.active { background: #dce5ef; color: #174e48; }
:root[data-theme="white"] .form-stack h3 { color: #202b40; }
:root[data-theme="white"] .flow-metric-card,
:root[data-theme="white"] .pace-comparison-grid > div { border-color: var(--line); background: #fff; }
:root[data-theme="white"] .flow-metric-card > span,
:root[data-theme="white"] .flow-metric-card > strong,
:root[data-theme="white"] .pace-comparison-grid strong { color: #202b40; }
:root[data-theme="white"] .pace-comparison-grid span { color: #59677d; }
:root[data-theme="white"] .roommate-spending-track { border-color: var(--line); background: #edf1f7; }

.theme-preferences-panel select { color-scheme: dark; }
:root[data-theme="white"] .theme-preferences-panel select { color-scheme: light; }

@media (max-width: 700px) {
  .sidebar .brand { display: none; }
  .topbar { position: sticky; display: grid; grid-template-columns: minmax(0,1fr) auto; min-height: 0; padding: 12px 14px 11px; }
  .mobile-brand { display: inline-flex; grid-column: 1; align-self: center; gap: 10px; width: fit-content; margin: 0; font-size: 22px; }
  .mobile-brand .brand-mark { width: 42px; height: 42px; border-radius: 13px; font-size: 27px; }
  .topbar-title { display: none; }
  .topbar-actions { position: static; display: grid; grid-column: 1 / -1; grid-template-columns: minmax(0,1fr); gap: 8px; }
  .topbar-actions .search-box { grid-column: 1; grid-row: 1; order: 0; width: 100%; height: 48px; margin: 0; padding-inline: 12px; border-radius: 15px; }
  .topbar-actions .search-box input { font-size: 16px; }
  .topbar-actions .account-chip { position: static; display: contents; }
  .topbar-actions .account-chip > span:last-child { display: none; }
  .mobile-account-shortcut { position: absolute; z-index: 25; top: 12px; right: 14px; display: grid; width: 47px; height: 47px; place-items: center; padding: 0; border: 0; border-radius: 50%; background: transparent; cursor: pointer; }
  .mobile-account-shortcut:focus-visible { outline: 3px solid rgba(17,216,192,.75); outline-offset: 2px; }
  .top-message-button { position: absolute; z-index: 25; top: 15px; right: 64px; width: 40px; min-height: 40px; }
  .mobile-account-shortcut .avatar-current { width: 43px; height: 43px; border-width: 2px; box-shadow: 0 0 0 3px rgba(17,216,192,.1); }
  #quickAddBtn { display: none; }
  button.mobile-quick-add { position: fixed; z-index: 25; right: calc(12px + env(safe-area-inset-right)); bottom: calc(88px + env(safe-area-inset-bottom)); display: inline-flex; min-height: 54px; padding: 0 19px; border: 1px solid rgba(255,255,255,.28); border-radius: 17px; background: linear-gradient(105deg, #16b9e6, #11d8c0); box-shadow: 0 12px 28px rgba(11,178,209,.3); font-size: 15px; }
  .quick-add span { font-size: 22px; }
  .topbar-actions > .logout-button { position: absolute; z-index: 25; top: 16px; right: 110px; min-height: 34px; padding: 0 8px; font-size: 10px; }
  .dashboard-main { padding-top: 22px; }
  .welcome-row { align-items: flex-start; margin-bottom: 20px; }
  .welcome-row .eyebrow { margin-bottom: 7px; font-size: 11px; letter-spacing: 1.5px; }
  .welcome-row h2 { font-size: 29px; letter-spacing: -.8px; }
  .role-note { font-size: 15px; line-height: 1.45; }
  .admin-badge { flex: 0 0 auto; margin-top: 3px; }
  .dashboard-main-column, .dashboard-side-column { gap: 16px; }
  .spend-panel { min-height: 205px; padding: 24px 22px; border: 1px solid rgba(56,179,255,.65); border-radius: 22px; background: radial-gradient(ellipse at 85% 0%, rgba(74,118,255,.55), transparent 54%), linear-gradient(135deg, #0759bd 0%, #1747a4 52%, #243d92 100%); box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 14px 34px rgba(3,55,146,.22); }
  .spend-copy .panel-kicker { color: #d5e7ff; font-size: 11px; letter-spacing: 1.5px; }
  .spend-copy h2 { color: #f5f8ff; font-size: 21px; }
  .spend-total { margin: 14px 0 8px; font-size: clamp(40px, 11vw, 52px); letter-spacing: -1.8px; }
  .spend-caption { color: #d2e0ff; font-size: 14px; }
  .balance-panel, .transactions-panel, .roommates-panel { border-color: rgba(87,131,210,.27); border-radius: 21px; background: linear-gradient(145deg, #14244a, #111d3c 85%); }
  .section-heading h2, .section-heading > div h2 { font-size: 19px; }
  .balance-list { gap: 11px; }
  .balance-row { min-height: 82px; gap: 10px; padding: 14px; border-color: rgba(108,144,215,.23); border-radius: 16px; background: rgba(8,20,47,.48); }
  .balance-description { gap: 11px; }
  .balance-description .avatar { width: 38px; height: 38px; font-size: 11px; }
  .balance-description strong { display: -webkit-box; overflow: hidden; font-size: 14px; line-height: 1.3; text-overflow: ellipsis; white-space: normal; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
  .balance-description span { display: block; margin-top: 3px; font-size: 12px; }
  .balance-amount { font-size: 17px; }
  .balance-note { margin-top: 15px; font-size: 12px; line-height: 1.5; }
  .transactions-panel .section-heading { align-items: center; }
  .transaction-search-box { flex: 1 0 100%; width: 100%; margin: 3px 0 0; }
  .table-scroll { overflow: visible; }
  .transactions-table { display: block; white-space: normal; }
  .transactions-table thead { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
  .transactions-table tbody { display: grid; gap: 10px; }
  .transactions-table tbody tr:not(.empty-row) {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px 12px;
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--panel-raised);
  }
  .transactions-table tbody tr:not(.empty-row):hover { background: var(--panel-raised); }
  .transactions-table tbody tr:not(.empty-row) td {
    display: block;
    min-width: 0;
    padding: 0;
    border: 0;
    color: var(--text);
    font-size: 12px;
    white-space: normal;
  }
  .transactions-table .transaction-description-cell { grid-column: 1; grid-row: 1; }
  .transactions-table .transaction-amount-cell { grid-column: 2; grid-row: 1; align-self: start; font-size: 15px; }
  .transactions-table .transaction-name { max-width: none; overflow-wrap: anywhere; white-space: normal; }
  .transactions-table .transaction-admin-actions { gap: 12px; margin-left: 38px; }
  .transactions-table .transaction-admin-actions button { min-height: 32px; }
  .transactions-table .transaction-payer-cell,
  .transactions-table .transaction-date-cell,
  .transactions-table .transaction-split-cell { display: grid; align-content: start; gap: 4px; }
  .transactions-table .transaction-payer-cell { grid-column: 1; grid-row: 2; }
  .transactions-table .transaction-date-cell { grid-column: 2; grid-row: 2; justify-items: end; text-align: right; white-space: nowrap; }
  .transactions-table .transaction-split-cell { grid-column: 1 / -1; grid-row: 3; }
  .transactions-table .transaction-mobile-label {
    display: block;
    color: var(--muted);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .45px;
    text-transform: uppercase;
  }
  .transactions-table .transaction-person { min-width: 0; gap: 6px; }
  .transactions-table .transaction-person-link { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .transactions-table .empty-row { display: block; padding: 20px 10px; border: 1px dashed var(--line); border-radius: 12px; }
  .transactions-table .empty-row td { display: block; padding: 0; border: 0; white-space: normal; }
  .sidebar { grid-template-columns: minmax(0,1fr) 52px; padding: 5px 5px calc(5px + env(safe-area-inset-bottom)); }
  .sidebar-bottom { width: 52px; }
  .nav-link, .sidebar-bottom .nav-link { min-height: 62px; gap: 5px; padding: 5px 2px; border-bottom: 2px solid transparent; border-radius: 0; font-size: 10px; }
  .nav-link.active { border-bottom-color: #16d8cb; background: transparent; color: #18ddcf; }
  .nav-icon { font-size: 24px; }
  .nav-icon svg { width: 25px; height: 25px; stroke-width: 1.8; }
  .app-content { margin-bottom: calc(77px + env(safe-area-inset-bottom)); }
  .sidebar { grid-template-columns: repeat(5, minmax(0,1fr)); }
  .primary-nav, .sidebar-bottom { display: contents; }
  .sidebar-bottom { width: auto; }
  .sidebar-footnote { display: none; }
  .nav-link[data-scroll-target="householdDashboard"] { order: 1; }
  .nav-link[data-scroll-target="activityPage"] { order: 2; }
  .nav-link[data-scroll-target="addExpensePage"] { order: 3; }
  .nav-link[data-scroll-target="pendingExpensesPage"] { order: 4; }
  .sidebar-bottom .nav-link[data-scroll-target="settingsPage"] { display: none; }
  .nav-link[data-scroll-target="personalAccountPage"] { display: none; }
  .nav-link.mobile-account-nav { display: flex; order: 5; }
  .mobile-profile-icon { display: grid; width: 38px; height: 38px; place-items: center; border: 1px solid rgba(17,216,192,.38); border-radius: 50%; background: rgba(17,216,192,.1); color: #77eddd; }
  .mobile-profile-icon svg { display: block; width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
  .nav-link[data-scroll-target="addExpensePage"] { position: relative; z-index: 1; transform: translateY(-7px); }
  .nav-link[data-scroll-target="addExpensePage"] .nav-icon { display: grid; width: 44px; height: 44px; place-items: center; border: 1px solid rgba(255,255,255,.33); border-radius: 15px; background: linear-gradient(140deg, #21e4d0, #21b7ed); box-shadow: 0 8px 22px rgba(12,194,208,.34); color: #08232f; font-size: 29px; font-weight: 700; }
  .nav-link[data-scroll-target="addExpensePage"].active { border: 0; background: transparent; color: #6df0dd; }
}

@media (max-width: 390px) {
  .sidebar { grid-template-columns: repeat(5, minmax(0,1fr)); }
  .mobile-brand { font-size: 20px; }
  .mobile-brand .brand-copy { display: none; }
  .mobile-brand .brand-mark { width: 39px; height: 39px; }
  .topbar { padding-inline: 12px; }
  .topbar-actions > .logout-button { top: 15px; right: 110px; }
  .mobile-account-shortcut { top: 8px; right: 10px; width: 45px; height: 45px; }
  .mobile-account-shortcut .avatar-current { width: 40px; height: 40px; }
  .welcome-row h2 { font-size: 26px; }
  .role-note { font-size: 14px; }
  .spend-panel { min-height: 190px; padding: 21px 18px; }
  .spend-copy h2 { font-size: 19px; }
  .spend-total { font-size: clamp(36px, 10vw, 46px); }
  .balance-row { grid-template-columns: minmax(0,1fr) auto; padding: 12px 10px; }
  .balance-description strong { font-size: 13px; }
  .balance-amount { font-size: 15px; }
  .mobile-quick-add { right: calc(12px + env(safe-area-inset-right)); }
}

.smart-assistant-widget {
  position: fixed;
  z-index: 30;
  right: calc(22px + env(safe-area-inset-right));
  bottom: calc(30px + env(safe-area-inset-bottom));
  font-family: 'DM Sans', sans-serif;
}

.smart-assistant-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 52px;
  padding: 0 18px;
  border: 1px solid rgba(255,255,255,.32);
  border-radius: 17px;
  background: linear-gradient(110deg, #18bce5, #11d8c0, #628cff, #b38cff, #18bce5);
  background-size: 260% 260%;
  animation: rosmate-button-colors 7s ease-in-out infinite;
  box-shadow: 0 12px 30px rgba(11,178,209,.28);
  color: #08232f;
  cursor: pointer;
  font-size: 14px;
  font-weight: 800;
}

.smart-assistant-toggle-icon { font-size: 18px; }
.smart-assistant-toggle:hover { filter: brightness(1.06); transform: translateY(-1px); }
@keyframes rosmate-button-colors {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.smart-assistant-panel {
  position: fixed;
  right: calc(22px + env(safe-area-inset-right));
  bottom: calc(88px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  width: min(390px, calc(100vw - 32px));
  height: min(590px, calc(100dvh - 112px));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel);
  box-shadow: 0 22px 70px rgba(0,0,0,.4);
  color: var(--text);
}

.smart-assistant-panel[hidden] { display: none; }
.smart-assistant-header { display: flex; align-items: center; gap: 11px; padding: 15px 16px; border-bottom: 1px solid var(--line); background: var(--panel-raised); }
.smart-assistant-avatar { display: grid; width: 38px; height: 38px; flex: 0 0 auto; place-items: center; border: 1px solid rgba(17,216,192,.35); border-radius: 12px; background: rgba(17,216,192,.1); color: var(--teal); font-size: 23px; }
.smart-assistant-heading { min-width: 0; }
.smart-assistant-heading h2 { margin: 0; color: var(--text); font-family: 'Manrope', sans-serif; font-size: 15px; }
.smart-assistant-heading p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.smart-assistant-close { display: grid; width: 36px; height: 36px; flex: 0 0 auto; place-items: center; margin-left: auto; border: 1px solid var(--line); border-radius: 10px; background: transparent; color: var(--muted); cursor: pointer; font-size: 23px; line-height: 1; }
.smart-assistant-close:hover { color: var(--text); border-color: rgba(17,216,192,.38); }

.smart-assistant-messages { display: flex; flex: 1 1 auto; flex-direction: column; align-items: flex-start; gap: 10px; min-height: 0; padding: 16px; overflow-y: auto; overscroll-behavior: contain; }
.smart-assistant-message { max-width: 92%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px 14px 14px 4px; background: var(--panel-raised); color: var(--text); font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; white-space: pre-wrap; }
.smart-assistant-message.user { align-self: flex-end; border-color: rgba(17,216,192,.22); border-radius: 14px 14px 4px 14px; background: rgba(17,216,192,.1); }
.smart-assistant-confirmation { width: min(100%, 390px); white-space: normal; }
.smart-assistant-confirmation-heading { display: block; margin-bottom: 8px; color: var(--text); }
.smart-assistant-confirmation-explanation { margin: 0 0 9px; color: var(--muted); font-size: 11px; }
.smart-assistant-confirmation-details { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 5px 9px; margin: 0; font-size: 12px; }
.smart-assistant-confirmation-details dt { color: var(--muted); }
.smart-assistant-confirmation-details dd { margin: 0; color: var(--text); overflow-wrap: anywhere; }
.smart-assistant-confirmation-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.smart-assistant-confirmation-actions button { min-height: 36px; padding: 0 11px; font-size: 11px; }

.smart-assistant-suggestions { display: flex; flex: 0 0 auto; flex-wrap: wrap; gap: 7px; padding: 0 14px 12px; }
.smart-assistant-suggestions button { min-height: 32px; padding: 5px 9px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel-raised); color: var(--muted); cursor: pointer; font: inherit; font-size: 10px; }
.smart-assistant-suggestions button:hover { border-color: rgba(17,216,192,.4); color: var(--teal); }

.smart-assistant-loading { display: flex; flex: 0 0 auto; align-items: center; gap: 8px; margin: 0; padding: 0 16px 10px; color: var(--muted); font-size: 11px; }
.smart-assistant-loading[hidden] { display: none; }
.smart-assistant-spinner { width: 14px; height: 14px; border: 2px solid var(--line); border-top-color: var(--teal); border-radius: 50%; animation: smart-assistant-spin .7s linear infinite; }
@keyframes smart-assistant-spin { to { transform: rotate(360deg); } }

.smart-assistant-form { display: flex; flex: 0 0 auto; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--line); }
.smart-assistant-form input { width: 100%; min-width: 0; min-height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: 11px; outline: 0; background: var(--panel-raised); color: var(--text); font: inherit; font-size: 13px; }
.smart-assistant-form input:focus { border-color: rgba(17,216,192,.65); box-shadow: 0 0 0 3px rgba(17,216,192,.08); }
.smart-assistant-form .button-primary { min-height: 42px; padding: 0 14px; font-size: 12px; }
.smart-assistant-form button:disabled, .smart-assistant-form input:disabled { cursor: wait; opacity: .65; }
.smart-assistant-note { flex: 0 0 auto; margin: 0; padding: 0 14px 12px; color: var(--muted); font-size: 9px; line-height: 1.4; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (max-width: 700px) {
  .smart-assistant-widget { right: calc(12px + env(safe-area-inset-right)); bottom: calc(152px + env(safe-area-inset-bottom)); }
  .smart-assistant-toggle { min-height: 48px; padding-inline: 14px; font-size: 13px; }
  .smart-assistant-panel { right: calc(12px + env(safe-area-inset-right)); bottom: calc(80px + env(safe-area-inset-bottom)); width: min(440px, calc(100vw - 24px)); height: min(560px, calc(100dvh - 112px - env(safe-area-inset-bottom))); }
}

@media (prefers-reduced-motion: reduce) {
  .smart-assistant-spinner { animation: none; }
  .smart-assistant-toggle { animation: none; }
  .smart-assistant-toggle:hover { transform: none; }
}

@media (max-width: 390px) {
  .topbar-actions { grid-template-columns: minmax(0, 1fr) auto auto auto; }
}

@media (max-width: 700px) {
  .topbar-actions { grid-template-columns: minmax(0, 1fr) auto auto auto; }
  .find-friends-button { width: 40px; min-height: 40px; padding: 0; border-radius: 12px; }
  .find-friends-button span { display: none; }
  .friend-finder-dialog { width: calc(100% - 20px); max-height: calc(100dvh - 20px); }
  .friend-finder-content { gap: 9px; padding: 18px; }
  .friend-list-row { gap: 7px; padding: 9px; }
  .friend-list-row > strong { font-size: 12px; }
  .friend-row-action, .friend-request-actions > button { min-height: 36px; padding-inline: 8px; font-size: 10px; }
}

.whatsapp-group-info-btn { display: grid; width: 38px; min-height: 38px; place-items: center; padding: 0; border: 0; border-radius: 50%; background: transparent; color: #00a884; cursor: pointer; }
.whatsapp-group-info-btn:hover, .messenger-group-details-heading .whatsapp-icon-btn:hover { background: rgba(0,168,132,.12); }
.messenger-group-details-heading .whatsapp-icon-btn { width: 34px; min-height: 34px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; }
.messenger-group-details-dialog { width: min(430px, calc(100% - 28px)); }
.messenger-group-details-form { gap: 14px !important; }
.messenger-group-details-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 3px; }
.messenger-group-details-heading .panel-kicker { margin-bottom: 4px; }
.messenger-group-details-heading h2 { margin: 0; }
.messenger-group-photo-editor { display: flex; align-items: center; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.035); }
.messenger-group-photo-preview { width: 66px; height: 66px; overflow: hidden; border: 2px solid rgba(0,168,132,.48); background: linear-gradient(140deg,#159d83,#537dd2); color: white; font-size: 20px; }
.messenger-group-photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.messenger-group-photo-editor .button-secondary { min-height: 36px; padding-inline: 12px; font-size: 11px; }
.messenger-group-photo-editor .text-button { margin-left: auto; padding: 5px; font-size: 10px; }
.messenger-group-details-form > label { margin-bottom: -8px; }
.messenger-group-details-form > input { width: 100%; min-height: 43px; padding: 0 12px; border: 1px solid var(--line); border-radius: 11px; outline: 0; background: rgba(4,12,22,.48); color: var(--text); font: inherit; font-size: 13px; }
.messenger-group-details-form > input:focus { border-color: rgba(0,168,132,.62); box-shadow: 0 0 0 3px rgba(0,168,132,.1); }
:root[data-theme="white"] .messenger-group-photo-editor { background: rgba(20,40,60,.035); }
:root[data-theme="white"] .messenger-group-details-form > input { background: white; color: #17212b; }

/* Refined WhatsApp-inspired messenger */
.messenger-dialog { width: min(1120px, calc(100vw - 36px)); height: min(780px, calc(100dvh - 36px)); max-height: none; border: 1px solid rgba(140,160,190,.2); border-radius: 22px; background: var(--panel); }
.messenger-shell { min-height: 0; height: 100%; max-height: none; }
.messenger-header { min-height: 62px; padding: 10px 18px; border-bottom: 1px solid var(--line); }
.messenger-brand-lockup { display: flex; align-items: center; gap: 10px; }
.messenger-brand-icon { display: grid; width: 37px; height: 37px; place-items: center; border-radius: 12px; background: rgba(0,168,132,.16); color: #20c997; font-size: 19px; }
.messenger-header .panel-kicker { color: #20c997; font-size: 8px; letter-spacing: 1.35px; }
.messenger-header h2 { font-size: 16px; letter-spacing: -.2px; }
.messenger-layout { grid-template-columns: minmax(300px, 35%) minmax(0,1fr); }
.messenger-list-pane { gap: 0; padding: 0; background: color-mix(in srgb, var(--panel) 94%, #71809b 6%); }
.messenger-list-toolbar { display: flex; align-items: center; justify-content: space-between; min-height: 62px; padding: 12px 17px 6px; }
.messenger-list-toolbar h3 { margin: 0; font: 750 20px Manrope, sans-serif; letter-spacing: -.5px; }
.messenger-new-chat { display: grid; width: 38px; min-height: 38px; place-items: center; padding: 0; border: 0; border-radius: 50%; background: rgba(0,168,132,.14); color: #20c997; cursor: pointer; font-size: 24px; transition: background .18s ease, transform .18s ease; }
.messenger-new-chat:hover { transform: scale(1.05); background: rgba(0,168,132,.24); }
.messenger-search { display: flex; align-items: center; gap: 10px; min-height: 40px; margin: 7px 13px 12px; padding: 0 13px; border: 1px solid transparent; border-radius: 11px; background: rgba(128,145,170,.1); color: var(--muted); }
.messenger-search:focus-within { border-color: rgba(32,201,151,.5); box-shadow: 0 0 0 3px rgba(32,201,151,.08); }
.messenger-search svg { width: 17px; height: 17px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-linecap: round; stroke-width: 1.8; }
.messenger-search input { width: 100%; min-width: 0; padding: 9px 0; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; font-size: 11px; }
.messenger-search input::placeholder { color: var(--muted); }
.messenger-chat-list { gap: 0; align-content: start; }
.messenger-chat-item { position: relative; display: flex; align-items: center; gap: 12px; min-height: 74px; padding: 10px 15px; border: 0; border-bottom: 1px solid rgba(140,160,190,.09); border-radius: 0; transition: background .16s ease; }
.messenger-chat-item:hover, .messenger-chat-item.is-active { border-color: rgba(140,160,190,.09); background: rgba(128,145,170,.12); }
.messenger-chat-avatar { display: grid; width: 48px; height: 48px; flex: 0 0 auto; place-items: center; overflow: hidden; border: 0; border-radius: 50%; background: linear-gradient(140deg, rgba(32,201,151,.85), rgba(59,130,246,.8)); color: #fff; font-size: 14px; font-weight: 750; }
.messenger-chat-avatar img { width: 100%; height: 100%; object-fit: cover; }
.messenger-group-avatar { background: linear-gradient(140deg, #4f83df, #7b69d4); }
.messenger-chat-copy { display: grid; min-width: 0; flex: 1; gap: 5px; }
.messenger-chat-title-line { display: flex; align-items: center; gap: 7px; min-width: 0; }
.messenger-chat-title-line strong { min-width: 0; flex: 1; color: var(--text); font-size: 12px; font-weight: 700; }
.messenger-chat-title-line time { color: var(--muted); font-size: 9px; white-space: nowrap; }
.messenger-chat-item small { color: var(--muted); font-size: 10px; line-height: 1.3; }
.messenger-unread-dot { position: static; width: 8px; height: 8px; flex: 0 0 auto; box-shadow: none; }
.messenger-list-empty { margin: 18px 15px; color: var(--muted); font-size: 11px; line-height: 1.5; text-align: center; }
.messenger-status { padding: 0 14px; }
.messenger-conversation { background: radial-gradient(ellipse at 20% 0%, rgba(32,201,151,.07), transparent 42%), linear-gradient(145deg, rgba(18,30,40,.98), rgba(12,22,31,.98)); }
.messenger-conversation-header { min-height: 69px; padding: 9px 16px; background: rgba(16,27,37,.9); }
.messenger-conversation-identity { display: flex; align-items: center; gap: 11px; min-width: 0; }
.messenger-conversation-identity .messenger-chat-avatar { width: 43px; height: 43px; }
.messenger-back-button { display: none; width: 34px; height: 38px; place-items: center; padding: 0; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.messenger-back-button svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; }
.messenger-conversation-title { gap: 4px; }
.messenger-conversation-title strong { font-size: 13px; }
.messenger-conversation-title small { font-size: 10px; }
.messenger-call-actions .icon-button { border: 0; background: transparent; color: #b7c6d3; }
.messenger-messages { gap: 8px; padding: 20px clamp(14px, 4vw, 38px); background-image: radial-gradient(rgba(255,255,255,.025) .7px, transparent .7px); background-size: 18px 18px; }
.messenger-bubble { max-width: min(78%, 540px); padding: 9px 12px 7px; border: 1px solid rgba(255,255,255,.04); border-radius: 13px 13px 13px 4px; background: #202d34; box-shadow: 0 1px 1px rgba(0,0,0,.13); }
.messenger-bubble.mine { border-color: rgba(0,168,132,.12); border-radius: 13px 13px 4px 13px; background: #075e54; }
.messenger-bubble strong { color: #65d8b1; }
.messenger-bubble p { color: #f0f3f4; font-size: 12px; line-height: 1.5; }
.messenger-message-meta { display: flex; align-items: center; justify-content: flex-end; gap: 4px; min-height: 13px; margin-top: 3px; }
.messenger-bubble time { margin: 0; color: rgba(230,239,241,.6); font-size: 9px; }
.messenger-receipt { color: rgba(230,239,241,.58); font-size: 12px; font-weight: 800; letter-spacing: -2.5px; line-height: 1; }
.messenger-receipt.is-seen { color: #53c8f2; }
.messenger-compose { align-items: end; gap: 9px; padding: 11px 15px; border: 0; background: rgba(18,29,37,.97); }
.messenger-compose textarea { min-height: 43px; max-height: 120px; resize: none; padding: 12px 16px; border: 1px solid transparent; border-radius: 22px; background: #26343b; color: #f0f3f4; font-size: 12px; }
.messenger-compose textarea:focus { border-color: rgba(32,201,151,.4); outline: 0; }
.messenger-send-button { display: grid; width: 43px; height: 43px; flex: 0 0 auto; place-items: center; border: 0; border-radius: 50%; background: #00a884; color: #fff; cursor: pointer; transition: transform .16s ease, background .16s ease; }
.messenger-send-button:hover { transform: scale(1.05); background: #06b992; }
.messenger-send-button svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.messenger-empty { gap: 11px; background: radial-gradient(ellipse at 50% 35%, rgba(32,201,151,.08), transparent 55%); }
.messenger-empty-mark { display: grid; width: 72px; height: 72px; place-items: center; border: 1px solid rgba(32,201,151,.28); border-radius: 50%; background: rgba(32,201,151,.09); color: #20c997; font-size: 30px; }
.messenger-empty strong { font-size: 18px; letter-spacing: -.3px; }
.messenger-empty p { max-width: 250px; font-size: 11px; line-height: 1.5; }
.messenger-new-panel { gap: 13px; padding: 20px; background: var(--panel); }
.messenger-new-heading { align-items: center; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.messenger-new-heading strong { font-size: 15px; }
.messenger-member-choice { min-height: 58px; border-radius: 12px; transition: background .16s ease; }
.messenger-member-choice:hover { background: rgba(128,145,170,.08); }
.messenger-member-choice .avatar { width: 40px; height: 40px; }
.messenger-call-dialog { background: var(--panel); }
:root[data-theme="white"] .messenger-list-pane { background: #f7f9fb; }
:root[data-theme="white"] .messenger-chat-item:hover, :root[data-theme="white"] .messenger-chat-item.is-active { background: #e9f4f1; }
:root[data-theme="white"] .messenger-chat-item { border-bottom-color: rgba(32,47,66,.08); }
:root[data-theme="white"] .messenger-conversation { background: #efeae2; }
:root[data-theme="white"] .messenger-conversation-header, :root[data-theme="white"] .messenger-compose { background: #f0f2f5; }
:root[data-theme="white"] .messenger-messages { background-image: radial-gradient(rgba(29,47,62,.035) .7px, transparent .7px); }
:root[data-theme="white"] .messenger-bubble { border-color: rgba(20,34,49,.06); background: #fff; }
:root[data-theme="white"] .messenger-bubble.mine { background: #d9fdd3; }
:root[data-theme="white"] .messenger-bubble p { color: #17212b; }
:root[data-theme="white"] .messenger-bubble time { color: #687782; }
:root[data-theme="white"] .messenger-receipt { color: #81909a; }
:root[data-theme="white"] .messenger-receipt.is-seen { color: #168cc1; }
:root[data-theme="white"] .messenger-compose textarea { background: #fff; color: #17212b; }
@media (max-width: 650px) {
  .messenger-dialog { width: 100vw; height: 100dvh; max-height: none; border: 0; border-radius: 0; }
  .messenger-shell { height: 100%; min-height: 0; }
  .messenger-header { min-height: 58px; padding: 8px 14px; }
  .messenger-layout { position: relative; display: flex; min-height: 0; flex: 1; }
  .messenger-list-pane { display: flex; width: 100%; min-width: 0; border: 0; }
  .messenger-conversation { display: none; width: 100%; min-width: 0; }
  .messenger-layout.conversation-open .messenger-list-pane { display: none; }
  .messenger-layout.conversation-open .messenger-conversation { display: flex; }
  .messenger-list-toolbar { min-height: 60px; padding-inline: 17px; }
  .messenger-list-toolbar h3 { font-size: 21px; }
  .messenger-search { min-height: 42px; margin: 5px 13px 11px; }
  .messenger-chat-item { min-height: 75px; padding: 10px 15px; }
  .messenger-chat-item strong { font-size: 12px; }
  .messenger-chat-item small { font-size: 10px; }
  .messenger-conversation-header { min-height: 62px; padding: 7px 9px; }
  .messenger-back-button { display: grid; }
  .messenger-conversation-identity { gap: 7px; }
  .messenger-conversation-identity .messenger-chat-avatar { width: 39px; height: 39px; }
  .messenger-call-actions { gap: 2px; }
  .messenger-call-actions .icon-button { width: 39px; min-height: 39px; }
  .messenger-messages { padding: 14px 11px; }
  .messenger-bubble { max-width: 88%; }
  .messenger-compose { padding: 8px 10px calc(9px + env(safe-area-inset-bottom)); }
  .messenger-compose textarea { min-height: 42px; }
  .messenger-new-panel { padding: 14px; }
}


/* ============================================================
   LIQUID GLASS THEME — 1:1 AUTHENTIC iPHONE / iOS EXPERIENCE
   ============================================================ */

:root[data-theme="liquid"] {
  color-scheme: dark;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "SF Pro", "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  --page: #060913;
  --sidebar: rgba(14, 20, 36, 0.72);
  --panel: rgba(255, 255, 255, 0.08);
  --panel-raised: rgba(255, 255, 255, 0.12);
  --line: rgba(255, 255, 255, 0.14);
  --text: #ffffff;
  --muted: rgba(235, 235, 245, 0.68);
  --muted-2: rgba(235, 235, 245, 0.42);
  --teal: #63e6e2;
  --blue: #0a84ff;
  --green: #30d158;
  --red: #ff453a;
  --orange: #ff9f0a;
  --radius: 22px;
  --glass-edge: rgba(255, 255, 255, 0.18);
  --glass-shine: rgba(255, 255, 255, 0.35);
  --glass-shadow: 0 16px 42px -8px rgba(0, 0, 0, 0.52), 0 1px 2px rgba(0, 0, 0, 0.25);
  background: var(--page);
  color: var(--text);
}

:root[data-theme="liquid"] body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 65% 50% at 18% 10%, rgba(48, 176, 199, 0.32), transparent 60%),
    radial-gradient(ellipse 60% 55% at 85% 18%, rgba(88, 86, 214, 0.38), transparent 65%),
    radial-gradient(ellipse 55% 45% at 48% 65%, rgba(10, 132, 255, 0.25), transparent 60%),
    radial-gradient(ellipse 70% 60% at 85% 90%, rgba(175, 82, 222, 0.28), transparent 70%),
    radial-gradient(ellipse 50% 50% at 12% 85%, rgba(48, 209, 88, 0.18), transparent 60%),
    linear-gradient(180deg, #070a14 0%, #0c1122 50%, #060913 100%);
  transform: translateZ(0);
}

:root[data-theme="liquid"] body {
  background: transparent;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

/* iOS Glass Panels & Cards (Apple System Ultra-Thin Material) */
:root[data-theme="liquid"] .panel,
:root[data-theme="liquid"] .auth-card,
:root[data-theme="liquid"] .setup-panel,
:root[data-theme="liquid"] .setup-aside,
:root[data-theme="liquid"] .flow-metric-card,
:root[data-theme="liquid"] .personal-stat-card,
:root[data-theme="liquid"] .account-settlement-card,
:root[data-theme="liquid"] .alert-dialog,
:root[data-theme="liquid"] .incoming-alert-card,
:root[data-theme="liquid"] .smart-assistant-panel {
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.11) 0%, rgba(255, 255, 255, 0.04) 100%);
  box-shadow:
    inset 0 1px 1px 0 rgba(255, 255, 255, 0.32),
    inset 0 -1px 1px 0 rgba(255, 255, 255, 0.04),
    0 18px 45px -10px rgba(0, 0, 0, 0.48),
    0 1px 2px rgba(0, 0, 0, 0.2);
  -webkit-backdrop-filter: blur(30px) saturate(190%);
  backdrop-filter: blur(30px) saturate(190%);
  transition: transform 0.25s cubic-bezier(0.32, 0.72, 0, 1), box-shadow 0.25s ease;
}

/* iOS Navigation Bar (Topbar) */
:root[data-theme="liquid"] .topbar {
  border-bottom: 0.5px solid rgba(255, 255, 255, 0.16);
  background: rgba(10, 15, 32, 0.68);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  -webkit-backdrop-filter: blur(32px) saturate(200%);
  backdrop-filter: blur(32px) saturate(200%);
}

/* iOS Sidebar (Desktop) */
:root[data-theme="liquid"] .sidebar {
  border-right: 0.5px solid rgba(255, 255, 255, 0.14);
  background: rgba(8, 12, 26, 0.68);
  -webkit-backdrop-filter: blur(32px) saturate(190%);
  backdrop-filter: blur(32px) saturate(190%);
}

/* iOS Mobile Tab Bar Dock */
@media (max-width: 700px) {
  :root[data-theme="liquid"] .sidebar {
    border-top: 0.5px solid rgba(255, 255, 255, 0.22);
    border-right: none;
    background: rgba(12, 18, 36, 0.82);
    box-shadow: 0 -10px 32px rgba(0, 0, 0, 0.4), inset 0 1px 0.5px rgba(255, 255, 255, 0.32);
    -webkit-backdrop-filter: blur(35px) saturate(220%);
    backdrop-filter: blur(35px) saturate(220%);
  }
}

:root[data-theme="liquid"] .nav-link {
  color: rgba(235, 235, 245, 0.75);
  border-radius: 14px;
  transition: all 0.2s cubic-bezier(0.32, 0.72, 0, 1);
}

:root[data-theme="liquid"] .nav-link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

:root[data-theme="liquid"] .nav-link.active {
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(48, 176, 199, 0.84) 0%, rgba(10, 132, 255, 0.84) 100%);
  color: #ffffff;
  box-shadow:
    0 6px 20px rgba(10, 132, 255, 0.4),
    inset 0 1px 1px rgba(255, 255, 255, 0.6);
}

:root[data-theme="liquid"] .account-chip {
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  padding: 4px 12px 4px 4px;
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

/* iOS Wallet / Apple Card Hero Spend Panel */
:root[data-theme="liquid"] .spend-panel {
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 26px;
  background:
    radial-gradient(ellipse at 15% 0%, rgba(99, 230, 226, 0.42), transparent 50%),
    radial-gradient(ellipse at 85% 100%, rgba(175, 82, 222, 0.35), transparent 60%),
    linear-gradient(135deg, rgba(20, 52, 98, 0.84) 0%, rgba(46, 40, 102, 0.82) 55%, rgba(74, 32, 92, 0.78) 100%);
  box-shadow:
    inset 0 1.5px 1.5px 0 rgba(255, 255, 255, 0.52),
    inset 0 -1px 1px 0 rgba(255, 255, 255, 0.08),
    0 24px 60px -12px rgba(0, 0, 0, 0.58);
  -webkit-backdrop-filter: blur(35px) saturate(210%);
  backdrop-filter: blur(35px) saturate(210%);
}

:root[data-theme="liquid"] .spend-panel .spend-total {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", sans-serif;
  font-weight: 800;
  letter-spacing: -1.2px;
  text-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
}

:root[data-theme="liquid"] .spend-panel.over-budget {
  border-color: rgba(255, 69, 58, 0.45);
  background:
    radial-gradient(ellipse at 15% 0%, rgba(255, 69, 58, 0.38), transparent 50%),
    linear-gradient(135deg, rgba(94, 20, 32, 0.84) 0%, rgba(60, 20, 44, 0.8) 55%, rgba(74, 32, 92, 0.76) 100%);
  box-shadow:
    inset 0 1.5px 1.5px 0 rgba(255, 120, 120, 0.5),
    0 24px 60px -12px rgba(255, 59, 48, 0.35);
}

/* iOS Inset Grouped Rows (Transactions, Members, Balances) */
:root[data-theme="liquid"] .balance-row,
:root[data-theme="liquid"] .personal-expense-row,
:root[data-theme="liquid"] .expense-item,
:root[data-theme="liquid"] .payment-request-row,
:root[data-theme="liquid"] .alarm-preference-row,
:root[data-theme="liquid"] .alarm-choice,
:root[data-theme="liquid"] .split-member-option,
:root[data-theme="liquid"] .expense-type-option,
:root[data-theme="liquid"] .pace-comparison-grid > div,
:root[data-theme="liquid"] .transactions-table tbody tr:not(.empty-row) {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.055);
  box-shadow: inset 0 1px 0.5px rgba(255, 255, 255, 0.18);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  transition: background 0.15s ease, transform 0.15s cubic-bezier(0.32, 0.72, 0, 1);
}

:root[data-theme="liquid"] .balance-row:active,
:root[data-theme="liquid"] .personal-expense-row:active,
:root[data-theme="liquid"] .expense-item:active,
:root[data-theme="liquid"] .payment-request-row:active {
  background: rgba(255, 255, 255, 0.11);
  transform: scale(0.992);
}

/* iOS Spotlight Search & Inputs */
:root[data-theme="liquid"] .search-box,
:root[data-theme="liquid"] .transaction-search-box {
  border: 0.5px solid rgba(255, 255, 255, 0.18);
  border-radius: 14px;
  background: rgba(118, 118, 128, 0.22);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.25), inset 0 1px 0.5px rgba(255, 255, 255, 0.12);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
}

:root[data-theme="liquid"] .search-box input,
:root[data-theme="liquid"] .transaction-search-box input {
  color: #ffffff;
}

:root[data-theme="liquid"] .search-box input::placeholder,
:root[data-theme="liquid"] .transaction-search-box input::placeholder {
  color: rgba(235, 235, 245, 0.5);
}

:root[data-theme="liquid"] .form-field input,
:root[data-theme="liquid"] .form-field select,
:root[data-theme="liquid"] .form-stack input,
:root[data-theme="liquid"] .theme-preferences-panel select,
:root[data-theme="liquid"] .upi-profile-form input,
:root[data-theme="liquid"] .alert-dialog textarea,
:root[data-theme="liquid"] .smart-assistant-form input,
:root[data-theme="liquid"] #authForm input,
:root[data-theme="liquid"] .payment-proof-content input[type="number"] {
  border: 0.5px solid rgba(255, 255, 255, 0.18);
  border-radius: 13px;
  background: rgba(118, 118, 128, 0.22);
  color: #ffffff;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.28);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

:root[data-theme="liquid"] input:focus,
:root[data-theme="liquid"] select:focus,
:root[data-theme="liquid"] textarea:focus {
  border-color: rgba(99, 230, 226, 0.85);
  box-shadow: 0 0 0 3.5px rgba(48, 176, 199, 0.28), inset 0 1px 2px rgba(0, 0, 0, 0.2);
  outline: none;
}

/* iOS Tactile Buttons */
:root[data-theme="liquid"] .button-primary {
  border: 0.5px solid rgba(255, 255, 255, 0.38);
  border-radius: 16px;
  background: linear-gradient(135deg, #11d8c0 0%, #0a84ff 100%);
  box-shadow:
    inset 0 1px 1.5px rgba(255, 255, 255, 0.55),
    0 8px 25px rgba(10, 132, 255, 0.38),
    0 2px 4px rgba(0, 0, 0, 0.2);
  color: #ffffff;
  font-weight: 700;
  transition: transform 0.15s cubic-bezier(0.32, 0.72, 0, 1), filter 0.15s ease;
}

:root[data-theme="liquid"] .button-primary:active {
  transform: scale(0.96);
  filter: brightness(0.92);
}

:root[data-theme="liquid"] .button-secondary,
:root[data-theme="liquid"] .button-quiet,
:root[data-theme="liquid"] .icon-button {
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.05) 100%);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.25), 0 4px 12px rgba(0, 0, 0, 0.15);
  color: #ffffff;
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  transition: transform 0.15s cubic-bezier(0.32, 0.72, 0, 1), background 0.15s ease;
}

:root[data-theme="liquid"] .button-secondary:active,
:root[data-theme="liquid"] .button-quiet:active,
:root[data-theme="liquid"] .icon-button:active {
  transform: scale(0.96);
  background: rgba(255, 255, 255, 0.18);
}

/* iOS Segmented Control Tabs */
:root[data-theme="liquid"] .tabs {
  border: 0.5px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  background: rgba(118, 118, 128, 0.24);
  padding: 3px;
  gap: 3px;
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
}

:root[data-theme="liquid"] .tabs button {
  border-radius: 11px;
  border: none;
  background: transparent;
  color: rgba(235, 235, 245, 0.75);
  font-weight: 600;
  transition: all 0.2s cubic-bezier(0.32, 0.72, 0, 1);
}

:root[data-theme="liquid"] .tabs button.active {
  background: rgba(255, 255, 255, 0.24);
  color: #ffffff;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25), inset 0 1px 0.5px rgba(255, 255, 255, 0.4);
}

/* iOS Floating Quick Add Button */
:root[data-theme="liquid"] button.mobile-quick-add {
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(17, 216, 192, 0.94) 0%, rgba(10, 132, 255, 0.94) 100%);
  box-shadow:
    inset 0 1.5px 1.5px rgba(255, 255, 255, 0.65),
    0 14px 34px rgba(10, 132, 255, 0.45);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  transition: transform 0.15s cubic-bezier(0.32, 0.72, 0, 1);
}

:root[data-theme="liquid"] button.mobile-quick-add:active {
  transform: scale(0.94);
}

/* iOS Status Badges & Pills */
:root[data-theme="liquid"] .admin-badge,
:root[data-theme="liquid"] .approval-pill,
:root[data-theme="liquid"] .split-status,
:root[data-theme="liquid"] .quiet-pill {
  border: 0.5px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

/* iOS Assistant Panel */
:root[data-theme="liquid"] .smart-assistant-header {
  border-bottom: 0.5px solid rgba(255, 255, 255, 0.16);
  background: linear-gradient(135deg, rgba(48, 176, 199, 0.35) 0%, rgba(10, 132, 255, 0.35) 100%);
}

:root[data-theme="liquid"] .smart-assistant-toggle {
  border: 0.5px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(48, 176, 199, 0.9) 0%, rgba(10, 132, 255, 0.9) 100%);
  box-shadow:
    inset 0 1px 1.5px rgba(255, 255, 255, 0.6),
    0 10px 28px rgba(10, 132, 255, 0.4);
}

:root[data-theme="liquid"] .alert-dialog::backdrop,
:root[data-theme="liquid"] .incoming-alert {
  background: rgba(4, 7, 18, 0.65);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
}

/* iOS Messages / FaceTime styling for Liquid Glass */
:root[data-theme="liquid"] .messenger-dialog,
:root[data-theme="liquid"] .messenger-call-dialog {
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 28px;
  background: rgba(12, 17, 34, 0.84);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.35),
    0 32px 80px rgba(0, 0, 0, 0.65);
  -webkit-backdrop-filter: blur(40px) saturate(210%);
  backdrop-filter: blur(40px) saturate(210%);
}

:root[data-theme="liquid"] .messenger-header,
:root[data-theme="liquid"] .messenger-conversation-header,
:root[data-theme="liquid"] .messenger-call-shell > header {
  border-bottom: 0.5px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
}

:root[data-theme="liquid"] .messenger-list-pane {
  border-right: 0.5px solid rgba(255, 255, 255, 0.12);
}

:root[data-theme="liquid"] .messenger-chat-item {
  border-radius: 14px;
  transition: all 0.2s cubic-bezier(0.32, 0.72, 0, 1);
}

:root[data-theme="liquid"] .messenger-chat-item.is-active,
:root[data-theme="liquid"] .messenger-chat-item:hover {
  background: rgba(255, 255, 255, 0.1);
}

:root[data-theme="liquid"] .message-bubble.is-outgoing {
  background: linear-gradient(135deg, #0a84ff 0%, #007aff 100%);
  color: #ffffff;
  border-radius: 18px 18px 4px 18px;
  box-shadow: 0 2px 8px rgba(0, 122, 255, 0.35);
}

:root[data-theme="liquid"] .message-bubble:not(.is-outgoing) {
  background: rgba(120, 120, 128, 0.28);
  color: #ffffff;
  border-radius: 18px 18px 18px 4px;
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

:root[data-theme="liquid"] .messenger-compose textarea {
  border: 0.5px solid rgba(255, 255, 255, 0.18);
  border-radius: 20px;
  background: rgba(118, 118, 128, 0.24);
  color: #ffffff;
}

:root[data-theme="liquid"] .call-end-button {
  box-shadow: 0 8px 24px rgba(255, 59, 48, 0.45);
}

:root[data-theme="liquid"] .theme-preferences-panel label { color: rgba(235, 235, 245, 0.85); }
:root[data-theme="liquid"] .theme-preferences-panel select { color-scheme: dark; }

:root[data-theme="liquid"] ::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
:root[data-theme="liquid"] ::-webkit-scrollbar-track {
  background: transparent;
}
:root[data-theme="liquid"] ::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.22);
  border-radius: 999px;
}
:root[data-theme="liquid"] ::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.38);
}

/* Restrained glass surfaces, with opaque fallbacks for browsers without blur support. */
:root {
  --glass-bg: rgba(18, 30, 50, .94);
  --glass-bg-raised: rgba(24, 39, 63, .96);
  --glass-border: rgba(190, 214, 255, .16);
  --glass-highlight: rgba(255, 255, 255, .075);
  --glass-shadow: 0 18px 48px rgba(0, 0, 0, .2);
}

body {
  background:
    radial-gradient(ellipse at 82% 4%, rgba(52, 104, 173, .16), transparent 34%),
    radial-gradient(ellipse at 58% 58%, rgba(17, 216, 192, .045), transparent 48%),
    var(--page);
}

.sidebar {
  background: linear-gradient(165deg, rgba(17, 29, 51, .97), rgba(11, 19, 35, .97));
  border-right-color: var(--glass-border);
  box-shadow: 10px 0 36px rgba(0, 0, 0, .12), inset -1px 0 var(--glass-highlight);
}

.topbar {
  border-bottom-color: var(--glass-border);
  background: rgba(13, 21, 38, .92);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .08);
}

.panel,
.auth-card,
.setup-panel,
.setup-aside,
.flow-metric-card,
.personal-stat-card,
.account-settlement-card,
.alert-dialog,
.incoming-alert-card,
.smart-assistant-panel {
  border-color: var(--glass-border);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .045), transparent 42%),
    linear-gradient(150deg, var(--glass-bg-raised), var(--glass-bg));
  box-shadow: var(--glass-shadow), inset 0 1px 0 var(--glass-highlight);
}

.panel {
  border-radius: 20px;
}

.spend-panel {
  border-color: rgba(105, 224, 230, .3);
  background:
    radial-gradient(ellipse at 92% 0, rgba(98, 140, 255, .2), transparent 46%),
    radial-gradient(ellipse at 0 100%, rgba(17, 216, 192, .13), transparent 52%),
    linear-gradient(135deg, rgba(18, 54, 76, .98), rgba(26, 40, 72, .96));
  box-shadow: 0 20px 46px rgba(4, 17, 37, .25), inset 0 1px 0 rgba(255, 255, 255, .16);
}

.spend-panel.over-budget {
  border-color: rgba(255, 127, 139, .5);
  background:
    radial-gradient(ellipse at 92% 0, rgba(255, 127, 139, .16), transparent 46%),
    linear-gradient(135deg, rgba(76, 35, 54, .98), rgba(47, 31, 56, .97));
}

.balance-row,
.personal-stat-card,
.account-settlement-card,
.account-settlement-row,
.personal-expense-row,
.expense-item,
.payment-request-row,
.alarm-preference-row,
.alarm-choice,
.split-member-option,
.expense-type-option,
.split-picker,
.expense-type-picker,
.upi-profile-form,
.pace-comparison-grid > div,
.transactions-table tbody tr:not(.empty-row) {
  border-color: rgba(177, 203, 242, .14);
  background: linear-gradient(145deg, rgba(255, 255, 255, .04), rgba(255, 255, 255, .015)), rgba(10, 20, 37, .52);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .045);
}

.balance-row { border-radius: 14px; }
.transactions-panel,
.roommates-panel,
.settings-page > .panel,
.personal-account-page > .panel,
.add-expense-page > .panel,
.pending-page > .panel {
  box-shadow: var(--glass-shadow), inset 0 1px 0 var(--glass-highlight);
}

.transaction-search-box,
.search-box {
  border-color: rgba(153, 191, 241, .2);
  background: linear-gradient(145deg, rgba(38, 57, 86, .76), rgba(17, 29, 49, .78));
}

.form-field input,
.form-field select,
.form-stack input,
.theme-preferences-panel select,
.upi-profile-form input,
.alert-dialog textarea,
.smart-assistant-form input,
#authForm input,
.payment-proof-content input[type="number"] {
  border-color: rgba(160, 190, 232, .2);
  background-color: rgba(9, 19, 35, .76);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .035);
}

.form-field input:focus,
.form-field select:focus,
.form-stack input:focus,
.theme-preferences-panel select:focus,
.upi-profile-form input:focus,
.alert-dialog textarea:focus,
.smart-assistant-form input:focus,
#authForm input:focus {
  border-color: rgba(65, 224, 207, .7);
  box-shadow: 0 0 0 3px rgba(17, 216, 192, .12), inset 0 1px 0 rgba(255, 255, 255, .05);
}

.button-primary {
  border-color: rgba(205, 255, 251, .28);
  background: linear-gradient(115deg, #24c7d8, #15d4be 70%, #57cdbb);
  box-shadow: 0 8px 22px rgba(7, 182, 183, .2), inset 0 1px 0 rgba(255, 255, 255, .28);
}

.button-secondary,
.button-quiet,
.icon-button {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06);
}

.nav-link.active {
  border-color: rgba(184, 255, 247, .24);
  background: linear-gradient(115deg, rgba(19, 164, 194, .96), rgba(13, 196, 177, .94));
  box-shadow: 0 8px 26px rgba(14, 211, 195, .16), inset 0 1px 0 rgba(255, 255, 255, .24);
}

.quick-add,
.mobile-quick-add,
.smart-assistant-toggle {
  border: 1px solid rgba(222, 255, 255, .3);
  box-shadow: 0 12px 30px rgba(4, 19, 42, .25), inset 0 1px 0 rgba(255, 255, 255, .26);
}

.alert-dialog {
  border-radius: 22px;
}

.incoming-alert {
  background: rgba(3, 8, 17, .72);
}

.smart-assistant-header {
  border-bottom-color: var(--glass-border);
  background: linear-gradient(120deg, rgba(41, 66, 100, .82), rgba(24, 39, 63, .86));
}

.smart-assistant-message,
.smart-assistant-form input,
.smart-assistant-suggestions button {
  border-color: rgba(177, 203, 242, .14);
  background: rgba(10, 20, 37, .58);
}

@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .sidebar,
  .topbar,
  .panel,
  .auth-card,
  .setup-panel,
  .setup-aside,
  .flow-metric-card,
  .alert-dialog,
  .incoming-alert-card,
  .smart-assistant-panel {
    -webkit-backdrop-filter: blur(16px) saturate(135%);
    backdrop-filter: blur(16px) saturate(135%);
  }

  .sidebar { background: linear-gradient(165deg, rgba(17, 29, 51, .82), rgba(11, 19, 35, .82)); }
  .topbar { background: rgba(13, 21, 38, .72); }
  .panel,
  .auth-card,
  .setup-panel,
  .setup-aside,
  .flow-metric-card,
  .alert-dialog,
  .incoming-alert-card,
  .smart-assistant-panel {
    background:
      linear-gradient(145deg, rgba(255, 255, 255, .055), transparent 42%),
      linear-gradient(150deg, rgba(24, 39, 63, .78), rgba(16, 28, 47, .76));
  }

  .spend-panel {
    background:
      radial-gradient(ellipse at 92% 0, rgba(98, 140, 255, .2), transparent 46%),
      radial-gradient(ellipse at 0 100%, rgba(17, 216, 192, .13), transparent 52%),
      linear-gradient(135deg, rgba(18, 54, 76, .82), rgba(26, 40, 72, .82));
  }
}

.reset-household-card {
  grid-column: 1 / -1;
  border-color: rgba(255, 104, 120, .34);
}

.reset-household-copy,
.reset-household-impact {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.reset-household-impact {
  padding: 10px 12px;
  border: 1px solid rgba(255, 175, 112, .2);
  border-radius: 12px;
  background: rgba(255, 175, 112, .055);
}

.reset-household-action {
  display: inline-flex;
  width: max-content;
  max-width: 100%;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  padding: 9px 14px;
  border: 1px solid rgba(255, 129, 143, .46);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(160, 43, 62, .94), rgba(114, 31, 54, .96));
  box-shadow: 0 8px 20px rgba(117, 24, 46, .22), inset 0 1px 0 rgba(255, 255, 255, .13);
  color: #fff3f4;
  font: inherit;
  font-size: 11px;
  font-weight: 750;
  line-height: 1.35;
  text-align: center;
  cursor: pointer;
  transition: filter .16s ease, transform .16s ease;
}

.reset-household-action:hover:not(:disabled) {
  filter: brightness(1.12);
  transform: translateY(-1px);
}

.reset-household-action:disabled {
  cursor: not-allowed;
  opacity: .48;
}

.reset-household-card .message {
  margin: 10px 0 0;
  line-height: 1.5;
}

.reset-household-warning {
  padding: 11px 12px;
  border: 1px solid rgba(255, 104, 120, .32);
  border-left: 3px solid #ff6878;
  border-radius: 10px;
  background: rgba(255, 82, 96, .08);
  color: #ffe0e4;
}

.reset-household-dialog label code {
  display: inline-block;
  margin: 4px 0 0;
  padding: 3px 7px;
  border: 1px solid rgba(255, 129, 143, .32);
  border-radius: 7px;
  background: rgba(255, 82, 96, .08);
  color: #ffd2d8;
  font-family: inherit;
  overflow-wrap: anywhere;
}

#resetHouseholdNameInput {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid rgba(160, 190, 232, .24);
  border-radius: 10px;
  outline: 0;
  background: rgba(9, 19, 35, .76);
  color: var(--text);
  font: inherit;
  font-size: 13px;
}

#resetHouseholdNameInput:focus {
  border-color: rgba(255, 104, 120, .72);
  box-shadow: 0 0 0 3px rgba(255, 82, 96, .13);
}

.reset-household-dialog .alert-dialog-actions {
  align-items: center;
}

.reset-household-dialog .alert-dialog-actions .reset-household-action {
  flex: 1 1 190px;
}

:root[data-theme="white"] .reset-household-action {
  border-color: rgba(153, 31, 51, .28);
  background: linear-gradient(135deg, #a92c43, #84243a);
  color: #fff;
}

:root[data-theme="white"] .reset-household-warning {
  color: #722333;
}

:root[data-theme="white"] .reset-household-dialog label code {
  background: rgba(169, 44, 67, .07);
  color: #762638;
}

:root[data-theme="white"] #resetHouseholdNameInput {
  border-color: rgba(57, 78, 111, .24);
  background: rgba(255, 255, 255, .92);
  color: #202b40;
}

@media (max-width: 700px) {
  .reset-household-action {
    width: 100%;
  }

  .reset-household-dialog .alert-dialog-actions .reset-household-action {
    flex-basis: 100%;
  }
}

:root[data-theme="white"] {
  --glass-bg: rgba(255, 255, 255, .97);
  --glass-bg-raised: rgba(255, 255, 255, .98);
  --glass-border: rgba(66, 91, 131, .15);
  --glass-highlight: rgba(255, 255, 255, .9);
  --glass-shadow: 0 18px 48px rgba(34, 52, 82, .09);
}

:root[data-theme="white"] body {
  background:
    radial-gradient(ellipse at 82% 4%, rgba(98, 140, 255, .08), transparent 34%),
    radial-gradient(ellipse at 58% 58%, rgba(17, 216, 192, .055), transparent 48%),
    var(--page);
}

:root[data-theme="white"] .sidebar {
  background: linear-gradient(165deg, rgba(255, 255, 255, .98), rgba(244, 248, 255, .97));
}

:root[data-theme="white"] .topbar {
  background: rgba(255, 255, 255, .92);
}

:root[data-theme="white"] .panel,
:root[data-theme="white"] .auth-card,
:root[data-theme="white"] .setup-panel,
:root[data-theme="white"] .setup-aside,
:root[data-theme="white"] .flow-metric-card,
:root[data-theme="white"] .personal-stat-card,
:root[data-theme="white"] .account-settlement-card,
:root[data-theme="white"] .alert-dialog,
:root[data-theme="white"] .incoming-alert-card,
:root[data-theme="white"] .smart-assistant-panel {
  border-color: var(--glass-border);
  background: linear-gradient(145deg, rgba(255, 255, 255, .99), rgba(246, 249, 255, .94));
  box-shadow: var(--glass-shadow), inset 0 1px 0 var(--glass-highlight);
}

:root[data-theme="white"] .balance-row,
:root[data-theme="white"] .personal-stat-card,
:root[data-theme="white"] .account-settlement-card,
:root[data-theme="white"] .account-settlement-row,
:root[data-theme="white"] .personal-expense-row,
:root[data-theme="white"] .expense-item,
:root[data-theme="white"] .payment-request-row,
:root[data-theme="white"] .alarm-preference-row,
:root[data-theme="white"] .alarm-choice,
:root[data-theme="white"] .split-member-option,
:root[data-theme="white"] .expense-type-option,
:root[data-theme="white"] .split-picker,
:root[data-theme="white"] .expense-type-picker,
:root[data-theme="white"] .upi-profile-form,
:root[data-theme="white"] .pace-comparison-grid > div,
:root[data-theme="white"] .transactions-table tbody tr:not(.empty-row) {
  border-color: rgba(66, 91, 131, .14);
  background: linear-gradient(145deg, rgba(255, 255, 255, .96), rgba(244, 248, 255, .88));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .92);
}

:root[data-theme="white"] .form-field input,
:root[data-theme="white"] .form-field select,
:root[data-theme="white"] .form-stack input,
:root[data-theme="white"] .theme-preferences-panel select,
:root[data-theme="white"] .upi-profile-form input,
:root[data-theme="white"] .alert-dialog textarea,
:root[data-theme="white"] .smart-assistant-form input,
:root[data-theme="white"] #authForm input,
:root[data-theme="white"] .payment-proof-content input[type="number"] {
  border-color: rgba(66, 91, 131, .18);
  background-color: rgba(255, 255, 255, .92);
  color: #202b40;
}

:root[data-theme="white"] .transaction-search-box,
:root[data-theme="white"] .search-box {
  border-color: rgba(66, 91, 131, .17);
  background: linear-gradient(145deg, rgba(255, 255, 255, .96), rgba(241, 246, 253, .9));
}

:root[data-theme="white"] .smart-assistant-header {
  background: linear-gradient(120deg, rgba(233, 241, 252, .96), rgba(248, 250, 255, .96));
}

@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  :root[data-theme="white"] .sidebar { background: rgba(255, 255, 255, .84); }
  :root[data-theme="white"] .topbar { background: rgba(255, 255, 255, .78); }
  :root[data-theme="white"] .panel,
  :root[data-theme="white"] .auth-card,
  :root[data-theme="white"] .setup-panel,
  :root[data-theme="white"] .setup-aside,
  :root[data-theme="white"] .flow-metric-card,
  :root[data-theme="white"] .alert-dialog,
  :root[data-theme="white"] .incoming-alert-card,
  :root[data-theme="white"] .smart-assistant-panel {
    background: linear-gradient(145deg, rgba(255, 255, 255, .83), rgba(246, 249, 255, .78));
  }
}

@media (max-width: 700px) {
  .sidebar {
    border-top: 1px solid rgba(190, 214, 255, .16);
    background: rgba(13, 22, 40, .96);
    box-shadow: 0 -12px 35px rgba(0, 0, 0, .24), inset 0 1px 0 rgba(255, 255, 255, .08);
  }

  .panel { border-radius: 18px; }
  .smart-assistant-panel { background: linear-gradient(150deg, rgba(24, 39, 63, .98), rgba(16, 28, 47, .98)); }

  @supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .sidebar { background: rgba(13, 22, 40, .82); }
    .smart-assistant-panel { background: linear-gradient(150deg, rgba(24, 39, 63, .88), rgba(16, 28, 47, .86)); }
    .sidebar,
    .topbar,
    .panel,
    .auth-card,
    .setup-panel,
    .setup-aside,
    .flow-metric-card,
    .alert-dialog,
    .incoming-alert-card,
    .smart-assistant-panel {
      -webkit-backdrop-filter: blur(10px) saturate(120%);
      backdrop-filter: blur(10px) saturate(120%);
    }
  }
}

/* ============================================================
   APP OPENING ANIMATION / SPLASH SCREEN
   ============================================================ */

.app-splash {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  margin: 0;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  background: linear-gradient(160deg, #ecfdf5, #f5f7f8 50%, #e0f2fe);
  overflow: hidden;
  font-family: Inter, -apple-system, BlinkMacSystemFont, sans-serif;
  color: #0f172a;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  transition: opacity 0.34s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.34s cubic-bezier(0.16, 1, 0.3, 1),
              filter 0.34s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform, filter;
}

.app-splash.splash-dismissing {
  opacity: 0;
  transform: scale(1.02);
  filter: blur(4px);
  pointer-events: none;
}

.app-splash.splash-hidden {
  display: none !important;
}

/* Ambient floating blobs (Splash reference) */
.splash-ambient {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.splash-blob {
  position: absolute;
  border-radius: 999px;
  will-change: transform;
}

.splash-blob-a {
  left: -60px;
  top: -40px;
  width: 260px;
  height: 260px;
  background: #5eead4;
  opacity: .45;
  filter: blur(50px);
  animation: splashBlobFloatA 9s ease-in-out infinite;
}

.splash-blob-b {
  right: -70px;
  top: 34%;
  width: 240px;
  height: 240px;
  background: #bae6fd;
  opacity: .55;
  filter: blur(50px);
  animation: splashBlobFloatB 11s ease-in-out infinite;
}

.splash-blob-c {
  left: 12%;
  bottom: -80px;
  width: 280px;
  height: 280px;
  background: #a7f3d0;
  opacity: .5;
  filter: blur(55px);
  animation: splashBlobFloatA 9s ease-in-out infinite;
}

/* Center composition */
.splash-center {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 24px;
  max-width: 90vw;
}

/* Emblem & Pulse Ring */
.splash-emblem-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 140px;
  height: 140px;
}

.splash-pulse-ring {
  position: absolute;
  inset: 0;
  border-radius: 40px;
  background: #0f766e;
  pointer-events: none;
  animation: splashMockRing 2.4s ease-out .65s infinite;
}

.splash-logo-card {
  position: relative;
  z-index: 2;
  width: 140px;
  height: 140px;
  border-radius: 38px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0f766e;
  box-shadow: 0 16px 28px rgba(15, 118, 110, .35);
  animation: splashMockPop .9s cubic-bezier(.2, .9, .3, 1.2) .15s backwards;
  will-change: transform, opacity;
}

.splash-logo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Text Group */
.splash-text-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 28px;
}

.splash-brand-title {
  display: inline-flex;
  align-items: baseline;
  font-family: Inter, 'Manrope', sans-serif;
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #0f172a;
  line-height: 1.15;
  animation: splashMockFadeUp .7s cubic-bezier(.2, .8, .2, 1) .45s backwards;
}

.splash-brand-accent {
  color: #0f766e;
}

.splash-tagline {
  margin: 6px 0 0;
  font-family: Inter, sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.4;
  color: #475569;
  animation: splashMockFadeUp .7s cubic-bezier(.2, .8, .2, 1) .58s backwards;
}

.splash-credit {
  margin-top: 5px;
  font-family: Inter, sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64748b;
  animation: splashMockFadeUp .7s cubic-bezier(.2, .8, .2, 1) .68s backwards;
}

/* Loader Dots */
.splash-loader-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 44px;
  animation: splashMockFadeUp .7s cubic-bezier(.2, .8, .2, 1) .78s backwards;
}

.splash-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.splash-dot {
  width: 10px;
  height: 10px;
  border-radius: 5px;
  background: #0f766e;
  animation: splashDotBounce 1.2s ease-in-out infinite;
}

.splash-dot-2 { animation-delay: .15s; }
.splash-dot-3 { animation-delay: .3s; }

/* Keep light-mint splash consistent across active themes */
:root[data-theme="white"] .app-splash,
:root[data-theme="liquid"] .app-splash {
  background: linear-gradient(160deg, #ecfdf5, #f5f7f8 50%, #e0f2fe);
  color: #0f172a;
}

/* Opening Animation Keyframes */
@keyframes splashBlobFloatA {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(24px, 18px) scale(1.08); }
}

@keyframes splashBlobFloatB {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-22px, -20px) scale(1.1); }
}

@keyframes splashMockPop {
  0% { opacity: 0; transform: scale(.4) rotate(-10deg); }
  70% { opacity: 1; transform: scale(1.1) rotate(3deg); }
  100% { opacity: 1; transform: none; }
}

@keyframes splashMockRing {
  0% { transform: scale(1); opacity: .4; }
  100% { transform: scale(2); opacity: 0; }
}

@keyframes splashMockFadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}

@keyframes splashDotBounce {
  0%, 80%, 100% { transform: translateY(0); opacity: .4; }
  40% { transform: translateY(-8px); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .splash-blob,
  .splash-pulse-ring,
  .splash-logo-card,
  .splash-brand-title,
  .splash-tagline,
  .splash-credit,
  .splash-loader-area,
  .splash-dot {
    opacity: 1 !important;
    animation: none !important;
  }
}

/* App View Entrance Transition */
.app-enter-reveal {
  animation: appViewReveal 0.65s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes appViewReveal {
  0% {
    opacity: 0.6;
    transform: translateY(14px) scale(0.992);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Preference button for previewing */
.opening-animation-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  margin-top: 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--panel-raised);
}

.opening-animation-row strong {
  display: block;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}

.opening-animation-row span {
  font-size: 11.5px;
  color: var(--muted);
}

.opening-animation-row button {
  flex-shrink: 0;
  min-height: 38px;
  padding: 0 14px;
  font-size: 12px;
  white-space: nowrap;
}

@media (max-width: 600px) {
  .splash-center {
    padding: 16px;
  }
  .splash-emblem-wrap,
  .splash-logo-card {
    width: 124px;
    height: 124px;
  }
  .splash-pulse-ring {
    border-radius: 36px;
  }
  .splash-logo-card {
    border-radius: 34px;
  }
  .splash-brand-title {
    font-size: 32px;
  }
  .splash-tagline {
    font-size: 15px;
  }
  .opening-animation-row {
    flex-direction: column;
    align-items: stretch;
  }
  .opening-animation-row button {
    width: 100%;
  }
}

/* Household spending breakdown: existing theme tokens, no palette changes. */
.spending-breakdown { min-width: 0; max-width: 100%; color: inherit; }
.spending-breakdown-heading { display:flex; align-items:center; justify-content:space-between; gap:8px; margin:0 0 6px; }
.spending-breakdown-heading h2 { margin:0; font-size:19px; font-weight:700; }
.spending-breakdown-heading > span, .spending-breakdown-total { font-size:12px; color:var(--muted); }
.spending-breakdown-total { margin:0 0 12px; }
.spending-breakdown-cards { display:flex; gap:12px; overflow-x:auto; padding:2px 2px 9px; scroll-snap-type:x proximity; -webkit-overflow-scrolling:touch; }
.spending-breakdown-card { box-sizing:border-box; flex:0 0 152px; min-width:0; padding:14px; border:1px solid var(--line); border-radius:var(--radius,18px); background:var(--panel); color:var(--text); display:flex; flex-direction:column; gap:7px; scroll-snap-align:start; }
.spending-breakdown-card > strong { font-size:14px; overflow-wrap:anywhere; }
.spending-breakdown-icon { display:grid; place-items:center; width:36px; height:36px; border-radius:12px; background:var(--panel-raised); color:var(--text); font-size:21px; }
.spending-breakdown-amount { color:var(--muted); font-size:13px; font-weight:600; }
.spending-breakdown-footer { display:flex; align-items:center; gap:8px; margin-top:auto; padding-top:7px; font-size:12px; }
.spending-breakdown-footer progress { appearance:none; -webkit-appearance:none; min-width:0; width:100%; height:6px; border:0; border-radius:8px; background:var(--panel-raised); }
.spending-breakdown-footer progress::-webkit-progress-bar { background:var(--panel-raised); border-radius:8px; }
.spending-breakdown-footer progress::-webkit-progress-value { background:var(--teal); border-radius:8px; }
.spending-breakdown-footer progress::-moz-progress-bar { background:var(--teal); border-radius:8px; }
.spending-breakdown-empty { color:var(--muted); padding:12px; margin:0; }

/* Shared mobile Home palette: same existing values, no new palette. */
@media (max-width:700px) {
  #householdDashboard {
    --home-card-surface: white;
    --home-card-line: #e2e8f0;
    --home-card-radius: 20px;
    --home-card-muted: #475569;
    --home-card-accent: #0f766e;
  }
  #householdDashboard .spending-breakdown { color: inherit; font: inherit; }
  #householdDashboard .spending-breakdown-heading h2 { color: inherit; font: 600 16px Inter, sans-serif; }
  #householdDashboard .spending-breakdown-card { padding:12px 16px; border-color:var(--home-card-line); border-radius:var(--home-card-radius); background:var(--home-card-surface); color:inherit; font:inherit; }
  #householdDashboard .spending-breakdown-card > span { margin:0; color:var(--home-card-muted); font-size:13px; }
  #householdDashboard .spending-breakdown-card > .spending-breakdown-icon { display:grid; background:transparent; color:inherit; font-size:21px; }
  #householdDashboard .spending-breakdown-heading > span, #householdDashboard .spending-breakdown-total, #householdDashboard .spending-breakdown-empty { color:var(--home-card-muted); }
  #householdDashboard .spending-breakdown-footer progress, #householdDashboard .spending-breakdown-footer progress::-webkit-progress-bar { background:var(--home-card-line); }
  #householdDashboard .spending-breakdown-footer progress::-webkit-progress-value { background:var(--home-card-accent); }
  #householdDashboard .spending-breakdown-footer progress::-moz-progress-bar { background:var(--home-card-accent); }
}
.spending-breakdown-footer > strong { flex:0 0 auto; white-space:nowrap; }
.spending-breakdown-footer progress { flex:1 1 0; width:0; }
@media (max-width:700px) { #householdDashboard .spending-breakdown { padding-bottom:16px; } }

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

@media (max-width: 700px) {
  .sidebar {
    transition: transform .2s ease;
  }
  body.floating-actions-hidden .sidebar {
    pointer-events: none;
    transform: translateY(100%);
  }
  .mobile-quick-add,
  .smart-assistant-widget {
    transition: opacity .2s ease, transform .2s ease;
  }
  body.floating-actions-hidden .mobile-quick-add,
  body.floating-actions-hidden .smart-assistant-widget {
    opacity: 0;
    pointer-events: none;
    transform: translateY(18px);
  }
}

/* iPhone and other narrow-screen layout guardrails. Keep every app surface
   inside the visual viewport and leave room for the safe-area insets. */
@media (max-width: 700px) {
  html, body { width: 100%; min-width: 320px; overflow-x: clip; }
  .app-shell, .app-content, .dashboard-main,
  .dashboard-layout, .dashboard-main-column, .dashboard-side-column,
  .setup-grid, .flowchart-page, .pending-page, .settings-page,
  .add-expense-page, .personal-account-page, .profile-edit-page {
    width: 100%; min-width: 0; max-width: 100%;
  }
  .app-content { margin-left: 0; }
  .topbar { padding-top: calc(12px + env(safe-area-inset-top)); }
  .dashboard-main { padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); }
  .dashboard-layout > *, .setup-grid > *, .settings-grid > *,
  .flowchart-page > *, .pending-page > *, .add-expense-page > *,
  .personal-account-page > *, .panel, .section-heading,
  .balance-row, .expense-item, .payment-request-row { min-width: 0; max-width: 100%; }
  img, video, canvas, iframe { max-width: 100%; }
  input, select, textarea, button { max-width: 100%; }
  .alert-dialog, .friend-finder-dialog, .messenger-dialog, .messenger-call-dialog {
    max-width: calc(100vw - 20px);
    max-height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 20px);
  }
  .alert-dialog form, .person-details-content, .payment-proof-content,
  .payment-review-content, .friend-finder-content { min-width: 0; }
}

@media (max-width: 390px) {
  .dashboard-main { padding-left: max(11px, env(safe-area-inset-left)); padding-right: max(11px, env(safe-area-inset-right)); }
  .panel { padding-inline: 13px; }
  .section-heading { gap: 8px; }
  .account-settlement-heading { flex-wrap: wrap; }
}

/* RoomMate messenger: desktop two-pane layout with a true full-screen iPhone view. */
.messenger-dialog.whatsapp-dialog {
  width: min(1040px, calc(100vw - 40px));
  max-width: min(1040px, calc(100vw - 40px));
  height: min(760px, calc(100dvh - 48px));
  max-height: min(760px, calc(100dvh - 48px));
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, .3);
  border-radius: 22px;
  color: var(--text, #17212b);
  background: #f8fafc;
  box-shadow: 0 28px 90px rgba(15, 23, 42, .3);
}
.messenger-dialog.whatsapp-dialog::backdrop { background: rgba(15, 23, 42, .58); backdrop-filter: blur(5px); }
.whatsapp-shell { display: flex; flex-direction: column; width: 100%; height: 100%; min-height: 0; background: #f8fafc; }
.whatsapp-main-header { flex: 0 0 76px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 20px; border-bottom: 1px solid #e6ebef; background: #fff; }
.whatsapp-brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.whatsapp-logo-mark { width: 42px; height: 42px; display: grid; place-items: center; flex: 0 0 42px; color: #fff; border-radius: 14px; background: linear-gradient(145deg, #0ea982, #087e70); box-shadow: 0 5px 14px rgba(8,126,112,.2); }
.whatsapp-brand-title { display: flex; align-items: center; gap: 9px; }
.whatsapp-brand-title h2 { margin: 0; color: #142d36; font-size: 18px; line-height: 1.2; font-weight: 800; letter-spacing: -.35px; }
.whatsapp-badge { padding: 4px 7px; color: #087e70; background: #e6f7f1; border-radius: 999px; font-size: 9px; font-weight: 800; letter-spacing: .8px; }
.whatsapp-main-header .panel-kicker { margin: 3px 0 0; color: #82919a; font-size: 9px; letter-spacing: 1.3px; }
.whatsapp-close-btn { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; color: #687780; background: #f3f6f7; }
.whatsapp-layout { display: flex; flex: 1; min-height: 0; }
.whatsapp-list-pane { width: 34%; min-width: 260px; max-width: 350px; display: flex; flex-direction: column; min-height: 0; background: #fff; border-right: 1px solid #e6ebef; }
.whatsapp-list-header { min-height: 68px; display: flex; align-items: center; justify-content: space-between; padding: 12px 17px; }
.whatsapp-my-avatar { position: relative; width: 42px; height: 42px; }
.whatsapp-my-avatar > .avatar { width: 42px; height: 42px; }
.whatsapp-status-online { position: absolute; right: -1px; bottom: -1px; width: 12px; height: 12px; border: 2px solid #fff; border-radius: 50%; background: #19b77a; }
.whatsapp-list-header-actions { display: flex; gap: 8px; }
.whatsapp-icon-btn { width: 42px; height: 42px; flex: 0 0 42px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 13px; color: #63747b; background: transparent; cursor: pointer; transition: background .15s ease, color .15s ease; }
.whatsapp-icon-btn:hover { color: #087e70; background: #eaf7f3; }
.whatsapp-search-bar { padding: 0 14px 13px; }
.whatsapp-search-box { height: 42px; display: flex; align-items: center; gap: 9px; padding: 0 12px; border: 1px solid #edf1f2; border-radius: 13px; color: #8b9aa1; background: #f5f8f8; }
.whatsapp-search-box input { width: 100%; min-width: 0; padding: 0; border: 0; outline: 0; color: #23363d; background: transparent; font-size: 13px; }
.whatsapp-search-box input::placeholder { color: #91a0a6; }
.whatsapp-chat-list { flex: 1; min-height: 0; overflow: auto; padding: 3px 8px 12px; }
.messenger-chat-item { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 12px 10px; border: 0; border-bottom: 1px solid #f0f3f4; border-radius: 13px; color: inherit; background: transparent; cursor: pointer; text-align: left; }
.messenger-chat-item:hover, .messenger-chat-item.is-active { background: #edf8f4; }
.messenger-chat-avatar { width: 46px; height: 46px; flex: 0 0 46px; border-radius: 50%; }
.messenger-chat-copy { flex: 1; min-width: 0; }
.messenger-chat-title-line { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #20343b; font-size: 13px; font-weight: 750; }
.messenger-chat-title-line > * { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.messenger-chat-copy > small { display: block; margin-top: 5px; overflow: hidden; color: #819198; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.messenger-list-empty { margin: 14px 10px; padding: 16px; border-radius: 12px; color: #84928f; background: #f6f9f8; font-size: 12px; text-align: center; }
.messenger-unread-dot { width: 8px; height: 8px; flex: 0 0 8px; border-radius: 50%; background: #0ba47d; }
.whatsapp-conversation { position: relative; display: flex; flex: 1; flex-direction: column; min-width: 0; min-height: 0; background-color: #f4f7f6; background-image: radial-gradient(rgba(8,126,112,.045) .8px, transparent .8px); background-size: 18px 18px; }
.whatsapp-chat-header { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 18px; border-bottom: 1px solid #e4ebea; background: rgba(255,255,255,.96); }
.whatsapp-chat-header-left { display: flex; align-items: center; gap: 11px; min-width: 0; }
.whatsapp-contact-avatar { width: 42px; height: 42px; flex: 0 0 42px; }
.whatsapp-header-info { min-width: 0; }
.whatsapp-header-info strong { display: block; overflow: hidden; color: #20343b; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.whatsapp-status-sub { display: block; margin-top: 3px; color: #87969a; font-size: 11px; }
.whatsapp-call-actions { display: flex; align-items: center; gap: 2px; }
.whatsapp-messages { display: flex; flex: 1; flex-direction: column; gap: 10px; min-height: 0; overflow: auto; padding: 18px clamp(12px, 4vw, 36px); }
.messenger-household-note { align-self: center; max-width: 90%; margin: 2px auto 9px; padding: 8px 13px; border: 1px solid #e2ece8; border-radius: 12px; color: #687c77; background: rgba(255,255,255,.88); font-size: 11px; line-height: 1.45; text-align: center; }
.messenger-bubble, .whatsapp-bubble { max-width: min(76%, 520px); padding: 10px 13px 8px; border: 1px solid #e8eeeb; border-radius: 16px 16px 16px 5px; color: #263b40; background: #fff; box-shadow: 0 2px 6px rgba(25,52,47,.045); overflow-wrap: anywhere; }
.messenger-bubble.mine, .whatsapp-bubble.mine { align-self: flex-end; border-color: #c6eee0; border-radius: 16px 16px 5px 16px; background: #dcf8ec; }
.whatsapp-msg-text { white-space: pre-wrap; line-height: 1.48; font-size: 14px; }
.whatsapp-bubble-meta { display: flex; align-items: center; justify-content: flex-end; gap: 5px; margin-top: 5px; color: #8a9b9a; font-size: 10px; }
.whatsapp-ticks { color: #159b82; }
.whatsapp-sender-name { display: block; margin-bottom: 4px; color: #07846f; font-size: 11px; font-weight: 750; }
.whatsapp-date-pill { align-self: center; margin: 5px auto; padding: 5px 10px; border-radius: 999px; color: #748580; background: #eaf0ed; font-size: 10px; }
.whatsapp-quick-emoji-bar { display: flex; justify-content: center; gap: 4px; padding: 5px 10px 8px; }
.whatsapp-emoji-quick { min-width: 38px; min-height: 36px; border: 0; border-radius: 10px; background: transparent; font-size: 18px; cursor: pointer; }
.whatsapp-emoji-quick:hover { background: #e7f3ef; }
.whatsapp-compose { display: flex; align-items: flex-end; gap: 5px; padding: 10px 14px max(12px, env(safe-area-inset-bottom)); border-top: 1px solid #e3eae7; background: #fff; }
.whatsapp-compose-tool { width: 40px; height: 42px; flex-basis: 40px; }
.whatsapp-input-wrap { flex: 1; min-width: 0; }
.whatsapp-input-wrap textarea { display: block; width: 100%; min-height: 42px; max-height: 120px; resize: none; padding: 11px 14px; border: 1px solid #e5ece9; border-radius: 15px; outline: none; color: #263a3f; background: #f7faf9; font: inherit; font-size: 14px; line-height: 20px; }
.whatsapp-input-wrap textarea:focus { border-color: #70cbb0; box-shadow: 0 0 0 3px rgba(14,169,130,.1); }
.whatsapp-send-btn { width: 44px; height: 44px; flex: 0 0 44px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 15px; color: #fff; background: #079879; cursor: pointer; }
.whatsapp-send-btn:hover { background: #067e69; }
.whatsapp-empty-state { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 28px; color: #62736f; text-align: center; }
.whatsapp-empty-illustration { width: 150px; height: 126px; display: grid; place-items: center; margin-bottom: 14px; border-radius: 40px; background: #e7f7f1; }
.whatsapp-empty-illustration svg { width: 125px; height: auto; }
.whatsapp-empty-state strong { color: #223a3d; font-size: 18px; }
.whatsapp-empty-state > p { max-width: 300px; margin: 8px 0 14px; color: #81908d; font-size: 13px; line-height: 1.55; }
.whatsapp-empty-security { display: flex; align-items: center; gap: 6px; padding: 8px 11px; border-radius: 999px; color: #538075; background: #e7f5ef; font-size: 10px; }
.whatsapp-new-panel { position: absolute; z-index: 2; inset: 0; display: flex; flex-direction: column; padding: 24px; overflow: auto; background: #f8fbfa; }
.whatsapp-new-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: #20383e; }
.whatsapp-member-choices { display: grid; gap: 8px; margin-top: 18px; }
.whatsapp-member-choices label { display: flex; align-items: center; gap: 11px; min-height: 54px; padding: 8px 12px; border: 1px solid #e6eeea; border-radius: 13px; background: #fff; }
.whatsapp-start-btn { min-height: 46px; margin-top: auto; border: 0; border-radius: 13px; color: #fff; background: #078f73; font-weight: 750; }
.whatsapp-list-pane > .message { margin: 0; padding: 0 16px 10px; font-size: 12px; }

@media (max-width: 700px) {
  .messenger-dialog.whatsapp-dialog {
    position: fixed; inset: 0; width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh;
    margin: 0; padding: 0; border: 0; border-radius: 0; overflow: hidden;
  }
  .whatsapp-shell { height: 100%; height: 100dvh; min-height: 0; }
  .whatsapp-main-header { flex-basis: 66px; min-height: 66px; padding: max(8px, env(safe-area-inset-top)) 14px 8px; }
  .whatsapp-brand { gap: 10px; }
  .whatsapp-logo-mark { width: 38px; height: 38px; flex-basis: 38px; border-radius: 12px; }
  .whatsapp-brand-title h2 { font-size: 16px; }
  .whatsapp-badge { font-size: 8px; }
  .whatsapp-main-header .panel-kicker { font-size: 8px; }
  .whatsapp-layout { position: relative; flex: 1; min-height: 0; }
  .whatsapp-list-pane { width: 100%; max-width: none; min-width: 0; border-right: 0; }
  .whatsapp-conversation { display: none; width: 100%; min-width: 0; }
  .whatsapp-mobile-chat-active .whatsapp-list-pane { display: none; }
  .whatsapp-mobile-chat-active .whatsapp-conversation { display: flex; }
  .whatsapp-mobile-chat-active .whatsapp-main-header { display: none; }
  .whatsapp-list-header { min-height: 64px; padding-inline: 16px; }
  .whatsapp-search-bar { padding-inline: 12px; }
  .whatsapp-chat-list { padding-inline: 9px; }
  .whatsapp-chat-item { min-height: 70px; }
  .whatsapp-chat-header { min-height: 60px; padding: 7px 8px; gap: 3px; }
  .whatsapp-chat-header-left { gap: 6px; }
  .whatsapp-back-btn { width: 40px; height: 44px; flex-basis: 40px; }
  .whatsapp-contact-avatar { width: 38px; height: 38px; flex-basis: 38px; }
  .whatsapp-header-info strong { max-width: min(44vw, 220px); font-size: 13px; }
  .whatsapp-status-sub { font-size: 10px; }
  .whatsapp-call-actions { gap: 0; }
  .whatsapp-call-actions .whatsapp-icon-btn { width: 38px; height: 42px; flex-basis: 38px; }
  .whatsapp-messages { gap: 8px; padding: 12px 12px 8px; }
  .messenger-bubble, .whatsapp-bubble { max-width: 86%; }
  .whatsapp-compose { gap: 2px; padding: 7px 8px max(8px, env(safe-area-inset-bottom)); }
  .whatsapp-compose-tool { width: 36px; height: 42px; flex-basis: 36px; }
  .whatsapp-compose-tool:nth-of-type(2) { display: none; }
  .whatsapp-input-wrap textarea { min-height: 42px; max-height: 96px; padding: 10px 12px; font-size: 16px; }
  .whatsapp-send-btn { width: 42px; height: 42px; flex-basis: 42px; border-radius: 14px; }
  .whatsapp-quick-emoji-bar { justify-content: flex-start; gap: 1px; padding-inline: 6px; overflow-x: auto; }
  .whatsapp-emoji-quick { min-width: 36px; }
  .whatsapp-new-panel { padding: 18px 15px max(18px, env(safe-area-inset-bottom)); }
}

/* Native-feeling incoming call screen for notification launches and foreground calls. */
.incoming-call-dialog {
  width: min(420px, calc(100vw - 32px));
  max-width: 100vw;
  max-height: min(760px, calc(100dvh - 32px));
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 30px;
  color: #f8fafc;
  background: #15251f;
  box-shadow: 0 30px 100px rgba(0,0,0,.5);
}
.incoming-call-dialog::backdrop { background: rgba(3,10,8,.78); backdrop-filter: blur(12px); }
.incoming-call-screen {
  min-height: 520px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 28px 34px;
  text-align: center;
  background: radial-gradient(ellipse at 50% 20%, rgba(48,125,91,.38), transparent 44%), linear-gradient(155deg, #1d332b, #111e1a 74%);
}
.incoming-call-halo {
  width: 132px;
  height: 132px;
  display: grid;
  place-items: center;
  margin-bottom: 30px;
  border: 1px solid rgba(168,237,197,.3);
  border-radius: 50%;
  color: #fff;
  background: rgba(100,194,141,.12);
  box-shadow: 0 0 0 14px rgba(100,194,141,.06), 0 0 0 30px rgba(100,194,141,.035);
  animation: incoming-call-pulse 2s ease-in-out infinite;
}
.incoming-call-halo span { font-size: 46px; transform: rotate(-18deg); }
.incoming-call-kind, #incomingCallKind { margin: 0 0 10px; color: #9dcab0; font-size: 10px; font-weight: 800; letter-spacing: 2px; }
#incomingCallHeading { max-width: 100%; margin: 0; color: #fff; font-size: clamp(25px, 6vw, 32px); font-weight: 700; letter-spacing: -.7px; line-height: 1.15; overflow-wrap: anywhere; }
.incoming-call-subheading { margin: 10px 0 0; color: #aabbb2; font-size: 14px; }
.incoming-call-actions { width: 100%; display: flex; align-items: center; justify-content: space-around; gap: 40px; margin-top: auto; padding-top: 60px; }
.incoming-call-action { min-width: 84px; display: flex; flex-direction: column; align-items: center; gap: 10px; border: 0; color: #dce6e0; background: none; font: inherit; cursor: pointer; }
.incoming-call-action > span { width: 66px; height: 66px; display: grid; place-items: center; border-radius: 50%; color: #fff; font-size: 26px; box-shadow: 0 9px 22px rgba(0,0,0,.22); }
.incoming-call-action small { font-size: 12px; font-weight: 650; }
.incoming-call-action.reject > span { background: #e34e55; transform: rotate(135deg); }
.incoming-call-action.answer > span { background: #22a66b; }
.incoming-call-action:hover > span { filter: brightness(1.08); transform: translateY(-2px); }
.incoming-call-action.reject:hover > span { transform: rotate(135deg) translateY(-2px); }
@keyframes incoming-call-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.045); }
}
@media (max-width: 700px) {
  .incoming-call-dialog {
    position: fixed; inset: 0; width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh;
    margin: 0; border: 0; border-radius: 0;
  }
  .incoming-call-screen {
    min-height: 100%;
    min-height: 100dvh;
    padding: max(72px, calc(env(safe-area-inset-top) + 44px)) 25px max(36px, env(safe-area-inset-bottom));
  }
}
@media (prefers-reduced-motion: reduce) {
  .incoming-call-halo { animation: none; }
}

/* Mobile household home */
.home-only, .mobile-nav-label { display: none; }

@media (max-width: 700px) {
  #dashboard .sidebar {
    gap: 0;
    padding: 8px max(12px, env(safe-area-inset-right)) max(28px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
    border: 0;
    border-top: 1px solid #e2e8f0;
    background: #fff;
    box-shadow: none;
    transform: none;
    pointer-events: auto;
  }
  #dashboard .sidebar .nav-link {
    min-height: 52px;
    gap: 2px;
    padding: 0;
    border: 0;
    border-radius: 16px;
    background: transparent;
    color: #475569;
    font: 500 12px Inter, sans-serif;
  }
  #dashboard .sidebar .nav-link.active { background: #ccfbf1; color: #115e59; font-weight: 600; }
  #dashboard .sidebar .desktop-nav-label,
  #dashboard .sidebar .nav-link:has(.mobile-nav-label) > .nav-icon { display: none; }
  .mobile-nav-label { display: grid; justify-items: center; gap: 2px; }
  .mobile-nav-label svg, .home-header-actions svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
  #dashboard .sidebar .mobile-profile-icon {
    width: 22px;
    height: 22px;
    border: 0;
    background: transparent;
    color: inherit;
  }
  #dashboard .sidebar .mobile-profile-icon svg { width: 22px; height: 22px; }
  #dashboard .sidebar .nav-link[data-scroll-target="addExpensePage"] {
    width: 56px;
    min-height: 56px;
    margin-inline: auto;
    border-radius: 50%;
    background: #0f766e;
    color: white;
    transform: none;
  }
  #dashboard .sidebar .nav-link[data-scroll-target="addExpensePage"] .nav-icon {
    width: auto;
    height: auto;
    border: 0;
    background: none;
    color: inherit;
    box-shadow: none;
    font-size: 29px;
  }

  #dashboard .app-content { margin-bottom: calc(65px + max(28px, env(safe-area-inset-bottom))); }
  #dashboard:has(#householdDashboard:not(.hidden)) .app-content {
    min-height: calc(100dvh - 65px - max(28px, env(safe-area-inset-bottom)));
    background: #f5f7f8;
    color: #0f172a;
    font-family: Inter, sans-serif;
  }
  #dashboard:has(#householdDashboard:not(.hidden)) .dashboard-main {
    padding: max(56px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) 24px max(20px, env(safe-area-inset-left));
  }
  #dashboard:has(#householdDashboard:not(.hidden)) :is(.topbar, .mobile-quick-add, .smart-assistant-toggle),
  #dashboard:has(#householdDashboard:not(.hidden)) #welcomeRow :is(.eyebrow, .role-note, .admin-badge) { display: none; }
  #dashboard:has(#householdDashboard:not(.hidden)) #welcomeRow {
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
  }
  #dashboard:has(#householdDashboard:not(.hidden)) .home-header-actions { display: flex; gap: 8px; }
  #dashboard:has(#householdDashboard:not(.hidden)) .home-member-role {
    display: block;
    margin: 0 0 2px;
    color: #475569;
    font-size: 13px;
  }
  .welcome-copy { flex: 1; min-width: 0; }
  #dashboard:has(#householdDashboard:not(.hidden)) #welcomeTitle {
    color: #0f172a;
    font: 700 22px/1.2 Inter, sans-serif;
    letter-spacing: normal;
    overflow-wrap: anywhere;
  }
  .home-header-actions button {
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    padding: 0;
    border: 1px solid #e2e8f0;
    border-radius: 50%;
    background: white;
    color: #334155;
  }
  .home-header-actions svg { width: 20px; height: 20px; }
  #homeAssistantBtn { color: #0f766e; }
  body.floating-actions-hidden #dashboard:has(#householdDashboard:not(.hidden)) .smart-assistant-widget.is-open { opacity: 1; pointer-events: auto; transform: none; }
  #dashboard:has(#householdDashboard:not(.hidden)) #dashboardMessage:empty { display: none; }
  #dashboard:has(#householdDashboard:not(.hidden)) #dashboardMessage { color: #334155; }
  #householdDashboard .dashboard-layout, #householdDashboard .dashboard-main-column { gap: 16px; }

  #householdDashboard .spend-panel {
    position: relative;
    min-height: 0;
    padding: 20px;
    border: 0;
    border-radius: 20px;
    background: #0f766e;
    box-shadow: none;
    color: white;
  }
  #householdDashboard .spend-panel.over-budget { background: #9f2636; }
  #householdDashboard #dashboardBudgetOverrun { color: white; }
  #householdDashboard .spend-panel .panel-kicker, #householdDashboard .spend-caption { display: none; }
  .home-spend-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
  #householdDashboard #spendHeading, #homeSpendingDetails { color: white; font: 500 14px Inter, sans-serif; }
  #homeSpendingDetails {
    display: block;
    padding: 0;
    border: 0;
    background: none;
  }
  #homeSpendingDetails::after { position: absolute; inset: 0; border-radius: 20px; content: ""; }
  #homeSpendingDetails:focus-visible::after { outline: 2px solid #fff; outline-offset: -5px; }
  #householdDashboard .spend-total {
    margin: 4px 0 12px;
    color: white;
    font: 700 36px/1.1 Inter, sans-serif;
    letter-spacing: normal;
    overflow-wrap: anywhere;
  }
  .home-months { display: flex; flex-wrap: wrap; gap: 8px 24px; font-size: 14px; color: #f0fdfa; }
  .home-months strong { display: block; margin-top: 2px; color: white; font-weight: 600; }

  #householdDashboard .balance-panel {
    padding: 16px;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    background: white;
    box-shadow: none;
    color: #0f172a;
  }
  #householdDashboard .balance-panel :is(.panel-kicker, .balance-note) { display: none; }
  #householdDashboard .balance-panel .section-heading { margin-bottom: 12px; }
  #householdDashboard #balanceHeading, #homeRecentHeading {
    margin: 0;
    color: #0f172a;
    font: 600 16px Inter, sans-serif;
  }
  #householdDashboard .balance-panel .quiet-pill {
    padding: 4px 10px;
    border: 0;
    border-radius: 10px;
    background: #f1f5f9;
    color: #334155;
    font: 600 12px Inter, sans-serif;
    white-space: nowrap;
  }
  #householdDashboard .balance-row {
    min-height: 44px;
    padding: 0;
    border: 0;
    background: none;
  }
  #householdDashboard .balance-description strong { color: #0f172a; font-size: 16px; overflow-wrap: anywhere; }
  #householdDashboard .balance-description span:not(.avatar), #householdDashboard .balance-empty { color: #475569; font-size: 14px; }
  #householdDashboard .balance-description .avatar {
    display: grid;
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    margin: 0;
    border: 0;
    background: #e0f2fe;
    color: #075985;
    font-size: 16px;
  }
  #householdDashboard .balance-amount { color: #0f172a; font-size: 18px; }
  #householdDashboard .owed-to-you .balance-amount { color: #047857; }
  #householdDashboard .owes .balance-amount { color: #b91c1c; }
  .home-settle-button {
    display: block;
    width: 100%;
    min-height: 48px;
    margin-top: 16px;
    border: 1px solid #0f766e;
    border-radius: 12px;
    background: white;
    color: #0f766e;
    font: 600 14px Inter, sans-serif;
  }

  .home-recent { display: block; }
  .home-recent-heading { display: flex; align-items: center; justify-content: space-between; margin: 0 4px 8px; }
  #homeSeeAllBtn {
    min-height: 44px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--home-card-accent, #0f766e);
    font: 600 14px Inter, sans-serif;
  }
  .home-recent-expenses {
    margin: 0;
    padding: 0 0 0 16px;
    border: 1px solid var(--home-card-line, #e2e8f0);
    border-radius: var(--home-card-radius, 20px);
    background: var(--home-card-surface, white);
    list-style: none;
  }
  .home-recent-expenses li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 56px;
    padding: 12px 16px 12px 0;
    overflow-wrap: anywhere;
  }
  .home-recent-expenses li + li { border-top: 1px solid #e2e8f0; }
  .home-recent-expenses span { display: block; margin-top: 2px; color: var(--home-card-muted, #475569); font-size: 14px; }
  .home-recent-expenses li > strong { flex: none; }
}

/* Activity expense history */
.activity-page {
  display: grid;
  width: min(100%, 640px);
  min-width: 0;
  gap: 16px;
  margin-inline: auto;
  color: #0f172a;
  font: 400 16px/1.35 Inter, sans-serif;
}
#dashboard:has(#activityPage:not(.hidden)) .app-content { background: #f5f7f8; }
.activity-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
#activityHeading {
  margin: 0;
  color: #0f172a;
  font: 700 22px/1.2 Inter, sans-serif;
}
#activityExpenseCount { color: #475569; font-size: 14px; }
.activity-search {
  display: flex;
  align-items: center;
  min-height: 48px;
  gap: 10px;
  margin: 0;
  padding: 0 14px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  color: #475569;
}
.activity-search:focus-within { outline: 2px solid #0f766e; outline-offset: 2px; }
.activity-search svg, .activity-receipt svg {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
#activityExpenseSearch {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  margin: 0;
  padding: 0;
  border: 0;
  outline: 0;
  color: #0f172a;
  background: transparent;
  box-shadow: none;
  font: inherit;
  color-scheme: light;
}
#activityExpenseSearch::placeholder { color: #64748b; }
.activity-expenses { display: grid; gap: 16px; }
.activity-expenses h3 {
  margin: 0 4px 8px;
  color: #475569;
  font: 600 14px Inter, sans-serif;
}
.activity-group, .activity-empty {
  margin: 0;
  padding: 0;
  list-style: none;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  background: #fff;
}
.activity-group li + li::before {
  display: block;
  height: 1px;
  margin-left: 68px;
  background: #e2e8f0;
  content: "";
}
.activity-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 12px 16px;
}
.activity-receipt {
  display: grid;
  width: 40px;
  height: 40px;
  flex: none;
  place-items: center;
  border-radius: 50%;
  background: #ccfbf1;
  color: #115e59;
}
.activity-copy { flex: 1; min-width: 0; }
.activity-copy strong {
  display: block;
  overflow: hidden;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.activity-copy span, .activity-amounts span { display: block; color: #475569; font-size: 14px; }
.activity-copy span { overflow-wrap: anywhere; }
.activity-amounts { max-width: 40%; flex: none; overflow-wrap: anywhere; text-align: right; }
.activity-group summary { display: block; border-radius: 18px; cursor: pointer; }
.activity-group summary::-webkit-details-marker { display: none; }
.activity-group .transaction-admin-actions { margin: 0 16px 12px 68px; }
.activity-group .transaction-admin-actions button { min-height: 36px; color: #115e59; }
.activity-group .transaction-admin-actions .transaction-delete-button { color: #b91c1c; }
.activity-empty { padding: 16px; color: #475569; font-size: 14px; }
.activity-message:empty { display: none; }
#activityMessage { margin: 0; color: #334155; }
.activity-reports {
  justify-self: start;
  min-height: 44px;
  padding: 0 4px;
  border: 0;
  background: none;
  color: #0f766e;
  font: 600 14px Inter, sans-serif;
}

@media (max-width: 700px) {
  #dashboard:has(#activityPage:not(.hidden)) .app-content {
    min-height: calc(100dvh - 65px - max(28px, env(safe-area-inset-bottom)));
  }
  #dashboard:has(#activityPage:not(.hidden)) .dashboard-main {
    padding: max(56px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) 24px max(20px, env(safe-area-inset-left));
  }
  #dashboard:has(#activityPage:not(.hidden)) :is(.topbar, .mobile-quick-add, .smart-assistant-toggle) { display: none; }
}

/* Profile and personal expense history */
#dashboard:has(#personalAccountPage:not(.hidden)) .app-content,
#dashboard:has(#personalExpensesPage:not(.hidden)) .app-content,
#dashboard:has(#householdPage:not(.hidden)) .app-content { background: #f5f7f8; }
#personalAccountPage {
  width: min(100%, 640px);
  gap: 16px;
  color: #0f172a;
  font: 400 16px/1.35 Inter, sans-serif;
}
#accountPageHeading {
  margin: 0;
  color: #0f172a;
  font: 700 22px/1.2 Inter, sans-serif;
}
#personalAccountPage .profile-menu-button {
  order: 0;
  color: #0f172a;
  border-color: #cbd5e1;
  background: #fff;
}
#personalAccountPage .profile-page-title-row { justify-content: space-between; }
#personalAccountPage .profile-menu-button:hover,
#personalAccountPage .profile-menu-button[aria-expanded="true"] {
  border-color: #0f766e;
  background: #f0fdfa;
  color: #0f766e;
}
#personalAccountPage .profile-menu-panel {
  border-color: #e2e8f0;
  background: #fff;
  box-shadow: 0 16px 38px rgba(15,23,42,.16);
}
#personalAccountPage .profile-menu-drawer-header { border-bottom-color: #e2e8f0; }
#personalAccountPage .profile-menu-eyebrow { color: #0f766e; }
#personalAccountPage .profile-menu-drawer-header h3 { color: #0f172a; }
#personalAccountPage .profile-menu-close { border-color: #cbd5e1; background: #f8fafc; color: #334155; }
#personalAccountPage .profile-menu-close:hover { border-color: #0f766e; color: #0f766e; }
#personalAccountPage .profile-menu-panel button { color: #334155; }
#personalAccountPage .profile-menu-panel button:hover { background: #f0fdfa; color: #0f766e; }
#personalAccountPage .profile-menu-page-list .profile-menu-logout { border-top-color: #e2e8f0; color: #b91c1c; }
#personalAccountPage .profile-menu-page-list .profile-menu-logout span { color: #dc2626; }
#personalAccountPage :is(.account-page-heading, .personal-stat-card, .account-budget-summary, .account-settlement-grid, .profile-expense-card, .profile-household-button) {
  min-width: 0;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  background: #fff;
}
#personalAccountPage .account-page-heading { flex-wrap: nowrap; gap: 14px; padding: 16px; }
#personalAccountPage .account-page-avatar {
  width: 64px;
  height: 64px;
  flex: 0 0 64px;
  border: 0;
  background: #ccfbf1;
  color: #115e59;
  font: 700 24px Inter, sans-serif;
  box-shadow: none;
}

@media (max-width: 700px) {
  .profile-menu-panel { width: min(316px, 86vw); min-width: 0; padding: 52px 12px 16px; }
}
.profile-identity { flex: 1; min-width: 0; }
#personalAccountPage .account-name { margin: 0; color: #0f172a; font-size: 18px; font-weight: 600; overflow-wrap: anywhere; }
#personalAccountPage :is(.account-email, .account-phone, .account-upi-id) {
  display: block;
  overflow: hidden;
  margin: 2px 0 0;
  color: #475569;
  font-size: 14px;
  text-overflow: ellipsis;
}
#personalAccountPage .account-edit-button {
  min-height: 44px;
  flex: none;
  margin: 0;
  padding: 0 16px;
  border: 1px solid #0f766e;
  border-radius: 12px;
  background: #fff;
  color: #0f766e;
  font: 600 14px Inter, sans-serif;
  box-shadow: none;
}
.profile-net-balance { padding: 20px; border-radius: 20px; background: #0f766e; color: #fff; }
.profile-net-balance span { display: block; color: #f0fdfa; font-size: 14px; }
.profile-net-balance strong { display: block; margin: 4px 0; font: 700 36px/1.1 Inter, sans-serif; overflow-wrap: anywhere; }
#personalAccountPage .personal-account-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
#personalAccountPage .personal-stat-card { align-content: start; gap: 4px; padding: 16px; }
#personalAccountPage .personal-stat-card span { color: #475569; font-size: 14px; }
#personalAccountPage .personal-stat-card strong { color: #0f172a; font-size: 20px; overflow-wrap: anywhere; }

#personalAccountPage .account-budget-summary { flex-direction: column; align-items: stretch; gap: 12px; padding: 16px; }
#personalAccountPage .account-budget-summary.over-budget { border-color: #fecdd3; }
#personalAccountPage .account-budget-copy { gap: 4px; }
#personalAccountPage :is(.account-budget-copy h3, .account-settlement-heading h3, .personal-ledger-heading h3) { margin: 0; color: #0f172a; font: 600 16px Inter, sans-serif; }
#personalAccountPage :is(.account-budget-copy p, .account-budget-payment-status, .settlement-empty) { color: #475569; font-size: 14px; }
.profile-budget-progress {
  appearance: none;
  width: 100%;
  height: 8px;
  margin: 8px 0;
  border: 0;
  border-radius: 4px;
  background: #e2e8f0;
  accent-color: #0f766e;
}
.profile-budget-progress::-webkit-progress-bar { border-radius: 4px; background: #e2e8f0; }
.profile-budget-progress::-webkit-progress-value { border-radius: 4px; background: #0f766e; }
.profile-budget-progress::-moz-progress-bar { border-radius: 4px; background: #0f766e; }
.profile-budget-share { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; color: #475569; font-size: 14px; }
#personalAccountPage .account-budget-share { color: #115e59; font-size: 16px; white-space: nowrap; }
#personalAccountPage .account-budget-overage-share { color: #b91c1c; font-size: 14px; }

#personalAccountPage .account-settlement-grid {
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  scroll-margin-top: 72px;
}
#personalAccountPage .account-settlement-card {
  padding: 16px;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 8px 26px rgba(34, 52, 82, .07);
}
#personalAccountPage .receivable-card { margin-top: 0; padding-top: 16px; border-top: 1px solid #e2e8f0; }
#personalAccountPage .account-settlement-heading { min-height: 44px; margin: 0; }
#personalAccountPage .account-settlement-heading strong { color: #0f172a; font-size: 20px; }
#personalAccountPage .account-settlement-row { padding: 6px 12px; border: 0; border-radius: 12px; background: #f5f7f8; }
#personalAccountPage .account-settlement-person { min-height: 40px; gap: 12px; color: #0f172a; font-size: 16px; }
#personalAccountPage .account-settlement-person .avatar { width: 32px; height: 32px; border: 0; background: #ffe4e6; color: #9f1239; font-size: 14px; }
#personalAccountPage .account-settlement-row > strong { color: #0f172a; font-size: 16px; }
#personalAccountPage .receivable-card :is(.account-settlement-heading, .account-settlement-row) > strong { color: #047857; }
#personalAccountPage .settlement-empty { padding: 0 0 4px; }

#personalAccountPage .personal-ledger-heading { align-items: baseline; margin: 4px 4px 8px; padding: 0; border: 0; }
#personalExpenseCount { color: #475569; font-size: 14px; font-weight: 400; }
#personalAccountPage .personal-expense-list { gap: 0; max-height: none; overflow: visible; }
#personalExpenseList:not(.is-expanded) .personal-expense-row:not(:first-child) { display: none; }
#personalAccountPage .personal-expense-row { min-height: 48px; padding: 12px 16px; border: 0; border-radius: 0; background: transparent; }
#personalAccountPage .personal-expense-row + .personal-expense-row { border-top: 1px solid #e2e8f0; }
#personalAccountPage .personal-expense-row > div:first-child strong { color: #0f172a; font-size: 16px; font-weight: 600; }
#personalAccountPage .personal-expense-row > div span, #personalAccountPage .personal-expense-empty { color: #475569; font-size: 14px; overflow-wrap: anywhere; }
#personalAccountPage .personal-expense-empty { padding: 16px; }
#personalAccountPage .personal-expense-amounts { max-width: 45%; text-align: right; }
#personalAccountPage .personal-expense-amounts strong { color: #0f172a; font-size: 16px; white-space: normal; overflow-wrap: anywhere; }
#profileExpensesToggle {
  width: 100%;
  min-height: 48px;
  border: 0;
  border-top: 1px solid #e2e8f0;
  border-radius: 0 0 20px 20px;
  background: none;
  color: #0f766e;
  font: 600 14px Inter, sans-serif;
}

/* Full-screen expense history opened from the profile preview. */
.personal-expenses-page {
  display: flex;
  flex-direction: column;
  width: min(100%, 640px);
  min-height: calc(100dvh - 32px);
  margin: 0 auto;
  overflow: hidden;
  color: #0f172a;
  background: #f5f7f8;
  font: 400 16px/1.35 Inter, sans-serif;
}
.personal-expenses-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 20px 12px 12px;
}
.personal-expenses-toolbar h2 { flex: 1; margin: 0; color: #0f172a; font: 700 22px/1.2 Inter, sans-serif; }
.personal-expenses-toolbar > span { color: #475569; font-size: 14px; }
.personal-expenses-back { display: grid; width: 44px; height: 44px; flex: none; place-items: center; padding: 0; border: 0; border-radius: 50%; background: transparent; color: #0f172a; }
.personal-expenses-back:hover { background: rgba(15, 23, 42, .06); }
.personal-expenses-content { display: flex; flex: 1; flex-direction: column; gap: 16px; min-height: 0; padding: 4px 20px 32px; overflow: auto; }
.personal-expenses-search { display: flex; align-items: center; gap: 10px; min-height: 48px; flex: none; padding: 0 14px; border: 1px solid #e2e8f0; border-radius: 12px; background: #fff; color: #475569; }
.personal-expenses-search input { width: 100%; min-width: 0; padding: 0; border: 0; outline: 0; background: transparent; color: #0f172a; font: 400 16px Inter, sans-serif; }
.personal-expenses-search input::placeholder { color: #64748b; }
.personal-expense-filters { display: flex; gap: 8px; flex: none; overflow-x: auto; }
.personal-expense-filter { min-height: 40px; padding: 0 16px; border: 1px solid #e2e8f0; border-radius: 20px; background: #fff; color: #334155; font: 600 14px Inter, sans-serif; white-space: nowrap; }
.personal-expense-filter.is-active { border-color: #0f766e; background: #0f766e; color: #fff; }
.all-personal-expense-list { display: grid; gap: 16px; min-height: 0; }
.all-personal-expense-group { display: grid; gap: 8px; }
.all-personal-expense-date { margin: 0 4px; color: #475569; font-size: 14px; font-weight: 600; }
.all-personal-expense-card { overflow: hidden; border: 1px solid #e2e8f0; border-radius: 20px; background: #fff; }
.all-personal-expense-row { display: flex; align-items: center; gap: 12px; min-height: 72px; padding: 12px 16px; }
.all-personal-expense-row + .all-personal-expense-row { border-top: 1px solid #e2e8f0; }
.all-personal-expense-detail { display: grid; flex: 1; min-width: 0; gap: 4px; }
.all-personal-expense-title { display: flex; align-items: center; min-width: 0; gap: 6px; color: #0f172a; font-size: 16px; font-weight: 600; }
.all-personal-expense-title > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.all-personal-expense-badge { flex: none; padding: 2px 8px; border-radius: 10px; background: #f1f5f9; color: #334155; font-size: 12px; font-weight: 600; }
.all-personal-expense-badge.is-shared { background: #e0f2fe; color: #075985; }
.all-personal-expense-caption { overflow: hidden; color: #475569; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.all-personal-expense-amount { flex: none; text-align: right; }
.all-personal-expense-amount strong { display: block; color: #0f172a; font-size: 16px; font-weight: 700; white-space: nowrap; }
.all-personal-expense-amount span { display: block; color: #475569; font-size: 14px; white-space: nowrap; }
.all-personal-expense-empty { margin: 0; padding: 24px 4px; color: #475569; font-size: 14px; }

.profile-household-button {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 16px;
  color: #0f172a;
  font: inherit;
  text-align: left;
}
.profile-household-icon {
  display: grid;
  width: 40px;
  height: 40px;
  flex: none;
  place-items: center;
  border-radius: 50%;
  background: #ccfbf1;
  color: #115e59;
}
.profile-household-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.profile-household-copy { display: grid; flex: 1; }
.profile-household-copy strong { font-weight: 600; }
.profile-household-copy span { color: #475569; font-size: 14px; }
.profile-mobile-actions { display: none; }

@media (max-width: 700px) {
  #dashboard:has(#personalAccountPage:not(.hidden)) .app-content,
  #dashboard:has(#personalExpensesPage:not(.hidden)) .app-content,
  #dashboard:has(#householdPage:not(.hidden)) .app-content {
    min-height: calc(100dvh - 65px - max(28px, env(safe-area-inset-bottom)));
  }
  #dashboard:has(#personalAccountPage:not(.hidden)) .dashboard-main,
  #dashboard:has(#personalExpensesPage:not(.hidden)) .dashboard-main,
  #dashboard:has(#householdPage:not(.hidden)) .dashboard-main {
    padding: max(56px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) 32px max(20px, env(safe-area-inset-left));
  }
  #dashboard:has(#personalAccountPage:not(.hidden)) :is(.topbar, .mobile-quick-add, .smart-assistant-toggle),
  #dashboard:has(#personalExpensesPage:not(.hidden)) :is(.topbar, .mobile-quick-add, .smart-assistant-toggle),
  #dashboard:has(#householdPage:not(.hidden)) :is(.topbar, .mobile-quick-add, .smart-assistant-toggle) { display: none; }
  #personalAccountPage .account-settlement-grid { scroll-margin-top: 16px; }
  .profile-mobile-actions { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; }
  .profile-mobile-actions button { min-height: 44px; padding: 0 4px; border: 0; background: transparent; color: #0f766e; font: 600 14px Inter, sans-serif; }
}

/* Household page (Roommates, invite code, payments) opened from Profile. */
#householdPage {
  display: flex;
  flex-direction: column;
  width: min(100%, 640px);
  min-height: calc(100dvh - 32px);
  margin: 0 auto;
  color: #0f172a;
  background: #f5f7f8;
  font: 400 16px/1.35 Inter, sans-serif;
}
#householdPage.hidden { display: none; }
#householdPage .household-page-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 12px 14px;
}
#householdPage .household-page-back {
  display: grid;
  width: 44px;
  height: 44px;
  flex: none;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #0f172a;
  cursor: pointer;
}
#householdPage .household-page-back:hover { background: rgba(15, 23, 42, .06); }
#householdPage .household-page-heading-copy { flex: 1; min-width: 0; }
#householdPageHeading {
  margin: 0;
  color: #0f172a;
  font: 700 22px/1.2 Inter, sans-serif;
}
#householdPage .household-page-subtitle {
  margin: 2px 0 0;
  color: #475569;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#householdPage .household-ring-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  min-height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: #ccfbf1;
  color: #115e59;
  font: 600 14px Inter, sans-serif;
  cursor: pointer;
}
#householdPage .household-ring-button:hover { background: #99f6e4; }
#householdPage .household-ring-button.hidden { display: none; }
#householdPage .household-page-content {
  display: grid;
  gap: 16px;
  padding: 2px 20px 32px;
}
#householdPage .household-card {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 20px;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  background: #fff;
  box-shadow: none;
  color: #0f172a;
}
#householdPage .household-card.hidden { display: none; }
#householdPage .household-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
#householdPage .panel-kicker {
  margin: 0 0 2px;
  color: #0f766e;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
}
#householdPage h3 {
  margin: 0;
  color: #0f172a;
  font: 600 18px/1.25 Inter, sans-serif;
}
#householdPage .household-count-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #334155;
  font-size: 13px;
  font-weight: 700;
}
#householdPage .household-card-note {
  margin: 0;
  color: #475569;
  font-size: 14px;
  line-height: 1.45;
}
#householdPage .member-list { display: grid; gap: 0; }
#householdPage .member-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 54px;
  padding: 10px 0;
  border-bottom: 1px solid #e2e8f0;
  color: #0f172a;
  font-size: 15px;
}
#householdPage .member-row:last-child { border-bottom: 0; padding-bottom: 0; }
#householdPage .member-row:first-child { padding-top: 2px; }
#householdPage .member-identity {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #0f172a;
  font: inherit;
  cursor: pointer;
}
#householdPage .member-identity .avatar { width: 38px; height: 38px; flex: 0 0 38px; font-size: 14px; }
#householdPage .member-name {
  max-width: none;
  color: #0f172a;
  font-size: 15px;
  font-weight: 600;
}
#householdPage .member-identity:hover .member-name { color: #0f766e; }
#householdPage .member-admin-badge {
  padding: 4px 10px;
  border: 0;
  border-radius: 999px;
  background: #ccfbf1;
  color: #115e59;
  font-size: 12px;
  font-weight: 600;
}
#householdPage .remove-member-button {
  margin-left: auto;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid #fecaca;
  border-radius: 10px;
  background: #fff;
  color: #b91c1c;
  font: 600 13px Inter, sans-serif;
}
#householdPage .remove-member-button:hover { background: #fef2f2; }
#householdPage .household-card-actions { display: flex; gap: 10px; }
#householdPage .household-secondary-btn {
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: #fff;
  color: #0f766e;
  font: 600 14px Inter, sans-serif;
  cursor: pointer;
}
#householdPage .household-secondary-btn:hover { background: #f0fdfa; border-color: #99f6e4; }
#householdPage .household-primary-btn {
  justify-self: start;
  min-height: 48px;
  padding: 0 20px;
  border: 0;
  border-radius: 12px;
  background: #0f766e;
  color: #fff;
  font: 600 15px Inter, sans-serif;
  cursor: pointer;
}
#householdPage .invite-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding: 14px 16px;
  border: 1.5px dashed #5eead4;
  border-radius: 16px;
  background: #f0fdfa;
}
#householdPage .invite-box-label {
  display: block;
  color: #475569;
  font-size: 12px;
  font-weight: 600;
}
#householdPage .invite-box strong {
  display: block;
  margin-top: 2px;
  color: #115e59;
  font: 700 22px/1.2 'Manrope', Inter, sans-serif;
  letter-spacing: 3px;
}
#householdPage .household-copy-btn {
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: 12px;
  background: #0f766e;
  color: #fff;
  font: 600 14px Inter, sans-serif;
  cursor: pointer;
  white-space: nowrap;
}
#householdPage .household-copy-btn:hover { background: #115e59; }
#householdPage #adminDashboardQrPanel:not(.hidden) {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: stretch;
  gap: 16px;
  margin-top: 0;
  padding: 20px;
  text-align: left;
  box-shadow: none;
}
#householdPage #adminDashboardQrPanel .admin-dashboard-qr-copy {
  display: grid;
  justify-items: stretch;
  gap: 8px;
}
#householdPage #adminDashboardQrPanel h2 {
  font: 600 18px/1.25 Inter, sans-serif;
  color: #0f172a;
}
#householdPage #adminDashboardQrPanel .household-member-shares {
  width: 100%;
}
#householdPage .household-payment-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}
#householdPage .household-payment-actions button {
  min-height: 44px;
  padding: 0 18px;
  border-radius: 12px;
  font: 600 14px Inter, sans-serif;
}
#householdPage #adminDashboardQrPanel .admin-dashboard-qr-code {
  justify-self: center;
  width: min(100%, 260px);
  padding: 12px;
}
@media (max-width: 700px) {
  #householdPage .household-page-content { padding-inline: 0; }
  #householdPage .household-page-toolbar { padding-inline: 0; padding-top: 0; }
  #householdPage .invite-box { flex-wrap: wrap; }
  #householdPage .household-copy-btn { width: 100%; }
}

/* Add-expense flow: compact, touch-friendly form for the profile-era mobile UI. */
#dashboard:has(#addExpensePage:not(.hidden)) .app-content { background: #f5f7f8; }
#addExpensePage {
  display: grid;
  width: min(100%, 720px);
  gap: 16px;
  margin: 0 auto;
  color: #0f172a;
  font: 400 16px/1.35 Inter, sans-serif;
}
#addExpensePage .page-intro { display: grid; gap: 6px; margin: 0 4px; }
#addExpensePage .page-intro > * { margin: 0; }
#addExpensePage .page-intro .panel-kicker { color: #0f766e; font-size: 12px; font-weight: 700; letter-spacing: .08em; }
#addExpensePage .page-intro h2 { color: #0f172a; font: 700 26px/1.2 Inter, sans-serif; }
#addExpensePage .page-intro p:last-child { color: #475569; font-size: 14px; }
#addExpensePage .action-panel { display: grid; gap: 18px; padding: 20px; border: 1px solid #e2e8f0; border-radius: 20px; background: #fff; box-shadow: 0 8px 26px rgba(34, 52, 82, .07); }
#addExpensePage .section-heading { margin: 0; padding: 0 0 14px; border-bottom: 1px solid #e2e8f0; }
#addExpensePage .section-heading h2 { color: #0f172a; font: 600 18px Inter, sans-serif; }
#addExpensePage .section-heading .quiet-pill { color: #475569; background: #f1f5f9; }

/* Spending report: mobile-first light dashboard matching the spending references. */
#dashboard:has(#flowChartPage:not(.hidden)) .app-content { background: #f5f7f8; }
#flowChartPage {
  width: min(100%, 760px);
  gap: 16px;
  color: #0f172a;
  font: 400 16px/1.35 Inter, sans-serif;
}
#flowChartPage .page-intro { display: grid; gap: 7px; margin: 0 4px; }
#flowChartPage .page-intro > * { margin: 0; }
#flowChartPage .page-intro .button-quiet { justify-self: start; min-height: 36px; padding: 0; color: #0f766e; font: 600 14px Inter, sans-serif; }
#flowChartPage .page-intro h2 { color: #0f172a; font: 700 28px/1.2 Inter, sans-serif; }
.flowchart-view-switch { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: 12px; background: #e2e8f0; }
.flowchart-view-switch button { min-height: 42px; border: 0; border-radius: 9px; background: transparent; color: #64748b; cursor: pointer; font: 600 14px Inter, sans-serif; }
.flowchart-view-switch button.is-active { background: #0f766e; color: #fff; box-shadow: 0 3px 8px rgba(15,118,110,.18); }
.flowchart-slider-controls { grid-template-columns: 38px minmax(130px, 1fr) 38px; gap: 14px; }
.flowchart-slider-controls > span { color: #0f172a; font: 600 16px Inter, sans-serif; }
.flowchart-slide-button { width: 38px; height: 38px; border: 1px solid #cbd5e1; border-radius: 50%; background: #fff; color: #0f766e; font-size: 25px; box-shadow: none; }
.flowchart-slide-button:hover { background: #ecfeff; }
.flowchart-section { gap: 16px; padding: 0; }
.flowchart-section-heading { padding: 0 4px; }
.flowchart-section-heading .panel-kicker { color: #0f766e; font-size: 11px; letter-spacing: .08em; }
.flowchart-section-heading h2 { color: #0f172a; font: 700 21px/1.25 Inter, sans-serif; }
.flowchart-section-heading > p:last-child { color: #475569; font-size: 14px; }
#flowChartPage .panel,
#flowChartPage .flow-metric-card,
#flowChartPage .personal-flow-summary,
#flowChartPage .personal-flow-expense-row {
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(34,52,82,.045);
}
#flowChartPage .flow-metric-card { min-height: 118px; gap: 8px; padding: 16px; }
#flowChartPage .flow-metric-card > span { color: #475569; font-size: 13px; }
#flowChartPage .flow-metric-card > strong { color: #0f172a; font: 700 24px/1.15 Inter, sans-serif; }
#flowChartPage .flow-metric-card > small { color: #64748b; font-size: 12px; line-height: 1.35; }
#flowChartPage .section-heading { margin-bottom: 14px; }
#flowChartPage .section-heading h2 { color: #0f172a; font: 700 18px/1.25 Inter, sans-serif; }
#flowChartPage .panel-kicker { color: #0f766e; }
#flowChartPage .roommate-chart-caption,
#flowChartPage .daily-chart-key,
#flowChartPage .daily-chart-note,
#flowChartPage .pace-message { color: #64748b; }
#flowChartPage .pace-comparison-grid > div { background: #f8fafc; }
#flowChartPage .pace-comparison-grid span { color: #64748b; }
#flowChartPage .pace-comparison-grid strong { color: #0f172a; }
#flowChartPage .month-comparison-panel { order: 3; }
#flowChartPage .daily-spending-panel { order: 6; }
#flowChartPage .pace-panel { order: 2; }
#flowChartPage .flow-roommate-panel { order: 4; }
#flowChartPage .flow-category-panel { order: 5; }
#flowChartPage .month-comparison-chart { min-height: 190px; }
#flowChartPage .month-comparison-amount,
#flowChartPage .month-comparison-label { color: #475569; }
#flowChartPage .month-comparison-track { background: #f1f5f9; }
#flowChartPage .month-comparison-fill { background: #0f766e; }
#flowChartPage .month-comparison-column.previous .month-comparison-fill { background: #cbd5e1; }
#flowChartPage .roommate-spending-name,
#flowChartPage .roommate-spending-amount,
#flowChartPage .legend-value { color: #0f172a; }
#flowChartPage .roommate-spending-track { background: #e2e8f0; border-color: transparent; }
#flowChartPage .personal-flow-summary { order: 1; padding: 22px; background: #0f766e; border-color: #0f766e; }
#flowChartPage .personal-flow-summary > span,
#flowChartPage .personal-flow-summary > small { color: #ccfbf1; font-size: 13px; }
#flowChartPage .personal-flow-summary > strong { color: #fff; font: 700 34px/1.1 Inter, sans-serif; }
#flowChartPage .personal-flow-metrics { order: 2; }
.personal-flow-section .daily-spending-panel { order: 3; }
.personal-flow-section .flow-category-panel { order: 4; }
.personal-flow-section .personal-flow-expense-list { order: 5; }
#flowChartPage .personal-flow-expense-row { padding: 15px 16px; }
#flowChartPage .personal-flow-expense-detail strong { color: #0f172a; font-size: 14px; }
#flowChartPage .personal-flow-expense-detail span { color: #64748b; font-size: 12px; }
#flowChartPage .personal-flow-expense-row > strong { color: #0f766e; font-size: 14px; }

@media (max-width: 700px) {
  #dashboard:has(#flowChartPage:not(.hidden)) .app-content { min-height: calc(100dvh - 65px - max(28px, env(safe-area-inset-bottom))); }
  #dashboard:has(#flowChartPage:not(.hidden)) .dashboard-main { padding: max(52px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) 32px max(20px, env(safe-area-inset-left)); }
  #dashboard:has(#flowChartPage:not(.hidden)) :is(.topbar, .mobile-quick-add, .smart-assistant-toggle) { display: none; }
  #flowChartPage .flowchart-metrics { gap: 10px; }
  #flowChartPage .flow-metric-card { min-height: 112px; padding: 14px; }
  #flowChartPage .flow-metric-card > strong { font-size: 21px; }
  #flowChartPage .panel { padding: 18px; }
  #flowChartPage .category-content { grid-template-columns: 105px minmax(0,1fr); gap: 14px; }
  #flowChartPage .flow-category-panel .category-donut { width: 105px; }
}
#addExpensePage .expense-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; gap: 14px; }
#addExpensePage .expense-name-field,
#addExpensePage .expense-type-picker,
#addExpensePage .split-picker,
#addExpensePage .expense-submit-field { grid-column: 1 / -1; }
#addExpensePage .form-field { display: grid; gap: 6px; min-width: 0; }
#addExpensePage .form-field label,
#addExpensePage .expense-type-picker legend,
#addExpensePage .split-picker legend { color: #334155; font-size: 13px; font-weight: 700; }
#addExpensePage .form-field input,
#addExpensePage .split-picker select { width: 100%; min-height: 48px; padding: 11px 12px; border: 1px solid #cbd5e1; border-radius: 12px; outline: 0; background: #f8fafc; color: #0f172a; font: 400 16px Inter, sans-serif; }
#addExpensePage .form-field input:focus,
#addExpensePage .split-picker select:focus { border-color: #0f766e; box-shadow: 0 0 0 3px rgba(15, 118, 110, .12); }
#addExpensePage .expense-type-picker,
#addExpensePage .split-picker { min-width: 0; margin: 2px 0 0; padding: 16px; border: 1px solid #e2e8f0; border-radius: 16px; background: #f8fafc; }
#addExpensePage .expense-type-picker { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
#addExpensePage .expense-type-picker legend,
#addExpensePage .split-picker legend { padding: 0 6px; }
#addExpensePage .expense-type-option { min-height: 112px; padding: 12px; border: 1px solid #e2e8f0; border-radius: 14px; background: #fff; }
#addExpensePage .expense-type-option:has(input:checked) { border-color: #0f766e; background: #f0fdfa; box-shadow: 0 0 0 2px rgba(15, 118, 110, .12); }
#addExpensePage .expense-type-option input { margin-top: 3px; accent-color: #0f766e; }
#addExpensePage .expense-type-option strong { color: #0f172a; font-size: 14px; }
#addExpensePage .expense-type-option small { color: #475569; font-size: 12px; line-height: 1.4; }
#addExpensePage .split-picker-actions { margin-bottom: 10px; }
#addExpensePage .split-preview { color: #0f766e; font-size: 13px; font-weight: 600; }
#addExpensePage .split-member-option { border-color: #e2e8f0; background: #fff; color: #0f172a; }
#addExpensePage .split-picker-note { color: #64748b; font-size: 12px; }
#addExpensePage .expense-submit-field { display: block; }
#addExpensePage .expense-submit-field label { display: none; }
#addExpensePage .expense-submit-field button { width: 100%; min-height: 52px; border-radius: 14px; background: #0f766e; font-size: 16px; font-weight: 700; }
#addExpensePage #expenseMessage { margin: 0; color: #475569; font-size: 14px; }

/* Exact Household Spending reference treatment. */
#flowChartPage .spending-back-button { display: grid; width: 44px; height: 44px; place-items: center; margin-left: -8px; border: 0; color: #0f172a; }
#flowChartPage .spending-back-button svg { display: block; }
#flowChartPage .flowchart-section-heading { display: none; }
#flowChartPage .flowchart-section { gap: 16px; }
#flowChartPage .flowchart-metrics { gap: 12px; }
#flowChartPage .flow-metric-card { min-height: 0; padding: 16px; border-radius: 20px; box-shadow: none; }
#flowChartPage .flow-metric-card > span { font-size: 14px; }
#flowChartPage .flow-metric-card > strong { margin: 4px 0; font-size: 20px; }
#flowChartPage .flow-metric-card > small { font-size: 14px; color: #475569; }
#flowChartPage .section-heading { display: block; margin: 0; }
#flowChartPage .section-heading .panel-kicker,
#flowChartPage .section-heading .roommate-chart-caption,
#flowChartPage .section-heading .daily-chart-key,
#flowChartPage .pace-panel .quiet-pill { display: none; }
#flowChartPage .section-heading h2 { font-size: 16px; font-weight: 600; }
#flowChartPage .panel { padding: 16px; border-radius: 20px; box-shadow: none; }
#flowChartPage .pace-comparison-grid { display: flex; gap: 12px; margin-top: 12px; }
#flowChartPage .pace-comparison-grid > div { flex: 1; padding: 0; background: transparent; }
#flowChartPage .pace-comparison-grid > div:nth-child(n+3) { display: none; }
#flowChartPage .pace-comparison-grid span { font-size: 14px; }
#flowChartPage .pace-comparison-grid strong { font-size: 18px; }
#flowChartPage .pace-progress { margin: 12px 0 8px; }
#flowChartPage .pace-message { margin: 0; font-size: 14px; }
#flowChartPage .month-comparison-chart { display: grid; min-height: 0; gap: 12px; padding: 12px 0 0; }
#flowChartPage .month-comparison-column { display: grid; grid-template-columns: minmax(0,1fr) auto; grid-template-rows: auto 8px; align-items: center; gap: 4px 12px; min-width: 0; }
#flowChartPage .month-comparison-label { grid-column: 1; grid-row: 1; justify-self: start; font-size: 14px; color: #0f172a; }
#flowChartPage .month-comparison-amount { grid-column: 2; grid-row: 1; font-size: 14px; color: #0f172a; }
#flowChartPage .month-comparison-track { grid-column: 1 / -1; grid-row: 2; width: 100%; height: 8px; border-radius: 4px; }
#flowChartPage .month-comparison-fill { width: 0; height: 8px; border-radius: 4px; background: #0f766e; }
#flowChartPage .month-comparison-column.previous .month-comparison-fill { background: #94a3b8; }
#flowChartPage .roommate-chart-caption { font-size: 14px; }
#flowChartPage .roommate-spending-chart { margin-top: 8px; gap: 0; }
#flowChartPage .roommate-spending-row { grid-template-columns: 32px minmax(0,1fr) 96px; gap: 10px; min-height: 52px; }
#flowChartPage .roommate-spending-identity { display: flex; align-items: flex-start; min-width: 0; }
#flowChartPage .roommate-spending-identity .avatar { width: 32px; height: 32px; }
#flowChartPage .roommate-spending-middle { display: grid; min-width: 0; align-content: start; gap: 6px; }
#flowChartPage .roommate-spending-name { overflow: hidden; min-width: 0; font-size: 16px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
#flowChartPage .roommate-spending-track { width: 100%; height: 8px; }
#flowChartPage .roommate-spending-amount { display: grid; min-width: 0; gap: 2px; color: #0f172a !important; font-size: 16px; font-weight: 600; text-align: right; white-space: nowrap; }
#flowChartPage .roommate-spending-amount strong { color: #0f172a !important; font-size: 16px; font-weight: 600; }
#flowChartPage .roommate-spending-amount small { color: #475569 !important; font-size: 14px; }
#flowChartPage .flow-category-panel .category-content { display: block; }
#flowChartPage .flow-category-panel .category-donut { display: none; }
#flowChartPage .category-legend { gap: 0; margin-top: 8px; }
#flowChartPage .flow-category-panel .legend-row { grid-template-columns: 10px minmax(0,1fr) auto; min-height: 48px; gap: 10px; font-size: 16px; }
#flowChartPage .flow-category-panel .legend-dot { width: 10px; height: 10px; }
#flowChartPage .flow-category-panel .legend-value { font-size: 16px; }
#flowChartPage .flow-category-panel .legend-value small { font-size: 14px; }
#flowChartPage .daily-chart-scroll { margin-top: 12px; overflow: hidden; }
#flowChartPage .daily-chart-inner { min-width: 0; }
#flowChartPage .daily-chart-plot { height: 130px; padding: 0; border: 0; background: none; }
#flowChartPage .daily-spending-chart, #flowChartPage .daily-spending-labels { gap: 4px; }
#flowChartPage .day-bar-track { width: 100%; border-radius: 3px; background: #f1f5f9; }
#flowChartPage .day-bar-fill { border-radius: 3px; background: #0f766e; box-shadow: none; }
#flowChartPage .day-bar-column.over-target .day-bar-fill { background: #e4572e; box-shadow: none; }
#flowChartPage .day-bar-value { display: none; }
#flowChartPage .daily-spending-labels { padding-top: 8px; color: #475569; font-size: 10px; }
#flowChartPage .daily-budget-line { border-color: #f59e0b; }
#flowChartPage .daily-chart-note { margin: 0; font-size: 14px; }
#flowChartPage .pace-message { color: #334155 !important; font-weight: 500; }
#flowChartPage .pace-comparison-grid span { color: #475569 !important; }
#flowChartPage .roommate-chart-caption { color: #475569 !important; }
#flowChartPage .flow-category-panel .legend-name { color: #334155 !important; }
#flowChartPage .flow-category-panel .legend-value { color: #0f172a !important; }
#flowChartPage .flow-category-panel .legend-value strong { color: #0f172a !important; }
#flowChartPage .flow-category-panel .legend-value small { color: #475569 !important; }
#flowChartPage .flow-category-panel .category-empty { color: #475569 !important; }
#flowChartPage .personal-flow-summary { padding: 20px; border-radius: 20px; box-shadow: none; }
#flowChartPage .personal-flow-summary > span { font-size: 14px; opacity: .9; }
#flowChartPage .personal-flow-summary > strong { margin: 4px 0; font-size: 36px; }
#flowChartPage .personal-flow-summary > small { font-size: 14px; opacity: .9; }
#flowChartPage .personal-flow-summary > small#personalFlowPreviousTotal,
#flowChartPage .personal-flow-summary > small.personal-flow-private-note { display: none !important; }
#flowChartPage .personal-flow-metrics .flow-metric-card > small { font-size: 14px; }
#flowChartPage .personal-flow-section .daily-chart-note { display: none; }
#flowChartPage .personal-flow-section .flow-category-panel .section-heading h2 { font-size: 16px; }
#flowChartPage .personal-flow-expense-block { order: 5; }
#flowChartPage .personal-flow-expense-block > h2 { margin: 0 4px 8px; color: #0f172a; font-size: 16px; font-weight: 600; }
#flowChartPage .personal-flow-expense-list { display: grid; gap: 0; max-height: none; overflow: hidden; padding: 0; border: 1px solid #e2e8f0; border-radius: 20px; background: #fff; }
#flowChartPage .personal-flow-expense-row { min-height: 48px; padding: 10px 16px; border: 0; border-radius: 0; background: #fff; box-shadow: none; }
#flowChartPage .personal-flow-expense-row + .personal-flow-expense-row { border-top: 1px solid #e2e8f0; }
#flowChartPage .personal-flow-expense-detail { gap: 2px; }
#flowChartPage .personal-flow-expense-detail strong { color: #0f172a; font-size: 16px; }
#flowChartPage .personal-flow-expense-detail span { color: #475569; font-size: 14px; }
#flowChartPage .personal-flow-expense-row > strong { color: #0f172a; font-size: 16px; }
#flowChartPage .personal-flow-empty { margin: 0; padding: 24px 16px; color: #475569 !important; font-size: 14px; }

@media (max-width: 700px) {
  #addExpensePage { width: 100%; gap: 14px; }
  #addExpensePage .page-intro { margin: 0; }
  #addExpensePage .page-intro h2 { font-size: 24px; }
  #addExpensePage .action-panel { padding: 16px; border-radius: 18px; }
  #addExpensePage .section-heading { align-items: flex-start; gap: 10px; }
  #addExpensePage .section-heading .quiet-pill { max-width: 150px; white-space: normal; text-align: right; }
  #addExpensePage .expense-form-grid { grid-template-columns: 1fr; gap: 12px; }
  #addExpensePage .expense-name-field,
  #addExpensePage .expense-type-picker,
  #addExpensePage .split-picker,
  #addExpensePage .expense-submit-field { grid-column: auto; }
  #addExpensePage .expense-type-picker { grid-template-columns: 1fr; }
  #addExpensePage .expense-type-option { min-height: 0; }
}

/* Add expense reference recreation. */
#dashboard:has(#addExpensePage:not(.hidden)) .app-content,
body.add-expense-open #dashboard .app-content { background: #f5f7f8; min-height: 100dvh; overflow-x: clip; }
#addExpensePage { width: 100%; max-width: 440px; min-height: calc(100dvh - 52px); align-content: start; gap: 20px; margin: 0 auto; padding-bottom: 0; color: #0f172a; font: 400 16px/1.35 Inter, sans-serif; }
#addExpensePage .page-intro { display: flex; align-items: center; gap: 8px; margin: 0 -8px; }
#addExpensePage .page-intro > * { margin: 0; }
#addExpensePage .add-expense-close { display: grid; width: 44px; height: 44px; flex: none; place-items: center; padding: 0; border: 0; color: #0f172a; }
#addExpensePage .page-intro h2 { color: #0f172a; font: 700 22px/1.2 Inter, sans-serif; }
#addExpensePage .action-panel { display: contents; padding: 0; border: 0; background: transparent; box-shadow: none; }
#addExpensePage #expenseForm { display: grid; grid-template-columns: 1.3fr 1fr; gap: 20px 12px; align-items: start; }
#addExpensePage .expense-type-picker { position: relative; grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 4px; margin: 0; padding: 4px; border: 0; border-radius: 14px; background: #e2e8f0; overflow: hidden; }
#addExpensePage .expense-type-picker::before { content: ""; position: absolute; top: 4px; bottom: 4px; left: 4px; z-index: 0; width: calc((100% - 16px) / 3); border-radius: 10px; background: #fff; box-shadow: 0 2px 8px rgba(15, 23, 42, .08); transform: translateX(0); transition: transform .28s cubic-bezier(.22, 1, .36, 1), width .2s ease; pointer-events: none; }
#addExpensePage .expense-type-picker[data-active-type="personal"]::before,
#addExpensePage .expense-type-picker:has(input[value="personal"]:checked)::before { transform: translateX(calc(100% + 4px)); }
#addExpensePage .expense-type-picker[data-active-type="household"]::before,
#addExpensePage .expense-type-picker:has(input[value="household"]:checked)::before { transform: translateX(calc(200% + 8px)); }
#addExpensePage .expense-type-picker:has(#householdExpenseOption.hidden) { grid-template-columns: repeat(2, minmax(0,1fr)); }
#addExpensePage .expense-type-picker:has(#householdExpenseOption.hidden)::before { width: calc((100% - 12px) / 2); }
#addExpensePage .expense-type-option { position: relative; z-index: 1; display: flex; min-height: 44px; align-items: center; justify-content: center; padding: 0 4px; border: 0; border-radius: 10px; background: transparent; color: #475569; text-align: center; cursor: pointer; transition: color .2s ease, transform .15s ease; }
#addExpensePage .expense-type-option:active { transform: scale(.97); }
#addExpensePage .expense-type-option input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
#addExpensePage .expense-type-option span { display: block; }
#addExpensePage .expense-type-option strong { color: #475569; font-size: 14px; font-weight: 600; transition: color .2s ease; }
#addExpensePage .expense-type-option small { display: none; }
#addExpensePage .expense-type-option:has(input:checked) { background: transparent; color: #0f766e; box-shadow: none; }
#addExpensePage .expense-type-option:has(input:checked) strong { color: #0f766e; }
#addExpensePage .expense-type-note { grid-column: 1 / -1; margin: -12px 0 0; color: #475569; font-size: 14px; }
#addExpensePage .expense-amount-field { grid-column: 1 / -1; display: grid; justify-items: center; padding: 16px 20px; border: 1px solid #e2e8f0; border-radius: 20px; background: #fff; text-align: center; }
#addExpensePage .expense-amount-field > label { color: #475569; font-size: 14px; }
#addExpensePage .expense-amount-input { display: flex; align-items: center; justify-content: center; margin-top: 4px; }
#addExpensePage .expense-amount-input > span { color: #475569; font-size: 30px; font-weight: 700; }
#addExpensePage .expense-amount-input input { width: 170px; min-height: 52px; padding: 0; border: 0; background: transparent; color: #0f172a; font: 700 44px/1 Inter, sans-serif; text-align: left; }
#addExpensePage .expense-amount-input input:focus { outline: 0; box-shadow: none; }
#addExpensePage .expense-name-field, #addExpensePage .expense-category-field { grid-column: 1 / -1; }
#addExpensePage .form-field { display: grid; gap: 8px; }
#addExpensePage .form-field > label, #addExpensePage .split-picker legend { color: #334155; font-size: 14px; font-weight: 600; }
#addExpensePage .form-field > input { width: 100%; min-height: 48px; padding: 0 14px; border: 1px solid #cbd5e1; border-radius: 12px; background: #fff; color: #0f172a; font: 400 16px Inter, sans-serif; }
#addExpensePage .expense-category-chips { display: flex; flex-wrap: wrap; gap: 8px; }
#addExpensePage .expense-category-chips.hidden { display: none; }
#addExpensePage .expense-category-chips button { height: 40px; padding: 0 16px; border: 1px solid #cbd5e1; border-radius: 20px; background: #fff; color: #334155; font: 600 14px Inter, sans-serif; cursor: pointer; transition: border-color .15s ease, background-color .15s ease, color .15s ease; }
#addExpensePage .expense-category-chips button:hover { border-color: #0f766e; background: #f0fdfa; color: #115e59; }
#addExpensePage .expense-category-chips button.is-selected { border-color: #0f766e; background: #0f766e; color: #fff; }
#addExpensePage #expenseCategory { position: absolute; width: 1px; height: 1px; overflow: hidden; padding: 0; border: 0; opacity: 0; pointer-events: none; }
#addExpensePage #expenseCategory.is-visible { position: static; width: 100%; height: 48px; padding: 0 14px; border: 1px solid #cbd5e1; border-radius: 12px; opacity: 1; pointer-events: auto; }
#addExpensePage #expenseCategory.is-visible:focus { border-color: #0f766e; outline: 0; box-shadow: 0 0 0 3px rgba(15, 118, 110, .14); }
#addExpensePage .expense-date-field, #addExpensePage .expense-time-field { grid-column: span 1; }
#addExpensePage input[type="date"], #addExpensePage input[type="time"] { min-height: 48px; }
#addExpensePage .split-picker { grid-column: 1 / -1; margin: 0; padding: 0; border: 0; overflow: hidden; transition: opacity .2s ease, transform .2s ease, max-height .22s ease; }
#addExpensePage .split-picker.is-entering { animation: expenseSplitEnter .28s cubic-bezier(.22, 1, .36, 1) both; }
#addExpensePage .split-picker.is-leaving { opacity: 0; transform: translateY(-6px); max-height: 0 !important; margin: 0; pointer-events: none; }
@keyframes expenseSplitEnter { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
#addExpensePage #expenseForm.is-switching-forward > :not(.expense-type-picker):not(.split-picker.is-leaving) {
  animation: expenseBodySlideForward .32s cubic-bezier(.22, 1, .36, 1) both;
}
#addExpensePage #expenseForm.is-switching-backward > :not(.expense-type-picker):not(.split-picker.is-leaving) {
  animation: expenseBodySlideBackward .32s cubic-bezier(.22, 1, .36, 1) both;
}
#addExpensePage #expenseForm.is-switching-forward > .expense-amount-field,
#addExpensePage #expenseForm.is-switching-backward > .expense-amount-field { animation-delay: 15ms; }
#addExpensePage #expenseForm.is-switching-forward > .expense-name-field,
#addExpensePage #expenseForm.is-switching-backward > .expense-name-field { animation-delay: 30ms; }
#addExpensePage #expenseForm.is-switching-forward > .expense-category-field,
#addExpensePage #expenseForm.is-switching-backward > .expense-category-field { animation-delay: 45ms; }
#addExpensePage #expenseForm.is-switching-forward > .expense-date-field,
#addExpensePage #expenseForm.is-switching-forward > .expense-time-field,
#addExpensePage #expenseForm.is-switching-backward > .expense-date-field,
#addExpensePage #expenseForm.is-switching-backward > .expense-time-field { animation-delay: 60ms; }
#addExpensePage #expenseForm.is-switching-forward > .split-picker:not(.is-leaving),
#addExpensePage #expenseForm.is-switching-backward > .split-picker:not(.is-leaving) { animation-delay: 75ms; }
#addExpensePage #expenseForm.is-switching-forward > .expense-submit-field,
#addExpensePage #expenseForm.is-switching-backward > .expense-submit-field { animation-delay: 85ms; }
@keyframes expenseBodySlideForward {
  from { opacity: 0; transform: translateX(26px) scale(.985); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes expenseBodySlideBackward {
  from { opacity: 0; transform: translateX(-26px) scale(.985); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  #addExpensePage .expense-type-picker::before,
  #addExpensePage .expense-type-option,
  #addExpensePage .expense-type-option strong,
  #addExpensePage .split-picker { transition: none !important; }
  #addExpensePage #expenseForm.is-switching-forward > :not(.expense-type-picker),
  #addExpensePage #expenseForm.is-switching-backward > :not(.expense-type-picker),
  #addExpensePage .split-picker.is-entering { animation: none !important; }
}
#addExpensePage .split-picker legend { padding: 0; margin-bottom: 8px; }
#addExpensePage .split-picker-actions { display: flex; justify-content: flex-end; margin: -44px 0 8px; }
#addExpensePage .text-button { min-height: 44px; color: #0f766e; font: 600 14px Inter, sans-serif; }
#addExpensePage .split-member-list { display: flex; flex-wrap: wrap; gap: 10px; }
#addExpensePage .split-member-option { display: flex; width: calc(50% - 5px); min-height: 56px; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid #cbd5e1; border-radius: 14px; background: #fff; color: #0f172a; font-size: 14px; font-weight: 600; }
#addExpensePage .split-member-option:has(input:checked) { border: 1.5px solid #0f766e; background: #ccfbf1; }
#addExpensePage .split-member-option input { order: 3; width: 20px; height: 20px; margin-left: auto; accent-color: #0f766e; }
#addExpensePage .split-member-option .avatar { width: 32px; height: 32px; flex: none; }
#addExpensePage .split-member-option > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#addExpensePage .split-preview { margin-top: 12px; padding: 12px 14px; border-radius: 12px; background: #ccfbf1; color: #115e59; font-size: 14px; font-weight: 600; }
#addExpensePage .split-picker-note { display: none; }
#addExpensePage .expense-submit-field { grid-column: 1 / -1; margin: 0 -20px; padding: 12px 20px 32px; border-top: 1px solid #e2e8f0; background: #fff; }
#addExpensePage .expense-submit-field label { display: none; }
#addExpensePage .expense-submit-field button { width: 100%; height: 52px; border: 0; border-radius: 14px; background: #0f766e; color: #fff; font-size: 16px; font-weight: 600; }
#addExpensePage #expenseMessage { grid-column: 1 / -1; margin: 0; color: #475569; font-size: 14px; }
#addExpensePage .expense-name-field { order: 4; }
#addExpensePage .expense-category-field { order: 5; }
#addExpensePage .expense-date-field { order: 6; }
#addExpensePage .expense-time-field { order: 7; }
#addExpensePage .expense-type-picker { order: 1; }
#addExpensePage .expense-type-note { order: 2; }
#addExpensePage .expense-amount-field { order: 3; }
#addExpensePage .split-picker { order: 8; }
#addExpensePage .expense-submit-field { order: 9; }
#adminDashboardQrPanel { border: 1px solid #e2e8f0; border-radius: 20px; background: #fff; box-shadow: 0 8px 24px rgba(15, 23, 42, .06); color: #0f172a; }
#adminDashboardQrPanel .panel-kicker { color: #0f766e; }
#adminDashboardQrPanel h2 { color: #0f172a; font: 700 24px/1.2 Inter, sans-serif; }
#adminDashboardQrPanel .admin-dashboard-qr-name { color: #334155; font-size: 16px; }
#adminDashboardQrPanel .admin-dashboard-qr-upi { color: #0f766e; }
#adminDashboardQrPanel .admin-dashboard-qr-help { color: #475569; }
#adminDashboardQrPanel .admin-dashboard-share { color: #0f172a; }
#adminDashboardQrPanel .household-share-row { border-color: #e2e8f0; background: #f8fafc; color: #334155; }
#adminDashboardQrPanel .household-share-row { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(100px, 1fr); align-items: center; text-align: left; }
#adminDashboardQrPanel .household-share-row span:first-child { text-align: left; }
#adminDashboardQrPanel .household-share-row strong { color: #0f172a; }
#adminDashboardQrPanel .household-share-row span:last-child { color: #64748b; }
#adminDashboardQrPanel .household-share-row strong { justify-self: end; }
#adminDashboardQrPanel .household-share-row span:last-child { min-width: 100px; text-align: right; }
#adminDashboardQrPanel #copyAdminUpiBtn { border: 1px solid #cbd5e1; background: #fff; color: #0f766e; }
#adminDashboardQrPanel #payHouseholdBtn { background: #0f766e; color: #fff; }
#adminDashboardQrPanel .admin-dashboard-qr-code { border: 1px solid #e2e8f0; box-shadow: none; }
#dashboard:has(#addExpensePage:not(.hidden)) :is(.sidebar, .topbar, .mobile-quick-add, .smart-assistant-toggle, .smart-assistant-widget) { display: none !important; }
#dashboard:has(#addExpensePage:not(.hidden)) .app-content { margin-left: 0; margin-bottom: 0; }
#dashboard:has(#addExpensePage:not(.hidden)) .dashboard-main { padding: 52px 20px 0; }
body.add-expense-open #dashboard :is(.sidebar, .topbar, .mobile-quick-add, .smart-assistant-toggle, .smart-assistant-widget) { display: none !important; }
body.add-expense-open #dashboard .app-content { margin-left: 0 !important; margin-bottom: 0 !important; }
body.add-expense-open #dashboard .dashboard-main { padding: 52px 20px 0 !important; }
@media (max-width: 700px) {
  #dashboard:has(#addExpensePage:not(.hidden)) :is(.topbar, .mobile-quick-add, .smart-assistant-toggle, .smart-assistant-widget) { display: none !important; }
  #dashboard:has(#addExpensePage:not(.hidden)) .dashboard-main { padding: max(52px, env(safe-area-inset-top)) 20px 0; }
  #dashboard:has(#addExpensePage:not(.hidden)) .app-content { margin-bottom: 0; }
}

/* Final Messenger contrast pass after theme overrides. */
.messenger-dialog.whatsapp-dialog .whatsapp-shell,
.messenger-dialog.whatsapp-dialog .whatsapp-list-pane,
.messenger-dialog.whatsapp-dialog .whatsapp-chat-list { background: #f5f7f8 !important; }
.messenger-dialog.whatsapp-dialog .whatsapp-main-header { background: #fff !important; }
.messenger-dialog.whatsapp-dialog .whatsapp-brand-title h2,
.messenger-dialog.whatsapp-dialog .messenger-chat-title-line strong { color: #0f172a !important; }
.messenger-dialog.whatsapp-dialog .messenger-chat-title-line time,
.messenger-dialog.whatsapp-dialog .messenger-chat-copy > small { color: #475569 !important; }
.messenger-dialog.whatsapp-dialog .messenger-chat-item { color: #0f172a !important; background: transparent !important; }
.messenger-dialog.whatsapp-dialog .messenger-chat-item::after { background: #e2e8f0 !important; }
.messenger-dialog.whatsapp-dialog .whatsapp-search-box { border-color: #e2e8f0 !important; background: #fff !important; color: #475569 !important; }
.messenger-dialog.whatsapp-dialog .whatsapp-search-box input { color: #0f172a !important; }
.messenger-dialog.whatsapp-dialog .whatsapp-search-box input::placeholder { color: #64748b !important; }
.messenger-dialog.whatsapp-dialog .messenger-filter-chip { color: #334155 !important; background: #fff !important; border-color: #cbd5e1 !important; }
.messenger-dialog.whatsapp-dialog .messenger-filter-chip.is-selected { color: #fff !important; background: #0f766e !important; border-color: #0f766e !important; }

/* Final spending reference alignment. */
#personalAccountPage .account-settlement-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; min-height: 56px; padding: 8px 12px; border: 1px solid #e2e8f0; border-radius: 14px; background: #f8fafc; cursor: pointer; transition: border-color .16s ease, background .16s ease, box-shadow .16s ease; }
#personalAccountPage .account-settlement-row:hover { border-color: #99d5ca; background: #f8fffd; box-shadow: 0 4px 12px rgba(15, 118, 110, .08); }
#personalAccountPage .account-settlement-row:focus-visible { outline: 3px solid rgba(15, 118, 110, .25); outline-offset: 2px; }
#personalAccountPage .account-settlement-person { width: 100%; cursor: pointer; }
#personalAccountPage .account-settlement-row > strong { justify-self: end; }

/* Final spending reference alignment. */
#householdDashboard .balance-row { min-height: 72px; padding: 12px; border: 1px solid #e2e8f0; border-radius: 16px; background: #fff; cursor: pointer; transition: border-color .16s ease, background .16s ease, box-shadow .16s ease; }
#householdDashboard .balance-row:hover { border-color: #99d5ca; background: #f8fffd; box-shadow: 0 4px 12px rgba(15, 118, 110, .08); }
#householdDashboard .balance-row:focus-visible { outline: 3px solid rgba(15, 118, 110, .25); outline-offset: 2px; }
#householdDashboard .balance-description { width: 100%; }
#householdDashboard .balance-description.person-link:hover strong { color: #0f766e; text-decoration: none; }

/* Final spending reference alignment. */
#flowChartPage .pace-panel .pace-comparison-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
#flowChartPage .pace-panel .pace-comparison-grid > div:nth-child(n+3) { display: none; }
#flowChartPage .personal-flow-private-note { color: #ccfbf1 !important; }
#flowChartPage .personal-flow-summary > small { line-height: 1.35; }
#flowChartPage .personal-flow-summary > small#personalFlowCount { order: 3; }
#flowChartPage .personal-flow-summary > small#personalFlowPreviousTotal { order: 4; }
#flowChartPage .personal-flow-summary > small.personal-flow-private-note { order: 5; }
#flowChartPage .current-flow-section .pace-panel h2::after { content: ''; }
@media (max-width: 700px) {
  #flowChartPage { width: 100%; gap: 16px; }
  #flowChartPage .flowchart-view-switch { margin-inline: 0; }
  #flowChartPage .flowchart-slider-controls { margin: 0 2px; }
  #flowChartPage .flowchart-section-heading { padding-inline: 0; }
  #flowChartPage .flowchart-section-heading h2 { font-size: 22px; }
  #flowChartPage .flowchart-section-heading > p:last-child { font-size: 14px; }
  #flowChartPage .flowchart-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #flowChartPage .flow-metric-card { border-radius: 16px; }
  #flowChartPage .panel { border-radius: 18px; box-shadow: none; }
  #flowChartPage .pace-panel,
  #flowChartPage .month-comparison-panel,
  #flowChartPage .flow-roommate-panel,
  #flowChartPage .flow-category-panel,
  #flowChartPage .daily-spending-panel { border-color: #e2e8f0; }
  #flowChartPage .personal-flow-summary { border-radius: 18px; box-shadow: 0 7px 18px rgba(15,118,110,.14); }
}

/* Home reference composition: keep the dashboard focused on the three core cards. */
@media (max-width: 700px) {
  #dashboard:has(#householdDashboard:not(.hidden)) .dashboard-main {
    padding: max(56px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) 0 max(20px, env(safe-area-inset-left));
  }
  #dashboard:has(#householdDashboard:not(.hidden)) #welcomeRow { margin-bottom: 8px; }
  #dashboard:has(#householdDashboard:not(.hidden)) #householdDashboard { display: block; }
  #dashboard:has(#householdDashboard:not(.hidden)) #householdDashboard .dashboard-layout { display: block; }
  #dashboard:has(#householdDashboard:not(.hidden)) #householdDashboard .dashboard-main-column {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }
  #dashboard:has(#householdDashboard:not(.hidden)) #householdDashboard .spend-panel,
  #dashboard:has(#householdDashboard:not(.hidden)) #householdDashboard .balance-panel,
  #dashboard:has(#householdDashboard:not(.hidden)) #householdDashboard .home-recent { width: 100%; }
  #dashboard:has(#householdDashboard:not(.hidden)) #householdDashboard .dashboard-side-column { display: grid; }
  #dashboard:has(#householdDashboard:not(.hidden)) #householdDashboard .transactions-panel { display: block; }
}

/* Cross-device mobile guardrails. These rules intentionally come last so older
   desktop/theme rules cannot force horizontal overflow on compact phones. */
@media (max-width: 700px) {
  html, body { width: 100%; max-width: 100%; overflow-x: hidden; }
  body { min-width: 0; }
  #dashboard, #dashboard .app-shell, #dashboard .app-content { width: 100%; max-width: 100%; min-width: 0; }
  #dashboard .dashboard-main { width: 100%; max-width: 100%; min-width: 0; padding-inline: max(12px, env(safe-area-inset-left)) max(12px, env(safe-area-inset-right)); }
  #dashboard .panel, #dashboard .page-intro, #dashboard .section-heading,
  #dashboard .dashboard-layout, #dashboard .dashboard-main-column, #dashboard .dashboard-side-column { min-width: 0; max-width: 100%; }
  #dashboard h1, #dashboard h2, #dashboard h3, #dashboard p, #dashboard span, #dashboard strong,
  #dashboard button, #dashboard label, #dashboard a { overflow-wrap: anywhere; }
  #dashboard button, #dashboard input, #dashboard select, #dashboard textarea { font-size: max(14px, 1em); }
  #dashboard .sidebar { width: 100%; max-width: 100%; padding-left: max(8px, env(safe-area-inset-left)); padding-right: max(8px, env(safe-area-inset-right)); }
  #dashboard .sidebar .nav-link { min-width: 0; }
  #dashboard .sidebar .mobile-nav-label { min-width: 0; max-width: 100%; white-space: nowrap; }
  #dashboard .app-content { margin-bottom: calc(65px + max(28px, env(safe-area-inset-bottom))); }
  .home-header-actions { flex: 0 0 auto; }
  .home-header-actions button { flex: 0 0 44px; }
  .home-spend-heading { min-width: 0; }
  .home-spend-heading h2, #homeSpendingDetails { min-width: 0; }
  #householdDashboard .spend-total { max-width: 100%; font-size: clamp(30px, 10vw, 42px); }
  #householdDashboard .balance-row { grid-template-columns: minmax(0, 1fr) auto; }
  #householdDashboard .balance-description { min-width: 0; }
  #householdDashboard .balance-amount { max-width: 42%; text-align: right; overflow-wrap: anywhere; }
  .home-recent-expenses li { min-width: 0; }
  .home-recent-expenses li > strong { max-width: 40%; text-align: right; overflow-wrap: anywhere; }
  .expense-form-grid { grid-template-columns: minmax(0, 1fr); }
  .expense-name-field, .expense-date-field, .expense-time-field,
  .expense-type-picker, .expense-category-field, .expense-amount-field,
  .expense-submit-field, .split-picker, #expenseMessage { grid-column: 1 / -1; }
  #addExpensePage .split-member-option { width: 100%; }
  #addExpensePage .expense-submit-field { margin-inline: -20px; padding-inline: 20px; }
  .flowchart-metrics, .personal-account-stats, .account-settlement-grid { grid-template-columns: 1fr; }
  .pace-comparison-grid { grid-template-columns: 1fr; }
  .month-comparison-chart { grid-template-columns: 1fr; gap: 12px; }
  .month-comparison-column { min-height: 100px; }
  .daily-chart-scroll { max-width: 100%; }
  .payment-request-row, .expense-item, .expense-change-item { flex-wrap: wrap; }
  .payment-request-main, .expense-item > div:first-child, .expense-change-item > div:first-child { width: 100%; }
  .payment-request-actions, .expense-actions { width: 100%; }
  .payment-request-actions button, .expense-actions button { flex: 1 1 0; min-width: 0; }
  .messenger-dialog, .messenger-call-dialog, .alert-dialog, .friend-finder-dialog { width: calc(100vw - 16px); max-width: calc(100vw - 16px); }
  .messenger-dialog.whatsapp-dialog { width: 100vw; max-width: 100vw; border-radius: 0; }
}

@media (max-width: 359px) {
  #dashboard .dashboard-main { padding-left: max(9px, env(safe-area-inset-left)); padding-right: max(9px, env(safe-area-inset-right)); }
  #dashboard .panel { padding-inline: 11px; }
  #dashboard .home-header-actions { gap: 5px; }
  #dashboard .home-header-actions button { width: 40px; height: 40px; flex-basis: 40px; }
  #dashboard:has(#householdDashboard:not(.hidden)) #welcomeTitle { font-size: 20px; }
  #householdDashboard .balance-row { padding-inline: 8px; }
  #householdDashboard .balance-description .avatar { width: 38px; height: 38px; flex-basis: 38px; }
  #householdDashboard .balance-amount { max-width: 38%; font-size: 15px; }
  #dashboard .sidebar .nav-link { font-size: 11px; }
}

@media (max-width: 700px) and (orientation: landscape) and (max-height: 520px) {
  #dashboard .sidebar { padding-bottom: max(5px, env(safe-area-inset-bottom)); }
  #dashboard .sidebar .nav-link { min-height: 46px; }
  #dashboard .app-content { margin-bottom: calc(53px + env(safe-area-inset-bottom)); }
  #dashboard:has(#householdDashboard:not(.hidden)) .dashboard-main { padding-top: max(16px, env(safe-area-inset-top)); }
  #dashboard:has(#householdDashboard:not(.hidden)) #welcomeRow { margin-bottom: 8px; }
}

/* Restore the previous focused Home presentation. */
#dashboard:has(#householdDashboard:not(.hidden)) #adminDashboardQrPanel { display: none !important; }
@media (max-width: 700px) {
  #dashboard:has(#householdDashboard:not(.hidden)) #smartAssistantWidget:not(.is-open) { display: none !important; }
  #dashboard:has(#householdDashboard:not(.hidden)) #householdDashboard .transactions-panel,
  #dashboard:has(#householdDashboard:not(.hidden)) #householdDashboard .dashboard-side-column { display: none !important; }
}

/* Home keeps the focused layout, with only the admin QR/payment card restored. */
#householdDashboard .dashboard-side-column { display: none; }
#householdDashboard .dashboard-layout { grid-template-columns: minmax(0, 1fr); }
#dashboard:has(#householdDashboard:not(.hidden)) #adminDashboardQrPanel:not(.hidden) { display: block !important; }

/* Conversation styling from the supplied Messenger conversation design. */
#messengerDialog .whatsapp-conversation { background: #eef2f1; color: #0f172a; font-family: Inter, sans-serif; }
#messengerConversationHeader { min-height: 64px; padding: 8px 12px 8px 4px; background: #fff; border-bottom: 1px solid #e2e8f0; }
#messengerConversationHeader .whatsapp-chat-header-left { flex: 1; gap: 6px; overflow: hidden; }
#messengerConversationHeader .whatsapp-icon-btn { width: 44px; height: 44px; flex: 0 0 44px; border-radius: 50%; color: #334155; background: transparent; }
#whatsappHeaderAvatar { width: 40px; height: 40px; flex: 0 0 40px; background: #fef3c7; color: #92400e; border: 0; border-radius: 50%; font-size: 13px; font-weight: 600; }
#messengerConversationName { color: #0f172a; font-size: 16px; font-weight: 600; }
#messengerConversationMembers { color: #475569; font-size: 13px; }
#messengerMessages { padding: 12px 16px; gap: 10px; background: #eef2f1; }
#messengerMessages .messenger-household-note { margin: auto auto 0; padding: 8px 14px; border: 0; border-radius: 14px; background: #fff; color: #475569; font-size: 13px; }
#messengerMessages .whatsapp-date-pill { padding: 4px 10px; margin: 0 auto; background: transparent; color: #475569; font-size: 12px; font-weight: 600; }
#messengerMessages .messenger-bubble { align-self: flex-start; max-width: min(78%, 540px); padding: 10px 14px; border: 1px solid #e2e8f0; border-radius: 16px 16px 16px 4px; background: #fff; color: #0f172a; box-shadow: none; }
#messengerMessages .messenger-bubble.mine { align-self: flex-end; border-color: #0f766e; border-radius: 16px 16px 4px 16px; background: #0f766e; color: #fff; }
#messengerMessages .whatsapp-msg-text { margin: 0; color: inherit; font-size: 16px; line-height: 1.35; }
#messengerMessages .whatsapp-bubble-meta { margin-top: 2px; color: #475569; font-size: 12px; }
#messengerMessages time { margin: 0; color: inherit; font-size: 12px; }
#messengerMessages .mine .whatsapp-bubble-meta { color: #e1f4f1; }
#messengerMessages .whatsapp-ticks { color: #c5ded9; }
#messengerMessages .whatsapp-ticks.is-seen { color: #fff; }
#messengerComposeForm { display: grid; grid-template-columns: 44px minmax(0, 1fr) 48px; align-items: end; gap: 8px 0; padding: 8px 12px max(20px, env(safe-area-inset-bottom)); border-top: 1px solid #e2e8f0; background: #fff; }
#messengerComposeForm.hidden { display: none; }
#whatsappAttachBtn { grid-column: 1 / -1; grid-row: 1; justify-self: start; width: auto; height: 40px; padding: 0 14px; border: 1px solid #cbd5e1; border-radius: 20px; background: #fff; color: #0f766e; gap: 6px; }
#whatsappAttachBtn::after { content: 'Reactions'; color: #334155; font-size: 14px; font-weight: 600; }
#whatsappEmojiToggleBtn { grid-column: 1; grid-row: 2; width: 44px; height: 48px; border-radius: 24px 0 0 24px; background: #f1f5f9; color: #475569; }
#messengerComposeForm .whatsapp-input-wrap { grid-column: 2; grid-row: 2; margin-right: 8px; }
#messengerInput { min-height: 48px; padding: 14px 14px 14px 0; border: 0; border-radius: 0 24px 24px 0; color: #0f172a; background: #f1f5f9; font-size: 16px; line-height: 20px; }
#messengerInput::placeholder { color: #64748b; }
#messengerInput:focus { box-shadow: inset 0 0 0 2px #0f766e; }
#messengerSendBtn { grid-column: 3; grid-row: 2; width: 48px; height: 48px; border-radius: 50%; background: #0f766e; color: #fff; }
#messengerSendBtn:hover { background: #115e59; }
#whatsappQuickEmojiBar { background: #fff; }
@media (max-width: 700px) {
  #messengerConversationHeader { padding-top: max(8px, env(safe-area-inset-top)); }
  #messengerConversationHeader .whatsapp-call-actions { gap: 0; }
}

/* Find friends reference: responsive community bottom sheet. */
#friendFinderDialog { width: min(520px, calc(100vw - 32px)); max-width: 520px; max-height: calc(100dvh - 32px); padding: 0; border: 0; border-radius: 24px; background: #f5f7f8; color: #0f172a; font-family: Inter, sans-serif; }
#friendFinderDialog::backdrop { background: rgba(30, 41, 59, .72); }
#friendFinderDialog .friend-finder-content { display: flex; flex-direction: column; gap: 16px; min-height: min(560px, calc(100dvh - 32px)); padding: 8px 20px 32px; box-sizing: border-box; }
#friendFinderDialog .friend-sheet-handle { align-self: center; width: 40px; height: 4px; flex-shrink: 0; border-radius: 2px; background: #cbd5e1; }
#friendFinderDialog .friend-finder-title { align-items: flex-start; gap: 4px; margin-right: -8px; }
#friendFinderHeading { margin: 0; color: #0f172a; font-size: 22px; font-weight: 700; }
#friendFinderDialog .friend-finder-title p { margin: 2px 0 0; color: #475569; font-size: 14px; line-height: 1.45; }
#closeFriendFinderBtn { display: grid; place-items: center; width: 44px; height: 44px; flex: 0 0 44px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: #0f172a; }
#friendFinderDialog .friend-search-box { display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 14px; border: 1.5px solid #0f766e; border-radius: 14px; background: #fff; color: #475569; }
#friendFinderDialog .friend-search-box svg { flex-shrink: 0; }
#friendSearchInput { width: 100%; min-width: 0; min-height: 44px; padding: 0; border: 0; border-radius: 0; background: transparent; color: #0f172a; font: inherit; font-size: 16px; box-shadow: none; outline: none; }
#friendFinderDialog .friend-search-box:focus-within { outline: 3px solid #99f6e4; outline-offset: 2px; }
#friendSearchInput::placeholder { color: #64748b; }
#friendSearchHint { margin: 6px 4px 0; color: #475569; font-size: 14px; }
#friendSearchStatus { color: #475569; font-size: 14px; }
#friendSearchStatus:empty, #friendSearchResults:empty { display: none; }
#friendFinderDialog .friend-filter-tabs { display: flex; gap: 4px; padding: 4px; border-radius: 14px; background: #e2e8f0; }
#friendFinderDialog .friend-filter-tabs button { flex: 1; min-height: 44px; border: 0; border-radius: 10px; background: transparent; color: #475569; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
#friendFinderDialog .friend-filter-tabs button[aria-pressed="true"] { background: #fff; color: #0f766e; }
#friendFinderDialog .friend-list { gap: 0; overflow: hidden; border: 1px solid #e2e8f0; border-radius: 20px; background: #fff; }
#friendFinderDialog .friend-list-row { flex-wrap: wrap; justify-content: flex-start; gap: 12px; min-height: 68px; padding: 12px 16px; border: 0; border-bottom: 1px solid #e2e8f0; border-radius: 0; background: #fff; }
#friendFinderDialog .friend-list-row:last-child { border-bottom: 0; }
#friendFinderDialog .friend-person-avatar { display: grid; place-items: center; width: 44px; height: 44px; flex: 0 0 44px; border-radius: 50%; background: #ede9fe; color: #5b21b6; font-size: 15px; font-weight: 600; }
#friendFinderDialog .friend-person-copy { flex: 1; min-width: 90px; }
#friendFinderDialog .friend-person-copy strong { display: block; overflow-wrap: anywhere; color: #0f172a; font-size: 16px; font-weight: 600; }
#friendFinderDialog .friend-person-copy small { display: block; margin-top: 2px; color: #475569; font-size: 14px; }
#friendFinderDialog .friend-status-pill { padding: 4px 10px; border-radius: 12px; background: #d1fae5; color: #047857; font-size: 13px; font-weight: 600; }
#friendFinderDialog .friend-row-action, #friendFinderDialog .friend-request-actions button { min-height: 40px; padding: 0 10px; border: 1px solid #cbd5e1; border-radius: 12px; background: #fff; color: #0f766e; font-size: 13px; }
#friendFinderDialog .friend-request-actions .button-primary { border-color: #0f766e; background: #0f766e; color: #fff; }
#friendFinderDialog .friend-list-empty { padding: 20px 16px; color: #475569; font-size: 14px; line-height: 1.5; }
#friendFinderDialog button:focus-visible { outline: 3px solid #0f766e; outline-offset: 2px; }
@media (max-width: 600px) {
  #friendFinderDialog { position: fixed; inset: auto 0 0; width: 100%; max-width: 100%; max-height: calc(100dvh - env(safe-area-inset-top) - 16px); margin: auto 0 0; border-radius: 24px 24px 0 0; }
  #friendFinderDialog .friend-finder-content { min-height: min(560px, calc(100dvh - 32px)); padding-bottom: max(32px, env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: no-preference) {
  #friendFinderDialog[open] { animation: friend-sheet-enter .25s ease-out; }
  @keyframes friend-sheet-enter { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
}

/* Ring your roommates composer: calm light sheet matching Profile / Household / Find friends. */
#alertComposerDialog {
  width: min(480px, calc(100vw - 32px));
  max-width: 480px;
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 1px solid #e2e8f0;
  border-radius: 24px;
  background: #f5f7f8;
  color: #0f172a;
  font-family: Inter, sans-serif;
  box-shadow: 0 24px 60px rgba(15, 23, 42, .22);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
#alertComposerDialog::backdrop {
  background: rgba(30, 41, 59, .72);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
#alertComposerDialog .alert-composer-content {
  display: grid;
  gap: 14px;
  padding: 10px 20px 24px;
  box-sizing: border-box;
}
#alertComposerDialog .alert-sheet-handle {
  justify-self: center;
  width: 40px;
  height: 4px;
  border-radius: 2px;
  background: #cbd5e1;
}
#alertComposerDialog .alert-composer-header {
  display: flex;
  align-items: center;
  gap: 12px;
}
#alertComposerDialog .alert-composer-badge {
  display: grid;
  width: 44px;
  height: 44px;
  flex: none;
  place-items: center;
  border-radius: 50%;
  background: #ccfbf1;
  color: #115e59;
}
#alertComposerDialog .alert-composer-heading-copy { flex: 1; min-width: 0; }
#alertComposerDialog .panel-kicker {
  margin: 0 0 2px;
  color: #0f766e;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
}
#alertComposerHeading {
  margin: 0;
  color: #0f172a;
  font: 700 22px/1.2 Inter, sans-serif;
}
#alertComposerDialog .alert-composer-close {
  display: grid;
  width: 44px;
  height: 44px;
  flex: none;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #475569;
  cursor: pointer;
}
#alertComposerDialog .alert-composer-close:hover {
  background: rgba(15, 23, 42, .06);
  color: #0f172a;
}
#alertComposerDialog .alert-dialog-copy {
  margin: 0;
  color: #475569;
  font-size: 14px;
  line-height: 1.5;
}
#alertComposerDialog .alert-quick-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
#alertComposerDialog .alert-quick-chip {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #fff;
  color: #334155;
  font: 600 13px Inter, sans-serif;
  cursor: pointer;
  transition: border-color .15s ease, background-color .15s ease, color .15s ease;
}
#alertComposerDialog .alert-quick-chip:hover {
  border-color: #0f766e;
  background: #f0fdfa;
  color: #115e59;
}
#alertComposerDialog .alert-composer-field {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  background: #fff;
}
#alertComposerDialog .alert-composer-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
#alertComposerDialog label {
  margin: 0;
  color: #0f172a;
  font-size: 14px;
  font-weight: 600;
}
#alertComposerDialog #alertRecipientUid {
  width: 100%;
  min-height: 44px;
  padding: 0 40px 0 14px;
  border: 1.5px solid #cbd5e1;
  border-radius: 14px;
  background: #f8fafc;
  color: #0f172a;
  font: 500 15px Inter, sans-serif;
  outline: 0;
}
#alertComposerDialog #alertRecipientUid:focus {
  border-color: #0f766e;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(15, 118, 110, .12);
}
#alertComposerDialog .alert-recipient-hint {
  color: #64748b;
  font-size: 12px;
  line-height: 1.4;
}
#alertComposerDialog .alert-char-count {
  color: #64748b;
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
#alertComposerDialog textarea {
  width: 100%;
  min-height: 88px;
  padding: 12px 14px;
  box-sizing: border-box;
  border: 1.5px solid #cbd5e1;
  border-radius: 14px;
  background: #f8fafc;
  color: #0f172a;
  font: 400 16px/1.45 Inter, sans-serif;
  resize: vertical;
  outline: 0;
  transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}
#alertComposerDialog textarea::placeholder { color: #64748b; }
#alertComposerDialog textarea:focus {
  border-color: #0f766e;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(15, 118, 110, .12);
}
#alertComposerDialog .message {
  margin: 0;
  color: #475569;
  font-size: 14px;
}
#alertComposerDialog .message:empty { display: none; }
#alertComposerDialog .message.error { color: #b91c1c; }
#alertComposerDialog .message.success { color: #047857; }
#alertComposerDialog .alert-dialog-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 2px;
}
#alertComposerDialog .alert-dialog-actions > button {
  flex: 1 1 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 14px;
  font: 600 15px Inter, sans-serif;
  cursor: pointer;
}
#alertComposerDialog #cancelAlertBtn {
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #334155;
  box-shadow: none;
}
#alertComposerDialog #cancelAlertBtn:hover { background: #f1f5f9; }
#alertComposerDialog #sendHouseholdAlertBtn {
  border: 0;
  background: #0f766e;
  color: #fff;
  box-shadow: 0 8px 20px rgba(15, 118, 110, .25);
}
#alertComposerDialog #sendHouseholdAlertBtn:hover:not(:disabled) { background: #115e59; }
#alertComposerDialog #sendHouseholdAlertBtn:disabled { opacity: .65; cursor: wait; }
#alertComposerDialog button:focus-visible { outline: 3px solid #0f766e; outline-offset: 2px; }
@media (max-width: 600px) {
  #alertComposerDialog {
    position: fixed;
    inset: auto 0 0;
    width: 100%;
    max-width: 100%;
    max-height: calc(100dvh - env(safe-area-inset-top) - 16px);
    margin: auto 0 0;
    border-radius: 24px 24px 0 0;
    border-bottom: 0;
  }
  #alertComposerDialog .alert-composer-content {
    padding: 10px 20px max(28px, env(safe-area-inset-bottom));
  }
}
@media (prefers-reduced-motion: no-preference) {
  #alertComposerDialog[open] { animation: friend-sheet-enter .25s ease-out; }
}

/* Settings full-scroll reference, retaining real account controls. */
#settingsPage { width: min(620px, 100%); margin: 0 auto; padding: 24px 20px 32px; gap: 20px; background: #f5f7f8; color: #0f172a; font-family: Inter, sans-serif; border-radius: 24px; }
#settingsPage.hidden { display: none; }
#settingsPage .settings-title-row { display: flex; align-items: center; gap: 8px; margin: 0 -8px; }
#settingsBackBtn { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: #0f172a; cursor: pointer; }
#settingsPageHeading { margin: 0; font: 700 22px Inter, sans-serif; color: #0f172a; }
#settingsPage .settings-grid { display: flex; flex-direction: column; gap: 0; }
#settingsPage .settings-section-label { margin: 20px 4px 8px; color: #475569; font-size: 14px; font-weight: 600; }
#settingsPage .settings-section-label:first-child { margin-top: 0; }
#settingsPage .panel { width: 100%; padding: 16px; border: 1px solid #e2e8f0; border-radius: 20px; background: #fff; color: #0f172a; box-shadow: none; }
#settingsPage .theme-preferences-panel, #settingsPage .alert-preferences-panel { padding: 0; overflow: hidden; }
#settingsPage .settings-theme-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; padding: 12px 16px; }
#settingsPage .settings-theme-row label { margin: 0; color: #0f172a; font-size: 16px; font-weight: 600; }
#themeSelect { width: auto; min-width: 0; max-width: 66%; margin: 0; padding: 8px 4px; border: 0; background: #fff; color: #475569; font: 400 16px Inter, sans-serif; }
#settingsPage .opening-animation-row, #settingsPage .alarm-preference-row { display: flex; align-items: center; gap: 12px; margin: 0; padding: 12px 16px; border-top: 1px solid #e2e8f0; background: #fff; }
#settingsPage .opening-animation-row > div, #settingsPage .alarm-preference-row > div { flex: 1; min-width: 0; }
#settingsPage .opening-animation-row strong, #settingsPage .alarm-preference-row strong { display: block; color: #0f172a; font-size: 16px; font-weight: 600; }
#settingsPage .opening-animation-row span, #settingsPage .alarm-preference-row span { display: block; margin-top: 2px; color: #475569; font-size: 14px; line-height: 1.4; }
#settingsPage .button-secondary, #settingsPage .button-quiet { min-height: 44px; padding: 0 16px; flex-shrink: 0; border: 1px solid #0f766e; border-radius: 12px; background: #fff; color: #0f766e; font-size: 14px; font-weight: 600; box-shadow: none; }
#settingsPage .section-heading { margin: 0; }
#settingsPage .section-heading h2 { margin: 0; color: #0f172a; font-size: 16px; font-weight: 600; }
#settingsPage .alert-preferences-panel > .section-heading { min-height: 56px; padding: 12px 16px; }
#settingsPage .alert-preferences-panel > p { margin: 0; padding: 0 16px 16px; color: #475569; font-size: 14px; line-height: 1.5; }
#settingsPage .push-alert-controls { margin: 0; padding: 12px 16px; border-top: 1px solid #e2e8f0; }
#settingsPage .message { margin: 0; padding: 8px 16px; color: #475569; font-size: 14px; }
#settingsPage .message:empty { display: none; }
#settingsPage .ios-push-install-hint { margin: 0; padding: 16px; border: 0; border-top: 1px solid #e2e8f0; border-radius: 0; background: #fff; color: #0f172a; font-size: 14px; }
#settingsPage .ios-push-install-hint ol { display: grid; gap: 12px; padding: 0; list-style: none; counter-reset: setup; }
#settingsPage .ios-push-install-hint li { position: relative; min-height: 24px; padding-left: 36px; color: #0f172a; line-height: 1.4; counter-increment: setup; }
#settingsPage .ios-push-install-hint li::before { content: counter(setup); position: absolute; left: 0; top: 0; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: #ccfbf1; color: #115e59; font-size: 13px; font-weight: 700; }
#settingsPage .ios-push-install-hint > span { color: #475569; font-size: 14px; }
#settingsPage .budget-panel .section-heading h2 { color: #475569; font-size: 14px; font-weight: 400; }
#settingsPage .budget-total { margin: 2px 0 12px; color: #0f172a; font: 700 36px Inter, sans-serif; letter-spacing: -1px; overflow-wrap: anywhere; }
#settingsPage .budget-progress { height: 8px; background: #e2e8f0; border-radius: 4px; }
#settingsPage .budget-progress span { background: #0f766e; }
#settingsPage .budget-progress span.over-budget { background: #b91c1c; }
#settingsPage .settings-budget-stats { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin: 8px 0 16px; }
#settingsPage .budget-used { margin: 0; color: #475569; font-size: 14px; }
#settingsPage .budget-remaining { margin: 0 !important; color: #047857 !important; font-size: 14px !important; }
#settingsPage .over-budget .budget-remaining { color: #b91c1c !important; }
#settingsPage .budget-previous-usage { margin: 0 0 12px; color: #475569; font-size: 14px; }
#settingsPage .budget-form { padding-top: 16px; border-color: #e2e8f0; }
#settingsPage .budget-form label { display: block; margin-bottom: 8px; color: #334155; font-size: 14px; font-weight: 600; }
#settingsPage .inline-form-row { gap: 12px; }
#monthlyBudgetInput { height: 48px; padding: 0 14px; border: 1px solid #cbd5e1; border-radius: 12px; background: #fff; color: #0f172a; font-size: 16px; }
#settingsPage .button-primary { min-height: 48px; padding: 0 24px; border: 0; border-radius: 12px; background: #0f766e; color: #fff; font-size: 16px; font-weight: 600; }
#settingsPage .reset-household-card { margin-top: 20px; border-color: #fecaca; }
#settingsPage .reset-household-card p { color: #475569; font-size: 14px; line-height: 1.5; }
#settingsPage .reset-household-card .panel-kicker { color: #b91c1c; }
#settingsPage .reset-household-action { border-color: #fecaca; background: #fff; color: #b91c1c; }
#settingsPage .settings-logout { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 52px; border: 1px solid #fecaca; border-radius: 14px; background: #fff; color: #b91c1c; font: 600 16px Inter, sans-serif; cursor: pointer; }
#settingsPage .settings-brand { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 8px; font-size: 14px; }
#settingsPage .settings-brand img { border-radius: 14px; object-fit: cover; display: block; }
#settingsPage .settings-brand span { color: #475569; font-size: 13px; }
#settingsPage :is(button, select, input):focus-visible { outline: 3px solid #0f766e; outline-offset: 3px; }
@media (max-width: 700px) {
  #settingsPage { padding: 16px 12px 32px; border-radius: 0; }
  #settingsPage .opening-animation-row, #settingsPage .alarm-preference-row { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: no-preference) {
  #settingsPage:not(.hidden) .panel { animation: settings-card-enter .35s ease-out both; }
  @keyframes settings-card-enter { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
}

/* RosMate AI start reference. */
#smartAssistantPanel {
  width: min(440px, calc(100vw - 32px));
  height: min(760px, calc(100dvh - 110px));
  background: #f5f7f8;
  color: #0f172a;
  font-family: Inter, sans-serif;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  box-shadow: 0 22px 70px rgba(15, 23, 42, .18);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
#smartAssistantPanel .smart-assistant-header { flex: 0 0 auto; gap: 12px; padding: 16px 8px 10px 20px; background: #fff; border-bottom: 1px solid #e2e8f0; }
#smartAssistantPanel .smart-assistant-avatar { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; flex: 0 0 auto; border: 0; border-radius: 20px; background: #0f766e; color: #fff; }
#smartAssistantPanel .smart-assistant-heading { flex: 1; min-width: 0; }
#smartAssistantPanel .smart-assistant-heading h2 { margin: 0; color: #0f172a; font: 600 16px/1.3 Inter, sans-serif; }
#smartAssistantPanel .smart-assistant-heading p { margin: 0; color: #475569; font: 400 14px/1.35 Inter, sans-serif; }
#smartAssistantClose { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; flex: 0 0 auto; margin-left: auto; padding: 0; border: 0; border-radius: 22px; background: transparent; color: #0f172a; }
#smartAssistantClose:hover { background: #f1f5f9; color: #0f172a; }
#smartAssistantStart { flex: 1; min-height: 0; overflow-y: auto; padding: 28px 20px 20px; display: flex; flex-direction: column; gap: 20px; }
#smartAssistantStart[hidden], #smartAssistantMessages[hidden] { display: none; }
#smartAssistantPanel .smart-assistant-welcome { text-align: center; }
#smartAssistantPanel .smart-assistant-welcome-icon { display: flex; align-items: center; justify-content: center; width: 56px; height: 56px; margin: 0 auto 12px; border-radius: 28px; background: #ccfbf1; color: #115e59; }
#smartAssistantPanel .smart-assistant-welcome h3 { margin: 0; color: #0f172a; font-size: 22px; font-weight: 700; line-height: 1.25; }
#smartAssistantPanel .smart-assistant-welcome p { margin: 6px 0 0; color: #475569; font-size: 14px; line-height: 1.45; }
#smartAssistantPanel .smart-assistant-suggestions { display: flex; flex-direction: column; gap: 10px; padding: 0; }
#smartAssistantPanel .smart-assistant-suggestions button { display: flex; align-items: center; width: 100%; gap: 12px; min-height: 56px; padding: 12px 14px; border: 1px solid #e2e8f0; border-radius: 16px; background: #fff; color: #0f172a; text-align: left; white-space: normal; font-family: inherit; }
#smartAssistantPanel .smart-assistant-suggestions button:hover { border-color: #0f766e; background: #f0fdfa; }
#smartAssistantPanel .smart-assistant-card-icon { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; flex: 0 0 36px; border-radius: 18px; background: #ccfbf1; color: #115e59; }
#smartAssistantPanel .smart-assistant-card-copy { flex: 1; min-width: 0; }
#smartAssistantPanel .smart-assistant-card-copy strong { display: block; color: #0f172a; font-size: 16px; font-weight: 600; line-height: 1.3; }
#smartAssistantPanel .smart-assistant-card-copy small { display: block; margin-top: 2px; color: #475569; font-size: 14px; line-height: 1.35; }
#smartAssistantPanel .smart-assistant-chevron { flex: 0 0 auto; color: #475569; }
#smartAssistantForm { display: flex; align-items: center; gap: 8px; padding: 0; border-top: 0; background: transparent; }
#smartAssistantInput { flex: 1; min-width: 0; height: 48px; min-height: 48px; padding: 0 16px; box-sizing: border-box; border: 0; border-radius: 24px; background: #f1f5f9; color: #0f172a; font-family: inherit; font-size: 16px; }
#smartAssistantInput::placeholder { color: #64748b; }
#smartAssistantInput:focus { border-color: transparent; box-shadow: 0 0 0 2px rgba(15, 118, 110, .25); }
#smartAssistantSend { display: flex; align-items: center; justify-content: center; width: 48px; height: 48px; min-height: 48px; flex: 0 0 48px; padding: 0; border: 0; border-radius: 24px; background: #0f766e; box-shadow: none; color: #fff; }
#smartAssistantSend:hover:not(:disabled) { background: #115e59; transform: none; }
#smartAssistantPanel .smart-assistant-footer { flex: 0 0 auto; display: flex; flex-direction: column; gap: 10px; padding: 10px 12px max(28px, env(safe-area-inset-bottom)); border-top: 1px solid #e2e8f0; background: #fff; }
#smartAssistantPanel .smart-assistant-quick-replies { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
#smartAssistantPanel .smart-assistant-quick-replies::-webkit-scrollbar { display: none; }
#smartAssistantPanel .smart-assistant-quick-replies[hidden] { display: none; }
#smartAssistantPanel .smart-assistant-quick-replies button { flex: none; height: 40px; min-height: 40px; padding: 0 16px; border: 1px solid #cbd5e1; border-radius: 20px; background: #fff; color: #334155; font: 600 14px Inter, sans-serif; white-space: nowrap; cursor: pointer; }
#smartAssistantPanel .smart-assistant-quick-replies button:hover { border-color: #0f766e; background: #f0fdfa; color: #0f766e; }
#smartAssistantPanel .smart-assistant-note { margin: 0; padding: 0; background: transparent; color: #475569; text-align: center; font-size: 12px; line-height: 1.35; }
#smartAssistantMessages { display: flex; flex: 1 1 auto; flex-direction: column; align-items: flex-start; gap: 12px; min-height: 0; padding: 16px; overflow-y: auto; background: #f5f7f8; }
#smartAssistantMessages > :first-child { margin-top: auto; }
#smartAssistantPanel .smart-assistant-message { max-width: 88%; padding: 10px 14px; background: #fff; border: 1px solid #e2e8f0; border-radius: 16px 16px 16px 4px; color: #0f172a; font-size: 16px; line-height: 1.35; }
#smartAssistantPanel .smart-assistant-message.user { max-width: 80%; align-self: flex-end; border: 0; background: #0f766e; color: #fff; border-radius: 16px 16px 4px 16px; }
#smartAssistantPanel .smart-assistant-confirmation,
#smartAssistantPanel .smart-assistant-budget-message { width: 88%; max-width: 88%; white-space: normal; }
#smartAssistantPanel .smart-assistant-lead { font-size: 16px; line-height: 1.35; color: #0f172a; }
#smartAssistantPanel .smart-assistant-summary-card { margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: #f5f7f8; }
#smartAssistantPanel .smart-assistant-draft-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 4px; }
#smartAssistantPanel .smart-assistant-draft-title { font-size: 16px; font-weight: 600; color: #0f172a; overflow-wrap: anywhere; }
#smartAssistantPanel .smart-assistant-draft-amount { flex: none; font-size: 20px; font-weight: 700; color: #0f172a; }
#smartAssistantPanel .smart-assistant-draft-row { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; font-size: 14px; }
#smartAssistantPanel .smart-assistant-draft-row span { color: #475569; }
#smartAssistantPanel .smart-assistant-draft-row b { font-weight: 700; color: #0f172a; text-align: right; overflow-wrap: anywhere; }
#smartAssistantPanel .smart-assistant-confirmation-actions { display: flex; flex-wrap: nowrap; gap: 8px; margin-top: 10px; }
#smartAssistantPanel .smart-assistant-btn-confirm { flex: 1; height: 44px; min-height: 44px; padding: 0 14px; border: 0; border-radius: 12px; background: #0f766e; color: #fff; font: 600 14px Inter, sans-serif; cursor: pointer; }
#smartAssistantPanel .smart-assistant-btn-confirm:hover:not(:disabled) { background: #115e59; }
#smartAssistantPanel .smart-assistant-btn-edit { height: 44px; min-height: 44px; padding: 0 16px; border: 1px solid #cbd5e1; border-radius: 12px; background: #fff; color: #334155; font: 600 14px Inter, sans-serif; cursor: pointer; }
#smartAssistantPanel .smart-assistant-btn-edit:hover:not(:disabled) { border-color: #0f766e; color: #0f766e; }
#smartAssistantPanel .smart-assistant-btn-cancel { height: 44px; min-height: 44px; padding: 0 12px; border: 0; border-radius: 12px; background: transparent; color: #b91c1c; font: 600 14px Inter, sans-serif; cursor: pointer; }
#smartAssistantPanel .smart-assistant-btn-cancel:hover:not(:disabled) { background: #fef2f2; }
#smartAssistantPanel .smart-assistant-budget-headline { font-size: 20px; font-weight: 700; color: #0f172a; }
#smartAssistantPanel .smart-assistant-budget-headline span { font-size: 14px; font-weight: 500; color: #475569; }
#smartAssistantPanel .smart-assistant-budget-track { height: 8px; margin: 8px 0; border-radius: 4px; background: #e2e8f0; overflow: hidden; }
#smartAssistantPanel .smart-assistant-budget-fill { height: 8px; border-radius: 4px; background: #0f766e; }
#smartAssistantPanel .smart-assistant-budget-fill.is-over { background: #b91c1c; }
#smartAssistantPanel .smart-assistant-budget-meta { font-size: 14px; color: #475569; }
#smartAssistantPanel .smart-assistant-confirmation-heading { color: #0f172a; }
#smartAssistantPanel .smart-assistant-confirmation-explanation,
#smartAssistantPanel .smart-assistant-confirmation-details dt { color: #475569; }
#smartAssistantPanel .smart-assistant-confirmation-details dd { color: #0f172a; }
#smartAssistantPanel .smart-assistant-confirmation-actions .button-primary { border: 0; border-radius: 12px; background: #0f766e; box-shadow: none; color: #fff; }
#smartAssistantPanel .smart-assistant-confirmation-actions .button-quiet { border: 1px solid #cbd5e1; border-radius: 12px; background: #fff; box-shadow: none; color: #0f172a; }
#smartAssistantLoading { padding: 8px 16px 10px; background: #f5f7f8; color: #475569; font-size: 12px; }
#smartAssistantPanel .smart-assistant-spinner { border-color: #cbd5e1; border-top-color: #0f766e; }
#smartAssistantPanel button { transition: transform .15s ease, background-color .15s ease, border-color .15s ease; }
#smartAssistantPanel button:active { transform: scale(.96); }
#smartAssistantPanel button:focus-visible, #smartAssistantInput:focus-visible { outline: 3px solid #0f766e; outline-offset: 2px; }
#dashboard #smartAssistantWidget.is-open,
body.floating-actions-hidden #dashboard #smartAssistantWidget.is-open {
  display: block !important;
  z-index: 1000 !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  transform: none !important;
}
#smartAssistantPanel:not([hidden]) {
  display: flex;
  flex-direction: column;
  z-index: 1000;
}
#smartAssistantPanel[hidden] { display: none !important; }
@media (max-width: 700px) {
  #smartAssistantWidget.is-open .smart-assistant-toggle { display: none; }
  #smartAssistantPanel { inset: 0; width: 100%; max-width: 100%; height: 100dvh; max-height: 100dvh; border: 0; border-radius: 0; box-shadow: none; z-index: 1000; }
  #smartAssistantPanel .smart-assistant-header { padding-top: max(16px, env(safe-area-inset-top)); }
}
@keyframes rmUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes rmGrow { from { width: 0; } }
@keyframes rmPop { 0% { opacity: 0; transform: scale(.6); } 70% { transform: scale(1.08); } 100% { opacity: 1; transform: none; } }
@keyframes rmSlide { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: no-preference) {
  #smartAssistantPanel:not([hidden]) .smart-assistant-avatar,
  #smartAssistantPanel:not([hidden]) .smart-assistant-welcome-icon,
  #smartAssistantPanel:not([hidden]) .smart-assistant-card-icon { animation: rmPop .5s ease .2s both; }
  #smartAssistantStart:not([hidden]) .smart-assistant-suggestions button { animation: rmSlide .5s ease both; }
  #smartAssistantStart:not([hidden]) .smart-assistant-suggestions button:nth-child(1) { animation-delay: .19s; }
  #smartAssistantStart:not([hidden]) .smart-assistant-suggestions button:nth-child(2) { animation-delay: .23s; }
  #smartAssistantStart:not([hidden]) .smart-assistant-suggestions button:nth-child(3) { animation-delay: .27s; }
  #smartAssistantStart:not([hidden]) .smart-assistant-suggestions button:nth-child(4) { animation-delay: .31s; }
  #smartAssistantPanel .smart-assistant-message { animation: rmUp .5s ease both; }
  #smartAssistantPanel .smart-assistant-budget-fill { animation: rmGrow 1.1s cubic-bezier(.2,.8,.2,1) .4s backwards; }
}
@media (prefers-reduced-motion: reduce) {
  #smartAssistantPanel *, #smartAssistantPanel *::after { animation: none !important; transition: none !important; }
  #profileEditPage *, #profileEditPage *::after { animation: none !important; transition: none !important; }
}

/* Edit profile reference. */
#dashboard:has(#profileEditPage:not(.hidden)) :is(.sidebar, .topbar, .mobile-quick-add, .smart-assistant-toggle, .smart-assistant-widget),
body.profile-edit-open #dashboard :is(.sidebar, .topbar, .mobile-quick-add, .smart-assistant-toggle, .smart-assistant-widget) { display: none !important; }
#dashboard:has(#profileEditPage:not(.hidden)) .app-content,
body.profile-edit-open #dashboard .app-content { margin-left: 0 !important; margin-bottom: 0 !important; background: #f5f7f8; }
#dashboard:has(#profileEditPage:not(.hidden)) .dashboard-main,
body.profile-edit-open #dashboard .dashboard-main { padding: 0 !important; }
#profileEditPage {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 100dvh;
  margin: 0;
  gap: 0;
  background: #f5f7f8;
  color: #0f172a;
  font: 400 16px/1.35 Inter, sans-serif;
}
#profileEditPage.hidden { display: none; }
#profileEditPage .profile-edit-header {
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(100%, 640px);
  margin: 0 auto;
  padding: max(20px, env(safe-area-inset-top)) 12px 8px;
  box-sizing: border-box;
}
#backFromProfileEditBtn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex: none;
  padding: 0;
  border: 0;
  border-radius: 22px;
  background: none;
  color: #0f172a;
  cursor: pointer;
}
#backFromProfileEditBtn:hover { background: rgba(15, 23, 42, .06); }
#profileEditHeading { margin: 0; color: #0f172a; font: 700 22px/1.25 Inter, sans-serif; }
#profileEditForm {
  display: flex;
  flex: 1;
  flex-direction: column;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
#profileEditPage .profile-edit-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 20px;
  width: min(100%, 640px);
  margin: 0 auto;
  padding: 8px 20px 24px;
  box-sizing: border-box;
}
#profileEditPage .profile-edit-photo-row { display: flex; align-items: center; gap: 16px; }
#profileEditPage .profile-edit-avatar-wrap { position: relative; width: 88px; height: 88px; flex: none; }
#profileEditPreview {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 88px;
  height: 88px;
  border: 0;
  border-radius: 44px;
  background: #ccfbf1;
  color: #115e59;
  font: 700 32px Inter, sans-serif;
  box-shadow: none;
  overflow: hidden;
}
#profileEditPage .profile-edit-camera-badge {
  position: absolute;
  right: -2px;
  bottom: -2px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 2px solid #f5f7f8;
  border-radius: 16px;
  background: #0f766e;
  color: #fff;
  cursor: pointer;
}
#profileEditPage .profile-edit-photo-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
#profileEditPage .profile-edit-change-photo {
  height: 44px;
  padding: 0 16px;
  border: 1px solid #0f766e;
  border-radius: 12px;
  background: #fff;
  color: #0f766e;
  font: 600 14px Inter, sans-serif;
  cursor: pointer;
}
#profileEditPage .profile-edit-change-photo:hover { background: #f0fdfa; }
#profileEditPage .profile-edit-remove-photo {
  height: 44px;
  padding: 0 4px;
  border: 0;
  background: none;
  color: #b91c1c;
  font: 600 14px Inter, sans-serif;
  cursor: pointer;
}
#upiProfileStatus { margin: 0; color: #475569; font-size: 14px; line-height: 1.45; }
#upiProfileStatus.error { color: #b91c1c; }
#upiProfileStatus.success { color: #047857; }
#profileEditPage .profile-edit-field label {
  display: block;
  margin: 0 0 8px;
  color: #334155;
  font-size: 14px;
  font-weight: 600;
}
#profileEditPage .profile-edit-field input {
  width: 100%;
  height: 52px;
  min-height: 52px;
  padding: 0 14px;
  box-sizing: border-box;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: #fff;
  color: #0f172a;
  font: 400 16px Inter, sans-serif;
  outline: 0;
  box-shadow: none;
}
#profileEditPage .profile-edit-field input::placeholder { color: #64748b; }
#profileEditPage .profile-edit-field input:focus {
  border-color: #0f766e;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, .14);
}
#profileEditPage .profile-edit-hint { margin: 6px 0 0; color: #475569; font-size: 14px; }
#toggleMyUpiQrBtn {
  margin-top: 8px;
  padding: 0;
  min-height: 36px;
  border: 0;
  background: none;
  color: #0f766e;
  font: 600 14px Inter, sans-serif;
  cursor: pointer;
}
#profileEditPage .upi-qr-wrap { margin-top: 12px; border: 1px solid #e2e8f0; }
#profileEditPage .profile-edit-footer {
  position: sticky;
  bottom: 0;
  padding: 12px 20px max(32px, env(safe-area-inset-bottom));
  border-top: 1px solid #e2e8f0;
  background: #fff;
}
#saveProfileBtn {
  position: relative;
  overflow: hidden;
  display: block;
  width: min(100%, 600px);
  height: 52px;
  min-height: 52px;
  margin: 0 auto;
  padding: 0 20px;
  border: 0;
  border-radius: 14px;
  background: #0f766e;
  color: #fff;
  font: 600 16px Inter, sans-serif;
  box-shadow: none;
  cursor: pointer;
}
#saveProfileBtn:hover:not(:disabled) { background: #115e59; }
#saveProfileBtn:disabled { opacity: .65; cursor: wait; }
#profileEditPage button { transition: transform .15s ease, background-color .15s ease; }
#profileEditPage button:active { transform: scale(.96); }
#profileEditPage :is(button, input):focus-visible { outline: 3px solid #0f766e; outline-offset: 2px; }
@media (max-width: 700px) {
  #profileEditPage .profile-edit-header { padding-top: max(52px, env(safe-area-inset-top)); }
}
@keyframes rmSweep { 0% { transform: translateX(-120%) skewX(-20deg); } 55%, 100% { transform: translateX(320%) skewX(-20deg); } }
@media (prefers-reduced-motion: no-preference) {
  #profileEditPage:not(.hidden) .profile-edit-avatar,
  #profileEditPage:not(.hidden) .profile-edit-camera-badge { animation: rmPop .5s ease .2s both; }
  #saveProfileBtn::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 60px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .3), transparent);
    animation: rmSweep 4s ease-in-out 1.5s infinite;
    pointer-events: none;
  }
}

/* Login (animated) reference, preserving RoomMate app name and logo. */
#authSection.auth-screen {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: stretch;
  min-height: 100dvh;
  padding: 0;
  background: #f5f7f8;
  font-family: Inter, sans-serif;
  color: #0f172a;
  overflow: hidden;
}
#authSection.hidden { display: none; }
#authSection .auth-blobs { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
#authSection .auth-blob { position: absolute; border-radius: 999px; }
#authSection .auth-blob-a { left: -60px; top: -40px; width: 260px; height: 260px; background: #5eead4; opacity: .45; filter: blur(50px); }
#authSection .auth-blob-b { right: -70px; top: 120px; width: 240px; height: 240px; background: #bae6fd; opacity: .55; filter: blur(50px); }
#authSection .auth-blob-c { left: 40px; bottom: -80px; width: 280px; height: 280px; background: #a7f3d0; opacity: .5; filter: blur(55px); }
#authSection .auth-card {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(430px, 100%);
  min-height: 100dvh;
  margin: 0 auto;
  padding: max(72px, calc(env(safe-area-inset-top) + 48px)) 24px max(32px, env(safe-area-inset-bottom));
  box-sizing: border-box;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
#authSection .auth-brand-hero { display: flex; flex-direction: column; align-items: center; text-align: center; }
#authSection .auth-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  width: auto;
  margin: 0;
  text-decoration: none;
  color: #0f172a;
}
#authSection .auth-logo-wrap { position: relative; display: block; width: 88px; height: 88px; }
#authSection .auth-logo-ring { position: absolute; inset: 0; z-index: 1; border-radius: 26px; background: #0f766e; }
#authSection .auth-logo {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 88px;
  height: 88px;
  border: 0;
  border-radius: 26px;
  background: transparent;
  box-shadow: 0 12px 28px rgba(15, 118, 110, .32);
  overflow: hidden;
}
#authSection .auth-logo img { display: block; width: 100%; height: 100%; border-radius: inherit; object-fit: cover; }
#authSection .auth-brand .brand-copy {
  display: grid;
  justify-items: center;
  gap: 2px;
  margin-top: 20px;
  font: 700 30px/1.15 Inter, sans-serif;
  letter-spacing: -.02em;
  color: #0f172a;
}
#authSection .auth-brand .brand-accent { color: #0f766e; }
#authSection .auth-brand .brand-credit {
  color: #475569;
  font: 600 10px/1.2 Inter, sans-serif;
  letter-spacing: .06em;
  text-transform: uppercase;
}
#authSection .auth-subtitle { margin: 6px 0 0; color: #475569; font-size: 16px; line-height: 1.4; }
#authSection #authForm { display: flex; flex-direction: column; gap: 16px; margin-top: 40px; }
#authSection #authForm .auth-field.hidden,
#authSection #profilePhotoGroup.hidden,
#authSection .auth-forgot-row.hidden,
#authSection .auth-switch-prompt.hidden { display: none; }
#authSection #authForm label { display: block; margin: 0 0 8px; color: #334155; font-size: 14px; font-weight: 600; }
#authSection .auth-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 54px;
  padding: 0 14px;
  box-sizing: border-box;
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  background: #fff;
  color: #475569;
  transition: border-color .15s ease, box-shadow .15s ease;
}
#authSection .auth-input-wrap-password { padding: 0 6px 0 14px; }
#authSection .auth-input-wrap:focus-within {
  border: 1.5px solid #0f766e;
  box-shadow: 0 0 0 4px rgba(15, 118, 110, .12);
}
#authSection .auth-input-wrap svg { flex: none; color: #475569; }
#authSection #authForm .auth-input-wrap input {
  flex: 1;
  min-width: 0;
  height: 100%;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: #0f172a;
  font: 400 16px Inter, sans-serif;
  outline: 0;
}
#authSection #authForm .auth-input-wrap input::placeholder { color: #64748b; letter-spacing: normal; }
#authSection #authForm #password[type="password"] { letter-spacing: 2px; }
#authSection #authForm #password[type="password"]::placeholder { letter-spacing: 2px; }
#authSection .auth-password-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex: none;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: none;
  color: #475569;
  cursor: pointer;
}
#authSection .auth-password-toggle:hover { background: #f1f5f9; color: #0f172a; }
#authSection .auth-forgot-row { text-align: right; margin-top: 2px; }
#authSection .auth-forgot-btn {
  min-height: 44px;
  padding: 0 2px;
  border: 0;
  background: none;
  color: #0f766e;
  font: 600 14px Inter, sans-serif;
  cursor: pointer;
}
#authSection .auth-forgot-btn:hover { color: #115e59; text-decoration: underline; }
#authSection .profile-photo-field { padding: 12px 14px; border: 1px solid #cbd5e1; border-radius: 14px; background: #fff; }
#authSection .profile-photo-field input[type="file"] { color: #334155; font-size: 13px; background: #f8fafc; border-radius: 10px; }
#authSection .profile-photo-field small,
#authSection .optional-label { color: #475569; }
#authSection .auth-submit-wrap { margin-top: 4px; }
#authSection .auth-submit-btn {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: 56px;
  padding: 0 20px;
  border: 0;
  border-radius: 16px;
  background: #0f766e;
  color: #fff;
  font: 600 16px Inter, sans-serif;
  box-shadow: 0 10px 24px rgba(15, 118, 110, .3);
  cursor: pointer;
  transition: transform .15s ease, background-color .15s ease;
}
#authSection .auth-submit-btn:hover:not(:disabled) { background: #115e59; }
#authSection .auth-submit-btn:active:not(:disabled) { transform: scale(.97); }
#authSection .auth-submit-btn:disabled { opacity: .65; cursor: wait; }
#authSection .auth-btn-shine {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 60px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .35), transparent);
  transform: skewX(-20deg);
  pointer-events: none;
}
#authSection .auth-message { margin: 0; text-align: center; font-size: 14px; color: #475569; }
#authSection .auth-message.error { color: #b91c1c; }
#authSection .auth-message.success { color: #047857; }
#authSection .auth-footer-spacer { flex: 1; min-height: 24px; }
#authSection .auth-switch-area { text-align: center; font-size: 14px; color: #475569; }
#authSection .auth-switch-prompt { margin: 0; }
#authSection .auth-switch-btn {
  min-height: 44px;
  padding: 0 4px;
  border: 0;
  background: none;
  color: #0f766e;
  font: 700 14px Inter, sans-serif;
  cursor: pointer;
}
#authSection .auth-back-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  margin-top: 2px;
  padding: 0 8px;
  border: 0;
  background: none;
  color: #64748b;
  font: 500 13px Inter, sans-serif;
  cursor: pointer;
}
#authSection .auth-back-link:hover { color: #0f172a; }
#authSection :is(button, input, a):focus-visible { outline: 3px solid #0f766e; outline-offset: 2px; }
@keyframes authFadeUp { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes authFloatA { 0%, 100% { transform: translate(0, 0) scale(1); } 50% { transform: translate(24px, 18px) scale(1.08); } }
@keyframes authFloatB { 0%, 100% { transform: translate(0, 0) scale(1); } 50% { transform: translate(-22px, -20px) scale(1.1); } }
@keyframes authPop { 0% { opacity: 0; transform: scale(.5) rotate(-8deg); } 70% { opacity: 1; transform: scale(1.08) rotate(2deg); } 100% { opacity: 1; transform: none; } }
@keyframes authRing { 0% { transform: scale(1); opacity: .45; } 100% { transform: scale(1.7); opacity: 0; } }
@keyframes authBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes authShine { 0% { transform: translateX(-120%) skewX(-20deg); } 60%, 100% { transform: translateX(620%) skewX(-20deg); } }
@media (prefers-reduced-motion: no-preference) {
  #authSection:not(.hidden) .auth-blob-a,
  #authSection:not(.hidden) .auth-blob-c { animation: authFloatA 9s ease-in-out infinite; }
  #authSection:not(.hidden) .auth-blob-b { animation: authFloatB 11s ease-in-out infinite; }
  #authSection:not(.hidden) .auth-logo { animation: authPop .8s cubic-bezier(.2, .9, .3, 1.2) .1s backwards; }
  #authSection:not(.hidden) .auth-logo-wrap { animation: authBob 4s ease-in-out 1.2s infinite; }
  #authSection:not(.hidden) .auth-logo-ring { animation: authRing 2.8s ease-out 1s infinite; }
  #authSection:not(.hidden) .auth-fu { animation: authFadeUp .7s cubic-bezier(.2, .8, .2, 1) backwards; }
  #authSection:not(.hidden) .auth-delay-1 { animation-delay: .5s; }
  #authSection:not(.hidden) .auth-delay-2 { animation-delay: .65s; }
  #authSection:not(.hidden) .auth-delay-3 { animation-delay: .85s; }
  #authSection:not(.hidden) .auth-delay-4 { animation-delay: 1s; }
  #authSection:not(.hidden) .auth-delay-5 { animation-delay: 1.15s; }
  #authSection:not(.hidden) .auth-delay-6 { animation-delay: 1.3s; }
  #authSection:not(.hidden) .auth-btn-shine { animation: authShine 3.2s ease-in-out 1.8s infinite; }
}
@media (prefers-reduced-motion: reduce) {
  #authSection .auth-fu, #authSection .auth-logo { opacity: 1 !important; animation: none !important; }
  #authSection .auth-blob, #authSection .auth-logo-ring, #authSection .auth-logo-wrap, #authSection .auth-btn-shine, #authSection .auth-strength-fill { animation: none !important; }
}

/* Create account (animated) mode overrides, keeping RoomMate app name and logo. */
#authSection.is-signup .auth-card {
  padding-top: max(48px, calc(env(safe-area-inset-top) + 20px));
}
#authSection .auth-signup-back-row { margin: 0 -12px 4px; }
#authSection .auth-signup-back-row.hidden,
#authSection .auth-signup-header.hidden,
#authSection .auth-subtitle.hidden,
#authSection .auth-strength-meter.hidden,
#authSection .auth-terms-row.hidden { display: none; }
#authSection .auth-signup-back-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 22px;
  background: none;
  color: #0f172a;
  cursor: pointer;
}
#authSection .auth-signup-back-btn:hover { background: rgba(15, 23, 42, .06); }
#authSection.is-signup .auth-brand-hero { align-items: flex-start; text-align: left; }
#authSection.is-signup .auth-brand {
  flex-direction: row;
  align-items: center;
  gap: 12px;
}
#authSection.is-signup .auth-logo-wrap,
#authSection.is-signup .auth-logo {
  width: 56px;
  height: 56px;
  border-radius: 18px;
}
#authSection.is-signup .auth-logo-ring { display: none; }
#authSection.is-signup .auth-logo { box-shadow: 0 8px 20px rgba(15, 118, 110, .3); }
#authSection.is-signup .auth-brand .brand-copy {
  justify-items: start;
  margin-top: 0;
  font-size: 22px;
}
#authSection .auth-signup-header h1 {
  margin: 16px 0 0;
  color: #0f172a;
  font: 700 28px/1.2 Inter, sans-serif;
}
#authSection .auth-signup-header .auth-subtitle { margin-top: 4px; }
#authSection.is-signup #authForm { margin-top: 28px; }
#authSection .auth-strength-meter { margin-top: -6px; }
#authSection .auth-strength-bars { display: flex; gap: 6px; }
#authSection .auth-strength-track { flex: 1; height: 6px; border-radius: 3px; background: #e2e8f0; overflow: hidden; }
#authSection .auth-strength-fill { width: 0; height: 6px; border-radius: 3px; background: #0f766e; transition: width .28s ease, background-color .28s ease; }
#authSection .auth-strength-meter[data-strength="1"] .auth-strength-track:nth-child(1) .auth-strength-fill { width: 100%; background: #b91c1c; }
#authSection .auth-strength-meter[data-strength="2"] .auth-strength-track:nth-child(-n+2) .auth-strength-fill { width: 100%; background: #d97706; }
#authSection .auth-strength-meter[data-strength="3"] .auth-strength-track:nth-child(-n+3) .auth-strength-fill { width: 100%; background: #0f766e; }
#authSection .auth-strength-meter[data-strength="4"] .auth-strength-track .auth-strength-fill { width: 100%; background: #047857; }
#authSection .auth-strength-text { margin: 6px 0 0; color: #475569; font-size: 13px; }
#authSection .auth-terms-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  margin: 0 !important;
  cursor: pointer;
}
#authSection .auth-terms-row input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 22px;
  height: 22px;
  margin: 0;
  cursor: pointer;
}
#authSection .auth-terms-box {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex: none;
  border: 1.5px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  transition: background-color .15s ease, border-color .15s ease;
}
#authSection .auth-terms-box svg { opacity: 0; transition: opacity .15s ease; }
#authSection .auth-terms-row input:checked + .auth-terms-box { border-color: #0f766e; background: #0f766e; }
#authSection .auth-terms-row input:checked + .auth-terms-box svg { opacity: 1; }
#authSection .auth-terms-row input:focus-visible + .auth-terms-box { outline: 3px solid #0f766e; outline-offset: 2px; }
#authSection .auth-terms-copy { color: #334155; font-size: 14px; font-weight: 400; line-height: 1.35; }
#authSection .auth-terms-copy b { color: #0f766e; font-weight: 700; }
@media (prefers-reduced-motion: no-preference) {
  #authSection.is-signup .auth-delay-2b { animation-delay: .4s; }
}

/* Household setup (Create or join) reference. */
#dashboard:has(#setupSection:not(.hidden)) :is(.sidebar, .topbar, .mobile-quick-add, .smart-assistant-toggle, .smart-assistant-widget, #welcomeRow, #dashboardMessage) { display: none !important; }
#dashboard:has(#setupSection:not(.hidden)) .app-content { margin-left: 0 !important; margin-bottom: 0 !important; background: #f5f7f8; }
#dashboard:has(#setupSection:not(.hidden)) .dashboard-main { padding: 0 !important; }
#setupSection.setup-screen {
  position: relative;
  display: flex;
  justify-content: center;
  min-height: 100dvh;
  width: 100%;
  background: #f5f7f8;
  font-family: Inter, sans-serif;
  color: #0f172a;
  overflow: hidden;
}
#setupSection.hidden { display: none; }
#setupSection .setup-blobs { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
#setupSection .setup-blob { position: absolute; border-radius: 999px; }
#setupSection .setup-blob-a { left: -60px; top: -50px; width: 240px; height: 240px; background: #5eead4; opacity: .4; filter: blur(50px); }
#setupSection .setup-blob-b { right: -70px; top: 200px; width: 220px; height: 220px; background: #bae6fd; opacity: .5; filter: blur(50px); }
#setupSection .setup-blob-c { left: 60px; bottom: -90px; width: 260px; height: 260px; background: #a7f3d0; opacity: .5; filter: blur(55px); }
#setupSection .setup-shell {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(440px, 100%);
  min-height: 100dvh;
  margin: 0 auto;
  padding: max(44px, calc(env(safe-area-inset-top) + 20px)) 24px max(28px, env(safe-area-inset-bottom));
  box-sizing: border-box;
}
#setupSection .setup-back-row { margin: 0 -12px; }
#setupSection .setup-back-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 22px;
  background: none;
  color: #0f172a;
  cursor: pointer;
}
#setupSection .setup-back-btn:hover { background: rgba(15, 23, 42, .06); }
#setupSection .setup-step-label { margin: 4px 0 0; color: #0f766e; font-size: 13px; font-weight: 600; }
#setupSection .setup-progress-bars { display: flex; gap: 6px; margin-top: 8px; }
#setupSection .setup-progress-bar { flex: 1; height: 6px; border-radius: 3px; background: #0f766e; }
#setupSection .setup-title { margin: 20px 0 0; color: #0f172a; font: 700 28px/1.2 Inter, sans-serif; }
#setupSection .setup-subtitle { margin: 4px 0 0; color: #475569; font-size: 16px; line-height: 1.4; }
#setupSection .setup-mode-cards { display: flex; flex-direction: column; gap: 12px; margin-top: 24px; }
#setupSection .setup-mode-card {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 16px;
  border: 1px solid #cbd5e1;
  border-radius: 18px;
  background: #fff;
  color: #0f172a;
  text-align: left;
  font-family: inherit;
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
#setupSection .setup-mode-card:active { transform: scale(.985); }
#setupSection .setup-mode-card.is-selected {
  border: 1.5px solid #0f766e;
  box-shadow: 0 0 0 4px rgba(15, 118, 110, .12);
}
#setupSection .setup-mode-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 22px;
  background: #ccfbf1;
  color: #115e59;
}
#setupSection .setup-mode-copy { flex: 1; min-width: 0; }
#setupSection .setup-mode-copy strong { display: block; color: #0f172a; font-size: 16px; font-weight: 600; }
#setupSection .setup-mode-copy small { display: block; margin-top: 2px; color: #475569; font-size: 14px; }
#setupSection .setup-mode-chevron { flex: none; color: #475569; }
#setupSection .setup-form { display: flex; flex: 1; flex-direction: column; margin-top: 20px; }
#setupSection .setup-form.hidden { display: none; }
#setupSection .setup-field label { display: block; margin: 0 0 8px; color: #334155; font-size: 14px; font-weight: 600; }
#setupSection .setup-input-wrap {
  display: flex;
  align-items: center;
  height: 54px;
  padding: 0 14px;
  box-sizing: border-box;
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  background: #fff;
  transition: border-color .15s ease, box-shadow .15s ease;
}
#setupSection .setup-input-wrap:focus-within {
  border: 1.5px solid #0f766e;
  box-shadow: 0 0 0 4px rgba(15, 118, 110, .12);
}
#setupSection .setup-input-wrap input {
  width: 100%;
  min-width: 0;
  height: 100%;
  border: 0;
  background: transparent;
  color: #0f172a;
  font: 400 16px Inter, sans-serif;
  outline: 0;
}
#setupSection .setup-input-wrap input::placeholder { color: #64748b; }
#setupSection .setup-code-field { position: relative; }
#setupSection .setup-code-native {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 52px;
  margin: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  font-size: 16px;
  cursor: text;
}
#setupSection .setup-code-boxes { display: flex; gap: 6px; }
#setupSection .setup-code-box {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  height: 52px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: #fff;
  color: #115e59;
  font: 700 20px Inter, sans-serif;
  transition: border-color .15s ease, box-shadow .15s ease;
}
#setupSection .setup-code-box.is-active {
  border: 1.5px solid #0f766e;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, .12);
}
#setupSection .setup-caret { display: inline-block; width: 2px; height: 22px; background: #0f766e; animation: setupBlink 1s steps(1) infinite; }
#setupSection .setup-spacer { flex: 1; min-height: 24px; }
#setupSection .setup-submit-btn {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: 56px;
  padding: 0 20px;
  border: 0;
  border-radius: 16px;
  background: #0f766e;
  color: #fff;
  font: 600 16px Inter, sans-serif;
  box-shadow: 0 10px 24px rgba(15, 118, 110, .3);
  cursor: pointer;
  transition: transform .15s ease, background-color .15s ease;
}
#setupSection .setup-submit-btn:hover:not(:disabled) { background: #115e59; }
#setupSection .setup-submit-btn:active:not(:disabled) { transform: scale(.97); }
#setupSection .setup-btn-shine {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 60px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .35), transparent);
  transform: skewX(-20deg);
  pointer-events: none;
}
#setupSection .setup-message { margin: 10px 0 0; text-align: center; font-size: 14px; color: #475569; }
#setupSection .setup-message.error { color: #b91c1c; }
#setupSection .setup-message.success { color: #047857; }
#setupSection .setup-skip-row { text-align: center; margin-top: 4px; }
#setupSection .setup-skip-btn {
  min-height: 44px;
  padding: 0 8px;
  border: 0;
  background: none;
  color: #475569;
  font: 600 14px Inter, sans-serif;
  cursor: pointer;
}
#setupSection .setup-skip-btn:hover { color: #0f172a; }
#setupSection :is(button, input):focus-visible { outline: 3px solid #0f766e; outline-offset: 2px; }
@keyframes setupPop { 0% { opacity: 0; transform: scale(.5); } 70% { opacity: 1; transform: scale(1.1); } 100% { opacity: 1; transform: none; } }
@keyframes setupBlink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }
@media (prefers-reduced-motion: no-preference) {
  #setupSection:not(.hidden) .setup-blob-a,
  #setupSection:not(.hidden) .setup-blob-c { animation: authFloatA 9s ease-in-out infinite; }
  #setupSection:not(.hidden) .setup-blob-b { animation: authFloatB 11s ease-in-out infinite; }
  #setupSection:not(.hidden) .setup-fu { animation: authFadeUp .7s cubic-bezier(.2, .8, .2, 1) backwards; }
  #setupSection:not(.hidden) .setup-delay-1 { animation-delay: .1s; }
  #setupSection:not(.hidden) .setup-delay-2 { animation-delay: .2s; }
  #setupSection:not(.hidden) .setup-delay-3 { animation-delay: .3s; }
  #setupSection:not(.hidden) .setup-delay-4 { animation-delay: .4s; }
  #setupSection:not(.hidden) .setup-delay-5 { animation-delay: .55s; }
  #setupSection:not(.hidden) .setup-delay-6 { animation-delay: .7s; }
  #setupSection:not(.hidden) .setup-delay-7 { animation-delay: .8s; }
  #setupSection:not(.hidden) .setup-delay-8 { animation-delay: 1.6s; }
  #setupSection:not(.hidden) .setup-delay-9 { animation-delay: 1.7s; }
  #setupSection:not(.hidden) .setup-pp { animation: setupPop .5s cubic-bezier(.2, .9, .3, 1.2) backwards; }
  #setupSection:not(.hidden) .setup-pp-1 { animation-delay: .90s; }
  #setupSection:not(.hidden) .setup-pp-2 { animation-delay: .98s; }
  #setupSection:not(.hidden) .setup-pp-3 { animation-delay: 1.06s; }
  #setupSection:not(.hidden) .setup-pp-4 { animation-delay: 1.14s; }
  #setupSection:not(.hidden) .setup-pp-5 { animation-delay: 1.22s; }
  #setupSection:not(.hidden) .setup-pp-6 { animation-delay: 1.30s; }
  #setupSection:not(.hidden) .setup-pp-7 { animation-delay: 1.38s; }
  #setupSection:not(.hidden) .setup-pp-8 { animation-delay: 1.46s; }
  #setupSection:not(.hidden) .setup-btn-shine { animation: authShine 3.2s ease-in-out 2s infinite; }
}
@media (prefers-reduced-motion: reduce) {
  #setupSection .setup-fu, #setupSection .setup-pp { opacity: 1 !important; animation: none !important; }
  #setupSection .setup-blob, #setupSection .setup-btn-shine, #setupSection .setup-caret { animation: none !important; }
}

/* Forgot password reference. */
#authSection .auth-card.hidden,
#authSection .auth-forgot-card.hidden { display: none; }
#authSection .auth-forgot-card {
  padding-top: max(48px, calc(env(safe-area-inset-top) + 20px));
}
#authSection .forgot-hero {
  display: flex;
  justify-content: center;
  margin-top: 36px;
}
#authSection .forgot-bob { position: relative; width: 104px; height: 104px; }
#authSection .forgot-ring {
  position: absolute;
  inset: 0;
  border-radius: 52px;
  background: #0f766e;
}
#authSection .forgot-badge {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 104px;
  height: 104px;
  border-radius: 52px;
  background: #ccfbf1;
  color: #115e59;
}
#authSection .forgot-wig {
  display: flex;
  align-items: center;
  justify-content: center;
  transform-origin: 50% 60%;
}
#authSection .forgot-title {
  margin: 28px 0 0;
  text-align: center;
  color: #0f172a;
  font: 700 28px/1.2 Inter, sans-serif;
}
#authSection .forgot-subtitle {
  margin: 8px 8px 0;
  text-align: center;
  color: #475569;
  font-size: 16px;
  line-height: 1.4;
}
#authSection .forgot-form {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 14px;
  margin-top: 28px;
}
#authSection .forgot-form label {
  display: block;
  margin: 0 0 8px;
  color: #334155;
  font-size: 14px;
  font-weight: 600;
}
#authSection .forgot-back-row {
  text-align: center;
  margin-top: 4px;
}
#authSection .forgot-back-login-btn {
  min-height: 44px;
  padding: 0 8px;
  border: 0;
  background: none;
  color: #0f766e;
  font: 700 14px Inter, sans-serif;
  cursor: pointer;
}
#authSection .forgot-back-login-btn:hover { color: #115e59; text-decoration: underline; }
@keyframes forgotWiggle { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-8deg); } 75% { transform: rotate(8deg); } }
@keyframes forgotRing { 0% { transform: scale(1); opacity: .35; } 100% { transform: scale(1.7); opacity: 0; } }
@keyframes forgotBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@media (prefers-reduced-motion: no-preference) {
  #authSection.is-forgot:not(.hidden) .forgot-bob { animation: forgotBob 4s ease-in-out 1.2s infinite; }
  #authSection.is-forgot:not(.hidden) .forgot-ring { animation: forgotRing 2.8s ease-out 1s infinite; }
  #authSection.is-forgot:not(.hidden) .forgot-badge { animation: authPop .6s cubic-bezier(.2, .9, .3, 1.2) .1s backwards; }
  #authSection.is-forgot:not(.hidden) .forgot-wig { animation: forgotWiggle 3s ease-in-out 1.5s infinite; }
  #authSection.is-forgot:not(.hidden) .forgot-delay-1 { animation-delay: .3s; }
  #authSection.is-forgot:not(.hidden) .forgot-delay-2 { animation-delay: .4s; }
  #authSection.is-forgot:not(.hidden) .forgot-delay-3 { animation-delay: .6s; }
  #authSection.is-forgot:not(.hidden) .forgot-delay-4 { animation-delay: .8s; }
  #authSection.is-forgot:not(.hidden) .forgot-delay-5 { animation-delay: .95s; }
}
@media (prefers-reduced-motion: reduce) {
  #authSection .forgot-bob, #authSection .forgot-ring, #authSection .forgot-badge, #authSection .forgot-wig { animation: none !important; }
}

/* Check your email (OTP) reference. */
#authSection .auth-email-sent-card.hidden { display: none; }
#authSection .auth-email-sent-card {
  padding-top: max(48px, calc(env(safe-area-inset-top) + 20px));
}
#authSection .email-sent-bob { position: relative; width: 104px; height: 104px; }
#authSection .email-sent-ring {
  position: absolute;
  inset: 0;
  border-radius: 52px;
  background: #0f766e;
}
#authSection .email-sent-badge {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 104px;
  height: 104px;
  border-radius: 52px;
  background: #ccfbf1;
}
#authSection .forgot-subtitle b { color: #0f172a; }
#authSection .email-sent-form {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 14px;
  margin-top: 24px;
}
#authSection .email-sent-form label {
  display: block;
  margin: 0 0 8px;
  color: #334155;
  font-size: 14px;
  font-weight: 600;
}
#authSection .email-sent-otp-field { position: relative; }
#authSection .email-sent-otp-native {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 54px;
  margin: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  font-size: 16px;
  cursor: text;
}
#authSection .email-sent-otp-boxes { display: flex; gap: 8px; }
#authSection .email-sent-otp-box {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  height: 54px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: #fff;
  color: #115e59;
  font: 700 22px Inter, sans-serif;
  transition: border-color .15s ease, box-shadow .15s ease;
}
#authSection .email-sent-otp-box.is-active {
  border: 1.5px solid #0f766e;
  box-shadow: 0 0 0 4px rgba(15, 118, 110, .12);
}
#authSection .email-sent-caret {
  display: inline-block;
  width: 2px;
  height: 22px;
  background: #0f766e;
  animation: setupBlink 1s steps(1) infinite;
}
#authSection .email-sent-tip {
  padding: 14px 16px;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  background: #fff;
  color: #475569;
  font-size: 14px;
  line-height: 1.45;
}
#authSection .email-sent-resend-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  margin-top: 4px;
  color: #475569;
  font-size: 14px;
}
#authSection .email-sent-resend-btn {
  min-height: 44px;
  padding: 0 4px;
  border: 0;
  background: none;
  color: #0f766e;
  font: 700 14px Inter, sans-serif;
  cursor: pointer;
}
#authSection .email-sent-resend-btn:disabled {
  color: #475569;
  cursor: default;
}
@keyframes emailLetterSlide { from { transform: translateY(16px); } to { transform: translateY(-10px); } }
@media (prefers-reduced-motion: no-preference) {
  #authSection.is-email-sent:not(.hidden) .email-sent-bob { animation: forgotBob 4s ease-in-out 1.2s infinite; }
  #authSection.is-email-sent:not(.hidden) .email-sent-ring { animation: forgotRing 2.8s ease-out 1s infinite; }
  #authSection.is-email-sent:not(.hidden) .email-sent-badge { animation: authPop .6s cubic-bezier(.2, .9, .3, 1.2) .1s backwards; }
  #authSection.is-email-sent:not(.hidden) .email-sent-letter { animation: emailLetterSlide .9s ease .7s both; }
  #authSection.is-email-sent:not(.hidden) .email-sent-pp { animation: setupPop .5s cubic-bezier(.2, .9, .3, 1.2) backwards; }
  #authSection.is-email-sent:not(.hidden) .email-sent-pp-1 { animation-delay: .50s; }
  #authSection.is-email-sent:not(.hidden) .email-sent-pp-2 { animation-delay: .56s; }
  #authSection.is-email-sent:not(.hidden) .email-sent-pp-3 { animation-delay: .62s; }
  #authSection.is-email-sent:not(.hidden) .email-sent-pp-4 { animation-delay: .68s; }
  #authSection.is-email-sent:not(.hidden) .email-sent-pp-5 { animation-delay: .74s; }
  #authSection.is-email-sent:not(.hidden) .email-sent-pp-6 { animation-delay: .80s; }
  #authSection.is-email-sent:not(.hidden) .email-sent-delay-1 { animation-delay: .3s; }
  #authSection.is-email-sent:not(.hidden) .email-sent-delay-2 { animation-delay: .4s; }
  #authSection.is-email-sent:not(.hidden) .email-sent-delay-3 { animation-delay: .5s; }
  #authSection.is-email-sent:not(.hidden) .email-sent-delay-3b { animation-delay: .65s; }
  #authSection.is-email-sent:not(.hidden) .email-sent-delay-4 { animation-delay: .85s; }
  #authSection.is-email-sent:not(.hidden) .email-sent-delay-5 { animation-delay: .95s; }
  #authSection.is-email-sent:not(.hidden) .email-sent-delay-6 { animation-delay: 1.05s; }
}
@media (prefers-reduced-motion: reduce) {
  #authSection .email-sent-bob, #authSection .email-sent-ring, #authSection .email-sent-badge, #authSection .email-sent-letter, #authSection .email-sent-pp, #authSection .email-sent-caret { animation: none !important; }
}

/* Create new password after OTP verification (Set a new password reference). */
#authSection .auth-reset-card.hidden { display: none; }
#authSection .auth-reset-card {
  padding-top: max(48px, calc(env(safe-area-inset-top) + 20px));
}
#authSection .auth-reset-card .forgot-hero { margin-top: 36px; }
#authSection .auth-reset-card .forgot-badge { color: #115e59; }
#authSection .reset-form {
  margin-top: 24px;
  gap: 16px;
}
#authSection .reset-match-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: -6px;
  color: #047857;
  font-size: 14px;
  font-weight: 600;
}
#authSection .reset-match-row.hidden { display: none; }
#authSection .reset-match-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 10px;
  background: #d1fae5;
  color: #047857;
  flex-shrink: 0;
}
#authSection .reset-match-row.is-mismatch { color: #b91c1c; }
#authSection .reset-match-row.is-mismatch .reset-match-badge {
  background: #fee2e2;
  color: #b91c1c;
}
@media (prefers-reduced-motion: no-preference) {
  #authSection.is-reset-password:not(.hidden) .forgot-bob { animation: forgotBob 4s ease-in-out 1.2s infinite; }
  #authSection.is-reset-password:not(.hidden) .forgot-ring { animation: forgotRing 2.8s ease-out 1s infinite; }
  #authSection.is-reset-password:not(.hidden) .forgot-badge { animation: authPop .6s cubic-bezier(.2, .9, .3, 1.2) .1s backwards; }
  #authSection.is-reset-password:not(.hidden) .reset-delay-1 { animation-delay: .3s; }
  #authSection.is-reset-password:not(.hidden) .reset-delay-2 { animation-delay: .4s; }
  #authSection.is-reset-password:not(.hidden) .reset-delay-3 { animation-delay: .6s; }
  #authSection.is-reset-password:not(.hidden) .reset-delay-4 { animation-delay: 1s; }
  #authSection.is-reset-password:not(.hidden) .reset-delay-5 { animation-delay: .8s; }
  #authSection.is-reset-password:not(.hidden) .reset-delay-6 { animation-delay: 1.1s; }
  #authSection.is-reset-password:not(.hidden) .reset-delay-7 { animation-delay: 1.3s; }
}

/* Settlement cards inline actions + person/payment/review dialogs in light sheet design. */
#personalAccountPage .account-settlement-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
#personalAccountPage .account-settlement-person {
  flex: 1 1 0;
  min-width: 0;
  width: auto;
}
#personalAccountPage .account-settlement-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex: 0 0 auto;
}
#personalAccountPage .account-settlement-meta > strong {
  color: #0f172a;
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
}
#personalAccountPage .receivable-card .account-settlement-meta > strong {
  color: #047857;
}
#personalAccountPage .settlement-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 10px;
  font: 600 13px Inter, sans-serif;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease, opacity .15s ease;
}
#personalAccountPage .settlement-action-btn:disabled {
  opacity: .65;
  cursor: wait;
}
#personalAccountPage .settlement-pay-btn {
  border: 0;
  background: #0f766e;
  color: #fff;
  box-shadow: 0 4px 12px rgba(15, 118, 110, .18);
}
#personalAccountPage .settlement-pay-btn:hover:not(:disabled) {
  background: #115e59;
}
#personalAccountPage .settlement-remind-btn {
  border: 1px solid #99d5ca;
  background: #fff;
  color: #0f766e;
}
#personalAccountPage .settlement-remind-btn:hover:not(:disabled) {
  background: #f0fdfa;
  border-color: #0f766e;
}
#personalAccountPage .settlement-review-btn {
  border: 1px solid #6ee7b7;
  background: #ecfdf5;
  color: #047857;
}
#personalAccountPage .settlement-review-btn:hover:not(:disabled) {
  background: #d1fae5;
}
#personalAccountPage .settlement-pending-badge {
  border: 1px solid #fde68a;
  background: #fef3c7;
  color: #92400e;
}
#personalAccountPage .settlement-action-btn:focus-visible {
  outline: 3px solid rgba(15, 118, 110, .28);
  outline-offset: 2px;
}

:is(#personDetailsDialog, #paymentProofDialog, #paymentReviewDialog) {
  width: min(500px, calc(100vw - 24px));
  max-width: min(500px, calc(100vw - 24px));
  max-height: min(90dvh, 760px);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0;
  border: 1px solid #e2e8f0;
  border-radius: 24px;
  background: #f5f7f8;
  color: #0f172a;
  box-shadow: 0 24px 70px rgba(15, 23, 42, .22);
}
:is(#personDetailsDialog, #paymentProofDialog, #paymentReviewDialog)::backdrop {
  background: rgba(15, 23, 42, .48);
  backdrop-filter: blur(6px);
}
:is(#personDetailsDialog, #paymentProofDialog, #paymentReviewDialog) :is(.person-details-content, .payment-proof-content, .payment-review-content) {
  display: grid;
  gap: 14px;
  max-height: none;
  overflow: visible;
  padding: 22px 22px max(22px, env(safe-area-inset-bottom));
  border: 0;
  background: transparent;
  color: #0f172a;
}
:is(#personDetailsDialog, #paymentProofDialog, #paymentReviewDialog) .panel-kicker {
  margin: 0 0 2px;
  color: #0f766e;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
}
:is(#personDetailsDialog, #paymentProofDialog, #paymentReviewDialog) h2 {
  margin: 0;
  color: #0f172a;
  font: 700 20px/1.2 Inter, sans-serif;
}
:is(#personDetailsDialog, #paymentProofDialog, #paymentReviewDialog) .account-email,
:is(#personDetailsDialog, #paymentProofDialog, #paymentReviewDialog) .alert-dialog-copy {
  margin: 0;
  color: #475569;
  font-size: 14px;
  line-height: 1.45;
}
#personDetailsDialog .account-phone {
  width: fit-content;
  color: #0f766e;
  font-size: 13px;
  font-weight: 600;
}
#personDetailsDialog .person-details-amount {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 18px 20px;
  border: 0;
  border-radius: 20px;
  background: #0f766e;
  color: #fff;
  box-shadow: 0 12px 24px rgba(15, 118, 110, .16);
}
#personDetailsDialog .person-details-amount span { color: rgba(255, 255, 255, .9); font-size: 14px; }
#personDetailsDialog .person-details-amount strong { font: 700 36px/1.1 Inter, sans-serif; letter-spacing: -.03em; }
#personDetailsDialog .person-details-amount.is-payable {
  background: #fff7ed;
  color: #9a3412;
}
#personDetailsDialog .person-details-amount.is-payable span { color: #9a3412; }
#personDetailsDialog .person-details-amount.is-receivable {
  background: #ecfdf5;
  color: #065f46;
}
#personDetailsDialog .person-details-amount.is-receivable span { color: #065f46; }
#personDetailsDialog .person-details-amount.is-settled {
  background: #f8fafc;
  color: #334155;
}
#personDetailsDialog .person-details-amount.is-settled span { color: #475569; }
#personDetailsDialog .person-details-upi {
  margin: 0;
  padding: 10px 13px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  color: #334155;
  font-size: 13px;
  font-weight: 600;
}
#personDetailsDialog .person-sheet-handle {
  width: 40px;
  height: 4px;
  margin: 0 auto 2px;
  border-radius: 999px;
  background: #cbd5e1;
}
#personDetailsDialog .person-profile-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
#personDetailsDialog .person-details-heading {
  min-width: 0;
}
#personDetailsDialog .person-profile-close {
  display: inline-flex;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: #e2e8f0;
  color: #0f172a;
  cursor: pointer;
  transition: transform .15s ease, background .15s ease;
}
#personDetailsDialog .person-profile-close:hover { background: #cbd5e1; }
#personDetailsDialog .person-profile-close:active { transform: scale(.97); }
#personDetailsDialog .person-profile-close:focus-visible { outline: 3px solid rgba(15, 118, 110, .28); outline-offset: 2px; }
#personDetailsDialog .person-debt-details {
  display: grid;
  gap: 12px;
  max-height: none;
  overflow: visible;
  padding: 14px;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  background: #fff;
}
#personDetailsDialog .person-debt-header {
  display: grid;
  gap: 4px;
}
#personDetailsDialog .person-debt-details h3 {
  margin: 0;
  color: #0f172a;
  font: 700 14px Inter, sans-serif;
}
#personDetailsDialog .person-debt-explain-note {
  margin: 0;
  color: #475569;
  font-size: 12.5px;
  line-height: 1.45;
}
#personDetailsDialog .person-debt-balance-summary {
  display: grid;
  gap: 9px;
  padding: 11px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
}
#personDetailsDialog .person-debt-balance-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  color: #334155;
  font-size: 12.5px;
  line-height: 1.4;
}
#personDetailsDialog .person-debt-balance-label {
  display: grid;
  gap: 2px;
  min-width: 0;
}
#personDetailsDialog .person-debt-balance-label small {
  color: #64748b;
  font-size: 11px;
  font-weight: 500;
}
#personDetailsDialog .person-debt-balance-row strong {
  color: #0f172a;
  white-space: nowrap;
  font-weight: 700;
}
#personDetailsDialog .person-debt-tone-credit { color: #047857 !important; }
#personDetailsDialog .person-debt-tone-owes { color: #b91c1c !important; }
#personDetailsDialog .person-debt-tone-final { color: #0f766e !important; }
#personDetailsDialog .person-debt-balance-row.final {
  margin-top: 2px;
  padding-top: 9px;
  border-top: 1.5px dashed #cbd5e1;
  color: #0f172a;
  font-size: 13.5px;
  font-weight: 700;
}
#personDetailsDialog .person-debt-pending-note {
  margin: 2px 0 0;
  padding: 9px 11px;
  border: 1px solid #fde68a;
  border-radius: 10px;
  background: #fffbeb;
  color: #92400e;
  font-size: 12px;
  line-height: 1.45;
}
#personDetailsDialog .person-debt-breakdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
#personDetailsDialog .person-debt-expense-list {
  display: grid;
  gap: 8px;
}
#personDetailsDialog .person-debt-expense {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fcfcfd;
}
#personDetailsDialog .person-debt-expense-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
}
#personDetailsDialog .person-debt-expense-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}
#personDetailsDialog .person-debt-expense-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
#personDetailsDialog .person-debt-expense strong {
  color: #0f172a;
  font-size: 13px;
}
#personDetailsDialog .person-debt-kind-badge {
  padding: 2px 7px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
}
#personDetailsDialog .person-debt-expense-math {
  margin: 0;
  color: #334155;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
}
#personDetailsDialog .person-debt-expense-meta {
  margin: 0;
  color: #64748b;
  font-size: 11.5px;
  line-height: 1.35;
}
#personDetailsDialog .person-debt-expense-impact {
  flex: 0 0 auto;
  display: grid;
  gap: 2px;
  text-align: right;
}
#personDetailsDialog .person-debt-expense-impact strong {
  font-size: 13.5px;
  white-space: nowrap;
}
#personDetailsDialog .person-debt-expense-impact span {
  color: #64748b;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}
#personDetailsDialog .person-debt-expense-actions .person-debt-edit-button {
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #0f766e;
}
#personDetailsDialog .person-debt-expense-actions .person-debt-delete-button {
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: #b91c1c;
}
:is(#personDetailsDialog, #paymentProofDialog, #paymentReviewDialog) label,
#paymentProofDialog .upi-app-picker-label {
  color: #0f172a;
  font-size: 13px;
  font-weight: 600;
}
#paymentProofDialog input[type="number"] {
  min-height: 46px;
  padding: 10px 14px;
  border: 1.5px solid #cbd5e1;
  border-radius: 12px;
  background: #fff;
  color: #0f172a;
  font: 600 16px Inter, sans-serif;
}
#paymentProofDialog input[type="number"]:focus {
  border-color: #0f766e;
  box-shadow: 0 0 0 4px rgba(15, 118, 110, .12);
}
#paymentProofDialog input[type="file"] {
  padding: 10px 12px;
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  background: #fff;
  color: #334155;
  font-size: 13px;
}
#paymentProofDialog .upi-app-link {
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: #fff;
  color: #0f172a;
  font: 600 13px Inter, sans-serif;
  box-shadow: none;
}
#paymentProofDialog .upi-app-link:hover {
  border-color: #0f766e;
  background: #f0fdfa;
  color: #115e59;
}
#paymentProofDialog .upi-app-link[aria-disabled="true"] {
  opacity: .5;
  cursor: not-allowed;
}
:is(#personDetailsDialog, #paymentProofDialog) .upi-qr-wrap {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #fff;
}
:is(#personDetailsDialog, #paymentProofDialog) .upi-qr-toggle {
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #fff;
  color: #0f766e;
  font-weight: 600;
  min-height: 38px;
  padding: 0 12px;
}
:is(#personDetailsDialog, #paymentProofDialog, #paymentReviewDialog) .message {
  margin: 0;
  color: #334155;
  font-size: 13px;
  line-height: 1.45;
}
:is(#personDetailsDialog, #paymentProofDialog, #paymentReviewDialog) .message:empty {
  display: none;
}
:is(#personDetailsDialog, #paymentProofDialog, #paymentReviewDialog) .message.error {
  color: #b91c1c;
}
:is(#personDetailsDialog, #paymentProofDialog, #paymentReviewDialog) .message.success {
  color: #047857;
}
:is(#personDetailsDialog, #paymentProofDialog, #paymentReviewDialog) .alert-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}
:is(#personDetailsDialog, #paymentProofDialog, #paymentReviewDialog) .alert-dialog-actions > button {
  min-height: 44px;
  padding: 0 16px;
  border-radius: 12px;
  font: 600 14px Inter, sans-serif;
  box-shadow: none;
}
:is(#personDetailsDialog, #paymentProofDialog, #paymentReviewDialog) .alert-dialog-actions .button-quiet {
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #334155;
}
:is(#personDetailsDialog, #paymentProofDialog, #paymentReviewDialog) .alert-dialog-actions .button-secondary {
  border: 1px solid #99d5ca;
  background: #fff;
  color: #0f766e;
}
:is(#personDetailsDialog, #paymentProofDialog, #paymentReviewDialog) .alert-dialog-actions .button-primary {
  border: 0;
  background: #0f766e;
  color: #fff;
  box-shadow: 0 6px 16px rgba(15, 118, 110, .2);
}
:is(#personDetailsDialog, #paymentProofDialog, #paymentReviewDialog) .alert-dialog-actions .button-primary:disabled {
  background: #94a3b8;
  box-shadow: none;
  cursor: not-allowed;
}
@media (max-width: 600px) {
  #personalAccountPage .account-settlement-meta {
    gap: 6px;
  }
  #personalAccountPage .settlement-action-btn {
    min-height: 34px;
    padding: 0 10px;
    font-size: 12px;
  }
  :is(#personDetailsDialog, #paymentProofDialog, #paymentReviewDialog) {
    position: fixed;
    inset: auto 0 0;
    width: 100%;
    max-width: 100%;
    max-height: calc(100dvh - env(safe-area-inset-top) - 16px);
    margin: auto 0 0;
    border-radius: 24px 24px 0 0;
  }
  :is(#personDetailsDialog, #paymentProofDialog, #paymentReviewDialog) .alert-dialog-actions > button {
    flex: 1 1 auto;
  }
}

/* Conversation reference: teal bubbles, white cards, pale gray canvas. */
#smartAssistantPanel { --chat-teal: #33736e; background:#f4f6f7; height: min(760px, calc(100vh - 110px)); height:min(760px, calc(100dvh - 110px)); }
#smartAssistantMessages { background:#f4f6f7; padding:16px; -webkit-overflow-scrolling:touch; }
#smartAssistantPanel .smart-assistant-message.user, #smartAssistantPanel .smart-assistant-avatar, #smartAssistantPanel .smart-assistant-btn-confirm, #smartAssistantSend, #smartAssistantPanel .smart-assistant-budget-fill:not(.is-over) { background:#33736e; }
#smartAssistantPanel .smart-assistant-summary-card { background:#f3f5f6; border-radius:12px; padding:12px; }
#smartAssistantPanel .smart-assistant-confirmation, #smartAssistantPanel .smart-assistant-budget-message { width:92%; max-width:92%; box-sizing:border-box; }
#smartAssistantPanel .smart-assistant-message { flex-shrink:0; }
#smartAssistantPanel .smart-assistant-confirmation-actions { flex-wrap:wrap; }
#smartAssistantPanel .smart-assistant-btn-confirm { flex:1 1 100px; }
#smartAssistantPanel .smart-assistant-btn-edit, #smartAssistantPanel .smart-assistant-btn-cancel { padding:0 10px; }
#smartAssistantPanel .smart-cloud-settings { color:#475569; font-size:12px; line-height:1.4; }
#smartAssistantPanel .smart-cloud-settings summary { cursor:pointer; }
#smartAssistantPanel .smart-cloud-settings label { display:block; margin-top:6px; }
#smartAssistantPanel .smart-assistant-footer { padding:10px 12px 18px; padding-bottom:max(18px, env(safe-area-inset-bottom)); }
@media(max-width:700px){ #smartAssistantPanel { top:0; right:0; bottom:0; left:0; height:100vh; max-height:100vh; height:100dvh; max-height:100dvh; } }
@media(max-width:360px){ #smartAssistantMessages { padding:10px; } #smartAssistantPanel .smart-assistant-confirmation, #smartAssistantPanel .smart-assistant-budget-message {width:100%;max-width:100%;} }
