/* Layout: single column, light header with hairline rules, five-tab bar at the bottom. One deep green accent, neutral greys, flat surfaces. */
:root {
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-display: var(--font-body);
  --bg: #F5F5F2;
  --surface: #FFFFFF;
  --surface2: #EFEFEB;
  --ink: #17191C;
  --muted: #5E646C;
  --line: #E0E0DA;
  --navy: #FFFFFF;
  --mint: #1D5C48;
  --btn: #1D5C48;
  --btn-ink: #FFFFFF;
  --link: #1D5C48;
  --ok: #1D6B4F; --ok-bg: #E6F1EC;
  --warn: #7A5410; --warn-bg: #F8F0DD;
  --bad: #A8322B; --bad-bg: #F8E6E4;
  --info: #2F5382; --info-bg: #E8EEF6;
  --neutral-bg: #EFEFEB;
  --focus: #2B6CD4;
  --radius: 10px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121315; --surface: #1A1C1F; --surface2: #23262A; --ink: #ECECE8; --muted: #9A9FA6; --line: #2E3237; --navy: #1A1C1F;
    --mint: #5FB894; --btn: #3E9C78; --btn-ink: #07140F; --link: #6CC4A0; --ok: #6CC4A0; --ok-bg: #16281F; --warn: #E2B968; --warn-bg: #2B2414; --bad: #F09890; --bad-bg: #321A19;
    --info: #96B7E3; --info-bg: #172335; --neutral-bg: #23262A; --focus: #7DAEF5; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121315; --surface: #1A1C1F; --surface2: #23262A; --ink: #ECECE8; --muted: #9A9FA6; --line: #2E3237; --navy: #1A1C1F;
  --mint: #5FB894; --btn: #3E9C78; --btn-ink: #07140F; --link: #6CC4A0; --ok: #6CC4A0; --ok-bg: #16281F; --warn: #E2B968; --warn-bg: #2B2414; --bad: #F09890; --bad-bg: #321A19;
  --info: #96B7E3; --info-bg: #172335; --neutral-bg: #23262A; --focus: #7DAEF5; color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 400 15px/1.5 var(--font-body); -webkit-text-size-adjust: 100%; font-feature-settings: "cv11", "ss01"; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); background: var(--surface); z-index: 40; }
h1, h2, h3 { font-family: var(--font-display); margin: 0; text-wrap: balance; letter-spacing: -0.012em; }
h1 { font-size: 24px; line-height: 1.2; font-weight: 650; }
h2 { font-size: 18px; font-weight: 620; }
h3 { font-size: 15px; font-weight: 620; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.in { width: 100%; max-width: 560px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.num { font-variant-numeric: tabular-nums; }
.wrapany { overflow-wrap: anywhere; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack-lg { display: flex; flex-direction: column; gap: 20px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.between { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.row2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }

/* header + tabs */
.hdr { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 30; background: var(--surface); color: var(--ink); border-bottom: 1px solid var(--line); }
.hdr .in { display: flex; align-items: center; gap: 12px; min-height: 56px; padding-block: 8px; }
.hdr .ttl { flex: 1; min-width: 0; font: 620 16px/1.2 var(--font-display); letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hdr .ttl small { display: block; font: 400 12.5px var(--font-body); color: var(--muted); letter-spacing: 0; }
.logo { width: 30px; height: 30px; flex: none; }
.iconbtn { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border: 0; border-radius: var(--radius); background: transparent; color: var(--ink); cursor: pointer; }
.hdr .iconbtn { margin-inline: -6px; }
.avatar { font: 600 13px var(--font-display); color: var(--ink); background: var(--surface2); border-radius: 50%; width: 36px; height: 36px; margin-inline: 0 !important; border: 1px solid var(--line); }
.hdr button.ttl { background: none; border: 0; color: inherit; text-align: left; cursor: pointer; padding: 4px 0; min-height: 44px; }
.hdr .ttl small svg { width: 12px; height: 12px; vertical-align: -1px; margin-left: 2px; }
.dotbadge { display: inline-block; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 6px; border-radius: 9px; background: var(--bad); color: #fff; font: 600 11px/18px var(--font-body); text-align: center; vertical-align: 1px; }
.chiprow { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.venue-card { align-items: flex-start; }
.venue-card.current { border-color: var(--mint); box-shadow: inset 0 0 0 1px var(--mint); }
.testbar { background: var(--warn-bg); color: var(--warn); font-size: 12.5px; border-bottom: 1px solid var(--line); }
.testbar .in { padding-block: 6px; }
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom, 0px); }
.tabs .in { display: flex; gap: 2px; }
.tab { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 9px 2px 8px; border: 0; background: none; color: var(--muted); font-size: 11.5px; font-weight: 500; cursor: pointer; position: relative; }
.tab svg { width: 22px; height: 22px; stroke-width: 1.6; }
.tab[aria-current="page"] { color: var(--ink); font-weight: 600; }
.tab[aria-current="page"] svg { color: var(--mint); stroke-width: 1.9; }
.tab .badge { position: absolute; top: 5px; left: calc(50% + 6px); min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--bad); color: #fff; font-size: 10.5px; font-weight: 600; line-height: 16px; text-align: center; }
main .in { padding-block: 16px 104px; }
.acct { background: var(--surface); border-bottom: 1px solid var(--line); }
.acct .in { padding-block: 14px; }

/* controls */
.btn { min-height: 46px; padding: 10px 16px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-align: center; }
.btn:hover { background: var(--surface2); }
.btn.primary { background: var(--btn); color: var(--btn-ink); border-color: var(--btn); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--bad); }
.btn.block { width: 100%; }
.btn.small { min-height: 38px; padding: 6px 12px; font-size: 14px; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.link { background: none; border: 0; padding: 0; color: var(--link); font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
label.lbl { display: block; font-size: 13px; font-weight: 550; color: var(--muted); margin-bottom: 5px; }
input[type=text], input[type=email], input[type=tel], input[type=number], input[type=date], input[type=time], input[type=search], select, textarea { width: 100%; min-height: 46px; padding: 10px 12px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); font-size: 16px; }
input:focus, select:focus, textarea:focus { border-color: var(--mint); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 25%, transparent); }
textarea { min-height: 84px; resize: vertical; }
.money-in { position: relative; }
.money-in span { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.money-in input { padding-left: 28px; font-variant-numeric: tabular-nums; }
.check { display: flex; gap: 10px; align-items: flex-start; }
.check input { width: 20px; height: 20px; margin: 1px 0 0; flex: none; accent-color: var(--mint); }

/* surfaces */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.card.flat { background: transparent; }
.item { display: flex; gap: 12px; align-items: center; width: 100%; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; cursor: pointer; }
.item:hover { background: var(--surface2); }
.item .main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.item .amt { font: 600 17px var(--font-display); font-variant-numeric: tabular-nums; white-space: nowrap; }
.chev { width: 18px; height: 18px; color: var(--muted); flex: none; }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px; border-radius: 6px; font-size: 12px; font-weight: 600; background: var(--neutral-bg); color: var(--muted); white-space: nowrap; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill.info { background: var(--info-bg); color: var(--info); }
.notice { border-radius: var(--radius); padding: 12px 14px; background: var(--info-bg); color: var(--ink); border: 1px solid transparent; font-size: 14px; }
.notice.warn { background: var(--warn-bg); }
.notice.bad { background: var(--bad-bg); }
.notice.ok { background: var(--ok-bg); }
.section-h { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding-top: 4px; }
.total { background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.total .big { font: 650 30px/1.15 var(--font-display); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; color: var(--ink); }
.total .parts { color: var(--muted); font-size: 13px; }
.steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.steps i { height: 4px; border-radius: 2px; background: var(--line); }
.steps i.on { background: var(--mint); }
.steps i.now { background: var(--mint); }
.checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.checklist li { display: flex; gap: 9px; align-items: flex-start; font-size: 14px; }
.dot { width: 20px; height: 20px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; margin-top: 1px; }
.dot.y { background: var(--ok-bg); color: var(--ok); }
.dot.n { background: var(--bad-bg); color: var(--bad); }
.dot.w { background: var(--warn-bg); color: var(--warn); }
.lines { display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.lines div { display: flex; justify-content: space-between; gap: 10px; font-variant-numeric: tabular-nums; }
.lines span:first-child { min-width: 0; overflow-wrap: anywhere; }
.hr { height: 1px; background: var(--line); border: 0; margin: 2px 0; }
details > summary { cursor: pointer; font-weight: 600; min-height: 32px; display: flex; align-items: center; }
pre.mail { white-space: pre-wrap; overflow-wrap: anywhere; font: 13px/1.55 var(--font-body); background: var(--surface2); border-radius: var(--radius); padding: 12px; margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 38px; padding: 6px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); font-size: 14px; font-weight: 500; cursor: pointer; }
.chip:hover { background: var(--surface2); }
.chip.on { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.radio-card { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); cursor: pointer; }
.radio-card.sel { border-color: var(--mint); box-shadow: inset 0 0 0 1px var(--mint); }
.radio-card input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--mint); flex: none; }
.empty { text-align: center; padding: 22px 12px; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius); }

/* statement */
.stub { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 4px; }
.stub-top { display: flex; justify-content: space-between; gap: 10px; }
.stub-k { font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.stub-period { font-size: 15px; font-weight: 550; margin-top: 8px; }
.stub-amt { font: 650 38px/1.1 var(--font-display); letter-spacing: -0.025em; margin-top: 2px; }
.stub-meta { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; color: var(--muted); margin-top: 6px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 0 0 6px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 9px 0; border-bottom: 1px solid var(--line); }
.tbl tfoot td { font-weight: 650; border-bottom: 0; padding-top: 10px; }
.tbl .r { text-align: right; }

/* Desktop and laptop screens: sidebar navigation and a wider reading column */
@media (min-width: 900px) {
  .hdr .in, .testbar .in, .acct .in { max-width: 1120px; }
  .testbar { position: relative; z-index: 6; }
  .tabs { z-index: 5; top: 0; right: auto; bottom: 0; width: 220px; border-top: 0; border-right: 1px solid var(--line); padding-bottom: 0; }
  .tabs .in { display: flex; flex-direction: column; gap: 4px; max-width: none; padding: 104px 12px 16px; }
  .tab { flex: 0 0 auto; flex-direction: row; justify-content: flex-start; gap: 12px; padding: 11px 14px; font-size: 15px; border-radius: 9px; text-align: left; }
  .tab:hover { background: var(--surface2, rgba(0,0,0,.05)); }
  .tab[aria-current="page"] { background: rgba(29, 92, 72, .1); }
  .tab .badge { position: static; margin-left: auto; order: 3; }
  main { margin-left: 220px; }
  main .in { max-width: 780px; padding-block: 28px 56px; }
  #toast { bottom: 28px; left: calc(50% + 110px); }
}
@media print {
  body { background: #fff; color: #000; }
  .hdr, .tabs, .testbar, .acct, .noprint, #toast, #sync, button { display: none !important; }
  main .in { padding-block: 0; max-width: none; }
  .stub, .card { border-color: #999; break-inside: avoid; }
}

/* auth + setup */
.hero { background: var(--surface); color: var(--ink); border-bottom: 1px solid var(--line); }
.hero .in { padding-block: 28px 24px; display: flex; flex-direction: column; gap: 12px; }
.hero .logo { width: 40px; height: 40px; }
.hero p { color: var(--muted); }
.pager { display: flex; gap: 6px; }
.pager i { flex: 1; height: 4px; border-radius: 2px; background: var(--line); }
.pager i.on { background: var(--mint); }

#toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(86px + env(safe-area-inset-bottom, 0px)); z-index: 60; max-width: min(92vw, 520px); background: #1F2226; color: #fff; border-radius: var(--radius); padding: 11px 16px; font-size: 14px; font-weight: 500; box-shadow: 0 4px 16px rgba(0,0,0,0.22); }
#sync { position: fixed; top: calc(8px + env(safe-area-inset-top, 0px)); right: 12px; z-index: 70; background: #1F2226; color: #fff; border-radius: 6px; padding: 4px 10px; font-size: 12px; font-weight: 500; opacity: .92; }
#toast.bad { background: var(--bad); color: #fff; }
#toast.ok { background: #1F2226; }
@media (prefers-reduced-motion: no-preference) {
  #toast { animation: rise .16s ease-out; }
  @keyframes rise { from { opacity: 0; transform: translate(-50%, 6px); } }
}

/* brand: the tipping T wordmark and the slogan */
.wordmark { font-family: 'Bricolage Grotesque', var(--font-body); font-weight: 800; letter-spacing: -0.045em; display: inline-flex; align-items: baseline; }
.wordmark .tilt { display: inline-block; transform: rotate(-14deg); transform-origin: 50% 92%; color: var(--mint); margin-left: 0.14em; margin-right: -0.05em; }
.wordmark .tempo { color: var(--mint); margin-left: 0.04em; }
.hero h1 .wordmark { font-size: 40px; line-height: 1.05; }
.slogan { font-family: 'Bricolage Grotesque', var(--font-body); font-weight: 700; font-size: 15px; letter-spacing: -0.01em; color: var(--mint) !important; margin: 0; }
