:root {
  --bg: #08111f;
  --bg-soft: #0d1828;
  --surface: #111f31;
  --surface-2: #17283d;
  --surface-3: #20344c;
  --border: rgba(148, 163, 184, 0.16);
  --border-strong: rgba(148, 163, 184, 0.27);
  --text: #f8fafc;
  --muted: #91a1b7;
  --accent: #5dd6c0;
  --accent-strong: #2ab9a3;
  --blue: #5bb8ff;
  --green: #66d69a;
  --red: #ff8c91;
  --amber: #f3bd69;
  --radius: 20px;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.24);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

[hidden] { display: none !important; }

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100%;
  color: var(--text);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(circle at 12% 0%, rgba(93, 214, 192, 0.08), transparent 26rem),
    radial-gradient(circle at 90% 30%, rgba(91, 184, 255, 0.055), transparent 30rem),
    var(--bg);
}

body.sheet-open { overflow: hidden; }

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

button { -webkit-tap-highlight-color: transparent; }

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(93, 214, 192, 0.25);
  outline-offset: 2px;
}

#app {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: env(safe-area-inset-top, 0px) clamp(18px, 4vw, 52px) 0;
  border-bottom: 1px solid var(--border);
  background: rgba(8, 17, 31, 0.86);
  backdrop-filter: blur(20px) saturate(135%);
}

.app-header-inner {
  width: min(1240px, 100%);
  min-height: 78px;
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 auto;
}

.app-heading {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 11px;
  margin-right: auto;
}

.app-heading h1 {
  overflow: hidden;
  font-size: 20px;
  font-weight: 780;
  letter-spacing: -0.035em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-brand-mark,
.welcome-brand-mark {
  width: 32px;
  height: 32px;
  flex: none;
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 3px;
  padding: 7px 6px;
  border-radius: 10px;
  color: #071713;
  background: var(--accent);
  box-shadow: 0 8px 26px rgba(93, 214, 192, 0.18);
}

.app-brand-mark i,
.welcome-brand-mark i {
  width: 4px;
  border-radius: 999px;
  background: currentColor;
}

.app-brand-mark i:nth-child(1),
.welcome-brand-mark i:nth-child(1) { height: 7px; }
.app-brand-mark i:nth-child(2),
.welcome-brand-mark i:nth-child(2) { height: 15px; }
.app-brand-mark i:nth-child(3),
.welcome-brand-mark i:nth-child(3) { height: 11px; }

.header-tools {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-btn,
.header-action,
.account-action {
  border: 0;
  color: var(--text);
  cursor: pointer;
}

.icon-btn {
  width: 40px;
  height: 40px;
  flex: none;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface);
  font-size: 19px;
  transition: border-color 160ms ease, transform 160ms ease;
}

.header-action {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  border-radius: 13px;
  color: #071713;
  background: var(--accent);
  box-shadow: 0 8px 24px rgba(93, 214, 192, 0.12);
}


/* Notifications toggle: a secondary header control, quieter than the primary
   "Add" action. The accent ring marks the opted-in state. */
.notif-btn {
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface);
  color: var(--text);
  box-shadow: none;
}
.notif-btn span { font-size: 18px; line-height: 1; }
.notif-btn b { font-size: 13px; }
.notif-btn[aria-pressed="true"] {
  border-color: var(--accent);
  color: var(--accent);
}
.notif-btn:disabled { opacity: 0.6; cursor: progress; }

.header-action span { font-size: 20px; line-height: 1; }
.header-action b { font-size: 13px; }

.account-action {
  min-height: 42px;
  display: grid;
  grid-template-columns: 30px auto;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 9px;
  padding: 5px 12px 5px 6px;
  border: 1px solid var(--border);
  border-radius: 13px;
  text-align: left;
  background: rgba(17, 31, 49, 0.72);
}

.account-action > span {
  grid-row: 1 / 3;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: #06251e;
  background: rgba(93, 214, 192, 0.88);
  font-size: 11px;
  font-weight: 850;
}

.account-action b {
  max-width: 120px;
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-action i {
  color: var(--muted);
  font-size: 9px;
  font-style: normal;
}

.view {
  width: 100%;
  flex: 1;
}

.groups-page,
.group-page {
  width: min(1240px, calc(100% - clamp(36px, 8vw, 104px)));
  margin: 0 auto;
  padding: clamp(48px, 6vw, 84px) 0 calc(90px + var(--safe-bottom));
}

.eyebrow {
  color: var(--accent);
  font-size: 10px;
  font-weight: 820;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.page-intro {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 40px;
}

.page-intro h2,
.dashboard-title h2 {
  margin-top: 11px;
  font-size: clamp(44px, 6vw, 76px);
  line-height: 0.98;
  letter-spacing: -0.065em;
}

.page-intro-copy,
.dashboard-title > p:last-child {
  max-width: 540px;
  margin-top: 20px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
}

.btn {
  min-height: 46px;
  width: 100%;
  border: 1px solid transparent;
  border-radius: 13px;
  padding: 12px 16px;
  color: var(--text);
  background: var(--surface-2);
  font-size: 14px;
  font-weight: 720;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.btn-primary {
  color: #061c18;
  background: var(--accent);
}

.btn-secondary {
  color: #bceaff;
  border-color: rgba(91, 184, 255, 0.2);
  background: rgba(91, 184, 255, 0.1);
}

.btn-ghost {
  border-color: var(--border);
  background: rgba(23, 40, 61, 0.7);
}

.btn-inline { width: auto; }
.btn-small { min-height: 36px; width: auto; padding: 8px 13px; font-size: 11px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.intro-action,
.dashboard-add {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding-inline: 20px;
}

.intro-action span,
.dashboard-add span { font-size: 19px; }

.overview-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 54px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(17, 31, 49, 0.62);
  box-shadow: var(--shadow);
}

.overview-strip > div {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 23px 25px;
}

.overview-strip > div + div { border-left: 1px solid var(--border); }

.overview-strip strong {
  overflow: hidden;
  font-size: 24px;
  letter-spacing: -0.04em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.overview-strip span { color: var(--muted); font-size: 11px; }

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 24px 26px 18px;
}

.section-heading h3 {
  margin-top: 6px;
  font-size: 18px;
  letter-spacing: -0.035em;
}

.section-heading > span {
  flex: none;
  padding: 5px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(23, 40, 61, 0.55);
  font-size: 9px;
  font-weight: 760;
}

.groups-heading {
  margin-top: 50px;
  padding: 0 1px 18px;
}

.groups-heading h3 { font-size: 20px; }

.group-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.group-card {
  position: relative;
  min-height: 238px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  text-align: left;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.028), transparent 55%),
    var(--surface);
  box-shadow: 0 18px 58px rgba(0, 0, 0, 0.16);
  cursor: pointer;
  transition: border-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.group-card-accent {
  position: absolute;
  top: 0;
  right: 0;
  width: 100px;
  height: 100px;
  border-radius: 0 0 0 100%;
  opacity: 0.12;
  background: var(--accent);
}

.group-card-accent.accent-1 { background: var(--blue); }
.group-card-accent.accent-2 { background: var(--amber); }
.group-card-accent.accent-3 { background: #b39cff; }

.group-card-top,
.group-card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.group-avatar {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(93, 214, 192, 0.22);
  border-radius: 16px;
  color: #a7f3e4;
  background: rgba(93, 214, 192, 0.09);
  font-size: 13px;
  font-weight: 820;
}

.currency-pill {
  padding: 5px 8px;
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.045);
  font-size: 9px;
  font-weight: 780;
  letter-spacing: 0.08em;
}

.group-card-copy {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 31px 0 28px;
}

.group-card-copy strong { font-size: 22px; letter-spacing: -0.04em; }
.group-card-copy small { color: var(--muted); font-size: 11px; }
.group-card-bottom { margin-top: auto; }

.avatar-stack { display: flex; }

.avatar-stack i {
  width: 29px;
  height: 29px;
  display: grid;
  margin-left: -6px;
  place-items: center;
  border: 2px solid var(--surface);
  border-radius: 999px;
  color: #cbd5e1;
  background: var(--surface-3);
  font-size: 8px;
  font-style: normal;
  font-weight: 800;
}

.avatar-stack i:first-child { margin-left: 0; }
.open-group { color: var(--muted); font-size: 11px; font-weight: 700; }
.open-group i { color: var(--accent); font-style: normal; }

.dashboard-hero {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 34px;
}

.dashboard-metrics {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 24px;
}

.metric-card {
  min-height: 139px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 23px 25px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(17, 31, 49, 0.66);
}

.metric-card > span,
.metric-card small { color: var(--muted); font-size: 10px; }
.metric-card strong { margin: 11px 0 5px; font-size: clamp(23px, 3vw, 32px); letter-spacing: -0.055em; }
.metric-accent { border-color: rgba(93, 214, 192, 0.25); background: linear-gradient(145deg, rgba(93, 214, 192, 0.11), rgba(17, 31, 49, 0.7)); }
.pos { color: var(--green) !important; }
.neg { color: var(--red) !important; }

/* Friendly nudge shown to a group owner who is not (yet) a member. */
.link-self-banner {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 24px;
  padding: 18px 22px;
  border: 1px solid rgba(93, 214, 192, 0.25);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(93, 214, 192, 0.08), rgba(17, 31, 49, 0.66));
}
.link-self-copy { min-width: 0; }
.link-self-copy strong { display: block; font-size: 14px; letter-spacing: -0.02em; }
.link-self-copy p { margin-top: 5px; max-width: 46ch; color: var(--muted); font-size: 11px; line-height: 1.6; }
.link-self-banner .btn { flex: none; }

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(270px, 0.75fr);
  align-items: start;
  gap: 18px;
  margin-top: 18px;
}

.dashboard-main,
.dashboard-side { display: grid; gap: 18px; }

.panel {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(17, 31, 49, 0.76);
  box-shadow: 0 18px 58px rgba(0, 0, 0, 0.12);
}

.balance-list,
.settlement-list,
.expense-list,
.member-list,
.payment-list { padding: 0 26px 11px; }

.balance-row,
.settlement-row,
.expense-row,
.member-row,
.payment-row {
  min-height: 69px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-top: 1px solid var(--border);
}

.person-avatar {
  width: 37px;
  height: 37px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #b7ece2;
  background: rgba(93, 214, 192, 0.09);
  font-size: 9px;
  font-weight: 820;
}

.balance-person,
.settlement-route > div,
.feed-meta,
.member-row > div,
.payment-row > div {
  min-width: 0;
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 4px;
}

.balance-person strong,
.settlement-route strong,
.feed-meta strong,
.member-row strong,
.payment-row strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }

.balance-person small,
.settlement-route small,
.feed-meta small,
.member-row small,
.payment-row small { overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }

.balance-amount,
.settlement-amount,
.expense-amount strong,
.payment-row b { flex: none; font-size: 12px; font-weight: 780; }

.settlement-row { gap: 18px; }
.settlement-route { min-width: 0; display: flex; flex: 1; align-items: center; gap: 12px; }

.settled-state,
.panel-empty {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 26px 24px;
  padding: 18px;
  border: 1px dashed var(--border-strong);
  border-radius: 15px;
  color: var(--muted);
}

.settled-state > span,
.panel-empty > span {
  width: 38px;
  height: 38px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: var(--green);
  background: rgba(102, 214, 154, 0.09);
  font-weight: 800;
}

.settled-state strong,
.panel-empty strong { color: var(--text); font-size: 12px; }
.settled-state p,
.panel-empty p { margin-top: 4px; font-size: 10px; }

.expense-row { min-height: 76px; }
button.expense-row {
  width: 100%;
  border-right: 0;
  border-bottom: 0;
  border-left: 0;
  color: inherit;
  text-align: left;
  background: transparent;
  cursor: pointer;
}
button.expense-row:hover { background: rgba(255, 255, 255, 0.025); }
.feed-icon { width: 39px; height: 39px; flex: none; display: grid; place-items: center; border-radius: 12px; background: rgba(255, 255, 255, 0.05); font-size: 17px; }
.category-food, .category-groceries { background: rgba(243, 189, 105, 0.1); }
.category-rent { background: rgba(91, 184, 255, 0.1); }
.category-utilities { background: rgba(179, 156, 255, 0.1); }
.category-travel { background: rgba(93, 214, 192, 0.1); }
.expense-amount { display: flex; flex: none; flex-direction: column; align-items: end; gap: 4px; }
.expense-amount small { color: var(--muted); font-size: 8px; }

.compact-heading { padding-bottom: 14px; }
.member-list { padding-bottom: 6px; }
.member-row { min-height: 61px; }
.you-pill { flex: none; padding: 4px 7px; border-radius: 999px; color: var(--accent); background: rgba(93, 214, 192, 0.09); font-size: 8px; font-weight: 800; }
.members-panel > .btn { width: calc(100% - 52px); margin: 12px 26px 24px; }

.member-invite-note {
  margin: 22px 0 18px;
  padding: 16px;
  border: 1px solid rgba(93, 214, 192, 0.22);
  border-radius: 14px;
  background: rgba(93, 214, 192, 0.07);
}

.member-invite-note strong { font-size: 12px; }
.member-invite-note p { margin-top: 6px; color: var(--muted); font-size: 11px; line-height: 1.55; }
.member-invite-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.member-invite-actions.single { grid-template-columns: 1fr; }

.contribution-list {
  margin: 8px 26px 24px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.contribution-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 0;
  color: var(--muted);
  font-size: 11px;
}
.contribution-row strong { color: var(--text); font-size: 11px; }

.household-warning {
  margin-bottom: 18px;
  padding: 15px;
  border: 1px solid rgba(255, 184, 77, 0.3);
  border-radius: 14px;
  background: rgba(255, 184, 77, 0.08);
}
.household-warning strong { color: var(--amber); font-size: 12px; }
.household-warning p { margin-top: 5px; color: var(--muted); font-size: 10px; line-height: 1.55; }
.household-config-grid { display: grid; gap: 12px; margin-bottom: 12px; }
.household-config-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface-2);
}
.household-config-card .field + .field { margin-top: 10px; }
.household-config-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.household-config-heading strong { font-size: 11px; }
.household-assignments { margin-top: 18px; }
.household-member-assignment {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(130px, 0.8fr);
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.household-member-assignment > div { display: flex; min-width: 0; align-items: center; gap: 10px; }
.household-member-assignment span { display: flex; min-width: 0; flex-direction: column; }
.household-member-assignment strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.household-member-assignment small { color: var(--muted); font-size: 9px; }
.household-member-assignment select { min-width: 0; }

@media (max-width: 520px) {
  .household-member-assignment { grid-template-columns: 1fr; }
  .contribution-list { margin-inline: 19px; }
}

.payment-row { min-height: 62px; }
.payment-row > span { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 9px; color: var(--green); background: rgba(102, 214, 154, 0.08); font-size: 10px; }
.payment-row > span.forgiven-payment-icon { font-size: 16px; }
.payment-row b { font-size: 10px; }

.empty-state,
.loading-state {
  width: min(560px, calc(100% - 36px));
  min-height: 380px;
  display: flex;
  margin: 80px auto;
  padding: 42px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
  background: rgba(17, 31, 49, 0.7);
}

.empty-groups { width: 100%; min-height: 330px; margin: 48px 0 0; }
.empty-icon { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 17px; color: var(--accent); background: rgba(93, 214, 192, 0.09); font-size: 24px; }
.empty-state h3 { margin-top: 20px; font-size: 24px; letter-spacing: -0.04em; }
.empty-state p { max-width: 390px; margin-top: 10px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.empty-state .btn { margin-top: 24px; }
.error-state .empty-icon { color: var(--red); background: rgba(255, 140, 145, 0.08); }

.loading-state { border: 0; background: transparent; }
.loading-state p { margin-top: 17px; color: var(--muted); font-size: 11px; }
.loading-mark { display: flex; gap: 4px; align-items: end; }
.loading-mark i { width: 5px; border-radius: 999px; background: var(--accent); animation: loading-bars 800ms ease-in-out infinite alternate; }
.loading-mark i:nth-child(1) { height: 9px; }
.loading-mark i:nth-child(2) { height: 20px; animation-delay: 140ms; }
.loading-mark i:nth-child(3) { height: 14px; animation-delay: 280ms; }

/* Sheets and forms */
.sheet-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(2, 8, 17, 0.72);
  backdrop-filter: blur(6px);
}

.sheet {
  position: fixed;
  z-index: 51;
  left: 50%;
  bottom: 0;
  width: min(680px, calc(100% - 24px));
  max-height: min(88dvh, 820px);
  overflow-y: auto;
  padding: 0 30px calc(28px + var(--safe-bottom));
  border: 1px solid var(--border-strong);
  border-bottom: 0;
  border-radius: 26px 26px 0 0;
  background: #101e30;
  box-shadow: 0 -30px 100px rgba(0, 0, 0, 0.38);
  transform: translateX(-50%);
}

.sheet-handle { width: 38px; height: 4px; margin: 11px auto 27px; border-radius: 999px; background: var(--surface-3); }
.sheet-header { margin-bottom: 28px; }
.sheet-header h2 { margin-top: 8px; font-size: 29px; letter-spacing: -0.045em; }
.sheet-header > p:last-child { margin-top: 8px; color: var(--muted); font-size: 12px; line-height: 1.55; }

.form-grid { display: grid; gap: 0 13px; }
.form-grid-2 { grid-template-columns: 1fr 1fr; }
.field-wide { grid-column: 1 / -1; }
.field { margin-bottom: 16px; }
.field label { display: flex; justify-content: space-between; margin-bottom: 7px; color: #c1ccda; font-size: 10px; font-weight: 690; }
.field label span { color: var(--muted); font-weight: 500; }
.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 47px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 11px 13px;
  color: var(--text);
  background: var(--bg-soft);
  font-size: 14px;
}

.field textarea { resize: vertical; line-height: 1.45; }
.field input::placeholder,
.field textarea::placeholder { color: #56677d; }
.field input:disabled { opacity: 0.45; }

.participants-field {
  overflow: hidden;
  margin: 3px 0 17px;
  padding: 0 17px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: rgba(8, 17, 31, 0.42);
}

.participants-heading { padding: 15px 0 12px; }
.participants-heading > div { display: flex; flex-direction: column; gap: 3px; }
.participants-heading strong { font-size: 11px; }
.participants-heading span { color: var(--muted); font-size: 9px; }

.split-participant {
  display: grid;
  grid-template-columns: 19px minmax(0, 1fr) 100px;
  align-items: center;
  gap: 10px;
  min-height: 57px;
  border-top: 1px solid var(--border);
}

.split-participant .participant-check { width: 17px; height: 17px; accent-color: var(--accent-strong); }
.split-participant .name { min-width: 0; display: flex; align-items: center; gap: 9px; color: var(--text); font-size: 11px; }
.split-participant .name .person-avatar { width: 29px; height: 29px; border-radius: 9px; font-size: 8px; }
.split-participant input[data-val] { width: 100%; min-height: 36px; padding: 7px 9px; border: 1px solid var(--border); border-radius: 9px; color: var(--text); background: var(--bg-soft); font-size: 12px; }

.payment-route-card {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 17px;
  margin-bottom: 22px;
  padding: 17px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: rgba(8, 17, 31, 0.5);
}

.payment-route-card > div { min-width: 0; display: flex; align-items: center; gap: 10px; }
.payment-route-card > div:last-child { flex-direction: row-reverse; text-align: right; }
.payment-route-card span { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.payment-route-card small { color: var(--muted); font-size: 8px; text-transform: uppercase; }
.payment-route-card strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.payment-route-card > b { color: var(--accent); }

.sheet-actions { display: grid; grid-template-columns: 0.75fr 1.25fr; gap: 9px; margin-top: 7px; }
.expense-delete-trigger { width: 100%; margin-top: 9px; }
.error-msg { min-height: 0; margin: 0 0 9px; color: var(--red); font-size: 11px; line-height: 1.5; }

.toast {
  position: fixed;
  z-index: 60;
  left: 50%;
  bottom: calc(26px + var(--safe-bottom));
  min-width: 190px;
  padding: 12px 17px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  color: var(--text);
  text-align: center;
  background: #1a2b40;
  box-shadow: var(--shadow);
  font-size: 11px;
  transform: translateX(-50%);
}

.empty {
  width: min(540px, calc(100% - 36px));
  margin: 70px auto;
  padding: 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
  line-height: 1.6;
  background: var(--surface);
}

.join-choice-page {
  min-height: calc(100dvh - 78px);
  display: grid;
  place-items: center;
  padding: 44px 20px calc(54px + var(--safe-bottom));
}

.join-choice-card {
  width: min(560px, 100%);
  padding: clamp(25px, 5vw, 42px);
  border: 1px solid var(--border);
  border-radius: 24px;
  background:
    radial-gradient(circle at top right, rgba(93, 214, 192, 0.1), transparent 42%),
    var(--surface);
  box-shadow: var(--shadow);
}

.join-choice-card h2 {
  margin-top: 9px;
  font-size: clamp(28px, 5vw, 38px);
  letter-spacing: -0.05em;
}

.join-choice-copy {
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.join-options {
  display: grid;
  gap: 9px;
  margin: 25px 0 17px;
  padding: 0;
  border: 0;
}

.join-options legend {
  margin-bottom: 8px;
  color: #c1ccda;
  font-size: 10px;
  font-weight: 700;
}

.join-option {
  position: relative;
  min-height: 66px;
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: rgba(8, 17, 31, 0.45);
  cursor: pointer;
}

.join-option:has(input:checked) {
  border-color: rgba(93, 214, 192, 0.52);
  background: rgba(93, 214, 192, 0.08);
}

.join-option input {
  width: 17px;
  height: 17px;
  accent-color: var(--accent-strong);
}

.join-option .person-avatar {
  width: 37px;
  height: 37px;
  border-radius: 11px;
  font-size: 9px;
}

.join-option > span {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.join-option strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.join-option-title {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.join-option-title strong { min-width: 0; }

.join-option-title em {
  flex: none;
  padding: 3px 6px;
  border: 1px solid rgba(93, 214, 192, 0.28);
  border-radius: 999px;
  color: var(--accent);
  background: rgba(93, 214, 192, 0.08);
  font-size: 8px;
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.join-option small { color: var(--muted); font-size: 9px; }

.join-option > i {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--surface-3);
}

.join-option:has(input:checked) > i {
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(93, 214, 192, 0.12);
}

.join-choice-note {
  margin-top: 15px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.5;
  text-align: center;
}

.join-choice-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.join-choice-actions > :only-child { grid-column: 1 / -1; }

@media (hover: hover) {
  .group-card:hover { border-color: rgba(93, 214, 192, 0.3); box-shadow: 0 24px 70px rgba(0, 0, 0, 0.24); transform: translateY(-3px); }
  .btn:hover, .header-action:hover { filter: brightness(1.06); transform: translateY(-1px); }
  .icon-btn:hover, .account-action:hover { border-color: var(--border-strong); }
}

@media (max-width: 900px) {
  .group-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .dashboard-side { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .payments-panel { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
  .app-header { padding-inline: 16px; }
  .app-header-inner { min-height: 65px; gap: 9px; }
  .app-brand-mark { width: 29px; height: 29px; }
  .app-heading { gap: 8px; }
  .app-heading h1 { font-size: 16px; }
  .header-tools { gap: 7px; }
  .account-action { min-height: 38px; grid-template-columns: 28px auto; grid-template-rows: 1fr; padding: 4px 8px 4px 4px; }
  .account-action > span { grid-row: auto; width: 28px; height: 28px; }
  .account-action b { display: none; }
  .account-action i { display: block; font-size: 8px; }
  .header-action { min-height: 38px; padding-inline: 11px; }
  .header-action b { display: none; }
  .notif-btn { min-height: 38px; padding-inline: 11px; }
  .notif-btn b { display: none; }
  .icon-btn { width: 37px; height: 37px; }

  .groups-page,
  .group-page { width: calc(100% - 32px); padding: 40px 0 calc(72px + var(--safe-bottom)); }
  .page-intro,
  .dashboard-hero { display: block; }
  .page-intro h2,
  .dashboard-title h2 { font-size: clamp(40px, 13vw, 58px); }
  .page-intro-copy { margin-top: 16px; }
  .intro-action,
  .dashboard-add { width: 100%; justify-content: center; margin-top: 24px; }

  .overview-strip { grid-template-columns: 1fr 1fr; margin-top: 34px; }
  .overview-strip > div { padding: 18px; }
  .overview-strip > div + div { border-left: 1px solid var(--border); }
  .overview-strip > div:nth-child(3) { grid-column: 1 / -1; border-top: 1px solid var(--border); border-left: 0; }
  .overview-strip strong { font-size: 20px; }
  .groups-heading { margin-top: 38px; }
  .group-grid { grid-template-columns: 1fr; }
  .group-card { min-height: 205px; padding: 21px; }
  .group-card-copy { margin: 25px 0 22px; }

  .dashboard-metrics { display: flex; overflow-x: auto; margin: 31px -16px 0; padding: 0 16px 5px; scroll-snap-type: x mandatory; scrollbar-width: none; }
  .dashboard-metrics::-webkit-scrollbar { display: none; }
  .metric-card { min-width: min(76vw, 270px); min-height: 127px; scroll-snap-align: start; }
  .dashboard-grid { margin-top: 13px; }
  .dashboard-side { grid-template-columns: 1fr; }
  .payments-panel { grid-column: auto; }

  .section-heading { padding: 21px 19px 15px; }
  .balance-list,
  .settlement-list,
  .expense-list,
  .member-list,
  .payment-list { padding-inline: 19px; }
  .settlement-row { flex-wrap: wrap; padding: 12px 0; }
  .settlement-route { flex-basis: calc(100% - 88px); }
  .settlement-row .btn { margin-left: 49px; }
  .feed-meta small { max-width: 180px; }
  .members-panel > .btn { width: calc(100% - 38px); margin-inline: 19px; }
  .settled-state, .panel-empty { margin-inline: 19px; }

  .sheet { width: 100%; max-height: 92dvh; padding-inline: 19px; border-right: 0; border-left: 0; }
  .sheet-header h2 { font-size: 25px; }
  .form-grid-2 { grid-template-columns: 1fr; }
  .field-wide { grid-column: auto; }
  .payment-route-card { gap: 9px; padding: 14px 11px; }
  .payment-route-card .person-avatar { display: none; }
}

@media (max-width: 380px) {
  .app-brand-mark { display: none; }
  .groups-page, .group-page { width: calc(100% - 24px); }
  .expense-row { gap: 9px; }
  .feed-meta small { max-width: 132px; }
  .expense-amount strong { font-size: 11px; }
  .split-participant { grid-template-columns: 18px minmax(0, 1fr) 80px; }
}

@media (prefers-reduced-motion: no-preference) {
  .groups-page,
  .group-page { animation: page-enter 360ms ease both; }
  .sheet { animation: sheet-enter 240ms ease both; }
}

@keyframes page-enter {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes sheet-enter {
  from { opacity: 0; transform: translate(-50%, 18px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

@keyframes loading-bars {
  from { opacity: 0.35; transform: scaleY(0.6); }
  to { opacity: 1; transform: scaleY(1); }
}

/* Guest welcome screen */
#app.guest-shell {
  max-width: none;
}

.guest-shell .view {
  padding: 0;
}

.welcome {
  position: relative;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(circle at 14% 16%, rgba(56, 189, 248, 0.12), transparent 29%),
    linear-gradient(135deg, #07111f 0%, #0f172a 54%, #111827 100%);
}

.welcome::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  opacity: 0.18;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.12) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to right, #000, transparent 72%);
}

.welcome-glow {
  position: absolute;
  z-index: -1;
  border-radius: 999px;
  filter: blur(2px);
  pointer-events: none;
}

.welcome-glow-one {
  width: 380px;
  height: 380px;
  left: -190px;
  bottom: -170px;
  background: rgba(74, 222, 128, 0.12);
}

.welcome-glow-two {
  width: 260px;
  height: 260px;
  left: 52%;
  top: -170px;
  background: rgba(56, 189, 248, 0.14);
}

.welcome-content {
  width: min(760px, 100%);
  min-height: 100%;
  justify-self: end;
  display: flex;
  flex-direction: column;
  padding: 42px clamp(32px, 6vw, 96px) 56px;
}

.welcome-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: #f8fafc;
  font-size: 23px;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.welcome-brand-mark {
  width: 31px;
  height: 31px;
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 3px;
  padding: 7px 6px;
  border-radius: 10px;
  color: #07111f;
  background: var(--accent);
  box-shadow: 0 8px 30px rgba(56, 189, 248, 0.2);
}

.welcome-brand-mark i {
  width: 4px;
  border-radius: 999px;
  background: currentColor;
}

.welcome-brand-mark i:nth-child(1) { height: 7px; }
.welcome-brand-mark i:nth-child(2) { height: 15px; }
.welcome-brand-mark i:nth-child(3) { height: 11px; }

.welcome-copy {
  margin: auto 0 42px;
}

.welcome-kicker,
.welcome-auth-kicker {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.welcome-copy h1 {
  max-width: 700px;
  margin-top: 18px;
  font-size: clamp(48px, 6vw, 88px);
  line-height: 0.98;
  letter-spacing: -0.065em;
}

.welcome-copy h1 em {
  color: var(--accent);
  font-style: normal;
}

.welcome-lede {
  max-width: 570px;
  margin-top: 24px;
  color: #b7c3d4;
  font-size: clamp(16px, 1.6vw, 19px);
  line-height: 1.65;
}

.welcome-points {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin-top: 26px;
  color: #dbe5ef;
  font-size: 13px;
  font-weight: 650;
}

.welcome-points span::before {
  content: "✓";
  display: inline-grid;
  width: 18px;
  height: 18px;
  margin-right: 7px;
  place-items: center;
  border-radius: 999px;
  color: #052e1a;
  background: var(--green);
  font-size: 11px;
  font-weight: 900;
}

.welcome-preview {
  width: min(480px, 100%);
  padding: 18px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 20px;
  background: rgba(30, 41, 59, 0.68);
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(14px);
}

.preview-topline,
.preview-expense,
.preview-balance {
  display: flex;
  align-items: center;
}

.preview-topline {
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
}

.preview-topline div,
.preview-expense div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.preview-label,
.preview-expense small {
  color: var(--muted);
  font-size: 11px;
}

.preview-topline strong,
.preview-expense strong {
  font-size: 14px;
}

.preview-people {
  flex: none;
  padding: 6px 9px;
  border-radius: 999px;
  color: #bae6fd;
  background: rgba(56, 189, 248, 0.1);
  font-size: 11px;
}

.preview-expense {
  gap: 11px;
  padding: 15px 0 12px;
}

.preview-expense b {
  margin-left: auto;
  font-size: 14px;
}

.preview-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: rgba(148, 163, 184, 0.1);
}

.preview-balance {
  justify-content: space-between;
  padding: 11px 13px;
  border-radius: 11px;
  color: #bbf7d0;
  background: rgba(74, 222, 128, 0.08);
  font-size: 12px;
}

.welcome-auth {
  display: grid;
  place-items: center;
  min-height: 100%;
  padding: 40px clamp(28px, 5vw, 80px);
  border-left: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(8, 15, 28, 0.58);
  backdrop-filter: blur(18px);
}

.welcome-auth-panel {
  width: min(420px, 100%);
}

.welcome-auth h2 {
  margin-top: 13px;
  font-size: clamp(32px, 3.4vw, 44px);
  line-height: 1.08;
  letter-spacing: -0.045em;
}

.welcome-auth-copy {
  margin: 14px 0 26px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
}

.welcome-auth-copy strong {
  color: var(--text);
  overflow-wrap: anywhere;
}

.welcome-field {
  margin-bottom: 10px;
}

.welcome-field label {
  color: #d3dce8;
  font-weight: 600;
}

.welcome-field input {
  min-height: 52px;
  border-color: #3a4960;
  background: rgba(15, 23, 42, 0.82);
}

.welcome-field input:focus {
  border-color: var(--accent);
  outline: 3px solid rgba(56, 189, 248, 0.12);
}

.welcome-dev {
  margin-top: 10px;
}

.welcome-security {
  margin-top: 20px;
  color: #718096;
  font-size: 11px;
  line-height: 1.5;
  text-align: center;
}

.welcome-invite {
  margin-bottom: 22px;
  padding: 12px 14px;
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: 12px;
  color: #cbd5e1;
  background: rgba(56, 189, 248, 0.07);
  font-size: 12px;
  line-height: 1.45;
}

.welcome-invite span {
  display: block;
  color: #7dd3fc;
  font-weight: 750;
}

.welcome-dev-login { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border); }
.welcome-auth-error { margin: 16px 0; text-align: center; }

@media (max-width: 820px) {
  .welcome {
    display: block;
  }

  .welcome-content {
    width: 100%;
    min-height: auto;
    padding: 28px 22px 30px;
  }

  .welcome-copy {
    margin: 66px 0 30px;
  }

  .welcome-copy h1 {
    font-size: clamp(43px, 13vw, 68px);
  }

  .welcome-lede {
    margin-top: 20px;
    font-size: 16px;
  }

  .welcome-preview {
    display: none;
  }

  .welcome-auth {
    min-height: auto;
    padding: 38px 22px calc(46px + var(--safe-bottom));
    border-top: 1px solid rgba(148, 163, 184, 0.14);
    border-left: 0;
    background: rgba(8, 15, 28, 0.76);
  }

  .welcome-auth-panel {
    width: min(480px, 100%);
  }
}

@media (max-width: 420px) {
  .welcome-copy {
    margin-top: 50px;
  }

  .welcome-copy h1 {
    font-size: 42px;
  }

  .welcome-points {
    display: grid;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .welcome-brand,
  .welcome-copy,
  .welcome-preview,
  .welcome-auth-panel {
    animation: welcome-rise 520ms ease both;
  }

  .welcome-copy { animation-delay: 70ms; }
  .welcome-preview { animation-delay: 140ms; }
  .welcome-auth-panel { animation-delay: 120ms; }
}

@keyframes welcome-rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Google sign-in button on the welcome screen */
.welcome-google {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-decoration: none;
  color: #e8edf4;
  background: rgba(23, 40, 61, 0.85);
  border: 1px solid var(--border);
}

.welcome-google-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  color: #4285f4;
  font-weight: 800;
  font-size: 13px;
  font-family: system-ui, sans-serif;
}


/* Disband group (danger zone) */
.disband-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 22px 26px 24px;
  border-color: rgba(255, 140, 145, 0.18);
  background: rgba(255, 140, 145, 0.04);
}
.disband-copy h3 { margin-top: 6px; font-size: 18px; letter-spacing: -0.035em; }
.disband-copy p { margin-top: 10px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.disband-panel .btn { width: 100%; }

.btn-danger {
  color: #2a0d0f;
  background: var(--red);
  border-color: transparent;
}
.btn-danger-ghost {
  color: var(--red);
  border-color: rgba(255, 140, 145, 0.28);
  background: rgba(255, 140, 145, 0.08);
}

.disband-warning {
  padding: 16px 18px;
  border: 1px solid rgba(255, 140, 145, 0.2);
  border-radius: 14px;
  background: rgba(255, 140, 145, 0.06);
  color: var(--text);
  font-size: 13px;
  line-height: 1.65;
}
.disband-warning strong { color: #ffd3d5; }
.disband-amount { color: var(--red); font-weight: 700; }

@media (max-width: 720px) {
  .disband-panel { padding: 20px 19px 22px; }
}

/* Terminal settlement lifecycle */
.archived-heading { margin-top: 54px; }
.archived-card {
  min-height: 190px;
  filter: saturate(0.45);
  background: rgba(17, 31, 49, 0.48);
}

.lifecycle-banner {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 17px;
  border: 1px solid rgba(243, 189, 105, 0.24);
  border-radius: 14px;
  background: rgba(243, 189, 105, 0.07);
}
.lifecycle-banner strong {
  flex: none;
  color: var(--amber);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.lifecycle-banner span { color: #c7d1de; font-size: 11px; line-height: 1.45; }
.lifecycle-archived {
  border-color: var(--border);
  background: rgba(148, 163, 184, 0.06);
}
.lifecycle-archived strong { color: var(--muted); }

.settlement-heading { padding-bottom: 16px; }
.settle-all-action {
  display: flex;
  align-items: center;
  gap: 13px;
  margin: 0 26px 10px;
  padding: 14px;
  border: 1px solid rgba(93, 214, 192, 0.18);
  border-radius: 13px;
  background: rgba(93, 214, 192, 0.055);
}
.settle-all-action small { color: var(--muted); font-size: 9px; line-height: 1.45; }

.settlement-callout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 0 26px 13px;
  padding: 15px;
  border: 1px solid rgba(243, 189, 105, 0.25);
  border-radius: 13px;
  background: rgba(243, 189, 105, 0.07);
}
.settlement-callout strong { color: var(--amber); font-size: 11px; }
.settlement-callout p { margin-top: 4px; color: var(--muted); font-size: 9px; line-height: 1.5; }

.obligation-list { padding: 0 26px 13px; }
.obligation-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px 20px;
  padding: 15px 0;
  border-top: 1px solid var(--border);
}
.obligation-state {
  display: flex;
  flex-direction: column;
  align-items: end;
  gap: 4px;
}
.obligation-state strong { font-size: 13px; }
.obligation-state span {
  padding: 4px 7px;
  border-radius: 999px;
  color: var(--amber);
  background: rgba(243, 189, 105, 0.08);
  font-size: 8px;
  font-weight: 760;
}
.status-readyToPay .obligation-state span { color: var(--accent); background: rgba(93, 214, 192, 0.09); }
.status-paymentRecorded .obligation-state span { color: var(--green); background: rgba(102, 214, 154, 0.08); }
.status-paymentRecorded { opacity: 0.72; }
.obligation-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  gap: 8px;
}
.obligation-actions .btn,
.payment-action-buttons .btn { text-decoration: none; }

.payme-button {
  width: 116px;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  background: #05f;
  box-shadow: 0 8px 22px rgba(0, 85, 255, 0.22);
  text-decoration: none;
  transition: background 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}
.payme-button img {
  width: 86px;
  height: auto;
  display: block;
}
.payme-button:hover {
  background: #0048d9;
  box-shadow: 0 10px 26px rgba(0, 85, 255, 0.3);
  transform: translateY(-1px);
}
.payme-button:active { transform: translateY(0); }
.payme-button:focus-visible {
  outline: 3px solid rgba(93, 214, 192, 0.42);
  outline-offset: 3px;
}

.archive-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 22px 26px 24px;
  border-color: rgba(102, 214, 154, 0.2);
  background: rgba(102, 214, 154, 0.045);
}
.archive-panel h3 { margin-top: 6px; font-size: 18px; letter-spacing: -0.035em; }
.archive-panel p { margin-top: 9px; color: var(--muted); font-size: 11px; line-height: 1.6; }

.terminal-warning {
  padding: 17px 19px;
  border: 1px solid rgba(243, 189, 105, 0.23);
  border-radius: 14px;
  background: rgba(243, 189, 105, 0.06);
  font-size: 12px;
  line-height: 1.6;
}
.terminal-warning strong { color: var(--amber); }
.terminal-warning ul { margin: 9px 0 0 18px; color: var(--muted); }
.terminal-warning li + li { margin-top: 5px; }
.frozen-amount {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  padding: 17px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(8, 17, 31, 0.5);
}
.frozen-amount span { color: var(--muted); font-size: 11px; }
.frozen-amount strong { color: var(--accent); font-size: 20px; }
.privacy-note { margin: -5px 0 18px; color: var(--muted); font-size: 10px; line-height: 1.55; }

.payment-action-list { display: grid; gap: 10px; }
.payment-action-row {
  display: grid;
  gap: 13px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(8, 17, 31, 0.45);
}
.payment-action-row > div:first-child {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 5px 12px;
}
.payment-action-row .eyebrow { grid-column: 1 / -1; }
.payment-action-row strong { font-size: 12px; }
.payment-action-row span { color: var(--accent); font-size: 14px; font-weight: 760; }
.payment-action-buttons { display: flex; flex-wrap: wrap; justify-content: end; gap: 8px; }

button.expense-row:disabled { color: inherit; cursor: default; opacity: 1; }

.welcome-legal,
.account-legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 16px;
}
.welcome-legal { margin-top: 15px; }
.welcome-legal a,
.account-legal a {
  color: var(--muted);
  font-size: 10px;
  text-underline-offset: 3px;
}
.welcome-legal a:hover,
.account-legal a:hover { color: var(--text); }

.account-menu,
.account-delete-confirm { display: grid; gap: 14px; }
.account-menu > p,
.account-delete-confirm > p {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.65;
}
.account-menu-action {
  display: grid;
  gap: 3px;
  width: 100%;
  padding: 16px 17px;
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.035);
  text-align: left;
}
.account-menu-action:hover { border-color: var(--border-strong); background: rgba(255, 255, 255, 0.06); }
.account-menu-action strong { font-size: 12px; }
.account-menu-action span { color: var(--muted); font-size: 10px; }
.account-legal {
  justify-content: flex-start;
  padding: 3px 2px 6px;
}
.account-delete { margin-top: -4px; }
.account-delete-confirm label { color: var(--muted); font-size: 10px; }
.account-delete-confirm label strong { color: var(--danger); letter-spacing: 0.08em; }
.account-reauth-note { font-size: 9px !important; }

@media (max-width: 720px) {
  .lifecycle-banner { align-items: flex-start; flex-direction: column; gap: 6px; }
  .settle-all-action,
  .settlement-callout { align-items: stretch; flex-direction: column; margin-right: 19px; margin-left: 19px; }
  .obligation-list { padding-right: 19px; padding-left: 19px; }
  .obligation-row { grid-template-columns: minmax(0, 1fr); }
  .obligation-state { align-items: flex-start; padding-left: 49px; }
  .obligation-actions { grid-column: 1; justify-content: stretch; padding-left: 49px; }
  .obligation-actions .btn { flex: 1 1 auto; }
  .obligation-actions .payme-button { flex: 0 0 116px; }
  .payment-action-buttons { display: grid; grid-template-columns: 1fr; }
  .payment-action-buttons .btn,
  .payment-action-buttons .payme-button { width: 100%; }
}
