/* Split · working demo for LaunchForce Lab
   All styling lives here (strict CSP: style-src 'self'). */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/inter-var.woff2") format("woff2");
}
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("/fonts/space-grotesk-var.woff2") format("woff2");
}

/* ---------- tokens ---------- */

:root {
  --bg: #070908;
  --app-bg: #0b0f0d;
  --surface: #121814;
  --surface-2: #161e18;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --text: #f3f7f2;
  --text-2: #c6d0c7;
  --muted: #94a096;
  --muted-2: #6e7b71;
  --mint: #b7f56a;
  --mint-bright: #d3ff9d;
  --mint-ink: #0b1406;
  --mint-soft: rgba(183, 245, 106, 0.12);
  --mint-line: rgba(183, 245, 106, 0.32);
  --orange: #f24700;
  --negative: #ffb27a;
  --cat-food: #b7f56a;
  --cat-stay: #8ab4ff;
  --cat-transport: #ffc46b;
  --cat-fun: #d8a1ff;
  --ui: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --lab-h: 48px;
  --phone-w: 390px;
  --phone-h: clamp(640px, calc(100vh - 168px), 780px);
  --phone-h: clamp(640px, calc(100dvh - 168px), 780px);
  color-scheme: dark;
}

/* ---------- base ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--ui);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(52% 48% at 12% 6%, rgba(183, 245, 106, 0.1), transparent 62%),
    radial-gradient(46% 42% at 88% 84%, rgba(138, 180, 255, 0.08), transparent 64%),
    radial-gradient(38% 36% at 64% 0%, rgba(242, 71, 0, 0.06), transparent 60%),
    #070908;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px);
  background-size: 72px 72px;
  -webkit-mask-image: radial-gradient(70% 62% at 50% 42%, #000 0%, transparent 100%);
  mask-image: radial-gradient(70% 62% at 50% 42%, #000 0%, transparent 100%);
  pointer-events: none;
}

h1,
h2,
h3,
p,
ul,
ol,
figure {
  margin: 0;
  padding: 0;
}

ul,
ol {
  list-style: none;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

input,
select,
textarea {
  font: inherit;
  color: inherit;
}

svg {
  display: block;
}

[hidden] {
  display: none !important;
}

::selection {
  background: rgba(183, 245, 106, 0.28);
  color: #fff;
}

:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--mint);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: -80px;
  left: 16px;
  z-index: 300;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--mint);
  color: var(--mint-ink);
  font-size: 13px;
  font-weight: 600;
  transition: top 0.16s ease;
}
.skip-link:focus-visible {
  top: 10px;
  outline-offset: 3px;
}

.icon {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.noscript {
  position: fixed;
  inset: auto 16px 16px;
  z-index: 400;
  padding: 12px 16px;
  border-radius: 12px;
  background: #1a2419;
  border: 1px solid var(--mint-line);
  color: var(--text);
  font-size: 13px;
  text-align: center;
}

/* ---------- lab bar ---------- */

.lab-bar {
  position: sticky;
  top: 0;
  z-index: 120;
  height: var(--lab-h);
  background: rgba(8, 10, 9, 0.9);
  border-bottom: 1px solid #1b211d;
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

.lab-bar-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  width: 100%;
  max-width: 1400px;
  height: 100%;
  margin: 0 auto;
  padding: 0 24px;
}

.lab-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-self: start;
  min-width: 0;
}

.lab-word {
  font-family: var(--display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: #f1f5ef;
  white-space: nowrap;
}

.lab-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 0 3px rgba(242, 71, 0, 0.14);
  flex: none;
}

.lab-tag {
  padding-left: 8px;
  border-left: 1px solid rgba(255, 255, 255, 0.16);
  color: #77837a;
  font-family: var(--display);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.2em;
  line-height: 1;
}

.lab-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border: 1px solid rgba(242, 71, 0, 0.45);
  border-radius: 999px;
  background: rgba(242, 71, 0, 0.13);
  color: #ff8a55;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  white-space: nowrap;
}

.lab-pill-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 8px rgba(242, 71, 0, 0.9);
  animation: lab-pulse 2.6s ease-in-out infinite;
}

.lab-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  justify-self: end;
  color: #a3ada4;
  font-size: 12px;
  white-space: nowrap;
  transition: color 0.18s ease;
}
.lab-back:hover {
  color: #fff;
}
.lab-back-arrow {
  transition: transform 0.18s ease;
}
.lab-back:hover .lab-back-arrow {
  transform: translateX(-2px);
}
.lab-back-short {
  display: none;
}

@keyframes lab-pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.45;
    transform: scale(0.8);
  }
}

/* ---------- stage + side panels ---------- */

.stage {
  display: grid;
  grid-template-columns: minmax(0, 340px) auto;
  align-items: center;
  justify-content: center;
  column-gap: clamp(40px, 5.5vw, 88px);
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px 32px;
  min-height: calc(100vh - var(--lab-h) - 38px);
  min-height: calc(100dvh - var(--lab-h) - 38px);
}

.side-panel {
  max-width: 352px;
  padding: 8px 0;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  line-height: 1.4;
  text-transform: uppercase;
}

.eyebrow-dot {
  width: 6px;
  height: 6px;
  flex: none;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 0 3px rgba(242, 71, 0, 0.13);
}

.wordmark {
  margin: 18px 0 20px;
  color: #f6faf3;
  font-family: var(--display);
  font-size: clamp(54px, 5vw, 72px);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 0.92;
}

.wordmark-dot {
  color: var(--mint);
}

.side-lede {
  max-width: 34ch;
  color: var(--text-2);
  font-size: 16px;
  letter-spacing: -0.01em;
  line-height: 1.6;
}

.feature-list {
  display: flex;
  flex-direction: column;
  gap: 13px;
  max-width: 350px;
  margin-top: 26px;
}

.feature-list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.feature-list strong {
  color: var(--text);
  font-weight: 600;
}

.feature-icon {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex: none;
  border: 1px solid rgba(183, 245, 106, 0.18);
  border-radius: 8px;
  background: var(--mint-soft);
  color: var(--mint);
}

.feature-icon .icon {
  width: 14px;
  height: 14px;
}

.side-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  margin-top: 30px;
}

.side-reset {
  height: 38px;
  font-size: 12.5px;
}

.side-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 13px;
  transition: color 0.18s ease;
}
.side-link:hover {
  color: var(--mint);
}
.side-link-arrow {
  color: var(--mint);
  transition: transform 0.18s ease;
}
.side-link:hover .side-link-arrow {
  transform: translateX(3px);
}

.side-note {
  max-width: 32ch;
  margin-top: 16px;
  color: var(--muted-2);
  font-size: 11.5px;
  line-height: 1.5;
}

.side-panel-right {
  display: none;
  max-width: 250px;
}

.try-title {
  margin: 16px 0 18px;
  color: #eef5ea;
  font-family: var(--display);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.try-list {
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.try-list li {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 9px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.5;
}

.try-num {
  padding-top: 1px;
  color: var(--mint);
  font-family: var(--display);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.state-card {
  margin-top: 22px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.035);
}

.state-head {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--mint);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.state-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 10px rgba(183, 245, 106, 0.8);
  animation: lab-pulse 2.8s ease-in-out infinite;
}

.state-summary {
  margin-top: 8px;
  color: var(--text);
  font-family: var(--display);
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.state-note {
  margin-top: 4px;
  color: var(--muted-2);
  font-size: 10.5px;
  line-height: 1.5;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 13px;
  font-weight: 600;
  letter-spacing: -0.005em;
  white-space: nowrap;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.12s ease;
}
.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--mint);
  color: var(--mint-ink);
  box-shadow: 0 8px 24px -12px rgba(183, 245, 106, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}
.btn-primary:hover {
  background: var(--mint-bright);
}

.btn-ghost {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}
.btn-ghost:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.07);
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: none;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}
.icon-btn:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.09);
  color: var(--text);
}
.icon-btn .icon {
  width: 16px;
  height: 16px;
}

/* ---------- phone ---------- */

.phone-wrap {
  position: relative;
  z-index: 0;
  justify-self: center;
  filter: drop-shadow(0 40px 90px rgba(0, 0, 0, 0.55));
}

.phone-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 0;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(183, 245, 106, 0.14), rgba(183, 245, 106, 0) 62%);
  filter: blur(8px);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.phone {
  position: relative;
  z-index: 1;
  width: calc(var(--phone-w) + 26px);
  padding: 13px;
  border-radius: 58px;
  background: linear-gradient(150deg, #3c473e 0%, #161c18 16%, #0a0d0b 55%, #262e28 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.16),
    inset 0 1px 1px rgba(255, 255, 255, 0.33),
    0 0 0 1px rgba(0, 0, 0, 0.8),
    0 60px 120px -40px rgba(0, 0, 0, 0.9);
}

.phone::before {
  content: "";
  position: absolute;
  inset: 8px;
  z-index: 3;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 50px;
  pointer-events: none;
}

.phone-btn {
  position: absolute;
  z-index: 0;
  width: 3px;
  border-radius: 2px;
  background: linear-gradient(180deg, #39443b, #141a16);
}
.phone-btn-mute {
  top: 132px;
  left: -2px;
  height: 26px;
}
.phone-btn-vol-up {
  top: 180px;
  left: -2px;
  height: 44px;
}
.phone-btn-vol-down {
  top: 234px;
  left: -2px;
  height: 44px;
}
.phone-btn-power {
  top: 196px;
  right: -2px;
  height: 66px;
}

.phone-screen {
  position: relative;
  display: flex;
  flex-direction: column;
  height: var(--phone-h);
  overflow: hidden;
  border-radius: 46px;
  background: var(--app-bg);
  isolation: isolate;
}

/* ---------- status bar ---------- */

.phone-status {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: none;
  height: 44px;
  padding: 0 24px;
  color: #e9f0ea;
  font-family: var(--display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.status-time {
  font-variant-numeric: tabular-nums;
}

.dynamic-island {
  position: absolute;
  top: 9px;
  left: 50%;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  width: 96px;
  height: 26px;
  padding-right: 9px;
  border-radius: 999px;
  background: #000;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  transform: translateX(-50%);
}

.island-cam {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #1d2a22, #0a0d0b 60%);
  box-shadow: inset 0 0 0 1px rgba(120, 160, 130, 0.25);
}

.status-icons {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #e9f0ea;
}

.status-icon {
  fill: none;
  stroke: currentColor;
}
.status-icon-signal {
  width: 16px;
  height: 11px;
}
.status-icon-wifi {
  width: 15px;
  height: 11px;
}
.status-icon-battery {
  width: 24px;
  height: 11px;
}

/* ---------- app shell ---------- */

.app {
  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  background:
    radial-gradient(120% 55% at 82% -8%, rgba(183, 245, 106, 0.1), transparent 60%),
    radial-gradient(90% 40% at 0% 105%, rgba(138, 180, 255, 0.06), transparent 65%),
    var(--app-bg);
}

.app::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 14%);
  pointer-events: none;
}

.app-screens {
  position: relative;
  z-index: 1;
  flex: 1;
  min-height: 0;
}

.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.screen-scroll {
  flex: 1;
  min-height: 0;
  padding: 10px 20px 26px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
}
.screen-scroll::-webkit-scrollbar {
  display: none;
}

.screen.is-entering .screen-scroll {
  animation: screen-in 0.32s cubic-bezier(0.2, 0.8, 0.3, 1) both;
}

@keyframes screen-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------- tab bar ---------- */

.tabbar::before {
  content: "";
  position: absolute;
  top: -22px;
  right: 0;
  left: 0;
  height: 22px;
  background: linear-gradient(180deg, rgba(11, 15, 13, 0), rgba(11, 15, 13, 0.92));
  pointer-events: none;
}

.tabbar {
  position: relative;
  z-index: 5;
  display: grid;
  flex: none;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 8px 14px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(11, 15, 13, 0.92);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 5px 4px 3px;
  border-radius: 12px;
  color: var(--muted);
  transition: color 0.18s ease;
}
.tab:hover {
  color: var(--text-2);
}

.tab-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 24px;
  border-radius: 8px;
  transition: background 0.2s ease, color 0.2s ease;
}
.tab-icon .icon {
  width: 19px;
  height: 19px;
}

.tab-label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.tab.is-active {
  color: var(--mint);
}
.tab.is-active .tab-icon {
  background: rgba(183, 245, 106, 0.12);
}

/* ---------- avatars ---------- */

.avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 50%;
  background: var(--avatar-bg, #b7f56a);
  color: #0d1309;
  font-family: var(--display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1;
  transition: transform 0.16s ease;
}
button.avatar:hover {
  transform: translateY(-1px);
}
.avatar-you {
  --avatar-bg: #b7f56a;
}
.avatar-maya {
  --avatar-bg: #8ab4ff;
}
.avatar-jordan {
  --avatar-bg: #ffc46b;
}
.avatar-sam {
  --avatar-bg: #d8a1ff;
}

.avatar-stack {
  display: flex;
  align-items: center;
  padding-left: 3px;
}
.avatar-stack .avatar {
  margin-left: -9px;
  box-shadow: 0 0 0 2px var(--app-bg);
}
.avatar-stack .avatar:first-child {
  margin-left: 0;
}

/* ---------- category tokens ---------- */

.cat-food {
  --cat: var(--cat-food);
  --cat-soft: rgba(183, 245, 106, 0.12);
}
.cat-stay {
  --cat: var(--cat-stay);
  --cat-soft: rgba(138, 180, 255, 0.13);
}
.cat-transport {
  --cat: var(--cat-transport);
  --cat-soft: rgba(255, 196, 107, 0.13);
}
.cat-fun {
  --cat: var(--cat-fun);
  --cat-soft: rgba(216, 161, 255, 0.13);
}

/* ---------- home ---------- */

.home-head {
  padding: 6px 0 0;
}

.trip-kicker {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}
.trip-kicker .icon {
  width: 13px;
  height: 13px;
  color: var(--mint);
}

.kicker-sep {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--muted-2);
}

.home-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-top: 9px;
}

.home-title {
  color: #f6faf3;
  font-family: var(--display);
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.05;
}

.title-dot {
  color: var(--mint);
}

.home-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 13px;
}

.home-meta {
  color: var(--muted);
  font-size: 11.5px;
  letter-spacing: 0.005em;
}

/* balance card */

.balance-card {
  position: relative;
  margin-top: 18px;
  padding: 17px 18px 16px;
  overflow: hidden;
  border: 1px solid rgba(183, 245, 106, 0.3);
  border-radius: 22px;
  background:
    radial-gradient(120% 130% at 100% 0%, rgba(183, 245, 106, 0.3), rgba(183, 245, 106, 0.06) 55%, transparent 78%),
    linear-gradient(150deg, rgba(183, 245, 106, 0.18), rgba(183, 245, 106, 0.045) 45%, rgba(255, 255, 255, 0.028));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 20px 40px -28px rgba(183, 245, 106, 0.5);
}

.balance-card::after {
  content: "";
  position: absolute;
  top: -58px;
  right: -46px;
  width: 170px;
  height: 170px;
  border: 1px solid rgba(183, 245, 106, 0.24);
  border-radius: 50%;
  pointer-events: none;
}

.balance-top {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.balance-label {
  color: rgba(232, 247, 214, 0.72);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.balance-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border: 1px solid rgba(183, 245, 106, 0.26);
  border-radius: 999px;
  background: rgba(8, 16, 4, 0.32);
  color: #ddf6b8;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.balance-amount {
  position: relative;
  margin-top: 10px;
  color: #f6ffe9;
  font-family: var(--display);
  font-size: 38px;
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.balance-sub {
  position: relative;
  max-width: 30ch;
  margin-top: 8px;
  color: rgba(226, 242, 208, 0.72);
  font-size: 11.5px;
  line-height: 1.45;
}

.balance-card.is-owe {
  border-color: rgba(255, 178, 122, 0.3);
  background:
    radial-gradient(120% 130% at 100% 0%, rgba(255, 178, 122, 0.24), rgba(255, 178, 122, 0.05) 55%, transparent 78%),
    linear-gradient(150deg, rgba(255, 178, 122, 0.14), rgba(255, 255, 255, 0.03) 45%, rgba(255, 255, 255, 0.02));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 20px 40px -28px rgba(255, 178, 122, 0.4);
}
.balance-card.is-owe::after {
  border-color: rgba(255, 178, 122, 0.22);
}
.balance-card.is-owe .balance-status {
  border-color: rgba(255, 178, 122, 0.3);
  color: #ffd6b8;
}
.balance-card.is-owe .balance-amount {
  color: #fff1e6;
}

.balance-card.is-settled {
  border-color: rgba(255, 255, 255, 0.14);
  background:
    radial-gradient(120% 130% at 100% 0%, rgba(255, 255, 255, 0.09), transparent 65%),
    linear-gradient(150deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}
.balance-card.is-settled::after {
  border-color: rgba(255, 255, 255, 0.12);
}
.balance-card.is-settled .balance-status {
  border-color: rgba(255, 255, 255, 0.18);
  color: var(--text-2);
}
.balance-card.is-settled .balance-amount {
  color: var(--text);
}

/* quick actions */

.quick-actions {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 9px;
  margin-top: 12px;
}
.quick-actions .btn {
  height: 45px;
  border-radius: 13px;
  font-size: 12.5px;
}
.quick-actions .icon {
  width: 16px;
  height: 16px;
}

/* sections */

.section {
  margin-top: 24px;
}

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

.section-head h3 {
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.005em;
}

.section-hint {
  color: var(--muted-2);
  font-size: 10px;
  letter-spacing: 0.02em;
}

.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 500;
  transition: color 0.18s ease;
}
.link-btn .icon {
  width: 13px;
  height: 13px;
}
.link-btn:hover {
  color: var(--mint);
}

/* expense rows */

.expense-list {
  padding: 3px 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.035);
}

.expense-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 11px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
}
.expense-item:last-child {
  border-bottom: 0;
}
.expense-item.is-new {
  animation: row-flash 1.8s ease-out;
}

@keyframes row-flash {
  0% {
    border-radius: 12px;
    background: rgba(183, 245, 106, 0.16);
  }
  100% {
    border-radius: 12px;
    background: transparent;
  }
}

.expense-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 11px;
  background: var(--cat-soft, rgba(255, 255, 255, 0.06));
  color: var(--cat, var(--mint));
}
.expense-icon .icon {
  width: 17px;
  height: 17px;
}

.expense-main {
  min-width: 0;
}

.expense-title {
  display: block;
  overflow: hidden;
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: -0.005em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.expense-meta {
  display: block;
  overflow: hidden;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.expense-right {
  text-align: right;
}

.expense-amount {
  display: block;
  color: var(--text);
  font-family: var(--display);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}

.expense-share {
  display: block;
  margin-top: 2px;
  color: var(--muted-2);
  font-size: 10px;
  white-space: nowrap;
}

/* member balances */

.member-list {
  padding: 4px 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.035);
}

.member-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
  border-radius: 10px;
  text-align: left;
  transition: background 0.16s ease;
}
.member-row:last-child {
  border-bottom: 0;
}
.member-row:hover {
  background: rgba(255, 255, 255, 0.035);
}

.member-avatar {
  width: 28px;
  height: 28px;
  font-size: 9.5px;
}

.member-main {
  min-width: 0;
}

.member-name-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.member-name {
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
}

.member-note {
  color: var(--muted-2);
  font-size: 9.5px;
  letter-spacing: 0.01em;
}

.member-bar {
  display: block;
  width: 100%;
  height: 5px;
  margin-top: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
}
.member-bar svg {
  display: block;
  width: 100%;
  height: 5px;
}
.member-bar .bar-fill {
  fill: var(--mint);
}
.member-bar.is-owe .bar-fill {
  fill: var(--negative);
}

.member-amount {
  min-width: 60px;
  color: var(--text-2);
  font-family: var(--display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.member-amount.is-owed {
  color: var(--mint);
}
.member-amount.is-owes {
  color: var(--negative);
}
.member-amount.is-zero {
  color: var(--muted-2);
}

/* home footer */

.home-foot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  margin-top: 26px;
  padding-bottom: 4px;
}

.reset-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 11px;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}
.reset-link .icon {
  width: 12px;
  height: 12px;
}
.reset-link:hover {
  border-color: var(--line-strong);
  color: var(--text);
}

.foot-note {
  color: var(--muted-2);
  font-size: 10px;
  letter-spacing: 0.02em;
}

/* ---------- activity ---------- */

.screen-head {
  margin-bottom: 16px;
  padding: 8px 0 0;
}

.screen-eyebrow {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--mint);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}
.screen-eyebrow::before {
  content: "";
  width: 16px;
  height: 1px;
  background: rgba(183, 245, 106, 0.5);
}

.screen-title {
  margin-top: 6px;
  color: #f6faf3;
  font-family: var(--display);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.1;
}

.screen-sub {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11.5px;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  margin-bottom: 14px;
  padding: 3px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.045);
}

.segment {
  height: 31px;
  border-radius: 9px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}
.segment:hover {
  color: var(--text-2);
}
.segment.is-active {
  background: rgba(183, 245, 106, 0.13);
  color: var(--mint);
  box-shadow: inset 0 0 0 1px rgba(183, 245, 106, 0.2);
}

.active-filter:not(:empty) {
  display: flex;
  margin-bottom: 12px;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 6px 5px 5px;
  border: 1px solid rgba(183, 245, 106, 0.24);
  border-radius: 999px;
  background: rgba(183, 245, 106, 0.09);
  color: var(--mint);
  font-size: 11px;
  font-weight: 600;
}
.filter-chip .avatar {
  width: 20px;
  height: 20px;
  font-size: 8px;
}
.filter-chip-x {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  margin-left: 2px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  transition: background 0.18s ease, color 0.18s ease;
}
.filter-chip-x .icon {
  width: 11px;
  height: 11px;
}
.filter-chip:hover .filter-chip-x {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

.activity-feed {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding-bottom: 8px;
}

.day-label {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 8px;
  color: var(--muted-2);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}
.day-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.06);
}

.feed-list {
  padding: 2px 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.035);
}

.feed-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
}
.feed-item:last-child {
  border-bottom: 0;
}

.feed-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 10px;
  background: var(--cat-soft, rgba(255, 255, 255, 0.06));
  color: var(--cat, var(--mint));
}
.feed-icon .icon {
  width: 15px;
  height: 15px;
}
.feed-item.is-settlement .feed-icon {
  color: var(--mint);
  background: rgba(183, 245, 106, 0.1);
}

.feed-main {
  min-width: 0;
}

.feed-title {
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feed-meta {
  overflow: hidden;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feed-amount {
  color: var(--text);
  font-family: var(--display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}
.feed-item.is-settlement .feed-amount {
  color: var(--mint);
}

.feed-sub {
  margin-top: 2px;
  color: var(--muted-2);
  font-size: 9.5px;
  text-align: right;
  white-space: nowrap;
}

/* empty state */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 34px 18px;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.02);
  text-align: center;
}

.empty-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
}
.empty-icon .icon {
  width: 18px;
  height: 18px;
}
.empty-title {
  margin-top: 12px;
  color: var(--text);
  font-family: var(--display);
  font-size: 14px;
  font-weight: 600;
}
.empty-sub {
  max-width: 26ch;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

/* ---------- insights ---------- */

.total-card {
  position: relative;
  margin-top: 2px;
  padding: 18px;
  overflow: hidden;
  border: 1px solid rgba(183, 245, 106, 0.26);
  border-radius: 22px;
  background:
    radial-gradient(120% 130% at 100% 0%, rgba(183, 245, 106, 0.22), transparent 62%),
    linear-gradient(150deg, rgba(183, 245, 106, 0.13), rgba(255, 255, 255, 0.03));
}

.total-label {
  color: rgba(232, 247, 214, 0.7);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.total-amount {
  margin-top: 8px;
  color: #f6ffe9;
  font-family: var(--display);
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.total-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
  padding-top: 13px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.total-stat-label {
  color: rgba(222, 240, 206, 0.55);
  font-size: 9.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.total-stat-value {
  margin-top: 3px;
  color: #eaf7dc;
  font-family: var(--display);
  font-size: 16px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.panel-card {
  margin-top: 16px;
  padding: 15px 16px 16px;
  border: 1px solid rgba(255, 255, 255, 0.065);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.035);
}

.donut-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 4px;
}

.donut-wrap {
  width: 132px;
  flex: none;
}

.donut {
  width: 132px;
  height: 132px;
  overflow: visible;
}

.donut-track circle {
  fill: none;
  stroke: rgba(255, 255, 255, 0.06);
  stroke-width: 13;
}

.donut-seg {
  fill: none;
  stroke-width: 13;
  transition: stroke-dasharray 0.4s ease;
}
.seg-food {
  stroke: var(--cat-food);
}
.seg-stay {
  stroke: var(--cat-stay);
}
.seg-transport {
  stroke: var(--cat-transport);
}
.seg-fun {
  stroke: var(--cat-fun);
}

.donut-center-main {
  fill: #f4faee;
  font-family: var(--display);
  font-size: 19px;
  font-weight: 700;
  text-anchor: middle;
  font-variant-numeric: tabular-nums;
}
.donut-center-sub {
  fill: #8c998f;
  font-family: var(--ui);
  font-size: 8px;
  letter-spacing: 0.1em;
  text-anchor: middle;
  text-transform: uppercase;
}

.legend {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.legend-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.legend-dot {
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 2px;
  background: var(--cat, var(--mint));
}

.legend-label {
  overflow: hidden;
  flex: 1;
  color: var(--text-2);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.legend-pct {
  color: var(--muted-2);
  font-size: 9.5px;
  font-variant-numeric: tabular-nums;
}

.legend-amount {
  min-width: 52px;
  color: var(--text);
  font-family: var(--display);
  font-size: 10.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.biggest-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
}

.biggest-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: var(--cat-soft, rgba(255, 255, 255, 0.06));
  color: var(--cat, var(--mint));
}
.biggest-icon .icon {
  width: 19px;
  height: 19px;
}

.biggest-main {
  min-width: 0;
}

.biggest-label {
  color: var(--muted-2);
  font-size: 9.5px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.biggest-title {
  margin-top: 3px;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}

.biggest-meta {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10.5px;
}

.biggest-amount {
  color: var(--mint);
  font-family: var(--display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.day-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: 3px;
}

.day-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.day-name {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.03em;
}

.day-bar {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
}
.day-bar svg {
  display: block;
  width: 100%;
  height: 7px;
}
.day-bar-fill {
  fill: var(--mint);
}

.day-amount {
  min-width: 56px;
  color: var(--text-2);
  font-family: var(--display);
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

/* ---------- sheets ---------- */

.sheet-overlay {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 6, 4, 0.66);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  opacity: 0;
  transition: opacity 0.26s ease;
}

.sheet {
  position: relative;
  width: 100%;
  max-height: 92%;
  padding: 8px 20px calc(20px + env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: 0;
  border-radius: 26px 26px 0 0;
  background: linear-gradient(180deg, #121914 0%, #0d120f 100%);
  box-shadow: 0 -24px 70px rgba(0, 0, 0, 0.7);
  scrollbar-width: none;
  transform: translateY(102%);
  transition: transform 0.34s cubic-bezier(0.2, 0.9, 0.25, 1);
}
.sheet::-webkit-scrollbar {
  display: none;
}

.sheet-overlay.is-open .sheet-backdrop {
  opacity: 1;
}
.sheet-overlay.is-open .sheet {
  transform: translateY(0);
}

.sheet-handle {
  width: 36px;
  height: 4px;
  margin: 1px auto 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
}

.sheet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.sheet-kicker {
  color: var(--mint);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.sheet-title {
  margin-top: 3px;
  color: #f5faf1;
  font-family: var(--display);
  font-size: 23px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.sheet-close {
  width: 32px;
  height: 32px;
}

.sheet-desc {
  margin-top: 7px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.5;
}

/* form */

.expense-form {
  margin-top: 16px;
}

.field {
  margin-top: 13px;
}

.field-fieldset {
  min-width: 0;
  margin-right: 0;
  margin-left: 0;
  padding: 0;
  border: 0;
}

.field > label,
.field > legend {
  display: block;
  margin-bottom: 7px;
  padding: 0;
  color: var(--text-2);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.field input[type="text"],
.field select {
  width: 100%;
  height: 44px;
  padding: 0 13px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
  font-size: 13.5px;
  transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.field input::placeholder {
  color: var(--muted-2);
}

.field input[type="text"]:focus-visible,
.field select:focus-visible {
  border-color: var(--mint-line);
  outline: none;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 0 3px rgba(183, 245, 106, 0.16);
}

.amount-wrap {
  position: relative;
}

.amount-prefix {
  position: absolute;
  top: 50%;
  left: 13px;
  color: var(--muted);
  font-family: var(--display);
  font-size: 14px;
  font-weight: 600;
  pointer-events: none;
  transform: translateY(-50%);
}

.field .amount-wrap input[type="text"] {
  padding-left: 27px;
  font-family: var(--display);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}

.chip-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.chip-input,
.split-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  opacity: 0;
}

.chip {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 11px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text-2);
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}
.chip:hover {
  border-color: var(--line-strong);
}
.chip .icon {
  width: 15px;
  height: 15px;
  color: var(--cat, var(--muted));
}

.chip-input:checked + .chip {
  border-color: var(--mint-line);
  background: rgba(183, 245, 106, 0.12);
  color: #e8f9d4;
}

.chip-input:focus-visible + .chip,
.split-input:focus-visible + .split-chip {
  outline: 2px solid var(--mint);
  outline-offset: 2px;
}

.select-wrap {
  position: relative;
}

.select-wrap select {
  padding-right: 36px;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.select-chevron {
  position: absolute;
  top: 50%;
  right: 13px;
  width: 14px;
  height: 14px;
  color: var(--muted);
  pointer-events: none;
  transform: translateY(-50%) rotate(90deg);
}

.split-chips {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.split-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px 5px 5px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text-2);
  font-size: 10.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}
.split-chip:hover {
  border-color: var(--line-strong);
}
.split-chip .avatar {
  width: 20px;
  height: 20px;
  font-size: 8px;
}

.split-input:checked + .split-chip {
  border-color: var(--mint-line);
  background: rgba(183, 245, 106, 0.11);
  color: #edfadf;
}

.split-hint {
  margin-top: 8px;
  color: var(--muted);
  font-size: 10.5px;
}
.split-hint strong {
  color: var(--mint);
  font-weight: 600;
}

.field-error {
  margin-top: 6px;
  color: #ff9d84;
  font-size: 10.5px;
  line-height: 1.4;
}

.sheet-actions {
  display: flex;
  gap: 9px;
  margin-top: 20px;
}
.sheet-actions .btn {
  flex: 1;
  height: 46px;
  font-size: 12.5px;
}

/* settle up */

.transfer-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}

.transfer {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 11px 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
}

.transfer-people {
  display: flex;
  align-items: center;
}

.transfer-people .avatar {
  width: 26px;
  height: 26px;
  font-size: 8.5px;
}

.transfer-arrow {
  display: grid;
  place-items: center;
  margin: 0 2px;
  color: var(--muted-2);
}
.transfer-arrow .icon {
  width: 11px;
  height: 11px;
}

.transfer-main {
  min-width: 0;
}

.transfer-title {
  overflow: hidden;
  color: var(--text);
  font-size: 11.5px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.transfer-sub {
  margin-top: 2px;
  color: var(--muted-2);
  font-size: 9.5px;
  white-space: nowrap;
}

.transfer-action {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
}

.transfer-amount {
  color: var(--mint);
  font-family: var(--display);
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.settle-btn {
  padding: 5px 8px;
  border-radius: 8px;
  background: var(--mint);
  color: var(--mint-ink);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  transition: background 0.18s ease, transform 0.12s ease;
}
.settle-btn:hover {
  background: var(--mint-bright);
}
.settle-btn:active {
  transform: scale(0.97);
}

.settled-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 26px 10px 22px;
  text-align: center;
}

.settled-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(183, 245, 106, 0.3);
  border-radius: 50%;
  background: var(--mint-soft);
  color: var(--mint);
}

.settled-title {
  color: var(--text);
  font-family: var(--display);
  font-size: 16px;
  font-weight: 600;
}

.settled-sub {
  max-width: 26ch;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.sheet-note {
  margin-top: 14px;
  color: var(--muted-2);
  font-size: 10px;
  line-height: 1.5;
}

/* ---------- toasts ---------- */

.toast-region {
  position: absolute;
  right: 14px;
  bottom: calc(74px + env(safe-area-inset-bottom, 0px));
  left: 14px;
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 7px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border: 1px solid rgba(183, 245, 106, 0.24);
  border-radius: 11px;
  background: rgba(20, 29, 21, 0.96);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.5);
  color: var(--text);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.35;
  animation: toast-in 0.24s cubic-bezier(0.2, 0.9, 0.25, 1);
}

.toast-icon {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  flex: none;
  border-radius: 50%;
  background: var(--mint-soft);
  color: var(--mint);
}
.toast-icon .icon {
  width: 11px;
  height: 11px;
}

.toast.is-leaving {
  animation: toast-out 0.2s ease forwards;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateY(6px);
  }
}

/* ---------- footer ---------- */

.lab-footer {
  max-width: 1400px;
  margin: 0 auto;
  padding: 8px 24px 13px;
  text-align: center;
}

.lab-footer p {
  color: var(--muted-2);
  font-size: 11px;
  letter-spacing: 0.01em;
}

/* ---------- wide desktop ---------- */

@media (min-width: 1200px) {
  .stage {
    grid-template-columns: minmax(0, 340px) auto minmax(0, 240px);
    max-width: 1280px;
    column-gap: clamp(36px, 4vw, 72px);
  }
  .side-panel-right {
    display: block;
  }
}

@media (min-width: 900px) and (max-width: 1199px) {
  .stage {
    grid-template-columns: minmax(0, 300px) auto;
    column-gap: clamp(28px, 4vw, 48px);
    padding: 20px 24px;
  }
  .side-panel {
    max-width: 300px;
  }
  .side-lede {
    font-size: 15px;
  }
  .phone-glow {
    width: 460px;
    height: 460px;
  }
}

/* ---------- mobile: app fills the screen ---------- */

@media (max-width: 899px) {
  html,
  body {
    height: 100%;
  }

  body {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    background: var(--app-bg);
  }

  body::before,
  body::after {
    display: none;
  }

  .lab-bar {
    position: relative;
    flex: none;
    height: var(--lab-h);
    background: #080a09;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .lab-bar-inner {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 14px;
  }

  .lab-brand {
    flex: 0 1 auto;
    min-width: 0;
  }

  .lab-pill {
    flex: none;
    margin-left: auto;
  }

  .lab-back {
    flex: none;
  }

  .lab-word {
    font-size: 10.5px;
    letter-spacing: 0.14em;
  }

  .lab-tag {
    padding-left: 6px;
    font-size: 9px;
    letter-spacing: 0.16em;
  }

  .lab-pill {
    gap: 5px;
    padding: 4px 8px;
    font-size: 8.5px;
    letter-spacing: 0.12em;
  }

  .lab-back {
    gap: 4px;
    font-size: 11px;
  }
  .lab-back-full {
    display: none;
  }
  .lab-back-short {
    display: inline;
  }

  .stage {
    display: block;
    flex: 1;
    width: 100%;
    max-width: none;
    min-height: 0;
    margin: 0;
    padding: 0;
  }

  .side-panel,
  .side-panel-right,
  .phone-glow {
    display: none;
  }

  .phone-wrap {
    width: 100%;
    height: 100%;
    filter: none;
  }

  .phone {
    width: 100%;
    height: 100%;
    padding: 0;
    border-radius: 0;
    background: var(--app-bg);
    box-shadow: none;
  }

  .phone::before,
  .phone-btn {
    display: none;
  }

  .phone-screen {
    height: 100%;
    border-radius: 0;
  }

  .phone-status {
    display: none;
  }

  .screen-scroll {
    padding: 16px 18px calc(26px + env(safe-area-inset-bottom, 0px));
  }

  .tabbar {
    padding: 8px 14px max(10px, env(safe-area-inset-bottom, 0px));
  }

  .toast-region {
    bottom: calc(82px + env(safe-area-inset-bottom, 0px));
  }

  .sheet {
    max-height: 94%;
    border-radius: 22px 22px 0 0;
  }

  .lab-footer {
    flex: none;
    padding: 6px 12px calc(7px + env(safe-area-inset-bottom, 0px));
    background: #080a09;
    border-top: 1px solid #1b211d;
  }

  .lab-footer p {
    color: #6b766d;
    font-size: 9.5px;
    line-height: 1.3;
  }

  .skip-link:focus-visible {
    top: 6px;
  }
}

@media (max-width: 359px) {
  .lab-back {
    display: none;
  }
  .lab-bar-inner {
    grid-template-columns: 1fr auto;
  }
}

/* ---------- reduced motion ---------- */

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