:root {
  color-scheme: dark;
  --bg: #0b0f14; --bg2: #10161d; --card: #141b23; --card2: #18212b; --ink: #e6edf3; --muted: #8b98a8; --line: #232e3a;
  --green: #4ade80; --green-2: #86efac; --green-soft: rgba(74, 222, 128, .12); --green-ink: #062e16;
  --red: #f87171; --amber: #fbbf24; --profit: #e6edf3;
  --radius: 16px; --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 8px 24px rgba(0, 0, 0, .25);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: radial-gradient(1200px 500px at 80% -10%, rgba(74, 222, 128, .07), transparent 60%), var(--bg);
  background-attachment: fixed; color: var(--ink); font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif; }
a { color: var(--green); text-decoration: none; }
h1 { font-size: 26px; margin: 0; letter-spacing: -.02em; }
h2 { font-size: 14px; margin: 0 0 14px; color: var(--ink); font-weight: 650; letter-spacing: .01em; }
.mt { margin-top: 20px; }
.muted { color: var(--muted); margin: 2px 0 0; }
.small { font-size: 13px; }
.tiny { font-size: 12px; margin: -6px 0 14px; }
.eyebrow { margin: 0 0 2px; color: var(--green); font-size: 13px; font-weight: 600; }
code { background: var(--card2); padding: 1px 6px; border-radius: 6px; font-size: 13px; }

/* top bar */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 24px; padding: 10px 24px;
  padding-top: max(10px, env(safe-area-inset-top)); background: rgba(11, 15, 20, .82); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; color: var(--ink); }
.brand.big { font-size: 20px; justify-content: center; }
.logo { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--green); color: var(--green-ink); font-weight: 800;
  box-shadow: 0 0 20px rgba(74, 222, 128, .35); }
.nav { display: flex; gap: 4px; }
.nav a { padding: 7px 12px; border-radius: 9px; color: var(--muted); font-weight: 500; }
.nav a:hover { color: var(--ink); background: var(--card); }
.nav a.on { background: var(--green-soft); color: var(--green); }
.me { margin-left: auto; display: flex; align-items: center; gap: 14px; font-size: 14px; }
.me form { margin: 0; }
.me .help { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line); color: var(--muted); font-weight: 700; }
button.link { background: none; border: 0; padding: 0; color: var(--muted); font: inherit; cursor: pointer; }

.wrap { max-width: 1240px; margin: 0 auto; padding: 24px 24px 120px; }
.head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.head-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.card { background: linear-gradient(180deg, var(--card2), var(--card)); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px 20px; margin-bottom: 16px; }
.card.narrow { max-width: 520px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.grid2 > .card { margin-bottom: 0; }
.grid-main { display: grid; grid-template-columns: 1.9fr 1fr; gap: 16px; margin-bottom: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 16px; }
.grid-main > .card, .grid3 > .card { margin-bottom: 0; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 14px; }
.row-between h2 { margin: 0; }
.actions { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.link-more { font-size: 13px; font-weight: 600; display: inline-block; margin-top: 10px; }
.row-between .link-more { margin: 0; }

/* flash */
.flash { padding: 10px 14px; border-radius: 10px; margin-bottom: 12px; background: var(--card2); border: 1px solid var(--line); }
.flash.success { background: rgba(74, 222, 128, .1); border-color: rgba(74, 222, 128, .3); color: var(--green-2); }
.flash.error { background: rgba(248, 113, 113, .1); border-color: rgba(248, 113, 113, .3); color: #fecaca; }

/* forms */
label { display: block; font-size: 13px; color: var(--muted); font-weight: 500; margin-bottom: 12px; }
input, select, textarea { display: block; width: 100%; margin-top: 5px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg2); color: var(--ink); font-size: 16px; font-family: inherit; }
input::placeholder, textarea::placeholder { color: #5b6878; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(74, 222, 128, .3); border-color: var(--green); }
input[type=date] { color-scheme: dark; }
label.check { display: flex; align-items: center; gap: 10px; color: var(--ink); font-size: 15px; }
label.check input { width: 20px; height: 20px; margin: 0; accent-color: var(--green); }
.err { color: var(--red); display: block; margin-top: 4px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 11px 18px; border: 0; border-radius: 10px;
  background: var(--green); color: var(--green-ink); font-weight: 700; font-size: 15px; font-family: inherit; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--green-2); }
.btn.small { padding: 7px 12px; font-size: 14px; }
.btn.full { width: 100%; }
.btn.ghost { background: var(--card); color: var(--ink); border: 1px solid var(--line); font-weight: 600; }
.btn.ghost:hover { border-color: #3a4756; }
.btn.ghost.active { border-color: var(--green); color: var(--green); }
.btn.danger { background: transparent; color: var(--red); border: 1px solid rgba(248, 113, 113, .4); }
.form-actions { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; }
.danger-zone { margin-top: 24px; }
.amount { display: grid; grid-template-columns: 1fr 150px; align-items: center; gap: 10px; color: var(--ink); font-size: 15px; }
.amount input { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.tag { font-style: normal; font-size: 11px; font-weight: 600; background: var(--green-soft); color: var(--green); padding: 2px 7px; border-radius: 6px; margin-left: 4px; vertical-align: 1px; }

/* period picker */
.period { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 0; }
.period select, .period input { width: auto; margin: 0; padding: 9px 10px; font-size: 15px; }
.period .custom { display: inline-flex; gap: 6px; align-items: center; }
.period .custom[hidden] { display: none; }
.period .search { min-width: 180px; }

/* KPIs */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 14px; }
.kpi { background: linear-gradient(180deg, var(--card2), var(--card)); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; }
.kpi span { display: block; font-size: 13px; color: var(--muted); }
.kpi b { display: block; font-size: 24px; margin: 6px 0 4px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.kpi small { color: var(--muted); font-size: 12px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.kpi.accent { background: linear-gradient(135deg, rgba(74, 222, 128, .16), rgba(74, 222, 128, .03) 60%), var(--card); border-color: rgba(74, 222, 128, .35); }
.kpi.accent.pos b { color: var(--green); }
.kpi.accent.neg b { color: var(--red); }
.delta { font-style: normal; font-weight: 700; font-size: 11px; padding: 1px 6px; border-radius: 6px; }
.delta.good { color: var(--green); background: var(--green-soft); }
.delta.bad { color: var(--red); background: rgba(248, 113, 113, .12); }

/* key/value tables */
table.kv { width: 100%; border-collapse: collapse; }
.kv td { padding: 9px 0; border-bottom: 1px solid var(--line); }
.kv tr:last-child td { border-bottom: 0; }
.kv .total td { font-weight: 700; border-top: 1px solid #3a4756; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pos { color: var(--green); }
.neg { color: var(--red); }
.calc { margin-top: 8px; background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 4px 12px; }
.calc td { padding: 7px 4px; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 8px; vertical-align: 1px; }
.dot.income { background: var(--green); }
.dot.expense { background: var(--amber); }
.dot.profit { background: var(--profit); }
.pill { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; }
.pill.paid { background: var(--green-soft); color: var(--green); }
.pill.open { background: rgba(251, 191, 36, .14); color: var(--amber); }

/* chart */
.legend { font-size: 12px; color: var(--muted); }
.legend .dot { margin-left: 10px; margin-right: 5px; }
.chart svg { width: 100%; height: 250px; display: block; }
.chart .axis { stroke: #3a4756; }
.chart .grid { stroke: var(--line); stroke-dasharray: 3 4; }
.chart .lbl { font-size: 11px; fill: var(--muted); }
.chart .mid { text-anchor: middle; }
.b-income { fill: var(--green); }
.b-expense { fill: var(--amber); opacity: .85; }
.l-profit { stroke: var(--profit); stroke-width: 2.5; }
.c-profit { fill: var(--bg); stroke: var(--profit); stroke-width: 2; }

/* profit flow */
.flow { display: flex; flex-direction: column; gap: 14px; }
.flow-row { display: grid; grid-template-columns: 1fr auto; row-gap: 6px; font-size: 14px; }
.flow-row span { color: var(--muted); }
.flow-row b { font-variant-numeric: tabular-nums; }
.flow-row.total { padding-top: 12px; border-top: 1px solid var(--line); }
.flow-row.total span { color: var(--ink); font-weight: 700; }
.bar { grid-column: 1 / -1; display: block; height: 8px; border-radius: 99px; max-width: 100%; min-width: 2px; }
.bar.income { background: var(--green); }
.bar.expense { background: var(--amber); opacity: .85; }
.bar.profit { background: var(--profit); }
.mini-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.mini-stats div { background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.mini-stats span { display: block; font-size: 12px; color: var(--muted); }
.mini-stats b { font-size: 17px; font-variant-numeric: tabular-nums; }

/* horizontal bars */
.hbar { margin-bottom: 12px; }
.hbar-top { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; margin-bottom: 5px; }
.hbar-top span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-top b { font-variant-numeric: tabular-nums; font-weight: 600; }
.hbar i { display: block; height: 6px; border-radius: 99px; background: linear-gradient(90deg, var(--green), var(--green-2)); min-width: 3px; }

/* lists */
.list { display: flex; flex-direction: column; }
.item { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 11px 2px; border-bottom: 1px solid var(--line); color: var(--ink); }
.item:last-child { border-bottom: 0; }
.item small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.chev { color: var(--muted); font-size: 22px; }
.opt-name { color: var(--ink); flex: 1; }
.opt form { margin: 0; }
.switch { width: 44px; height: 26px; border-radius: 99px; border: 1px solid var(--line); background: var(--bg2); position: relative; cursor: pointer; padding: 0; }
.switch i { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #5b6878; transition: .15s; }
.switch.on { background: var(--green-soft); border-color: rgba(74, 222, 128, .5); }
.switch.on i { left: 21px; background: var(--green); }

/* excel-like sheet */
.sheet-card { padding: 0; overflow: hidden; }
.sheet { overflow: auto; max-height: 70vh; -webkit-overflow-scrolling: touch; }
table.xl { border-collapse: separate; border-spacing: 0; min-width: 100%; font-size: 14px; }
.xl th, .xl td { padding: 10px 12px; border-bottom: 1px solid var(--line); border-right: 1px solid #1c2530; background: var(--card); }
.xl th { position: sticky; top: 0; z-index: 2; background: var(--card2); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); white-space: nowrap; }
.xl th.income { box-shadow: inset 0 -2px 0 var(--green); }
.xl th.expense { box-shadow: inset 0 -2px 0 var(--amber); }
.xl .sticky { position: sticky; left: 0; z-index: 1; white-space: nowrap; }
.xl .sticky2 { min-width: 180px; }
.xl th.sticky { z-index: 3; }
.xl tbody tr { cursor: pointer; }
.xl tbody tr:hover td { background: #1a232d; }
.xl td small { color: var(--muted); }
.xl tfoot td { position: sticky; bottom: 0; background: var(--card2); font-weight: 700; border-top: 1px solid #3a4756; }

/* login */
.login { min-height: 80vh; display: grid; place-items: center; }
.login .card { width: 100%; max-width: 380px; text-align: center; padding: 30px; }
.login form { text-align: left; margin-top: 18px; }

/* manual */
.toc { display: flex; flex-wrap: wrap; gap: 6px; }
.toc a { padding: 6px 11px; border-radius: 8px; background: var(--bg2); border: 1px solid var(--line); color: var(--ink); font-size: 13px; }
.toc a:hover { border-color: var(--green); color: var(--green); }
.manual .card { scroll-margin-top: 80px; }
.manual h2 { font-size: 17px; display: flex; align-items: center; gap: 10px; }
.manual ul, .manual ol { padding-left: 20px; margin: 0; }
.manual li { margin-bottom: 7px; }
.manual p { margin: 0 0 10px; }
.num-badge { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: var(--green-soft); color: var(--green); font-size: 13px; }
.example { margin: 12px 0; padding: 12px 14px; border-left: 3px solid var(--green); background: var(--bg2); border-radius: 0 10px 10px 0; font-size: 14px; }

/* chat */
.chat { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.chat-log { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 4px 2px 10px; }
.msg { max-width: 88%; padding: 9px 13px; border-radius: 14px; white-space: pre-wrap; word-wrap: break-word; }
.msg.bot { background: var(--bg2); border: 1px solid var(--line); align-self: flex-start; }
.msg.me { background: var(--green); color: var(--green-ink); align-self: flex-end; font-weight: 500; }
.msg.typing { color: var(--muted); }
.chat-form { display: flex; gap: 8px; }
.chat-form input { margin: 0; }
.chat-page { height: calc(100vh - 230px); min-height: 380px; display: flex; flex-direction: column; }
.fab { position: fixed; right: 20px; bottom: 24px; z-index: 30; border: 0; border-radius: 999px; padding: 13px 18px; background: var(--green); color: var(--green-ink);
  font-weight: 800; font-size: 14px; font-family: inherit; box-shadow: 0 8px 28px rgba(74, 222, 128, .3); cursor: pointer; }
.panel { position: fixed; right: 20px; bottom: 84px; z-index: 40; width: 380px; height: 520px; max-height: calc(100vh - 120px);
  background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); padding: 14px; display: flex; flex-direction: column; }
.panel[hidden] { display: none; }
.panel-head { display: flex; justify-content: space-between; margin-bottom: 8px; }

/* bottom tab bar (phone) */
.tabbar { display: none; }

@media (max-width: 1000px) {
  .grid-main { grid-template-columns: 1fr; }
  .grid3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 820px) {
  .nav { display: none; }
  .top { padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top)); }
  .wrap { padding: 18px 16px calc(110px + env(safe-area-inset-bottom)); }
  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi { padding: 14px; }
  .kpi b { font-size: 18px; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  h1 { font-size: 23px; }
  .head { align-items: stretch; flex-direction: column; }
  .head-tools .btn { display: none; }
  .period, .head-tools { width: 100%; }
  .period select { flex: 1; }
  .period .search { width: 100%; }
  .amount { grid-template-columns: 1fr 130px; }
  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; background: rgba(11, 15, 20, .92); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; color: var(--muted); padding: 4px 0; }
  .tabbar svg { width: 22px; height: 22px; fill: currentColor; }
  .tabbar a.on { color: var(--green); }
  .tabbar a.plus svg { background: var(--green); fill: var(--green-ink); border-radius: 10px; width: 36px; height: 26px; padding: 2px 7px; }
  .fab { display: none; }
  .panel { left: 8px; right: 8px; width: auto; bottom: calc(70px + env(safe-area-inset-bottom)); height: 70vh; }
  .chat-page { height: calc(100vh - 260px); }
  .me > a:not(.help) { display: none; }
}
.legend { white-space: nowrap; }
@media (max-width: 820px) { .row-between { flex-wrap: wrap; } }

/* v6: actions, trash, logboek, maanden */
.spacer { flex: 1; }
.phone-only { display: none; }
.icon-btn { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line); color: var(--muted); }
.icon-btn svg { width: 18px; height: 18px; fill: currentColor; }
.flash { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.flash form.inline { margin: 0; }
.row-actions { display: flex; gap: 6px; align-items: center; }
.row-actions form { margin: 0; }
.xl .act-col { position: sticky; right: 0; z-index: 1; white-space: nowrap; box-shadow: -8px 0 12px -8px rgba(0, 0, 0, .6); }
.xl th.act-col { z-index: 3; }
.xl tbody tr { cursor: default; }
.totals-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 12px; }
.totals-strip div { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.totals-strip span { display: block; font-size: 12px; color: var(--muted); }
.totals-strip b { font-variant-numeric: tabular-nums; font-size: 16px; }
.entry-card, .month-card { display: block; color: var(--ink); }
.ec-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.ec-head small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.ec-lines div { display: flex; justify-content: space-between; font-size: 14px; padding: 4px 0; color: var(--muted); }
.ec-lines .dot { margin-right: 6px; }
.ec-sum { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0 12px; }
.ec-sum.four { grid-template-columns: repeat(2, 1fr); }
.ec-sum div { background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.ec-sum span { display: block; font-size: 11px; color: var(--muted); }
.ec-sum b { font-size: 14px; font-variant-numeric: tabular-nums; }
.entry-card .row-actions .btn, .entry-card .row-actions form { flex: 1; }
.entry-card .row-actions .btn { width: 100%; padding: 10px; }
.month-card.best, .xl tr.best td:first-child { box-shadow: inset 3px 0 0 var(--green); }
.icon-btn.phone-only { display: none; }
.xl.months th, .xl.months td { padding: 10px 9px; font-size: 13px; }
.xl.months th { font-size: 10px; }
.xl.months tbody tr { cursor: pointer; }
.xl tr.future td { opacity: .45; }
.trash-item { flex-wrap: wrap; }
.log-day { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 16px 0 6px; }
.log-day:first-child { margin-top: 0; }
.log-row { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--line); }
.log-row:last-child { border-bottom: 0; }
.log-body { flex: 1; min-width: 0; }
.log-body small, .log-row small { color: var(--muted); font-size: 12px; }
.log-badge { flex: none; width: 128px; text-align: center; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: var(--bg2); color: var(--muted); border: 1px solid var(--line); }
.log-badge.add, .log-badge.restore { color: var(--green); background: var(--green-soft); border-color: transparent; }
.log-badge.edit { color: #93c5fd; background: rgba(147, 197, 253, .12); border-color: transparent; }
.log-badge.delete, .log-badge.purge { color: var(--red); background: rgba(248, 113, 113, .12); border-color: transparent; }
.log-details { margin: 6px 0 0; padding: 8px 10px; background: var(--bg2); border: 1px solid var(--line); border-radius: 8px; font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; color: var(--ink); }
details summary { cursor: pointer; color: var(--green); font-size: 12px; margin-top: 4px; }
.history { margin-top: 16px; }
.pager { align-items: center; justify-content: center; }
h2 .link-more { margin: 0 0 0 10px; font-weight: 500; }
@media (max-width: 820px) {
  .desk-only { display: none !important; }
  .phone-only { display: block; }
  .me .icon-btn.phone-only { display: grid; }
  .totals-strip { grid-template-columns: 1fr 1fr; }
  .actions .spacer { display: none; }
  .log-badge { width: auto; }
  .log-row { flex-direction: column; gap: 4px; }
  .trash-item .row-actions { width: 100%; margin-top: 8px; }
  .trash-item .row-actions form, .trash-item .row-actions .btn { flex: 1; width: 100%; }
}

/* invoices */
.totals-strip.five { grid-template-columns: repeat(5, 1fr); }
.amber { color: var(--amber); }
.inv-item { display: flex; align-items: center; gap: 12px; }
.inv-kind { flex: none; width: 42px; text-align: center; font-size: 11px; font-weight: 800; padding: 4px 0; border-radius: 8px; }
.inv-kind.purchase { background: rgba(251, 191, 36, .14); color: var(--amber); }
.inv-kind.sale { background: var(--green-soft); color: var(--green); }
.inv-main { flex: 1; min-width: 0; }
.inv-main small, .inv-amt small { display: block; color: var(--muted); }
.inv-amt { text-align: right; white-space: nowrap; }
.inv-file { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; word-break: break-all; }
.inv-file label.check { margin: 0; font-size: 13px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 14px; background: var(--bg2); padding: 4px; border-radius: 12px; }
.seg label { margin: 0; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; text-align: center; padding: 9px 6px; border-radius: 9px; color: var(--muted); font-weight: 600; font-size: 14px; cursor: pointer; }
.seg input:checked + span { background: var(--green); color: var(--green-ink); }
@media (max-width: 820px) {
  .totals-strip.five { grid-template-columns: 1fr 1fr; }
  .totals-strip.five div:first-child { grid-column: 1 / -1; }
  .inv-item { flex-wrap: wrap; }
  .inv-item .row-actions { width: 100%; justify-content: flex-end; }
}
.howto { margin-bottom: 14px; }
.howto summary { cursor: pointer; font-weight: 650; color: var(--green); }
.howto ol { margin: 10px 0 0; padding-left: 20px; }
.howto li { margin-bottom: 6px; }
.howto-line { margin: 0 0 14px; }
