/* Money · styles (from the Tron 3 build, 2026-10-28) */
/* Brand tokens: keep in step with brand/tokens.css */
:root {
  --navy: #1B2A4A; --navy-deep: #111D33; --navy-soft: #2A3B5F;
  --copper: #C87533; --copper-lt: #D4924D; --copper-deep: #A85F22; --copper-soft: #FBF3EA;
  --blue: #0057A4; --blue-lt: #E6EFF8;
  --charcoal: #4A4A4A; --olive: #5B6B5A; --stone: #F3F1EC; --paper: #FAF7F2; --paper-2: #F1ECE3;
  --white: #FFFFFF; --burgundy: #6B1D2A;
  --font-head: 'Playfair Display', Georgia, serif;
  --font-body: 'DM Sans', system-ui, -apple-system, sans-serif;
  --radius: 14px; --radius-pill: 999px;
  --shadow: 0 10px 30px rgba(17, 29, 51, .14);
  --lift: 0 1px 2px rgba(17, 29, 51, .06), 0 4px 14px rgba(17, 29, 51, .06);
  --line: rgba(27, 42, 74, .1);
  --glass: rgba(255, 255, 255, .07); --glass-line: rgba(255, 255, 255, .14);
  --nav-h: 62px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--charcoal); font: 400 16px/1.55 var(--font-body); overflow-x: hidden; }
body.sheet-open { overflow: hidden; }
h1, h2, h3 { font-family: var(--font-head); color: var(--navy); line-height: 1.15; margin: 0 0 .4em; }
h1 { font-size: clamp(2rem, 6vw, 3rem); font-weight: 700; }
h2 { font-size: clamp(1.75rem, 5vw, 2.4rem); font-weight: 700; }
h3 { font-size: 1.2rem; font-weight: 600; }
h4 { font: 700 .74rem/1.2 var(--font-body); letter-spacing: .12em; text-transform: uppercase; color: var(--olive); margin: 24px 0 10px; }
p { margin: 0 0 1em; }
button, input, select, textarea { font: inherit; }
.wrap { width: min(1080px, 100% - 32px); margin-inline: auto; }
.nm { text-transform: none; } /* keeps the lowercase i in iKAG inside uppercase lines */
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--copper-lt); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }
.nw { white-space: nowrap; }

/* Top bar and section tabs (tabs sit at the bottom on a phone) */
.bar { background: var(--navy-deep); }
.bar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 56px; }
.brand { display: flex; align-items: center; gap: 14px; }
.mark { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0; border: 0; background: none; font: 700 1.35rem/1 var(--font-head); color: var(--white); letter-spacing: .01em; cursor: pointer; }
.mark .mk { display: inline-flex; flex-direction: column; white-space: nowrap; }
.mark .mk::after { content: ""; display: block; height: 2px; margin-top: 5px; background: var(--copper); border-radius: 2px; }
.mark svg { width: 16px; height: 16px; margin-bottom: 4px; color: rgba(255, 255, 255, .6); transition: color .2s; }
.mark:hover svg { color: var(--copper-lt); }
/* The business list */
.biz-row { justify-content: flex-start; cursor: pointer; }
.biz-row .row-main { flex: 1; }
.biz-row .row-main b { white-space: normal; }
.biz-row[aria-current] { box-shadow: var(--lift), inset 0 0 0 1.5px var(--copper-lt); }
.biz-mono { display: grid; place-items: center; flex-shrink: 0; width: 44px; height: 44px; border-radius: 12px; background: var(--navy); box-shadow: inset 0 -3px 0 var(--copper); color: var(--white); font: 700 .82rem/1 var(--font-head); letter-spacing: .02em; }
.biz-end { display: grid; place-items: center; flex-shrink: 0; width: 24px; color: var(--copper); }
.biz-end svg { width: 18px; height: 18px; }
.biz-row:not([aria-current]) .biz-end { color: var(--charcoal); opacity: .5; }
/* Setup */
.set-row { justify-content: space-between; gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); }
.set-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.set-text b { color: var(--navy); font-weight: 500; }
.set-text small { color: var(--charcoal); font-size: .84rem; line-height: 1.4; }
.brand small { color: rgba(255, 255, 255, .6); font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; }
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: grid; grid-template-columns: repeat(5, 1fr); background: var(--navy-deep); border-top: 1px solid var(--glass-line); padding-bottom: env(safe-area-inset-bottom); }
.tab { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: var(--nav-h); color: rgba(255, 255, 255, .6); text-decoration: none; font: 500 .72rem/1 var(--font-body); letter-spacing: .02em; }
.tab svg { width: 22px; height: 22px; }
.tab[aria-current="page"] { color: var(--white); }
.tab-ai { border: 0; background: none; cursor: pointer; color: rgba(255, 255, 255, .85); }
.tab-ai .spark { display: grid; place-items: center; width: 40px; height: 40px; margin-top: -6px; border-radius: 50%; background: var(--navy-soft); box-shadow: 0 0 0 1.5px rgba(212, 146, 77, .6); color: var(--copper-lt); }
.tab .spark svg { width: 20px; height: 20px; }
.tab[aria-current="page"]::before { content: ""; position: absolute; top: 0; left: 30%; right: 30%; height: 3px; border-radius: 0 0 3px 3px; background: var(--copper); }

/* Navy stage and bands */
.stage, .band { background: radial-gradient(120% 90% at 85% 0%, var(--navy-soft) 0%, var(--navy) 45%, var(--navy-deep) 100%); color: rgba(255, 255, 255, .86); }
.stage { padding: 32px 0 44px; }
.band { padding: 18px 0 20px; }
.stage h1, .band h2, .stage h3 { color: var(--white); }
.band h2 { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 0; font-size: clamp(1.6rem, 4.5vw, 2.1rem); }
.band .sub { margin: 4px 0 0; font-size: .95rem; color: rgba(255, 255, 255, .74); }
.band-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; }
.band-row .btn { flex-shrink: 0; }
label.btn:focus-within { outline: 3px solid var(--copper-lt); outline-offset: 2px; }
label.btn.over { box-shadow: 0 0 0 3px var(--copper-lt); }
.eyebrow-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px; }
.eyebrow .vs-then { margin-left: 4px; color: rgba(255, 255, 255, .55); font: italic 400 .8rem var(--font-body); letter-spacing: .02em; text-transform: none; }
.eyebrow { font-size: .78rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--copper-lt); }
.sample { display: inline-block; font: 700 .68rem/1 var(--font-body); letter-spacing: .1em; text-transform: uppercase; color: var(--copper-deep); background: var(--copper-soft); border: 1px solid rgba(200, 117, 51, .35); border-radius: var(--radius-pill); padding: .4em .8em; }
.band h2 .sample { margin: 0; }

/* Living diagram: billed, collected, spent, kept */
.flow { position: relative; max-width: 760px; margin: 26px 0 6px; }
.flow-track { position: absolute; left: 12.5%; right: 12.5%; top: 14px; height: 2px; background: repeating-linear-gradient(90deg, rgba(255, 255, 255, .24) 0 4px, transparent 4px 10px); }
.flow-dot { position: absolute; top: 50%; left: 0; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: var(--copper); box-shadow: 0 0 12px rgba(200, 117, 51, .85); opacity: 0; }
.flow-drop { position: absolute; top: 50%; left: 66.667%; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 2px rgba(230, 239, 248, .5); opacity: 0; }
.flow-stops { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); text-align: center; }
.node { display: block; width: 30px; height: 30px; margin: 0 auto 12px; border-radius: 50%; background: var(--navy-deep); border: 2px solid var(--glass-line); }
.stop b::after { content: ""; display: block; width: 56%; height: 2px; margin: 7px auto 0; border-radius: 2px; background: var(--copper-lt); opacity: .35; transform: scaleX(.6); transition: opacity .2s, transform .2s; }
/* Runs twice when the Overview opens (about 10 seconds), then rests until the next visit */
.flow.run .flow-dot { animation: flow 5s 2 cubic-bezier(.6, 0, .4, 1) forwards; }
.flow.run .flow-drop { animation: drop 5s 2 ease-in forwards; }
.flow.run .node { animation: lit 5s 2; }
.flow.run .stop b::after { animation: uline 5s 2; }
.flow.run .stop:nth-child(2) .node, .flow.run .stop:nth-child(2) b::after { animation-delay: 1.5s; }
.flow.run .stop:nth-child(3) .node, .flow.run .stop:nth-child(3) b::after { animation-delay: 3s; }
.flow.run .stop:nth-child(4) .node, .flow.run .stop:nth-child(4) b::after { animation-delay: 4.4s; }
.stop b { display: block; font: 700 clamp(1.05rem, 3.6vw, 1.6rem)/1.1 var(--font-head); color: var(--white); font-variant-numeric: tabular-nums; }
.stop-kept b { color: var(--copper-lt); }
/* With taxes on, five meters: the dot stops at each, and taxes take the last bite of what was kept */
.flow.five .flow-track { left: 10%; right: 10%; }
.flow.five .flow-stops { grid-template-columns: repeat(5, 1fr); }
.flow.five .flow-drop { left: 50%; }
.flow.five.run .flow-dot { animation-name: flow5; }
.flow.five.run .flow-drop { animation-name: drop5; }
.flow.five.run .stop:nth-child(2) .node, .flow.five.run .stop:nth-child(2) b::after { animation-delay: 1.2s; }
.flow.five.run .stop:nth-child(3) .node, .flow.five.run .stop:nth-child(3) b::after { animation-delay: 2.4s; }
.flow.five.run .stop:nth-child(4) .node, .flow.five.run .stop:nth-child(4) b::after { animation-delay: 3.6s; }
.flow.five.run .stop:nth-child(5) .node, .flow.five.run .stop:nth-child(5) b::after { animation-delay: 4.6s; }
@keyframes flow5 {
  0% { left: 0; opacity: 0; transform: scale(1); }
  4% { opacity: 1; }
  24%, 29% { left: 25%; transform: scale(1); }
  48% { left: 50%; transform: scale(1); }
  53% { left: 50%; transform: scale(.62); }
  72% { left: 75%; transform: scale(.62); }
  92% { left: 100%; opacity: 1; transform: scale(.48); }
  97%, 100% { left: 100%; opacity: 0; transform: scale(.48); }
}
@keyframes drop5 { 0%, 49% { opacity: 0; transform: translateY(0); } 51% { opacity: 1; } 66%, 100% { opacity: 0; transform: translateY(30px); } }
@media (max-width: 480px) {
  .flow.five .stop b { font-size: clamp(.92rem, 4vw, 1.05rem); }
  .flow.five .stop small { font-size: .6rem; letter-spacing: .03em; }
  .flow.five .stop .vs { font-size: .7rem; }
  .flow.five .node { width: 26px; height: 26px; }
  .flow.five .flow-track { top: 12px; }
}
button.stop { padding: 0 0 6px; border: 0; border-radius: 12px; background: none; color: inherit; font: inherit; cursor: pointer; }
button.stop:hover b::after, button.stop:focus-visible b::after { opacity: 1; transform: scaleX(1); }
.stop .vs { display: block; min-height: 1.3em; margin-top: 4px; font-style: normal; font-size: .76rem; font-weight: 500; color: rgba(255, 255, 255, .78); font-variant-numeric: tabular-nums; }
.stop small { display: block; margin-top: 4px; font-size: .7rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: rgba(255, 255, 255, .62); }
@keyframes flow {
  0% { left: 0; opacity: 0; transform: scale(1); }
  4% { opacity: 1; }
  30%, 36% { left: 33.333%; transform: scale(1); }
  60% { left: 66.667%; transform: scale(1); }
  66% { left: 66.667%; transform: scale(.62); }
  88% { left: 100%; opacity: 1; transform: scale(.62); }
  96%, 100% { left: 100%; opacity: 0; transform: scale(.62); }
}
@keyframes drop { 0%, 61% { opacity: 0; transform: translateY(0); } 63% { opacity: 1; } 80%, 100% { opacity: 0; transform: translateY(30px); } }
@keyframes lit { 0%, 10% { border-color: var(--copper); } 18%, 100% { border-color: var(--glass-line); } }
@keyframes uline { 0%, 12% { opacity: 1; transform: scaleX(1); } 24%, 100% { opacity: .35; transform: scaleX(.6); } }

/* Glass cards on the stage */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 14px; margin-top: 30px; }
.glass { background: var(--glass); border: 1px solid var(--glass-line); border-radius: var(--radius); padding: 18px; backdrop-filter: blur(6px); display: flex; flex-direction: column; }
.glass.premium { box-shadow: inset 3px 0 0 var(--copper); }
.glass .k { font-size: .74rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--copper-lt); }
.glass .v { font: 700 1.9rem/1.15 var(--font-head); color: var(--white); margin: 6px 0 2px; font-variant-numeric: tabular-nums; }
.glass .note { margin: 0 0 14px; font-size: .9rem; color: rgba(255, 255, 255, .74); }
.glass .btn { margin-top: auto; align-self: flex-start; }
.aging { list-style: none; margin: 0 0 16px; padding: 0; }
.aging li { display: grid; grid-template-columns: 7.2rem 1fr 4.6rem; gap: 10px; align-items: center; padding: 3px 0; font-size: .82rem; color: rgba(255, 255, 255, .75); }
.aging i { height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .1); overflow: hidden; }
.aging s { display: block; height: 100%; border-radius: 3px; background: var(--copper-lt); }
.aging b { text-align: right; color: var(--white); font-weight: 500; font-variant-numeric: tabular-nums; }
.od { list-style: none; margin: 4px 0 0; padding: 0; }
.od li { border-top: 1px solid var(--glass-line); }
.od-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 44px; padding: 10px 0; border: 0; background: none; color: rgba(255, 255, 255, .7); font: inherit; text-align: left; cursor: pointer; }
.od-row > span { display: flex; flex-direction: column; min-width: 0; font-size: .84rem; }
.od-row b { color: var(--white); font-size: 1rem; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.od-row .rem { color: rgba(255, 255, 255, .6); }
.od-row .rem.due { color: var(--copper-lt); font-weight: 700; }
.od-row svg { width: 18px; height: 18px; flex-shrink: 0; color: rgba(255, 255, 255, .5); }
.od-row:hover svg { color: var(--white); }
.od-more { text-decoration: none; }
.ready { list-style: none; margin: 8px 0 16px; padding: 0; display: grid; gap: 10px; }
.ready b { display: block; color: var(--white); font-weight: 500; }
.ready span { font-size: .86rem; color: rgba(255, 255, 255, .72); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5em; min-height: 44px; padding: .65em 1.35em; border-radius: var(--radius-pill); border: 0; font: 700 .95rem/1.1 var(--font-body); text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn-go { background: var(--copper); color: var(--white); }
.btn-go:hover { background: var(--copper-deep); }
.btn-go:disabled { opacity: .5; cursor: default; }
.btn-quiet { background: transparent; color: var(--white); box-shadow: inset 0 0 0 1.5px var(--glass-line); }
.btn-quiet:hover { background: var(--glass); }
.btn[hidden] { display: none; }
.btn-ghost { background: var(--white); color: var(--navy); box-shadow: inset 0 0 0 1.5px rgba(27, 42, 74, .2); }
.btn-ghost:hover { box-shadow: inset 0 0 0 1.5px var(--navy); }
.btn-sm { padding: .55em 1.1em; font-size: .88rem; }

/* Light sections */
.section { padding: 24px 0 44px; }
.card { background: var(--white); border-radius: var(--radius); box-shadow: var(--lift); padding: 20px; }
.card h3 { margin-bottom: 12px; }
.card-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; margin-bottom: 8px; }
.card-head h3 { margin: 0; }
.ov-grid { display: grid; gap: 16px; }
.ov-main { display: grid; gap: 16px; }
.ov-grid > *, .exp-grid > *, .ov-main > * { min-width: 0; }
.col { max-width: 760px; }
.empty { margin: 8px 0; color: var(--charcoal); font-size: .95rem; }

/* Rows */
.list { display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 64px; padding: 12px 16px; text-align: left; background: var(--white); border: 0; border-radius: 12px; box-shadow: var(--lift); color: var(--charcoal); }
button.row { cursor: pointer; }
button.row:hover { box-shadow: 0 0 0 1.5px rgba(27, 42, 74, .18), var(--lift); }
.row-main { display: flex; flex-direction: column; min-width: 0; }
.row-main b { color: var(--navy); font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-sub { font-size: .84rem; color: var(--charcoal); }
.row-end { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; flex-shrink: 0; }
.amt { color: var(--navy); font-weight: 700; font-variant-numeric: tabular-nums; }
.row.flash { animation: flash 2.4s ease-out; }
@keyframes flash { 0%, 40% { box-shadow: 0 0 0 3px var(--copper-lt), var(--lift); } 100% { box-shadow: var(--lift); } }

/* Status pills and tags */
.pill { display: inline-flex; align-items: center; font: 700 .72rem/1 var(--font-body); padding: .4em .75em; border-radius: var(--radius-pill); white-space: nowrap; }
.st-draft { background: var(--stone); color: var(--charcoal); box-shadow: inset 0 0 0 1px rgba(74, 74, 74, .28); }
.st-open, .st-partial { background: var(--blue-lt); color: var(--blue); }
.st-overdue { background: var(--navy); color: var(--white); }
.st-paid { background: rgba(91, 107, 90, .14); color: var(--olive); }
.tag { display: inline-block; font: 500 .72rem/1 var(--font-body); padding: .4em .7em; border-radius: var(--radius-pill); background: var(--stone); color: var(--olive); white-space: nowrap; }

/* Filter chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border-radius: var(--radius-pill); border: 1px solid rgba(27, 42, 74, .18); background: var(--white); color: var(--navy); font-weight: 500; cursor: pointer; }
.chip .n { font-size: .78rem; opacity: .7; font-variant-numeric: tabular-nums; }
.chip[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: var(--white); }

/* Chart: collected and spent by month */
.legend { display: flex; gap: 14px; font-size: .82rem; color: var(--charcoal); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }
.sw-in { background: var(--copper); }
.sw-out { background: var(--blue); }
.chart { position: relative; height: 220px; margin-top: 14px; }
.ch-grid { position: absolute; left: 0; right: 0; top: 6px; bottom: 28px; display: flex; flex-direction: column; justify-content: space-between; }
.ch-grid div { position: relative; margin-left: 46px; border-top: 1px solid var(--line); height: 0; }
.ch-grid div:last-child { border-top-color: rgba(27, 42, 74, .3); }
.ch-grid span { position: absolute; right: calc(100% + 8px); top: -.65em; font-size: .72rem; color: var(--charcoal); font-variant-numeric: tabular-nums; }
.ch-cols { position: absolute; left: 46px; right: 0; top: 6px; bottom: 0; display: grid; grid-template-columns: repeat(6, 1fr); }
.ch-col { display: block; height: 100%; padding: 0; border: 0; background: none; border-radius: 8px 8px 0 0; cursor: pointer; }
.ch-bars { display: flex; align-items: flex-end; justify-content: center; gap: 2px; height: calc(100% - 28px); }
.ch-bars s { display: block; width: min(18px, 32%); border-radius: 4px 4px 0 0; }
.ch-col:hover .ch-bars, .ch-col:focus-visible .ch-bars { background: rgba(27, 42, 74, .05); }
.b-in { background: var(--copper); }
.b-out { background: var(--blue); }
.ch-m { display: block; height: 28px; line-height: 28px; text-align: center; font-size: .78rem; color: var(--charcoal); }
.ch-tip { position: absolute; top: 0; z-index: 2; min-width: 168px; padding: 10px 12px; border-radius: 10px; background: var(--navy-deep); color: var(--white); font-size: .82rem; line-height: 1.5; box-shadow: var(--shadow); pointer-events: none; transform: translateX(-50%); }
.ch-tip b { display: block; font-weight: 700; margin-bottom: 2px; }
.ch-tip span { display: flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; }
.numbers { margin-top: 12px; font-size: .9rem; }
.numbers summary { cursor: pointer; color: var(--blue); font-weight: 500; min-height: 44px; display: flex; align-items: center; }
.numbers table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.numbers th, .numbers td { padding: 6px 0; border-bottom: 1px solid var(--line); text-align: left; }
.mlink { min-height: 44px; padding: 0; border: 0; background: none; color: var(--blue); font: inherit; text-align: left; cursor: pointer; }
.mlink:hover { text-decoration: underline; }
.numbers th { font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--olive); }
.r { text-align: right !important; padding-left: 12px !important; white-space: nowrap; }

/* Latest movement */
.moves { list-style: none; margin: 0; padding: 0; }
.mv { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.mv:first-child { border-top: 0; padding-top: 0; }
.moves .empty { margin: 0; }
.mv-ic { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0; }
.mv-ic svg { width: 18px; height: 18px; }
.mv-ic.mv-in { background: var(--copper-soft); color: var(--copper-deep); }
.mv-ic.mv-out { background: var(--blue-lt); color: var(--blue); }
.mv-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mv-main b { color: var(--navy); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mv-main span { font-size: .82rem; }
.mv-amt { color: var(--navy); font-size: .92rem; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Expenses */
.exp-grid { display: grid; gap: 16px; }
.hbars { list-style: none; margin: 0; padding: 0; }
/* Repeating costs: one quiet row above the categories */
.rep-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 56px; margin: 0 0 14px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); color: var(--navy); font: inherit; text-align: left; cursor: pointer; }
.rep-row > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rep-row b { font-weight: 700; }
.rep-row small { color: var(--charcoal); font-size: .82rem; }
.rep-row svg { width: 18px; height: 18px; flex-shrink: 0; color: var(--charcoal); }
.rep-row:hover { border-color: var(--copper-lt); }
.set-sub { padding-top: 0; border-top: 0; }
/* Home: a card for each business whose books we keep */
.at-home .tabs { display: none; }
/* Home is the front door: its own light stage, no app bar, Oak Street's tree as Money's mark */
.at-home { background: var(--paper); }
.at-home .bar { display: none; }
.home-stage { position: relative; min-height: 100vh; padding: max(28px, env(safe-area-inset-top)) 0 48px; overflow: hidden; color: var(--navy);
  background: radial-gradient(110% 70% at 30% 0%, var(--copper-soft) 0%, var(--paper) 50%, var(--stone) 100%); }
.home-glow { position: absolute; inset: 0; pointer-events: none; }
.home-glow i { position: absolute; width: 60vmax; height: 60vmax; border-radius: 50%; filter: blur(110px); opacity: .14; }
.home-glow i:nth-child(1) { left: -20vmax; top: -30vmax; background: var(--copper-lt); animation: drift-a 26s ease-in-out infinite alternate; }
.home-glow i:nth-child(2) { right: -25vmax; top: 10vmax; background: var(--blue); opacity: .07; animation: drift-b 30s ease-in-out infinite alternate; }
.home-hero { position: relative; display: flex; flex-direction: column; align-items: flex-start; padding-bottom: 28px; }
.home-lockup { display: flex; align-items: center; gap: 12px; margin-bottom: clamp(28px, 7vh, 64px); }
.home-logo { width: 84px; height: 84px; margin: -6px 0 -6px -8px; object-fit: contain; filter: drop-shadow(0 8px 14px rgba(27, 42, 74, .16)); }
.home-lockup span { display: flex; flex-direction: column; gap: 5px; }
.home-lockup b { color: var(--navy); font: 700 1.8rem/1 var(--font-head); letter-spacing: .01em; }
.home-lockup small { color: var(--copper-deep); font: 700 .68rem/1.2 var(--font-body); letter-spacing: .14em; text-transform: uppercase; }
.home-hero h2 { margin: 0; color: var(--navy); font: 700 clamp(2.2rem, 7vw, 3.6rem)/1.05 var(--font-head); }
.home-sub { margin: 10px 0 22px; color: var(--charcoal); font-size: 1.02rem; }
.home-sum { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; width: min(100%, 640px); margin-top: 30px; }
.home-sum .tile { border-color: var(--line); background: rgba(255, 255, 255, .72); box-shadow: var(--lift); }
.home-sum .tile span { color: var(--olive); }
.home-sum .tile b { color: var(--navy); }
.home-stage .home-grid { position: relative; }
.home-stage .biz-card { animation: rise .6s cubic-bezier(.2, .8, .2, 1) both; }
.home-stage .biz-card:nth-child(2) { animation-delay: .08s; }
.home-stage .biz-card:nth-child(3) { animation-delay: .16s; }
.home-stage .biz-card:nth-child(4) { animation-delay: .24s; }
.home-stage .biz-card:nth-child(n+5) { animation-delay: .32s; }
.home-stage .biz-mono.has-logo { background: none; box-shadow: none; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@media (max-width: 480px) { .home-sum { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 800px) and (max-width: 1100px) { .brand small { display: none; } }

.at-home footer { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
.at-home .toast { bottom: calc(18px + env(safe-area-inset-bottom)); }
.home-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 16px; }
.biz-card { display: flex; flex-direction: column; gap: 16px; width: 100%; padding: 18px; border: 0; border-radius: var(--radius); background: var(--white); box-shadow: var(--lift); color: var(--charcoal); font: inherit; text-align: left; cursor: pointer; transition: transform .2s ease, box-shadow .2s ease; }
.biz-card:hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(17, 29, 51, .14); }
.biz-card-top { display: flex; align-items: center; gap: 12px; }
.biz-card-name { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.biz-card-name b { color: var(--navy); font: 700 1.1rem/1.25 var(--font-head); }
.biz-card-name small { color: var(--charcoal); font-size: .84rem; }
.biz-card .pill { flex-shrink: 0; }
.src-qbo { background: var(--blue-lt); color: var(--blue); }
.src-money { background: var(--copper-soft); color: var(--copper-deep); }
.biz-card-nums { display: grid; grid-template-columns: 1.4fr 1fr .7fr; gap: 8px; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.biz-card-nums span { display: flex; flex-direction: column; justify-content: flex-end; gap: 3px; min-width: 0; }
.biz-card-nums i { color: var(--olive); font: 700 .66rem/1.2 var(--font-body); letter-spacing: .08em; text-transform: uppercase; }
.biz-card-nums b { color: var(--navy); font: 700 1.05rem/1.2 var(--font-head); font-variant-numeric: tabular-nums; }
.biz-card-next { display: flex; align-items: center; justify-content: space-between; color: var(--charcoal); font-size: .9rem; }
.biz-card-next.on { color: var(--copper-deep); font-weight: 700; }
.biz-card-next svg { width: 18px; height: 18px; }
.biz-mono.has-logo { overflow: hidden; background: var(--white); box-shadow: inset 0 0 0 1px var(--line); }
.biz-mono img { width: 100%; height: 100%; object-fit: contain; }
.biz-mono.wide { width: 56px; padding: 10px 1px; }
.biz-mono svg { width: 22px; height: 22px; }
.biz-home { background: var(--copper-soft); box-shadow: none; color: var(--copper-deep); }
.logo-tile { display: inline-block; width: 36px; height: 36px; margin-right: 10px; padding: 2px; vertical-align: middle; border-radius: 10px; background: var(--paper); object-fit: contain; }
.logo-tile[hidden], .bar-wide[hidden], .mark .mk[hidden] { display: none; }
.bar-wide { display: block; width: auto; height: 34px; }
.inv-logo { display: block; width: auto; height: auto; max-width: 180px; max-height: 76px; }
.inv-mark.with-icon { display: flex; align-items: center; gap: 12px; }
.inv-icon { width: 52px; height: 52px; flex-shrink: 0; border-radius: 10px; object-fit: contain; }
.inv-mark.with-icon span { font-size: 1.3rem; line-height: 1.1; }
.inv-title b { white-space: nowrap; }
.inv-from { margin: 10px 0 0; color: var(--charcoal); font-size: .78rem; line-height: 1.45; }
.set-details { margin-top: 2px; }
.set-hint { margin: -4px 0 12px; }
.field-short { max-width: 220px; }
.set-details .field { margin-bottom: 10px; }
@media (max-width: 480px) { .inv-icon { width: 42px; height: 42px; } .inv-mark.with-icon { gap: 10px; } .inv-mark.with-icon span { font-size: 1.08rem; } }
.logo-tile.bare { padding: 0; background: none; border-radius: 9px; }
.mark .logo-tile { margin-right: 2px; }
.home-mark { display: none; text-decoration: none; }
.home-mark .mk { flex-direction: row; align-items: center; }
.at-home .home-mark { display: inline-flex; }
.at-home #biz-btn { display: none; }
.mark .mk { flex-direction: row; flex-wrap: wrap; align-items: center; }
.mark .mk::after { flex-basis: 100%; }
.logo-pick { display: flex; align-items: center; gap: 14px; }
.logo-prev { width: 56px; height: 56px; }
.field .logo-pick label.btn { display: inline-flex; margin: 0; font: 700 .9rem/1.1 var(--font-body); letter-spacing: 0; text-transform: none; color: var(--navy); }
/* QuickBooks */
.qb-btn { gap: 10px; }
.qb-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--blue-lt); box-shadow: 0 0 0 3px rgba(230, 239, 248, .25); }
.btn-danger { background: var(--burgundy); border-color: var(--burgundy); color: var(--white); }
.qb-list { margin: 0 0 12px; padding-left: 18px; color: var(--charcoal); }
.qb-list li + li { margin-top: 6px; }
.hbars li { display: grid; grid-template-columns: minmax(0, 8.6rem) 1fr 4.8rem; gap: 10px; align-items: center; padding: 6px 0; font-size: .88rem; }
.hbars i { height: 8px; border-radius: 4px; background: var(--stone); overflow: hidden; }
.hbars s { display: block; height: 100%; border-radius: 0 4px 4px 0; background: var(--blue); }
.hbars b { text-align: right; color: var(--navy); font-weight: 500; font-variant-numeric: tabular-nums; }
.group + .group { margin-top: 24px; }
.group-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.group-head h3 { margin: 0; }
.group-head span { color: var(--navy); font-weight: 700; font-variant-numeric: tabular-nums; }

/* Clients */
.clients { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.client { display: block; width: 100%; padding: 18px; text-align: left; background: var(--white); border: 0; border-radius: var(--radius); box-shadow: var(--lift); color: var(--charcoal); cursor: pointer; }
.client:hover { box-shadow: 0 0 0 1.5px rgba(27, 42, 74, .18), var(--lift); }
.cl-name { display: block; font: 700 1.15rem/1.2 var(--font-head); color: var(--navy); }
.cl-sub { display: block; font-size: .84rem; margin: 2px 0 12px; }
.share { display: block; height: 6px; border-radius: 3px; background: var(--stone); overflow: hidden; }
.share s { display: block; height: 100%; border-radius: 0 3px 3px 0; background: var(--copper); }
.cl-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0 0; }
.cl-stats .dt { display: block; font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--olive); }
.cl-stats .dd { display: block; margin-top: 2px; color: var(--navy); font-weight: 700; font-variant-numeric: tabular-nums; }
.cl-stats .dd small { font-weight: 500; color: var(--charcoal); }

/* Sheet: one panel for detail and forms (bottom sheet on a phone) */
.scrim { position: fixed; inset: 0; z-index: 45; background: rgba(17, 29, 51, .55); opacity: 0; visibility: hidden; transition: opacity .25s, visibility 0s .25s; }
.scrim.open { opacity: 1; visibility: visible; transition: opacity .25s; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; display: flex; flex-direction: column; max-height: 92vh; max-height: 92dvh; background: var(--paper); border-radius: 20px 20px 0 0; box-shadow: 0 -10px 40px rgba(17, 29, 51, .3); visibility: hidden; transform: translateY(100%); transition: transform .3s cubic-bezier(.2, .8, .2, 1), visibility 0s .3s; }
.sheet.open { visibility: visible; transform: none; transition: transform .3s cubic-bezier(.2, .8, .2, 1); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 10px 10px 20px; border-bottom: 1px solid var(--line); }
.sheet-head h3 { margin: 0; font-size: 1.25rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.x { display: grid; place-items: center; width: 44px; height: 44px; flex-shrink: 0; border: 0; border-radius: 50%; background: transparent; color: var(--navy); cursor: pointer; }
.x:hover { background: var(--stone); }
.x svg { width: 20px; height: 20px; }
.sheet-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 16px 20px 22px; }
.sheet-foot { display: flex; flex-wrap: wrap; gap: 10px; padding: 12px 20px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--white); }
.sheet-foot .btn { flex: 1 1 auto; }
.sheet-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.lead-sm { margin: 0 0 14px; color: var(--charcoal); }
.lead-sm b { color: var(--navy); }
.hint { font-size: .85rem; color: var(--charcoal); margin: 4px 0 0; }
.err { margin: 10px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--copper-soft); color: var(--navy); font-size: .9rem; }
.pays { list-style: none; margin: 0; padding: 0; }
.pays li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: .92rem; }
.pays b { color: var(--navy); font-variant-numeric: tabular-nums; }

/* Fields */
.field { margin-bottom: 14px; }
.field label, .label { display: block; margin-bottom: 6px; font: 700 .72rem/1.2 var(--font-body); letter-spacing: .08em; text-transform: uppercase; color: var(--olive); }
.in { display: block; width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid rgba(27, 42, 74, .22); border-radius: 10px; background: var(--white); color: var(--navy); }
.in:focus { outline: 2px solid rgba(0, 87, 164, .28); border-color: var(--blue); }
textarea.in { resize: vertical; line-height: 1.5; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.line { display: grid; grid-template-columns: 1fr 108px 44px; gap: 8px; margin-bottom: 8px; }
.x-line { display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 10px; background: transparent; color: var(--charcoal); cursor: pointer; }
.x-line:hover { background: var(--stone); }
.x-line svg { width: 16px; height: 16px; }
.form-total { display: flex; justify-content: space-between; align-items: baseline; padding: 12px 0; margin-top: 6px; border-top: 2px solid var(--navy); color: var(--navy); }
.form-total b { font: 700 1.3rem var(--font-head); font-variant-numeric: tabular-nums; }
.switch { display: flex; align-items: center; gap: 12px; min-height: 44px; cursor: pointer; color: var(--navy); }
.switch input { appearance: none; -webkit-appearance: none; position: relative; width: 46px; height: 28px; margin: 0; flex-shrink: 0; border-radius: 999px; background: rgba(74, 74, 74, .3); cursor: pointer; transition: background .2s; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--white); transition: transform .2s; }
.switch input:checked { background: var(--copper); }
.switch input:checked::after { transform: translateX(18px); }
.switch input:disabled { opacity: .45; cursor: default; }
.switch input:disabled + span { opacity: .6; }

/* Receipt reading */
.rc-thumb { display: grid; place-items: center; height: 170px; margin-bottom: 14px; overflow: hidden; border-radius: 12px; background: var(--stone); }
.rc-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.rc-thumb .doc { display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--navy); font-size: .85rem; }
.rc-thumb .doc svg { width: 40px; height: 40px; }
.reading b { color: var(--navy); }
.shim { display: block; height: 12px; margin-top: 12px; border-radius: 6px; background: linear-gradient(90deg, var(--stone) 0%, var(--white) 50%, var(--stone) 100%); background-size: 200% 100%; animation: shim 1.2s linear infinite; }
.shim.s { width: 60%; }
@keyframes shim { from { background-position: 100% 0; } to { background-position: -100% 0; } }

/* Invoice document */
.inv { background: var(--white); border: 1px solid rgba(27, 42, 74, .12); border-radius: 12px; padding: 22px; font-size: .92rem; color: var(--charcoal); }
.inv-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding-bottom: 16px; border-bottom: 2px solid var(--navy); }
.inv-mark { font: 700 1.6rem/1 var(--font-head); color: var(--navy); }
.inv-mark i { display: block; height: 2px; margin-top: 5px; background: var(--copper); border-radius: 2px; }
.inv-mark small { display: block; margin-top: 6px; font: 500 .7rem/1 var(--font-body); letter-spacing: .14em; text-transform: uppercase; color: var(--olive); }
.inv-title { text-align: right; }
.inv-title span { display: block; font-size: .7rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--olive); }
.inv-title b { display: block; margin-top: 4px; font: 700 1.25rem/1.1 var(--font-head); color: var(--navy); }
.inv-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; margin: 16px 0; }
.inv-meta dl { margin: 0; }
.inv-meta dt { margin-top: 8px; font-size: .68rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--olive); }
.inv-meta dt:first-child { margin-top: 0; }
.inv-meta dd { margin: 2px 0 0; color: var(--navy); }
.inv-lines { width: 100%; border-collapse: collapse; }
.inv-lines th { padding: 8px 0; border-bottom: 1px solid rgba(27, 42, 74, .18); text-align: left; font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--olive); }
.inv-lines td { padding: 10px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.inv-lines td.r { color: var(--navy); font-variant-numeric: tabular-nums; }
.inv-lines tr.edit-line { cursor: pointer; }
.inv-lines tr.edit-line:hover td { background: var(--stone); }
.inv-tot { max-width: 270px; margin: 12px 0 0 auto; font-variant-numeric: tabular-nums; }
.inv-tot div { display: flex; justify-content: space-between; gap: 16px; padding: 4px 0; }
.inv-tot .due { margin-top: 6px; padding-top: 8px; border-top: 2px solid var(--navy); color: var(--navy); font-weight: 700; font-size: 1.05rem; }
.inv-note { margin: 18px 0 0; font-size: .85rem; }
.stmt-doc small { display: block; color: var(--charcoal); font-size: .76rem; }
.stmt-doc .inv-lines td { padding: 8px 0; }
.inv-meta dd.big { color: var(--navy); font: 700 1.35rem/1.2 var(--font-head); font-variant-numeric: tabular-nums; }
.stmt-aging { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 12px 0 0; font-size: .82rem; }
.stmt-aging b { color: var(--navy); font-variant-numeric: tabular-nums; }
.stmt-clear { margin: 6px 0 0; color: var(--navy); font-weight: 500; }
.stmt-doc h5 { margin: 20px 0 4px; color: var(--olive); font-size: .68rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.stmt-doc .pm { margin-left: 6px; }

/* Period switch on the Overview */
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; margin-top: 20px; padding: 4px; border-radius: var(--radius-pill); background: rgba(255, 255, 255, .06); border: 1px solid var(--glass-line); }
.seg button { min-height: 44px; padding: 0 14px; border: 0; border-radius: var(--radius-pill); background: none; color: rgba(255, 255, 255, .75); font: 500 .88rem var(--font-body); cursor: pointer; }
.seg button:hover { color: var(--white); }
.seg button[aria-pressed="true"] { background: var(--white); color: var(--navy); }
.ch-cols.dense .ch-m { font-size: .68rem; }
.title-select { appearance: none; -webkit-appearance: none; max-width: 100%; min-height: 44px; margin: 0; padding: 0 26px 0 0; border: 0; border-radius: 0; background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231B2A4A' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right center / 18px; font: 600 1.2rem/1.2 var(--font-head); color: var(--navy); cursor: pointer; }
.title-select:hover { color: var(--blue); }
.stabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin: 0 0 6px; }
.stab { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 3px; min-width: 0; min-height: 64px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--white); color: var(--charcoal); font: inherit; text-align: left; cursor: pointer; }
.stab span { font-size: .64rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--olive); }
.stab b { font-size: .88rem; font-weight: 700; color: var(--navy); font-variant-numeric: tabular-nums; white-space: nowrap; }
.stab:hover { border-color: rgba(27, 42, 74, .35); }
.stab[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); }
.stab[aria-pressed="true"] span { color: var(--copper-lt); }
.stab[aria-pressed="true"] b { font: 700 1.15rem/1.1 var(--font-head); color: var(--white); }
.st-count { margin-top: 14px; }
.seg-light { margin: 0 0 14px; background: var(--stone); border-color: var(--line); }
.seg-light button { color: var(--charcoal); }
.seg-light button:hover { color: var(--navy); }
.seg-light button[aria-pressed="true"] { background: var(--navy); color: var(--white); }
.stmt { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; background: var(--white); border-radius: 10px; box-shadow: var(--lift); }
.stmt td { padding: 10px 14px; border-top: 1px solid var(--line); color: var(--charcoal); }
.stmt tr:first-child td { border-top: 0; }
.stmt .lead td, .stmt .tot td { color: var(--navy); font-weight: 700; }
.stmt .sub-h td { padding-top: 14px; font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--olive); }
.stmt .tot td { border-top: 2px solid var(--navy); }

/* Payment methods (labelled marks; the official artwork drops in when Stripe is wired) */
.pm { display: inline-flex; align-items: center; min-height: 24px; padding: 0 .55em; border-radius: 6px; border: 1px solid rgba(27, 42, 74, .2); background: var(--white); color: var(--navy); font: 700 .7rem/1 var(--font-body); white-space: nowrap; }
.pms { display: inline-flex; flex-wrap: wrap; gap: 6px; vertical-align: middle; }
.inv-pay { margin-top: 18px; padding: 14px; border-radius: 10px; background: var(--stone); }
.inv-pay-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.inv-pay p { margin: 10px 0 0; font-size: .85rem; }
.inv-pay p .pms { margin: 0 4px; }
.field .pm-chips .chip { display: inline-flex; min-height: 44px; margin: 0; font: 500 .9rem/1 var(--font-body); letter-spacing: 0; text-transform: none; color: var(--navy); }
.field .pm-chips .chip:has(input:checked) { background: var(--navy); border-color: var(--navy); color: var(--white); }
.chip:has(input:focus-visible) { outline: 3px solid var(--copper-lt); outline-offset: 2px; }
.pays .pm { margin-left: 6px; }

/* Ask Claude: its own space. Self-contained: lift .cla, these rules and the "Ask Claude" script section into any app. */
.cla { --cla-glass: rgba(255, 255, 255, .85); --cla-line: rgba(27, 42, 74, .12); --cla-dim: var(--charcoal); --orb: 156px;
  position: fixed; inset: 0; z-index: 70; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; overflow: hidden; color: var(--navy);
  background: radial-gradient(90% 70% at 50% 24%, var(--copper-soft) 0%, var(--paper) 52%, var(--stone) 100%);
  visibility: hidden; opacity: 0; transform: scale(1.02); transition: opacity .3s ease, transform .3s ease, visibility 0s .3s; }
.cla.open { visibility: visible; opacity: 1; transform: none; transition: opacity .3s ease, transform .3s ease; }
.cla-aura { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.cla-aura i { position: absolute; width: 70vmax; height: 70vmax; border-radius: 50%; filter: blur(90px); opacity: .16; }
.cla-aura i:nth-child(1) { left: -25vmax; top: -30vmax; background: var(--copper); animation: drift-a 24s ease-in-out infinite alternate; }
.cla-aura i:nth-child(2) { right: -30vmax; bottom: -35vmax; background: var(--blue); opacity: .1; animation: drift-b 28s ease-in-out infinite alternate; }
.cla-aura i:nth-child(3) { left: 30%; bottom: -45vmax; width: 50vmax; height: 50vmax; background: var(--copper-lt); opacity: .18; animation: drift-a 32s ease-in-out infinite alternate-reverse; }
@keyframes drift-a { to { transform: translate(12vmax, 8vmax); } }
@keyframes drift-b { to { transform: translate(-10vmax, -12vmax); } }
.cla-top, .cla-inner { position: relative; width: min(680px, 100% - 32px); margin-inline: auto; }
.cla-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: max(12px, env(safe-area-inset-top)) 0 8px; }
.cla-id { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.cla-id b { font: 600 1.25rem/1 var(--font-head); }
.cla-pill { padding: .5em .8em; border: 1px solid rgba(200, 117, 51, .35); border-radius: var(--radius-pill); background: var(--copper-soft); color: var(--copper-deep); font: 700 .64rem/1 var(--font-body); letter-spacing: .1em; text-transform: uppercase; }
.cla-pill.quiet { border-color: var(--cla-line); background: var(--cla-glass); color: var(--cla-dim); }
.cla-x { display: grid; place-items: center; width: 44px; height: 44px; flex-shrink: 0; border: 1px solid var(--cla-line); border-radius: 50%; background: var(--white); color: var(--navy); box-shadow: var(--lift); cursor: pointer; }
.cla-x:hover { border-color: var(--copper-lt); }
/* New chat clears the conversation and brings back the front of the room */
.cla-acts { display: flex; align-items: center; gap: 8px; }
.cla-new { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 16px 0 12px; border: 1px solid var(--cla-line); border-radius: var(--radius-pill); background: var(--white); color: var(--navy); font: 500 .9rem/1 var(--font-body); box-shadow: var(--lift); cursor: pointer; }
.cla-new:hover { border-color: var(--copper-lt); }
.cla-new svg { width: 16px; height: 16px; color: var(--copper); }
.cla:not(.chatting) .cla-new { display: none; }
@media (max-width: 480px) { .cla.chatting .cla-pill { display: none; } }
.cla-x svg { width: 18px; height: 18px; }
.cla-body { position: relative; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; }
.cla-body .cla-inner { padding-bottom: 12px; }
/* The body runs up behind the header so the orb's rings and glow are never cut off; scrolled content fades out under the header */
.cla-top { grid-row: 1; grid-column: 1; z-index: 1; }
.cla-body { grid-row: 1 / 3; grid-column: 1; padding-top: calc(max(12px, env(safe-area-inset-top)) + 52px); }
.cla-body.scrolled { -webkit-mask-image: linear-gradient(transparent calc(max(12px, env(safe-area-inset-top)) + 40px), #000 calc(max(12px, env(safe-area-inset-top)) + 72px)); mask-image: linear-gradient(transparent calc(max(12px, env(safe-area-inset-top)) + 40px), #000 calc(max(12px, env(safe-area-inset-top)) + 72px)); }
.cla.chatting .cla-body { grid-row: 2; padding-top: 0; -webkit-mask-image: none; mask-image: none; }
.cla-dock { grid-row: 3; grid-column: 1; }
.orb-core { border-radius: 50%; background: radial-gradient(circle at 34% 28%, var(--copper-soft) 0%, var(--copper-lt) 16%, var(--copper) 38%, var(--navy-soft) 74%, var(--navy-deep) 100%); }
.cla-mark { display: grid; place-items: center; width: 30px; height: 30px; color: var(--copper); }
.cla-mark svg { width: 24px; height: 24px; filter: drop-shadow(0 0 8px rgba(200, 117, 51, .35)); }
.cla-hero { display: flex; flex-direction: column; align-items: center; padding: clamp(16px, 6vh, 64px) 0 24px; text-align: center; }
.cla.chatting .cla-hero { display: none; }
.cla-orb { position: relative; width: var(--orb); height: var(--orb); padding: 0; border: 0; border-radius: 50%; background: none; box-shadow: 0 0 60px rgba(200, 117, 51, .45), 0 0 120px rgba(0, 87, 164, .16); cursor: pointer; }
.cla-orb:focus-visible { outline-offset: 10px; }
.orb-core { position: absolute; inset: 0; overflow: hidden; isolation: isolate; clip-path: circle(50% at 50% 50%); box-shadow: inset 0 -18px 40px rgba(17, 29, 51, .55); animation: breathe 5.5s ease-in-out infinite; }
.orb-core::before { content: ""; position: absolute; inset: -35%; background: conic-gradient(from 0deg, transparent 0 18%, rgba(0, 87, 164, .6) 28%, transparent 42% 58%, rgba(251, 243, 234, .5) 68%, transparent 82%); filter: blur(16px); mix-blend-mode: screen; animation: swirl 10s linear infinite; }
.orb-core::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(circle at 50% 115%, rgba(0, 87, 164, .55), transparent 55%); mix-blend-mode: screen; }
.orb-ring { position: absolute; inset: 0; border: 1.5px solid rgba(212, 146, 77, .5); border-radius: 50%; opacity: 0; animation: ripple 5s ease-out infinite; }
.orb-ring:nth-child(2) { animation-delay: 1.66s; }
.orb-ring:nth-child(3) { animation-delay: 3.33s; }
.orb-spark { position: absolute; inset: 0; display: grid; place-items: center; color: var(--white); filter: drop-shadow(0 0 12px rgba(251, 243, 234, .85)); }
.orb-spark svg { width: 28%; height: 28%; }
.cla[data-state="listening"] .orb-ring { animation-duration: 1.5s; border-color: rgba(212, 146, 77, .85); }
.cla[data-state="listening"] .orb-core { animation-duration: 1.2s; }
.cla[data-state="listening"] .cla-mark svg { animation: breathe 1.2s ease-in-out infinite; }
.cla[data-state="thinking"] .orb-core::before { animation-duration: 1.8s; }
.cla[data-state="thinking"] .orb-spark svg { animation: swirl 2.6s linear infinite; }
.cla[data-state="thinking"] .cla-mark svg { animation: swirl 2.4s linear infinite; }
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
@keyframes swirl { to { transform: rotate(360deg); } }
@keyframes ripple { 0% { transform: scale(1); opacity: .6; } 100% { transform: scale(1.85); opacity: 0; } }
.cla-status { min-height: 1.3em; margin: 22px 0 0; color: var(--copper-deep); font-size: .74rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.cla-hello { margin: 6px 0; color: var(--navy); font: 700 clamp(2rem, 6vw, 2.8rem)/1.1 var(--font-head); }
.cla-sub { max-width: 34ch; margin: 0; color: var(--cla-dim); }
.cla-note-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin-top: 18px; padding: 0 16px 0 20px; border: 1px solid var(--cla-line); border-radius: var(--radius-pill); background: var(--white); color: var(--navy); font: 500 .92rem/1 var(--font-body); box-shadow: var(--lift); cursor: pointer; }
.cla-note-btn[hidden] { display: none; }
.cla-note-btn:hover { border-color: var(--copper-lt); }
.cla-note-btn svg { width: 16px; height: 16px; color: var(--copper-deep); transition: transform .2s ease; }
.cla-note-btn[aria-expanded="true"] svg { transform: rotate(180deg); }
.cla.has-note .cla-note-btn { margin-top: 12px; }
.cla-note { width: 100%; max-width: 520px; margin: 20px 0 0; padding: 16px 18px; border: 1px solid var(--cla-line); border-radius: 22px; background: var(--white); box-shadow: var(--lift); text-align: left; }
.cla-note-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 10px; color: var(--copper-deep); font-size: .7rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.cla-note-head small { color: var(--charcoal); font: inherit; letter-spacing: .06em; white-space: nowrap; }
.cla-note ul { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.cla-note li { position: relative; padding-left: 16px; color: var(--charcoal); font-size: .95rem; line-height: 1.5; }
.cla-note li::before { content: ""; position: absolute; left: 0; top: .62em; width: 6px; height: 6px; border-radius: 50%; background: var(--copper); }
.cla-note li b { color: var(--navy); }
.cla-note .btn { margin-top: 14px; }
/* With the note showing, the hero tightens so everything fits on one screen */
.cla.has-note { --orb: 116px; }
.cla.has-note .cla-hero { padding-top: 8px; padding-bottom: 12px; }
.cla.has-note .cla-status { margin-top: 10px; }
.cla.has-note .cla-hello { margin: 2px 0 0; font-size: clamp(1.6rem, 5vw, 2.2rem); }
.cla.has-note .cla-note { margin-top: 12px; }
.cla.has-note .cla-opts { margin-top: 14px; }
.cla.has-note .cla-opt .o { width: 52px; height: 52px; }
.cla-opts { display: flex; justify-content: center; gap: clamp(18px, 6vw, 34px); margin-top: 28px; }
.cla-opt { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 0; border: 0; background: none; color: var(--cla-dim); font: 700 .82rem var(--font-body); cursor: pointer; }
.cla-opt .o { display: grid; place-items: center; width: 64px; height: 64px; border: 1px solid var(--cla-line); border-radius: 50%; background: var(--white); color: var(--copper-deep); box-shadow: var(--lift); transition: transform .2s, border-color .2s, background .2s; }
.cla-opt .o svg { width: 26px; height: 26px; }
/* Recent chats: the clock at the top opens the chats set aside by New chat */
.cla-hist-btn { display: grid; place-items: center; width: 44px; height: 44px; flex-shrink: 0; border: 1px solid var(--cla-line); border-radius: 50%; background: var(--white); color: var(--copper-deep); box-shadow: var(--lift); cursor: pointer; }
.cla-hist-btn[hidden] { display: none; }
.cla-hist-btn[aria-expanded="true"] { border-color: var(--copper-lt); }
.cla-hist-btn svg { width: 20px; height: 20px; }
.cla-hist { position: absolute; top: calc(100% - 2px); right: 0; z-index: 3; width: min(360px, 100%); padding: 14px; border: 1px solid var(--cla-line); border-radius: 18px; background: var(--white); box-shadow: 0 18px 48px rgba(17, 29, 51, .18); }
.cla-hist h3 { display: flex; align-items: center; gap: 8px; margin: 2px 2px 10px; color: var(--cla-dim); font: 700 .7rem/1 var(--font-body); letter-spacing: .12em; text-transform: uppercase; }
.cla-hist h3 svg { width: 15px; height: 15px; color: var(--copper-deep); }
.cla-hist-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 48px; padding: 10px 12px; border: 0; border-radius: 12px; background: none; color: var(--navy); font: 500 .94rem/1.3 var(--font-body); text-align: left; cursor: pointer; }
.cla-hist-row + .cla-hist-row { border-top: 1px solid var(--cla-line); border-radius: 0 0 12px 12px; }
.cla-hist-row:hover { background: var(--copper-soft); }
.cla-hist-row span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cla-hist-row small { flex-shrink: 0; color: var(--cla-dim); font-size: .8rem; }
.cla-keep { margin: 8px 0 0; padding: 10px 4px 0; border-top: 1px solid var(--cla-line); color: var(--cla-dim); font-size: .82rem; }
/* Setup: how many recent chats to keep */
.set-keep { display: flex; flex-wrap: wrap; align-items: center; }
.keep-ctl { display: flex; flex-wrap: wrap; gap: 6px; }
.keep-ctl .chip { min-height: 44px; padding: 0 14px; cursor: pointer; }
.keep-ctl .chip:has(input[type="radio"]:checked) { background: var(--navy); border-color: var(--navy); color: var(--white); }
.keep-last { gap: 8px; padding-right: 6px; }
.keep-last label { display: flex; align-items: center; min-height: 42px; cursor: pointer; }
.keep-ctl .keep-n { width: 54px; min-height: 32px; padding: 2px 6px; border-radius: 999px; background: var(--white); color: var(--navy); text-align: center; }
.cla-opt:hover, .cla-opt:focus-within { color: var(--navy); }
.cla-opt:hover .o, .cla-opt:focus-within .o { transform: translateY(-3px); border-color: var(--copper); background: var(--copper-soft); }
.cla-log { display: flex; flex-direction: column; gap: 18px; padding-top: 12px; }
.cm { display: flex; align-items: flex-start; gap: 12px; animation: rise .35s ease-out; }
.cm.me { justify-content: flex-end; }
.cm-ic { position: relative; display: grid; place-items: center; width: 28px; height: 28px; flex-shrink: 0; color: var(--copper); }
.cm-ic svg { width: 20px; height: 20px; }
.cm-ic.settle svg { animation: settle .55s cubic-bezier(.2, .8, .2, 1); }
.cm-ic.spin { animation: swirl 1.8s linear infinite; }
.cm-ic.spin i { position: absolute; width: 6px; height: 6px; border-radius: 50%; background: var(--copper); animation: floaty 1.1s ease-in-out infinite; }
.cm-ic.spin i:nth-child(1) { top: 2px; left: 11px; }
.cm-ic.spin i:nth-child(2) { top: 11px; right: 2px; animation-delay: .14s; }
.cm-ic.spin i:nth-child(3) { bottom: 2px; left: 11px; animation-delay: .28s; }
.cm-ic.spin i:nth-child(4) { top: 11px; left: 2px; animation-delay: .42s; }
@keyframes floaty { 0%, 100% { transform: scale(.65); opacity: .5; } 50% { transform: scale(1.15); opacity: 1; } }
@keyframes settle { from { transform: scale(.3) rotate(-120deg); opacity: 0; } to { transform: none; opacity: 1; } }
.cm-t { min-width: 0; line-height: 1.6; }
.cm.ai .cm-t { padding-top: 3px; color: var(--charcoal); font-size: 1.02rem; }
.cm.ai .cm-t b { color: var(--navy); }
.cm.me .cm-t { max-width: 80%; padding: 10px 16px; border-radius: 22px 22px 6px 22px; background: var(--navy); color: var(--white); }
.cm-t .btn { margin-top: 12px; }
.cm-t svg { width: 16px; height: 16px; vertical-align: -3px; }
.ai-note-list { margin: 8px 0 0; padding-left: 18px; }
.ai-note-list li { margin: 4px 0; }
.cm-img { display: block; max-width: 200px; max-height: 220px; border-radius: 14px; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.cla .dots i, .cla .listen i { background: var(--copper); }
.cla-dock { position: relative; padding: 10px 0 max(14px, env(safe-area-inset-bottom)); background: linear-gradient(rgba(243, 241, 236, 0), rgba(243, 241, 236, .94) 30%); }
.cla-sugs { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 12px; scrollbar-width: none; }
.cla-sugs::-webkit-scrollbar { display: none; }
.cla-chip { flex-shrink: 0; min-height: 44px; padding: 0 16px; border: 1px solid var(--cla-line); border-radius: var(--radius-pill); background: var(--white); color: var(--navy); font: 500 .9rem var(--font-body); white-space: nowrap; cursor: pointer; }
.cla-chip:hover { border-color: var(--copper); }
.cla-ask { display: flex; align-items: center; gap: 8px; }
.cla-tool { display: grid; place-items: center; width: 48px; height: 48px; flex-shrink: 0; border: 1px solid var(--cla-line); border-radius: 50%; background: var(--white); color: var(--copper-deep); cursor: pointer; padding: 0; font: inherit; }
@media (max-width: 420px) { .cla-ask { gap: 6px; } .cla-tool { width: 44px; height: 44px; } .cla-field { padding-left: 14px; } }
.cla-tool:hover { border-color: var(--copper); }
.cla-tool:focus-within { outline: 3px solid var(--copper-lt); outline-offset: 2px; }
.cla-tool svg { width: 22px; height: 22px; }
/* Talk, Snap and Upload show once: on the front of the room, and beside the box only while chatting */
.cla:not(.chatting) .cla-tool { display: none; }
.cla-field { display: flex; flex: 1; align-items: center; gap: 6px; min-width: 0; min-height: 52px; padding: 4px 4px 4px 18px; border: 1px solid var(--cla-line); border-radius: var(--radius-pill); background: var(--white); box-shadow: var(--lift); }
.cla-field:focus-within { border-color: var(--copper); }
.cla-field input { flex: 1; min-width: 0; padding: 0; border: 0; background: none; color: var(--navy); font: 400 1rem var(--font-body); outline: none; }
.cla-field input::placeholder { color: rgba(74, 74, 74, .6); }
.cla-send { display: grid; place-items: center; width: 44px; height: 44px; flex-shrink: 0; border: 0; border-radius: 50%; background: var(--copper); color: var(--white); cursor: pointer; }
.cla-send:hover { background: var(--copper-deep); }
.cla-send svg { width: 20px; height: 20px; }
.cla-fine { margin: 10px 0 0; text-align: center; color: rgba(74, 74, 74, .75); font-size: .74rem; }
.dots, .listen { display: inline-flex; align-items: center; gap: 4px; vertical-align: middle; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--olive); animation: blink 1s infinite; }
.dots i:nth-child(2) { animation-delay: .15s; }
.dots i:nth-child(3) { animation-delay: .3s; }
.listen { margin-right: 6px; }
.listen i { width: 3px; height: 14px; border-radius: 2px; background: var(--copper); animation: wave .9s infinite ease-in-out; }
.listen i:nth-child(2) { animation-delay: .12s; }
.listen i:nth-child(3) { animation-delay: .24s; }
.listen i:nth-child(4) { animation-delay: .36s; }
.listen i:nth-child(5) { animation-delay: .48s; }
@keyframes blink { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
@keyframes wave { 0%, 100% { transform: scaleY(.4); } 50% { transform: scaleY(1.2); } }

/* Earlier records fold away */
.older { margin-top: 24px; }
.older > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; cursor: pointer; font: 600 1.2rem/1.2 var(--font-head); color: var(--navy); }
.older > summary span { font: 700 .9rem var(--font-body); font-variant-numeric: tabular-nums; }
.older[open] > summary { margin-bottom: 12px; }

/* Coming in, next 30 days */
.card-total { font: 700 1.3rem/1.2 var(--font-head); color: var(--navy); font-variant-numeric: tabular-nums; }
.weeks { list-style: none; margin: 4px 0 8px; padding: 0; }
.weeks li { display: grid; grid-template-columns: 7.4rem 1fr 5.2rem; gap: 2px 12px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line); }
.weeks li:first-child { border-top: 0; }
.weeks .wk { color: var(--navy); font-size: .88rem; font-weight: 500; }
.weeks i { height: 8px; border-radius: 4px; background: var(--stone); overflow: hidden; }
.weeks s { display: block; height: 100%; border-radius: 0 4px 4px 0; background: var(--copper); }
.weeks b { text-align: right; color: var(--navy); font-variant-numeric: tabular-nums; }
.weeks .who { grid-column: 1 / -1; font-size: .8rem; color: var(--charcoal); }

/* Clients: each side of the business, and how fast each client pays */
/* Header tiles: each page's key figures, in the space beside the title */
.band-grid { display: grid; gap: 14px; }
.tiles { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; }
.tile { display: flex; flex-direction: column; justify-content: center; gap: 3px; min-width: 0; min-height: 60px; padding: 8px 10px; border: 1px solid var(--glass-line); border-radius: 12px; background: var(--glass); color: var(--white); font: inherit; text-align: left; }
button.tile { cursor: pointer; }
button.tile:hover { border-color: var(--copper-lt); }
.tile span { overflow: hidden; color: rgba(255, 255, 255, .66); font-size: .64rem; font-weight: 700; letter-spacing: .08em; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.tile b { color: var(--white); font: 700 1rem/1.15 var(--font-head); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tile[aria-pressed="true"] { border-color: var(--white); background: var(--white); }
.tile[aria-pressed="true"] span { color: var(--olive); }
.tile[aria-pressed="true"] b { color: var(--navy); }
.list-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 10px; color: var(--navy); font-weight: 700; }
.list-head button { min-height: 44px; padding: 0; border: 0; background: none; color: var(--blue); font: 500 .92rem var(--font-body); cursor: pointer; }
.cl-pay { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; font-size: .84rem; color: var(--charcoal); }

/* Export for the CPA */
.title-row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 20px; }
.title-row h1 { margin: 0; }
.xsum { display: grid; gap: 8px; margin: 4px 0 14px; }
.xsum div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 14px; border-radius: 10px; background: var(--white); box-shadow: var(--lift); }
.xsum b { color: var(--navy); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl-wrap { max-height: 300px; overflow: auto; border-radius: 10px; background: var(--white); box-shadow: var(--lift); }
.xtbl { width: 100%; border-collapse: collapse; font-size: .84rem; font-variant-numeric: tabular-nums; }
.xtbl th { position: sticky; top: 0; padding: 8px 10px; background: var(--stone); text-align: left; font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; color: var(--olive); white-space: nowrap; }
.xtbl td { padding: 8px 10px; border-top: 1px solid var(--line); color: var(--charcoal); white-space: nowrap; }
.xtbl .r { color: var(--navy); }

/* Toast */
.toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + 14px + env(safe-area-inset-bottom)); z-index: 80; max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 12px; background: var(--navy); color: var(--white); font-size: .92rem; box-shadow: var(--shadow); opacity: 0; visibility: hidden; transform: translate(-50%, 12px); transition: opacity .2s, transform .2s, visibility 0s .2s; }
.toast.show { opacity: 1; visibility: visible; transform: translate(-50%, 0); transition: opacity .2s, transform .2s; }

/* Sample data switch (build helper) */
.sample-switch { padding: 6px 0 10px; }
.ss { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: var(--charcoal); font: 500 .8rem var(--font-body); cursor: pointer; }
.ss input { appearance: none; -webkit-appearance: none; position: relative; width: 34px; height: 20px; margin: 0; border-radius: 999px; background: rgba(74, 74, 74, .3); cursor: pointer; transition: background .2s; }
.ss input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--white); transition: transform .2s; }
.ss input:checked { background: var(--olive); }
.ss input:checked::after { transform: translateX(14px); }

.foot-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.powered { display: block; width: 76px; height: auto; }
@media (max-width: 480px) { .powered { width: 68px; } }
footer { background: var(--navy-deep); color: rgba(255, 255, 255, .55); font-size: .85rem; padding: 24px 0 calc(24px + var(--nav-h) + env(safe-area-inset-bottom)); }

/* Without the script (some file viewers), the tabs still switch screens */
html:not(.js) .view { display: none; }
html:not(.js) .view:target, html:not(.js) main:not(:has(.view:target)) > #overview { display: block; }
html:not(.js):has(.view:target) .tab[data-tab="overview"] { color: rgba(255, 255, 255, .6); background: none; }
html:not(.js):has(.view:target) .tab[data-tab="overview"]::before { display: none; }
html:not(.js):has(#invoices:target) .tab[data-tab="invoices"],
html:not(.js):has(#expenses:target) .tab[data-tab="expenses"],
html:not(.js):has(#clients:target) .tab[data-tab="clients"] { color: var(--white); }
html:not(.js):has(#invoices:target) .tab[data-tab="invoices"]::before,
html:not(.js):has(#expenses:target) .tab[data-tab="expenses"]::before,
html:not(.js):has(#clients:target) .tab[data-tab="clients"]::before { content: ""; position: absolute; top: 0; left: 30%; right: 30%; height: 3px; border-radius: 0 0 3px 3px; background: var(--copper); }

@media (min-width: 800px) {
  footer { padding-bottom: 24px; }
  .tabs { position: static; display: flex; gap: 4px; padding: 0; border: 0; background: none; }
  .tab { flex-direction: row; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: var(--radius-pill); font-size: .92rem; }
  .tab svg { width: 18px; height: 18px; }
  .tab:hover { color: var(--white); background: var(--glass); }
  .tab[aria-current="page"] { background: rgba(255, 255, 255, .1); }
  .tab-ai { order: 5; margin-left: 8px; box-shadow: inset 0 0 0 1.5px rgba(212, 146, 77, .55); color: var(--white); }
  .tab-ai .spark { width: auto; height: auto; margin: 0; background: none; box-shadow: none; }
  .tab .spark svg { width: 16px; height: 16px; }
  .tab[aria-current="page"]::before { top: auto; bottom: 3px; left: 18px; right: 18px; height: 2px; border-radius: 2px; }
  html:not(.js) .tab::before { top: auto; bottom: 3px; left: 18px; right: 18px; height: 2px; border-radius: 2px; }
  html:not(.js):has(#invoices:target) .tab[data-tab="invoices"],
  html:not(.js):has(#expenses:target) .tab[data-tab="expenses"],
  html:not(.js):has(#clients:target) .tab[data-tab="clients"] { background: rgba(255, 255, 255, .1); }
  .stage { padding: 44px 0 56px; }
  .band { padding: 24px 0 26px; }
  .band-grid { grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 40px; }
  .band-grid .band-row { justify-content: flex-start; gap: 20px; }
  .tiles { justify-self: end; width: min(100%, 640px); }
  .tile { min-height: 66px; padding: 10px 16px; }
  .tile span { font-size: .68rem; }
  .tile b { font-size: 1.25rem; }
  .section { padding: 32px 0 56px; }
  .ov-grid { grid-template-columns: 1.45fr 1fr; align-items: start; }
  .exp-grid { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; }
  .exp-grid .cats { order: 2; position: sticky; top: 16px; }
  .sheet { left: 50%; right: auto; top: 50%; bottom: auto; width: min(720px, 100vw - 48px); max-height: 88vh; border-radius: 18px; opacity: 0; transform: translate(-50%, -46%); transition: transform .25s, opacity .25s, visibility 0s .25s; }
  .sheet.open { opacity: 1; transform: translate(-50%, -50%); transition: transform .25s, opacity .25s; }
  .sheet-foot { border-radius: 0 0 18px 18px; padding-bottom: 12px; }
  .sheet-foot .btn { flex: 0 0 auto; }
  .toast { bottom: 24px; }
  .cla { --orb: 200px; }
  .cla.has-note { --orb: 150px; }
}
@media (min-width: 1600px) {
  .wrap { width: min(1280px, 100% - 64px); }
}
@media (max-width: 480px) {
  .tile { padding: 8px 6px; }
  .tile span { font-size: .58rem; letter-spacing: .02em; }
  .tile b { font-size: .92rem; }
  .seg { gap: 2px; }
  .seg button { padding: 0 10px; font-size: .84rem; }
}
@media (max-width: 520px) {
  .line { grid-template-columns: 1fr 44px; }
  .line [data-f="desc"] { grid-column: 1 / -1; }
  .line + .line { padding-top: 10px; border-top: 1px solid var(--line); }
}
@media (max-width: 400px) { .tile span { letter-spacing: 0; } }
/* iPad in portrait: a little less room between tabs, so a longer business name fits the top bar */
@media (min-width: 800px) and (max-width: 1023px) { .tab { padding: 0 12px; } }
@media (max-width: 420px) {
  .stab { padding: 8px 7px; }
  .stab[aria-pressed="true"] b { font-size: 1rem; }
  .chart-card { padding-inline: 14px; }
  .ch-grid div { margin-left: 36px; }
  .ch-cols { left: 36px; }
  .two { grid-template-columns: 1fr; gap: 0; }
  .aging li { grid-template-columns: 6.6rem 1fr 4.4rem; }
}
@media (prefers-reduced-motion: reduce) {
  .flow-dot, .flow-drop { display: none; }
  .flow.run .node, .flow.run .stop b::after, .node, .shim, .row.flash, .dots i, .listen i, .cla-aura i, .orb-core, .orb-core::before, .cla-mark svg, .orb-spark svg, .cm, .cm-ic, .cm-ic i, .cm-ic svg, .home-glow i, .home-stage .biz-card { animation: none !important; }
  .orb-ring { display: none; }
  .cla, .cla.open { transition: none; }
  .sheet, .sheet.open, .scrim, .scrim.open, .toast, .toast.show { transition: none; }
}
@media print {
  body.sheet-open { padding: 0; background: var(--white); overflow: visible; }
  body.sheet-open > :not(.sheet) { display: none !important; }
  body.sheet-open .sheet { position: static; visibility: visible; opacity: 1; transform: none; width: auto; max-height: none; box-shadow: none; border-radius: 0; background: var(--white); }
  body.sheet-open .sheet-head, body.sheet-open .sheet-foot, body.sheet-open .sheet-body > :not(.inv) { display: none !important; }
  body.sheet-open .sheet-body { overflow: visible; padding: 0; }
  .inv { border: 0; padding: 0; }
}

/* ---------- The signed-in app (added when Money moved to its own home, 2026-10-28) ---------- */
/* Nothing shows until the books are open, so no screen flashes empty or someone else's numbers */
.booting > :not(.gate), .gated > :not(.gate) { visibility: hidden; }
.gate { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 24px 16px; background: var(--navy-deep); overflow-y: auto; }
.gate[hidden] { display: none; }
.gate-card { width: min(440px, 100%); padding: 32px 28px; border-radius: var(--radius); background: var(--paper); box-shadow: var(--shadow); text-align: center; }
.gate-eyebrow { font: 700 .74rem/1.2 var(--font-body); letter-spacing: .14em; text-transform: uppercase; color: var(--copper-deep); margin: 0 0 8px; }
.gate-title { font-size: 1.9rem; margin-bottom: 8px; }
.gate-text { color: var(--charcoal); }
.gate-text:empty, .gate-actions:empty { display: none; }
#gate-signin { display: flex; justify-content: center; }
#gate-signin:empty { display: none; }
.gate-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 16px 0 0; }
.gate-actions .btn { text-decoration: none; }
/* An owner opens on their own business: no Home */
.no-home .home-mark, .no-home.at-home .home-mark { display: none; }
.no-home #biz-btn { display: inline-flex; }
/* Before the first business, Home is the only place */
.no-biz .tabs, .no-biz #biz-btn { display: none; }
.linkish { padding: 0; border: 0; background: none; color: var(--copper-deep); font: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.signed-in { margin-top: 14px; }
/* Import */
.import-hint { margin: -6px 0 14px; }
.import-pick { margin: 4px 0 12px; cursor: pointer; }
.import-count { margin: 6px 0 2px; }
