/* Folga app. One codebase, two layouts: a sidebar workspace from 960px up, a thumb-first phone app below. */
:root {
  --bg: #eef3f1; --surface: #ffffff; --surface-2: #e4ece9; --ink: #0b2028; --muted: #587069;
  --sun: #d9733a; --sun-soft: rgba(217, 115, 58, .14); --coral: #d24a3a; --glass: #178f7b; --glass-soft: rgba(23, 143, 123, .13);
  --line: rgba(11, 32, 40, .1); --hero-a: #0f2f39; --hero-b: #1b4b57; --hero-ink: #eaf2ef; --hero-sun: #ffb37a;
  --shadow: 0 18px 50px -24px rgba(11, 32, 40, .35);
  --f-display: 'Bodoni Moda', 'Bodoni 72', Didot, Georgia, serif;
  --f-body: 'Hanken Grotesk', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --f-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --r: 22px;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #071a21; --surface: #0d2730; --surface-2: #133540; --ink: #eaf2ef; --muted: #8ea8a5; --sun: #ffb37a; --sun-soft: rgba(255, 179, 122, .14);
  --coral: #ff6f5e; --glass: #5fd0bb; --glass-soft: rgba(95, 208, 187, .13); --line: rgba(234, 242, 239, .1); --hero-a: #0b2830; --hero-b: #123d48;
  --shadow: 0 18px 50px -24px rgba(0, 0, 0, .8); color-scheme: dark; } }
:root[data-theme="dark"] {
  --bg: #071a21; --surface: #0d2730; --surface-2: #133540; --ink: #eaf2ef; --muted: #8ea8a5; --sun: #ffb37a; --sun-soft: rgba(255, 179, 122, .14);
  --coral: #ff6f5e; --glass: #5fd0bb; --glass-soft: rgba(95, 208, 187, .13); --line: rgba(234, 242, 239, .1); --hero-a: #0b2830; --hero-b: #123d48;
  --shadow: 0 18px 50px -24px rgba(0, 0, 0, .8); color-scheme: dark; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100dvh; background: var(--bg); color: var(--ink); font: 400 15px/1.45 var(--f-body); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--sun); outline-offset: 2px; border-radius: 8px; }
h1, h2, h3 { margin: 0; font-weight: 500; }
.num, .money { font-variant-numeric: tabular-nums lining-nums; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.pos { color: var(--glass); }
.neg { color: var(--coral); }
.mono { font-family: var(--f-mono); font-size: 12px; letter-spacing: .04em; }
.hide-values .money, .hide-values .odo { filter: blur(8px); transition: filter .3s; }
.hide-values .money:hover { filter: none; }
svg.i { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.boot { min-height: 100dvh; display: grid; place-items: center; }
.boot-sun { width: 56px; height: 28px; border-radius: 56px 56px 0 0; background: var(--sun); animation: breathe 1.6s var(--ease) infinite alternate; }
@keyframes breathe { from { transform: scale(.85); opacity: .5; } to { transform: none; opacity: 1; } }

/* ---------------------------------------------------------------- buttons, fields */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 18px; border-radius: 999px; font-weight: 600; font-size: 14px; border: 1px solid var(--line); background: var(--surface); transition: transform .2s var(--ease), background .2s, border-color .2s; white-space: nowrap; }
.btn:hover { border-color: color-mix(in srgb, var(--ink) 30%, transparent); }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--ink); color: var(--bg); border-color: transparent; }
.btn.sun { background: var(--sun); color: #1a0f08; border-color: transparent; }
.btn.danger { color: var(--coral); }
.btn.danger.fill { background: var(--coral); color: #fff; border-color: transparent; }
.btn.small { min-height: 34px; padding: 0 14px; font-size: 13px; }
.btn.ghost { background: transparent; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line); background: var(--surface); }
.link { color: var(--sun); font-weight: 600; text-decoration: none; }
.link:hover { text-decoration: underline; }
kbd { font: 500 11px/1 var(--f-mono); padding: 3px 6px; border-radius: 6px; border: 1px solid currentColor; opacity: .55; }

.f { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.in, select.in, textarea.in { width: 100%; min-height: 46px; padding: 10px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font-size: 15px; font-weight: 500; transition: border-color .2s, box-shadow .2s; }
.in:focus { outline: none; border-color: var(--sun); box-shadow: 0 0 0 4px var(--sun-soft); }
textarea.in { min-height: 70px; resize: vertical; }
.in.big { font: 500 34px/1 var(--f-display); min-height: 64px; text-align: center; }
.hint { font-size: 12.5px; color: var(--muted); font-weight: 400; line-height: 1.45; }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.row.between { justify-content: space-between; }
.stack { display: grid; gap: 14px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.three { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 560px) { .three { grid-template-columns: 1fr; } }

.seg { display: flex; padding: 4px; border-radius: 999px; background: var(--surface-2); position: relative; }
.seg button { flex: 1; min-height: 36px; border-radius: 999px; font-size: 13.5px; font-weight: 600; color: var(--muted); position: relative; z-index: 1; transition: color .25s; padding: 0 10px; }
.seg button[aria-pressed="true"] { color: var(--ink); }
.seg .pill { position: absolute; top: 4px; bottom: 4px; border-radius: 999px; background: var(--surface); box-shadow: 0 4px 14px -6px rgba(0, 0, 0, .3); transition: left .35s var(--ease), width .35s var(--ease); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 13px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: 13.5px; font-weight: 500; transition: background .2s, border-color .2s, transform .2s var(--ease); }
.chip:active { transform: scale(.96); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: transparent; }
.chip.add { border-style: dashed; color: var(--muted); }

.switch { position: relative; width: 46px; height: 28px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); transition: background .25s; }
.switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--surface); box-shadow: 0 2px 6px rgba(0, 0, 0, .25); transition: transform .35s var(--ease); }
.switch input:checked + span { background: var(--glass); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 2px solid var(--sun); outline-offset: 2px; }
.switch input:disabled + span { opacity: .45; }

/* ---------------------------------------------------------------- login */
.login { min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
.login-art { position: relative; overflow: clip; background: radial-gradient(120% 90% at 20% 110%, #2a5a63 0%, var(--hero-a) 45%, #061820 100%); color: var(--hero-ink); padding: clamp(28px, 4vw, 56px); display: flex; flex-direction: column; justify-content: space-between; gap: 32px; isolation: isolate; }
.login-art canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }
.login-art::after { content: ''; position: absolute; width: 520px; height: 520px; right: -160px; bottom: -260px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 179, 122, .55), rgba(255, 111, 94, .12) 45%, transparent 70%); z-index: -1; animation: sunrise 2.4s var(--ease) both; }
@keyframes sunrise { from { transform: translateY(160px); opacity: 0; } }
.brand { display: inline-flex; align-items: center; gap: 10px; font: italic 500 28px/1 var(--f-display); text-decoration: none; }
.brand svg { width: 34px; height: 22px; }
.login-copy h1 { font: 400 clamp(38px, 4.6vw, 68px)/1.02 var(--f-display); letter-spacing: -.02em; max-width: 12ch; }
.login-copy h1 em { color: var(--hero-sun); }
.login-copy p { max-width: 42ch; color: rgba(234, 242, 239, .72); font-size: 16px; margin: 18px 0 0; }
.flap { display: grid; gap: 6px; width: max-content; padding: 14px; border-radius: 18px; background: rgba(0, 0, 0, .28); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08); backdrop-filter: blur(6px); }
.flap-row { display: flex; gap: 4px; }
.flap-cell { width: clamp(20px, 2.2vw, 32px); height: clamp(30px, 3.2vw, 46px); display: grid; place-items: center; border-radius: 6px; background: linear-gradient(#123640 50%, #0d2a33 50%); font: 500 clamp(15px, 1.6vw, 24px)/1 var(--f-mono); color: #f4efe6; position: relative; perspective: 200px; box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .4); }
.flap-cell::after { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: rgba(0, 0, 0, .55); }
.flap-cell.flip { animation: flap .14s linear; }
.flap-row.sun .flap-cell { color: var(--hero-sun); }
@keyframes flap { 0% { transform: rotateX(0); } 50% { transform: rotateX(-88deg); } 100% { transform: rotateX(0); } }
.login-foot { display: flex; gap: 18px; flex-wrap: wrap; font: 500 11px/1.4 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: rgba(234, 242, 239, .55); }
.login-foot span::before { content: '●'; color: var(--glass); margin-right: 8px; }

.login-side { display: grid; place-items: center; padding: clamp(24px, 4vw, 64px); position: relative; }
.login-card { width: min(400px, 100%); display: grid; gap: 22px; animation: rise .9s .15s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(24px); } }
.login-card h2 { font: 400 36px/1.05 var(--f-display); }
.login-card .seg { margin-bottom: 4px; }
.fl { position: relative; }
.fl input { width: 100%; height: 58px; padding: 22px 46px 6px 16px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); font-size: 16px; transition: border-color .25s, box-shadow .25s; }
.fl label { position: absolute; left: 17px; top: 19px; font-size: 15px; color: var(--muted); pointer-events: none; transition: transform .3s var(--ease), font-size .3s var(--ease), color .3s; transform-origin: left top; }
.fl input:focus { outline: none; border-color: var(--sun); box-shadow: 0 0 0 4px var(--sun-soft); }
.fl input:focus + label, .fl input:not(:placeholder-shown) + label { transform: translateY(-11px); font-size: 11.5px; color: var(--sun); font-weight: 600; letter-spacing: .02em; }
.fl .eye { position: absolute; right: 8px; top: 9px; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; color: var(--muted); }
.fl.hidden { display: none; }
.login-msg { min-height: 20px; font-size: 13.5px; color: var(--coral); font-weight: 500; }
.login-msg.ok { color: var(--glass); }
.shake { animation: shake .45s var(--ease); }
@keyframes shake { 20% { transform: translateX(-10px); } 40% { transform: translateX(8px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(3px); } }
.go { position: relative; height: 56px; width: 100%; border-radius: 999px; background: var(--ink); color: var(--bg); font-weight: 700; font-size: 15.5px; overflow: hidden; transition: width .45s var(--ease), border-radius .45s var(--ease), background .3s; justify-self: center; }
.go .lbl { transition: opacity .2s, transform .3s var(--ease); display: inline-block; }
.go::before { content: ''; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .2) 50%, transparent 70%); transform: translateX(-100%); transition: transform .8s var(--ease); }
.go:hover::before { transform: translateX(100%); }
.go.busy { width: 56px; }
.go.busy .lbl, .go.done .lbl { opacity: 0; transform: translateY(10px); }
.go .spin { position: absolute; inset: 0; margin: auto; width: 22px; height: 22px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; opacity: 0; }
.go.busy .spin { opacity: 1; animation: spin .7s linear infinite; }
.go.done { width: 56px; background: var(--glass); }
.go .ok { position: absolute; inset: 0; margin: auto; width: 24px; height: 24px; stroke: #fff; stroke-width: 2.6; fill: none; stroke-dasharray: 30; stroke-dashoffset: 30; }
.go.done .ok { stroke-dashoffset: 0; transition: stroke-dashoffset .4s .1s var(--ease); }
@keyframes spin { to { transform: rotate(360deg); } }
.demo-note { padding: 12px 14px; border-radius: 14px; background: var(--sun-soft); font-size: 13.5px; }
.wipe { position: fixed; z-index: 100; inset: 0; background: var(--bg); clip-path: circle(0 at var(--x, 50%) var(--y, 50%)); transition: clip-path .75s var(--ease); pointer-events: none; }
.wipe.on { clip-path: circle(150% at var(--x, 50%) var(--y, 50%)); }
.wipe.out { opacity: 0; transition: opacity .5s; }
@media (max-width: 899px) {
  .login { grid-template-columns: 1fr; }
  .login-art { min-height: 46dvh; border-radius: 0 0 32px 32px; padding-top: max(24px, env(safe-area-inset-top)); }
  .login-copy h1 { font-size: 38px; }
  .login-copy p, .login-foot { display: none; }
  .login-side { place-items: start center; padding-top: 28px; }
}

/* ---------------------------------------------------------------- shell */
.shell { display: grid; grid-template-columns: 256px minmax(0, 1fr); min-height: 100dvh; }
.side { position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; gap: 18px; padding: 24px 16px 18px; border-right: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 55%, var(--bg)); }
.side .brand { padding: 0 10px; color: var(--ink); }
.ws-btn { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); text-align: left; transition: border-color .2s; }
.ws-btn:hover { border-color: var(--sun); }
.ws-btn b { display: block; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-btn small { display: block; color: var(--muted); font-size: 12px; }
.ws-btn > span:nth-child(2) { flex: 1; min-width: 0; }
.ws-dot { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: var(--sun-soft); color: var(--sun); font: italic 600 15px/1 var(--f-display); flex: none; }
.ws-dot.biz { background: var(--glass-soft); color: var(--glass); }
.nav { display: grid; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; text-decoration: none; color: var(--muted); font-weight: 600; font-size: 14.5px; position: relative; transition: color .2s, background .2s; }
.nav a:hover { color: var(--ink); background: var(--surface-2); }
.nav a[aria-current="page"] { color: var(--ink); background: var(--surface); box-shadow: 0 6px 18px -12px rgba(0, 0, 0, .35); }
.nav a[aria-current="page"]::before { content: ''; position: absolute; left: -16px; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--sun); }
.count { margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 99px; background: var(--sun); color: #1a0f08; font: 600 12px/22px var(--f-body); text-align: center; }
.count:empty { display: none; }
.side .btn.primary { width: 100%; justify-content: space-between; }
.side-foot { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 14px; text-decoration: none; }
.side-foot:hover { background: var(--surface-2); }
.side-foot span { min-width: 0; }
.side-foot b, .side-foot small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-foot small { color: var(--muted); font-size: 12px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex: none; background: linear-gradient(140deg, var(--hero-sun), var(--coral)); color: #1a0f08; font-weight: 700; font-size: 14px; }

.main { min-width: 0; padding: 30px clamp(20px, 3vw, 48px) 64px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head h1 { font: 400 clamp(30px, 3vw, 42px)/1.05 var(--f-display); letter-spacing: -.01em; }
.page-head p { margin: 6px 0 0; color: var(--muted); }
.view-in > * { animation: rise .6s var(--ease) both; }
.view-in > *:nth-child(2) { animation-delay: .05s; }
.view-in > *:nth-child(3) { animation-delay: .1s; }
.view-in > *:nth-child(4) { animation-delay: .15s; }

.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 18px; }
.c3 { grid-column: span 3; } .c4 { grid-column: span 4; } .c5 { grid-column: span 5; } .c6 { grid-column: span 6; }
.c7 { grid-column: span 7; } .c8 { grid-column: span 8; } .c12 { grid-column: 1 / -1; }
.grid > * { animation: rise .7s var(--ease) both; }
.grid > *:nth-child(2) { animation-delay: .06s; } .grid > *:nth-child(3) { animation-delay: .12s; } .grid > *:nth-child(4) { animation-delay: .18s; }
.grid > *:nth-child(5) { animation-delay: .24s; } .grid > *:nth-child(6) { animation-delay: .3s; }
@media (max-width: 1240px) { .c3 { grid-column: span 6; } .c4, .c5 { grid-column: span 6; } .c7, .c8 { grid-column: span 12; } .c4.side-col { grid-column: span 12; grid-template-columns: 1fr 1fr; align-items: start; } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; min-width: 0; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.card-h h2 { font: 600 15px/1.3 var(--f-body); }
.card-h a, .card-h button.link { font-size: 13px; }
.empty { padding: 26px 10px; text-align: center; color: var(--muted); font-size: 14px; }
.empty b { display: block; color: var(--ink); font: 400 22px/1.2 var(--f-display); margin-bottom: 6px; }

.monthnav { display: inline-flex; align-items: center; gap: 4px; padding: 4px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }
.monthnav button { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; }
.monthnav button:hover { background: var(--surface-2); }
.monthnav button[disabled] { opacity: .3; pointer-events: none; }
.monthnav .mn-label { width: auto; min-width: 150px; height: 34px; padding: 0 14px; border-radius: 99px; display: inline-flex; justify-content: center; gap: 8px; font-weight: 600; text-transform: capitalize; font-size: 14px; }
.monthnav .mn-label svg { width: 16px; height: 16px; color: var(--sun); }
.monthnav .mn-label[aria-expanded="true"] { background: var(--surface-2); }

/* phone chrome */
.ptop, .tabbar { display: none; }
@media (max-width: 959px) {
  .shell { grid-template-columns: 1fr; align-content: start; }
  .side { display: none; }
  .main { padding: 8px 16px calc(104px + env(safe-area-inset-bottom)); }
  .ptop { display: flex; position: sticky; top: 0; z-index: 20; align-items: center; justify-content: space-between; gap: 10px; padding: max(10px, env(safe-area-inset-top)) 16px 10px; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
  .ptop .ws-btn { width: auto; max-width: 70%; padding: 6px 12px 6px 6px; border-radius: 999px; }
  .ptop .ws-dot { width: 28px; height: 28px; border-radius: 50%; }
  .ptop .ws-btn small { display: none; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); align-items: end; position: fixed; z-index: 30; left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); height: 66px; padding: 0 6px; border-radius: 24px; background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border: 1px solid var(--line); box-shadow: var(--shadow); transition: transform .4s var(--ease); }
  .tabbar a, .tabbar button { height: 100%; display: grid; place-items: center; align-content: center; gap: 3px; text-decoration: none; color: var(--muted); font-size: 10.5px; font-weight: 600; position: relative; }
  .tabbar a[aria-current="page"] { color: var(--ink); }
  .tabbar a[aria-current="page"] svg { stroke: var(--sun); }
  .tabbar .count { position: absolute; top: 8px; left: 52%; min-width: 18px; height: 18px; line-height: 18px; font-size: 10.5px; }
  .tabbar .fab { align-self: center; justify-self: center; width: 54px; height: 54px; border-radius: 18px; background: var(--ink); color: var(--bg); box-shadow: 0 10px 24px -8px rgba(11, 32, 40, .6); transform: translateY(-14px); transition: transform .25s var(--ease); }
  .tabbar .fab:active { transform: translateY(-14px) scale(.92); }
  .tabbar .fab svg { width: 26px; height: 26px; }
  body.sheet-open .tabbar { transform: translateY(140%); }
  .grid { grid-template-columns: 1fr; gap: 14px; }
  .grid > [class*="c"] { grid-column: auto; }
  .page-head { margin: 6px 0 16px; }
  .page-head h1 { font-size: 30px; }
  .card { padding: 16px; border-radius: 20px; }
  .desk-only { display: none !important; }
}
@media (min-width: 960px) { .phone-only { display: none !important; } }

/* ---------------------------------------------------------------- home */
.hello { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.hello h1 { font: 400 clamp(28px, 3vw, 40px)/1.05 var(--f-display); }
.hello p { margin: 4px 0 0; color: var(--muted); }
.hero { position: relative; overflow: clip; isolation: isolate; color: var(--hero-ink); border: 0; border-radius: 28px; padding: clamp(22px, 3vw, 34px); min-height: 300px; display: flex; flex-direction: column; justify-content: space-between; gap: 22px;
  background: radial-gradient(90% 120% at 100% 0%, var(--hero-b), var(--hero-a) 60%, #061820); box-shadow: 0 30px 70px -36px rgba(6, 24, 32, .8); }
.hero::before { content: ''; position: absolute; z-index: -1; width: 420px; height: 420px; right: -90px; top: -180px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 179, 122, .5), rgba(255, 111, 94, .1) 45%, transparent 70%); animation: sunrise 1.8s var(--ease) both; }
.hero.low::before { background: radial-gradient(circle, rgba(255, 111, 94, .55), rgba(255, 111, 94, .08) 45%, transparent 70%); }
.hero .waves { position: absolute; z-index: -1; left: 0; right: 0; bottom: 0; height: 110px; width: 200%; opacity: .5; }
.hero .waves path { animation: tide 14s linear infinite; }
.hero .waves path + path { animation-duration: 22s; opacity: .6; }
@keyframes tide { to { transform: translateX(-50%); } }
.hero-k { font: 500 11.5px/1 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: rgba(234, 242, 239, .7); display: flex; gap: 10px; align-items: center; }
.hero-k i { width: 8px; height: 8px; border-radius: 50%; background: var(--hero-sun); box-shadow: 0 0 0 6px rgba(255, 179, 122, .18); animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 11px rgba(255, 179, 122, 0); } }
.odo { display: flex; align-items: baseline; font: 400 clamp(54px, 7vw, 92px)/1 var(--f-display); letter-spacing: -.02em; margin-top: 14px; white-space: nowrap; }
.odo .od { display: inline-block; height: 1em; overflow: hidden; }
.odo .od-s { display: flex; flex-direction: column; transition: transform 1.6s var(--ease); }
.odo .od-s i { font-style: normal; height: 1em; line-height: 1; }
.odo .od-c { display: inline-block; }
.odo .cur { font-size: .42em; margin-right: .2em; align-self: flex-start; margin-top: .25em; color: rgba(234, 242, 239, .7); }
.hero-sub { color: rgba(234, 242, 239, .78); font-size: 15px; max-width: 46ch; }
.hero-sub b { color: var(--hero-sun); font-weight: 600; }
.hero-stats { display: flex; gap: clamp(16px, 3vw, 40px); flex-wrap: wrap; padding-top: 16px; border-top: 1px solid rgba(234, 242, 239, .14); }
.hero-stats div { display: grid; gap: 4px; }
.hero-stats small { font: 500 10.5px/1 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: rgba(234, 242, 239, .6); }
.hero-stats .money { font-size: 17px; font-weight: 600; }
.hero .btn { background: rgba(234, 242, 239, .12); color: var(--hero-ink); border-color: rgba(234, 242, 239, .2); }

.daybar { position: relative; height: 12px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin: 14px 0 8px; }
.daybar > span { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px; background: linear-gradient(90deg, var(--glass), var(--sun)); transform-origin: left; animation: growx 1.2s .2s var(--ease) both; }
.daybar > span.over { background: var(--coral); }
.daybar > i { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--ink); border-radius: 2px; }
@keyframes growx { from { transform: scaleX(0); } }
.legend { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }

.setup { background: linear-gradient(150deg, var(--sun-soft), transparent 60%), var(--surface); }
.setup h2 { font: 400 26px/1.15 var(--f-display); margin-bottom: 6px; }
.tour-offer { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; justify-content: space-between; background: linear-gradient(120deg, var(--glass-soft), transparent 70%), var(--surface); }
.tour-offer p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }

.bud { display: grid; gap: 14px; }
.bud-row { display: grid; gap: 6px; }
.bud-row .row { justify-content: space-between; font-size: 14px; }
.bar { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 99px; background: var(--glass); transform-origin: left; animation: growx 1s .2s var(--ease) both; }
.bar > span.warn { background: var(--sun); }
.bar > span.over { background: var(--coral); }

/* transaction list */
.tx-list { display: grid; }
.tx { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 6px; border-radius: 14px; text-align: left; width: 100%; transition: background .2s; }
.tx:hover { background: var(--surface-2); }
.tx .ic { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; background: var(--surface-2); font-size: 18px; }
.tx .ic.in { background: var(--glass-soft); }
.tx b { display: block; font-weight: 600; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tx small { display: block; color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tx .amt { font-weight: 600; font-size: 14.5px; text-align: right; }
.day-h { display: flex; justify-content: space-between; padding: 14px 6px 4px; font: 500 11px/1 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font: 500 11px/1 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); }
.table td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr.click { cursor: pointer; transition: background .15s; }
.table tr.click:hover td { background: var(--surface-2); }
.table td.r, .table th.r { text-align: right; }
.table .who { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.table .who span:first-child { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); font-size: 15px; flex: none; }
.tag { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 99px; background: var(--surface-2); font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.tag.sun { background: var(--sun-soft); color: var(--sun); }
.tag.glass { background: var(--glass-soft); color: var(--glass); }
.totals { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.totals div { padding: 14px 16px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); }
.totals small { display: block; font: 500 10.5px/1 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.totals .money { font: 500 clamp(18px, 2vw, 24px)/1 var(--f-display); }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 16px 0; }
.filters .in { min-height: 40px; width: auto; }
.filters .search { flex: 1 1 220px; }

/* inbox */
.inbox { display: grid; gap: 12px; }
.cap { position: relative; border-radius: 20px; overflow: hidden; background: var(--surface-2); }
.cap-bg { position: absolute; inset: 0; display: flex; justify-content: space-between; align-items: center; padding: 0 22px; font-weight: 700; font-size: 13px; }
.cap-bg span:first-child { color: var(--glass); }
.cap-bg span:last-child { color: var(--coral); }
.cap-card { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 16px; display: grid; gap: 12px; touch-action: pan-y; transition: transform .35s var(--ease), opacity .3s; }
.cap-card.drag { transition: none; }
.cap-top { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.cap-top .ic { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--sun-soft); font-size: 20px; }
.cap-top b { display: block; font-size: 15px; }
.cap-top small { color: var(--muted); font-size: 12.5px; }
.cap-top .money { font: 500 22px/1 var(--f-display); }
.cap .row select { flex: 1; min-height: 40px; }
.cap.gone { animation: gone .45s var(--ease) forwards; }
@keyframes gone { to { opacity: 0; transform: scale(.94); height: 0; margin: -6px 0; } }
.mini-cap { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.mini-cap:last-child { border-bottom: 0; }
.mini-cap small { display: block; color: var(--muted); font-size: 12px; }

/* accounts */
.accts { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.acct { position: relative; overflow: clip; text-align: left; border-radius: 22px; padding: 20px; min-height: 168px; display: flex; flex-direction: column; justify-content: space-between; gap: 18px; background: var(--surface); border: 1px solid var(--line); transition: transform .35s var(--ease), box-shadow .35s; }
.acct:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.acct.card-cc { color: #f4efe6; border: 0; background: linear-gradient(135deg, #1b4b57, #0b2028 60%), #0b2028; }
.acct.card-cc::after { content: ''; position: absolute; width: 240px; height: 240px; right: -80px; top: -110px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 179, 122, .45), transparent 65%); }
.acct .k { font: 500 11px/1 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; opacity: .7; }
.acct h3 { font: 600 17px/1.2 var(--f-body); margin-top: 6px; }
.acct .money.big { font: 400 30px/1 var(--f-display); }
.acct .last4 { font: 500 13px/1 var(--f-mono); letter-spacing: .18em; opacity: .8; }
.acct .bar { background: rgba(255, 255, 255, .14); }
.acct.add { border: 1.5px dashed var(--line); background: transparent; align-items: center; justify-content: center; color: var(--muted); font-weight: 600; }

/* categories */
.cat-list { display: grid; gap: 4px; }
.cat-item { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 8px 6px; border-radius: 14px; text-align: left; width: 100%; }
.cat-item:hover { background: var(--surface-2); }
.cat-item .ic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); font-size: 18px; }
.emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; }
.emoji-grid button { aspect-ratio: 1; border-radius: 12px; font-size: 20px; background: var(--surface-2); border: 2px solid transparent; }
.emoji-grid button[aria-pressed="true"] { border-color: var(--sun); background: var(--sun-soft); }

/* budget page */
.bud-table { display: grid; }
.bud-line { display: grid; grid-template-columns: 38px minmax(0, 1.3fr) minmax(0, 1fr) 150px 64px; gap: 14px; align-items: center; padding: 12px 4px; border-bottom: 1px solid var(--line); }
.bud-line:last-child { border-bottom: 0; }
.bud-line .ic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); font-size: 18px; }
.bud-line .in { min-height: 40px; text-align: right; }
.bud-line .fx { display: grid; justify-items: center; gap: 2px; font-size: 10.5px; color: var(--muted); }
@media (max-width: 700px) { .bud-line { grid-template-columns: 38px minmax(0, 1fr) 112px; } .bud-line .bar-cell { grid-column: 2 / -1; grid-row: 2; } .bud-line .fx { grid-column: 3; grid-row: 2; justify-items: end; } .bud-line .bar-cell { grid-column: 2; } }

/* reports */
.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.kpi { padding: 16px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); display: grid; gap: 8px; position: relative; overflow: clip; }
.kpi small { font: 500 10.5px/1.2 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.kpi .money { font: 400 clamp(20px, 2vw, 28px)/1 var(--f-display); }
.kpi em { font-style: normal; font-size: 12px; color: var(--muted); }
.kpi.hl { background: linear-gradient(140deg, #1b4b57, #0b2028 70%); color: #eaf2ef; border-color: transparent; box-shadow: inset 0 0 0 1px rgba(255, 179, 122, .35); }
.kpi.hl .money { color: #ffb37a; }
.kpi.hl small, .kpi.hl em { color: rgba(234, 242, 239, .7); }
@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .kpis .kpi:last-child { grid-column: 1 / -1; } }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart text { font: 500 11px var(--f-mono); fill: var(--muted); }
.chart text.ax { paint-order: stroke; stroke: var(--surface); stroke-width: 4px; stroke-linejoin: round; }
.chart .grid-l { stroke: var(--line); }
.chart .b-in { fill: var(--glass); }
.chart .b-out { fill: var(--sun); }
.chart .sel rect.hit { fill: var(--surface-2); }
.chart rect.hit { fill: transparent; cursor: pointer; }
.chart .grow { transform-box: fill-box; transform-origin: bottom; animation: growy .9s var(--ease) both; }
@keyframes growy { from { transform: scaleY(0); } }
.chart .draw { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.6s .3s var(--ease) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.chart .net { fill: none; stroke: var(--ink); stroke-width: 2; }
.chart .dot { fill: var(--surface); stroke: var(--ink); stroke-width: 2; }
.chart .pace-a { fill: none; stroke: var(--sun); stroke-width: 2.5; }
.chart .pace-b { fill: none; stroke: var(--muted); stroke-width: 1.5; stroke-dasharray: 4 4; }
.chart .pace-plan { fill: none; stroke: var(--glass); stroke-width: 1.5; opacity: .8; }
.chart .area { fill: url(#sunfade); opacity: .9; animation: fade 1.2s .4s both; }
@keyframes fade { from { opacity: 0; } }
.keys { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.keys i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.cq { container-type: inline-size; }
/* Donut above the list in narrow cards (phone, or a half-width card); side by side only when the card itself is wide. */
.donut-wrap { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; justify-items: center; }
@container (min-width: 600px) { .donut-wrap { grid-template-columns: 180px minmax(0, 1fr); align-items: center; justify-items: stretch; gap: 24px; } }
.donut circle { fill: none; stroke-width: 18; transform: rotate(-90deg); transform-origin: center; animation: ring 1.2s var(--ease) both; }
@keyframes ring { from { stroke-dasharray: 0 999; } }
.donut text { font: 400 20px var(--f-display); fill: var(--ink); }
.donut text.s { font: 500 9px var(--f-mono); fill: var(--muted); letter-spacing: .1em; }
.cat-rows { display: grid; gap: 2px; width: 100%; }
.cat-rows button { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto 54px; gap: 10px; align-items: center; padding: 9px 6px; border-radius: 10px; font-size: 14px; text-align: left; }
.cat-rows button > span:nth-of-type(1) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-rows .money { white-space: nowrap; font-weight: 600; }
.cat-rows button:hover { background: var(--surface-2); }
.cat-rows i { width: 12px; height: 12px; border-radius: 4px; }
.cat-rows .d { font-size: 12px; text-align: right; }
.hbars { display: grid; gap: 12px; }
.hbar { display: grid; gap: 5px; font-size: 14px; }
.hbar .row { justify-content: space-between; }
.insights { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 1100px) { .insights { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.insight { padding: 16px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); display: grid; gap: 6px; align-content: start; }
.insight .e { font-size: 22px; }
.insight b { font: 400 21px/1.15 var(--f-display); }
.insight p { margin: 0; font-size: 13px; color: var(--muted); }
.tip-box { position: fixed; z-index: 70; pointer-events: none; padding: 8px 10px; border-radius: 10px; background: var(--ink); color: var(--bg); font-size: 12.5px; transform: translate(-50%, -110%); opacity: 0; transition: opacity .15s; white-space: nowrap; }

/* settings */
.set-grid { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 28px; align-items: start; }
.set-nav { position: sticky; top: 24px; display: grid; gap: 2px; }
.set-nav button { text-align: left; padding: 9px 12px; border-radius: 10px; color: var(--muted); font-weight: 600; font-size: 14px; }
.set-nav button:hover { background: var(--surface-2); color: var(--ink); }
@media (max-width: 959px) { .set-grid { grid-template-columns: 1fr; } .set-nav { display: none; } }
.set-sec { scroll-margin-top: 80px; }
.set-sec + .set-sec { margin-top: 18px; }
.set-sec h2 { font: 400 24px/1.2 var(--f-display); margin-bottom: 4px; }
.set-sec > .hint { margin: 0 0 14px; }
.set-line { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-top: 1px solid var(--line); }
.set-line:first-of-type { border-top: 0; }
.set-line b { display: block; font-weight: 600; font-size: 14.5px; }
.set-line small { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.set-line.sub { padding-left: 18px; }
.set-line.sub.off { opacity: .45; }
.ws-opt { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px; border-radius: 14px; border: 1px solid var(--line); text-align: left; }
.ws-opt[aria-pressed="true"] { border-color: var(--sun); background: var(--sun-soft); }
.ws-opt span:nth-child(2) { flex: 1; }
.ws-opt small { display: block; color: var(--muted); font-size: 12.5px; }

/* sheets */
dialog.sheet { border: 0; padding: 0; width: min(560px, calc(100% - 32px)); max-height: min(88dvh, 860px); border-radius: 28px; background: var(--surface); color: var(--ink); box-shadow: 0 40px 100px -30px rgba(0, 0, 0, .55); overflow: auto; overscroll-behavior: contain; }
dialog.sheet[open] { animation: pop .45s var(--ease); }
dialog.sheet::backdrop { background: rgba(4, 18, 26, .45); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); animation: fade .3s both; }
@keyframes pop { from { opacity: 0; transform: translateY(18px) scale(.97); } }
.sheet-h { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 18px 22px 12px; background: var(--surface); }
.sheet-h h2 { font: 400 26px/1.1 var(--f-display); }
.sheet-b { padding: 4px 22px 22px; display: grid; gap: 18px; }
.sheet-f { position: sticky; bottom: 0; display: flex; gap: 10px; justify-content: space-between; padding: 14px 22px calc(14px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); }
.sheet-f .btn.primary { flex: 1; max-width: 260px; margin-left: auto; }
.grab { display: none; }
@media (max-width: 959px) {
  dialog.sheet { width: 100%; max-width: 100%; margin: auto 0 0; border-radius: 28px 28px 0 0; max-height: 92dvh; }
  dialog.sheet[open] { animation: up .5s var(--ease); }
  @keyframes up { from { transform: translateY(100%); } }
  .grab { display: block; width: 40px; height: 5px; border-radius: 9px; background: var(--line); margin: 8px auto 0; }
  .sheet-h { padding-top: 10px; }
}
.kind-help { font-size: 13px; color: var(--muted); padding: 10px 12px; border-radius: 12px; background: var(--surface-2); line-height: 1.5; }
.kind-help b { color: var(--ink); }
.more-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.more-grid a, .more-grid button { display: grid; justify-items: center; gap: 8px; padding: 16px 6px; border-radius: 18px; background: var(--surface-2); text-decoration: none; font-size: 13px; font-weight: 600; position: relative; }
.more-grid .count { position: absolute; top: 8px; right: 8px; }

/* toast */
.toast { position: fixed; z-index: 90; left: 50%; bottom: calc(26px + env(safe-area-inset-bottom)); transform: translate(-50%, 30px); opacity: 0; pointer-events: none; padding: 12px 18px; border-radius: 16px; background: var(--ink); color: var(--bg); font-weight: 600; font-size: 14px; box-shadow: var(--shadow); transition: transform .45s var(--ease), opacity .3s; max-width: calc(100% - 32px); }
.toast.on { transform: translate(-50%, 0); opacity: 1; }
@media (max-width: 959px) { .toast { bottom: calc(96px + env(safe-area-inset-bottom)); } }

/* tour */
.tour { position: fixed; inset: 0; z-index: 80; }
.tour-spot { position: fixed; border-radius: 20px; box-shadow: 0 0 0 9999px rgba(4, 18, 26, .62), 0 0 0 3px var(--sun); transition: all .55s var(--ease); pointer-events: none; }
.tour-tip { position: fixed; width: min(340px, calc(100% - 32px)); padding: 18px; border-radius: 20px; background: var(--surface); box-shadow: var(--shadow); transition: top .55s var(--ease), left .55s var(--ease); display: grid; gap: 10px; }
.tour-tip h3 { font: 400 22px/1.15 var(--f-display); }
.tour-tip p { margin: 0; font-size: 14px; color: var(--muted); }
.tour-dots { display: flex; gap: 5px; }
.tour-dots i { width: 6px; height: 6px; border-radius: 9px; background: var(--line); transition: width .3s var(--ease), background .3s; }
.tour-dots i.on { width: 18px; background: var(--sun); }


@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
}

a.tag { text-decoration: none; }
@media (max-width: 959px) { .c4.side-col { grid-template-columns: 1fr; } }
a.btn { text-decoration: none; }

/* ---------------------------------------------------------------- v0.3: controls, pickers, login states */
button, .chip, .seg, .nav a, .tabbar, .tx, .cat-item, .acct, .monthnav, summary, .switch { -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
html { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--muted) 55%, transparent) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--muted) 45%, transparent); border-radius: 99px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: var(--sun); }

/* custom dropdown + date field (replace the native look) */
.dd { display: flex; align-items: center; justify-content: space-between; gap: 10px; text-align: left; cursor: pointer; }
.dd span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd svg { width: 18px; height: 18px; flex: none; opacity: .6; transition: transform .35s var(--ease), opacity .2s; }
.dd[aria-expanded="true"] { border-color: var(--sun); box-shadow: 0 0 0 4px var(--sun-soft); }
.dd[aria-expanded="true"]:not(.date) svg { transform: rotate(180deg); opacity: 1; }
.dd.date { justify-content: flex-start; }
.dd.date svg { color: var(--sun); opacity: 1; }
.pop { position: fixed; inset: auto; margin: 0; z-index: 200; padding: 6px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); color: var(--ink); box-shadow: 0 30px 70px -24px rgba(0, 0, 0, .5); max-height: min(360px, 62vh); overflow: auto; overscroll-behavior: contain; animation: pop-in .26s var(--ease); }
.pop.out { animation: pop-out .18s ease forwards; }
@keyframes pop-in { from { opacity: 0; transform: translateY(-8px) scale(.97); } }
@keyframes pop-out { to { opacity: 0; transform: translateY(-4px) scale(.98); } }
.pop.sheetish { left: 0; right: 0; bottom: 0; top: auto; width: 100%; max-width: 100%; max-height: 72dvh; border-radius: 26px 26px 0 0; padding: 14px 12px calc(18px + env(safe-area-inset-bottom)); animation: pop-up .38s var(--ease); box-shadow: 0 -20px 60px -20px rgba(0, 0, 0, .5); }
.pop.sheetish.out { animation: pop-down .22s ease forwards; }
.pop.sheetish::before { content: ''; display: block; width: 40px; height: 5px; border-radius: 9px; background: var(--line); margin: -4px auto 10px; }
@keyframes pop-up { from { transform: translateY(100%); } }
@keyframes pop-down { to { transform: translateY(100%); } }
.opts { display: grid; gap: 2px; }
.opts button { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 11px 12px; border-radius: 12px; text-align: left; font-size: 14.5px; font-weight: 500; transition: background .15s; }
.opts button:hover, .opts button:focus-visible { background: var(--surface-2); outline: none; }
.opts button[aria-selected="true"] { color: var(--sun); font-weight: 650; }
.opts svg { width: 18px; height: 18px; }
.calpop { width: 316px; padding: 14px; }
.sheetish.calpop { width: 100%; }
.cal-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cal-h b { font: 400 21px/1 var(--f-display); text-transform: capitalize; }
.cal-h button { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; transition: background .15s; }
.cal-h button:hover { background: var(--surface-2); }
.cal-h button[disabled] { opacity: .3; }
.cal-g { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; text-align: center; }
.cal-g span { font: 500 10.5px var(--f-mono); color: var(--muted); padding: 4px 0 6px; }
.cal-g button { aspect-ratio: 1; border-radius: 12px; font-size: 14px; font-weight: 500; font-variant-numeric: tabular-nums; transition: background .15s, transform .15s var(--ease); }
.cal-g button:hover, .cal-g button:focus-visible { background: var(--surface-2); outline: none; }
.cal-g button:active { transform: scale(.92); }
.cal-g button.out { color: var(--muted); opacity: .45; }
.cal-g button.today { box-shadow: inset 0 0 0 1.5px var(--sun); }
.cal-g button[aria-selected="true"] { background: var(--ink); color: var(--bg); }
.cal-f { display: flex; gap: 6px; margin-top: 12px; }
.cal-f button { flex: 1; min-height: 36px; border-radius: 99px; background: var(--surface-2); font-size: 13px; font-weight: 600; }
.cal-f button:hover { background: var(--sun-soft); color: var(--sun); }
.mgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.mgrid button { min-height: 50px; border-radius: 14px; text-transform: capitalize; font-weight: 600; font-size: 14.5px; position: relative; transition: background .15s; }
.mgrid button:hover, .mgrid button:focus-visible { background: var(--surface-2); outline: none; }
.mgrid button.now::after { content: ''; position: absolute; left: 50%; bottom: 8px; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: var(--sun); }
.mgrid button[aria-selected="true"] { background: var(--ink); color: var(--bg); }
.mgrid button[disabled] { opacity: .28; pointer-events: none; }
input[type="date"].in, select.in { accent-color: var(--sun); }

/* shell: profile opens settings */
.side-foot { color: inherit; }
.side-foot > svg { margin-left: auto; color: var(--muted); transition: transform .5s var(--ease); }
.side-foot:hover > svg { transform: rotate(90deg); color: var(--sun); }
.side-foot[aria-current="page"] { background: var(--surface); box-shadow: 0 6px 18px -12px rgba(0, 0, 0, .35); }
.avatar-btn { display: grid; place-items: center; border-radius: 50%; box-shadow: 0 0 0 2px var(--bg), 0 0 0 3.5px var(--line); }
.demo-card { margin-top: auto; padding: 14px; border-radius: 16px; background: var(--sun-soft); display: grid; gap: 4px; }
.demo-card b { font-size: 13.5px; }
.demo-card small { color: var(--muted); font-size: 12.5px; margin-bottom: 8px; }
.demo-card + .side-foot { margin-top: 0; }

/* login: states, keep-me-logged-in, email check */
.lc-head { display: grid; gap: 6px; }
.lc-head p b { color: var(--ink); }
.use-pick { display: grid; gap: 8px; font-size: 13px; font-weight: 600; color: var(--muted); }
.login-opts { font-size: 14px; }
.check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 500; }
.check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check i { width: 22px; height: 22px; border-radius: 7px; border: 1.5px solid var(--line); background: var(--surface); display: grid; place-items: center; transition: background .25s, border-color .25s; }
.check i::after { content: ''; width: 10px; height: 5px; border: 2px solid #fff; border-top: 0; border-right: 0; transform: rotate(-45deg) scale(0); margin-top: -3px; transition: transform .3s var(--ease); }
.check input:checked + i { background: var(--glass); border-color: var(--glass); }
.check input:checked + i::after { transform: rotate(-45deg) scale(1); }
.check input:focus-visible + i { outline: 2px solid var(--sun); outline-offset: 2px; }
.check-actions { display: grid; gap: 10px; }
.check-actions .btn { min-height: 50px; }
.check-actions svg { width: 18px; height: 18px; }
.link.back { justify-self: start; font-size: 14px; }
.mail-art { display: grid; place-items: center; padding: 4px 0; }
.mail-art svg { width: 150px; height: 112px; overflow: visible; }
.mail-art .m-body { fill: var(--sun); }
.mail-art .m-flap { fill: color-mix(in srgb, var(--sun) 75%, #000); transform-origin: 60px 34px; animation: flap-close 2.8s var(--ease) infinite; }
.mail-art .m-letter { fill: var(--surface); stroke: var(--line); animation: letter-in 2.8s var(--ease) infinite; }
.mail-art .m-lines { stroke: var(--muted); stroke-width: 3; stroke-linecap: round; animation: letter-in 2.8s var(--ease) infinite; }
@keyframes letter-in { 0% { transform: translateY(-34px); opacity: 0; } 25%, 100% { transform: translateY(6px); opacity: 1; } }
@keyframes flap-close { 0%, 30% { transform: scaleY(-1); } 50%, 100% { transform: scaleY(1); } }

/* phone login: its own layout — compact board on top, the form rises as a sheet */
@media (max-width: 899px) {
  .login { min-height: 100dvh; background: var(--hero-a); }
  .login-art { min-height: 0; padding-bottom: 54px; gap: 22px; border-radius: 0; }
  .login-copy h1 { font-size: 34px; max-width: none; }
  .flap { transform-origin: left; scale: .82; margin: -6px 0 -14px; }
  .login-side { background: var(--bg); border-radius: 30px 30px 0 0; margin-top: -30px; position: relative; z-index: 1; padding: 30px 20px calc(30px + env(safe-area-inset-bottom)); place-items: start stretch; animation: sheet-rise .8s var(--ease) both; box-shadow: 0 -20px 50px -20px rgba(0, 0, 0, .5); }
  .login-side::before { content: ''; position: absolute; top: 10px; left: 50%; width: 40px; height: 5px; margin-left: -20px; border-radius: 9px; background: var(--line); }
  .login-card { width: 100%; gap: 18px; }
  .login-card h2 { font-size: 30px; }
}
@keyframes sheet-rise { from { transform: translateY(40%); opacity: 0; } }
.pop.calpop { max-height: none; }
.avatar-btn { text-decoration: none; }
.table .who > span:last-child { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ---------------------------------------------------------------- business: lists, sales, alerts */
.crow { display: flex; align-items: center; gap: 8px; }
.crow > .tx { flex: 1; min-width: 0; }
.crow.off { opacity: .55; }
.crow.late .tx small { color: var(--coral); }
.icon-btn.wa { color: #1f9d55; flex: none; }
.icon-btn.wa:hover { background: rgba(31, 157, 85, .1); }
.alert { padding: 14px 18px; border-color: color-mix(in srgb, var(--sun) 40%, transparent); background: var(--sun-soft); font-size: 14px; }
.alerts { display: grid; gap: 6px; }
.alert-row { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); text-decoration: none; font-size: 14px; transition: background .2s; }
.alert-row:hover { background: var(--sun-soft); }
.biz-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; padding: 0; overflow: clip; }
.biz-kpis > div { padding: 16px 18px; display: grid; gap: 8px; border-left: 1px solid var(--line); }
.biz-kpis > div:first-child { border-left: 0; }
.biz-kpis small { font: 500 10.5px/1.2 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.biz-kpis .money { font: 400 clamp(19px, 1.8vw, 26px)/1 var(--f-display); }
@media (max-width: 1100px) {
  .biz-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .biz-kpis > div { border-left: 0; border-top: 1px solid var(--line); }
  .biz-kpis > div:nth-child(even) { border-left: 1px solid var(--line); }
  .biz-kpis > div:first-child { grid-column: 1 / -1; border-top: 0; }
}
.lines { display: grid; gap: 8px; }
.line { display: grid; grid-template-columns: minmax(0, 1fr) auto 112px 40px; gap: 8px; align-items: center; }
.qty { display: inline-flex; align-items: center; height: 42px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.qty button { width: 34px; height: 100%; font-size: 18px; color: var(--muted); border-radius: 999px; }
.qty button:hover { color: var(--ink); }
.qty b { min-width: 22px; text-align: center; font-variant-numeric: tabular-nums; }
@media (max-width: 560px) { .line { grid-template-columns: minmax(0, 1fr) auto 40px; } .line > input:first-child { grid-column: 1 / -1; } }
.sale-total { display: flex; align-items: end; justify-content: space-between; gap: 16px; padding-top: 12px; border-top: 1px dashed var(--line); }
.sale-total .f { max-width: 160px; }
.sale-total > div { text-align: right; }
.sale-total small { display: block; font: 500 10.5px/1 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.sale-total b { font: 400 30px/1 var(--f-display); font-variant-numeric: tabular-nums; }
.hint.fee:empty { display: none; }
.newclient { flex-wrap: wrap; }
.newclient .in { flex: 1 1 140px; }

/* ---------------------------------------------------------------- people, activity, conflicts */
.members { display: grid; gap: 4px; }
.member { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 8px 0; }
.member b, .member small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member small { color: var(--muted); font-size: 12.5px; }
.member select.in, .member .dd { min-width: 150px; }
@media (max-width: 560px) { .member { grid-template-columns: 36px minmax(0, 1fr) auto; } .member > :nth-child(3) { grid-column: 2 / -1; } }
.invite-form { display: grid; grid-template-columns: minmax(0, 1fr) 210px auto; gap: 8px; margin-top: 14px; }
@media (max-width: 560px) { .invite-form { grid-template-columns: 1fr; } }
.avatar.sm { width: 28px; height: 28px; font-size: 12px; }
.acts { display: grid; }
.act { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 9px 6px; border-radius: 12px; font-size: 14px; }
.act > span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.act .what { color: var(--muted); }
.act > small { color: var(--muted); font: 500 11.5px/1 var(--f-mono); }
.act.fresh { background: var(--sun-soft); }
.act.delete .what { text-decoration: line-through; }
.since { border-color: color-mix(in srgb, var(--sun) 35%, transparent); }
.hint.by { margin: 0; }
.vs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.vs > div { padding: 12px 14px; border-radius: 14px; background: var(--surface-2); font-size: 14px; }
.vs > div:last-child { background: var(--sun-soft); }
.vs small { display: block; font: 500 10.5px/1 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }

/* Viewers can look but not change: the server refuses writes anyway, this just hides the buttons. */
.read-only .fab, .read-only [data-act="newtx"], .read-only [data-act="sale"], .read-only [data-act="contact-new"], .read-only [data-act="item-new"],
.read-only [data-act="restock"], .read-only [data-act="settle"], .read-only [data-act="plan-new"], .read-only [data-act="newsrc"], .read-only [data-act="newcat"], .read-only [data-act="cap-ok"], .read-only [data-act="cap-all"], .read-only [data-act="cap-del"] { display: none !important; }
@media (max-width: 560px) { .since .card-h { flex-wrap: wrap; } .since .card-h h2 { white-space: nowrap; } }

/* Side menu scrolls on its own when the window is short (more items in business spaces). */
.side { overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.side > * { flex-shrink: 0; }
@media (max-height: 860px) { .side { gap: 12px; padding-top: 18px; } .nav a { padding: 8px 12px; } .demo-card small { margin-bottom: 4px; } }
