/* ==========================================================================
   Arbitrage Tracker — "solid liquid glass" design system
   Opaque, layered surfaces with specular rims, depth shadows, pointer sheen
   and spring motion. Light + dark. Desktop sidebar, tablet rail, phone tab bar.
   ========================================================================== */
:root {
  --bg: #eceef4;
  --amb-1: #b9d4ff; --amb-2: #d9c8ff; --amb-3: #bdeee6;
  --surface-top: #ffffff; --surface-bot: #f6f7fa;
  --card-top: #f7f8fb; --card-bot: #f0f2f6;
  --tile-top: #ffffff; --tile-bot: #fcfcfe; --tile-edge: rgba(17,24,39,.09);
  --sunken: #e6e8ef;
  --rim: rgba(255,255,255,.95); --edge: rgba(17,24,39,.07); --edge-2: rgba(17,24,39,.12);
  --line: rgba(17,24,39,.07); --row-hover: rgba(17,24,39,.035);
  --text: #0f1222; --muted: #5f6476; --faint: #9a9fb0;
  --accent: #0a6cff; --accent-2: #5b5bf6; --accent-soft: rgba(10,108,255,.12);
  --good: #12a150; --good-soft: rgba(18,161,80,.12);
  --bad: #e5263a; --bad-soft: rgba(229,38,58,.1);
  --warn: #d97706; --warn-soft: rgba(217,119,6,.13);
  --depth: inset 0 1px 0 var(--rim), inset 0 -1px 0 rgba(17,24,39,.04), 0 1px 2px rgba(17,24,39,.05), 0 8px 20px -6px rgba(17,24,39,.10), 0 28px 56px -22px rgba(17,24,39,.20);
  --depth-tile: 0 1px 2px rgba(17,24,39,.06), 0 6px 14px -6px rgba(17,24,39,.14), 0 16px 30px -18px rgba(17,24,39,.18);
  --depth-hover: 0 2px 4px rgba(17,24,39,.07), 0 18px 36px -10px rgba(17,24,39,.24);
  --sheen: rgba(255,255,255,.75);
  --radius: 26px; --radius-tile: 20px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  --spring: cubic-bezier(.34, 1.36, .44, 1);
  --smooth: cubic-bezier(.22, 1, .36, 1);
  --tab-h: 74px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #07080c; --amb-1: #123a7a; --amb-2: #3a1f73; --amb-3: #0c4a45;
  --surface-top: #1c1e26; --surface-bot: #15161d; --card-top: #15161c; --card-bot: #111217; --tile-top: #272a35; --tile-bot: #20232c; --tile-edge: rgba(255,255,255,.09); --sunken: #0d0e13;
  --rim: rgba(255,255,255,.09); --edge: rgba(255,255,255,.06); --edge-2: rgba(255,255,255,.12); --line: rgba(255,255,255,.07); --row-hover: rgba(255,255,255,.04);
  --text: #f4f5fa; --muted: #9aa0b4; --faint: #646a7e;
  --accent: #3b8bff; --accent-2: #7c7cff; --accent-soft: rgba(59,139,255,.18);
  --good: #34d175; --good-soft: rgba(52,209,117,.15); --bad: #ff5a6a; --bad-soft: rgba(255,90,106,.15); --warn: #fbbf24; --warn-soft: rgba(251,191,36,.14);
  --depth: inset 0 1px 0 var(--rim), 0 1px 2px rgba(0,0,0,.5), 0 10px 24px -8px rgba(0,0,0,.6), 0 30px 60px -24px rgba(0,0,0,.8);
  --depth-tile: inset 0 1px 0 rgba(255,255,255,.07), 0 1px 2px rgba(0,0,0,.45), 0 8px 18px -8px rgba(0,0,0,.7);
  --depth-hover: inset 0 1px 0 rgba(255,255,255,.14), 0 2px 4px rgba(0,0,0,.5), 0 22px 40px -12px rgba(0,0,0,.85);
  --sheen: rgba(255,255,255,.10); color-scheme: dark; } }
:root[data-theme="dark"] {
  --bg: #07080c; --amb-1: #123a7a; --amb-2: #3a1f73; --amb-3: #0c4a45;
  --surface-top: #1c1e26; --surface-bot: #15161d; --card-top: #15161c; --card-bot: #111217; --tile-top: #272a35; --tile-bot: #20232c; --tile-edge: rgba(255,255,255,.09); --sunken: #0d0e13;
  --rim: rgba(255,255,255,.09); --edge: rgba(255,255,255,.06); --edge-2: rgba(255,255,255,.12); --line: rgba(255,255,255,.07); --row-hover: rgba(255,255,255,.04);
  --text: #f4f5fa; --muted: #9aa0b4; --faint: #646a7e;
  --accent: #3b8bff; --accent-2: #7c7cff; --accent-soft: rgba(59,139,255,.18);
  --good: #34d175; --good-soft: rgba(52,209,117,.15); --bad: #ff5a6a; --bad-soft: rgba(255,90,106,.15); --warn: #fbbf24; --warn-soft: rgba(251,191,36,.14);
  --depth: inset 0 1px 0 var(--rim), 0 1px 2px rgba(0,0,0,.5), 0 10px 24px -8px rgba(0,0,0,.6), 0 30px 60px -24px rgba(0,0,0,.8);
  --depth-tile: inset 0 1px 0 rgba(255,255,255,.07), 0 1px 2px rgba(0,0,0,.45), 0 8px 18px -8px rgba(0,0,0,.7);
  --depth-hover: inset 0 1px 0 rgba(255,255,255,.14), 0 2px 4px rgba(0,0,0,.5), 0 22px 40px -12px rgba(0,0,0,.85);
  --sheen: rgba(255,255,255,.10); color-scheme: dark;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--bg); color: var(--text); font: 15px/1.5 var(--font); font-feature-settings: "cv11", "ss01"; letter-spacing: -.011em; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; overflow-x: hidden; }
.hidden, [hidden] { display: none !important; }
a { color: var(--accent); text-decoration: none; }
code { font-size: 13px; background: var(--sunken); padding: 2px 7px; border-radius: 7px; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .center { text-align: center; }
.num, .tnum { font-variant-numeric: tabular-nums; }
.good { color: var(--good); } .bad { color: var(--bad); } .warn { color: var(--warn); }
.row { display: flex; align-items: center; } .gap { gap: 8px; } .grow { flex: 1; } .wrap { flex-wrap: wrap; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
::selection { background: var(--accent-soft); }

.ambient { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.ambient i { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .55; animation: drift 26s ease-in-out infinite alternate; }
.ambient i:nth-child(1) { width: 46vw; height: 46vw; background: var(--amb-1); top: -16vw; left: -8vw; }
.ambient i:nth-child(2) { width: 40vw; height: 40vw; background: var(--amb-2); top: 30vh; right: -14vw; animation-delay: -9s; }
.ambient i:nth-child(3) { width: 36vw; height: 36vw; background: var(--amb-3); bottom: -18vw; left: 30vw; animation-delay: -16s; }
@keyframes drift { to { transform: translate(6vw, 4vh) scale(1.12); } }

/* ---------- Surfaces ---------- */
.surface, .card { position: relative; background: linear-gradient(180deg, var(--surface-top), var(--surface-bot)); border: 1px solid var(--edge); box-shadow: var(--depth); border-radius: var(--radius); }
.card { padding: 26px; isolation: isolate; background: linear-gradient(180deg, var(--card-top), var(--card-bot)); }
/* specular rim along the top edge */
.card::before, .tile::before { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none; z-index: 1;
  background: linear-gradient(180deg, var(--rim), transparent 38%); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
/* pointer-following sheen */
.card::after, .tile::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 0; opacity: 0; transition: opacity .4s;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%), var(--sheen), transparent 45%); }
.card:hover::after, .tile:hover::after { opacity: 1; }
.card > *, .tile > * { position: relative; z-index: 2; }

.tile { position: relative; background: linear-gradient(180deg, var(--tile-top), var(--tile-bot)); border: 1px solid var(--tile-edge); box-shadow: var(--depth-tile); border-radius: var(--radius-tile);
  transition: transform .55s var(--spring), box-shadow .4s var(--smooth); transform-style: preserve-3d; will-change: transform; }
.tile.tilting { transition: transform .12s linear, box-shadow .3s; }
.tile:hover { box-shadow: var(--depth-hover); }

/* ---------- Logo ---------- */
.logo { width: 36px; height: 36px; border-radius: 11px; flex: none; display: grid; place-items: center; position: relative;
  background: linear-gradient(180deg, #4aa3ff, #005fe0); box-shadow: inset 0 1px 0 rgba(255,255,255,.45), inset 0 -2px 4px rgba(0,0,0,.18), 0 6px 14px -4px rgba(10,108,255,.55); }
.logo::after { content: ""; position: absolute; inset: 1px 1px 50% 1px; border-radius: 10px 10px 40% 40%; background: linear-gradient(180deg, rgba(255,255,255,.35), transparent); }
.logo svg { width: 28px; height: 28px; stroke: #fff; stroke-width: 2.8; }
.logo.xl svg { stroke-dasharray: 32; animation: draw 1.4s var(--smooth) .2s both; }
.logo.xl { width: 76px; height: 76px; border-radius: 22px; margin: 0 auto 20px; animation: float 5s ease-in-out infinite; }
.logo.xl svg { width: 56px; height: 56px; }
@keyframes draw { from { stroke-dashoffset: 32; } to { stroke-dashoffset: 0; } }
@keyframes float { 50% { transform: translateY(-6px) rotate(-2deg); } }

/* ---------- Shell ---------- */
.app { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 16px; height: calc(100vh - 32px); margin: 16px 0 16px 16px; padding: 20px 14px 14px; display: flex; flex-direction: column; z-index: 40; }
.brand { display: flex; align-items: center; gap: 12px; padding: 2px 8px 22px; }
.brand-txt b { display: block; font-size: 17px; letter-spacing: -.025em; line-height: 1.1; }
.brand-txt small { color: var(--muted); font-size: 12px; }
nav#nav { display: flex; flex-direction: column; gap: 2px; position: relative; }
.nav-label { font-size: 11px; font-weight: 600; color: var(--faint); padding: 16px 12px 6px; text-transform: uppercase; letter-spacing: .07em; }
nav#nav a { position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 13px; color: var(--muted); font-size: 14.5px; font-weight: 550; transition: color .3s, transform .4s var(--spring); }
nav#nav a svg { width: 20px; height: 20px; transition: transform .5s var(--spring); }
nav#nav a:hover { color: var(--text); }
nav#nav a:hover svg { transform: scale(1.12) rotate(-4deg); }
nav#nav a:active { transform: scale(.97); }
nav#nav a.active { color: #fff; }
.nav-pill { position: absolute; left: 0; right: 0; top: 0; height: 42px; border-radius: 13px; z-index: 0; opacity: 0;
  background: linear-gradient(180deg, #3d96ff, #0a64f0); box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 8px 18px -6px rgba(10,108,255,.6);
  transition: transform .55s var(--spring), height .4s var(--smooth), opacity .3s; }
.side-foot { margin-top: auto; display: flex; align-items: center; gap: 4px; padding: 12px 4px 0; border-top: 1px solid var(--line); }
.me { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 14px; flex: 1; min-width: 0; padding-left: 4px; }
.main { overflow-x: clip; min-width: 0; padding: 0 36px 80px; max-width: 1500px; width: 100%; margin: 0 auto; }
.topbar { position: relative; display: flex; align-items: center; justify-content: center; padding: 30px 230px 18px; min-height: 120px; }
.hello { display: flex; align-items: center; justify-content: center; gap: 16px; text-align: center; min-width: 0; animation: titleIn .8s var(--smooth) both; }
.hello h1 { margin: 0; font-size: clamp(28px, 3.4vw, 44px); font-weight: 800; letter-spacing: -.04em; line-height: 1.1; }
.hello h1 .name { background: linear-gradient(120deg, var(--accent) 10%, var(--accent-2) 90%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hello-emoji { font-size: clamp(34px, 3.6vw, 52px); line-height: 1; display: inline-block; filter: drop-shadow(0 8px 14px rgba(0,0,0,.18)); }
.hello-emoji.morning { animation: sunSpin 9s linear infinite, glowPulse 3s ease-in-out infinite; }
.hello-emoji.afternoon { animation: bob 3.2s ease-in-out infinite; }
.hello-emoji.evening { animation: rock 4s ease-in-out infinite; }
.nowrap { white-space: nowrap; }
.hello .wave { display: inline-block; transform-origin: 70% 75%; animation: wave 2.6s ease-in-out infinite; }
@keyframes sunSpin { to { transform: rotate(360deg); } }
@keyframes glowPulse { 50% { filter: drop-shadow(0 0 18px rgba(255,190,40,.75)); } }
@keyframes bob { 50% { transform: translateY(-7px) scale(1.05); } }
@keyframes rock { 0%, 100% { transform: rotate(-10deg); } 50% { transform: rotate(12deg) translateY(-3px); } }
@keyframes wave { 0%, 60%, 100% { transform: rotate(0); } 10%, 30% { transform: rotate(16deg); } 20%, 40% { transform: rotate(-8deg); } 50% { transform: rotate(10deg); } }
.top-actions { position: absolute; right: 0; top: 50%; transform: translateY(-50%); display: flex; gap: 10px; align-items: center; }
.toolbar { position: relative; z-index: 30; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 10px 12px; padding: 4px 0 24px; min-width: 0; pointer-events: none; }
.toolbar > * { pointer-events: auto; }
.toolbar:empty { display: none; }
.range { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 10px; max-width: 100%; }
@media (max-width: 1100px) {
  .topbar { padding: 26px 70px 18px; }
  .top-actions .lbl { display: none; }
  .top-actions .btn { padding: 11px; border-radius: 14px; }
}
.toolbar:empty { display: none; }
.view { min-width: 0; }
.only-mobile { display: none !important; }
.tabbar { display: none; }

/* ---------- Buttons ---------- */
.btn { appearance: none; position: relative; overflow: hidden; border: 1px solid var(--edge-2); color: var(--text); padding: 9px 16px; border-radius: 999px; font: 600 14px var(--font); letter-spacing: -.01em; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; white-space: nowrap; text-decoration: none !important;
  background: linear-gradient(180deg, var(--surface-top), var(--surface-bot)); box-shadow: inset 0 1px 0 var(--rim), 0 1px 2px rgba(17,24,39,.06), 0 4px 10px -4px rgba(17,24,39,.12);
  transition: transform .45s var(--spring), box-shadow .3s, filter .2s; }
.btn:hover { transform: translateY(-1px); box-shadow: inset 0 1px 0 var(--rim), 0 2px 4px rgba(17,24,39,.08), 0 10px 20px -8px rgba(17,24,39,.25); }
.btn:active { transform: scale(.95); transition-duration: .12s; }
.btn svg { width: 17px; height: 17px; }
.btn.primary { color: #fff; border-color: rgba(0,60,170,.45); background: linear-gradient(180deg, #3d96ff, #0a64f0);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.4), inset 0 -2px 3px rgba(0,30,90,.2), 0 2px 4px rgba(10,100,240,.25), 0 10px 22px -8px rgba(10,100,240,.6); }
.btn.primary:hover { filter: brightness(1.06); box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 4px 8px rgba(10,100,240,.25), 0 16px 30px -10px rgba(10,100,240,.7); }
.btn.danger { color: var(--bad); }
.btn.sm { padding: 6px 12px; font-size: 13px; }
.btn.wide { width: 100%; padding: 14px; font-size: 16px; border-radius: 16px; }
.btn[disabled] { opacity: .55; pointer-events: none; }
.btn .ripple { position: absolute; border-radius: 50%; background: currentColor; opacity: .18; transform: scale(0); animation: ripple .65s var(--smooth) forwards; pointer-events: none; }
@keyframes ripple { to { transform: scale(2.6); opacity: 0; } }
.icon-btn { appearance: none; border: 0; background: transparent; color: var(--muted); width: 38px; height: 38px; border-radius: 12px; display: inline-grid; place-items: center; cursor: pointer; transition: background .2s, color .2s, transform .4s var(--spring); flex: none; }
.icon-btn:hover { background: var(--sunken); color: var(--text); }
.icon-btn:active { transform: scale(.88); }
.icon-btn.danger:hover { color: var(--bad); background: var(--bad-soft); }
.shot-btn { color: var(--muted); }
.shot-btn:hover { color: var(--accent); }

/* ---------- Inputs ---------- */
input, select, textarea { width: 100%; background: var(--sunken); border: 1px solid transparent; color: var(--text); padding: 11px 14px; border-radius: 13px; font: 15px var(--font); letter-spacing: -.01em;
  box-shadow: inset 0 1px 2px rgba(17,24,39,.08); transition: border-color .25s, box-shadow .25s, background .25s; min-width: 0; }
input:focus, select:focus, textarea:focus { outline: none; background: var(--surface-top); border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft), 0 6px 14px -8px rgba(10,108,255,.4); }
input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--accent); box-shadow: none; }
input[type=color] { padding: 4px; height: 42px; width: 52px; cursor: pointer; }
select { appearance: none; padding-right: 36px; cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238a8fa3' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 13px center; }
textarea { resize: vertical; min-height: 84px; }
label { display: flex; flex-direction: column; gap: 7px; font-size: 13px; font-weight: 600; color: var(--muted); min-width: 0; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
.hint { font-size: 12.5px; color: var(--faint); font-weight: 450; }
.check { flex-direction: row; align-items: center; gap: 10px; color: var(--text); font-size: 14px; font-weight: 550; cursor: pointer; }
.field-icon { position: relative; }
.field-icon svg { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--faint); }
.field-icon input { padding-left: 44px; }
.switch { appearance: none; width: 44px !important; height: 26px !important; border-radius: 99px; background: var(--sunken); position: relative; cursor: pointer; transition: background .3s; box-shadow: inset 0 1px 3px rgba(0,0,0,.15) !important; border: 0 !important; padding: 0; flex: none; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(0,0,0,.25); transition: transform .45s var(--spring); }
.switch:checked { background: var(--good); }
.switch:checked::after { transform: translateX(18px); }

/* ---------- Segmented control with sliding glass thumb ---------- */
.seg { position: relative; display: inline-flex; padding: 6px; gap: 2px; border-radius: 999px; background: linear-gradient(180deg, var(--surface-top), var(--surface-bot)); border: 1px solid var(--tile-edge); box-shadow: var(--depth-tile); max-width: 100%; overflow-x: auto; scrollbar-width: none; scroll-behavior: smooth; }
.seg::-webkit-scrollbar { display: none; }
.seg button { position: relative; z-index: 1; border: 0; background: transparent; color: var(--muted); padding: 10px 18px; border-radius: 999px; font: 600 14px var(--font); cursor: pointer; white-space: nowrap; transition: color .35s; display: inline-flex; align-items: center; gap: 7px; flex: none; }
.seg button svg { width: 16px; height: 16px; }
.seg button:hover { color: var(--text); }
.seg button.on { color: #fff; }
.seg .thumb { position: absolute; z-index: 0; top: 6px; height: calc(100% - 12px); left: 0; border-radius: 999px; background: linear-gradient(180deg, #3b95ff, #0a64f0);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 6px 14px -4px rgba(10,100,240,.55); transition: transform .55s var(--spring), width .55s var(--spring); }
.date-pair { display: flex; gap: 6px; align-items: center; }
.date-pair input { width: auto; padding: 8px 12px; font-size: 14px; }

/* Month stepper */
.stepper { display: inline-flex; align-items: center; gap: 2px; padding: 6px; border-radius: 999px; border-color: var(--tile-edge) !important; background: linear-gradient(180deg, var(--surface-top), var(--surface-bot)); border: 1px solid var(--edge); box-shadow: var(--depth-tile); flex: none; }
.stepper .icon-btn { width: 40px; height: 40px; border-radius: 999px; }
.chip-toggle { display: inline-flex; align-items: center; gap: 10px; padding: 9px 16px 9px 10px; border-radius: 999px; background: linear-gradient(180deg, var(--surface-top), var(--surface-bot)); border: 1px solid var(--tile-edge); box-shadow: var(--depth-tile); font-size: 14px; font-weight: 600; cursor: pointer; flex-direction: row; color: var(--text); }
.stepper label { position: relative; flex-direction: row; align-items: center; gap: 8px; padding: 0 12px; color: var(--text); font-size: 15px; font-weight: 650; cursor: pointer; min-width: 150px; justify-content: center; }
.stepper label svg { width: 16px; height: 16px; color: var(--accent); }
.stepper label .dd-native { display: none; }
.stepper .val { display: inline-block; animation: flip .45s var(--spring); }
@keyframes flip { from { opacity: 0; transform: translateY(8px) rotateX(-50deg); } }

/* ---------- Layout grids ---------- */
.grid { display: grid; gap: 20px; }
.section { margin-top: 20px; }
.kpis { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dash-split { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.earn-split { grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); align-items: start; }

.card-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; margin-bottom: 22px; }
.card-head:not(:has(.ic)) { grid-template-columns: minmax(0, 1fr) auto; }
.card-head .ic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex: none; color: #fff; background: linear-gradient(180deg, var(--c1, #4aa3ff), var(--c2, #0a64f0)); box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 6px 12px -4px var(--glow, rgba(10,100,240,.55)); }
.card-head .ic svg { width: 19px; height: 19px; }
.card-head .ttl { min-width: 0; }
.card-head h2 { margin: 0; font-size: 21px; font-weight: 720; letter-spacing: -.028em; line-height: 1.2; }
.card-head h3 { margin: 0; font-size: 17px; font-weight: 680; letter-spacing: -.022em; line-height: 1.25; }
.card-head .sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.card-head .tools { display: flex; gap: 6px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.card-head .tools:empty { display: none; }
.card { container-type: inline-size; }
@container (max-width: 520px) {
  .card-head .tools .lbl { display: none; }
  .card-head .tools .btn { padding: 8px; }
  .card-head .tools:has(> :nth-child(2)) { grid-column: 1 / -1; justify-content: space-between; }
}
.sub-head { display: flex; align-items: baseline; gap: 10px; margin: 0 0 14px; flex-wrap: wrap; }
.sub-head h3 { margin: 0; font-size: 16px; font-weight: 680; letter-spacing: -.02em; }
.sub-head .sub { color: var(--muted); font-size: 13px; }

/* KPI tiles */
.kpi { padding: 18px 18px 16px; min-width: 0; }
.kpi .label { color: var(--muted); font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 10px; }
.kpi .badge { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; color: #fff; flex: none; background: linear-gradient(180deg, var(--c1), var(--c2)); box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 4px 10px -3px var(--glow); }
.kpi .badge svg { width: 16px; height: 16px; }
.kpi .value { font-size: 30px; font-weight: 760; letter-spacing: -.035em; line-height: 1.1; margin-top: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .value.empty { font-size: 20px !important; color: var(--faint) !important; font-weight: 650; letter-spacing: -.01em; padding: 6px 0 4px; }
.kpi .foot { font-size: 12.5px; color: var(--muted); margin-top: 6px; line-height: 1.4; }
.kpi { background: radial-gradient(130% 90% at 0% 0%, var(--wash, transparent), transparent 62%), linear-gradient(180deg, var(--tile-top), var(--tile-bot)); }
.kpi.hero { border-color: var(--ring, rgba(10,100,240,.35));
  background: radial-gradient(140% 100% at 0% 0%, var(--wash-strong, rgba(10,108,255,.16)), transparent 70%), linear-gradient(180deg, var(--tile-top), var(--tile-bot));
  box-shadow: 0 0 0 3px var(--wash, rgba(10,108,255,.08)), var(--depth-tile); }
.kpi.hero .value { font-size: 40px; color: var(--c2, var(--accent)); }
.kpi.hero:hover { box-shadow: 0 0 0 3px var(--wash, rgba(10,108,255,.08)), var(--depth-hover); }

/* Partners */
.pchip { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; min-width: 0; }
.avatar { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; color: #fff; font: 700 12px var(--font); flex: none; position: relative;
  background: var(--c); background-image: linear-gradient(180deg, rgba(255,255,255,.28), rgba(0,0,0,.1)); box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 3px 8px -2px var(--c); }
.avatar.lg { width: 44px; height: 44px; font-size: 17px; }
.people { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.person { padding: 18px; min-width: 0; }
.person .top { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.person .top b { font-size: 16px; letter-spacing: -.02em; display: block; }
.person .top small { color: var(--faint); font-size: 12.5px; }
.person .stat { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; font-size: 14px; }
.person .stat span:first-child { color: var(--muted); }
.person .stat b { font-weight: 650; font-variant-numeric: tabular-nums; }
.person .net { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; font-weight: 650; }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 4px 11px; border-radius: 999px; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; box-shadow: inset 0 1px 0 rgba(255,255,255,.3); }
.pill svg { width: 14px; height: 14px; }
.pill.good { background: var(--good-soft); color: var(--good); } .pill.bad { background: var(--bad-soft); color: var(--bad); } .pill.muted { background: var(--sunken); color: var(--muted); }
.bar { height: 8px; border-radius: 8px; background: var(--sunken); box-shadow: inset 0 1px 2px rgba(17,24,39,.12); overflow: hidden; margin: 6px 0 8px; }
.bar > i { display: block; height: 100%; border-radius: 8px; width: 0; transition: width 1.3s var(--smooth); background-image: linear-gradient(180deg, rgba(255,255,255,.35), rgba(255,255,255,0)); box-shadow: inset 0 -1px 0 rgba(0,0,0,.1); }
.stack { display: flex; height: 14px; border-radius: 14px; overflow: hidden; background: var(--sunken); gap: 3px; box-shadow: inset 0 1px 3px rgba(17,24,39,.12); }
.stack i { height: 100%; width: 0; transition: width 1.3s var(--smooth); background-image: linear-gradient(180deg, rgba(255,255,255,.4), rgba(255,255,255,0) 60%); }
.stack i:first-child { border-radius: 14px 0 0 14px; } .stack i:last-child { border-radius: 0 14px 14px 0; }
.legend { display: flex; gap: 8px 16px; flex-wrap: wrap; margin-top: 12px; font-size: 13px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend span::before { content: ""; width: 9px; height: 9px; border-radius: 3px; background: var(--c); box-shadow: 0 2px 4px -1px var(--c); }

/* Transfers */
.settled-ok { padding: 22px; border-radius: 18px; background: var(--good-soft); color: var(--good); font-weight: 650; display: flex; align-items: center; justify-content: center; gap: 10px; text-align: center; }
.settled-ok svg { width: 22px; height: 22px; }

/* Steps / stat tiles */
.steps { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.step { padding: 16px 16px 15px; min-width: 0; }
.step small { color: var(--muted); display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.step small svg { width: 15px; height: 15px; color: var(--faint); }
.step b { font-size: 22px; font-weight: 740; letter-spacing: -.03em; font-variant-numeric: tabular-nums; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.step .faint { font-size: 12px; margin-top: 3px; }
.step .done-dot { position: absolute; top: 12px; right: 12px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: linear-gradient(180deg, #3fd47f, #12a150); box-shadow: 0 3px 8px -2px rgba(18,161,80,.6); z-index: 3; animation: pop .6s var(--spring) both; }
.step .done-dot svg { width: 13px; height: 13px; stroke-width: 3; }
@keyframes pop { from { transform: scale(0); } }

/* Tags */
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px; font-size: 12px; font-weight: 650; background: var(--sunken); color: var(--muted); white-space: nowrap; }
.tag::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.tag.live::before { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px transparent; transform: scale(.85); } }
.tag.ok { background: var(--good-soft); color: var(--good); }
.tag.pending { background: var(--warn-soft); color: var(--warn); }

/* Notes */
.note { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 16px; background: var(--accent-soft); font-size: 14px; color: var(--text); line-height: 1.55; }
.note > svg { color: var(--accent); margin-top: 2px; }
.note.warn { background: var(--warn-soft); } .note.warn > svg { color: var(--warn); }

/* ---------- Tables (become cards on phones) ---------- */
.table-wrap { overflow-x: auto; margin: 0 -10px; padding: 0 10px; }
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
th { text-align: left; color: var(--faint); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; padding: 0 14px 12px; white-space: nowrap; }
td { padding: 14px; border-top: 1px solid var(--line); vertical-align: middle; }
tbody tr { transition: background .25s; }
tbody tr:hover td { background: var(--row-hover); }
tbody tr:hover td:first-child { border-radius: 14px 0 0 14px; } tbody tr:hover td:last-child { border-radius: 0 14px 14px 0; }
td.num, th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
tfoot td { font-weight: 700; border-top: 1px solid var(--edge-2); padding-top: 16px; }
.reason { font-weight: 600; } .comment { color: var(--muted); font-size: 13px; max-width: 380px; margin-top: 2px; }
.row-actions { display: inline-flex; gap: 2px; }
.thumb { width: 42px; height: 42px; border-radius: 12px; object-fit: cover; cursor: zoom-in; display: block; box-shadow: 0 0 0 1px var(--edge-2), 0 4px 10px -4px rgba(0,0,0,.3); transition: transform .45s var(--spring); }
.thumb:hover { transform: scale(1.12) rotate(-2deg); }
.pdf-thumb { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--bad-soft); font-size: 10px; font-weight: 800; color: var(--bad); }
.empty { text-align: center; padding: 48px 16px; color: var(--muted); }
.empty .em-ic { width: 72px; height: 72px; margin: 0 auto 16px; border-radius: 22px; display: grid; place-items: center; color: var(--accent); background: linear-gradient(180deg, var(--tile-top), var(--tile-bot)); border: 1px solid var(--edge); box-shadow: var(--depth-tile); animation: float 4s ease-in-out infinite; }
.empty .em-ic svg { width: 32px; height: 32px; }
.empty b { display: block; color: var(--text); font-size: 16px; margin-bottom: 4px; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.filters select { width: auto; }
.filters .field-icon { flex: 1; min-width: 200px; max-width: 360px; }

.chart-box { position: relative; height: 320px; }
.chart-box.sm { height: 240px; }

/* File drop */
.drop { border: 1.5px dashed var(--edge-2); border-radius: 16px; padding: 18px; text-align: center; color: var(--muted); cursor: pointer; transition: all .35s var(--smooth); font-size: 14px; background: var(--sunken); }
.drop .row { justify-content: center; gap: 10px; }
.drop.over, .drop:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); transform: scale(1.01); }
.drop img { max-height: 160px; border-radius: 12px; margin-top: 12px; animation: pop .5s var(--spring); }

/* ---------- Modal → bottom sheet on phones ---------- */
.dd-native { display: none !important; }
/* Themed date + dropdown buttons (look like inputs) */
.dp-btn, .dd-btn { width: 100%; display: flex; align-items: center; gap: 10px; background: var(--sunken); border: 1px solid transparent; color: var(--text); padding: 11px 14px; border-radius: 13px; font: 500 15px var(--font); letter-spacing: -.01em; cursor: pointer; text-align: left; transition: background .25s, border-color .25s, box-shadow .25s; min-height: 46px; }
.dp-btn svg { width: 17px; height: 17px; color: var(--accent); }
.dp-btn .ph, .dd-btn .ph { color: var(--faint); }
.dd-btn span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd-btn > svg { width: 16px; height: 16px; color: var(--muted); transition: transform .35s var(--spring); }
.dp-btn:hover, .dd-btn:hover { border-color: var(--edge-2); }
.dp-btn.open, .dd-btn.open { background: var(--surface-top); border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.dd-btn.open > svg { transform: rotate(180deg); }
.dd-btn.pill { width: auto; border-radius: 999px; background: linear-gradient(180deg, var(--tile-top), var(--tile-bot)); border-color: var(--tile-edge); box-shadow: var(--depth-tile); font-weight: 600; font-size: 14px; padding: 9px 14px; min-height: 0; }
.dd-dot { width: 10px; height: 10px; border-radius: 4px; flex: none; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.date-pair .dp-btn { width: auto; padding: 9px 14px; min-height: 0; font-size: 14px; border-radius: 999px; background: linear-gradient(180deg, var(--surface-top), var(--surface-bot)); border-color: var(--tile-edge); box-shadow: var(--depth-tile); font-weight: 600; }

/* Popover shell */
.pop { position: fixed; inset: 0; z-index: 300; pointer-events: none; }
.pop-card { position: absolute; pointer-events: auto; background: linear-gradient(180deg, var(--surface-top), var(--surface-bot)); border: 1px solid var(--tile-edge); border-radius: 20px; box-shadow: 0 2px 6px rgba(17,24,39,.08), 0 24px 48px -12px rgba(17,24,39,.32); padding: 10px; transform-origin: top left; animation: popIn .32s var(--spring) both; }
.pop.up .pop-card { transform-origin: bottom left; }
.pop.out .pop-card { animation: popOut .2s var(--smooth) both; }
@keyframes popIn { from { opacity: 0; transform: translateY(-6px) scale(.94); } }
@keyframes popOut { to { opacity: 0; transform: translateY(-4px) scale(.96); } }
.pop.sheet { pointer-events: auto; }
.pop-backdrop { position: absolute; inset: 0; background: rgba(10,12,20,.35); animation: fadeIn .25s both; }
.pop.out .pop-backdrop { animation: fadeOut .2s both; }
@keyframes fadeIn { from { opacity: 0; } } @keyframes fadeOut { to { opacity: 0; } }
.pop.sheet .pop-card { left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); top: auto; border-radius: 26px; padding: 14px; max-height: 70vh; overflow: auto; animation: sheetUp .45s var(--spring) both; transform-origin: bottom center; }
.pop.sheet.out .pop-card { animation: sheetDown .22s var(--smooth) both; }
@keyframes sheetUp { from { transform: translateY(110%); } } @keyframes sheetDown { to { transform: translateY(110%); } }

/* Calendar */
.pop-cal .pop-card { width: 316px; min-width: 0 !important; }
.pop.sheet.pop-cal .pop-card { width: auto; }
.cal-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 2px 8px; }
.cal-head b { font-size: 15px; font-weight: 700; letter-spacing: -.02em; }
.cal-head .icon-btn { width: 36px; height: 36px; border-radius: 12px; }
.cal-head .icon-btn:disabled { opacity: .3; cursor: default; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.cal-grid.from-right { animation: calR .38s var(--smooth); } .cal-grid.from-left { animation: calL .38s var(--smooth); }
@keyframes calR { from { opacity: 0; transform: translateX(18px); } } @keyframes calL { from { opacity: 0; transform: translateX(-18px); } }
.cal-grid span { text-align: center; font-size: 11px; font-weight: 650; color: var(--faint); padding: 4px 0 6px; text-transform: uppercase; letter-spacing: .04em; }
.cal-grid button { aspect-ratio: 1; border: 0; background: transparent; border-radius: 12px; font: 600 14px var(--font); color: var(--text); cursor: pointer; transition: background .2s, transform .25s var(--spring); }
.cal-grid button:hover:not(:disabled) { background: var(--accent-soft); color: var(--accent); }
.cal-grid button:active:not(:disabled) { transform: scale(.88); }
.cal-grid button.other { color: var(--faint); font-weight: 500; }
.cal-grid button.today { box-shadow: inset 0 0 0 1.5px var(--accent); color: var(--accent); }
.cal-grid button.sel { background: linear-gradient(180deg, #3b95ff, #0a64f0); color: #fff; box-shadow: 0 6px 12px -4px rgba(10,100,240,.55); }
.cal-grid button:disabled { color: var(--faint); opacity: .35; cursor: default; }
.cal-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.pop.sheet .cal-grid button { font-size: 16px; }
.cal-grid button i { font-style: normal; }
/* Range calendar: one tap = a day, second tap = a range */
.cal-range .cal-grid { gap: 3px 0; }
.cal-range .cal-grid button { border-radius: 12px; position: relative; }
.cal-range .cal-grid button.in { background: var(--accent-soft); color: var(--accent); border-radius: 0; }
.cal-range .cal-grid button.start { border-radius: 12px 0 0 12px; }
.cal-range .cal-grid button.end { border-radius: 0 12px 12px 0; }
.cal-range .cal-grid button.in:nth-child(7n+1), .cal-range .cal-grid button.end:nth-child(7n+1) { border-top-left-radius: 12px; border-bottom-left-radius: 12px; }
.cal-range .cal-grid button.in:nth-child(7n), .cal-range .cal-grid button.start:nth-child(7n) { border-top-right-radius: 12px; border-bottom-right-radius: 12px; }
.cal-range .cal-grid button.sel { animation: selPop .35s var(--spring); }
@keyframes selPop { 0% { transform: scale(.82); } }
.cal-range .cal-foot { gap: 12px; }
.cal-sum { display: flex; flex-direction: column; min-width: 0; }
.cal-sum b { font-size: 14px; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-sum small { font-size: 11.5px; color: var(--faint); }
.cal-range [data-apply]:disabled { opacity: .45; cursor: default; }
.seg.fade-r { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 36px), transparent); }
.seg.fade-l { -webkit-mask-image: linear-gradient(90deg, transparent, #000 36px); mask-image: linear-gradient(90deg, transparent, #000 36px); }
.seg.fade-l.fade-r { -webkit-mask-image: linear-gradient(90deg, transparent, #000 36px, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(90deg, transparent, #000 36px, #000 calc(100% - 36px), transparent); }

/* Dropdown list */
.pop-dd .pop-card { padding: 6px; max-height: 340px; overflow: auto; max-width: min(360px, calc(100vw - 16px)); }
.dd-list { display: flex; flex-direction: column; gap: 2px; }
.dd-list button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 11px 12px; border: 0; background: transparent; border-radius: 12px; font: 550 15px var(--font); color: var(--text); text-align: left; cursor: pointer; transition: background .15s; animation: ddIn .3s var(--smooth) both; }
.dd-list button span { flex: 1; }
.dd-list button svg { width: 17px; height: 17px; color: var(--accent); }
.dd-list button:hover { background: var(--row-hover); }
.dd-list button.sel { background: var(--accent-soft); color: var(--accent); font-weight: 650; }
.dd-list button:nth-child(2) { animation-delay: .02s; } .dd-list button:nth-child(3) { animation-delay: .04s; } .dd-list button:nth-child(4) { animation-delay: .06s; } .dd-list button:nth-child(n+5) { animation-delay: .08s; }
@keyframes ddIn { from { opacity: 0; transform: translateY(-4px); } }
.pop.sheet .dd-list button { padding: 14px 14px; font-size: 16px; }

.span-all { grid-column: 1 / -1; }
.partner-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.partner-set, .acc-set { padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.acc-set { padding: 14px; gap: 12px; }
.acc-rows { display: flex; flex-direction: column; gap: 10px; }
.set-label { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); margin-top: 4px; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sw { position: relative; width: 32px; height: 32px; border-radius: 10px; border: 0; padding: 0; cursor: pointer; background: var(--sw); box-shadow: inset 0 0 0 1px rgba(0,0,0,.08), 0 3px 8px -3px var(--sw); transition: transform .35s var(--spring), box-shadow .25s; display: grid; place-items: center; flex-direction: row; }
.sw:hover { transform: translateY(-2px) scale(1.06); }
.sw.on { box-shadow: 0 0 0 2.5px var(--surface-top), 0 0 0 5px var(--sw), 0 6px 12px -4px var(--sw); transform: scale(1.04); }
.sw.custom { border: 1.5px dashed var(--edge-2); color: var(--muted); overflow: hidden; }
.sw.custom.on { border-color: transparent; color: #fff; }
.sw.custom svg { width: 16px; height: 16px; }
.sw.custom input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; padding: 0; }
.chks { display: flex; flex-wrap: wrap; gap: 8px; }
.chk { flex-direction: row; align-items: center; gap: 9px; padding: 8px 14px 8px 9px; border-radius: 999px; background: var(--sunken); color: var(--text); font-size: 14px; font-weight: 600; cursor: pointer; transition: background .25s, color .25s; user-select: none; }
.chk input { position: absolute; opacity: 0; width: 0; height: 0; }
.chk .box { width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; background: var(--surface-top); box-shadow: inset 0 0 0 1.5px var(--edge-2); transition: background .25s, box-shadow .25s, transform .35s var(--spring); }
.chk .box svg { width: 14px; height: 14px; color: #fff; stroke-width: 3; opacity: 0; transform: scale(.4); transition: opacity .2s, transform .35s var(--spring); }
.chk:has(input:checked) { background: var(--accent-soft); color: var(--accent); }
.chk input:checked + .box { background: linear-gradient(180deg, #3b95ff, #0a64f0); box-shadow: 0 4px 8px -3px rgba(10,100,240,.6); }
.chk input:checked + .box svg { opacity: 1; transform: none; }
.chk:active .box { transform: scale(.85); }
.chk input:focus-visible + .box { box-shadow: 0 0 0 3px var(--accent-soft), inset 0 0 0 1.5px var(--accent); }
.rate-live { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; }
.rate-live b { font-size: 26px; font-weight: 780; letter-spacing: -.03em; }
.btn.spin svg { animation: sunSpin .8s linear infinite; }
.reason-list { display: flex; flex-wrap: wrap; gap: 8px; }
.reason-chip { display: inline-flex; align-items: center; gap: 4px; padding: 6px 6px 6px 14px; border-radius: 999px; background: linear-gradient(180deg, var(--tile-top), var(--tile-bot)); border: 1px solid var(--tile-edge); box-shadow: var(--depth-tile); font-size: 14px; font-weight: 600; animation: ddIn .3s var(--smooth) both; }
.reason-chip .icon-btn { width: 26px; height: 26px; border-radius: 999px; }
.reason-chip .icon-btn svg { width: 14px; height: 14px; }

.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(8,10,20,.42); backdrop-filter: blur(6px) saturate(120%); -webkit-backdrop-filter: blur(6px); animation: fade .35s; }
.modal-card { width: min(620px, 100%); max-height: calc(100vh - 32px); overflow: auto; padding: 26px; border-radius: 28px; animation: sheetIn .6s var(--spring); overscroll-behavior: contain; }
.modal-card.wide { width: min(940px, 100%); }
.modal-card header { display: flex; align-items: center; margin-bottom: 20px; gap: 10px; }
.modal-card header h3 { margin: 0; font-size: 22px; font-weight: 740; letter-spacing: -.028em; flex: 1; }
.modal-card .actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.modal-card img.full { max-width: 100%; border-radius: 16px; display: block; margin: auto; }
.modal.closing .modal-card { animation: sheetOut .3s var(--smooth) forwards; }
.modal.closing .modal-backdrop { animation: fade .3s reverse forwards; }
.grabber { display: none; }
@keyframes sheetIn { from { opacity: 0; transform: translateY(30px) scale(.94); } }
@keyframes sheetOut { to { opacity: 0; transform: translateY(20px) scale(.96); } }
@keyframes fade { from { opacity: 0; } }
.menu-list { display: flex; flex-direction: column; gap: 8px; }
.menu-list button, .menu-list a { display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 16px; border-radius: 16px; border: 1px solid var(--edge); background: linear-gradient(180deg, var(--tile-top), var(--tile-bot)); box-shadow: var(--depth-tile); color: var(--text); font: 600 15px var(--font); cursor: pointer; text-align: left; }
.menu-list svg { color: var(--accent); }

/* ---------- Toasts (dynamic-island style) ---------- */
.toasts { position: fixed; top: max(14px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 300; pointer-events: none; width: max-content; max-width: calc(100vw - 24px); }
.toast { display: flex; gap: 10px; align-items: center; padding: 12px 18px 12px 12px; border-radius: 999px; background: linear-gradient(180deg, #23252e, #121319); color: #fff; font-weight: 600; font-size: 14px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 18px 40px -10px rgba(0,0,0,.55); animation: island .7s var(--spring); }
.toast .t-ic { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: #30d158; flex: none; }
.toast.err .t-ic { background: #ff453a; }
.toast .t-ic svg { width: 15px; height: 15px; stroke-width: 3; }
.toast.out { animation: islandOut .4s var(--smooth) forwards; }
@keyframes island { from { opacity: 0; transform: translateY(-14px) scaleX(.4) scaleY(.7); } }
@keyframes islandOut { to { opacity: 0; transform: translateY(-14px) scale(.8); } }

/* ---------- Sign in ---------- */
.auth { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 20px; }
.auth-card { width: min(430px, 100%); text-align: center; padding: 38px 30px 30px; animation: sheetIn .8s var(--spring); }
.auth-card h1 { font-size: 30px; font-weight: 780; letter-spacing: -.035em; margin: 0 0 6px; }
.auth-card form { display: flex; flex-direction: column; gap: 14px; margin-top: 26px; }
.auth-card input[type=password] { padding: 15px 15px 15px 44px; font-size: 16px; }
.who { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 4px; }
.who label { cursor: pointer; align-items: center; gap: 10px; padding: 18px 6px 14px; border-radius: 20px; color: var(--text); font-size: 14px; font-weight: 600; border: 1px solid transparent; transition: all .5s var(--spring); }
.who label:hover { background: var(--sunken); }
.who label:has(input:checked) { background: linear-gradient(180deg, var(--tile-top), var(--tile-bot)); border-color: var(--edge); box-shadow: var(--depth-tile); transform: translateY(-3px); }
.who label .avatar { transition: transform .55s var(--spring), box-shadow .3s; }
.who label:has(input:checked) .avatar { transform: scale(1.14); box-shadow: 0 0 0 3px var(--surface-top), 0 0 0 5.5px var(--accent), 0 10px 20px -6px var(--c); }
.who input { display: none; }
.who .avatar.lg { width: 58px; height: 58px; font-size: 22px; }
.err { color: var(--bad); min-height: 20px; margin: 0; font-size: 14px; font-weight: 550; }
.shake { animation: shake .5s var(--smooth); }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }

/* ---------- Motion: reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(8px); }
.reveal.in { opacity: 1; transform: none; transition: opacity .3s var(--smooth), transform .4s var(--smooth); transition-delay: calc(var(--i, 0) * 25ms); }
.tile.reveal.in { transition: opacity .3s var(--smooth), transform .4s var(--smooth), box-shadow .4s; transition-delay: calc(var(--i, 0) * 25ms), calc(var(--i, 0) * 25ms), 0s; }
.tile.reveal.in.settled { transition: transform .55s var(--spring), box-shadow .4s var(--smooth); transition-delay: 0s; }
tbody tr.reveal { filter: none; transform: translateX(-10px); }
.skeleton { border-radius: var(--radius); height: 140px; background: linear-gradient(100deg, var(--surface-bot) 30%, var(--surface-top) 50%, var(--surface-bot) 70%); background-size: 300% 100%; animation: shimmer 1.4s infinite; border: 1px solid var(--edge); }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.view.leaving { opacity: 0; transform: translateY(6px); transition: opacity .11s, transform .11s; }

/* Capture helpers */
/* the captured block's own drop shadow is painted under it separately; html2canvas would smear it across the block */
.card.capturing, .tile.capturing, .surface.capturing { box-shadow: none !important; }
.capturing #ppAdd { display: none; }
.capturing .shot-btn, .capturing .no-shot, .capturing-page .shot-btn, .capturing-page .no-shot { visibility: hidden; }
.capturing::before, .capturing::after, .capturing .card::before, .capturing .card::after, .capturing .tile::before, .capturing .tile::after, .capturing .gloss, .capturing .logo::after { display: none !important; }

/* FAB (phones) */
.fab { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1240px) { .dash-split { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 1100px) {
  .app { grid-template-columns: 88px minmax(0, 1fr); }
  .sidebar { padding: 18px 10px 12px; align-items: center; }
  .brand { padding: 2px 0 18px; } .brand-txt, .nav-label, nav#nav a span, .me span { display: none; }
  nav#nav a { justify-content: center; padding: 11px; } nav#nav { gap: 6px; width: 100%; }
  .side-foot { flex-direction: column; gap: 6px; border: 0; } .me { padding: 0; justify-content: center; }
  .main { padding: 0 24px 70px; }
  .cols-3 { grid-template-columns: 1fr 1fr; }
  .earn-split { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) { .cols-2 { grid-template-columns: minmax(0, 1fr); } }

@media (max-width: 900px) {
  .kpis { grid-template-columns: 1fr 1fr; }
  .kpis .kpi.hero { grid-column: 1 / -1; }
  .kpis:has(> .hero:first-child) > .tile:last-child:nth-child(even),
  .kpis:not(:has(> .hero:first-child)) > .tile:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
@media (max-width: 680px) {
  body { font-size: 15px; }
  .app { display: block; }
  .sidebar { display: none; }
  .main { padding: 0 14px calc(var(--tab-h) + 40px + env(safe-area-inset-bottom)); }
  .only-mobile { display: inline-grid !important; }
  .topbar { padding: max(16px, env(safe-area-inset-top)) 0 10px; min-height: 0; }
  .topbar { padding-left: 54px; padding-right: 54px; min-height: calc(44px + max(16px, env(safe-area-inset-top)) + 10px); }
  .hello { gap: 6px; }
  .hello h1 { font-size: 25px; }
  .hello-emoji { font-size: 40px; }
  .top-actions { left: 0; right: auto; top: max(16px, env(safe-area-inset-top)); transform: none; }
  .me-btn { position: absolute; right: 0; top: max(16px, env(safe-area-inset-top)); }
  .top-actions .lbl { display: none; }
  .top-actions .btn { padding: 10px; border-radius: 14px; }
  .top-actions .add-btn { display: none; }
  .me-btn { appearance: none; border: 0; padding: 0; background: none; cursor: pointer; }
  .me-btn .avatar { width: 38px; height: 38px; font-size: 15px; }
  .toolbar { padding: 6px 0 16px; gap: 8px; }
  .range { gap: 8px; }
  .seg { padding: 5px; }
  .seg button { padding: 9px 12px; font-size: 13.5px; }
  .date-pair { width: 100%; justify-content: center; }
  .date-pair input { flex: 1; min-width: 0; }
  .card { padding: 18px; border-radius: 24px; }
  .card-head { margin-bottom: 16px; gap: 10px; }
  .card-head h2 { font-size: 19px; }
  .card-head .tools .lbl { display: none; }
  .card-head .tools:has(> :nth-child(2)) { grid-column: 1 / -1; justify-content: space-between; }
  .card-head .tools .btn { padding: 8px; }
  .grid { gap: 14px; } .section { margin-top: 14px; }
  .kpis { gap: 10px; }
  .kpi { padding: 14px; border-radius: 18px; }
  .kpi .value { font-size: 22px; margin-top: 10px; }
  .kpi.hero .value { font-size: 36px; }
  .kpi .label { font-size: 12px; gap: 8px; } .kpi .badge { width: 26px; height: 26px; border-radius: 9px; }
  .kpi .foot { font-size: 11.5px; }
  .cols-3, .steps { grid-template-columns: 1fr 1fr; }
  .steps.three { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .steps.three .step { padding: 12px 10px; } .steps.three .step b { font-size: 17px; } .steps.three .step small { font-size: 11.5px; }
  .step b { font-size: 19px; }
  /* partner cards become a swipeable carousel */
  .people { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 12px; margin: 0 -18px; padding: 4px 18px 10px; scrollbar-width: none; }
  .people::-webkit-scrollbar { display: none; }
  .people > .person { flex: 0 0 84%; scroll-snap-align: center; }
  .chart-box { height: 250px; } .chart-box.sm { height: 210px; }
  .form-grid { grid-template-columns: 1fr; gap: 14px; }
  .filters .field-icon { min-width: 0; max-width: none; }
  input, select, textarea { font-size: 16px; }
  /* tables → stacked cards */
  table.rt thead { display: none; }
  table.rt, table.rt tbody, table.rt tfoot { display: block; }
  table.rt tr { display: flex; flex-direction: column; padding: 14px 16px; margin-bottom: 10px; border-radius: 18px; background: linear-gradient(180deg, var(--tile-top), var(--tile-bot)); border: 1px solid var(--edge); box-shadow: var(--depth-tile); }
  table.rt td { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 6px 0; border: 0; text-align: right; background: none !important; }
  table.rt td::before { content: attr(data-label); color: var(--muted); font-size: 13px; font-weight: 550; text-align: left; flex: none; }
  table.rt td[data-label=""]::before { display: none; }
  table.rt td.lead { order: -1; display: block; text-align: left; font-size: 15px; padding-bottom: 8px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
  table.rt td.lead::before { display: none; }
  table.rt tr { position: relative; }
  table.rt td.acts { position: absolute; top: 9px; right: 10px; padding: 0; }
  table.rt tr:has(td.acts:not(:empty)) td.lead { padding-right: 80px; }
  table.rt td.nil { display: none; }
  table.rt td.acts::before { display: none; }
  table.rt td:empty { display: none; }
  table.rt tfoot tr { background: var(--accent-soft); box-shadow: none; border-color: transparent; }
  .table-wrap { margin: 0; padding: 0; overflow: visible; }
  .comment { max-width: none; }
  /* bottom tab bar */
  .tabbar { display: grid; grid-template-columns: repeat(6, 1fr); position: fixed; z-index: 60; left: 12px; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom)); height: var(--tab-h); padding: 8px; border-radius: 26px; }
  .tabbar a { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--muted); font-size: 11px; font-weight: 650; border-radius: 18px; transition: color .3s, transform .4s var(--spring); }
  .tabbar a svg { width: 23px; height: 23px; transition: transform .5s var(--spring); }
  .tabbar a.active { color: var(--accent); }
  .tabbar a.active svg { transform: translateY(-2px) scale(1.08); }
  .tabbar a:active { transform: scale(.9); }
  .tab-pill { position: absolute; top: 8px; bottom: 8px; left: 8px; border-radius: 18px; background: var(--accent-soft); box-shadow: inset 0 1px 0 var(--rim); transition: transform .55s var(--spring), width .4s; z-index: 0; }
  .fab { display: grid; place-items: center; position: fixed; z-index: 61; right: 18px; bottom: calc(var(--tab-h) + 22px + env(safe-area-inset-bottom)); width: 58px; height: 58px; border-radius: 20px; border: 0; color: #fff; cursor: pointer;
    background: linear-gradient(180deg, #3d96ff, #0a64f0); box-shadow: inset 0 1px 0 rgba(255,255,255,.45), inset 0 -3px 6px rgba(0,30,90,.25), 0 14px 28px -8px rgba(10,100,240,.7); animation: pop .7s var(--spring) .2s both; transition: transform .45s var(--spring); }
  .fab svg { width: 26px; height: 26px; stroke-width: 2.4; }
  .fab:active { transform: scale(.88) rotate(90deg); }
  /* sheets */
  .modal { place-items: end center; padding: 0; }
  .modal-card, .modal-card.wide { width: 100%; max-height: 92vh; max-height: 92dvh; border-radius: 30px 30px 0 0; padding: 10px 18px calc(22px + env(safe-area-inset-bottom)); animation: sheetUp .55s var(--spring); }
  .modal.closing .modal-card { animation: sheetDown .3s var(--smooth) forwards; }
  .grabber { display: block; width: 42px; height: 5px; border-radius: 5px; background: var(--edge-2); margin: 2px auto 14px; cursor: grab; touch-action: none; }
  .modal-card .actions { position: sticky; bottom: calc(-22px - env(safe-area-inset-bottom)); margin: 18px -18px 0; padding: 12px 18px calc(12px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--surface-bot) 16px); }
  .modal-card .actions .btn { flex: 1; padding: 13px; }
  .toasts { top: max(10px, env(safe-area-inset-top)); }
  .auth-card { padding: 30px 20px 22px; }
}
@keyframes sheetUp { from { transform: translateY(100%); } }
@keyframes sheetDown { to { transform: translateY(100%); } }
@media (hover: none) { .card::after, .tile::after { display: none; } }

/* ---------- Round 5 ---------- */
/* Wordmark: one title, NewMor with a glossy OS badge */
.wordmark { display: inline-flex; align-items: center; gap: 7px; font-weight: 800; font-size: 21px; letter-spacing: -.045em; line-height: 1; white-space: nowrap;
  background: linear-gradient(100deg, var(--text) 0%, var(--text) 42%, var(--accent) 50%, var(--text) 58%, var(--text) 100%); background-size: 260% 100%; background-position: 100% 0;
  -webkit-background-clip: text; background-clip: text; color: transparent; animation: wmShine 7s ease-in-out infinite; }
.wordmark .os { color: #fff; -webkit-text-fill-color: #fff; font-size: 11px; font-weight: 800; letter-spacing: .08em; padding: 4px 7px 4px 8px; border-radius: 8px;
  background: linear-gradient(180deg, #4aa3ff, #0a64f0); box-shadow: inset 0 1px 0 rgba(255,255,255,.45), 0 5px 12px -4px rgba(10,100,240,.7); transform: translateY(-1px) rotate(-4deg); animation: osTilt 7s var(--spring) infinite; }
.auth-card h1.wordmark { font-size: 36px; margin: 0 0 6px; gap: 10px; }
.auth-card h1.wordmark .os { font-size: 15px; padding: 6px 10px; border-radius: 11px; }
@keyframes wmShine { 0%, 55% { background-position: 100% 0; } 85%, 100% { background-position: 0 0; } }
@keyframes osTilt { 0%, 60%, 100% { transform: translateY(-1px) rotate(-4deg); } 70% { transform: translateY(-3px) rotate(4deg) scale(1.08); } 80% { transform: translateY(-1px) rotate(-4deg); } }

/* Greeting: one looping scene after the name */
.hello { width: 100%; }
.hello h1 { white-space: nowrap; flex: none; }
.hello h1 .nowrap { white-space: nowrap; }
.hello h1 .sky { display: inline-block; vertical-align: -.3em; margin: 0 0 0 .14em; }
.sky { width: 1.35em; height: 1.35em; flex: none; overflow: visible; filter: drop-shadow(0 6px 10px rgba(255,140,0,.22)); margin-bottom: -.06em; }
.sky { stroke: none; }
.sky .halo, .sky .cloud, .sky .sun, .sky .sea line, .sky .moon, .sky .star { transform-box: fill-box; transform-origin: center; }
.sky .halo { opacity: .16; animation: halo 3.2s ease-in-out infinite; }
.sky .rays { transform-box: view-box; animation: raySpin 14s linear infinite; }
.sky.sunrise .rays { transform-origin: 38px 36px; } .sky.day .rays { transform-origin: 46px 30px; }
.sky.sunrise { animation: rise 3.6s ease-in-out infinite; }
.sky .cloud { animation: drift 4.5s ease-in-out infinite alternate; }
.sky.sunset .sun { animation: sink 3.4s ease-in-out infinite alternate; }
.sky.sunset .sea line { animation: ripple2 2.4s ease-in-out infinite alternate; }
.sky.sunset .sea .w2 { animation-delay: -.8s; } .sky.sunset .sea .w3 { animation-delay: -1.6s; }
.sky.night { filter: drop-shadow(0 6px 12px rgba(255,200,60,.28)); }
.sky.night .moon { animation: rockMoon 4.6s ease-in-out infinite; }
.sky.night .star { animation: twinkle 1.8s ease-in-out infinite alternate; }
@keyframes halo { 50% { transform: scale(1.22); opacity: .07; } }
@keyframes raySpin { to { transform: rotate(360deg); } }
@keyframes rise { 50% { transform: translateY(-3px); } }
@keyframes drift { from { transform: translateX(-5px); } to { transform: translateX(5px); } }
@keyframes sink { from { transform: translateY(-2px); } to { transform: translateY(5px); } }
@keyframes ripple2 { from { transform: scaleX(.7); opacity: .55; } to { transform: scaleX(1.06); opacity: 1; } }
@keyframes rockMoon { 0%, 100% { transform: rotate(-9deg); } 50% { transform: rotate(7deg) translateY(-2px); } }
@keyframes twinkle { from { transform: scale(.35); opacity: .3; } to { transform: scale(1.1); opacity: 1; } }

/* Busy screenshot button */
.shot-btn.busy, .btn.busy { pointer-events: none; opacity: .75; }
.shot-btn.busy svg, .btn.busy svg { animation: sunSpin .9s linear infinite; }

/* Values that just changed */
.bump { animation: bump .9s var(--smooth); }
@keyframes bump { 0% { color: var(--accent); } 100% { } }
.gone { animation: goneOut .3s var(--smooth) forwards !important; pointer-events: none; }
@keyframes goneOut { to { opacity: 0; transform: scale(.97); } }

/* Person tile: ring + paid / share */
.person { padding: 18px; display: flex; flex-direction: column;
  background: radial-gradient(130% 90% at 0% 0%, var(--wash, transparent), transparent 62%), linear-gradient(180deg, var(--tile-top), var(--tile-bot)); }
.person .top { margin-bottom: 14px; }
.ring { position: relative; width: 52px; height: 52px; flex: none; margin: -4px -2px -4px 0; }
.ring svg { width: 100%; height: 100%; display: block; }
.ring circle { fill: none; stroke-width: 5.5; stroke-linecap: round; }
.ring .trk { stroke: var(--sunken); }
.ring .val { stroke: var(--c); stroke-dasharray: 100 100; stroke-dashoffset: calc(100 - var(--p, 0)); transition: stroke-dashoffset 1.3s var(--smooth); }
.ring span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 12px; font-weight: 750; font-variant-numeric: tabular-nums; color: var(--text); }
.ring span svg { width: 20px; height: 20px; color: var(--good); stroke-width: 3; }
.frac { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 8px; min-width: 0; }
.frac b { font-size: 26px; font-weight: 780; letter-spacing: -.035em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.frac .den { font-size: 16px; font-weight: 650; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.frac i, .frac-cap i { font-style: normal; font-weight: 300; color: var(--faint); margin-right: 6px; }
.frac .den i { font-size: 20px; }
.frac-cap { font-size: 10.5px; font-weight: 700; color: var(--faint); text-transform: uppercase; letter-spacing: .07em; margin-top: 4px; }
.frac-cap i { margin: 0 3px; }
.ps-foot { margin-top: auto; padding-top: 14px; }
.kpis-people { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }

/* Who owes whom: cards side by side, coins flowing payer → receiver */
.transfers { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr)); }
.transfer { display: flex; flex-direction: column; gap: 14px; padding: 16px 16px 14px; min-width: 0; }
.tf { display: grid; grid-template-columns: 66px minmax(90px, 1fr) 66px; align-items: start; gap: 4px; }
.tf-who { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; text-align: center; }
.tf-who b { font-size: 13.5px; font-weight: 650; margin-top: 6px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tf-who small { font-size: 10.5px; color: var(--faint); font-weight: 700; text-transform: uppercase; letter-spacing: .07em; }
.tf-who.to .avatar { animation: catch2 .8s ease-out infinite; }
.tf-flow { position: relative; align-self: stretch; min-height: 76px; }
.tf-amt { position: absolute; left: 0; right: 0; top: 36px; text-align: center; font-size: 19px; font-weight: 780; letter-spacing: -.03em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.transfer > .btn { width: 100%; justify-content: center; }

@media (max-width: 680px) {
  .wordmark { font-size: 19px; }
  .kpis > .person { grid-column: 1 / -1; }
  .kpis-people { grid-template-columns: 1fr; }
  .people > .person { flex: 0 0 82%; }
  .frac b { font-size: 23px; }
}

/* Personal finance */
.pf-people { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); }
.pf-person { padding: 16px 18px; cursor: pointer; user-select: none; -webkit-user-select: none;
  background: radial-gradient(130% 90% at 0% 0%, var(--wash, transparent), transparent 62%), linear-gradient(180deg, var(--tile-top), var(--tile-bot)); }
.pf-person .top { display: flex; align-items: center; gap: 12px; }
.pf-person .top b { display: block; font-size: 16px; letter-spacing: -.02em; }
.pf-person .top small { color: var(--faint); font-size: 12.5px; }
.pf-person.picked { border-color: var(--c); box-shadow: 0 0 0 3px var(--wash), var(--depth-tile); }
.pf-bal { margin-top: 14px; }
.pf-bal small { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--faint); }
.pf-bal b { font-size: 26px; font-weight: 780; letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.pf-bal.good b { color: var(--good); } .pf-bal.bad b { color: var(--bad); }
.pf-io { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.pf-io span { display: inline-flex; align-items: center; gap: 5px; } .pf-io svg { width: 14px; height: 14px; color: var(--faint); }
.pf-io b { color: var(--text); font-weight: 650; font-variant-numeric: tabular-nums; }
.pf-route { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pf-dir { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: end; }
.pf-swap { margin-bottom: 4px; width: 42px; height: 42px; border-radius: 999px; background: var(--sunken); }
td .good, b.good { color: var(--good); } b.bad { color: var(--bad); }
@media (max-width: 680px) { .tabbar a { font-size: 10px; } .tabbar a svg { width: 21px; height: 21px; } .pf-people { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -18px; padding: 4px 18px 10px; scrollbar-width: none; } .pf-people > .tile { flex: 0 0 78%; scroll-snap-align: center; } }
#pfForm [data-new=to] { grid-column: 2; }
@media (max-width: 680px) { #pfForm [data-new=to] { grid-column: auto; } .pf-dir { grid-template-columns: 1fr; } .pf-swap { justify-self: center; transform: rotate(90deg); margin: 0; } }

/* Flying money: a stream of 💸 travelling from payer to receiver, evenly spaced, on a loop */
.tf-fly { position: absolute; left: 0; right: 0; top: 4px; height: 34px; pointer-events: none; }
.tf-fly { contain: layout paint; }
/* Moves only with transform and opacity, so scrolling past it stays smooth */
.tf-fly span { position: absolute; left: 0; top: 4px; width: 100%; height: 26px; will-change: transform; transform: translate3d(-2%, 0, 0);
  animation: flyX 3.2s linear infinite; animation-delay: calc(var(--i) * -.8s); }
.tf-fly span i { display: inline-block; font-style: normal; font-size: 21px; line-height: 1; opacity: 0; will-change: transform, opacity;
  animation: flyBob 3.2s linear infinite; animation-delay: calc(var(--i) * -.8s); }
@keyframes flyX { from { transform: translate3d(-2%, 0, 0); } to { transform: translate3d(calc(100% - 22px), 0, 0); } }
@keyframes flyBob {
  0% { opacity: 0; transform: translateY(6px) scale(.55) rotate(-10deg); }
  12% { opacity: 1; transform: translateY(-2px) scale(1) rotate(4deg); }
  30% { transform: translateY(-7px) rotate(-4deg); }
  50% { transform: translateY(-1px) rotate(6deg); }
  70% { transform: translateY(-7px) rotate(-4deg); }
  88% { opacity: 1; transform: translateY(-2px) scale(.95) rotate(3deg); }
  100% { opacity: 0; transform: translateY(4px) scale(.5) rotate(10deg); }
}
@keyframes catch2 { 0% { transform: scale(1.08); box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 0 0 0 var(--b2); } 100% { transform: scale(1); box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 0 0 9px transparent; } }
.capturing .tf-fly span { animation: none; transform: translate3d(calc(var(--i) * 22% + 4%), 0, 0); }
.capturing .tf-fly span i { animation: none; opacity: 1; transform: none; }

/* Add tiles: dashed square with a + */
.add-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: 150px; padding: 18px; border-radius: var(--radius-tile, 22px);
  border: 2px dashed var(--faint); background: transparent; color: var(--muted); font: 650 14px var(--font); cursor: pointer;
  transition: border-color .3s, color .3s, background .3s, transform .4s var(--spring); }
.add-tile .plus { width: 46px; height: 46px; border-radius: 16px; display: grid; place-items: center; color: #fff; background: linear-gradient(180deg, #4aa3ff, #0a64f0);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 8px 18px -6px rgba(10,100,240,.6); transition: transform .5s var(--spring); }
.add-tile .plus svg { width: 22px; height: 22px; stroke-width: 2.6; }
.add-tile:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.add-tile:hover .plus { transform: rotate(90deg) scale(1.06); }
.add-tile:active { transform: scale(.97); }
.capturing .add-tile { display: none; }

/* Person page */
.pf-hero { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.pf-hero .avatar.xl { width: 58px; height: 58px; font-size: 24px; }
.pf-hero h2 { margin: 0; font-size: 26px; letter-spacing: -.035em; }
.pf-hero .grow { min-width: 0; }
.pf-entries { display: grid; gap: 16px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card.pf-head { background: radial-gradient(90% 120% at 0% 0%, var(--wash, transparent), transparent 55%), linear-gradient(180deg, var(--card-top), var(--card-bot)); }
.pf-head .pf-hero .sub { font-weight: 600; }
.kpis-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 680px) { .kpis-3 { grid-template-columns: 1fr 1fr; } }
.pf-entry { padding: 16px 16px 12px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.pf-entry .pf-io { margin-top: 0; justify-content: space-between; align-items: center; flex-wrap: nowrap; }
.pf-entry .pf-io .why { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); font-weight: 600; }
.pf-entry .row-actions { display: inline-flex; gap: 2px; flex: none; }
.pf-entry .row-actions .icon-btn { width: 32px; height: 32px; }
.pf-entry .when { color: var(--faint); font-size: 12px; white-space: nowrap; }
.pf-entry .pf-note { font-size: 12.5px; color: var(--muted); margin-top: -4px; }
.tf-amt.in { color: var(--good); } .tf-amt.out { color: var(--bad); }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--accent); font-weight: 650; font-size: 14px; margin-bottom: 14px; }
.back-link svg { width: 16px; height: 16px; }
@media (max-width: 1240px) { .pf-entries { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 680px) { .pf-entries { grid-template-columns: 1fr; } }
@media (max-width: 680px) { .pf-people > .add-tile { flex: 0 0 60%; min-height: 0; } .add-tile { min-height: 120px; } .pf-hero .avatar.xl { width: 48px; height: 48px; } .pf-hero h2 { font-size: 22px; } }
.btn.danger-text { color: var(--bad); }

/* Saved payout: a calm summary with an Edit button instead of a form full of old values */
.po-sum { display: flex; flex-direction: column; gap: 2px; }
.po-row { display: grid; grid-template-columns: 18px auto 1fr; align-items: baseline; column-gap: 10px; row-gap: 2px; padding: 11px 2px; border-bottom: 1px solid var(--line); }
.po-row svg { width: 16px; height: 16px; color: var(--faint); align-self: center; }
.po-row .po-l { color: var(--muted); font-size: 13.5px; }
.po-row b { justify-self: end; font-size: 16px; font-variant-numeric: tabular-nums; }
.po-row .faint { grid-column: 2 / -1; font-size: 12.5px; text-align: right; }
.po-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; }
.step .faint { font-size: 12px; margin-top: 4px; line-height: 1.35; }

/* Month calendar popup */
.stepper .mp-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 150px; height: 40px; padding: 0 12px; border: 0; background: transparent; border-radius: 999px; font: 650 15px var(--font); color: var(--text); cursor: pointer; transition: background .2s; }
.stepper .mp-btn:hover, .stepper .mp-btn.open { background: var(--accent-soft); }
.stepper .mp-btn svg { width: 16px; height: 16px; color: var(--accent); }
.stepper .mp-btn svg:last-child { width: 14px; height: 14px; color: var(--faint); transition: transform .25s var(--spring); }
.stepper .mp-btn.open svg:last-child { transform: rotate(180deg); }
.stepper .icon-btn:disabled { opacity: .3; cursor: default; }
.mcal { min-width: 280px; }
.mcal-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.mcal-grid.from-right { animation: calR .38s var(--smooth); } .mcal-grid.from-left { animation: calL .38s var(--smooth); }
.mcal-grid button { position: relative; height: 48px; border: 0; background: transparent; border-radius: 14px; font: 650 15px var(--font); color: var(--text); cursor: pointer; transition: background .2s, transform .25s var(--spring); }
.mcal-grid button:hover:not(:disabled) { background: var(--accent-soft); color: var(--accent); }
.mcal-grid button:active:not(:disabled) { transform: scale(.9); }
.mcal-grid button.today { box-shadow: inset 0 0 0 1.5px var(--accent); color: var(--accent); }
.mcal-grid button.sel { background: linear-gradient(180deg, #3b95ff, #0a64f0); color: #fff; box-shadow: 0 6px 12px -4px rgba(10,100,240,.55); }
.mcal-grid button:disabled { color: var(--faint); opacity: .35; cursor: default; }
.mcal .dot { position: absolute; left: 50%; bottom: 7px; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: var(--good); }
.mcal-grid button.sel .dot { background: #fff; }
.mcal .dot.inline { position: static; display: inline-block; margin: 0 4px 1px 0; vertical-align: middle; }

/* Dashboard overview (round 8) */
.kpis.ov { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1180px) { .kpis.ov { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kpi .foot .tag { margin-right: 4px; vertical-align: 1px; }
.ov-list { display: flex; flex-direction: column; gap: 7px; margin-top: 12px; }
.ov-row { display: flex; align-items: center; gap: 9px; font-size: 13.5px; min-width: 0; }
.ov-row .grow { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-weight: 550; }
.ov-row b { font-weight: 700; font-variant-numeric: tabular-nums; }
.ov-row .pct { min-width: 44px; text-align: right; font-size: 12px; font-weight: 650; color: var(--bad); background: var(--bad-soft); border-radius: 99px; padding: 2px 7px; font-variant-numeric: tabular-nums; }
.ov-row .dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.ov-row .avatar { width: 22px; height: 22px; font-size: 11px; }
.ov-acc { display: flex; align-items: center; gap: 14px; margin-top: 10px; }
.ov-acc .ov-list { margin-top: 0; }
.mini-donut { width: 86px; height: 86px; flex: none; position: relative; }
.month-bar { display: flex; align-items: center; justify-content: center; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; text-align: center; }
.month-bar .mb-text { display: flex; flex-direction: column; gap: 2px; }
.month-bar .mb-text b { font-size: 17px; letter-spacing: -.02em; }
.month-bar .mb-text span { font-size: 12.5px; color: var(--muted); }
.step small .avatar { width: 18px; height: 18px; font-size: 10px; }
.person .stat b i { font-style: normal; font-weight: 550; }
@media (max-width: 680px) { .kpis.ov > .tile:first-child, .kpis.ov > .tile:nth-child(n+4) { grid-column: 1 / -1; } .month-bar { margin-bottom: 16px; } }

/* Bulk select on the person page */
.pf-entry { position: relative; }
.pf-entries.selecting .pf-entry { cursor: pointer; }
.pf-entries.selecting .pf-entry .row-actions { visibility: hidden; }
.pf-entry .pick { position: absolute; top: 12px; left: 12px; z-index: 2; width: 26px; height: 26px; border-radius: 9px; border: 2px solid var(--faint); background: var(--card-top); display: grid; place-items: center; color: #fff; cursor: pointer; padding: 0; transition: background .2s, border-color .2s, transform .25s var(--spring); }
.pf-entry .pick svg { width: 15px; height: 15px; }
.pf-entry .pick.on { background: linear-gradient(180deg, #3b95ff, #0a64f0); border-color: transparent; transform: scale(1.06); }
.pf-entry.picked { box-shadow: 0 0 0 2px var(--accent), var(--depth-tile); }
.btn.danger { color: var(--bad); }
.btn.danger:disabled { opacity: .4; cursor: default; }

/* Earnings & Payouts: the list is as tall as the entry form, and scrolls inside */
.earn-split { align-items: stretch; }
.earn-right { position: relative; min-width: 0; }
.earn-right > .card { position: absolute; inset: 0; display: flex; flex-direction: column; min-height: 0; }
.earn-right .chart-box.xs { height: 150px; flex: none; }
.earn-right .scroll-fill { flex: 1 1 0; min-height: 0; overflow: auto; margin-top: 12px; border-radius: 14px; }
.earn-right .scroll-fill .table-wrap { overflow: visible; margin: 0; padding: 0; }
.earn-right .scroll-fill thead th { position: sticky; top: 0; z-index: 2; background: var(--card-top); }
.earn-right .scroll-fill tfoot td { position: sticky; bottom: 0; background: var(--card-bot); }
@media (max-width: 900px) {
  .earn-right > .card { position: static; }
  .earn-right .scroll-fill { max-height: none; overflow: visible; }
}

/* ---------- Simplify round ---------- */
.icon-btn.red { color: var(--bad); }
.exp-table tr.xrow { cursor: pointer; }
.exp-table tr.child td { padding-top: 6px; padding-bottom: 6px; font-size: 13px; color: var(--muted); border-top: 0; }
.exp-table tr.child td:first-child { padding-left: 34px; position: relative; }
.exp-table tr.child td:first-child::before { content: ""; position: absolute; left: 16px; top: 0; bottom: 50%; width: 10px; border-left: 2px solid rgba(127,127,127,.35); border-bottom: 2px solid rgba(127,127,127,.35); border-bottom-left-radius: 6px; }
.split-tag { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
.split-tag svg { width: 15px; height: 15px; }
.radio-row { display: flex; flex-wrap: wrap; gap: 8px; }
.radio-pill { position: relative; cursor: pointer; }
.radio-pill input { position: absolute; opacity: 0; pointer-events: none; }
.radio-pill span { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 99px; background: var(--surface-2, rgba(127,127,127,.1)); font-weight: 600; font-size: 14px; border: 1.5px solid transparent; transition: background .2s, border-color .2s, transform .2s; }
.radio-pill span svg { width: 16px; height: 16px; }
.radio-pill input:checked + span { border-color: var(--accent); background: var(--accent-soft, rgba(10,100,240,.12)); color: var(--accent); }
.radio-pill:active span { transform: scale(.96); }
.split-box:empty { display: none; }
.split-box .hint.bad { color: var(--bad); }
form.locked .radio-pill, form.locked .drop { pointer-events: none; opacity: .75; }
.kpi .dual { font-size: 15px; font-weight: 700; color: var(--muted); margin-top: 2px; }
.bds { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.bd { font-size: 12px; font-weight: 600; padding: 4px 9px; border-radius: 99px; background: rgba(127,127,127,.12); }
.bd.good { color: var(--good); } .bd.bad { color: var(--bad); }
.day-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
.dg-wd { text-align: center; font-size: 12px; font-weight: 700; color: var(--muted); }
.day-sq { aspect-ratio: 1; border-radius: 18px; border: 0; background: var(--sunken, rgba(127,127,127,.1)); position: relative; display: grid; place-items: center; padding: 10px; cursor: pointer; color: inherit; font: inherit; transition: transform .25s var(--spring, ease), box-shadow .25s, background .25s; user-select: none; overflow: hidden; }
.day-sq .ds-date { font-size: clamp(14px, 1.6vw, 22px); font-weight: 750; letter-spacing: -.02em; color: var(--muted); }
.day-sq .ds-add { position: absolute; right: 10px; bottom: 10px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; color: var(--c); opacity: 0; transition: opacity .2s; }
.day-sq .ds-add svg { width: 14px; height: 14px; }
.day-sq:not([disabled]):hover .ds-add { opacity: 1; }
.day-sq.has { background: linear-gradient(155deg, var(--c2), var(--c)); color: #fff; box-shadow: 0 10px 24px -6px var(--c2), inset 0 1px 0 rgba(255,255,255,.35); }
.day-sq.has small { position: absolute; left: 12px; top: 10px; font-size: 12px; font-weight: 700; color: rgba(255,255,255,.85); }
.day-sq.has b { font-size: clamp(15px, 1.9vw, 28px); font-weight: 800; letter-spacing: -.03em; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.day-sq .ds-ok { position: absolute; right: 10px; top: 10px; width: 18px; height: 18px; border-radius: 50%; background: rgba(255,255,255,.28); display: grid; place-items: center; }
.day-sq .ds-ok svg { width: 11px; height: 11px; }
.day-sq.today { box-shadow: inset 0 0 0 2px var(--accent); }
.day-sq.has.today { box-shadow: 0 10px 24px -6px var(--c2), inset 0 0 0 2px #fff; }
.day-sq:not([disabled]):hover { transform: translateY(-3px); }
.day-sq[disabled] { opacity: .35; cursor: default; }
@media (max-width: 680px) { .day-grid { gap: 5px; } .day-sq { border-radius: 11px; padding: 4px; } .day-sq .ds-date { font-size: 11px; text-align: center; } .day-sq.has small { font-size: 9px; left: 6px; top: 5px; } .day-sq.has b { font-size: 11px; margin-top: 8px; } .day-sq .ds-ok, .day-sq .ds-add { display: none; } }
.acc-seg { display: flex; justify-content: center; margin: 8px 0 26px; }
.payer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin: 8px 0 6px; }
.payer { position: relative; cursor: pointer; }
.payer input { position: absolute; opacity: 0; pointer-events: none; }
.payer .pc { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 10px 14px; border-radius: 20px; background: var(--sunken, rgba(127,127,127,.08)); border: 1.5px solid transparent; transition: transform .35s var(--spring, ease), background .25s, border-color .25s, box-shadow .25s; }
.payer .pc b { font-size: 14px; font-weight: 650; }
.payer .tick { position: absolute; top: 10px; right: 10px; width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid rgba(127,127,127,.35); display: grid; place-items: center; color: #fff; transition: background .25s, border-color .25s, transform .35s var(--spring, ease); }
.payer .tick svg { width: 12px; height: 12px; opacity: 0; transform: scale(.4); transition: opacity .2s, transform .35s var(--spring, ease); }
.payer:hover .pc { transform: translateY(-2px); }
.payer:active .pc { transform: scale(.97); }
.payer input:checked + .pc { background: var(--wash); border-color: var(--c); box-shadow: 0 8px 22px -8px var(--ring); }
.payer input:checked + .pc .tick { background: var(--c); border-color: var(--c); }
.payer input:checked + .pc .tick svg { opacity: 1; transform: none; }
form.locked .payer { pointer-events: none; }
form.locked .payer input:not(:checked) + .pc { opacity: .45; }
.btn[hidden] { display: none !important; }
.dp-btn:disabled, .dd-btn:disabled { opacity: .55; cursor: not-allowed; pointer-events: none; }
.qr-btn { margin-right: 6px; }
.super-row { display: flex !important; flex-direction: row !important; align-items: center !important; text-align: left; gap: 12px; padding: 10px 14px; margin-top: 6px; border-radius: 14px; color: var(--muted); font-weight: 550; cursor: pointer; }
.super-row > svg { width: 18px; height: 18px; flex: none; }
.super-row span { flex: 1; }
label.locked { opacity: .6; }
label.locked .hint { display: inline-flex; align-items: center; gap: 5px; }
label.locked .hint svg { width: 13px; height: 13px; }
.acc-name { cursor: text; border-radius: 6px; outline: none; }
.acc-name[contenteditable="true"] { box-shadow: 0 0 0 2px var(--accent); padding: 0 4px; }

/* Final round: inline Save/Cancel, centred empty states, plain breakdowns, working buttons */
.actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.actions[hidden] { display: none !important; }
.form-grid .actions { margin-top: 4px; }
@media (max-width: 680px) { .form-grid .actions .btn { flex: 1 1 0; } }
.card.fill { height: 100%; display: flex; flex-direction: column; }
.card.fill > .card-empty, .card.fill > .ov-acc, .card.fill > .inv-list { flex: 1; }
.card-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; min-height: 150px; padding: 18px; border-radius: 18px; background: var(--sunken, rgba(127,127,127,.06)); color: var(--muted); font-size: 13.5px; }
.card-empty b { color: var(--text); font-size: 16px; font-weight: 680; letter-spacing: -.015em; }
.card-empty .btn { margin-top: 10px; }
.kpi.is-empty { display: flex; flex-direction: column; }
.kpi-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center; min-height: 92px; padding-top: 10px; color: var(--muted); font-size: 12.5px; line-height: 1.4; }
.kpi-empty b { color: var(--faint); font-size: 19px; font-weight: 680; letter-spacing: -.01em; }
.ov-row .inr { min-width: 74px; text-align: right; font-size: 12.5px; color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.inv-list { align-self: stretch; justify-content: center; }
.ov-row.tot { border-top: 1px solid var(--line); padding-top: 9px; margin-top: 2px; }
.ov-row.tot .grow { color: var(--text); font-weight: 650; }
.ov-row .pct-gap { min-width: 44px; }
.bd-list { display: flex; flex-direction: column; gap: 2px; margin: 14px 0 12px; padding: 10px 14px; border-radius: 16px; background: var(--sunken, rgba(127,127,127,.06)); text-align: left; }
.bd-row { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; padding: 5px 0; font-size: 13.5px; }
.bd-row span { color: var(--muted); font-weight: 550; min-width: 0; }
.bd-row b { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bd-row.total { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 9px; }
.bd-row.total span { color: var(--text); font-weight: 650; }
.btn.loading { pointer-events: none; color: transparent !important; }
.btn.loading svg { opacity: 0; }
.btn.loading::after { content: ''; position: absolute; left: 50%; top: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; border: 2px solid var(--muted); border-right-color: transparent; animation: sunSpin .7s linear infinite; }
.btn.primary.loading::after { border-color: #fff; border-right-color: transparent; }
.icon-btn.loading { pointer-events: none; opacity: .5; }
.lock-hint:empty { display: none; }

/* Payouts and close: where the money landed, then one card per pair with its credit / debit lines */
.landed-row { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.landed { display: flex; align-items: center; gap: 10px; padding: 9px 14px 9px 10px; border-radius: 999px; background: var(--sunken); font-size: 13.5px; color: var(--muted); min-width: 0; }
.landed b { color: var(--text); font-weight: 680; }
.landed small { color: var(--faint); margin-left: 4px; }
.landed .avatar { width: 26px; height: 26px; font-size: 12px; flex: none; }
.even-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.even-row { display: flex; align-items: center; gap: 9px; padding: 11px 14px; border-radius: 14px; background: var(--good-soft); color: var(--good); font-size: 13.5px; font-weight: 600; }
.even-row svg { width: 17px; height: 17px; flex: none; }
/* Who owes whom: + what the payer owes, − what is owed back, = the payment that settles it */
.lg-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.transfer .lg-list { margin: 0; padding: 4px 14px 12px; border-radius: 16px; background: var(--sunken); gap: 0; }
.lg-list li { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; align-items: center; gap: 10px; font-size: 13.5px; }
.transfer .lg-list li { padding: 9px 0; }
.transfer .lg-list li + li:not(.tot) { border-top: 1px dashed var(--edge-2); }
.lg-list li i { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; color: #fff; }
.lg-list li i svg { width: 12px; height: 12px; stroke-width: 3.2; }
.lg-list li.cr i { background: var(--good); box-shadow: 0 3px 8px -3px var(--good); }
.lg-list li.dr i { background: var(--bad); box-shadow: 0 3px 8px -3px var(--bad); }
.lg-list li span { color: var(--text); font-weight: 550; line-height: 1.35; min-width: 0; overflow-wrap: anywhere; }
.lg-list li span small { display: block; margin-top: 1px; font-size: 11.5px; font-weight: 500; color: var(--muted); }
.lg-list li b { font-weight: 750; font-variant-numeric: tabular-nums; white-space: nowrap; }
.lg-list li.cr b { color: var(--good); } .lg-list li.dr b { color: var(--bad); }
.transfer .lg-list li.tot { margin: 6px -6px 0; padding: 11px 12px 11px 6px; border-radius: 13px; background: var(--tile-top); box-shadow: inset 0 1px 0 var(--rim), 0 0 0 1px var(--edge), 0 8px 18px -12px rgba(17,24,39,.35); }
.lg-list li.tot i { background: var(--text); color: var(--tile-top); }
.lg-list li.tot span { color: var(--muted); font-weight: 600; }
.lg-list li.tot span em { font-style: normal; color: var(--text); font-weight: 700; }
.lg-list li.tot b { font-size: 17px; font-weight: 800; letter-spacing: -.02em; color: var(--text); }
.card-head .tools .btn.sm svg { width: 14px; height: 14px; }
.transfer > .btn { margin-top: auto; }
.acc-tools { display: inline-flex; align-items: center; gap: 4px; }
.card-head .tools .acc-tools .btn.sm { padding: 6px 12px; }
.kpis-people .kpi.hero .value { font-size: clamp(24px, 2.4vw, 34px); }

/* Ledger: credit / debit entries */
.led-status { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.led-status .tag svg { width: 12px; height: 12px; margin-right: 4px; vertical-align: -1px; }
.led-tick { width: 30px; height: 30px; border-radius: 50%; flex: none; display: grid; place-items: center; padding: 0; cursor: pointer; border: 2px solid var(--good); background: transparent; color: var(--good); transition: background .2s, color .2s, transform .35s var(--spring); }
.led-tick svg { width: 15px; height: 15px; stroke-width: 3; }
.led-tick:hover { background: var(--good-soft); transform: scale(1.08); }
.led-tick.on { background: var(--good); color: #fff; }
.led-tick.loading { opacity: .5; pointer-events: none; }
tr.led-done td:not(:last-child):not(:nth-last-child(2)) { opacity: .55; }
.sub-head .sub-add { margin-left: auto; }
@media (max-width: 680px) { .sub-head .sub-add { margin-left: 0; } }
/* The soft background blobs get their own layer so scrolling doesn't repaint them */
.ambient { contain: strict; }
.ambient i { will-change: transform; transform: translateZ(0); }
.led-kind { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 700; padding: 3px 9px; border-radius: 99px; margin-right: 6px; vertical-align: middle; }
.led-kind svg { width: 13px; height: 13px; }
.led-kind.gave { color: var(--good); background: var(--good-soft); }
.led-kind.took { color: var(--bad); background: var(--bad-soft); }
.led-type { justify-content: center; }
.led-type .radio-pill span { padding: 11px 22px; font-size: 15px; }
td.lead:has(.led-kind) { white-space: nowrap; }
#ledTop:not(:empty) + #ledList { margin-top: 20px; }

/* A transfer that has been cleared in Payouts and close: dimmed, money stops, a PAID stamp on top */
.transfer.is-paid { position: relative; }
.transfer.is-paid .tf { opacity: .45; }
.transfer.is-paid .tf-fly { display: none; }
.paid-stamp { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) rotate(-11deg); z-index: 2; pointer-events: none;
  display: flex; flex-direction: column; align-items: center; padding: 6px 22px 7px; border: 4px solid var(--good); border-radius: 14px;
  color: var(--good); background: var(--card-top); box-shadow: 0 0 0 3px var(--card-top), 0 10px 26px -10px rgba(18,161,80,.55); animation: stampIn .5s var(--spring) both; }
.paid-stamp b { font-size: 30px; font-weight: 850; letter-spacing: .18em; text-transform: uppercase; line-height: 1.05; padding-left: .18em; }
.paid-stamp small { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; opacity: .85; }
@keyframes stampIn { from { opacity: 0; transform: translate(-50%, -50%) rotate(-11deg) scale(1.8); } to { opacity: 1; transform: translate(-50%, -50%) rotate(-11deg) scale(1); } }
.capturing .paid-stamp { animation: none; }

/* Sign out veil */
.out-veil { position: fixed; inset: 0; z-index: 9999; display: grid; place-items: center; background: var(--bg); opacity: 0; transition: opacity .35s ease; pointer-events: all; }
.out-veil.on { opacity: 1; }
.out-veil > div { display: flex; align-items: center; gap: 12px; font-weight: 650; font-size: 16px; color: var(--muted); }
.out-spin { width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid var(--accent-soft); border-top-color: var(--accent); animation: outSpin .7s linear infinite; }
@keyframes outSpin { to { transform: rotate(360deg); } }

/* ---------- Phones & tablets pass: nothing here changes the desktop layout ---------- */
/* Money ripple on the receiver: transform/opacity only, so it never repaints */
.tf-who.to .avatar { animation: catch3 .8s ease-out infinite; }
.tf-who.to .avatar::after { content: ""; position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 0 3px var(--b2); opacity: 0; pointer-events: none; animation: ring3 .8s ease-out infinite; }
@keyframes catch3 { 0% { transform: scale(1.08); } 100% { transform: scale(1); } }
@keyframes ring3 { 0% { opacity: .9; transform: scale(1); } 100% { opacity: 0; transform: scale(1.38); } }
.transfer.is-paid .tf-who.to .avatar, .transfer.is-paid .tf-who.to .avatar::after, .capturing .tf-who.to .avatar, .capturing .tf-who.to .avatar::after { animation: none; }
/* Numbers shrink to fit their tile (set from app.js) instead of being cut off */
.fitted { text-overflow: clip !important; }
.day-sq .sm { display: none; }

/* Touch screens: no hover tilt, so no 3D layers to keep in memory; soft background drawn without a live blur */
@media (hover: none) {
  .tile { will-change: auto; transform-style: flat; }
  .ambient i { filter: none; animation: none; opacity: .5; will-change: auto; transform: none; }
  .ambient i:nth-child(1) { background: radial-gradient(closest-side, var(--amb-1), transparent); width: calc(46vw + 220px); height: calc(46vw + 220px); top: calc(-16vw - 110px); left: calc(-8vw - 110px); }
  .ambient i:nth-child(2) { background: radial-gradient(closest-side, var(--amb-2), transparent); width: calc(40vw + 220px); height: calc(40vw + 220px); top: calc(30vh - 110px); right: calc(-14vw - 110px); }
  .ambient i:nth-child(3) { background: radial-gradient(closest-side, var(--amb-3), transparent); width: calc(36vw + 220px); height: calc(36vw + 220px); bottom: calc(-18vw - 110px); left: calc(30vw - 110px); }
}

/* Tablet rail: the Super admin row keeps only its switch */
@media (max-width: 1100px) and (min-width: 681px) {
  .super-row { justify-content: center; padding: 8px 0; gap: 0; }
  .super-row > svg, .super-row span { display: none; }
}

@media (max-width: 680px) {
  /* Card headers: icon lines up with the title when the subtitle wraps */
  .card-head { align-items: start; }
  .card-head .ic { margin-top: 1px; }
  .card-head .ttl .row.gap { row-gap: 4px; }
  .card-head .sub { line-height: 1.4; }
  .card-head .tools { align-self: start; }
  /* Who owes whom on phones */
  .tf { grid-template-columns: 62px minmax(0, 1fr) 62px; }
  .tf-amt { font-size: 18px; }
  .paid-stamp { padding: 4px 14px 5px; border-width: 3px; border-radius: 11px; box-shadow: 0 0 0 2px var(--card-top), 0 8px 20px -10px rgba(18,161,80,.55); }
  .paid-stamp b { font-size: 22px; letter-spacing: .16em; }
  .paid-stamp small { font-size: 8.5px; letter-spacing: .06em; }
  .landed-row { flex-direction: column; gap: 8px; }
  .landed { border-radius: 16px; align-items: center; padding: 9px 12px 9px 10px; line-height: 1.35; }
  .landed small { display: block; margin-left: 0; }
  /* Payments made and other person → person rows stay on one line */
  table.rt td.lead:has(> .pchip) { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-start; gap: 6px 8px; text-align: left; }
  /* Breakdown lists inside who-owes-whom cards get a little more room for their text */
  .transfer { padding: 14px 12px 12px; }
  .transfer .lg-list { padding: 3px 12px 11px; }
  .lg-list li.tot b { font-size: 16px; }
  .lg-list li { gap: 8px; font-size: 13px; }
  table.rt tr:has(td.acts:not(:empty)) td.lead { padding-right: 46px; }
  /* Daily earnings grid: day number and a short amount */
  .day-sq .lg { display: none; }
  .day-sq .sm { display: inline; }
  .day-sq.has { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; padding: 2px; }
  .day-sq.has small { position: static; font-size: 9.5px; line-height: 1; color: rgba(255,255,255,.8); }
  .day-sq.has b { font-size: 11px; margin-top: 0; line-height: 1.1; letter-spacing: -.02em; overflow: visible; text-overflow: clip; }
  .day-sq .ds-date { font-size: 12px; }
  /* Account switcher inside a card: two accounts fit side by side */
  .acc-seg .seg { display: flex; width: 100%; }
  .acc-seg .seg button { flex: 1 0 auto; padding: 9px 10px; font-size: 13px; justify-content: center; }
  /* Pickers in sheets: three people fit in one row */
  .payer-grid { grid-template-columns: repeat(auto-fit, minmax(88px, 1fr)); gap: 8px; }
  .payer .pc { padding: 14px 6px 12px; min-width: 0; }
  .payer .pc b { font-size: 13.5px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .payer .tick { top: 8px; right: 8px; }
  .radio-pill span { padding: 9px 13px; }
  .acc-tools .rst-lbl { display: none; }
  .card-head .tools .acc-tools .btn.sm { padding: 8px; }
  /* Settings */
  .rate-live { flex-wrap: wrap; }
  .rate-live .btn, #addReason { flex: none; }
  #newReason { min-width: 0; flex: 1; }
  .swatches { gap: 6px; }
  .swatches .sw { width: 30px; height: 30px; border-radius: 9px; }
}
@media (max-width: 380px) {
  .tf { grid-template-columns: 56px minmax(0, 1fr) 56px; gap: 2px; }
  .tf-who b { font-size: 12.5px; }
  .paid-stamp b { font-size: 19px; }
  .paid-stamp small { font-size: 7.5px; }
  .seg button { padding: 9px 10px; }
}

/* Earnings by account in a narrow card (phones, tablets, small laptops): name on one line, $ and ₹ under it */
@container (max-width: 480px) {
  .ov-acc { gap: 12px; align-items: center; }
  .ov-acc .mini-donut { width: 70px; height: 70px; }
  .ov-acc .ov-list { gap: 10px; min-width: 0; }
  .ov-acc .ov-row { flex-wrap: wrap; row-gap: 1px; column-gap: 8px; }
  .ov-acc .ov-row .grow { flex: 1 0 calc(100% - 20px); }
  .ov-acc .ov-row b { margin-left: 18px; }
  .ov-acc .ov-row .inr { min-width: 0; text-align: left; }
}
/* Daily squares: the amount shrinks with the square when the grid gets narrow */
.day-sq { container-type: inline-size; }
@media (min-width: 681px) {
  .day-sq.has b { font-size: min(clamp(15px, 1.9vw, 28px), 24cqw); }
  .day-sq.has small { font-size: min(12px, 15cqw); }
}
/* Buttons beside an input or a value never get squeezed */
#addReason, #rateNow { flex: none; }
/* Short screens (phones held sideways): the side rail scrolls instead of cutting off its last buttons */
@media (max-height: 600px) and (min-width: 681px) {
  .sidebar { overflow-y: auto; scrollbar-width: none; }
  .sidebar::-webkit-scrollbar { display: none; }
}

/* Forgot password */
.link-btn { appearance: none; border: 0; background: none; padding: 4px; margin: -6px auto 0; font: 600 14px var(--font); color: var(--accent); cursor: pointer; border-radius: 8px; }
.link-btn:hover { text-decoration: underline; }
.err.info { color: var(--good); }
.rec-intro { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.rec-help { text-align: left; font-size: 13.5px; color: var(--muted); background: var(--sunken); border-radius: 14px; padding: 10px 14px; }
.rec-help summary { cursor: pointer; font-weight: 650; color: var(--text); }
.rec-help p { margin: 8px 0 2px; line-height: 1.55; }
.rec-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: var(--sunken); }
.rec-row b { display: block; font-size: 14px; }
.rec-row small { display: block; color: var(--muted); font-size: 12.5px; line-height: 1.45; margin-top: 2px; }
.rec-row .btn { flex: none; }
.rec-ic { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; flex: none; color: var(--warn); background: var(--warn-soft, rgba(255,159,10,.14)); }
.rec-ic.on { color: var(--good); background: var(--good-soft); }
.rec-code { display: grid; place-items: center; padding: 18px 12px; border-radius: 16px; background: var(--sunken); border: 1.5px dashed var(--edge-2); }
.rec-code code { background: none; padding: 0; font-size: 19px; font-weight: 750; letter-spacing: .06em; color: var(--text); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; text-align: center; word-break: break-all; }
@media (max-width: 680px) { .rec-row { flex-wrap: wrap; } .rec-row .grow { flex: 1 1 calc(100% - 46px); min-width: 0; } .rec-row .btn { margin-left: 46px; } .rec-code code { font-size: 16px; } }

/* Very narrow cards: the date-range dropdown drops under the title instead of squeezing it */
@container (max-width: 310px) {
  .card-head .tools:has(.qr-btn) { grid-column: 1 / -1; justify-content: flex-start; }
}
