/* Krachan v1.8 — Obsidian Studio Design System & Physics Engine */
:root {
  --bg: #08080C;
  --bg-elevated: #101016;
  --surface: #15151E;
  --surface-2: #1A1A25;
  --surface-hover: #20202D;
  --surface-glass: rgba(255, 255, 255, 0.07);

  --border: rgba(255, 255, 255, 0.085);
  --border-strong: rgba(255, 255, 255, 0.16);
  --bevel: inset 0 1px 0 rgba(255, 255, 255, 0.09);

  --gold: #E5B84B;
  --gold-bright: #F6D77E;
  --gold-dim: #8E722E;
  --gold-tint: rgba(229, 184, 75, 0.13);
  --gold-border: rgba(229, 184, 75, 0.36);

  --text: #F7F7FA;
  --text-muted: #9CA3AF;
  --text-soft: #6B7280;

  --green: #34D399;
  --green-bg: rgba(52, 211, 153, 0.14);
  --green-border: rgba(52, 211, 153, 0.32);

  --danger: #F87171;
  --danger-bg: rgba(248, 113, 113, 0.13);
  --danger-border: rgba(248, 113, 113, 0.34);

  --blue: #60A5FA;
  --blue-bg: rgba(96, 165, 250, 0.15);

  --warn: #FBBF24;
  --warn-bg: rgba(251, 191, 36, 0.15);

  --radius-sm: 11px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --shadow-sm: 0 3px 12px rgba(0, 0, 0, 0.38);
  --shadow-md: 0 18px 44px rgba(0, 0, 0, 0.6);
  --shadow-fab: 0 12px 28px rgba(229, 184, 75, 0.38);

  --spring: cubic-bezier(0.22, 1, 0.36, 1);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
  --rail-w: 244px;
}

*, *::before, *::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  margin: 0;
  padding: 0;
  background: var(--bg);
  overflow-x: clip;
  overflow-y: auto;
}

body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  color-scheme: dark;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  overflow-y: visible;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; padding: 0; }
a { color: inherit; text-decoration: none; }
.hidden { display: none !important; }
.muted { color: var(--text-muted); }
.small { font-size: 0.85rem; }

/* Tabular numerals across all financial figures */
.tnum, .hero-amount, .cat-tile-total, .project-tile-amount, .summary-total,
.expense-amount, .kpi-val, .bar-val, .legend-amt, .highlight-val, .settle-amt,
.travel-stat-val, .amount-input {
  font-variant-numeric: tabular-nums;
}

/* =========================================================
   F3 · 1-TAP PRIVACY CURTAIN (₹ •••••)
   ========================================================= */
.money {
  transition: filter 0.22s var(--spring), opacity 0.22s ease;
}

body.privacy-mode .money,
body.privacy-mode .hero-amount,
body.privacy-mode .cat-tile-total,
body.privacy-mode .project-tile-amount,
body.privacy-mode .summary-total,
body.privacy-mode .expense-amount,
body.privacy-mode .kpi-val,
body.privacy-mode .bar-val,
body.privacy-mode .legend-amt,
body.privacy-mode .highlight-val,
body.privacy-mode .settle-amt,
body.privacy-mode .travel-stat-val,
body.privacy-mode .travel-headline,
body.privacy-mode .travel-detail,
body.privacy-mode .cat-tile-meta,
body.privacy-mode .project-tile-sub,
body.privacy-mode .date-group-head span:last-child,
body.privacy-mode .chart-svg text {
  filter: blur(7px);
  user-select: none;
}

.icon-btn.privacy-active {
  border-color: var(--gold-border);
  background: var(--gold-tint);
  color: var(--gold-bright);
}

/* =========================================================
   VIEW TRANSITIONS API (Baseline 2025 Native Motion)
   ========================================================= */
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.24s;
  animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
}

html[data-vt-dir="forward"]::view-transition-old(root) {
  animation-name: vtSlideOutLeft;
}
html[data-vt-dir="forward"]::view-transition-new(root) {
  animation-name: vtSlideInRight;
}

html[data-vt-dir="back"]::view-transition-old(root) {
  animation-name: vtSlideOutRight;
}
html[data-vt-dir="back"]::view-transition-new(root) {
  animation-name: vtSlideInLeft;
}

@keyframes vtSlideOutLeft {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0.4; transform: translateX(-18px); }
}
@keyframes vtSlideInRight {
  from { opacity: 0.35; transform: translateX(26px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes vtSlideOutRight {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0.4; transform: translateX(22px); }
}
@keyframes vtSlideInLeft {
  from { opacity: 0.35; transform: translateX(-22px); }
  to { opacity: 1; transform: translateX(0); }
}

@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
  .carousel-track, .swipe-row-content, .modal-sheet { transition: none !important; }
}

/* =========================================================
   SPLASH 1 · PURE HALLMARK (Lifted above Netlify badge)
   ========================================================= */
.splash-screen {
  position: fixed; inset: 0; z-index: 200; background: var(--bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: calc(28px + var(--safe-top)) 24px calc(110px + var(--safe-bottom));
  transition: opacity 0.32s ease, transform 0.32s var(--spring);
}
.splash-screen.splash-exit { opacity: 0; transform: scale(1.03); pointer-events: none; }
.splash-center { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.splash-mark-wrap { position: relative; width: 112px; height: 112px; display: flex; align-items: center; justify-content: center; }
.splash-glow {
  position: absolute; inset: -24px; border-radius: 50%;
  background: radial-gradient(circle, rgba(229, 184, 75, 0.32) 0%, rgba(229, 184, 75, 0.0) 68%);
  animation: splashGlowReveal 0.7s var(--spring) forwards, splashBreathe 2.2s ease-in-out 0.75s infinite;
}
.splash-k { position: relative; width: 100px; height: 100px; filter: drop-shadow(0 12px 28px rgba(229, 184, 75, 0.28)); animation: splashZoom 0.68s var(--spring) forwards; }
.splash-wordmark { font-size: 1.35rem; font-weight: 800; letter-spacing: 0.34em; padding-left: 0.34em; color: #FFFFFF; opacity: 0; animation: splashFadeUp 0.5s ease 0.18s forwards; }
.splash-hallmark { position: absolute; bottom: calc(104px + var(--safe-bottom)); left: 0; right: 0; display: flex; flex-direction: column; align-items: center; gap: 12px; opacity: 0; animation: splashFadeUp 0.45s ease 0.22s forwards; }
.splash-line { width: 34px; height: 2px; border-radius: 2px; background: var(--gold); }
.splash-lineage { font-size: 0.76rem; font-weight: 700; letter-spacing: 0.28em; padding-left: 0.28em; color: #C4C8D4; }

@keyframes splashZoom { 0% { opacity: 0; transform: scale(0.76); } 70% { opacity: 1; transform: scale(1.03); } 100% { opacity: 1; transform: scale(1); } }
@keyframes splashGlowReveal { 0% { opacity: 0; transform: scale(0.6); } 100% { opacity: 1; transform: scale(1); } }
@keyframes splashBreathe { 0%, 100% { opacity: 0.85; transform: scale(1); } 50% { opacity: 1; transform: scale(1.12); } }
@keyframes splashFadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* =========================================================
   STUDIO LAYOUT SHELL (Mobile Single-Col → iPad/Desktop Split-View)
   ========================================================= */
.app-shell {
  min-height: 100dvh;
  max-width: 960px;
  margin: 0 auto;
  padding-bottom: calc(168px + var(--safe-bottom));
}

.studio-rail {
  display: none;
}

.studio-main {
  min-width: 0;
  width: 100%;
}

/* F2 · True iPad Landscape & Desktop Split-View (≥ 900px) */
@media (min-width: 900px) {
  .app-shell.has-studio {
    max-width: none;
    display: grid;
    grid-template-columns: var(--rail-w) minmax(0, 1fr);
    padding-bottom: 0;
  }

  .studio-rail {
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100dvh;
    overflow-y: auto;
    background: linear-gradient(180deg, #0E0E15 0%, #09090D 100%);
    border-right: 1px solid var(--border);
    padding: 22px 14px 20px;
    z-index: 25;
  }

  .rail-brand {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 4px 10px 22px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 16px;
  }

  .rail-brand-word {
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: 0.22em;
    color: #FFFFFF;
  }

  .rail-nav {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
  }

  .rail-section-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-soft);
    padding: 12px 12px 4px;
  }

  .rail-item {
    display: flex;
    align-items: center;
    gap: 11px;
    width: 100%;
    padding: 10px 12px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease;
    text-align: left;
  }

  .rail-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #FFFFFF;
  }

  .rail-item.active {
    background: linear-gradient(135deg, rgba(229, 184, 75, 0.18), rgba(229, 184, 75, 0.08));
    color: var(--gold-bright);
    border: 1px solid var(--gold-border);
    box-shadow: var(--bevel);
  }

  .rail-item-badge {
    margin-left: auto;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--gold);
    color: #0A0A0E;
    font-size: 0.7rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .rail-footer {
    padding-top: 14px;
    border-top: 1px solid var(--border);
    text-align: center;
  }

  .studio-main {
    max-width: 1120px;
    width: 100%;
    margin: 0 auto;
    padding-bottom: 120px;
  }

  /* Hide mobile-only main header elements duplicated in the Studio Rail */
  .topbar-main-mobile {
    display: none;
  }

  /* 2-Column Split Detail Stage for Project & Shared Trip screens */
  .detail-split {
    display: grid;
    grid-template-columns: minmax(320px, 0.92fr) minmax(360px, 1.08fr);
    gap: 18px;
    align-items: start;
  }

  .detail-split-left {
    position: sticky;
    top: 76px;
  }

  /* 2-Column Insights Grid on wide screens */
  .analytics-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  .analytics-grid .span-full {
    grid-column: 1 / -1;
  }

  .fab {
    right: 34px;
    bottom: 88px;
  }
}

/* =========================================================
   TOP BAR
   ========================================================= */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 6px;
  padding: calc(11px + var(--safe-top)) 12px 11px;
  background: rgba(8, 8, 12, 0.84); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
}
.topbar-title { flex: 1; min-width: 0; display: flex; align-items: center; gap: 7px; }
.topbar-title h1 { margin: 0; font-size: 1.04rem; font-weight: 800; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-k-svg { width: 25px; height: 25px; flex-shrink: 0; }

@media (max-width: 460px) {
  .topbar-brand-text { display: none; }
  .topbar { padding: calc(10px + var(--safe-top)) 9px 10px; gap: 5px; }
  .mode-pill-btn { padding: 4px 8px; font-size: 0.72rem; }
  .icon-btn { min-width: 35px; min-height: 35px; font-size: 0.96rem; }
}

.icon-btn {
  position: relative; min-width: 38px; min-height: 38px; border-radius: 11px;
  display: inline-flex; align-items: center; justify-content: center; font-size: 1.04rem;
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  box-shadow: var(--bevel);
  transition: transform 0.12s var(--spring), background 0.15s ease, border-color 0.15s ease; flex-shrink: 0;
}
.icon-btn:active { transform: scale(0.92); background: var(--surface-hover); }
@media (hover: hover) { .icon-btn:hover { border-color: var(--border-strong); background: var(--surface-hover); } }

.bell-badge {
  position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px; background: var(--gold); color: #0A0A0E; font-size: 0.65rem; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center; border: 2px solid var(--bg);
}

.mode-pill {
  display: inline-flex; align-items: center; background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: 999px; padding: 3px; flex-shrink: 0;
  box-shadow: var(--bevel);
}
.mode-pill-btn {
  min-height: 29px; padding: 4px 10px; border-radius: 999px; font-size: 0.75rem; font-weight: 700;
  color: var(--text-muted); transition: all 0.2s var(--spring); white-space: nowrap;
}
.mode-pill-btn.active { background: #FFFFFF; color: #0A0A0E; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35); }

.offline-pill { font-size: 0.66rem; font-weight: 700; padding: 3px 7px; border-radius: 999px; background: var(--warn-bg); color: var(--warn); border: 1px solid rgba(251, 191, 36, 0.32); white-space: nowrap; }

.page { padding: 16px; }
@media (min-width: 900px) { .page { padding: 24px 28px; } }

/* =========================================================
   A1 · PERSISTENT 3-PANE FINGER-FOLLOWING SLIDING CAROUSEL
   ========================================================= */
.carousel-viewport {
  width: 100%;
  overflow-x: clip;
  overflow-y: visible;
  touch-action: pan-y pinch-zoom;
}

.carousel-track {
  display: flex;
  align-items: flex-start;
  width: 300%;
  will-change: transform;
  transition: transform 0.34s var(--spring);
}

.carousel-track.is-dragging {
  transition: none !important;
}

.carousel-pane {
  width: 33.333333%;
  flex: 0 0 33.333333%;
  min-height: calc(100dvh - 64px);
}

/* On desktop/iPad split-view, render only the active top-level pane full-width (no horizontal carousel clipping) */
@media (min-width: 900px) {
  .carousel-track {
    width: 100% !important;
    transform: none !important;
    display: block;
  }
  .carousel-pane {
    width: 100%;
    display: none;
    min-height: auto;
  }
  .carousel-pane.active-pane {
    display: block;
    animation: studioFade 0.2s var(--spring);
  }
}

@keyframes studioFade {
  from { opacity: 0.55; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Sub-tab bar inside Shared screen */
.subtab-bar { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 12px; padding: 4px; margin-bottom: 14px; box-shadow: var(--bevel); }
.subtab-btn { min-height: 36px; border-radius: 9px; font-size: 0.84rem; font-weight: 700; color: var(--text-muted); transition: all 0.18s var(--spring); }
.subtab-btn.active { background: #FFFFFF; color: #0A0A0E; }

/* =========================================================
   F1 · SPECULAR OBSIDIAN HERO BANNER & GLASS CARDS
   ========================================================= */
.hero-banner {
  position: relative; overflow: hidden;
  background:
    radial-gradient(120% 100% at 12% 0%, rgba(229, 184, 75, 0.15) 0%, rgba(229, 184, 75, 0.0) 56%),
    linear-gradient(155deg, #1B1A26 0%, #111118 62%, #17140E 100%);
  border: 1px solid rgba(229, 184, 75, 0.22);
  border-radius: var(--radius-lg);
  padding: 22px 20px 20px;
  margin-bottom: 18px;
  box-shadow: var(--bevel), var(--shadow-md);
}
.hero-banner::before {
  content: ""; position: absolute; top: 0; left: 22px; width: 48px; height: 3px;
  border-radius: 0 0 4px 4px; background: linear-gradient(90deg, var(--gold-bright), var(--gold));
}
.hero-label { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-muted); font-weight: 700; }
.hero-amount { font-size: 2.25rem; font-weight: 800; margin-top: 5px; letter-spacing: -0.03em; color: #FFFFFF; }
.hero-amount.pos { color: var(--green); }
.hero-amount.neg { color: var(--danger); }
.hero-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 11px; flex-wrap: wrap; }
.hero-sub { font-size: 0.84rem; color: var(--text-muted); }
.swipe-hint { font-size: 0.76rem; font-weight: 700; color: var(--gold-bright); display: inline-flex; align-items: center; gap: 4px; }

.section-head { display: flex; align-items: center; justify-content: space-between; margin: 20px 2px 10px; }
.section-head:first-child { margin-top: 4px; }
.section-head h2 { margin: 0; font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); font-weight: 700; }

/* Category Grid */
.tile-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 600px) { .tile-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; } }
@media (min-width: 1080px) { .tile-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.cat-tile {
  position: relative;
  background: linear-gradient(180deg, #181822 0%, #13131B 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 15px; text-align: left; display: flex; flex-direction: column; gap: 6px; min-height: 140px;
  box-shadow: var(--bevel), var(--shadow-sm);
  transition: transform 0.14s var(--spring), border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}
.cat-tile:active { transform: scale(0.965); border-color: var(--gold-border); }
@media (hover: hover) {
  .cat-tile:hover { transform: translateY(-2px); border-color: rgba(229, 184, 75, 0.34); box-shadow: var(--bevel), 0 10px 26px rgba(0, 0, 0, 0.48); }
}
.cat-tile-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.cat-tile-icon { font-size: 1.65rem; line-height: 1; }
.cat-tile-name { font-weight: 700; font-size: 0.94rem; color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cat-tile-total { margin-top: auto; font-size: 1.16rem; font-weight: 800; color: var(--gold); }
.cat-tile-meta { font-size: 0.78rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.add-tile { background: rgba(229, 184, 75, 0.05); border: 1.5px dashed var(--gold-border); color: var(--gold); align-items: center; justify-content: center; text-align: center; font-weight: 700; box-shadow: none; }
.add-tile-plus { font-size: 1.8rem; line-height: 1; }

/* Project / Split Cards */
.project-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 680px) { .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.project-tile {
  background: linear-gradient(180deg, #181822 0%, #13131B 100%);
  border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 16px; text-align: left; display: flex; flex-direction: column; gap: 8px;
  box-shadow: var(--bevel), var(--shadow-sm);
  transition: transform 0.14s var(--spring), border-color 0.18s ease;
}
.project-tile:active { transform: scale(0.98); }
@media (hover: hover) { .project-tile:hover { transform: translateY(-2px); border-color: var(--border-strong); } }
.project-tile.is-current { border: 1.5px solid var(--gold-border); background: linear-gradient(180deg, #1B1A24 0%, #14131A 100%); }
.project-tile-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.project-tile-chips { display: flex; flex-wrap: wrap; gap: 5px; justify-content: flex-end; }
.project-tile-name { font-size: 1.05rem; font-weight: 700; color: #FFFFFF; }
.project-tile-dates { font-size: 0.82rem; color: var(--text-muted); }
.project-tile-amount { font-size: 1.38rem; font-weight: 800; color: #FFFFFF; }
.project-tile-sub { font-size: 0.84rem; color: var(--text-muted); }
.project-tile-sub.calm-red { color: var(--danger); font-weight: 600; }
.project-tile-sub.calm-gold { color: var(--gold); font-weight: 600; }
.project-tile-sub.calm-green { color: var(--green); font-weight: 600; }

.new-project-tile {
  background: rgba(229, 184, 75, 0.05); border: 1.5px dashed var(--gold-border); color: var(--gold);
  border-radius: var(--radius-md); padding: 16px; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 60px;
  transition: background 0.15s ease, transform 0.12s var(--spring);
}
.new-project-tile:active { transform: scale(0.98); }

/* Chips */
.chip { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 999px; font-size: 0.72rem; font-weight: 700; white-space: nowrap; }
.chip-current { background: var(--gold-tint); color: var(--gold-bright); border: 1px solid var(--gold-border); }
.chip-completed { background: rgba(255, 255, 255, 0.07); color: var(--text-muted); }
.chip-fixed { background: var(--blue-bg); color: var(--blue); }
.chip-daily { background: var(--gold-tint); color: var(--gold); }
.chip-green { background: var(--green-bg); color: var(--green); border: 1px solid var(--green-border); }
.chip-red { background: var(--danger-bg); color: var(--danger); border: 1px solid var(--danger-border); }
.chip-override { background: rgba(239, 68, 68, 0.22); color: #FCA5A5; border: 1px solid rgba(248, 113, 113, 0.55); font-weight: 800; }

.delta-pill { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 999px; font-size: 0.8rem; font-weight: 700; }
.delta-down { background: var(--green-bg); color: var(--green); border: 1px solid var(--green-border); }
.delta-up { background: var(--danger-bg); color: var(--danger); border: 1px solid var(--danger-border); }
.delta-flat { background: rgba(255, 255, 255, 0.07); color: var(--text-muted); }

/* Progress */
.progress-track { width: 100%; height: 7px; background: rgba(255, 255, 255, 0.08); border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-bright)); border-radius: 999px; transition: width 0.35s var(--spring); }
.progress-fill.over { background: var(--danger); }

/* Cards */
.card {
  background: linear-gradient(180deg, #171721 0%, #13131B 100%);
  border: 1px solid var(--border); border-radius: var(--radius-md); padding: 16px; margin-bottom: 14px;
  box-shadow: var(--bevel), var(--shadow-sm);
}
.card-gold { border-color: var(--gold-border); background: linear-gradient(180deg, rgba(229, 184, 75, 0.1) 0%, #14141C 100%); }
.card-title { margin: 0 0 12px; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.09em; color: var(--text-muted); font-weight: 700; }

/* Skeleton Shimmer Loaders */
.skeleton-card { padding: 18px; }
.skel-line {
  height: 14px; border-radius: 8px; margin-bottom: 10px;
  background: linear-gradient(90deg, rgba(255,255,255,0.05) 25%, rgba(255,255,255,0.12) 50%, rgba(255,255,255,0.05) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.25s infinite linear;
}
.skel-line.lg { height: 30px; width: 52%; margin-bottom: 14px; }
.skel-line.md { height: 14px; width: 78%; }
.skel-line.sm { height: 12px; width: 42%; margin-bottom: 0; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

.approval-card { background: rgba(229, 184, 75, 0.09); border: 1px solid var(--gold-border); border-radius: var(--radius-sm); padding: 13px; margin-bottom: 10px; }
.approval-card:last-child { margin-bottom: 0; }
.approval-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

.creator-box { margin-top: 14px; padding: 13px; border-radius: var(--radius-sm); background: rgba(248, 113, 113, 0.06); border: 1px dashed rgba(248, 113, 113, 0.35); }
.per-exp-settle-box { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }

/* Activity Feed */
.activity-item { display: flex; align-items: flex-start; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--border); text-align: left; width: 100%; }
.activity-item:last-child { border-bottom: none; }
.activity-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); margin-top: 6px; flex-shrink: 0; }
.activity-dot.read { background: rgba(255, 255, 255, 0.22); }

/* Settled Details */
.settled-details { margin-top: 22px; }
.settled-details summary {
  cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
  font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted);
}
.settled-details summary::-webkit-details-marker { display: none; }
.settled-details[open] summary { margin-bottom: 12px; border-color: var(--border-strong); color: var(--text); }

/* Project Summary & Travel */
.summary-total { font-size: 2.15rem; font-weight: 800; color: #FFFFFF; letter-spacing: -0.025em; }
.summary-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 6px; }
.summary-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

.travel-box { background: rgba(229, 184, 75, 0.08); border: 1px solid var(--gold-border); border-radius: var(--radius-md); padding: 14px; margin-top: 14px; }
.travel-box.is-over { background: var(--danger-bg); border-color: var(--danger-border); }
.travel-headline { font-size: 1.2rem; font-weight: 800; color: var(--gold-bright); }
.travel-box.is-over .travel-headline { color: var(--danger); }
.travel-detail { font-size: 0.85rem; color: var(--text-muted); margin-top: 3px; }
.travel-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, 0.09); }
.travel-stat-label { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.travel-stat-val { font-size: 0.96rem; font-weight: 700; color: #FFFFFF; margin-top: 2px; }

/* Settlements */
.settle-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.settle-row:last-child { border-bottom: none; }
.settle-text { font-size: 0.92rem; color: var(--text); display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.settle-amt { font-weight: 800; color: var(--gold); }
.settle-btns { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

/* Bars & Swipeable Expense Rows (A2) */
.bar-list { display: flex; flex-direction: column; gap: 12px; }
.bar-row-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 5px; font-size: 0.9rem; }
.bar-name { font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 6px; min-width: 0; }
.bar-val { font-weight: 700; color: #FFFFFF; white-space: nowrap; }
.bar-pct { font-weight: 500; color: var(--text-muted); font-size: 0.78rem; margin-left: 5px; }

.date-group { margin-bottom: 16px; }
.date-group-head { display: flex; justify-content: space-between; align-items: center; padding: 6px 4px; font-size: 0.76rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.expense-list {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
  overflow: hidden; box-shadow: var(--bevel), var(--shadow-sm);
}

.swipe-row {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
  background: #101017;
}
.swipe-row:last-child { border-bottom: none; }

.swipe-row-actions {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 146px;
  display: flex;
  align-items: stretch;
  z-index: 1;
}

.swipe-act {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #FFFFFF;
}
.swipe-act-dup { background: rgba(229, 184, 75, 0.22); color: var(--gold-bright); border-left: 1px solid var(--gold-border); }
.swipe-act-del { background: rgba(239, 68, 68, 0.28); color: #FCA5A5; }

.swipe-row-content {
  position: relative;
  z-index: 2;
  background: var(--surface);
  will-change: transform;
  transition: transform 0.24s var(--spring);
}
.swipe-row-content.dragging { transition: none !important; }

.expense-item {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 13px 14px; text-align: left; background: var(--surface); transition: background 0.12s ease;
}
.expense-item:active { background: var(--surface-hover); }
@media (hover: hover) { .expense-item:hover { background: var(--surface-2); } }
.expense-left { min-width: 0; flex: 1; }
.expense-subcat { font-weight: 700; font-size: 0.95rem; color: #FFFFFF; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.expense-desc { font-size: 0.85rem; color: var(--text-muted); margin-top: 2px; word-break: break-word; }
.expense-right { text-align: right; flex-shrink: 0; }
.expense-amount { font-size: 1rem; font-weight: 800; color: #FFFFFF; }
.expense-paidby { font-size: 0.76rem; color: var(--text-soft); margin-top: 2px; }

/* 3-Way Payment Toggle */
.pay-toggle { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; background: #0D0D13; border: 1.5px solid var(--border-strong); border-radius: 12px; padding: 4px; }
.pay-toggle-btn { min-height: 40px; padding: 6px 8px; border-radius: 9px; font-size: 0.84rem; font-weight: 700; color: var(--text-muted); text-align: center; transition: all 0.16s var(--spring); white-space: nowrap; }
.pay-toggle-btn.selected { background: var(--gold); color: #0A0A0E; }

/* Analytics */
.month-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.month-nav-btn { width: 36px; height: 36px; border-radius: 10px; background: var(--surface-glass); border: 1px solid var(--border); color: #FFFFFF; font-size: 1.05rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.month-nav-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.month-nav-label { font-size: 0.96rem; font-weight: 800; color: var(--gold); letter-spacing: 0.03em; }
.kpi-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.kpi-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-muted); font-weight: 700; }
.kpi-val { font-size: 1.35rem; font-weight: 800; color: #FFFFFF; margin-top: 3px; }
.kpi-val.gold { color: var(--gold); }
.kpi-val.green { color: var(--green); }
.kpi-val.red { color: var(--danger); }
.donut-wrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.donut-svg-box { width: 132px; height: 132px; flex-shrink: 0; position: relative; }
.donut-legend { flex: 1; min-width: 160px; display: flex; flex-direction: column; gap: 9px; }
.legend-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 0.86rem; }
.legend-left { display: flex; align-items: center; gap: 8px; min-width: 0; }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.legend-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.legend-amt { font-weight: 700; color: var(--text-muted); white-space: nowrap; }
.split-bar { display: flex; height: 10px; border-radius: 999px; overflow: hidden; background: rgba(255, 255, 255, 0.08); margin-top: 10px; }
.split-seg { height: 100%; transition: width 0.3s var(--spring); }
.split-labels { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px 14px; font-size: 0.84rem; font-weight: 700; }
.chart-svg { width: 100%; height: auto; display: block; }
.highlight-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
.highlight-row:last-child { border-bottom: none; }
.highlight-val { font-weight: 800; color: var(--gold); white-space: nowrap; }

/* Buttons */
.btn { min-height: 45px; padding: 10px 18px; border-radius: var(--radius-sm); font-weight: 700; font-size: 0.94rem; display: inline-flex; align-items: center; justify-content: center; gap: 7px; transition: transform 0.12s var(--spring), opacity 0.15s ease, background 0.15s ease; }
.btn:active { transform: scale(0.96); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: #FFFFFF; color: #0A0A0E; }
.btn-gold { background: linear-gradient(135deg, var(--gold-bright), var(--gold)); color: #0A0A0E; }
.btn-secondary { background: var(--surface-glass); color: #FFFFFF; border: 1px solid var(--border-strong); }
.btn-outline { background: transparent; color: var(--text); border: 1px solid var(--border-strong); }
.btn-danger { background: var(--danger-bg); color: var(--danger); border: 1px solid var(--danger-border); }
.btn-wa { background: rgba(37, 211, 102, 0.14); color: #4ADE80; border: 1px solid rgba(74, 222, 128, 0.34); }
.btn-block { width: 100%; }
.btn-sm { min-height: 34px; padding: 5px 11px; font-size: 0.8rem; }

/* Lifted FAB (clears Netlify badge) */
.fab {
  position: fixed; right: max(18px, calc(50% - 462px)); bottom: calc(88px + var(--safe-bottom));
  width: 60px; height: 60px; border-radius: 50%; background: linear-gradient(135deg, var(--gold-bright), var(--gold));
  color: #0A0A0E; font-size: 2rem; font-weight: 700; line-height: 1; display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-fab); z-index: 30; transition: transform 0.14s var(--spring);
}
.fab:active { transform: scale(0.9); }

/* Forms */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 0.82rem; font-weight: 700; color: var(--text-muted); margin-bottom: 6px; }
.input, .select, .textarea { width: 100%; min-height: 46px; padding: 10px 12px; border-radius: var(--radius-sm); border: 1.5px solid var(--border-strong); background: #0E0E14; color: #FFFFFF; font-size: 1rem; outline: none; transition: border-color 0.15s ease; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--gold); }
.textarea { min-height: 86px; resize: vertical; }
.amount-input-wrap { display: flex; align-items: center; border: 2px solid var(--gold); border-radius: var(--radius-md); background: rgba(229, 184, 75, 0.08); padding: 4px 14px; }
.amount-currency { font-size: 1.8rem; font-weight: 800; color: var(--gold); margin-right: 6px; }
.amount-input { width: 100%; border: none; background: transparent; font-size: 2rem; font-weight: 800; color: #FFFFFF; padding: 8px 0; outline: none; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.chip-group-label { font-size: 0.74rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin: 8px 0 6px; }
.chip-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.pick-chip { min-height: 38px; padding: 7px 13px; border-radius: 999px; border: 1.5px solid var(--border-strong); background: #121219; font-size: 0.86rem; font-weight: 600; color: var(--text); transition: all 0.14s var(--spring); }
.pick-chip.selected { background: var(--gold); border-color: var(--gold); color: #0A0A0E; }

.emoji-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.emoji-btn { width: 38px; height: 38px; border-radius: 8px; border: 1px solid var(--border); background: #121219; font-size: 1.2rem; }

/* =========================================================
   A2 · NATIVE BOTTOM SHEETS & CUSTOM CONFIRM DIALOGS
   ========================================================= */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  z-index: 50; display: flex; align-items: flex-end; justify-content: center; padding: 0;
  animation: backdropIn 0.2s ease;
}
.confirm-backdrop { z-index: 80; align-items: center; padding: 20px; }

@keyframes backdropIn { from { opacity: 0; } to { opacity: 1; } }

@media (min-width: 600px) { .modal-backdrop { align-items: center; padding: 20px; } }

.modal-sheet {
  width: 100%; max-width: 520px; max-height: 92dvh; overflow-y: auto;
  overscroll-behavior-y: contain; -webkit-overflow-scrolling: touch;
  background: linear-gradient(180deg, #1A1A25 0%, #14141D 100%);
  border: 1px solid var(--border-strong); border-radius: 24px 24px 0 0;
  padding: 10px 18px calc(22px + var(--safe-bottom));
  box-shadow: var(--bevel), var(--shadow-md);
  will-change: transform;
  animation: sheetSlideUp 0.26s var(--spring);
}
@media (min-width: 600px) {
  .modal-sheet { border-radius: 20px; padding: 14px 22px 22px; animation: sheetPopIn 0.22s var(--spring); }
}

.confirm-sheet {
  max-width: 400px;
  border-radius: 20px;
  padding: 22px;
  animation: sheetPopIn 0.2s var(--spring);
}

.confirm-msg {
  margin: 0 0 18px;
  font-size: 0.94rem;
  color: var(--text-muted);
  white-space: pre-line;
  line-height: 1.5;
}

@keyframes sheetSlideUp { from { opacity: 0.6; transform: translateY(48px); } to { opacity: 1; transform: translateY(0); } }
@keyframes sheetPopIn { from { opacity: 0; transform: scale(0.94) translateY(8px); } to { opacity: 1; transform: scale(1) translateY(0); } }

.sheet-handle-zone {
  padding: 4px 0 12px;
  display: flex;
  justify-content: center;
  cursor: grab;
  touch-action: none;
}
.sheet-handle {
  width: 40px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
}
@media (min-width: 600px) { .sheet-handle-zone { display: none; } }

.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.modal-head h2 { margin: 0; font-size: 1.15rem; font-weight: 800; color: #FFFFFF; }
.modal-actions { display: flex; gap: 10px; margin-top: 16px; }
.modal-actions .btn { flex: 1; }

/* Lists & Settings */
.list-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.list-row:last-child { border-bottom: none; }
.list-row-main { min-width: 0; flex: 1; }
.list-row-title { font-weight: 700; font-size: 0.95rem; color: #FFFFFF; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.list-row-sub { font-size: 0.82rem; color: var(--text-muted); word-break: break-all; }
.list-row-actions { display: flex; gap: 6px; flex-shrink: 0; }

.settings-hallmark { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); text-align: center; }
.settings-hallmark-line { width: 28px; height: 2px; background: var(--gold); margin: 0 auto 10px; border-radius: 2px; }
.settings-hallmark-text { font-size: 0.74rem; font-weight: 700; letter-spacing: 0.24em; color: #C4C8D4; }

.center-screen { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px 24px calc(92px + var(--safe-bottom)); text-align: center; }
.auth-card { width: 100%; max-width: 420px; background: linear-gradient(180deg, #181823 0%, #13131B 100%); border: 1px solid var(--border-strong); border-radius: var(--radius-lg); padding: 32px 24px 26px; box-shadow: var(--bevel), var(--shadow-md); }
.brand-mark-lg { width: 76px; height: 76px; margin: 0 auto 16px; display: block; filter: drop-shadow(0 10px 24px rgba(229, 184, 75, 0.26)); }
.alert-box { margin-top: 14px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--danger-bg); border: 1px solid var(--danger-border); color: var(--danger); text-align: left; font-size: 0.88rem; }
.alert-box code { background: rgba(255, 255, 255, 0.08); padding: 2px 5px; border-radius: 4px; word-break: break-all; }
.empty-state { text-align: center; padding: 28px 16px; color: var(--text-muted); background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--radius-md); }

.toast {
  position: fixed; left: 50%; bottom: calc(92px + var(--safe-bottom)); transform: translateX(-50%);
  background: #FFFFFF; color: #0A0A0E; padding: 11px 18px; border-radius: 999px;
  font-size: 0.88rem; font-weight: 700; z-index: 95; max-width: calc(100vw - 32px);
  text-align: center; box-shadow: var(--shadow-md);
}


/* =========================================================
   v1.5 TRACK B: MATH STRIP, SMART PASTE, RECENTS, DUE BILLS & IMPORTER
   ========================================================= */
.math-live-preview {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--gold-bright);
  white-space: nowrap;
  padding-left: 8px;
  font-variant-numeric: tabular-nums;
}

.math-strip {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin-top: 8px;
}

.math-op-btn {
  min-height: 34px;
  border-radius: 9px;
  background: #111118;
  border: 1px solid var(--border-strong);
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.1s var(--spring), background 0.14s ease, border-color 0.14s ease;
}

.math-op-btn:active {
  transform: scale(0.92);
  background: var(--gold-tint);
  border-color: var(--gold-border);
  color: var(--gold-bright);
}

.math-op-eq {
  background: var(--gold-tint);
  border-color: var(--gold-border);
  color: var(--gold-bright);
}

/* Smart Paste Toggle Pill & Box */
.smart-pill-btn {
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  background: var(--gold-tint);
  border: 1px solid var(--gold-border);
  color: var(--gold-bright);
  transition: all 0.16s var(--spring);
}

.smart-pill-btn.active {
  background: var(--gold);
  color: #0A0A0E;
}

.smart-paste-box {
  background: rgba(229, 184, 75, 0.06);
  border: 1px solid var(--gold-border);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 14px;
}

.smart-paste-box code {
  background: rgba(255, 255, 255, 0.09);
  padding: 1px 5px;
  border-radius: 5px;
  color: var(--gold-bright);
}

/* Quick-Add Smart Recents Strip */
.recent-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.recent-strip::-webkit-scrollbar { display: none; }

.recent-pill {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  padding: 7px 12px;
  border-radius: 12px;
  background: linear-gradient(180deg, #1A1A25 0%, #13131B 100%);
  border: 1px solid var(--border-strong);
  font-size: 0.82rem;
  font-weight: 700;
  color: #FFFFFF;
  transition: transform 0.12s var(--spring), border-color 0.15s ease;
}

.recent-pill:active {
  transform: scale(0.95);
  border-color: var(--gold);
}

.recent-pill-sub {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--gold);
}

.qa-cat-scroll {
  max-height: 122px;
  overflow-y: auto;
  padding-right: 2px;
}

.qa-route-pill {
  margin-top: 9px;
  padding: 8px 11px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.qa-route-pill strong {
  color: var(--gold-bright);
}

/* B4 · Calm Due Bills Banner on Home */
.due-banner {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  margin-bottom: 16px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(229, 184, 75, 0.14) 0%, rgba(22, 22, 30, 0.96) 100%);
  border: 1px solid var(--gold-border);
  box-shadow: var(--bevel), var(--shadow-sm);
  text-align: left;
  transition: transform 0.14s var(--spring), border-color 0.15s ease;
}

.due-banner:active { transform: scale(0.985); }
.due-banner-left { min-width: 0; flex: 1; }
.due-banner-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.due-banner-cta { font-size: 0.82rem; font-weight: 800; color: var(--gold-bright); white-space: nowrap; }

.due-review-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.due-review-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  background: #101017;
  border: 1px solid var(--border);
}

.due-check-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  cursor: pointer;
}

.due-check-wrap input[type="checkbox"],
.imp-row-check input[type="checkbox"] {
  width: 19px;
  height: 19px;
  accent-color: var(--gold);
  flex-shrink: 0;
  cursor: pointer;
}

.due-amt-box {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #171721;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  padding: 4px 8px;
  width: 106px;
  flex-shrink: 0;
}

.due-amt-input {
  width: 100%;
  border: none;
  background: transparent;
  color: #FFFFFF;
  font-weight: 800;
  font-size: 0.94rem;
  outline: none;
  text-align: right;
}

/* B5 · Bank / Card Statement Importer */
.file-drop-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 28px 18px;
  border-radius: var(--radius-md);
  border: 1.5px dashed var(--gold-border);
  background: rgba(229, 184, 75, 0.05);
  text-align: center;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.file-drop-zone:hover {
  background: rgba(229, 184, 75, 0.1);
}

.imp-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #0F0F15;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
}

.imp-preview-box {
  background: #0E0E14;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 10px;
}

.imp-preview-line {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.78rem;
  color: var(--text-muted);
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
}
.imp-preview-line:last-child { border-bottom: none; }

.imp-summary-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(229, 184, 75, 0.08);
  border: 1px solid var(--gold-border);
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.imp-rows-scroll {
  max-height: 46dvh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 2px;
}

.imp-row {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: #101017;
  border: 1px solid var(--border);
  transition: opacity 0.15s ease;
}

.imp-row.dimmed { opacity: 0.48; }

.imp-row-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.imp-row-check {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  flex: 1;
  min-width: 0;
  cursor: pointer;
}

.imp-row-cat {
  margin-top: 8px;
  padding-left: 28px;
}

.imp-cat-select {
  min-height: 36px;
  padding: 6px 10px;
  font-size: 0.84rem;
}


/* =========================================================
   v1.6 TRACK C: INTERACTIVE DONUTS, HEATMAP, BURN-RATE SCRUB & CC CYCLE
   ========================================================= */
.card-head-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

/* C1 · Interactive Tap-to-Filter Donuts */
.donut-slice {
  cursor: pointer;
  transition: stroke-width 0.22s var(--spring), opacity 0.22s ease, filter 0.22s ease;
}

.donut-slice.is-selected {
  filter: drop-shadow(0 0 8px rgba(229, 184, 75, 0.55));
}

.donut-slice.is-dimmed {
  opacity: 0.28;
}

.legend-btn {
  width: 100%;
  text-align: left;
  padding: 5px 7px;
  margin: -3px -7px;
  border-radius: 9px;
  transition: background 0.14s ease, opacity 0.2s ease;
}

.legend-btn:active {
  background: rgba(255, 255, 255, 0.06);
}

.legend-btn.is-selected {
  background: rgba(229, 184, 75, 0.13);
  outline: 1px solid var(--gold-border);
}

.legend-btn.is-dimmed {
  opacity: 0.42;
}

/* Shared Drill-Down Drawer (Donut Filter, Heatmap Day Ledger, CC Unbilled Txns) */
.drill-drawer {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  animation: studioFade 0.2s var(--spring);
}

.drill-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.drill-clear-btn {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-muted);
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--border);
}

.drill-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.drill-row:last-child { border-bottom: none; }

.drill-row-title {
  font-weight: 600;
  font-size: 0.88rem;
  color: #FFFFFF;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* C2 · Monthly Spending Heatmap Calendar */
.hm-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin: 12px 0 6px;
  text-align: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-soft);
}

.hm-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.hm-blank {
  aspect-ratio: 1 / 1;
}

.hm-cell {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 0.78rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  border: 1px solid transparent;
  transition: transform 0.12s var(--spring), border-color 0.15s ease, box-shadow 0.15s ease;
}

.hm-cell:not(:disabled):active {
  transform: scale(0.9);
}

.hm-nospend {
  background: #0D0E14;
  border-color: rgba(52, 211, 153, 0.24);
  color: #9CA3AF;
}

.hm-future {
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.2);
  cursor: default;
}

.hm-l1 {
  background: rgba(229, 184, 75, 0.14);
  border-color: rgba(229, 184, 75, 0.26);
  color: #F3E4BC;
}

.hm-l2 {
  background: rgba(229, 184, 75, 0.30);
  border-color: rgba(229, 184, 75, 0.48);
  color: #FFFFFF;
}

.hm-l3 {
  background: rgba(229, 184, 75, 0.56);
  border-color: rgba(246, 215, 126, 0.72);
  color: #0A0A0E;
}

.hm-l4 {
  background: linear-gradient(135deg, #F6D77E, #E5B84B);
  border-color: #F6D77E;
  color: #0A0A0E;
  box-shadow: 0 0 14px rgba(229, 184, 75, 0.42);
}

.hm-today {
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.55);
}

.hm-selected {
  border-color: #FFFFFF !important;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.28);
  transform: scale(1.04);
}

.hm-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.7;
}

.hm-legend {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.hm-scale {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.hm-swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  display: inline-block;
  border: 1px solid transparent;
}

/* C3 · Cumulative Burn-Rate Scrub Chart */
.scrub-zone {
  position: relative;
  margin-top: 4px;
  touch-action: pan-y;
  user-select: none;
  cursor: crosshair;
}

.burn-scrub-readout {
  margin-top: 10px;
  min-height: 22px;
  padding: 5px 10px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  font-size: 0.78rem;
  line-height: 1.35;
}

.burn-legend-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 8px;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}

.burn-legend-row span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-swatch {
  display: inline-block;
  width: 14px;
  height: 3px;
  border-radius: 2px;
}

.legend-swatch.dashed {
  height: 0;
  border-top: 2px dashed #9CA3AF;
}

/* C4 · Credit Card Statement Cycle Tracker */
.cc-cycle-card {
  background:
    radial-gradient(110% 90% at 92% 0%, rgba(96, 165, 250, 0.12) 0%, rgba(96, 165, 250, 0) 58%),
    linear-gradient(180deg, #171722 0%, #12121A 100%);
  border-color: rgba(96, 165, 250, 0.24);
}

.cc-cycle-total {
  font-size: 1.78rem;
  font-weight: 800;
  color: #FFFFFF;
  margin-top: 10px;
  letter-spacing: -0.02em;
}

/* C5 · Interactive Year Bars */
.yr-bar-hit {
  cursor: pointer;
}
.yr-bar-hit:hover rect:nth-child(2) {
  filter: brightness(1.18);
}


/* =========================================================
   v1.7 TRACK D & E3: SEARCH, GUARDRAILS, MULTI-CURRENCY, RECEIPTS & VAULT
   ========================================================= */

/* D1 · Inline Home Search Bar + Studio Rail Kbd + Command Modal */
.home-search-bar {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 15px;
  margin-bottom: 16px;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, #161620 0%, #111119 100%);
  border: 1px solid var(--border-strong);
  box-shadow: var(--bevel), var(--shadow-sm);
  text-align: left;
  transition: border-color 0.16s ease, transform 0.12s var(--spring);
}
.home-search-bar:active { transform: scale(0.985); border-color: var(--gold-border); }
@media (hover: hover) { .home-search-bar:hover { border-color: var(--gold-border); } }

.home-search-placeholder {
  flex: 1;
  font-size: 0.9rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-kbd, .rail-kbd {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-soft);
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.rail-kbd { margin-left: auto; }
@media (max-width: 899px) { .search-kbd { display: none; } }

.search-modal-sheet { max-width: 560px; }

.search-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  border-radius: var(--radius-md);
  background: #0D0D14;
  border: 1.5px solid var(--gold-border);
}

.search-field-input {
  flex: 1;
  min-width: 0;
  min-height: 40px;
  border: none;
  background: transparent;
  color: #FFFFFF;
  font-size: 0.96rem;
  outline: none;
}

.search-quick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.btn-chip-sm {
  min-height: 32px;
  padding: 4px 11px;
  font-size: 0.78rem;
}

.search-filters-panel {
  margin-top: 10px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: #0F0F16;
  border: 1px solid var(--border);
}

.search-subtotal-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  background: rgba(229, 184, 75, 0.08);
  border: 1px solid var(--gold-border);
  margin-bottom: 10px;
}

.search-results-list {
  max-height: 48dvh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-right: 2px;
}

.search-res-row {
  display: flex;
  align-items: center;
  gap: 6px;
  border-radius: var(--radius-sm);
  background: #111119;
  border: 1px solid var(--border);
  padding: 4px;
}

.search-res-main {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 8px;
  text-align: left;
  border-radius: 8px;
  transition: background 0.12s ease;
}
.search-res-main:active { background: var(--surface-hover); }

.search-res-title {
  font-weight: 700;
  font-size: 0.88rem;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
}

.search-bill-btn {
  min-width: 34px;
  min-height: 34px;
  font-size: 0.92rem;
}

/* D2 · Soft Monthly Guardrails (3px Hairline on Home Tile) */
.cat-tile.has-guardrail {
  overflow: hidden;
  padding-bottom: 18px;
}

.tile-guardrail-track {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3.5px;
  background: rgba(255, 255, 255, 0.07);
}

.tile-guardrail-fill {
  height: 100%;
  transition: width 0.35s var(--spring);
}

.tile-guardrail-fill.ok { background: linear-gradient(90deg, var(--gold), var(--gold-bright)); }
.tile-guardrail-fill.warn { background: #F59E0B; }
.tile-guardrail-fill.over { background: var(--danger); box-shadow: 0 0 10px rgba(248, 113, 113, 0.5); }

.cat-guardrail-row {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 8px;
}

/* D3 · Multi-Currency Inline Bar & Row Subtitle */
.fx-inline-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 7px 11px;
  border-radius: 10px;
  background: rgba(96, 165, 250, 0.08);
  border: 1px solid rgba(96, 165, 250, 0.28);
  flex-wrap: wrap;
}

.fx-rate-input {
  width: 84px;
  padding: 4px 8px;
  border-radius: 7px;
  border: 1px solid var(--border-strong);
  background: #0D0D14;
  color: #FFFFFF;
  font-size: 0.88rem;
  font-weight: 700;
  outline: none;
}

.fx-inr-readout {
  margin-left: auto;
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--gold-bright);
}

.expense-fx-sub {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--blue);
  margin-top: 1px;
}

/* E3 · Bill / Warranty Attachment Box & Viewer */
.receipt-attach-box {
  margin-top: 4px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
}

.receipt-attach-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 9px;
}

.receipt-viewer-frame {
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border-strong);
  background: #0B0B10;
  max-height: 62dvh;
  overflow-y: auto;
}

.receipt-viewer-img {
  width: 100%;
  height: auto;
  display: block;
}

/* D4 · Vault Backup Box in Settings */
.vault-box {
  padding: 12px;
  border-radius: var(--radius-sm);
  background: #0E0E15;
  border: 1px solid var(--border-strong);
}

.vault-check-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.vault-check-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--gold);
}


/* =========================================================
   v1.8 TRACK E: FLEXIBLE SPLITS & UPI PAY SHEET
   ========================================================= */
.split-mode-bar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  background: #0D0D13;
  border: 1.5px solid var(--border-strong);
  border-radius: 12px;
  padding: 4px;
}

.split-mode-btn {
  min-height: 36px;
  padding: 5px 4px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  transition: all 0.16s var(--spring);
  white-space: nowrap;
}

.split-mode-btn.active {
  background: var(--gold);
  color: #0A0A0E;
}

.split-alloc-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  max-height: 220px;
  overflow-y: auto;
  padding-right: 2px;
}

.split-alloc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #101017;
  border: 1px solid var(--border);
}

.split-alloc-name {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
  font-size: 0.9rem;
  color: #FFFFFF;
}

.split-alloc-input-wrap {
  display: flex;
  align-items: center;
  gap: 5px;
  background: #171722;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  padding: 4px 9px;
  width: 112px;
  flex-shrink: 0;
}

.split-alloc-unit {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--gold);
}

.split-alloc-input {
  width: 100%;
  border: none;
  background: transparent;
  color: #FFFFFF;
  font-weight: 800;
  font-size: 0.94rem;
  outline: none;
  text-align: right;
}

.split-status-bar {
  margin-top: 8px;
  padding: 6px 10px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  font-weight: 700;
}

.split-status-bar.ok {
  background: var(--green-bg);
  border-color: var(--green-border);
  color: var(--green);
}

.split-status-bar.err {
  background: var(--danger-bg);
  border-color: var(--danger-border);
  color: var(--danger);
}

/* E2 · UPI Pay Sheet & Member UPI Tag */
.upi-tag {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--gold-bright);
  margin-top: 2px;
  word-break: break-all;
}

.upi-inline-form {
  display: flex;
  gap: 8px;
  align-items: center;
}

.upi-pay-hero {
  text-align: center;
  padding: 18px 14px;
  border-radius: var(--radius-md);
  background:
    radial-gradient(120% 100% at 50% 0%, rgba(229, 184, 75, 0.16) 0%, rgba(229, 184, 75, 0) 68%),
    #101018;
  border: 1px solid var(--gold-border);
}

.upi-pay-amt {
  font-size: 2.2rem;
  font-weight: 800;
  color: #FFFFFF;
  margin-top: 4px;
  letter-spacing: -0.02em;
}

.upi-id-pill {
  display: inline-flex;
  align-items: center;
  margin-top: 8px;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--border-strong);
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--gold-bright);
}
