:root {
  --ink: #171a20;
  --muted: #5c5e62;
  --line: #e5e5e5;
  --panel: #fff;
  --canvas: #f6f8fb;
  --nav: #171a20;
  --blue: #2f66f6;
  --mint: #dff7ed;
  --sky: #e7efff;
  --sun: #fff1d8;
  --shadow: 0 18px 46px rgba(22, 32, 44, 0.08);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; font-size: 15px; }
body { margin: 0; font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif; color: var(--ink); background: var(--canvas); line-height: 1.5; font-weight: 400; letter-spacing: -0.006em; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }
button, input, select { font: inherit; }
button { cursor: pointer; min-height: 44px; border: 1px solid var(--line); border-radius: 4px; padding: 11px 18px; background: #fff; color: var(--ink); font-weight: 600; }
a { color: inherit; text-decoration: none; }
.app { display: grid; grid-template-columns: 280px minmax(0, 1fr); grid-template-rows: auto 1fr; min-height: 100vh; }
.topbar {
  grid-column: 1 / -1;
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 9px clamp(14px, 3vw, 28px);
  background: #fff; border-bottom: 1px solid var(--line);
}
.topbar-brand { gap: 10px; }
.topbar-brand > span { width: 34px; height: 34px; border-radius: 7px; background: var(--nav); color: #fff; font-weight: 800; }
.topbar-brand strong { font-size: 1rem; font-weight: 700; letter-spacing: -0.01em; }
.topbar-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.topbar-actions button { min-height: 38px; padding: 8px 14px; }
.topbar-actions .account-chip { min-height: 38px; }
@media (max-width: 720px) {
  .topbar { flex-direction: column; align-items: stretch; gap: 10px; }
  .topbar-actions { justify-content: flex-start; }
}
.side { position: sticky; top: 57px; display: flex; flex-direction: column; gap: 26px; height: calc(100vh - 57px); padding: 24px; background: var(--nav); color: #fff; }
.brand { display: inline-flex; align-items: center; gap: 12px; }
.brand > span { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 8px; background: #fff; color: var(--nav); font-weight: 900; }
.brand strong, .brand small { display: block; }
.brand small, .note { color: rgba(255,255,255,.68); font-weight: 500; }
nav { display: grid; gap: 8px; }
nav a { padding: 12px 14px; border-radius: 4px; color: rgba(255,255,255,.78); font-weight: 500; letter-spacing: -0.005em; }
nav a:hover { background: rgba(255,255,255,.1); color: #fff; }
nav a.active { background: rgba(255,255,255,.16); color: #fff; font-weight: 600; }
.note { margin-top: auto; padding: 18px; border: 1px solid rgba(255,255,255,.14); border-radius: 8px; }
main { display: grid; gap: 22px; padding: 28px clamp(18px,4vw,42px) 42px; align-content: start; }
.view { display: grid; gap: 18px; align-content: start; }
.hero, .bank, .splitHead { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.hero h1 { max-width: 940px; margin: 0; font-size: clamp(2rem,4vw,4rem); line-height: 1.02; letter-spacing: 0; }
.eyebrow { margin: 0 0 8px; color: var(--blue); font-size: .76rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.actions, .bankAction { display: flex; gap: 10px; align-items: center; }
.primary { color: #fff; background: var(--blue); border-color: var(--blue); text-transform: uppercase; letter-spacing: .07em; font-size: .8rem; font-weight: 600; }
.dark { color: #fff; background: var(--nav); border-color: var(--nav); text-transform: uppercase; letter-spacing: .07em; font-size: .8rem; font-weight: 600; }
.metrics, .forms { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 14px; }
.forms { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; }
.metrics article, .card, .bank { border: 1px solid var(--line); border-radius: 8px; background: var(--panel); box-shadow: var(--shadow); }
.metrics article { min-height: 150px; padding: 20px; }
.metrics span, .metrics small, label, dt, .splitRows span { color: var(--muted); }
.metrics span, .metrics small { display: block; font-weight: 600; }
.metrics strong { display: block; margin: 10px 0 8px; font-size: clamp(1.3rem,2.1vw,1.7rem); line-height: 1.1; }
.metrics article:nth-child(1) { background: linear-gradient(180deg,#fff,var(--mint)); }
.metrics article:nth-child(2) { background: linear-gradient(180deg,#fff,#ffe9e5); }
.metrics article:nth-child(3) { background: linear-gradient(180deg,#fff,var(--sky)); }
.metrics article:nth-child(4) { background: linear-gradient(180deg,#fff,var(--sun)); }
.bank { padding: 20px; align-items: center; }
.bank h2, .card h2 { margin: 0 0 14px; font-size: 1.22rem; line-height: 1.2; }
.bank p { max-width: 780px; margin: 0; color: var(--muted); }
#bankState, .pill { display: inline-flex; padding: 7px 10px; border-radius: 999px; background: var(--mint); color: #0d5f41; font-size: .82rem; font-weight: 600; white-space: nowrap; }
.card { min-width: 0; padding: 20px; }
form { display: grid; gap: 14px; }
label { display: grid; gap: 7px; font-size: .82rem; font-weight: 600; }
input, select { width: 100%; min-height: 44px; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; color: var(--ink); background: #fff; outline: none; }
input:focus, select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(47,102,246,.13); }
textarea { width: 100%; min-height: 110px; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; color: var(--ink); background: #fff; outline: none; font: inherit; resize: vertical; }
textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(47,102,246,.13); }
.muted-note { margin: 0 0 4px; color: var(--muted); font-size: .9rem; }
.amt-pos { color: #16a34a; font-weight: 600; }
.amt-neg { color: #b94b46; font-weight: 600; }
.net-badge { display: flex; align-items: center; gap: 8px; }
.net-badge strong { font-size: 1.05rem; }
input[type="checkbox"], input[type="radio"] { width: auto; min-height: 0; }
.member-add { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 6px; }
.member-add input { flex: 1 1 160px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; background: var(--sky); color: var(--ink); font-size: .82rem; font-weight: 600; }
.chip button { background: none; border: none; min-height: 0; padding: 0; margin: 0; cursor: pointer; font-size: 1.05rem; line-height: 1; color: var(--muted); }
.split-checks { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 4px; }
.split-checks .check { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; font-size: .85rem; }
.group-card { padding: 6px 0 12px; border-top: 1px solid var(--line); }
.modal-overlay { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; background: rgba(23,26,32,.45); }
.modal-overlay[hidden] { display: none; }
.modal { width: min(460px, 100%); max-height: 90vh; overflow-y: auto; background: #fff; border-radius: 10px; padding: 22px; box-shadow: 0 24px 60px rgba(0,0,0,.28); }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.modal-head h2 { margin: 0; }
.modal-close { background: none; border: none; min-height: 0; padding: 0 4px; font-size: 1.5rem; line-height: 1; cursor: pointer; color: var(--muted); }
.row-del { background: none; border: none; min-height: 0; padding: 0 0 0 6px; cursor: pointer; color: var(--muted); font-size: 1rem; }
.export-menu { position: relative; flex: none; }
.export-btn { color: var(--blue); border-color: var(--blue); background: #fff; font-weight: 600; }
.export-options { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; display: grid; gap: 2px; min-width: 130px; padding: 6px; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 14px 34px rgba(0,0,0,.14); }
.export-options[hidden] { display: none; }
.export-options button { width: 100%; text-align: left; min-height: 36px; padding: 6px 10px; border: none; border-radius: 6px; background: none; color: var(--ink); font-weight: 500; text-transform: none; letter-spacing: normal; }
.export-options button:hover { background: #f4f4f4; }
.row { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.upload { min-height: 58px; align-items: center; justify-items: center; border: 1px dashed #a8b4c1; border-radius: 8px; background: #eef2f5; }
.upload input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.reports, .tables { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.list { display: grid; gap: 10px; }
.list div, .snapshot div { display: flex; justify-content: space-between; gap: 14px; padding: 11px 0; border-top: 1px solid var(--line); }
.snapshot { margin: 0; }
.snapshot dd { margin: 0; font-weight: 600; }
.table { padding: 0; overflow: hidden; }
.table h2 { padding: 20px 20px 0; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; overflow-x: auto; }
th, td { padding: 13px 20px; border-top: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { color: var(--muted); font-size: .72rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.empty { color: var(--muted); text-align: center; }
.splitRows { display: grid; gap: 10px; }
.splitRows article { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 15px; border: 1px solid var(--line); border-radius: 8px; background: #fbfcfd; }
.splitRows strong, .splitRows span { display: block; }
.toast { position: fixed; right: 18px; bottom: 18px; max-width: min(420px,calc(100vw - 36px)); padding: 12px 14px; border-radius: 4px; color: #fff; background: var(--nav); box-shadow: var(--shadow); opacity: 0; transform: translateY(10px); transition: 180ms ease; pointer-events: none; font-weight: 500; }
.toast.show { opacity: 1; transform: translateY(0); }
@media print {
  .side, .actions, .bank, .forms, .tables, .splitHead button, .toast { display: none; }
  .app { display: block; }
  main { padding: 0; }
  .metrics, .reports { grid-template-columns: repeat(2,1fr); }
  .card, .metrics article { box-shadow: none; break-inside: avoid; }
}
@media (max-width: 1180px) {
  .app { grid-template-columns: 1fr; }
  .side { position: static; height: auto; }
  nav { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .note { display: none; }
  .metrics, .forms, .reports, .tables { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 760px) {
  main { padding: 20px 14px 30px; }
  .hero, .bank, .splitHead, .splitRows article { flex-direction: column; align-items: stretch; }
  .actions, .bankAction { display: grid; grid-template-columns: 1fr; }
  .row, .metrics, .forms, .reports, .tables, nav { grid-template-columns: 1fr; }
  .side { padding: 18px; }
}

[hidden] { display: none !important; }
.auth-screen {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
  background: linear-gradient(180deg, #ffffff 0%, #f4f4f4 100%);
}
.auth-card {
  display: grid;
  gap: 16px;
  width: min(460px, 100%);
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}
.auth-brand { color: var(--ink); }
.auth-brand > span { background: var(--nav); color: #fff; }
.auth-card h1 { margin: 0 0 8px; font-size: clamp(1.8rem, 6vw, 2.7rem); font-weight: 600; line-height: 1.06; letter-spacing: -0.02em; }
.auth-card p { margin: 0; color: var(--muted); }
.auth-error { min-height: 22px; color: #b94b46 !important; font-weight: 600; }
.auth-error.success { color: #16734a !important; }
.oauth-options { display: grid; gap: 10px; }
.oauth-button {
  display: grid;
  grid-template-columns: 24px 1fr 24px;
  align-items: center;
  min-height: 46px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  color: #171a20;
  font-weight: 500;
  text-align: center;
}
.oauth-button:hover { border-color: #8a929c; background: #f7f7f7; }
.oauth-button span { font-size: 1.1rem; font-weight: 700; }
.auth-divider { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; color: var(--muted); font-size: .72rem; font-weight: 500; letter-spacing: .04em; text-transform: uppercase; }
.auth-divider::before, .auth-divider::after { content: ""; height: 1px; background: var(--line); }
.account-chip {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  color: var(--muted);
  font-size: .85rem;
  font-weight: 500;
}
/* When signed out (e.g. a Splits guest) the email is empty — don't render an
   empty bordered box. */
.account-chip:empty { display: none; }

.beta-pill {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  min-height: 20px;
  padding: 2px 9px;
  border: 1px solid #e8721c;
  border-radius: 999px;
  color: #e8721c;
  background: #fff;
  font-size: .66rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.beta-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 8px 14px;
  border: 1px solid #f0d29b;
  border-radius: 8px;
  background: var(--sun);
  color: #5d3a07;
  font-size: .88rem;
}
.beta-banner strong,
.beta-banner span { display: block; }
.beta-banner span { font-weight: 700; }
@media (max-width: 760px) {
  .beta-banner { flex-direction: column; align-items: flex-start; }
}

.legal-consent {
  margin: 0;
  color: var(--muted);
  font-size: .84rem;
  line-height: 1.45;
}
.legal-consent a,
.app-legal-links a,
.policy-page a { color: var(--blue); font-weight: 900; }
.app-legal-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 14px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 8px;
}
.app-legal-links a { color: rgba(255,255,255,.84); font-size: .84rem; }
.policy-body { background: #f6f8fb; }
.policy-page {
  width: min(920px, calc(100% - 32px));
  margin: 32px auto;
  padding: clamp(22px, 5vw, 44px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}
.policy-page h1 { margin: 18px 0 12px; font-size: clamp(2rem, 5vw, 3.5rem); line-height: 1.04; letter-spacing: 0; }
.policy-page h2 { margin-top: 28px; margin-bottom: 8px; font-size: 1.3rem; }
.policy-page p,
.policy-page li { color: var(--muted); }
.policy-page li { margin-bottom: 8px; }
.policy-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

/* Tesla-inspired visual direction: monochrome, spacious, restrained. */
:root {
  --ink: #171a20;
  --muted: #5c5e62;
  --line: #d0d1d2;
  --panel: #ffffff;
  --canvas: #ffffff;
  --nav: #171a20;
  --blue: #171a20;
  --mint: #f4f4f4;
  --sky: #f4f4f4;
  --sun: #f4f4f4;
  --shadow: none;
}

body {
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: #ffffff;
  line-height: 1.45;
}

button,
input,
select {
  font-family: Arial, Helvetica, sans-serif;
}

button {
  min-height: 40px;
  border-radius: 4px;
  border-color: #c8c9ca;
  background: rgba(244, 244, 244, 0.92);
  color: #171a20;
  font-size: .86rem;
  font-weight: 700;
  text-transform: none;
}

button:hover {
  background: #e7e7e7;
}

.primary,
.dark {
  color: #ffffff;
  background: rgba(23, 26, 32, 0.92);
  border-color: rgba(23, 26, 32, 0.92);
  box-shadow: none;
}

.primary:hover,
.dark:hover {
  background: #000000;
}

.app {
  background: #ffffff;
}

.side {
  background: rgba(255, 255, 255, 0.96);
  color: #171a20;
  border-right: 1px solid #e5e5e5;
}

.brand > span {
  background: #171a20;
  color: #ffffff;
  border-radius: 4px;
}

.brand small,
.note {
  color: #5c5e62;
}

nav a {
  color: #393c41;
  border-radius: 4px;
  font-size: .88rem;
}

nav a:hover {
  color: #171a20;
  background: #f4f4f4;
}

nav a.active {
  color: #171a20;
  background: #e7e9ee;
  font-weight: 600;
}

/* Topbar app-switch button (TallyMigo <-> Splits): styled as a switcher,
   not an action, and divided from the action buttons. */
.app-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 8px 14px;
  border: 1px solid var(--nav);
  border-radius: 4px;
  color: var(--nav);
  font-weight: 600;
  font-size: .88rem;
  text-decoration: none;
  white-space: nowrap;
}

.app-switch:hover {
  background: var(--nav);
  color: #fff;
}

.tb-divider {
  width: 1px;
  align-self: stretch;
  margin: 4px 2px;
  background: var(--line);
}

/* "Back to TallyMigo" link only appears in Splits-only mode. */
.nav-full {
  display: none;
}

/* Splits-only mode: show just the back-to-TallyMigo link in the sidebar
   (switching to Splits happens from the topbar switcher). */
body.splits-only nav a:not(.nav-full),
body.splits-only nav .nav-group,
body.splits-only nav .nav-sub,
body.splits-only #betaBanner,
html.is-splits nav a:not(.nav-full),
html.is-splits nav .nav-group,
html.is-splits nav .nav-sub,
html.is-splits #betaBanner {
  display: none;
}

/* Splits already has a "⇄ TallyMigo" switch in the topbar, so the sidebar
   back-link stays hidden and the print button is dropped on Splits. */
html.is-splits [data-print] { display: none; }

/* Land straight on Splits with no flash of the TallyMigo login/dashboard. The
   is-splits class is set on <html> before first paint (inline head script);
   Splits is guest-usable so we can reveal the app immediately. */
html.is-splits #authScreen { display: none !important; }
html.is-splits .app { display: grid !important; }
html.is-splits #view-dashboard { display: none !important; }
html.is-splits #view-shared { display: block !important; }

/* On mobile, put the sidebar (note + Privacy/Terms) BELOW the Splits content
   instead of stacking it on top. */
@media (max-width: 1180px) {
  html.is-splits main { order: 1; }
  html.is-splits .side { order: 2; }
}

.nav-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}

.nav-caret {
  font-size: .7rem;
  color: #8a8d92;
  transition: transform .15s ease;
}

.nav-group[aria-expanded="false"] .nav-caret {
  transform: rotate(-90deg);
}

.nav-sub {
  display: flex;
  flex-direction: column;
}

.nav-sub a {
  padding-left: 26px;
  font-size: .84rem;
  color: #5c5e62;
}

.nav-sub a::before {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #c7c9cf;
  margin-right: 10px;
  flex: none;
}

.nav-sub a {
  display: flex;
  align-items: center;
}

.nav-sub a.active::before {
  background: #171a20;
}

.charts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
  margin: 18px 0;
}

.chart-card {
  display: flex;
  flex-direction: column;
}

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

.seg {
  display: inline-flex;
  border: 1px solid #d7d9de;
  border-radius: 6px;
  overflow: hidden;
}

.seg button {
  border: 0;
  background: #fff;
  color: #5c5e62;
  padding: 5px 12px;
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
}

.seg button + button {
  border-left: 1px solid #d7d9de;
}

.seg button.on {
  background: #171a20;
  color: #fff;
}

.chart-body {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.chart-svg {
  width: 100%;
  height: auto;
  display: block;
}

.pie-wrap {
  flex: 0 0 170px;
}

.pie-svg {
  width: 170px;
  height: 170px;
  display: block;
}

.chart-svg .ax {
  font-size: 10px;
  fill: #8a8d92;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  font-size: .82rem;
  color: #393c41;
}

.legend-col {
  flex-direction: column;
  flex: 1 1 140px;
  gap: 6px;
}

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

.legend-item i {
  width: 11px;
  height: 11px;
  border-radius: 3px;
  flex: none;
  display: inline-block;
}

.note,
.app-legal-links {
  border-color: #e5e5e5;
  background: #fafafa;
}

.app-legal-links a {
  color: #393c41;
}

main {
  gap: 24px;
  padding-top: 30px;
}

.hero {
  min-height: 260px;
  align-items: center;
  padding: clamp(26px, 5vw, 56px);
  border: 1px solid #e5e5e5;
  border-radius: 4px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.78), rgba(255,255,255,.94)),
    linear-gradient(135deg, #f7f7f7, #ffffff 45%, #eeeeee);
}

.hero h1 {
  max-width: 720px;
  font-size: clamp(1.4rem, 2.3vw, 1.95rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.015em;
}

.eyebrow {
  color: #5c5e62;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.metrics article,
.card,
.bank,
.auth-card,
.policy-page {
  border-radius: 4px;
  border-color: #e5e5e5;
  box-shadow: none;
}

.metrics article {
  background: #ffffff !important;
  border-top: 3px solid #171a20;
}

.metrics span,
.metrics small,
label,
dt,
.splitRows span,
.policy-page p,
.policy-page li {
  color: #5c5e62;
}

.metrics strong {
  color: #171a20;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.bank {
  background: #f7f7f7;
}

#bankState,
.pill {
  border-radius: 4px;
  color: #171a20;
  background: #eeeeee;
}

.beta-banner {
  border-color: #171a20;
  border-radius: 4px;
  color: #ffffff;
  background: #171a20;
}

.forms,
.reports,
.tables {
  gap: 18px;
}

.card h2,
.bank h2,
.policy-page h2 {
  color: #171a20;
  font-weight: 600;
  letter-spacing: -0.01em;
}

input,
select {
  border-radius: 4px;
  border-color: #c8c9ca;
  background: #ffffff;
}

input:focus,
select:focus {
  border-color: #171a20;
  box-shadow: 0 0 0 2px rgba(23, 26, 32, .12);
}

/* ===== Wave-style split login screen ===== */
.auth-screen {
  display: grid;
  grid-template-columns: 1fr 1fr;
  place-items: stretch;
  height: 100vh;
  overflow: hidden;
  padding: 0;
  background: #ffffff;
}
.auth-marketing {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
  padding: clamp(28px, 6vw, 92px);
  background: #ffffff;
}
.auth-illustration { width: 124px; height: 124px; margin-bottom: 4px; }
.auth-illustration svg { width: 100%; height: 100%; }
.auth-headline {
  margin: 0;
  font-size: clamp(1.9rem, 3.4vw, 2.9rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.05;
  color: #171a20;
}
.auth-subhead { margin: 0; max-width: 430px; color: #5c5e62; font-size: 1.02rem; }
.auth-points { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 13px; }
.auth-points li { position: relative; padding-left: 30px; color: #2b2e33; font-weight: 500; }
.auth-points li::before {
  content: "\2713";
  position: absolute; left: 0; top: 1px;
  display: inline-grid; place-items: center;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: #e7f6ec; color: #16a34a;
  font-size: .72rem; font-weight: 800;
}
.auth-eyebrow { margin: 0 0 2px; font-size: .72rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: #2f66f6; }
.auth-trades { margin: 20px 0 0; font-size: .8rem; color: #8a8f98; font-weight: 600; line-height: 1.6; }
.auth-panel {
  display: grid;
  place-items: center;
  padding: clamp(16px, 3vw, 40px);
  background: #e9f1ff;
  overflow-y: auto;
}
.auth-card {
  width: min(400px, 100%);
  display: grid;
  gap: 10px;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.auth-brand { gap: 10px; margin-bottom: 2px; }
.auth-brand > span { background: var(--nav); color: #fff; }
.auth-brand small { color: #5c5e62; font-weight: 500; }
.auth-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0; }
.auth-card h1 { margin: 0; font-size: clamp(1.3rem, 2.2vw, 1.55rem); font-weight: 600; letter-spacing: -0.015em; line-height: 1.15; }
.auth-card label { gap: 5px; font-size: .8rem; font-weight: 600; color: #2b2e33; }
.auth-card input {
  min-height: 44px;
  border: 1px solid #c7d2e2;
  border-radius: 8px;
  background: #fff;
  padding: 10px 13px;
}
.auth-card input:focus { border-color: #2f66f6; box-shadow: 0 0 0 3px rgba(47,102,246,.18); }
.password-meta { display: flex; align-items: center; gap: 12px; margin-top: -4px; min-height: 20px; }
.password-meta button {
  background: none; border: none; padding: 0; min-height: 0;
  color: #2f66f6; font-size: .82rem; font-weight: 600; cursor: pointer;
  text-transform: none; letter-spacing: normal;
}
.password-meta button[hidden] { display: none; }
.password-meta .show-pass { margin-left: auto; }
.auth-card:has(#passwordField[hidden]) .password-meta { display: none; }
.auth-card .primary {
  min-height: 46px;
  border-radius: 999px;
  background: #2f66f6;
  border-color: #2f66f6;
  color: #fff;
  font-size: .92rem;
  font-weight: 700;
  text-transform: none;
  letter-spacing: normal;
  margin-top: 2px;
}
.auth-card .primary:hover { background: #2557e6; }
.auth-card .auth-divider {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px;
  color: #8a8f98; font-size: .82rem; font-weight: 500;
  text-transform: none; letter-spacing: normal; margin: 2px 0;
}
.auth-card .auth-divider::before, .auth-card .auth-divider::after { content: ""; height: 1px; background: #c7d2e2; }
.oauth-options { display: grid; gap: 10px; }
.auth-card .oauth-button {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 46px;
  border: 1px solid #c7d2e2;
  border-radius: 999px;
  background: #fff;
  color: #171a20;
  font-weight: 600;
  text-transform: none; letter-spacing: normal;
}
.auth-card .oauth-button:hover { background: #f5f8ff; border-color: #2f66f6; }
.g-mark { width: 20px; height: 20px; flex: none; }
.auth-card #authToggle {
  justify-self: center;
  background: none; border: none; min-height: 0; padding: 6px;
  color: #2f66f6; font-weight: 600;
  text-transform: none; letter-spacing: normal;
}
.auth-card .legal-consent { margin: 2px 0 0; font-size: .72rem; color: #8a8f98; }
.legal-note { margin: 8px 0 0; color: #8a8f98; font-size: .72rem; line-height: 1.45; }
.legal-note strong { color: #6b6f76; font-weight: 700; }
.legal-note a { color: var(--blue); }
.legal-draft { margin: 14px 0; padding: 12px 14px; border: 1px solid #e8b339; border-radius: 6px; background: #fff7e6; color: #7a5b12; font-size: .85rem; }
.legal-draft-tag { color: #b8860b; font-size: .7em; font-weight: 700; letter-spacing: .04em; vertical-align: middle; }
.auth-card .legal-consent a { color: #2f66f6; }
.auth-splits-cta {
  margin: 10px 0 0; padding-top: 12px; border-top: 1px solid var(--line);
  text-align: center; font-size: .85rem; color: var(--muted);
}
.auth-splits-cta a { color: #2f66f6; font-weight: 700; white-space: nowrap; }
@media (max-width: 860px) {
  .auth-screen { grid-template-columns: 1fr; }
  /* Keep the targeting message on phones, just compact it. */
  .auth-marketing { padding: 22px 22px 4px; gap: 8px; }
  .auth-illustration, .auth-points, .auth-trades { display: none; }
  .auth-headline { font-size: 1.5rem; }
  .auth-subhead { font-size: .92rem; }
  .auth-panel { min-height: auto; }
}

.upload {
  border-radius: 4px;
  background: #f7f7f7;
}

th {
  color: #5c5e62;
  letter-spacing: 0;
}

th,
td {
  border-color: #e5e5e5;
}

.splitRows article {
  border-radius: 4px;
  background: #ffffff;
}

.auth-screen {
  background: linear-gradient(180deg, #ffffff, #f4f4f4);
}

.auth-card h1,
.policy-page h1 {
  color: #171a20;
  font-weight: 700;
  letter-spacing: 0;
}

.auth-error {
  color: #b74134 !important;
}

.account-chip {
  border-radius: 4px;
  background: #ffffff;
}

.toast {
  border-radius: 4px;
  background: #171a20;
  box-shadow: none;
}

.policy-body {
  background: #ffffff;
}

.policy-links {
  border-color: #e5e5e5;
}

@media (max-width: 760px) {
  .hero {
    min-height: auto;
    padding: 24px;
  }
}

/* ---- Share a Splits group ---- */
.share-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}

.share-menu {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.share-menu a,
.share-menu button {
  min-height: 38px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
  font-weight: 600;
  font-size: .84rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.share-menu a:hover,
.share-menu button:hover {
  background: #f4f4f4;
}

#shareHint {
  flex-basis: 100%;
  word-break: break-all;
}

/* ---- Receipts ---- */
.methods {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.method-card {
  text-align: center;
  gap: 8px;
}

.method-card h3 {
  font-size: 1rem;
  font-weight: 700;
}

.method-icon {
  font-size: 1.8rem;
  line-height: 1;
}

.quickstart {
  cursor: pointer;
  font: inherit;
  color: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform .08s ease, box-shadow .12s ease, border-color .12s ease;
}

.quickstart:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(15, 23, 42, .1);
  border-color: #2f66f6;
}

.quickstart.active {
  border-color: #2f66f6;
  box-shadow: 0 0 0 2px rgba(47, 102, 246, .35);
}

.split-exp { padding: 8px 0; border-bottom: 1px solid #eef2fb; }
.split-exp:last-child { border-bottom: 0; }
.split-exp-main { display: flex; justify-content: space-between; gap: 12px; }
.split-receipt { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.split-receipt-meta { display: flex; flex-direction: column; gap: 2px; }
.split-thumb {
  display: inline-block; width: 46px; height: 46px; border-radius: 8px;
  overflow: hidden; background: #eef2fb; color: #2f66f6; font-size: .7rem;
  font-weight: 700; text-align: center; line-height: 46px; flex: 0 0 auto;
}
.split-thumb img { width: 46px; height: 46px; object-fit: cover; display: block; }
.split-capture { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; cursor: pointer; color: #2f66f6; font-size: .85rem; }
.split-capture:hover { text-decoration: underline; }
.mini-link { font-size: .8rem; color: #2f66f6; }

/* Import upsell banner (shown to free users). */
.tx-promo {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; border-radius: 10px; background: #fdeede; color: #7a4a12;
  font-size: .9rem; font-weight: 500;
}
.tx-promo-btn {
  flex: 0 0 auto; background: #f59e0b; color: #fff; border: 0; border-radius: 8px;
  padding: 8px 14px; font-weight: 700; cursor: pointer;
}
.tx-promo-btn:hover { background: #d9860a; }

/* Transactions toolbar: select-all, bulk delete, search. */
.tx-toolbar { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; flex-wrap: wrap; }
.tx-selall { display: flex; align-items: center; gap: 7px; font-size: .85rem; font-weight: 600; color: var(--muted); }
.tx-tool-sel { min-height: 40px; width: auto; max-width: 200px; }
.tx-search { margin-left: auto; flex: 0 1 240px; min-height: 40px; }

/* Transactions: one row per transaction with aligned columns; scrolls
   horizontally on narrow screens so rows never wrap. */
.tx-list { display: flex; flex-direction: column; overflow-x: auto; }
.txr {
  display: grid;
  grid-template-columns: 34px 92px minmax(150px, 2fr) minmax(104px, 1.1fr) minmax(120px, 1.2fr) 104px 100px;
  align-items: center; gap: 14px; min-width: 740px;
  padding: 10px 8px; border-bottom: 1px solid var(--line); font-size: .9rem;
}
.txr:hover:not(.txr-head) { background: #f5f8fd; }
.txr > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.txr-head {
  font-size: .7rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase;
  color: var(--muted); border-bottom: 2px solid var(--line); position: sticky; top: 0; background: #fff; z-index: 1;
}
.txr-check { display: flex; align-items: center; overflow: visible; }
.txr-check input { width: 16px; height: 16px; min-height: 0; }
.txr-date { color: var(--muted); }
.txr-desc { font-weight: 600; }
.txr-cat { display: flex; align-items: center; gap: 8px; }
.cat-dot { flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%; }
.txr-amt { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.txr-rev { display: flex; gap: 6px; justify-content: flex-end; overflow: visible; }
.tx-act {
  width: 26px; height: 26px; border: 1px solid var(--line); border-radius: 7px;
  background: #fff; color: var(--muted); font-size: .85rem; line-height: 1; padding: 0;
  cursor: pointer; min-height: 0;
}
.tx-act:hover { background: #f1f5fb; color: var(--ink); }
.is-reviewed { background: #fafffb; }
.is-reviewed .tx-review { background: #dcfce7; border-color: #86efac; color: #166534; }

/* Compact the Transactions header + toolbar so more rows fit on screen. */
#view-transactions { gap: 10px; }
#view-transactions > .card { padding: 12px 16px; }
#view-transactions .eyebrow { margin: 0 0 1px; }
#view-transactions h2 { margin: 0; font-size: 1.12rem; }
#view-transactions .tx-toolbar { margin-bottom: 6px; }
#view-transactions .txr { padding: 8px; }

/* Cross-promo strip (Splits <-> TallyMigo). Slim, subtle, dismissible. */
.promo-strip {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 14px; border: 1px dashed var(--line); border-radius: 8px;
  background: var(--panel); font-size: .85rem;
}
.promo-strip a { color: var(--blue); font-weight: 500; }
.promo-strip a strong { font-weight: 700; }
.promo-close {
  background: none; border: 0; color: var(--muted); cursor: pointer;
  font-size: .95rem; line-height: 1; padding: 4px 6px; min-height: 0; flex: 0 0 auto;
}
.promo-close:hover { color: var(--ink); }

/* High-visibility variant: black background, white text. */
.promo-strip.promo-dark { background: #0f172a; border: 1px solid #0f172a; }
.promo-strip.promo-dark a { color: #fff; font-weight: 600; }
.promo-strip.promo-dark a strong { color: #fff; }
.promo-strip.promo-dark .promo-close { color: rgba(255,255,255,.72); }
.promo-strip.promo-dark .promo-close:hover { color: #fff; }

/* Splits: separate the "Done — Tally up" finalize action from the add-expense
   form so the two buttons don't look attached. */
#tripExpenseList:empty { display: none; }
#tripExpenseList:not(:empty) { margin-top: 12px; }
#view-shared .actions {
  margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line);
}
#view-shared .actions #submitTrip { width: 100%; justify-content: center; }

/* Settle up: per-debt pay button + payment-method modal. */
.settle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.settle-right { display: flex; align-items: center; gap: 10px; }
.settle-up-btn {
  padding: 6px 12px; border-radius: 999px; border: 1px solid var(--blue);
  background: var(--blue); color: #fff; font-size: .8rem; font-weight: 700; cursor: pointer; min-height: 0;
}
.settle-up-btn:hover { filter: brightness(.95); }
.settle-row.is-settled span:first-child { text-decoration: line-through; color: var(--muted); }
.settle-badge { padding: 4px 10px; border-radius: 999px; background: #dcfce7; color: #166534; font-size: .74rem; font-weight: 700; }
.settle-methods { display: flex; flex-direction: column; gap: 10px; margin: 6px 0 4px; }
.settle-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 16px; border-radius: 10px; border: 1px solid var(--line);
  font-size: 1rem; font-weight: 700; cursor: pointer; text-align: center; color: #fff;
}
.settle-btn.cash { background: #16a34a; border-color: #16a34a; }
.settle-btn.venmo { background: #3d95ce; border-color: #3d95ce; }
.settle-btn.paypal { background: #fff; border-color: #dfe3ea; color: #003087; }
.settle-btn.cashapp { background: #00c244; border-color: #00c244; }
.settle-btn.zelle { background: #6d1ed4; border-color: #6d1ed4; }

/* "How Splits works" guide — fills the sidebar in Splits mode only. */
.splits-guide { display: none; }
html.is-splits .splits-guide, body.splits-only .splits-guide { display: block; }
.splits-guide h3 { font-size: .95rem; margin: 0 0 14px; color: #fff; }
.splits-guide ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.splits-guide li { display: flex; gap: 11px; align-items: flex-start; color: rgba(255,255,255,.82); font-size: .85rem; line-height: 1.45; }
.splits-guide li span {
  flex: 0 0 auto; width: 22px; height: 22px; border-radius: 50%;
  background: rgba(255,255,255,.16); color: #fff; display: grid; place-items: center;
  font-size: .75rem; font-weight: 700;
}
.settle-btn:hover { filter: brightness(.96); }
.settle-fine { font-size: .74rem; line-height: 1.45; margin: 10px 0 0; }

/* On phones, keep the Splits quick-start options compact so they fit the first
   screen instead of forcing a long scroll. */
@media (max-width: 640px) {
  .methods { grid-template-columns: 1fr; gap: 8px; }
  .quickstart {
    flex-direction: row;
    align-items: center;
    text-align: left;
    padding: 10px 12px;
    gap: 10px;
  }
  .quickstart .method-icon { font-size: 1.3rem; }
  .quickstart h3 { font-size: .95rem; margin: 0; }
  .quickstart .muted-note { display: none; }
}

.pill.soon {
  background: #fff4e6;
  color: #b35309;
  font-size: .66rem;
  padding: 2px 7px;
  vertical-align: middle;
}

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 36px 20px;
  border: 2px dashed #c7c9cf;
  border-radius: 10px;
  text-align: center;
  transition: border-color .15s ease, background .15s ease;
}

.dropzone.drag {
  border-color: var(--nav);
  background: #f4f6fa;
}

.drop-title {
  font-weight: 700;
  font-size: 1.05rem;
}

.receipt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
}

.receipt-item {
  position: relative;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.receipt-thumb {
  display: block;
  height: 130px;
  background: #f4f4f4;
}

.receipt-thumb img {
  width: 100%;
  height: 130px;
  object-fit: cover;
  display: block;
}

.receipt-thumb.pdf {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  letter-spacing: .08em;
  color: #b3261e;
  background: #fdecea;
  text-decoration: none;
}

.receipt-item figcaption {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  font-size: .8rem;
}

.receipt-item figcaption span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 600;
}

.receipt-item figcaption small {
  color: #8a8d92;
}

.receipt-item .row-del {
  position: absolute;
  top: 6px;
  right: 6px;
  min-height: 0;
  width: 26px;
  height: 26px;
  padding: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .92);
  border: 1px solid var(--line);
  line-height: 1;
}
