/* ============================================
   SPLITO — Custom Palette Design System
   Palette: #054A75 · #06B6D4 · #E2E8F0 · #000000
   Status: Success #0D9488 · Danger #EF4444
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
  /* Light Theme — #054A75 containers, #06B6D4 content, #E2E8F0 surfaces, black text */
  --bg-primary: #E2E8F0;
  --bg-secondary: #FFFFFF;
  --bg-tertiary: #F1F5F9;
  --text-primary: #000000;
  --text-secondary: #334155;
  --text-tertiary: #64748B;
  --border-color: #CBD5E1;
  --border-light: #E2E8F0;
  --accent: #054A75;
  --accent-dark: #000000;
  --accent-light: #06B6D4;
  --accent-soft: rgba(5, 74, 117, 0.10);
  --accent-gradient: #054A75;
  --header-gradient: #054A75;
  --success: #0D9488;
  --success-soft: rgba(13, 148, 136, 0.12);
  --danger: #EF4444;
  --danger-soft: rgba(239, 68, 68, 0.12);
  --warning: #EF4444;
  
  /* Solid Multi-Layered Shadows & Depth */
  --shadow-sm: 0 4px 12px -2px rgba(5, 74, 117, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 10px 25px -4px rgba(5, 74, 117, 0.14), 0 4px 10px -2px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 18px 42px -6px rgba(5, 74, 117, 0.22), 0 8px 20px -4px rgba(0, 0, 0, 0.08);
  --shadow-xl: 0 28px 64px -8px rgba(5, 74, 117, 0.30), 0 12px 28px -6px rgba(0, 0, 0, 0.12);
  --shadow-3d-button: 0 8px 20px -2px rgba(5, 74, 117, 0.4), 0 4px 8px -1px rgba(0, 0, 0, 0.15);

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --radius-full: 9999px;
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --icon-color: #054A75;
  --skeleton-base: #CBD5E1;
  --skeleton-shine: #E2E8F0;
  --toast-bg: #054A75;
  --toast-text: #06B6D4;
  --modal-backdrop: rgba(0, 0, 0, 0.65);

  --category-food: #F97316;
  --category-transport: #06B6D4;
  --category-stay: #8B5CF6;
  --category-entertainment: #EC4899;
  --category-shopping: #054A75;
  --category-utilities: #F59E0B;
  --category-other: #64748B;
}

[data-theme="dark"] {
  /* ChatGPT Dark Theme Palette — Sleek charcoal, crisp white text & icons, emerald green accents */
  --bg-primary: #212121;
  --bg-secondary: #171717;
  --bg-tertiary: #2f2f2f;
  --text-primary: #ececec;
  --text-secondary: #b4b4b4;
  --text-tertiary: #8e8e93;
  --border-color: #383838;
  --border-light: #2a2a2a;
  --accent: #10a37f;
  --accent-dark: #10a37f;
  --accent-light: #19c37d;
  --accent-soft: rgba(16, 163, 127, 0.15);
  --accent-gradient: linear-gradient(135deg, #10a37f 0%, #19c37d 100%);
  --header-gradient: linear-gradient(135deg, #171717 0%, #2f2f2f 100%);
  --icon-color: #ececec;
  --skeleton-base: #2f2f2f;
  --skeleton-shine: #383838;
  --toast-bg: #2f2f2f;
  --toast-text: #10a37f;
  --modal-backdrop: rgba(0, 0, 0, 0.75);

  --shadow-sm: 0 4px 12px -2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 10px 28px -4px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 18px 45px -6px rgba(0, 0, 0, 0.6);
  --shadow-xl: 0 28px 70px -8px rgba(0, 0, 0, 0.7);
  --shadow-3d-button: 0 8px 20px -2px rgba(16, 163, 127, 0.35);
}

[data-theme="dark"] body::before {
  opacity: 0.08;
  filter: invert(1) brightness(0.4);
}

[data-theme="dark"] .sticky-header {
  background: #171717 !important;
  color: #ececec !important;
  border-bottom-color: #383838 !important;
}

[data-theme="dark"] .sticky-header .theme-toggle,
[data-theme="dark"] .sticky-header .btn-ghost,
[data-theme="dark"] .sticky-header .header-select {
  color: #ececec !important;
}

[data-theme="dark"] .sticky-header .header-select {
  background: #2f2f2f !important;
  border-color: #383838 !important;
  color: #ececec !important;
}

[data-theme="dark"] select.input-field {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23ececec' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
}

[data-theme="dark"] .btn-ocean-blue {
  background: #10a37f !important;
  color: #FFFFFF !important;
  box-shadow: 0 4px 14px rgba(16, 163, 127, 0.3) !important;
}

[data-theme="dark"] .btn-ocean-blue svg {
  stroke: #FFFFFF !important;
}

[data-theme="dark"] .btn-primary {
  background: linear-gradient(135deg, #10a37f 0%, #19c37d 100%) !important;
  color: #FFFFFF !important;
}

[data-theme="dark"] .input-field {
  background: #2f2f2f !important;
  color: #ececec !important;
  border-color: #383838 !important;
}

[data-theme="dark"] .input-field:focus {
  border-color: #10a37f !important;
  box-shadow: 0 0 0 4px rgba(16, 163, 127, 0.2) !important;
}

/* --- Reset & Base --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100dvh;
  max-width: 100vw;
  max-height: 100dvh;
  overflow: hidden;
  margin: 0;
  padding: 0;
  /* `none` also suppressed pinch-to-zoom, so a low-vision user had no way to
     magnify the app (WCAG 1.4.4). Allowing pinch-zoom still blocks the pan /
     rubber-band scrolling this rule was added to prevent. */
  touch-action: pinch-zoom;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url('../assets/bg.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0.5;
  z-index: -1;
  pointer-events: none;
}

a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
img, svg { display: block; max-width: 100%; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }
input, select, textarea { font-family: inherit; font-size: inherit; }

/* --- Layout --- */
.app-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100dvh;
  max-width: 100vw;
  max-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

@media (min-width: 768px) {
  .app-container {
    flex-direction: row;
    position: relative;
    height: 100vh;
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
  }
}

.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding-bottom: 84px; /* Clear space for fixed bottom nav */
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y pinch-zoom; /* Block horizontal touch scrolling, keep zoom */
}

/* Remove bottom nav and bottom padding on home page */
body.is-home-page .app-main {
  padding-bottom: 0 !important;
}

body.is-home-page #bottom-nav,
body.is-home-page #fab,
body.is-home-page .bottom-nav {
  display: none !important;
}

/* Auto Title Case formatting for text inputs */
input[type="text"].input-field,
#exp-description,
#input-group-name,
#input-members,
.member-tag,
.expense-description {
  text-transform: capitalize;
}

.page-content {
  flex: 1;
  padding: 16px;
  max-width: 100vw;
  box-sizing: border-box;
  overflow-x: hidden;
}

@media (min-width: 768px) {
  .app-main {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding-bottom: 0;
    overflow: hidden;
  }
  .page-content {
    padding: 24px 32px;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .page-content::-webkit-scrollbar {
    display: none;
  }
}

/* --- Reference-Matched Debit Card Hero Style (Site Theme Colors) --- */
.debit-card-hero {
  position: relative;
  background: var(--bg-secondary, #FFFFFF);
  border: 1.5px solid var(--border-color, #E2E8F0);
  border-radius: 22px;
  padding: 22px 24px;
  box-shadow: 0 12px 32px rgba(5, 74, 117, 0.08), 0 2px 6px rgba(0, 0, 0, 0.04);
  margin-bottom: 20px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.debit-card-hero:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 40px rgba(5, 74, 117, 0.12), 0 4px 10px rgba(0, 0, 0, 0.06);
}

/* Organic curved background shape on the top right (matching reference card) */
.debit-card-hero::after {
  content: '';
  position: absolute;
  top: -35px;
  right: -35px;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  background: rgba(5, 74, 117, 0.05);
  pointer-events: none;
  z-index: 1;
}

[data-theme="dark"] .debit-card-hero {
  background: var(--bg-card, #0F172A);
  border-color: rgba(51, 65, 85, 0.7);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .debit-card-hero::after {
  background: rgba(56, 189, 248, 0.06);
}

.debit-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: relative;
  z-index: 2;
}

.debit-top-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Microchip Icon with Grid and Center Circle */
.debit-microchip {
  width: 38px;
  height: 28px;
  background: rgba(13, 148, 136, 0.15);
  border: 1.5px solid rgba(13, 148, 136, 0.35);
  border-radius: 7px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(5, 74, 117, 0.06);
}

[data-theme="dark"] .debit-microchip {
  background: rgba(45, 212, 191, 0.2);
  border-color: rgba(45, 212, 191, 0.45);
}

.debit-microchip::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(13, 148, 136, 0.4);
  transform: translateY(-50%);
}

.debit-microchip::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(13, 148, 136, 0.4);
  transform: translateX(-50%);
}

.chip-circle {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1px solid rgba(13, 148, 136, 0.5);
  background: var(--bg-secondary, #FFFFFF);
  z-index: 2;
}

[data-theme="dark"] .chip-circle {
  background: #0F172A;
}

/* Pill badge beside chip */
.debit-pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  background: var(--bg-tertiary, #F1F5F9);
  border: 1px solid var(--border-color, #E2E8F0);
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-secondary, #475569);
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.debit-pill-badge svg {
  stroke: var(--accent, #0D9488);
  flex-shrink: 0;
}

/* Top Right Brand & Overlapping Circles (matching reference card) */
.debit-top-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  flex-shrink: 0;
}

.debit-card-brand {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--text-tertiary, #64748B);
  text-transform: uppercase;
}

.debit-card-circles {
  display: flex;
  align-items: center;
  position: relative;
  width: 26px;
  height: 16px;
}

.circle-dot {
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
}

.circle-1 {
  left: 0;
  background: #054A75;
  opacity: 0.85;
}

.circle-2 {
  right: 0;
  background: #0D9488;
  opacity: 0.7;
}

[data-theme="dark"] .circle-1 {
  background: #38BDF8;
}
[data-theme="dark"] .circle-2 {
  background: #2DD4BF;
}

/* Middle Content */
.debit-card-middle {
  position: relative;
  z-index: 2;
}

.debit-card-group-name {
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--text-secondary, #334155);
  text-transform: uppercase;
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

[data-theme="dark"] .debit-card-group-name {
  color: #94A3B8;
}

.debit-card-amount-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.debit-card-amount {
  font-size: 2.35rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: #054A75;
  line-height: 1.05;
}

[data-theme="dark"] .debit-card-amount {
  color: #F8FAFC;
}

.debit-due-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 8px;
  background: rgba(13, 148, 136, 0.12);
  border: 1px solid rgba(13, 148, 136, 0.25);
  color: var(--accent, #0D9488);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

[data-theme="dark"] .debit-due-pill {
  background: rgba(45, 212, 191, 0.15);
  border-color: rgba(45, 212, 191, 0.3);
  color: #2DD4BF;
}

/* Bottom Panel with Organic Wave (matching reference card) */
.debit-card-bottom-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 30px 24px 20px 24px;
  margin: -10px -24px -22px -24px;
  background: transparent;
  position: relative;
  z-index: 2;
}

/* Curved wave shape swooping upward to the right across the entire bottom section */
.debit-card-bottom-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpath d='M0,38 C35,38 52,36 68,22 C82,10 92,2 100,0 L100,100 L0,100 Z' fill='%23054A75' fill-opacity='0.045'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: -1;
}

[data-theme="dark"] .debit-card-bottom-panel::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpath d='M0,38 C35,38 52,36 68,22 C82,10 92,2 100,0 L100,100 L0,100 Z' fill='%230F172A' fill-opacity='0.8'/%3E%3C/svg%3E");
}

.debit-bottom-info {
  flex: 1;
  min-width: 0;
}

.debit-bottom-title {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  color: var(--text-tertiary, #64748B);
  text-transform: uppercase;
  margin-bottom: 3px;
}

.debit-bottom-highlight {
  font-size: 1.02rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.debit-bottom-sub {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-tertiary, #64748B);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Mobile responsive adjustments: 25% height reduction for Debit Card Hero */
@media (max-width: 767px) {
  .debit-card-hero {
    padding: 14px 18px 16px 18px;
    gap: 10px;
    border-radius: 18px;
    margin-bottom: 14px;
  }

  .debit-card-hero::after {
    top: -25px;
    right: -25px;
    width: 150px;
    height: 150px;
  }

  .debit-card-top {
    gap: 8px;
  }

  .debit-top-left {
    gap: 8px;
  }

  .debit-top-right {
    gap: 4px;
  }

  .debit-microchip {
    width: 32px;
    height: 22px;
    border-radius: 5px;
  }

  .chip-circle {
    width: 6px;
    height: 6px;
  }

  .debit-pill-badge {
    padding: 3px 8px;
    font-size: 0.7rem;
    max-width: 150px;
    gap: 4px;
  }

  .debit-card-brand {
    font-size: 0.62rem;
    letter-spacing: 0.06em;
  }

  .debit-card-circles {
    width: 22px;
    height: 14px;
  }

  .circle-dot {
    width: 13px;
    height: 13px;
  }

  .debit-card-group-name {
    font-size: 0.75rem;
    margin-bottom: 2px;
  }

  .debit-card-amount-row {
    gap: 8px;
  }

  .debit-card-amount {
    font-size: 1.75rem;
    line-height: 1.1;
  }

  .debit-due-pill {
    padding: 2px 7px;
    font-size: 0.65rem;
  }

  .debit-card-bottom-panel {
    padding: 22px 18px 12px 18px;
    margin: -8px -18px -16px -18px;
    gap: 10px;
  }

  .debit-bottom-title {
    font-size: 0.62rem;
    margin-bottom: 1px;
  }

  .debit-bottom-highlight {
    font-size: 0.88rem;
    margin-bottom: 1px;
  }

  .debit-bottom-sub {
    font-size: 0.72rem;
  }
}

/* --- Empty Groups Clean Orbital Animated View (Desktop & Mobile) --- */
.empty-groups-clean-view {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 30px 12px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 220px;
  width: 100% !important;
  box-sizing: border-box !important;
  margin: 0 auto !important;
}

.empty-groups-stage {
  position: relative;
  width: 100%;
  max-width: 340px;
  height: 190px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  box-sizing: border-box;
}

.empty-groups-center-content {
  position: relative;
  z-index: 5;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

.empty-groups-title-clean {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0;
  letter-spacing: -0.01em;
  white-space: nowrap;
  text-align: center;
}

/* Orbiting / Floating Badges */
.floating-item {
  position: absolute;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-secondary, #FFFFFF);
  border: 1px solid var(--border-color, #E2E8F0);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(5, 74, 117, 0.1), 0 1px 3px rgba(0, 0, 0, 0.04);
  color: var(--accent, #0D9488);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  z-index: 2;
  box-sizing: border-box;
}

[data-theme="dark"] .floating-item {
  background: var(--bg-card, #0F172A);
  border-color: rgba(51, 65, 85, 0.8);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.floating-item svg {
  stroke: currentColor;
  width: 22px;
  height: 22px;
}

.floating-minus-symbol {
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
  color: currentColor;
}

/* Dedicated Theme Colors & 6-Point Even Radial Distribution (No Top/Bottom Gaps) */

/* 1. Calculator (Top Center - 12 o'clock) */
.float-item-calc {
  top: 4px;
  left: calc(50% - 22px);
  color: #054A75;
  background: rgba(5, 74, 117, 0.08);
  border-color: rgba(5, 74, 117, 0.2);
  animation: orbit-float-top 4.2s ease-in-out infinite;
}

/* 2. Plus (Top Right - 2 o'clock) */
.float-item-plus {
  top: 36px;
  right: 24px;
  color: #0D9488;
  background: rgba(13, 148, 136, 0.1);
  border-color: rgba(13, 148, 136, 0.25);
  animation: orbit-float-tr 4.8s ease-in-out infinite;
}

/* 3. Receipt (Bottom Right - 4 o'clock) */
.float-item-receipt {
  bottom: 36px;
  right: 24px;
  color: #054A75;
  background: rgba(5, 74, 117, 0.08);
  border-color: rgba(5, 74, 117, 0.2);
  animation: orbit-float-br 5.1s ease-in-out infinite;
}

/* 4. Minus (Bottom Center - 6 o'clock) */
.float-item-minus {
  bottom: 4px;
  left: calc(50% - 22px);
  color: #0D9488;
  background: rgba(13, 148, 136, 0.1);
  border-color: rgba(13, 148, 136, 0.25);
  animation: orbit-float-bottom 4.4s ease-in-out infinite;
}

/* 5. Percent (Bottom Left - 8 o'clock) */
.float-item-percent {
  bottom: 36px;
  left: 24px;
  color: #00A8CC;
  background: rgba(0, 168, 204, 0.1);
  border-color: rgba(0, 168, 204, 0.25);
  animation: orbit-float-bl 4.6s ease-in-out infinite;
}

/* 6. Currency / Payment (Top Left - 10 o'clock) */
.float-item-currency {
  top: 36px;
  left: 24px;
  color: #0284C7;
  background: rgba(2, 132, 199, 0.1);
  border-color: rgba(2, 132, 199, 0.25);
  animation: orbit-float-tl 4.5s ease-in-out infinite;
}

/* Dark Mode Theme Adjustments for Badges */
[data-theme="dark"] .float-item-calc {
  color: #38BDF8;
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.3);
}

[data-theme="dark"] .float-item-plus {
  color: #2DD4BF;
  background: rgba(45, 212, 191, 0.15);
  border-color: rgba(45, 212, 191, 0.3);
}

[data-theme="dark"] .float-item-receipt {
  color: #2DD4BF;
  background: rgba(45, 212, 191, 0.15);
  border-color: rgba(45, 212, 191, 0.3);
}

[data-theme="dark"] .float-item-minus {
  color: #2DD4BF;
  background: rgba(45, 212, 191, 0.15);
  border-color: rgba(45, 212, 191, 0.3);
}

[data-theme="dark"] .float-item-percent {
  color: #38BDF8;
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.3);
}

[data-theme="dark"] .float-item-currency {
  color: #38BDF8;
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.3);
}

/* Keyframes for Gentle Floating Orbits Across 6 Radial Points */
@keyframes orbit-float-top {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-7px) scale(1.05); }
}

@keyframes orbit-float-tr {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(6px, -5px) scale(1.05); }
}

@keyframes orbit-float-br {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(6px, 5px) scale(1.05); }
}

@keyframes orbit-float-bottom {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(7px) scale(1.05); }
}

@keyframes orbit-float-bl {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-6px, 5px) scale(1.05); }
}

@keyframes orbit-float-tl {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-6px, -5px) scale(1.05); }
}

/* Mobile Alignment & Sizing (< 600px) */
@media (max-width: 600px) {
  .empty-groups-clean-view {
    padding: 24px 8px !important;
    min-height: 180px;
  }
  .empty-groups-stage {
    max-width: 290px;
    height: 165px;
  }
  .floating-item {
    width: 38px;
    height: 38px;
  }
  .floating-item svg {
    width: 18px;
    height: 18px;
  }
  .floating-minus-symbol {
    font-size: 20px;
  }
  .empty-groups-title-clean {
    font-size: 1.05rem;
  }
  .float-item-calc {
    top: 2px;
    left: calc(50% - 19px);
  }
  .float-item-plus {
    top: 30px;
    right: 12px;
  }
  .float-item-receipt {
    bottom: 30px;
    right: 12px;
  }
  .float-item-minus {
    bottom: 2px;
    left: calc(50% - 19px);
  }
  .float-item-percent {
    bottom: 30px;
    left: 12px;
  }
  .float-item-currency {
    top: 30px;
    left: 12px;
  }
}

/* --- Curved Hero Header Banner --- */
.hero-banner {
  background: var(--header-gradient);
  color: #FFFFFF;
  padding: 20px 22px;
  border-radius: var(--radius-xl);
  position: relative;
  box-shadow: var(--shadow-md);
  margin-bottom: 20px;
}

.hero-banner-inner {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 16px;
  text-align: left !important;
  width: 100%;
}

.hero-banner-icon-badge {
  width: 56px;
  height: 56px;
  min-width: 56px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.18);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(8px);
}

.hero-banner-icon-badge svg {
  stroke: #FFFFFF;
  width: 28px;
  height: 28px;
}

.hero-banner-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start !important;
  text-align: left !important;
}

.hero-banner-title {
  font-size: 0.78rem;
  font-weight: 700;
  opacity: 0.9;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 2px;
  text-align: left !important;
}

.hero-banner-amount {
  font-size: 2.1rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left !important;
}

.hero-banner-subtitle {
  font-size: 0.8125rem;
  opacity: 0.85;
  margin-top: 4px;
  text-align: left !important;
}

.hero-banner-metrics {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
  text-align: left !important;
}

.hero-metric-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(6px);
  color: #FFFFFF;
  font-size: 0.72rem;
  font-weight: 600;
}

.hero-metric-chip svg {
  stroke: #FFFFFF;
}

@media (min-width: 768px) {
  .hero-banner {
    padding: 24px 28px;
    margin-bottom: 24px;
  }

  .hero-banner-inner {
    gap: 20px;
  }

  .hero-banner-icon-badge {
    width: 60px;
    height: 60px;
    min-width: 60px;
    border-radius: var(--radius-xl);
  }

  .hero-banner-icon-badge svg {
    width: 30px;
    height: 30px;
  }

  .hero-banner-title {
    font-size: 0.85rem;
  }

  .hero-banner-amount {
    font-size: 2.5rem;
  }

  .hero-banner-subtitle {
    font-size: 0.9rem;
  }

  .hero-metric-chip {
    padding: 5px 12px;
    font-size: 0.78rem;
  }
}

/* --- Sticky Header --- */
.sticky-header {
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  max-width: 100vw;
  box-sizing: border-box;
  flex-shrink: 0;
  background: #FFFFFF;
  color: #054A75;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  overflow: visible;
  border-bottom: 1px solid var(--border-color);
}

.sticky-header .theme-toggle,
.sticky-header .btn-ghost,
.sticky-header .header-select {
  color: #054A75;
}

.sticky-header .theme-toggle:hover,
.sticky-header .btn-ghost:hover {
  background: rgba(5, 74, 117, 0.08);
}

.sticky-header .header-select {
  background: rgba(5, 74, 117, 0.08);
  border-color: rgba(5, 74, 117, 0.20);
  color: #054A75;
  padding: 4px 6px;
  font-size: 0.75rem;
  max-width: 85px;
}

.sticky-header .header-select option {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
  overflow: hidden;
}

.header-left > div {
  min-width: 0;
  flex: 1;
  overflow: hidden;
}

/* Smart Dynamic Greeting & Date Pill (Seamless Borderless Style) */
.header-greeting-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 6px;
  background: transparent;
  border: none;
  border-radius: var(--radius-full, 9999px);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary, #475569);
  box-shadow: none;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
  user-select: none;
  max-width: fit-content;
}

[data-theme="dark"] .header-greeting-pill {
  background: transparent;
  border: none;
  color: #94A3B8;
  box-shadow: none;
}

.header-greeting-pill:hover {
  transform: translateY(-1px);
  opacity: 0.9;
}

.greeting-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  flex-shrink: 0;
  transition: transform var(--transition-fast);
}

.header-greeting-pill:hover .greeting-icon {
  transform: scale(1.12) rotate(8deg);
}

.greeting-icon-morning {
  background: rgba(245, 158, 11, 0.14);
  color: #D97706;
}

.greeting-icon-afternoon {
  background: rgba(13, 148, 136, 0.14);
  color: #0D9488;
}

.greeting-icon-evening {
  background: rgba(234, 88, 12, 0.14);
  color: #EA580C;
}

.greeting-icon-night {
  background: rgba(56, 189, 248, 0.14);
  color: #0284C7;
}

[data-theme="dark"] .greeting-icon-morning {
  background: rgba(251, 191, 36, 0.2);
  color: #FBBF24;
}

[data-theme="dark"] .greeting-icon-afternoon {
  background: rgba(45, 212, 191, 0.2);
  color: #2DD4BF;
}

[data-theme="dark"] .greeting-icon-evening {
  background: rgba(251, 146, 60, 0.2);
  color: #FB923C;
}

[data-theme="dark"] .greeting-icon-night {
  background: rgba(56, 189, 248, 0.2);
  color: #38BDF8;
}

.greeting-text {
  font-weight: 700;
  color: var(--text-primary, #0F172A);
  letter-spacing: -0.01em;
}

[data-theme="dark"] .greeting-text {
  color: #F8FAFC;
}

.greeting-divider {
  color: var(--text-tertiary, #94A3B8);
  font-weight: 800;
}

.greeting-date {
  color: var(--text-secondary, #64748B);
  font-weight: 500;
  font-size: 0.74rem;
}

@media (max-width: 480px) {
  .header-greeting-pill {
    padding: 2px 4px;
    gap: 5px;
    font-size: 0.76rem;
  }
  .greeting-icon {
    width: 20px;
    height: 20px;
  }
  .greeting-icon svg {
    width: 13px;
    height: 13px;
  }
}

.header-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  position: relative;
}

.desktop-header-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Header Action Pill Buttons (About, Install App, Feedback) */
.btn-header-pill,
.btn-feedback-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  background: var(--bg-tertiary, rgba(5, 74, 117, 0.08));
  border: 1px solid var(--border-color, rgba(5, 74, 117, 0.18));
  border-radius: var(--radius-full, 9999px);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent, #054A75);
  cursor: pointer;
  white-space: nowrap;
  line-height: 1;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.btn-header-pill:hover,
.btn-feedback-pill:hover {
  background: var(--accent-soft, rgba(5, 74, 117, 0.14));
  border-color: var(--accent, #054A75);
  color: var(--accent, #054A75);
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(5, 74, 117, 0.15);
}

.btn-header-pill:active,
.btn-feedback-pill:active {
  transform: translateY(0);
}

.btn-header-pill svg,
.btn-feedback-pill svg {
  color: var(--accent, #054A75);
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.btn-header-pill:hover svg,
.btn-feedback-pill:hover svg {
  transform: scale(1.1);
}

[data-theme="dark"] .btn-header-pill,
[data-theme="dark"] .btn-feedback-pill {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  color: var(--text-primary, #F8FAFC);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .btn-header-pill:hover,
[data-theme="dark"] .btn-feedback-pill:hover {
  background: rgba(16, 163, 127, 0.18);
  border-color: var(--accent, #10a37f);
  color: var(--accent, #10a37f);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .btn-header-pill svg,
[data-theme="dark"] .btn-feedback-pill svg {
  color: var(--accent, #10a37f);
}

@media (max-width: 680px) {
  .btn-header-pill,
  .btn-feedback-pill {
    padding: 5px 8px;
    font-size: 0.72rem;
    gap: 4px;
  }
}

@media (max-width: 520px) {
  .btn-header-pill span,
  .btn-feedback-pill span {
    display: none;
  }
  .btn-header-pill,
  .btn-feedback-pill {
    padding: 6px;
    width: 32px;
    height: 32px;
    justify-content: center;
    border-radius: var(--radius-full);
  }
}

/* --- Mobile Extended Dropdown Menu --- */
.header-overflow-menu {
  position: absolute;
  top: 100%;
  right: 10px;
  margin-top: 6px;
  min-width: 220px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  padding: 8px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 2px;
  animation: fadeIn 0.15s ease-out;
}

.overflow-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background var(--transition-fast);
  text-align: left;
}

.overflow-menu-item:hover {
  background: var(--bg-tertiary);
}

.overflow-menu-item.danger {
  color: #EF4444;
}

.overflow-menu-item.danger:hover {
  background: rgba(239, 68, 68, 0.12);
}

.overflow-item-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  color: var(--accent);
  flex-shrink: 0;
}

.overflow-menu-item.danger .overflow-item-icon {
  color: #EF4444;
}

.overflow-item-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.overflow-item-title {
  font-size: 0.875rem;
  font-weight: 600;
}

.overflow-item-sub {
  font-size: 0.72rem;
  color: var(--text-tertiary);
}

.overflow-menu-divider {
  height: 1px;
  background: var(--border-color);
  margin: 4px 0;
}

.identity-avatar-btn-sm {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #06B6D4;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 800;
  flex-shrink: 0;
}

.header-logo {
  height: 24px;
  width: auto;
  object-fit: contain;
  background: transparent;
  box-shadow: none;
}

.header-logo-only {
  height: 26px;
}

.sidebar-logo {
  height: 24px;
  width: auto;
  object-fit: contain;
  background: transparent;
  box-shadow: none;
}

.header-title {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-subtitle {
  font-size: 0.72rem;
  opacity: 0.85;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* --- Sidebar (Desktop) --- */
.sidebar {
  display: none;
}

@media (min-width: 768px) {
  .sidebar {
    display: flex;
    flex-direction: column;
    width: 270px;
    min-width: 270px;
    flex-shrink: 0;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    height: 100vh;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 24px 16px;
  }

  .sidebar::-webkit-scrollbar {
    display: none;
  }

  .sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
  }

  #btn-sidebar-home {
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    border-radius: var(--radius-full);
    background: var(--accent-soft, rgba(5, 74, 117, 0.12));
    color: var(--accent, #054A75);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all var(--transition-fast);
    box-shadow: 0 2px 6px rgba(5, 74, 117, 0.12);
  }

  #btn-sidebar-home:hover {
    background: #054A75;
    color: #FFFFFF;
    transform: scale(1.06);
    box-shadow: 0 4px 12px rgba(5, 74, 117, 0.25);
  }

  #btn-sidebar-home svg {
    stroke: currentColor;
    width: 18px;
    height: 18px;
  }

  .sidebar-title {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--accent);
  }

  .sidebar-group-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
  }

  .sidebar-group-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    color: var(--text-secondary);
    font-weight: 500;
  }

  .sidebar-group-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
  }

  .sidebar-group-item.active {
    background: var(--accent-gradient);
    color: #FFFFFF;
    font-weight: 600;
    box-shadow: var(--shadow-sm);
  }
}

/* --- Desktop Columns (50/50 Equal Width & Independent Scroll) --- */
.group-view {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 0;
}

@media (min-width: 768px) {
  .group-view {
    display: flex;
    flex-direction: row;
    flex: 1;
    height: 100%;
    min-height: 0;
    width: 100%;
    overflow: hidden;
  }

  .expenses-column {
    flex: 1 1 50%;
    width: 50%;
    max-width: 50%;
    min-width: 0;
    height: 100%;
    overflow-y: auto; /* Separately scrollable */
    scrollbar-width: none; /* Hide scrollbar Firefox */
    -ms-overflow-style: none; /* Hide scrollbar IE/Edge */
    border-right: 1px solid var(--border-color);
    padding: 24px 32px;
  }

  .expenses-column::-webkit-scrollbar {
    display: none; /* Hide scrollbar Chrome/Safari */
  }

  .settlement-column {
    flex: 1 1 50%;
    width: 50%;
    max-width: 50%;
    min-width: 0;
    height: 100%;
    overflow-y: auto; /* Separately scrollable */
    scrollbar-width: none; /* Hide scrollbar Firefox */
    -ms-overflow-style: none; /* Hide scrollbar IE/Edge */
    padding: 24px 28px;
    background: var(--bg-tertiary);
  }

  .settlement-column::-webkit-scrollbar {
    display: none; /* Hide scrollbar Chrome/Safari */
  }
}

/* --- Bottom Navigation (Mobile) --- */
.bottom-nav {
  position: fixed !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 9999 !important;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 10px 0;
  padding-bottom: max(10px, env(safe-area-inset-bottom));
  box-shadow: 0 -4px 16px rgba(0,0,0,0.08);
}

@media (min-width: 768px) {
  .bottom-nav { display: none; }
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px 16px;
  background: transparent !important;
  color: var(--text-tertiary);
  border: none;
  box-shadow: none !important;
  transition: all var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
}

.bottom-nav-item.active {
  color: var(--accent) !important;
  background: transparent !important;
  box-shadow: none !important;
  transform: translateY(-1px);
}

.bottom-nav-item.active svg {
  stroke: var(--accent) !important;
  stroke-width: 2.6px !important;
  transform: scale(1.1);
  transition: transform var(--transition-fast);
}

.bottom-nav-item.active span {
  color: var(--accent) !important;
  font-weight: 800 !important;
  font-size: 0.72rem !important;
}

[data-theme="dark"] .bottom-nav-item.active {
  color: #10a37f !important;
  background: transparent !important;
  box-shadow: none !important;
}

[data-theme="dark"] .bottom-nav-item.active svg {
  stroke: #10a37f !important;
  stroke-width: 2.6px !important;
}

[data-theme="dark"] .bottom-nav-item.active span {
  color: #10a37f !important;
  font-weight: 800 !important;
}

/* --- Standard Buttons --- */
.btn {
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  padding: 10px 20px;
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 600;
  transition: all var(--transition-fast);
  white-space: nowrap !important;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

#btn-add-expense-inline {
  flex-direction: row;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  gap: 6px;
}

.btn-primary {
  background: var(--accent-gradient);
  color: #FFFFFF;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-3d-button);
}

.btn-ocean-blue {
  background: #054A75 !important;
  color: #FFFFFF !important;
  border-radius: var(--radius-full);
  box-shadow: 0 4px 12px rgba(5, 74, 117, 0.25);
  transition: all var(--transition-fast);
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center !important;
  white-space: nowrap !important;
}

.btn-ocean-blue svg {
  stroke: #06B6D4;
}

.btn-ocean-blue:hover {
  transform: translateY(-1px);
  background: #033656 !important;
  box-shadow: 0 6px 16px rgba(5, 74, 117, 0.35);
}

.btn-primary:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: var(--shadow-xl);
}

.btn-primary:active {
  transform: translateY(1px) scale(0.98);
  opacity: 0.95;
  box-shadow: var(--shadow-sm);
}

.btn-secondary {
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  background: rgba(2, 132, 199, 0.18);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: var(--radius-full);
}

.btn-ghost:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.btn-danger {
  background: var(--danger);
  color: #FFFFFF;
  border-radius: var(--radius-full);
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.3);
}

.btn-sm {
  padding: 7px 16px;
  font-size: 0.8125rem;
  border-radius: var(--radius-full);
}

.btn-lg {
  padding: 12px 24px;
  font-size: 0.9375rem;
  border-radius: var(--radius-full);
}

.btn-full {
  width: 100%;
}

.btn-icon {
  padding: 10px;
  border-radius: var(--radius-full);
}

/* --- FAB (Floating Action Button) --- */
.fab {
  position: fixed !important;
  bottom: 80px !important;
  right: 20px !important;
  z-index: 9998 !important;
  width: 58px;
  height: 58px;
  border-radius: var(--radius-full);
  background: var(--accent-gradient);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-3d-button);
  transition: all var(--transition-normal);
  -webkit-tap-highlight-color: transparent;
}

.fab:hover {
  transform: scale(1.08) translateY(-3px);
  box-shadow: var(--shadow-xl);
}

.fab:active {
  transform: scale(0.95);
}

.fab svg {
  width: 26px;
  height: 26px;
}

@media (min-width: 768px) {
  .fab { display: none; }
}

/* --- Cards --- */
.card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  transition: all var(--transition-normal);
  box-shadow: var(--shadow-md);
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent-light);
}

/* --- Expense Card --- */
.expense-card {
  position: relative;
  overflow: hidden;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  transition: all var(--transition-normal);
  box-shadow: var(--shadow-md);
}

.expense-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent-light);
}

.expense-card-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  position: relative;
  z-index: 1;
  background: var(--bg-secondary);
  transition: transform var(--transition-normal);
}

.expense-card-delete {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 80px;
  background: var(--danger);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
}

.expense-card.swiped .expense-card-inner {
  transform: translateX(-80px);
}

.expense-category-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #FFFFFF;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
}

.expense-category-icon svg {
  width: 22px;
  height: 22px;
  stroke: #FFFFFF;
}

.expense-category-icon.food { background: var(--category-food, #F97316); }
.expense-category-icon.transport { background: var(--category-transport, #0284C7); }
.expense-category-icon.stay { background: var(--category-stay, #8B5CF6); }
.expense-category-icon.entertainment { background: var(--category-entertainment, #EC4899); }
.expense-category-icon.shopping { background: var(--category-shopping, #0F172A); }
.expense-category-icon.utilities { background: var(--category-utilities, #F59E0B); }
.expense-category-icon.other { background: var(--category-other, #64748B); }

.expense-info {
  flex: 1;
  min-width: 0;
}

.expense-description {
  font-size: 0.95rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.expense-meta {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  margin-top: 2px;
}

.expense-amount {
  font-size: 1.1rem;
  font-weight: 800;
  text-align: right;
  white-space: nowrap;
  color: var(--accent-dark);
}

[data-theme="dark"] .expense-amount {
  color: var(--accent);
}

/* --- Member Avatars Bubble Bar --- */
.member-bubbles-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  overflow-x: auto;
  padding: 12px 4px;
  scrollbar-width: none;
}
.member-bubbles-bar::-webkit-scrollbar { display: none; }

.member-bubble {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.member-avatar {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background: #06B6D4;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 800;
  box-shadow: 0 4px 14px -2px rgba(6, 182, 212, 0.35);
}

.member-name {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  max-width: 60px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* --- Inputs --- */
.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.input-label {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.input-field {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 10px 14px;
  background: var(--bg-tertiary);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.9375rem;
  outline: none;
  transition: all var(--transition-fast);
  text-overflow: ellipsis;
}

.input-field::placeholder { color: var(--text-tertiary); }

.input-field:focus {
  border-color: var(--accent);
  background: var(--bg-secondary);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

/* --- Form Validation Error States --- */
.input-field.input-error,
.feedback-textarea.input-error,
.feedback-email-input.input-error,
.multi-payer-input.input-error,
.split-row-input.input-error {
  border-color: #ef4444 !important;
  background: rgba(239, 68, 68, 0.06) !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.22) !important;
}

.form-error-banner {
  background: rgba(239, 68, 68, 0.12);
  border: 1.5px solid rgba(239, 68, 68, 0.4);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  color: #dc2626;
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  animation: fadeIn 0.2s ease-in-out;
  line-height: 1.4;
}

.form-error-banner.hidden {
  display: none !important;
}

[data-theme="dark"] .form-error-banner {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.6);
  color: #f87171;
}

.form-error-msg {
  color: #ef4444;
  font-size: 0.775rem;
  font-weight: 500;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.form-error-msg.hidden {
  display: none !important;
}

/* --- Member Tags in Create Group Modal --- */
.member-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.member-tag {
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-between;
  gap: 6px;
  background: var(--accent-soft, rgba(5, 74, 117, 0.12));
  border: 1px solid var(--border-color, rgba(5, 74, 117, 0.2));
  color: var(--text-primary);
  padding: 4px 10px;
  border-radius: 16px;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap !important;
  user-select: none;
  line-height: 1;
}

.member-tag-remove {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.15s ease, transform 0.15s ease;
  padding: 2px;
  border-radius: 50%;
  flex-shrink: 0;
}

.member-tag-remove:hover {
  opacity: 1;
  transform: scale(1.15);
  color: var(--accent-danger, #ef4444);
}

/* --- Group Status Badges on Home Cards --- */
.group-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
}

.group-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
}

.group-status-badge.badge-online {
  background: rgba(34, 197, 94, 0.12);
  color: #16a34a;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.group-status-badge.badge-online .status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #22c55e;
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.6);
}

.group-status-badge.badge-offline {
  background: rgba(245, 158, 11, 0.12);
  color: #d97706;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.group-status-badge.badge-offline .status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #f59e0b;
}

/* --- 3-Way Home Filter Switch --- */
.filter-3way-switch {
  display: inline-flex;
  align-items: center;
  background: var(--bg-tertiary, rgba(0, 0, 0, 0.06));
  border: 1px solid var(--border-color, rgba(0, 0, 0, 0.12));
  border-radius: var(--radius-full);
  padding: 3px;
  gap: 2px;
}

.filter-3way-btn {
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-tertiary);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.filter-3way-btn:hover {
  color: var(--text-primary);
}

.filter-3way-btn.active {
  background: var(--bg-secondary, #ffffff);
  color: var(--accent);
  box-shadow: var(--shadow-sm, 0 2px 6px rgba(0, 0, 0, 0.1));
}

[data-theme="dark"] .filter-3way-switch {
  background: #2f2f2f;
  border-color: #383838;
}

[data-theme="dark"] .filter-3way-btn.active {
  background: #10a37f;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(16, 163, 127, 0.4);
}

/* --- Mode Segment Select inside Create Group Modal --- */
.mode-select-segment {
  display: flex;
  gap: 8px;
  width: 100%;
}

.mode-segment-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  border: 1.5px solid var(--border-color);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.mode-segment-btn.active[data-mode="online"] {
  background: rgba(34, 197, 94, 0.12);
  color: #16a34a;
  border-color: rgba(34, 197, 94, 0.4);
}

.mode-segment-btn.active[data-mode="offline"] {
  background: rgba(245, 158, 11, 0.12);
  color: #d97706;
  border-color: rgba(245, 158, 11, 0.4);
}

[data-theme="dark"] .mode-segment-btn.active[data-mode="online"] {
  background: rgba(34, 197, 94, 0.2);
  color: #22c55e;
  border-color: #22c55e;
}

[data-theme="dark"] .mode-segment-btn.active[data-mode="offline"] {
  background: rgba(245, 158, 11, 0.2);
  color: #f59e0b;
  border-color: #f59e0b;
}

select.input-field {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23054A75' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 32px;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}

/* --- Chips --- */
.chip-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-size: 0.8125rem;
  font-weight: 600;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
}

.chip:hover { background: var(--accent-soft); color: var(--accent); }

.chip.active {
  background: var(--accent);
  color: #FFFFFF;
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
}

/* --- Tabs --- */
.tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-tertiary);
  padding: 4px;
  border-radius: var(--radius-full);
  margin-bottom: 16px;
}

.tab {
  flex: 1;
  padding: 8px 12px;
  text-align: center;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text-secondary);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.tab.active {
  background: var(--bg-secondary);
  color: var(--accent);
  box-shadow: var(--shadow-sm);
}

/* Hide bottom navigation and FAB when modal is active */
body.modal-open .bottom-nav,
body.modal-open .fab {
  opacity: 0 !important;
  pointer-events: none !important;
  visibility: hidden !important;
  transform: translateY(20px) !important;
  transition: opacity var(--transition-fast), transform var(--transition-fast), visibility var(--transition-fast);
}

/* --- Modal / Bottom Sheet --- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100000 !important;
  background: var(--modal-backdrop);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
}

.modal-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  position: fixed;
  z-index: 100001 !important;
  background: var(--bg-secondary);
  display: flex;
  flex-direction: column;
  bottom: 0;
  left: 0;
  right: 0;
  max-height: 90vh;
  max-height: 90dvh;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: 24px 20px 20px 20px;
  padding-bottom: max(24px, env(safe-area-inset-bottom));
  transform: translateY(100%);
  transition: transform var(--transition-slow);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
}

.modal-content::-webkit-scrollbar {
  display: none;
}

.modal-backdrop.active .modal-content {
  transform: translateY(0);
}

.modal-handle {
  width: 48px;
  height: 5px;
  background: var(--border-color);
  border-radius: var(--radius-full);
  margin: 0 auto 16px auto;
  flex-shrink: 0;
}

.modal-title {
  font-size: 1.35rem;
  font-weight: 800;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

.form-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.form-grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
  box-sizing: border-box;
}

.form-grid-2col > .input-group {
  min-width: 0;
}

.modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
  background: var(--bg-secondary);
  flex-shrink: 0;
  width: 100%;
}

.modal-actions .btn { flex: 1; }

@media (min-width: 768px) {
  .modal-content {
    bottom: auto;
    left: 50%;
    top: 50%;
    right: auto;
    height: auto;
    max-height: 85vh;
    max-height: 85dvh;
    width: 500px;
    max-width: 90vw;
    border-radius: var(--radius-xl);
    padding: 24px 20px 20px 20px;
    transform: translate(-50%, -50%) scale(0.95);
    opacity: 0;
  }
  .modal-backdrop.active .modal-content {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
  .modal-handle { display: none; }
}

/* --- Toast --- */
.toast-container {
  position: fixed;
  bottom: 88px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200005 !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

@media (min-width: 768px) {
  .toast-container { bottom: 32px; }
}

.toast {
  background: #0F172A;
  color: #F8FAFC;
  padding: 10px 16px;
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4);
  pointer-events: auto;
  animation: toastIn var(--transition-normal) forwards;
  border: 1px solid rgba(255, 255, 255, 0.15);
  max-width: 90vw;
  box-sizing: border-box;
}

.toast.leaving {
  animation: toastOut var(--transition-normal) forwards;
}

.toast-undo {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #06B6D4;
  color: #FFFFFF !important;
  border: none;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 0 2px 8px rgba(6, 182, 212, 0.4);
  margin-left: 4px;
  line-height: 1;
  text-decoration: none;
}

.toast-undo:hover {
  background: #0891B2;
  transform: scale(1.06);
  box-shadow: 0 4px 12px rgba(6, 182, 212, 0.6);
}

.toast-undo svg {
  stroke: #FFFFFF !important;
  width: 14px;
  height: 14px;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(16px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(-16px) scale(0.95); }
}

/* --- Empty State --- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 44px 20px;
}

.empty-state-badge {
  width: 72px;
  height: 72px;
  min-width: 72px;
  min-height: 72px;
  border-radius: var(--radius-full);
  background: var(--header-gradient, #054A75);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  box-shadow: 0 8px 24px rgba(5, 74, 117, 0.22);
  flex-shrink: 0;
}

.empty-state-badge svg {
  stroke: #FFFFFF;
  width: 32px !important;
  height: 32px !important;
  min-width: 32px;
  min-height: 32px;
  flex-shrink: 0;
}

.empty-state-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}

.empty-state-text {
  font-size: 0.875rem;
  color: var(--text-tertiary);
  max-width: 280px;
  line-height: 1.5;
  margin-bottom: 20px;
}

/* --- Skeleton Loading --- */
.skeleton {
  background: var(--skeleton-base);
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
}
.skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, var(--skeleton-shine) 50%, transparent 100%);
  animation: shimmer 1.5s infinite;
}
@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* --- Settlement Card --- */
.settlement-card {
  display: flex !important;
  flex-direction: column !important;
  gap: 0 !important;
  padding: 14px 16px !important;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  transition: all var(--transition-fast);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box !important;
  overflow: hidden !important;
}

.settlement-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent-light);
}

.settlement-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: #06B6D4;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 800;
  flex-shrink: 0;
  box-shadow: 0 4px 12px -2px rgba(6, 182, 212, 0.35);
}

.settlement-arrow {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  background: #06B6D4;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(6, 182, 212, 0.3);
}

.settlement-arrow svg {
  stroke: #FFFFFF;
  width: 12px;
  height: 12px;
}

.settlement-amount {
  margin-left: auto;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--accent-dark);
  white-space: nowrap;
  flex-shrink: 0;
}

[data-theme="dark"] .settlement-amount { color: var(--accent); }

/* --- Summary Stats Grid --- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 20px;
  width: 100%;
  box-sizing: border-box;
}

.stat-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 12px 10px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
  box-sizing: border-box;
}

.stat-card > div:last-child {
  min-width: 0;
  flex: 1;
  overflow: hidden;
}

.stat-icon-badge {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: var(--radius-md);
  background: #054A75;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
}

.stat-icon-badge svg {
  stroke: #FFFFFF;
  width: 18px;
  height: 18px;
}

.stat-value {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--accent-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
[data-theme="dark"] .stat-value { color: var(--accent); }

.stat-label {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* --- Bar Chart --- */
.bar-chart {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  box-sizing: border-box;
}

.bar-chart-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

.bar-chart-label {
  width: 68px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 0;
}

.bar-chart-track {
  flex: 1;
  min-width: 0;
  height: 18px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.bar-chart-fill {
  height: 100%;
  background: var(--accent-gradient);
  border-radius: var(--radius-full);
  transition: width var(--transition-slow);
}

.bar-chart-value {
  min-width: 65px;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text-primary);
  text-align: right;
  white-space: nowrap;
  flex-shrink: 0;
}

/* --- Split Input Row --- */
.split-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
}

.split-row-name {
  flex: 1;
  min-width: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.split-row-input {
  width: 95px;
  text-align: right;
}

.split-row-lock {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  color: var(--text-tertiary);
  transition: all var(--transition-fast);
  cursor: pointer;
}

.split-row-lock.locked {
  color: var(--accent);
  background: var(--accent-soft);
}

/* --- Category Picker --- */
.category-picker {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: none;
}
.category-picker::-webkit-scrollbar { display: none; }

.category-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 1.5px solid var(--border-color);
  background: var(--bg-secondary);
  min-width: 72px;
}

.category-item:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.category-item.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: var(--shadow-sm);
}

.category-item span {
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--text-secondary);
}

/* --- Checkbox --- */
.checkbox-input {
  width: 22px;
  height: 22px;
  border: 2px solid var(--border-color);
  border-radius: 6px;
  appearance: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
  flex-shrink: 0;
}

.checkbox-input:checked {
  background: var(--accent);
  border-color: var(--accent);
}

.checkbox-input:checked::after {
  content: '';
  position: absolute;
  left: 6px;
  top: 2px;
  width: 6px;
  height: 11px;
  border: solid #FFFFFF;
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
}

/* --- Animations --- */
.fade-in { animation: fadeIn var(--transition-normal) forwards; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.stagger-item {
  opacity: 0;
  animation: fadeIn var(--transition-normal) forwards;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.section-title {
  font-size: 0.8125rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
}

.header-select {
  padding: 6px 12px;
  font-size: 0.8125rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  outline: none;
  cursor: pointer;
}

.theme-toggle {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* --- Home Page (Responsive Mobile & Laptop Layouts) --- */
.home-container {
  max-width: 520px;
  margin: 0 auto;
  padding: 20px 16px;
}

.desktop-hero-btn {
  display: none !important;
}

.mobile-only-btn {
  display: flex !important;
  margin-bottom: 20px;
}

.home-columns-wrapper {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

@media (min-width: 768px) {
  .home-container {
    max-width: 1360px;
    width: 100%;
    padding: 32px 40px;
  }

  .home-columns-wrapper {
    flex-direction: row;
    gap: 32px;
    align-items: stretch;
  }

  .home-col-main {
    flex: 1 1 50%;
    min-width: 0;
  }

  .home-col-side {
    flex: 1 1 50%;
    min-width: 0;
  }

  .home-hero-card {
    padding: 16px 0;
  }

  .home-hero-logo {
    height: 216px;
    max-width: 680px;
  }
}

.home-hero-card {
  background: transparent;
  border: none;
  color: var(--text-primary);
  border-radius: 0;
  padding: 12px 0;
  text-align: center;
  box-shadow: none;
  margin-bottom: 24px;
  backdrop-filter: none;
}

.hero-cta-btn {
  margin-top: 18px;
  padding: 12px 28px;
  font-size: 1rem;
  font-weight: 700;
}

.home-hero-inner {
  justify-content: center !important;
  text-align: center !important;
}

.home-hero-body {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  width: 100%;
}

.home-hero-logo {
  width: auto;
  height: 76px;
  max-width: 380px;
  object-fit: contain;
  background: transparent;
  padding: 0;
  box-shadow: none;
  border-radius: 0;
  margin: 0 auto 12px auto;
  display: block;
}

.home-tagline {
  font-size: 0.9375rem;
  color: var(--text-secondary);
}

/* Feature Cards Grid */
.home-features-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.feature-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
  backdrop-filter: blur(8px);
  height: 100%;
}

.feature-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent-light);
}

.feature-card-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: #054A75;
  color: #06B6D4;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(5, 74, 117, 0.2);
}

.feature-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.25;
}

.feature-card-desc {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.group-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}

.group-list-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-md);
}

.group-list-item:hover {
  box-shadow: var(--shadow-lg);
  border-color: var(--accent-light);
  transform: translateY(-2px);
}

.group-list-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: #06B6D4;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px -2px rgba(6, 182, 212, 0.35);
}

.group-list-info { flex: 1; min-width: 0; }
.group-list-name { font-size: 1rem; font-weight: 700; }
.group-list-meta { font-size: 0.75rem; color: var(--text-tertiary); margin-top: 2px; }

/* Disclaimer Note */
.disclaimer-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 24px;
  padding: 10px 16px;
  font-size: 0.75rem;
  color: var(--text-tertiary);
  text-align: center;
  opacity: 0.85;
}

.disclaimer-note svg {
  flex-shrink: 0;
  stroke: var(--text-tertiary);
}

/* Spinner */
@keyframes spin {
  to { transform: rotate(360deg); }
}

.spinner {
  border: 3px solid var(--border-color);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* Utilities */
.hidden { display: none !important; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mobile-only { display: block !important; }
.desktop-only { display: none !important; }

@media (min-width: 768px) {
  .mobile-only { display: none !important; }
  .desktop-only { display: inline-flex !important; }
}

/* Mode Toggle Pill with Slider Switch */
.mode-toggle-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 6px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
  transition: all var(--transition-normal);
  cursor: pointer;
  border: 1px solid transparent;
  background: var(--bg-secondary);
  user-select: none;
}

/* Non-interactive Mode Status Badge (for non-home pages) */
.mode-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 700;
  border: 1px solid transparent;
  user-select: none;
  cursor: default;
}

.mode-status-badge.is-online {
  background: var(--success-soft);
  color: var(--success);
  border-color: rgba(13, 148, 136, 0.35);
}

.mode-status-badge.is-offline {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: rgba(239, 68, 68, 0.35);
}

.mode-status-badge .mode-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.mode-toggle-pill.is-online {
  background: var(--success-soft);
  color: var(--success);
  border-color: rgba(13, 148, 136, 0.35);
}

.mode-toggle-pill.is-offline {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: rgba(239, 68, 68, 0.35);
}


/* Sliding Switch Track & Thumb */
.toggle-switch-track {
  width: 30px;
  height: 16px;
  border-radius: 999px;
  background: #CBD5E1;
  position: relative;
  transition: background-color var(--transition-fast);
  display: flex;
  align-items: center;
  padding: 2px;
}

.mode-toggle-pill.is-online .toggle-switch-track {
  background: var(--success);
}

.mode-toggle-pill.is-offline .toggle-switch-track {
  background: var(--danger);
}

.toggle-switch-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #FFFFFF;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  transition: transform var(--transition-fast);
}

.mode-toggle-pill.is-online .toggle-switch-thumb {
  transform: translateX(14px);
}

.mode-toggle-pill.is-offline .toggle-switch-thumb {
  transform: translateX(0px);
}

.mode-label {
  font-weight: 700;
  letter-spacing: -0.01em;
}


/* Home Mode Banner Widget */
.home-mode-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
}

.home-mode-banner.mode-online {
  background: var(--bg-secondary);
  border: 1px solid rgba(13, 148, 136, 0.35);
}

.home-mode-banner.mode-offline {
  background: var(--bg-secondary);
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.mode-banner-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mode-banner-badge {
  font-size: 0.85rem;
  font-weight: 700;
}

.home-mode-banner.mode-online .mode-banner-badge {
  color: var(--success);
}

.home-mode-banner.mode-offline .mode-banner-badge {
  color: var(--danger);
}

.mode-banner-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin: 0;
}

@media (max-width: 640px) {
  .home-mode-banner {
    flex-direction: column;
    align-items: flex-start;
  }
  .home-mode-banner button {
    width: 100%;
  }
}

/* ============================================
   NEW FEATURES — Identity Picker, Settlement
   Clearing, Add Members, Personal Balance
   ============================================ */

/* --- Identity Picker Modal --- */
.identity-picker-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 20px;
}

.identity-picker-icon {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-full);
  background: var(--accent-gradient);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  box-shadow: 0 8px 24px rgba(5, 74, 117, 0.3);
}

.identity-picker-icon svg {
  stroke: #FFFFFF;
  width: 32px;
  height: 32px;
}

.identity-picker-subtitle {
  font-size: 0.875rem;
  color: var(--text-tertiary);
  margin-bottom: 8px;
  line-height: 1.5;
}

.identity-picker-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 50vh;
  overflow-y: auto;
  padding: 4px 0;
}

.identity-picker-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-radius: var(--radius-lg);
  background: var(--bg-tertiary);
  border: 1.5px solid var(--border-color);
  cursor: pointer;
  transition: all var(--transition-fast);
  width: 100%;
  text-align: left;
}

.identity-picker-item:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.identity-picker-item.current {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.identity-picker-avatar {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: #06B6D4;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 800;
  flex-shrink: 0;
  box-shadow: 0 4px 12px -2px rgba(6, 182, 212, 0.35);
}

.identity-picker-name {
  flex: 1;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.identity-current-badge {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.identity-picker-item svg {
  color: var(--text-tertiary);
  flex-shrink: 0;
}

/* --- Identity Avatar Button in Header --- */
.identity-avatar-btn {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  background: #06B6D4;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 800;
  flex-shrink: 0;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all var(--transition-fast);
  box-shadow: 0 2px 8px rgba(6, 182, 212, 0.35);
}

.identity-avatar-btn:hover {
  transform: scale(1.1);
  border-color: var(--accent);
  box-shadow: 0 4px 14px rgba(6, 182, 212, 0.45);
}

/* --- Header Balance Display --- */
.header-balance {
  font-weight: 700;
  font-size: 0.72rem;
}

.header-balance.balance-positive {
  color: #0D9488;
}

.header-balance.balance-negative {
  color: #EF4444;
}

.header-balance.balance-settled {
  color: #0D9488;
}

.header-total-spent {
  font-size: 0.68rem;
  opacity: 0.7;
}

[data-theme="dark"] .header-balance.balance-positive { color: #2dd4bf; }
[data-theme="dark"] .header-balance.balance-negative { color: #f87171; }
[data-theme="dark"] .header-balance.balance-settled { color: #2dd4bf; }

/* --- Personal Balance Banner --- */
.personal-balance-banner {
  background: var(--bg-secondary);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
}

.personal-balance-banner.settled {
  border-color: rgba(13, 148, 136, 0.3);
}

.personal-balance-inner {
  display: flex;
  align-items: center;
  gap: 14px;
}

.personal-balance-avatar {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background: #06B6D4;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 800;
  flex-shrink: 0;
  box-shadow: 0 4px 12px -2px rgba(6, 182, 212, 0.35);
}

.personal-balance-avatar.settled {
  background: #0D9488;
}

.personal-balance-avatar.settled svg {
  stroke: #FFFFFF;
}

.personal-balance-body {
  flex: 1;
  min-width: 0;
}

.personal-balance-name {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 2px;
}

.personal-balance-owe {
  font-size: 0.9375rem;
  color: #EF4444;
}

.personal-balance-owed {
  font-size: 0.9375rem;
  color: #0D9488;
}

.personal-balance-settled {
  font-size: 0.9375rem;
  color: #0D9488;
  font-weight: 600;
}

/* --- Settlement Card with Actions --- */
.settlement-card-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.settlement-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
}

.settlement-name {
  font-size: 0.9375rem;
  font-weight: 700;
}

.btn-settle-clear {
  flex: 1;
  background: rgba(13, 148, 136, 0.12) !important;
  color: #0D9488 !important;
  border: 1px solid rgba(13, 148, 136, 0.25);
  border-radius: var(--radius-full) !important;
  font-weight: 700 !important;
  transition: all var(--transition-fast) !important;
}

.btn-settle-clear:hover {
  background: rgba(13, 148, 136, 0.22) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(13, 148, 136, 0.2);
}

.btn-settle-clear svg {
  stroke: #0D9488;
}

.btn-settle-partial {
  flex: 1;
  background: rgba(5, 74, 117, 0.08) !important;
  color: var(--accent) !important;
  border: 1px solid rgba(5, 74, 117, 0.2);
  border-radius: var(--radius-full) !important;
  font-weight: 700 !important;
  transition: all var(--transition-fast) !important;
}

.btn-settle-partial:hover {
  background: rgba(5, 74, 117, 0.16) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(5, 74, 117, 0.15);
}

.btn-settle-partial svg {
  stroke: var(--accent);
}

[data-theme="dark"] .btn-settle-clear {
  background: rgba(16, 163, 127, 0.15) !important;
  color: #2dd4bf !important;
  border-color: rgba(16, 163, 127, 0.3);
}

[data-theme="dark"] .btn-settle-clear svg { stroke: #2dd4bf; }

[data-theme="dark"] .btn-settle-partial {
  background: rgba(16, 163, 127, 0.1) !important;
  color: #10a37f !important;
  border-color: rgba(16, 163, 127, 0.25);
}

[data-theme="dark"] .btn-settle-partial svg { stroke: #10a37f; }

/* --- Settlement Highlight (You owe / You are owed) --- */
.settlement-highlight-owe {
  border-color: rgba(239, 68, 68, 0.3) !important;
  background: rgba(239, 68, 68, 0.04) !important;
}

.settlement-highlight-owed {
  border-color: rgba(13, 148, 136, 0.3) !important;
  background: rgba(13, 148, 136, 0.04) !important;
}

.you-badge {
  font-size: 0.65rem;
  font-weight: 800;
  color: #FFFFFF;
  background: var(--accent);
  padding: 1px 6px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  vertical-align: middle;
  margin-left: 4px;
}

/* --- Partial Clear Modal --- */
.partial-clear-info {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 16px 0;
}

.partial-clear-from,
.partial-clear-to {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 0.9375rem;
}

.partial-clear-max {
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-secondary);
  padding: 8px 16px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
}

/* --- Payment Expense Card Styling --- */
.expense-category-icon.payment {
  background: #0D9488;
}

.payment-card {
  border-left: 3px solid #0D9488 !important;
}

.payment-desc {
  color: #0D9488 !important;
}

.payment-amount {
  color: #0D9488 !important;
}

[data-theme="dark"] .expense-category-icon.payment {
  background: #10a37f;
}

[data-theme="dark"] .payment-desc,
[data-theme="dark"] .payment-amount {
  color: #2dd4bf !important;
}

[data-theme="dark"] .payment-card {
  border-left-color: #10a37f !important;
}

.payment-count-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  min-height: 24px;
  border-radius: var(--radius-full);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 700;
}

.payment-history-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  border-left: 3px solid #0D9488;
}

.payment-history-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: rgba(13, 148, 136, 0.12);
  color: #0D9488;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.payment-history-icon svg {
  stroke: #0D9488;
}

.payment-history-info {
  flex: 1;
  min-width: 0;
}

.payment-history-desc {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-primary);
}

.payment-history-date {
  font-size: 0.72rem;
  color: var(--text-tertiary);
  margin-top: 1px;
}

.payment-history-amount {
  font-size: 1rem;
  font-weight: 800;
  color: #0D9488;
  white-space: nowrap;
}

.payment-history-delete {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  margin-left: 4px;
}

.payment-history-delete:hover {
  background: rgba(239, 68, 68, 0.12);
  color: var(--danger);
}

.payment-history-delete svg {
  stroke: currentColor;
}

/* Preset Chips for Partial Payment */
.preset-chips {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.preset-chip {
  padding: 6px 12px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  background: var(--bg-tertiary);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.preset-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.preset-chip.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #FFFFFF;
}

.partial-calc-preview {
  margin-top: 14px;
  padding: 12px 14px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
}

.partial-calc-label {
  color: var(--text-secondary);
}

.partial-calc-val {
  font-weight: 800;
  color: var(--text-primary);
}

[data-theme="dark"] .payment-history-card {
  border-left-color: #10a37f;
}

[data-theme="dark"] .payment-history-icon {
  background: rgba(16, 163, 127, 0.15);
  color: #2dd4bf;
}

[data-theme="dark"] .payment-history-icon svg { stroke: #2dd4bf; }
[data-theme="dark"] .payment-history-amount { color: #2dd4bf; }

/* --- Add Member Bubble --- */
.add-member-bubble {
  cursor: pointer;
}

.add-member-avatar {
  background: var(--bg-tertiary) !important;
  color: var(--accent) !important;
  border: 2px dashed var(--border-color);
  box-shadow: none !important;
  transition: all var(--transition-fast);
}

.add-member-avatar svg {
  stroke: var(--accent) !important;
}

.add-member-bubble:hover .add-member-avatar {
  background: var(--accent-soft) !important;
  border-color: var(--accent);
  transform: scale(1.05);
}

/* --- Current Members List in Add Member Modal --- */
.current-members-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 0;
}

.current-member-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 4px;
  border-radius: var(--radius-full);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
}

/* --- Desktop Identity Pill Button in Header --- */
.desktop-identity-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 3px 12px 3px 4px;
  border-radius: var(--radius-full);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition-fast);
  height: 34px;
  user-select: none;
}

.desktop-identity-pill:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.desktop-identity-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #06B6D4;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
  flex-shrink: 0;
}

.desktop-identity-name {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.desktop-identity-admin-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  margin-left: 2px;
}

.desktop-identity-admin-icon svg {
  stroke: var(--accent);
  width: 14px;
  height: 14px;
}

.desktop-identity-readonly-tag {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  background: rgba(100, 116, 139, 0.15);
  color: var(--text-tertiary);
  margin-left: 4px;
}

/* --- Admin Settings & Permissions Modal --- */
.admin-card-section {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px;
}

.admin-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.admin-section-title svg {
  stroke: var(--accent);
}

.admin-current-info {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.admin-badge-standard {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid rgba(5, 74, 117, 0.2);
}

/* --- Admin PIN Security Components --- */
.admin-pin-status-box {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}

.pin-status-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  background: rgba(100, 116, 139, 0.15);
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pin-status-icon.protected {
  background: var(--accent-soft);
  color: var(--accent);
}

.pin-status-icon.protected svg {
  stroke: var(--accent);
}

.pin-modal-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 16px;
}

.pin-shield-badge {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-full);
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  box-shadow: 0 4px 14px rgba(5, 74, 117, 0.15);
}

.pin-shield-badge svg {
  stroke: var(--accent);
}

.pin-input-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 0;
}

.pin-digit-boxes {
  display: flex;
  gap: 12px;
  position: relative;
  cursor: pointer;
}

.pin-hidden-input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 10;
}

.pin-box {
  width: 48px;
  height: 54px;
  border-radius: var(--radius-md);
  border: 2px solid var(--border-color);
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent);
  transition: all var(--transition-fast);
}

.pin-box.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  background: var(--bg-secondary);
}

.pin-box.filled {
  border-color: var(--accent);
  background: var(--bg-secondary);
}

.pin-shake {
  animation: pinShake 0.4s ease-in-out;
}

@keyframes pinShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}

.pin-error-msg {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--danger);
  margin-top: 10px;
  text-align: center;
}

.admin-notice-box {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.admin-notice-box svg {
  stroke: var(--accent);
  flex-shrink: 0;
  margin-top: 1px;
}

.admin-transfer-box {
  padding-top: 14px;
  margin-top: 14px;
  border-top: 1px solid var(--border-color);
}

.admin-access-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.permission-member-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.permission-member-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  min-width: 0;
}

.permission-member-info {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
  overflow: hidden;
}

.permission-member-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.permission-member-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #06B6D4;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 800;
  flex-shrink: 0;
}

.perm-segment {
  display: flex;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 2px;
  gap: 2px;
  flex-shrink: 0;
}

.perm-segment-global {
  background: var(--bg-tertiary);
}

.perm-segment-global .perm-segment-btn {
  padding: 4px 10px;
  font-size: 0.7rem;
}

.perm-segment-btn {
  border: none;
  background: transparent;
  padding: 6px 14px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-tertiary);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.perm-segment-btn.active {
  background: var(--accent);
  color: #FFFFFF;
  box-shadow: var(--shadow-sm);
}

[data-theme="dark"] .perm-segment-btn.active {
  background: #10a37f;
  color: #FFFFFF;
}

[data-theme="dark"] .admin-badge-standard {
  background: rgba(16, 163, 127, 0.15);
  color: #10a37f;
  border-color: rgba(16, 163, 127, 0.3);
}

.current-member-avatar {
  width: 26px;
  height: 26px;
  border-radius: var(--radius-full);
  background: #06B6D4;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 800;
  flex-shrink: 0;
}

.remove-member-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.12);
  color: #EF4444;
  border: none;
  cursor: pointer;
  margin-left: 2px;
  padding: 0;
  transition: all var(--transition-fast);
}

.remove-member-btn:hover {
  background: #EF4444;
  color: #FFFFFF;
  transform: scale(1.15);
}

.remove-member-btn svg {
  stroke: currentColor;
  width: 12px;
  height: 12px;
}

/* --- Member Removal Options Modal --- */
.member-removal-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 12px;
}

.member-removal-avatar {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background: #EF4444;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 800;
  margin-bottom: 8px;
  box-shadow: 0 6px 18px rgba(239, 68, 68, 0.3);
}

.member-removal-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  margin-top: 2px;
}

.member-removal-badge.owe-badge {
  background: rgba(13, 148, 136, 0.12);
  color: #0D9488;
  border: 1px solid rgba(13, 148, 136, 0.3);
}

.member-removal-badge.debt-badge {
  background: rgba(239, 68, 68, 0.12);
  color: #EF4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.member-removal-badge.zero-badge {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.removal-options-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.removal-option-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: var(--bg-tertiary);
  border: 1.5px solid var(--border-color);
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.removal-option-card:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.removal-option-card.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: var(--shadow-sm);
}

.removal-option-card input[type="radio"] {
  margin-top: 3px;
  accent-color: var(--accent);
}

.removal-option-body {
  flex: 1;
}

.removal-option-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.rec-tag {
  font-size: 0.65rem;
  font-weight: 800;
  color: #FFFFFF;
  background: #0D9488;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.removal-option-desc {
  font-size: 0.78rem;
  color: var(--text-tertiary);
  margin-top: 4px;
  line-height: 1.4;
}

.option-info-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(5, 74, 117, 0.08);
  color: var(--accent);
  border: none;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.option-info-btn:hover {
  background: var(--accent);
  color: #FFFFFF;
  transform: scale(1.1);
}

.option-info-btn svg {
  stroke: currentColor;
  width: 14px;
  height: 14px;
}

.option-info-box {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  font-size: 0.78rem;
  line-height: 1.45;
  animation: fadeIn 0.15s ease-out;
}

.info-box-heading {
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 4px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.info-box-text {
  color: var(--text-secondary);
}

.info-box-text strong {
  color: var(--text-primary);
}

/* --- Bubble Crush / Poof Delete Animation --- */
@keyframes bubbleCrush {
  0% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
    filter: blur(0px);
  }
  30% {
    transform: scale(1.12) rotate(-4deg);
    opacity: 0.95;
  }
  60% {
    transform: scale(0.4) rotate(8deg);
    opacity: 0.5;
    filter: blur(2px);
  }
  100% {
    transform: scale(0) rotate(-20deg);
    opacity: 0;
    filter: blur(6px);
  }
}

.anim-bubble-crush {
  animation: bubbleCrush 0.4s cubic-bezier(0.36, 0, 0.66, -0.56) forwards !important;
  pointer-events: none !important;
  overflow: hidden !important;
}

.expense-amount-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}

.expense-card-desktop-delete {
  display: none;
}

@media (min-width: 768px) {
  .expense-card-desktop-delete {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 32px !important;
    height: 32px !important;
    border-radius: 50% !important;
    background: rgba(239, 68, 68, 0.12) !important;
    color: #EF4444 !important;
    border: 1px solid rgba(239, 68, 68, 0.3) !important;
    cursor: pointer !important;
    padding: 0 !important;
    transition: all var(--transition-fast) !important;
    flex-shrink: 0 !important;
    margin-left: 4px;
  }

  .expense-card-desktop-delete:hover {
    background: #EF4444 !important;
    color: #FFFFFF !important;
    border-color: #EF4444 !important;
    transform: scale(1.12) !important;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.35) !important;
  }

  .expense-card-desktop-delete svg {
    stroke: currentColor !important;
    width: 15px !important;
    height: 15px !important;
  }
}

/* --- Utility Text Classes --- */
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-tertiary { color: var(--text-tertiary); }
.text-secondary { color: var(--text-secondary); }
.text-success { color: #0D9488; }
.text-danger { color: #EF4444; }
.font-semibold { font-weight: 600; }
.divider { height: 1px; background: var(--border-color); margin: 8px 0; }
.flex { display: flex; }
.justify-between { justify-content: space-between; }
.items-center { align-items: center; }

/* --- Detailed Summary & Analytics Modal Styles --- */
.analytics-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.analytics-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.analytics-subtitle {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  margin-top: 2px;
}

.analytics-close-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.analytics-close-btn:hover {
  background: #EF4444;
  color: #FFFFFF;
  border-color: #EF4444;
}

.analytics-tabs-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 6px;
  width: 100%;
  margin-bottom: 16px;
  box-sizing: border-box;
}

.analytics-tab-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 5px !important;
  padding: 6px 12px !important;
  border-radius: var(--radius-full) !important;
  font-size: 0.78rem !important;
  font-weight: 700 !important;
  background: var(--bg-tertiary) !important;
  color: var(--text-secondary) !important;
  border: 1.5px solid var(--border-color) !important;
  cursor: pointer !important;
  white-space: nowrap !important;
  line-height: 1.2 !important;
  box-sizing: border-box !important;
  transition: all var(--transition-fast) !important;
  -webkit-tap-highlight-color: transparent;
}

.analytics-tab-btn:hover {
  background: var(--bg-secondary) !important;
  color: var(--text-primary) !important;
  border-color: var(--accent) !important;
}

.analytics-tab-btn.active {
  background: var(--accent) !important;
  color: #FFFFFF !important;
  border-color: var(--accent) !important;
  box-shadow: 0 3px 10px rgba(5, 74, 117, 0.25) !important;
}

.analytics-tab-btn.active svg {
  stroke: #FFFFFF !important;
}

[data-theme="dark"] .analytics-tab-btn.active {
  background: #10a37f !important;
  border-color: #10a37f !important;
  color: #FFFFFF !important;
}

.analytics-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 70vh;
  overflow-y: auto;
}

.analytics-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.analytics-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.analytics-card-title {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Budget Gauge Visual */
.budget-status-badge {
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.budget-status-badge.status-good {
  background: rgba(13, 148, 136, 0.15);
  color: #0D9488;
  border: 1px solid rgba(13, 148, 136, 0.3);
}

.budget-status-badge.status-warning {
  background: rgba(245, 158, 11, 0.15);
  color: #F59E0B;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.budget-status-badge.status-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #EF4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.gauge-container {
  position: relative;
  width: 180px;
  height: 100px;
  margin: 0 auto 10px auto;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.gauge-svg {
  width: 100%;
  height: 100%;
}

.gauge-center-text {
  position: absolute;
  bottom: 0;
  text-align: center;
}

.gauge-pct-value {
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--text-primary);
  line-height: 1;
}

.gauge-pct-label {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 2px;
}

.budget-metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
  text-align: center;
}

.metric-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-tertiary);
  text-transform: uppercase;
}

.metric-val {
  font-size: 0.875rem;
  font-weight: 800;
  margin-top: 2px;
}

/* Donut Chart Visual */
.donut-chart-wrapper {
  position: relative;
  width: 160px;
  height: 160px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.donut-svg {
  width: 100%;
  height: 100%;
}

.donut-center-info {
  position: absolute;
  text-align: center;
}

.donut-center-val {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-primary);
}

.donut-center-label {
  font-size: 0.65rem;
  color: var(--text-tertiary);
  text-transform: uppercase;
}

.category-legend-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.category-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
}

.category-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.category-legend-name {
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.category-legend-val {
  font-weight: 700;
  color: var(--text-primary);
  font-size: 0.72rem;
  flex-shrink: 0;
}

/* Trend Line Chart Visual */
.trend-chart-container {
  width: 100%;
  height: 140px;
}

.trend-svg {
  width: 100%;
  height: 100%;
}

.trend-date-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--text-tertiary);
  font-weight: 600;
}

/* Member Analytics List */
.member-analytics-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.member-analytics-row {
  display: flex;
  flex-direction: column;
}

.member-analytics-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.member-analytics-amount {
  font-size: 0.85rem;
  font-weight: 800;
}

/* --- Main Page Budget Card & Banner --- */
.main-budget-card {
  background: var(--bg-secondary);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
}

.main-budget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.main-budget-title {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.main-budget-progress-track {
  width: 100%;
  height: 14px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 10px;
}

.main-budget-progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width var(--transition-slow);
}

.main-budget-metrics {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.main-budget-empty-banner {
  background: var(--bg-secondary);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-lg);
  padding: 12px 16px;
}

.member-analytics-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.member-analytics-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 14px;
}

.member-analytics-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.member-analytics-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.member-analytics-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
}

.member-analytics-amount {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--text-primary);
}

.member-analytics-bar-track {
  width: 100%;
  height: 8px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.member-analytics-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width var(--transition-slow);
}

.member-analytics-bottom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.72rem;
}

.member-diff-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  line-height: 1.2;
}

.member-diff-badge.above {
  background: rgba(13, 148, 136, 0.15);
  color: #0D9488;
}

.member-diff-badge.below {
  background: rgba(239, 68, 68, 0.15);
  color: #EF4444;
}

/* Interactive Chart Hover Styles */
.donut-segment-ring:hover {
  stroke-width: 24px !important;
  opacity: 1 !important;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.25));
}

.category-legend-item {
  cursor: pointer;
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
}

.category-legend-item:hover {
  background: var(--bg-tertiary);
}

.trend-hover-info {
  font-size: 0.76rem;
  color: var(--text-secondary);
  background: var(--bg-tertiary);
  padding: 6px 12px;
  border-radius: var(--radius-md);
  text-align: center;
  border: 1px solid var(--border-color);
  min-height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

@media (min-width: 768px) {
  .modal-content.analytics-modal-content {
    width: 780px !important;
    max-width: 92vw !important;
    max-height: 88vh !important;
    max-height: 88dvh !important;
    padding: 28px 24px 24px 24px !important;
  }

  .modal-content.analytics-modal-content .analytics-body {
    max-height: 72vh !important;
  }

  .modal-content.analytics-modal-content .category-legend-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

/* Admin Recovery Key Card */
.admin-recovery-card {
  padding: 10px 12px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.recovery-key-text {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.92rem;
  letter-spacing: 1.2px;
  color: var(--accent);
}

/* Itemized Badge */
.badge-itemized {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 6px;
  background: rgba(6, 182, 212, 0.14);
  color: #06B6D4;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

/* Multi-Payer Component */
.payer-mode-toggle {
  display: flex;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 2px;
  margin-bottom: 8px;
}

.payer-mode-btn {
  flex: 1;
  border: none;
  background: transparent;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-tertiary);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: center;
}

.payer-mode-btn.active {
  background: var(--bg-primary);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

.multi-payer-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.multi-payer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.multi-payer-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #06B6D4;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 800;
  flex-shrink: 0;
}

/* Itemized Split Builder */
.itemized-builder {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.itemized-item-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  position: relative;
}

.itemized-member-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.itemized-chip {
  padding: 3px 8px;
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.itemized-chip.active {
  background: var(--accent);
  color: #FFFFFF;
  border-color: var(--accent);
}

.itemized-summary-bar {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.item-split-mode-btn {
  border: none;
  background: transparent;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  cursor: pointer;
  color: var(--text-tertiary);
  transition: all var(--transition-fast);
}

.item-split-mode-btn.active {
  background: var(--bg-primary);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

/* --- Split Mode Tabs Container (Mobile Grid Fitted - No Scrolling) --- */
.split-type-tabs {
  display: grid !important;
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  gap: 2px !important;
  padding: 3px !important;
  background: var(--bg-tertiary) !important;
  border: 1.5px solid var(--border-color) !important;
  border-radius: var(--radius-full) !important;
  width: 100% !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}

.split-tab-item {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 2px !important;
  padding: 6px 2px !important;
  font-size: 0.6875rem !important;
  font-weight: 700 !important;
  color: var(--text-tertiary) !important;
  background: transparent !important;
  border: 1px solid transparent !important;
  border-radius: var(--radius-full) !important;
  cursor: pointer !important;
  white-space: nowrap !important;
  user-select: none !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
  text-align: center !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.split-tab-item .tab-icon {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  line-height: 1 !important;
}

.split-tab-item:hover {
  color: var(--text-primary) !important;
}

/* Selected Active Highlight Styling */
.split-tab-item.active {
  background: var(--bg-primary) !important;
  color: var(--accent) !important;
  border-color: var(--border-color) !important;
  box-shadow: var(--shadow-sm) !important;
  font-weight: 800 !important;
  transform: scale(1.02) !important;
}

[data-theme="dark"] .split-tab-item.active {
  background: var(--accent) !important;
  color: #FFFFFF !important;
  border-color: var(--accent) !important;
  box-shadow: 0 2px 8px rgba(6, 182, 212, 0.4) !important;
}

@media (min-width: 600px) {
  .split-tab-item {
    flex-direction: row !important;
    gap: 5px !important;
    padding: 8px 6px !important;
    font-size: 0.8125rem !important;
  }
}

/* --- Settlement Header & Filter Toggle --- */
.settlement-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.settlement-filter-toggle {
  display: inline-flex;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 3px;
  gap: 3px;
}

.settle-toggle-btn {
  border: none;
  background: transparent;
  padding: 5px 12px;
  font-size: 0.775rem;
  font-weight: 600;
  color: var(--text-tertiary);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  user-select: none;
}

.settle-toggle-btn:hover {
  color: var(--text-primary);
}

.settle-toggle-btn.active {
  background: var(--bg-primary);
  color: var(--accent);
  box-shadow: var(--shadow-sm);
  font-weight: 700;
}

[data-theme="dark"] .settle-toggle-btn.active {
  background: var(--accent);
  color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(6, 182, 212, 0.35);
}

/* --- Admin Member Chip & Lock Icon --- */
.current-member-chip.is-admin-chip {
  border-color: rgba(245, 158, 11, 0.4);
  background: rgba(245, 158, 11, 0.08);
}

.remove-member-btn.disabled-admin-lock {
  opacity: 0.6;
  cursor: not-allowed;
  color: var(--text-tertiary);
}

.remove-member-btn.disabled-admin-lock:hover {
  opacity: 1;
  color: #f59e0b;
}

/* --- PWA App Install Banner --- */
.pwa-install-card {
  position: relative;
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, rgba(13, 148, 136, 0.08) 0%, rgba(6, 182, 212, 0.12) 100%);
  border: 1.5px solid rgba(13, 148, 136, 0.25);
  padding: 16px 20px;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
}

[data-theme="dark"] .pwa-install-card {
  background: linear-gradient(135deg, rgba(13, 148, 136, 0.18) 0%, rgba(6, 182, 212, 0.25) 100%);
  border-color: rgba(45, 212, 191, 0.4);
}

.pwa-close-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.06);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

[data-theme="dark"] .pwa-close-btn {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
}

.pwa-close-btn:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #EF4444;
}

.pwa-install-inner {
  display: flex;
  align-items: center;
  gap: 16px;
}

.pwa-install-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pwa-install-content {
  flex: 1;
  min-width: 0;
  padding-right: 20px;
}

.pwa-install-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--accent);
  margin-bottom: 2px;
  text-transform: uppercase;
}

.pwa-install-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.25;
}

.pwa-install-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 4px;
  line-height: 1.4;
}

.pwa-install-action {
  flex-shrink: 0;
}

@media (max-width: 640px) {
  .pwa-install-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .pwa-install-action {
    width: 100%;
  }
  .pwa-install-action .btn {
    width: 100%;
    justify-content: center;
  }
  .pwa-install-content {
    padding-right: 16px;
  }
}

/* --- Animated App Launch & Loading Splash Screen --- */
.app-splash-screen {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary, #FFFFFF);
  transition: opacity 0.45s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.45s ease;
  user-select: none;
  overflow: hidden;
}

[data-theme="dark"] .app-splash-screen {
  background: #0F172A;
}

.app-splash-screen.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.splash-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
}

.splash-logo-wrapper {
  width: 90px;
  height: 90px;
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(13, 148, 136, 0.12) 0%, rgba(6, 182, 212, 0.18) 100%);
  border: 1.5px solid rgba(13, 148, 136, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 22px;
  box-shadow: 0 14px 36px rgba(13, 148, 136, 0.2);
  animation: splashLogoPop 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  opacity: 0;
  transform: scale(0.4);
}

[data-theme="dark"] .splash-logo-wrapper {
  background: linear-gradient(135deg, rgba(13, 148, 136, 0.28) 0%, rgba(6, 182, 212, 0.35) 100%);
  border-color: rgba(45, 212, 191, 0.45);
  box-shadow: 0 14px 36px rgba(6, 182, 212, 0.3);
}

.splash-logo-img {
  width: 60px;
  height: 60px;
  object-fit: contain;
  background: transparent !important;
  filter: drop-shadow(0 6px 14px rgba(13, 148, 136, 0.35));
}

.splash-text-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Heading: Split to Join (SPL + ITO) */
.splash-app-title {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 2.75rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #0D9488 0%, #06B6D4 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 0 0 8px 0;
  line-height: 1.1;
}

[data-theme="dark"] .splash-app-title {
  background: linear-gradient(135deg, #2DD4BF 0%, #38BDF8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.split-title-left {
  display: inline-block;
  opacity: 0;
  transform: translateX(-48px);
  animation: splitTitleLeft 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.15s forwards;
  will-change: transform, opacity;
}

.split-title-right {
  display: inline-block;
  opacity: 0;
  transform: translateX(48px);
  animation: splitTitleRight 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.15s forwards;
  will-change: transform, opacity;
}

/* Tagline: Smooth Transition with Dynamic Flipping Word */
.splash-tagline {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-secondary, #64748B);
  margin: 0;
  line-height: 1.35;
  opacity: 0;
  transform: translateY(8px);
  animation: taglineSmoothFade 0.85s cubic-bezier(0.22, 1, 0.36, 1) 0.5s forwards;
  transition: opacity 0.4s ease, transform 0.4s ease;
  will-change: transform, opacity;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
  white-space: nowrap;
}

[data-theme="dark"] .splash-tagline {
  color: #94A3B8;
}

.splash-tagline-prefix {
  display: inline-block;
  white-space: pre;
}

.splash-flip-container {
  display: inline-grid;
  vertical-align: top;
  position: relative;
  overflow: hidden;
  height: 1.35em;
  text-align: left;
}

.splash-flip-word {
  grid-area: 1 / 1;
  display: inline-block;
  white-space: nowrap;
  will-change: transform, opacity;
}

.word-friends {
  color: var(--accent, #0D9488);
  font-weight: 700;
  opacity: 1;
  transform: translateY(0);
  animation: slideOutWord 0.75s cubic-bezier(0.4, 0, 0.2, 1) 1.2s forwards;
}

.word-effortless {
  color: var(--sky-blue, #00A8CC);
  font-weight: 700;
  opacity: 0;
  transform: translateY(110%);
  animation: slideInWord 0.75s cubic-bezier(0.4, 0, 0.2, 1) 1.2s forwards;
}

/* Ensure PNG logos have 100% transparent backgrounds */
img[src*="logo"], .home-hero-logo, .hero-banner-logo {
  background: transparent !important;
  object-fit: contain !important;
}

@keyframes splashLogoPop {
  0% {
    opacity: 0;
    transform: scale(0.35) rotate(-12deg);
  }
  60% {
    opacity: 1;
    transform: scale(1.08) rotate(2deg);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
}

@keyframes splitTitleLeft {
  0% {
    opacity: 0;
    transform: translateX(-48px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes splitTitleRight {
  0% {
    opacity: 0;
    transform: translateX(48px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes taglineSmoothFade {
  0% {
    opacity: 0;
    transform: translateY(8px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideOutWord {
  0% {
    opacity: 1;
    transform: translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateY(-115%);
  }
}

@keyframes slideInWord {
  0% {
    opacity: 0;
    transform: translateY(115%);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================
   SPLITO — Admin Audit Log & Activity Timeline
   ============================================ */
.audit-count-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--accent-soft, rgba(13, 148, 136, 0.12));
  color: var(--accent, #0D9488);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.audit-log-box {
  background: var(--bg-secondary, #F8FAFC);
  border: 1px solid var(--border-color, #E2E8F0);
  border-radius: var(--radius-lg, 12px);
  padding: 14px;
  max-height: 280px;
  overflow-y: auto;
  overflow-x: hidden;
}

[data-theme="dark"] .audit-log-box {
  background: rgba(15, 23, 42, 0.6);
  border-color: rgba(51, 65, 85, 0.7);
}

.audit-log-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 28px 16px;
  color: var(--text-tertiary, #94A3B8);
  text-align: center;
  font-size: 0.85rem;
}

.audit-timeline {
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  padding-left: 6px;
}

.audit-timeline-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  position: relative;
}

.audit-timeline-item:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 26px;
  left: 13px;
  bottom: -12px;
  width: 2px;
  background: var(--border-color, #E2E8F0);
  z-index: 1;
}

[data-theme="dark"] .audit-timeline-item:not(:last-child)::after {
  background: rgba(51, 65, 85, 0.6);
}

.audit-timeline-badge {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  z-index: 2;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.audit-timeline-body {
  flex: 1;
  min-width: 0;
  background: var(--bg-primary, #FFFFFF);
  border: 1px solid var(--border-color, #E2E8F0);
  border-radius: var(--radius-md, 8px);
  padding: 10px 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

[data-theme="dark"] .audit-timeline-body {
  background: #1E293B;
  border-color: rgba(51, 65, 85, 0.8);
}

.audit-timeline-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}

.audit-badge-pill {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border-radius: var(--radius-full);
}

.audit-time {
  font-size: 0.72rem;
  color: var(--text-tertiary, #94A3B8);
  font-weight: 500;
}

.audit-details-text {
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--text-primary, #0F172A);
  line-height: 1.35;
  word-break: break-word;
}

[data-theme="dark"] .audit-details-text {
  color: #F1F5F9;
}

.audit-actor-row {
  display: flex;
  align-items: center;
  margin-top: 6px;
}

.audit-actor-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  color: var(--text-secondary, #64748B);
  background: var(--bg-secondary, #F1F5F9);
  padding: 2px 7px;
  border-radius: var(--radius-full);
}

[data-theme="dark"] .audit-actor-pill {
  background: rgba(15, 23, 42, 0.5);
  color: #94A3B8;
}

.audit-actor-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent, #0D9488);
}

/* Category Specific Badge Styling */
.audit-badge-security {
  background: rgba(245, 158, 11, 0.15);
  color: #D97706;
  border: 1px solid rgba(245, 158, 11, 0.3);
}
.audit-timeline-badge.audit-badge-security {
  background: #FEF3C7;
  color: #D97706;
}
[data-theme="dark"] .audit-timeline-badge.audit-badge-security {
  background: rgba(245, 158, 11, 0.25);
  color: #FBBF24;
}

.audit-badge-admin {
  background: rgba(139, 92, 246, 0.15);
  color: #7C3AED;
  border: 1px solid rgba(139, 92, 246, 0.3);
}
.audit-timeline-badge.audit-badge-admin {
  background: #EDE9FE;
  color: #7C3AED;
}
[data-theme="dark"] .audit-timeline-badge.audit-badge-admin {
  background: rgba(139, 92, 246, 0.25);
  color: #A78BFA;
}

.audit-badge-perm {
  background: rgba(59, 130, 246, 0.15);
  color: #2563EB;
  border: 1px solid rgba(59, 130, 246, 0.3);
}
.audit-timeline-badge.audit-badge-perm {
  background: #DBEAFE;
  color: #2563EB;
}
[data-theme="dark"] .audit-timeline-badge.audit-badge-perm {
  background: rgba(59, 130, 246, 0.25);
  color: #60A5FA;
}

.audit-badge-add {
  background: rgba(16, 185, 129, 0.15);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.audit-timeline-badge.audit-badge-add {
  background: #D1FAE5;
  color: #059669;
}
[data-theme="dark"] .audit-timeline-badge.audit-badge-add {
  background: rgba(16, 185, 129, 0.25);
  color: #34D399;
}

.audit-badge-remove {
  background: rgba(239, 68, 68, 0.15);
  color: #DC2626;
  border: 1px solid rgba(239, 68, 68, 0.3);
}
.audit-timeline-badge.audit-badge-remove {
  background: #FEE2E2;
  color: #DC2626;
}
[data-theme="dark"] .audit-timeline-badge.audit-badge-remove {
  background: rgba(239, 68, 68, 0.25);
  color: #F87171;
}

.audit-badge-budget {
  background: rgba(6, 182, 212, 0.15);
  color: #0891B2;
  border: 1px solid rgba(6, 182, 212, 0.3);
}
.audit-timeline-badge.audit-badge-budget {
  background: #CFFAFE;
  color: #0891B2;
}
[data-theme="dark"] .audit-timeline-badge.audit-badge-budget {
  background: rgba(6, 182, 212, 0.25);
  color: #38BDF8;
}

.audit-badge-settings {
  background: rgba(100, 116, 139, 0.15);
  color: #475569;
  border: 1px solid rgba(100, 116, 139, 0.3);
}
.audit-timeline-badge.audit-badge-settings {
  background: #F1F5F9;
  color: #475569;
}
[data-theme="dark"] .audit-timeline-badge.audit-badge-settings {
  background: rgba(100, 116, 139, 0.25);
  color: #CBD5E1;
}

.audit-badge-payment {
  background: rgba(16, 185, 129, 0.15);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.audit-timeline-badge.audit-badge-payment {
  background: #D1FAE5;
  color: #059669;
}
[data-theme="dark"] .audit-timeline-badge.audit-badge-payment {
  background: rgba(16, 185, 129, 0.25);
  color: #34D399;
}

.audit-badge-created {
  background: rgba(13, 148, 136, 0.15);
  color: #0D9488;
  border: 1px solid rgba(13, 148, 136, 0.3);
}
.audit-timeline-badge.audit-badge-created {
  background: #CCFBF1;
  color: #0D9488;
}
[data-theme="dark"] .audit-timeline-badge.audit-badge-created {
  background: rgba(13, 148, 136, 0.25);
  color: #2DD4BF;
}

.audit-badge-expense {
  background: rgba(13, 148, 136, 0.15);
  color: #0D9488;
  border: 1px solid rgba(13, 148, 136, 0.3);
}
.audit-timeline-badge.audit-badge-expense {
  background: #CCFBF1;
  color: #0D9488;
}
[data-theme="dark"] .audit-timeline-badge.audit-badge-expense {
  background: rgba(13, 148, 136, 0.25);
  color: #2DD4BF;
}

.audit-badge-edit {
  background: rgba(245, 158, 11, 0.15);
  color: #D97706;
  border: 1px solid rgba(245, 158, 11, 0.3);
}
.audit-timeline-badge.audit-badge-edit {
  background: #FEF3C7;
  color: #D97706;
}
[data-theme="dark"] .audit-timeline-badge.audit-badge-edit {
  background: rgba(245, 158, 11, 0.25);
  color: #FBBF24;
}

.audit-badge-restore {
  background: rgba(99, 102, 241, 0.15);
  color: #4F46E5;
  border: 1px solid rgba(99, 102, 241, 0.3);
}
.audit-timeline-badge.audit-badge-restore {
  background: #E0E7FF;
  color: #4F46E5;
}
[data-theme="dark"] .audit-timeline-badge.audit-badge-restore {
  background: rgba(99, 102, 241, 0.25);
  color: #818CF8;
}

.audit-badge-default {
  background: rgba(100, 116, 139, 0.15);
  color: #475569;
}
.audit-timeline-badge.audit-badge-default {
  background: #F1F5F9;
  color: #64748B;
}


/* Feedback Button in Header */
.btn-feedback-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  border-radius: 20px;
  color: var(--text-primary);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-feedback-pill:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}

.btn-feedback-pill:active {
  transform: translateY(0);
}

.btn-feedback-pill svg {
  color: var(--accent);
  flex-shrink: 0;
}

/* ============================================
   Feedback Modal
   ============================================ */
.feedback-modal-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.feedback-modal-subtitle {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 24px;
  line-height: 1.5;
}

.feedback-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.feedback-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.feedback-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
}

.feedback-required {
  color: #EF4444;
  font-weight: 700;
}

.feedback-optional {
  color: var(--text-secondary);
  font-weight: 400;
  font-size: 0.78rem;
}

/* Type Pills */
.feedback-type-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.feedback-type-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  border-radius: 20px;
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.feedback-type-pill:hover {
  border-color: var(--accent);
  color: var(--text-primary);
  background: var(--accent-soft);
}

.feedback-type-pill.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.1);
}

[data-theme="dark"] .feedback-type-pill.active {
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.2);
}

.feedback-pill-emoji {
  font-size: 1rem;
  line-height: 1;
}

.feedback-pill-label {
  line-height: 1;
}

/* Textarea */
.feedback-textarea {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  border-radius: 10px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.85rem;
  line-height: 1.6;
  resize: vertical;
  min-height: 100px;
  max-height: 240px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.feedback-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.1);
}

.feedback-textarea::placeholder {
  color: var(--text-secondary);
  opacity: 0.7;
}

/* Character Counter */
.feedback-char-counter {
  font-size: 0.72rem;
  color: var(--text-secondary);
  text-align: right;
  font-variant-numeric: tabular-nums;
  transition: color 0.2s;
}

.feedback-char-counter.near-limit {
  color: #F59E0B;
  font-weight: 600;
}

/* Email Input */
.feedback-email-input {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  border-radius: 10px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.feedback-email-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.1);
}

.feedback-email-input::placeholder {
  color: var(--text-secondary);
  opacity: 0.7;
}

/* Submit Button */
.feedback-submit-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 4px;
}

.feedback-submit-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ============================================
   SPLITO — Home Page About Section & Hero Graphic
   ============================================ */

:root {
  --theme-wallet-from: #054A75;
  --theme-wallet-to: #022b45;
  --theme-card-from: #0D9488;
  --theme-card-to: #06B6D4;
  --theme-chart-from: #06B6D4;
  --theme-chart-to: #0D9488;
  --theme-backdrop-panel: #E0F2FE;
  --theme-backdrop-accent: #FEF08A;
}

[data-theme="dark"] {
  --theme-wallet-from: #10a37f;
  --theme-wallet-to: #054a3b;
  --theme-card-from: #06b6d4;
  --theme-card-to: #0e7490;
  --theme-chart-from: #10a37f;
  --theme-chart-to: #06b6d4;
  --theme-backdrop-panel: #262626;
  --theme-backdrop-accent: #333333;
}

.home-about-section {
  width: 100%;
  margin-top: 24px;
  margin-bottom: 24px;
}

.about-card-container {
  display: flex;
  flex-direction: column;
  gap: 28px;
  background: var(--bg-secondary);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
  transition: border-color var(--transition-normal), box-shadow var(--transition-normal);
}

.about-card-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #054A75 0%, #06B6D4 50%, #0D9488 100%);
}

[data-theme="dark"] .about-card-container::before {
  background: linear-gradient(90deg, #10a37f 0%, #06b6d4 50%, #19c37d 100%);
}

@media (min-width: 900px) {
  .about-card-container {
    flex-direction: row;
    align-items: center;
    padding: 32px;
    gap: 36px;
  }
}

.about-content-side {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.about-visual-side {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Made in Udupi Badge */
.about-badge-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.badge-udupi {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  background: var(--accent-soft);
  border: 1px solid rgba(5, 74, 117, 0.2);
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.01em;
  box-shadow: 0 2px 8px rgba(5, 74, 117, 0.06);
}

[data-theme="dark"] .badge-udupi {
  border-color: rgba(16, 163, 127, 0.3);
  color: var(--accent);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.udupi-pin-icon {
  display: inline-flex;
  align-items: center;
  color: #EF4444;
}

.badge-heart-icon {
  display: inline-flex;
  align-items: center;
  color: #EF4444;
  animation: pulse-heart 1.6s ease-in-out infinite;
  transform-origin: center;
}

@keyframes pulse-heart {
  0%, 100% { transform: scale(1); }
  25% { transform: scale(1.22); }
  40% { transform: scale(1); }
  60% { transform: scale(1.15); }
}

.badge-by-label {
  opacity: 0.85;
  font-weight: 500;
  margin-right: 1px;
}

/* thedevstory Brand Link & Animated Underline */
.tds-brand-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none !important;
  color: inherit;
  line-height: 1;
  position: relative;
  vertical-align: middle;
  padding: 0 1px 3px 1px;
  cursor: pointer;
  outline: none;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), filter 0.2s ease;
}

.tds-brand-link:hover,
.tds-brand-link:focus-visible {
  transform: translateY(-1px);
  text-decoration: none !important;
}

.tds-brand-text {
  display: inline-flex;
  align-items: baseline;
  font-size: 0.88rem;
  letter-spacing: -0.015em;
}

.tds-part-the,
.tds-part-story {
  font-weight: 700;
  color: #0F172A;
  transition: color var(--transition-fast);
}

[data-theme="dark"] .tds-part-the,
[data-theme="dark"] .tds-part-story {
  color: #F8FAFC;
}

.tds-part-dev-wrap {
  position: relative;
  display: inline-block;
  margin: 0 0.5px;
}

.tds-part-dev {
  font-weight: 800;
  color: #8B5CF6;
  transition: color var(--transition-fast);
}

[data-theme="dark"] .tds-part-dev {
  color: #A78BFA;
}

.tds-arc {
  position: absolute;
  left: -1px;
  bottom: -4px;
  width: calc(100% + 5px);
  height: 6px;
  overflow: visible;
  pointer-events: none;
}

.tds-arc-path {
  stroke: #8B5CF6;
  stroke-linecap: round;
  stroke-dasharray: 45;
  stroke-dashoffset: 0;
  animation: tds-arc-glow-flow 2.8s ease-in-out infinite;
}

[data-theme="dark"] .tds-arc-path {
  stroke: #A78BFA;
}

.tds-brand-link:hover .tds-arc-path {
  animation: tds-arc-glow-flow 1.3s ease-in-out infinite;
  filter: drop-shadow(0 0 4px rgba(139, 92, 246, 0.8));
}

[data-theme="dark"] .tds-brand-link:hover .tds-arc-path {
  filter: drop-shadow(0 0 5px rgba(167, 139, 250, 0.9));
}

@keyframes tds-arc-glow-flow {
  0% {
    stroke-dashoffset: 45;
    opacity: 0.5;
    filter: drop-shadow(0 0 1px rgba(139, 92, 246, 0.2));
  }
  35% {
    stroke-dashoffset: 0;
    opacity: 1;
    filter: drop-shadow(0 0 3px rgba(139, 92, 246, 0.7));
  }
  65% {
    stroke-dashoffset: 0;
    opacity: 1;
    filter: drop-shadow(0 0 2px rgba(139, 92, 246, 0.4));
  }
  100% {
    stroke-dashoffset: -45;
    opacity: 0.5;
    filter: drop-shadow(0 0 1px rgba(139, 92, 246, 0.2));
  }
}

[data-theme="dark"] @keyframes tds-arc-glow-flow {
  0% {
    stroke-dashoffset: 45;
    opacity: 0.5;
    filter: drop-shadow(0 0 1px rgba(167, 139, 250, 0.2));
  }
  35% {
    stroke-dashoffset: 0;
    opacity: 1;
    filter: drop-shadow(0 0 4px rgba(167, 139, 250, 0.8));
  }
  65% {
    stroke-dashoffset: 0;
    opacity: 1;
    filter: drop-shadow(0 0 2px rgba(167, 139, 250, 0.4));
  }
  100% {
    stroke-dashoffset: -45;
    opacity: 0.5;
    filter: drop-shadow(0 0 1px rgba(167, 139, 250, 0.2));
  }
}

/* About Typography */
.about-main-title {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin: 0;
}

.about-main-desc {
  font-size: 0.92rem;
  line-height: 1.65;
  color: var(--text-secondary);
  margin: 0;
}

/* Modes Grid */
.about-modes-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 4px;
}

@media (min-width: 600px) {
  .about-modes-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.about-mode-card {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.about-mode-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.about-mode-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.about-mode-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.mode-icon-online {
  background: rgba(6, 182, 212, 0.15);
  color: #06B6D4;
}

.mode-icon-offline {
  background: rgba(13, 148, 136, 0.15);
  color: #0D9488;
}

.mode-icon-split {
  background: rgba(99, 102, 241, 0.15);
  color: #6366F1;
}

.about-mode-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.about-mode-desc {
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--text-tertiary);
  margin: 0;
}

/* Device Download CTA Button */
.about-action-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 6px;
}

.btn-device-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 700;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-normal);
  cursor: pointer;
}

.btn-device-download:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-device-download:active {
  transform: translateY(0);
}

.btn-device-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-device-label {
  letter-spacing: -0.01em;
}

.btn-device-badge {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  background: rgba(255, 255, 255, 0.22);
  border-radius: var(--radius-full);
  margin-left: 2px;
}

/* ============================================
   Animated Vector Illustration
   ============================================ */

.about-illustration-wrapper {
  width: 100%;
  max-width: 480px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
}

.about-hero-svg {
  width: 100%;
  height: auto;
  overflow: visible;
  filter: drop-shadow(0 12px 28px rgba(5, 74, 117, 0.12));
}

[data-theme="dark"] .about-hero-svg {
  filter: drop-shadow(0 12px 32px rgba(0, 0, 0, 0.5));
}

/* Floating & Bobbing Micro-Animations */
.anim-floating-backdrop {
  animation: float-backdrop 7s ease-in-out infinite;
  transform-origin: center;
}

@keyframes float-backdrop {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

.anim-float-keypad {
  animation: float-keypad 5s ease-in-out infinite;
  transform-origin: center;
}

@keyframes float-keypad {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-7px) rotate(-1deg); }
}

.anim-float-wallet {
  animation: float-wallet 6s ease-in-out infinite;
  transform-origin: center;
}

@keyframes float-wallet {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-4px) scale(1.01); }
}

.anim-float-card {
  animation: float-card 4.5s ease-in-out infinite;
  transform-origin: center;
}

@keyframes float-card {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-8px) rotate(2deg); }
}

.anim-float-chart {
  animation: float-chart 5.5s ease-in-out infinite;
  transform-origin: center;
}

@keyframes float-chart {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.anim-float-clock {
  animation: float-clock 6.5s ease-in-out infinite;
  transform-origin: center;
}

@keyframes float-clock {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-6px) rotate(-1.5deg); }
}

.anim-float-badge-top {
  animation: float-badge-top 4s ease-in-out infinite;
  transform-origin: 180px 95px;
}

@keyframes float-badge-top {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-9px) scale(1.06); }
}

.anim-badge-bob {
  animation: badge-bob 3s ease-in-out infinite;
  transform-origin: 130px 215px;
}

@keyframes badge-bob {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

/* Clock Hand Ticking */
.anim-clock-hand {
  animation: clock-hand-tick 12s linear infinite;
}

@keyframes clock-hand-tick {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Chart Bars Rising / Breathing */
.anim-bar {
  transform-origin: bottom;
}

.anim-bar-1 {
  animation: chart-bar-pulse-1 2.8s ease-in-out infinite;
}

.anim-bar-2 {
  animation: chart-bar-pulse-2 2.8s ease-in-out 0.4s infinite;
}

.anim-bar-3 {
  animation: chart-bar-pulse-3 2.8s ease-in-out 0.8s infinite;
}

@keyframes chart-bar-pulse-1 {
  0%, 100% { transform: scaleY(1); }
  50% { transform: scaleY(0.78); }
}

@keyframes chart-bar-pulse-2 {
  0%, 100% { transform: scaleY(1); }
  50% { transform: scaleY(1.12); }
}

@keyframes chart-bar-pulse-3 {
  0%, 100% { transform: scaleY(1); }
  50% { transform: scaleY(0.85); }
}

/* Sparkles Twinkle */
.anim-sparkle {
  animation: sparkle-twinkle 3s ease-in-out infinite;
  transform-origin: center;
}

.anim-sparkle-1 { animation-delay: 0s; }
.anim-sparkle-2 { animation-delay: 0.7s; }
.anim-sparkle-3 { animation-delay: 1.4s; }
.anim-sparkle-4 { animation-delay: 2.1s; }

@keyframes sparkle-twinkle {
  0%, 100% { opacity: 0.35; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.3); }
}

.anim-symbol-glow {
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.25));
}

/* ============================================
   About Modal Component Styling
   ============================================ */

/* Top-Right Modal Close (X) Button */
.modal-close-icon-btn {
  position: absolute !important;
  top: 16px !important;
  right: 16px !important;
  left: auto !important;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  z-index: 100;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.modal-close-icon-btn:hover {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent);
  transform: scale(1.08);
}

.modal-close-icon-btn:active {
  transform: scale(0.95);
}

/* Draggable Modal Resize Handle */
.modal-resize-handle {
  position: absolute;
  bottom: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  cursor: nwse-resize;
  opacity: 0.6;
  transition: opacity var(--transition-fast), color var(--transition-fast);
  z-index: 105;
  user-select: none;
  touch-action: none;
}

.modal-resize-handle:hover {
  opacity: 1;
  color: var(--accent);
}

@media (max-width: 767px) {
  .modal-resize-handle {
    display: none;
  }
}

/* Truncation & layout fixes for Member chips & shares */
.current-member-name-wrap {
  min-width: 0;
  flex: 1;
  overflow: hidden;
}

.current-member-name-wrap span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-block;
  max-width: 160px;
}

.itemized-chip {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.itemized-shares-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 0.75rem;
}

.itemized-shares-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  color: var(--text-secondary);
}

.itemized-shares-val {
  flex-shrink: 0;
  font-weight: 700;
  text-align: right;
}

.taxtip-summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-items: flex-end;
}

@media (max-width: 480px) {
  .taxtip-summary-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

.itemized-summary-box {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  min-width: 0;
  overflow: hidden;
}

.itemized-summary-box .summary-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  min-width: 0;
  white-space: nowrap;
}

.itemized-summary-box .summary-val {
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: right;
}

/* About Modal Dialog Layout */
.modal-content.about-modal-dialog {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
}

.about-modal-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-height: 100%;
  min-height: 0;
  flex: 1;
}

.about-modal-scrollable {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  padding-right: 4px;
  margin-top: 4px;
}

.about-modal-scrollable::-webkit-scrollbar {
  width: 6px;
}

.about-modal-scrollable::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

.about-modal-header-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.about-modal-logo-wrap {
  flex-shrink: 0;
}

.about-modal-logo-img {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  object-fit: contain;
  box-shadow: 0 4px 12px rgba(5, 74, 117, 0.15);
}

.about-modal-features-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.about-feature-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.about-feature-card:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.about-feature-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.about-feature-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.about-feature-desc {
  font-size: 0.76rem;
  line-height: 1.45;
  color: var(--text-tertiary);
}

/* Responsive Modal Sizing Across Devices */

/* Mobile (< 768px): Bottom-sheet style, full width, 1-column scrollable */
@media (max-width: 767px) {
  .modal-content.about-modal-dialog {
    width: 100%;
    max-height: 88vh;
    max-height: 88dvh;
    padding: 16px 18px 24px 18px;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  }
  .about-modal-columns {
    display: flex;
    flex-direction: column;
    gap: 14px;
  }
  .about-modal-visual-col .about-illustration-wrapper {
    display: none;
  }
}

/* Tablet (768px - 1024px): 740px width, 2-column with stickers on left */
@media (min-width: 768px) and (max-width: 1024px) {
  .modal-content.about-modal-dialog {
    width: 740px;
    max-width: 94vw;
    max-height: 86vh;
    max-height: 86dvh;
    padding: 24px 24px 20px 24px;
    border-radius: var(--radius-xl);
  }
  .about-modal-columns {
    display: grid;
    grid-template-columns: 0.88fr 1.12fr;
    gap: 24px;
    align-items: flex-start;
  }
  .about-modal-visual-col {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 14px;
  }
}

/* Laptop & Desktop (> 1024px): 860px width, 2-column with rich stickers on left */
@media (min-width: 1025px) {
  .modal-content.about-modal-dialog {
    width: 860px;
    max-width: 90vw;
    max-height: 86vh;
    max-height: 86dvh;
    padding: 28px 28px 24px 28px;
    border-radius: var(--radius-xl);
  }
  .about-modal-columns {
    display: grid;
    grid-template-columns: 1fr 1.25fr;
    gap: 32px;
    align-items: flex-start;
  }
  .about-modal-visual-col {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 16px;
  }
}




/* ============================================
   Accessibility Layer
   ============================================ */

/* --- Focus Visibility (WCAG 2.4.7 Focus Visible, AA) ---
   The stylesheet previously set `outline: none` on inputs and defined no focus
   style at all for buttons, tabs, chips or the FAB, so a keyboard or
   switch-control user had no way to tell where they were on the page.

   The ring is deliberately background-independent: a solid high-contrast
   outline plus a contrasting halo, so it stays visible on the light page, on
   white cards, and on the dark navy header alike. `:focus-visible` means
   pointer users never see it. */
:root {
  --focus-ring: #0F172A;
  --focus-ring-halo: rgba(255, 255, 255, 0.95);
}

[data-theme="dark"] {
  --focus-ring: #F8FAFC;
  --focus-ring-halo: rgba(0, 0, 0, 0.85);
}

a:focus-visible,
button:focus-visible,
select:focus-visible,
summary:focus-visible,
[role="button"]:focus-visible,
[role="tab"]:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
  box-shadow: 0 0 0 6px var(--focus-ring-halo);
  z-index: 1;
  position: relative;
}

/* Inputs already have a clear accent focus treatment; add the outline on top
   rather than replacing their existing ring. */
input:focus-visible,
textarea:focus-visible,
.input-field:focus-visible,
.feedback-textarea:focus-visible,
.feedback-email-input:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

/* --- Reduced Motion (WCAG 2.3.3 Animation from Interactions) ---
   The app ships 35 keyframe animations, 24 of which loop forever (orbiting
   badges, floating cards, pulsing bars, a ticking clock hand). Continuous
   motion with no way to stop it is a known trigger for vestibular disorders.
   Honour the OS-level "reduce motion" setting. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  /* Decorative loops carry no information — remove them outright rather than
     replaying them once at 0.01ms. */
  .float-item-calc,
  .float-item-plus,
  .float-item-receipt,
  .float-item-minus,
  .float-item-percent,
  .float-item-currency,
  .anim-floating-backdrop,
  .anim-float-keypad,
  .anim-float-wallet,
  .anim-float-card,
  .anim-float-chart,
  .anim-float-clock,
  .anim-float-badge-top,
  .anim-badge-bob,
  .anim-clock-hand,
  .anim-bar-1,
  .anim-bar-2,
  .anim-bar-3,
  .anim-sparkle,
  .badge-heart-icon,
  .tds-arc-path,
  .splash-flip-word {
    animation: none !important;
  }

  /* The spinner is the one loop that must survive: it communicates that work
     is in progress. Slow it down instead of freezing it. */
  .spinner {
    animation: spin 1.6s linear infinite !important;
  }
}

/* --- Touch Target Size (WCAG 2.5.8 Target Size, AA) ---
   The modal close button (32px) and theme toggle (38px) were below the minimum
   comfortable target. Rather than resize them and disturb the layout, expand
   the invisible hit area around them. */
.theme-toggle {
  position: relative;
}

.modal-close-icon-btn::after,
.theme-toggle::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
}

/* --- Screen-reader-only utility --- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
