@layer components {
  /* buttons */
  .btn { height: 36px; padding: 0 14px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: transparent; color: var(--ink); font-weight: 600; font-size: 13.5px; line-height: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap; }
  .btn svg { width: 16px; height: 16px; }
  .btn:hover { background: var(--fill); border-color: var(--line-3); }
  .btn:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
  .btn-p { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
  .btn-p:hover { background: var(--accent-hi); border-color: var(--accent-hi); }
  .btn-p:focus-visible { box-shadow: 0 0 0 3px var(--accent-line); }
  .btn-g { border-color: transparent; color: var(--dim); }
  .btn-d { color: var(--bad); border-color: var(--bad-line); }
  .btn-d:hover { background: var(--bad-soft); border-color: var(--bad); }
  .btn-dp { background: var(--bad); border-color: var(--bad); color: var(--accent-ink); }
  .btn-dp:hover { background: var(--bad-hi); border-color: var(--bad-hi); }
  .btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; gap: 6px; }
  .btn-sm svg { width: 14px; height: 14px; }
  .btn-lg { height: 44px; padding: 0 18px; font-size: 14.5px; }
  .btn-i { width: 36px; padding: 0; }
  .btn-i.btn-sm { width: 30px; }
  .btn-w { width: 100%; }
  .btn.on { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); }
  .btn .cnt { min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--r-xs); display: inline-grid; place-items: center; background: var(--accent); color: var(--accent-ink); font-family: var(--f-m); font-size: 10.5px; font-weight: 700; }
  .btn[disabled], .btn.dis { opacity: 0.4; }
  .btn[disabled] { pointer-events: none; }
  .btn.dis { cursor: not-allowed; }
  .btn.dis:hover { background: transparent; border-color: var(--line-2); }
  .btn-p.dis:hover { background: var(--accent); border-color: var(--accent); }
  .link { color: var(--accent); font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
  .link svg { width: 14px; height: 14px; }
  .link:hover { text-decoration: underline; text-underline-offset: 3px; }
  button.link { padding: 0; border: 0; background: none; }

  /* chips, counts, dots, avatars */
  .chip { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: var(--r-xs); font-family: var(--f-m); font-weight: 700; font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; background: var(--fill-2); color: var(--dim); white-space: nowrap; line-height: 1; vertical-align: middle; }
  .chip.dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
  .chip.good { background: var(--good-soft); color: var(--good); }
  .chip.bad { background: var(--bad-soft); color: var(--bad); }
  .chip.warn { background: var(--warn-soft); color: var(--warn); }
  .chip.acc { background: var(--accent-soft); color: var(--accent); }
  .chip.off { background: transparent; color: var(--muted); box-shadow: inset 0 0 0 1px var(--line-2); }
  .chip.live { background: var(--accent); color: var(--accent-ink); }
  .nav-n { font-family: var(--f-m); font-size: 10.5px; font-weight: 700; min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--r-xs); display: inline-grid; place-items: center; background: var(--raised); color: var(--dim); line-height: 1; }
  .nav-n.warn { background: var(--warn-soft); color: var(--warn); }
  .sd { width: 8px; height: 8px; border-radius: 50%; background: oklch(from var(--c, var(--accent)) var(--series-l) c h); flex: none; display: inline-block; }
  .tag { font-family: var(--f-m); font-size: 11px; color: var(--muted); }
  .av { width: 30px; height: 30px; border-radius: var(--r-sm); background: var(--raised); border: 1px solid var(--line); display: grid; place-items: center; font-family: var(--f-m); font-weight: 700; font-size: 11px; color: var(--dim); flex: none; }
  .av.sm { width: 26px; height: 26px; font-size: 10px; }
  img.av { object-fit: cover; }
  .av.lg { width: 44px; height: 44px; font-size: 14px; }
  .av.xl { width: 56px; height: 56px; font-size: 16px; }

  /* page header and tabs */
  .ph { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
  .ph.flush { border-bottom: 0; padding-bottom: 0; }
  .ph-t { min-width: 0; display: flex; flex-direction: column; gap: 10px; }
  .trail { display: flex; align-items: center; gap: 8px; font-family: var(--f-m); font-weight: 700; font-size: 10.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
  .trail a { color: var(--dim); }
  .trail a:hover { color: var(--ink); }
  .trail i { font-style: normal; color: var(--line-3); }
  .ph h1 { font-family: var(--f-d); font-weight: 900; font-size: 34px; line-height: 0.95; letter-spacing: -0.01em; text-transform: uppercase; color: var(--strong); display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
  .ph .sub { color: var(--dim); font-size: 14px; }
  .ph .sub b { color: var(--strong); font-weight: 600; }
  .ph-a { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
  /* The page header bleeds to the edges of the main column, out of the page's padding. */
  .pgh { margin: calc(var(--pad-t, 0px) * -1) calc(var(--pad-x, 0px) * -1 - max(0px, 100cqw - var(--max, 100cqw))) 0 calc(var(--pad-x, 0px) * -1); }
  .pgh-bar { min-height: 60px; padding: 10px var(--pad-x, 0px); display: flex; align-items: center; justify-content: space-between; gap: 16px; background: var(--side); border-bottom: 1px solid var(--line); }
  .crumbs { min-width: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 17px; font-weight: 500; line-height: 1.25; color: var(--muted); }
  .crumbs a:hover { color: var(--ink); }
  .crumbs .cr-up svg { display: none; }
  .crumbs .cr-s { display: inline-flex; color: var(--line-3); }
  .crumbs .cr-s svg { width: 16px; height: 16px; }
  .crumbs h1 { font-size: inherit; font-weight: 700; color: var(--strong); }
  .crumbs .av { width: 26px; height: 26px; font-size: 10px; }
  .pgh-a { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
  .pgh-a .btn { height: 32px; padding: 0 12px; font-size: 13px; }
  .pgh-a .btn-i { width: 32px; padding: 0; }
  .pgh-sub { padding: 18px var(--pad-x, 0px) 0; color: var(--dim); font-size: 13.5px; }
  .pgh-sub b { color: var(--strong); font-weight: 600; }
  .tabs { display: flex; gap: 26px; border-bottom: 1px solid var(--line); overflow-x: auto; }
  .tabs a { padding: 2px 0 12px; font-weight: 600; font-size: 13.5px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: flex; align-items: center; gap: 8px; }
  .tabs a:hover { color: var(--ink); }
  .tabs a.on { color: var(--strong); border-color: var(--accent); }

  /* panels and layout */
  .pnl { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); min-width: 0; }
  .pnl-h { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 10px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
  .pnl-h h2 { font-size: 14.5px; font-weight: 600; color: var(--strong); display: flex; align-items: center; gap: 10px; }
  .pnl-h .n { font-family: var(--f-m); font-size: 11px; color: var(--muted); font-weight: 700; }
  .pnl-h .end, .pnl-f .end { margin-left: auto; display: flex; align-items: center; gap: 8px; }
  .pnl-b { padding: 18px; }
  .pnl-f { border-top: 1px solid var(--line); padding: 12px 18px; display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; flex-wrap: wrap; }
  .pnl.flat { background: transparent; }
  .sec { display: flex; align-items: center; gap: 12px; }
  .sec h2 { font-family: var(--f-m); font-weight: 700; font-size: 10.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
  .sec::after { content: ""; flex: 1; height: 1px; background: var(--line); }
  .sec .end { order: 2; display: flex; gap: 8px; }
  .cols { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 20px; align-items: start; }
  .cols.even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cols.side-l { grid-template-columns: minmax(0, 1fr) minmax(0, 1.65fr); }
  .cols.eq { align-items: stretch; }
  .cols.eq > .pnl { display: flex; flex-direction: column; }
  .cols.eq > .pnl > .pnl-b { flex: 1; display: flex; }
  .cols.eq .chart { flex: 1; height: auto; min-height: 220px; }
  .stack { display: flex; flex-direction: column; gap: 20px; min-width: 0; }

  /* list rows */
  .li { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line); min-height: 56px; }
  .li:last-child { border-bottom: 0; }
  .li2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .li2 > .li { border-bottom: 1px solid var(--line); }
  .li2 > .li:nth-child(odd) { border-right: 1px solid var(--line); }
  .li2 > .li:nth-last-child(2):nth-child(odd), .li2 > .li:last-child { border-bottom: 0; }
  .li-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
  .li-t b { color: var(--strong); font-weight: 600; }
  .li-t small { color: var(--muted); font-size: 12.5px; }
  .li .amt { font-variant-numeric: tabular-nums; color: var(--strong); font-weight: 600; white-space: nowrap; }
  .li > svg { width: 16px; height: 16px; color: var(--muted); }
  a.li:hover { background: var(--hover); }
  .li-a { display: flex; gap: 6px; flex: none; }
  .ico { width: 34px; height: 34px; border-radius: var(--r-sm); display: grid; place-items: center; background: var(--raised); color: var(--dim); flex: none; }
  .ico svg { width: 17px; height: 17px; }
  .ico.warn { background: var(--warn-soft); color: var(--warn); }
  .ico.bad { background: var(--bad-soft); color: var(--bad); }
  .ico.acc { background: var(--accent-soft); color: var(--accent); }
  .ico.good { background: var(--good-soft); color: var(--good); }
  .ico.lg { width: 48px; height: 48px; }
  .ico.lg svg { width: 22px; height: 22px; }

  /* facts and money */
  .kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 10px 24px; margin: 0; }
  .kv dt { font-family: var(--f-m); font-weight: 700; font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); padding-top: 3px; }
  .kv dd { margin: 0; color: var(--ink); }
  .copy { padding: 0; border: 0; background: none; color: inherit; text-align: left; overflow-wrap: anywhere; cursor: copy; }
  .copy:hover { color: var(--accent); }
  .tally { display: flex; flex-direction: column; }
  .tally > div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); color: var(--dim); }
  .tally > div span:last-child { font-variant-numeric: tabular-nums; color: var(--ink); }
  .tally > div.tot { border-bottom: 0; padding-top: 12px; color: var(--strong); font-weight: 600; }
  .tally > div.tot span:last-child { font-family: var(--f-d); font-weight: 900; font-size: 22px; color: var(--strong); }
  .tally > div.tot span.pos:last-child { color: var(--good); }
  .tally h4 { margin: 16px 0 2px; font-family: var(--f-m); font-weight: 700; font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
  .tally h4:first-child { margin-top: 0; }
  .tally > div.tot span.neg:last-child { color: var(--bad); }

  /* charts: heights and widths arrive as --v, a percentage set on the server */
  .chart { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 10px; height: 220px; }
  .chart .ax { display: flex; flex-direction: column; justify-content: space-between; font-family: var(--f-m); font-size: 10px; color: var(--muted); text-align: right; padding-bottom: 22px; }
  .chart .plot { position: relative; display: flex; align-items: flex-end; gap: 10px; border-bottom: 1px solid var(--line-2); background: repeating-linear-gradient(to top, transparent 0 calc(25% - 1px), var(--line) calc(25% - 1px) 25%); margin-bottom: 22px; }
  .chart .col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; position: relative; }
  .chart .bar { width: 100%; max-width: 34px; height: calc(var(--v) * 1%); background: var(--accent); border-radius: 2px 2px 0 0; }
  .chart .bar.b2 { background: oklch(from var(--c-tr) var(--series-l) c h); border-radius: 0; }
  .chart .bar.b3 { background: oklch(from var(--c-uoft) var(--series-l) c h); border-radius: 0; }
  .chart .col > .bar:first-child { border-radius: 2px 2px 0 0; }
  .chart .bar.ghost { background: var(--ghost); }
  .chart .pair { display: flex; align-items: flex-end; justify-content: center; gap: 3px; width: 100%; height: 100%; }
  .chart .pair .bar { width: 45%; max-width: 22px; }
  .chart .col i { position: absolute; bottom: -20px; font-style: normal; font-family: var(--f-m); font-size: 10px; color: var(--muted); white-space: nowrap; }
  .legend { display: flex; gap: 16px; font-size: 12.5px; color: var(--dim); }
  .legend span { display: inline-flex; align-items: center; gap: 6px; }
  .legend span::before { content: ""; width: 10px; height: 10px; border-radius: 2px; background: var(--accent); }
  .legend span.k2::before { background: oklch(from var(--c-tr) var(--series-l) c h); }
  .legend span.k3::before { background: oklch(from var(--c-uoft) var(--series-l) c h); }
  .legend span.kg::before { background: var(--ghost); }
  .stk { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .stk:last-child { border-bottom: 0; }
  .stk b { color: var(--strong); font-weight: 600; font-size: 13.5px; }
  .stk .ct { font-variant-numeric: tabular-nums; color: var(--ink); font-weight: 600; }
  .stk .tr { grid-column: 1 / -1; height: 6px; border-radius: 2px; background: var(--fill-2); overflow: hidden; }
  .stk .tr span { display: block; height: 100%; width: calc(var(--v) * 1%); background: var(--accent); }

  [data-expand] > svg { transition: transform 0.15s; }
  [data-expand][aria-expanded="true"] > svg { transform: rotate(90deg); }
  [data-sort-grip] { cursor: grab; touch-action: none; }
  [data-sort-item][data-dragging] { opacity: 0.5; }

  /* diff: one field's value before and after a change */
  .dif { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 10px; align-items: baseline; padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); }
  .dif + .dif { margin-top: 6px; }
  .dif-k { font-family: var(--f-m); font-weight: 700; font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
  .dif p { overflow-wrap: anywhere; white-space: pre-wrap; }
  .dif.was p { color: var(--muted); text-decoration: line-through; }
  .dif.now { background: var(--accent-soft); border-color: var(--accent-line); }
  .dif.now p { color: var(--ink); }
  .dif p.mono { font-size: 12.5px; }

  /* photo grid: tiles in the order they show on the site, one of them the cover */
  .pg { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
  .pg-t { position: relative; aspect-ratio: 4 / 3; border-radius: var(--r-sm); border: 1px solid var(--line); overflow: hidden; background: linear-gradient(135deg, var(--img-a), var(--img-b)); touch-action: manipulation; }
  .pg-t img { width: 100%; height: 100%; object-fit: cover; }
  .pg-t img { transition: opacity .2s; }
  .pg-t.wait img, .pg-t.wait .chip, .pg-t.wait .pg-na { opacity: 0; }
  .pg-t.wait::before { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 20%, color-mix(in srgb, var(--strong) 16%, transparent) 50%, transparent 80%); animation: pg-shine 1.1s linear infinite; }
  @keyframes pg-shine { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
  .pg-t.cover::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 2px var(--accent); pointer-events: none; }
  .pg-b { position: absolute; z-index: 1; width: 26px; height: 26px; padding: 0; border: 0; border-radius: var(--r-xs); background: var(--on-photo); color: var(--on-photo-ink); display: grid; place-items: center; }
  .pg-b svg { width: 14px; height: 14px; }
  .pg-b.grip { top: 6px; left: 6px; cursor: grab; touch-action: none; }
  .pg-b.rm { top: 6px; right: 6px; }
  .pg-b.star { bottom: 6px; right: 6px; }
  .pg-b.star.on { color: var(--accent); }
  .pg-b.star.on svg { fill: currentColor; }
  .pg-t .chip { position: absolute; z-index: 1; bottom: 8px; left: 8px; }
  .pg-add { aspect-ratio: 4 / 3; padding: 10px; gap: 6px; cursor: pointer; }
  .pg-add .req { font-size: 11.5px; justify-content: center; }
  .pg-none { padding: 44px 16px; cursor: pointer; }
  .pg-none .req { justify-content: center; }
  .pg-in { position: relative; }
  .pg-over { position: absolute; inset: -6px; z-index: 2; justify-content: center; }
  .pg-up::after { content: ""; position: absolute; inset: 0; background: var(--scrim); }
  .pg-pct { position: absolute; z-index: 1; top: 50%; left: 50%; transform: translate(-50%, -50%); font-family: var(--f-m); font-weight: 700; font-size: 12px; color: var(--on-photo-ink); }
  .pg-p { position: absolute; z-index: 1; left: 8px; right: 8px; bottom: 8px; height: 4px; border-radius: 2px; background: var(--ghost); overflow: hidden; }
  .pg-p span { display: block; height: 100%; width: calc(var(--v, 0) * 1%); background: var(--accent); }
  .pg-up[data-state="wait"] .pg-pct { color: var(--muted); }
  .pg-up[data-state="wait"] .pg-p { visibility: hidden; }
  .pg-up[data-state="conv"] .pg-p span { width: 40%; animation: pg-run 1.3s ease-in-out infinite; }
  @keyframes pg-run { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
  @media (prefers-reduced-motion: reduce) { .pg-up[data-state="conv"] .pg-p span { animation: none; margin-left: 30%; } .pg-t.wait::before { animation: none; } }
  .pg-slot { aspect-ratio: 4 / 3; border: 2px dashed var(--accent-line); border-radius: var(--r-sm); background: var(--accent-soft); }
  .pg-t.lift { position: fixed; z-index: var(--z-pop); pointer-events: none; transform: rotate(-2deg); box-shadow: var(--sh-pop); outline: 2px solid var(--accent); }
  .pg-why { margin: 8px 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; }
  .pg-why li::before { content: ""; display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: var(--bad); margin: 0 8px 2px 0; }
  .pg.five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .pg-t[data-photo] { cursor: pointer; }
  .pg-t.on, [data-mode="select"] .pg-t:has(:checked) { outline: 2px solid var(--accent); outline-offset: 2px; }
  .pg-k { display: none; position: absolute; z-index: 1; top: 8px; left: 8px; }
  .pg-k input { margin: 0; }
  [data-mode="select"] .pg-k { display: flex; }
  [data-mode="select"] .pg-add { display: none; }
  .pg-na { position: absolute; z-index: 1; top: 8px; right: 8px; height: 20px; padding: 0 6px; border-radius: var(--r-xs); display: inline-flex; align-items: center; background: var(--warn-soft); color: var(--warn); font-family: var(--f-m); font-weight: 700; font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; }
  .pg-sel { display: none; align-items: center; gap: 12px; padding: 8px 8px 8px 12px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--wash); }
  [data-mode="select"] .pg-sel { display: flex; }
  .pg-sel > span { display: flex; align-items: center; gap: 8px; font-size: 13px; }
  .pg-sel b { color: var(--strong); font-weight: 600; }
  .pg-sel .end { margin-left: auto; display: flex; gap: 6px; }
  .pg-x { color: var(--bad); }
  .pg-w { display: grid; grid-template-columns: minmax(0, 1fr); }
  .pg-main { display: flex; flex-direction: column; min-width: 0; }
  .pg-w:has(> .pg-side[open]) { grid-template-columns: minmax(0, 1fr) 360px; }
  .pg-w:has(> .pg-side[open]) .pg.five { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  dialog.pg-side { position: static; margin: 0; width: auto; height: auto; max-height: none; display: none; flex-direction: column; min-width: 0; border-left: 1px solid var(--line); background: var(--wash); border-radius: 0 var(--r) var(--r) 0; }
  dialog.pg-side[open] { display: flex; }
  .pg-side-h { display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 10px 14px 10px 18px; border-bottom: 1px solid var(--line); flex: none; }
  .pg-side-h b { color: var(--strong); font-weight: 600; }
  .pg-side-h .end { margin-left: auto; display: flex; gap: 4px; }
  .pg-side-f { display: flex; flex-direction: column; flex: 1; min-height: 0; }
  .pg-side-f[hidden] { display: none; }
  .pg-side-b { display: flex; flex-direction: column; gap: 14px; padding: 18px; }
  .pg-side-img { display: none; }
  .pg-side-x { margin-top: auto; display: flex; align-items: center; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); flex: none; }
  .pg-side-x .end { margin-left: auto; display: flex; gap: 8px; }
  .pg-used { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: -6px; font-size: 12px; color: var(--muted); }
  .pg-used button { border: 0; cursor: pointer; }
  .pg-cov { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink); }

  /* a line in a refund: tick, what it is, how many, and what it comes to */
  .rline { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto 76px; gap: 12px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--line); }
  .rline:last-child { border-bottom: 0; }
  .rline b { display: block; color: var(--strong); font-weight: 600; font-size: 13.5px; }
  .rline small { display: block; color: var(--muted); font-size: 12px; }
  .rline .amt { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink); font-weight: 600; }
  .rline.off b, .rline.off .amt { color: var(--muted); font-weight: 500; }

  /* notices and empty states */
  .note { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-sm); border: 1px solid var(--accent-line); background: var(--accent-soft); color: var(--ink); font-size: 13.5px; }
  .note > svg { width: 18px; height: 18px; color: var(--accent); margin-top: 1px; }
  .note b { color: var(--strong); }
  .note.warn { border-color: var(--warn-line); background: var(--warn-soft); }
  .note.warn > svg { color: var(--warn); }
  .note.bad { border-color: var(--bad-line); background: var(--bad-soft); }
  .note.bad > svg { color: var(--bad); }
  .note .end { margin-left: auto; flex: none; }
  .empty { padding: 44px 18px; text-align: center; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 10px; }
  .empty > svg { width: 22px; height: 22px; color: var(--dim); }
  .empty b { color: var(--strong); font-size: 15px; }

  /* KPI strips */
  .kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
  .kpis.k2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpis.k3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpis.k6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .kpi { background: var(--panel); padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
  .kpi .l { font-family: var(--f-m); font-weight: 700; font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 6px; }
  .kpi .v { font-family: var(--f-d); font-weight: 900; font-size: 28px; line-height: 1; letter-spacing: -0.01em; color: var(--strong); font-variant-numeric: tabular-nums; white-space: nowrap; }
  .kpi .v small { font-family: var(--f-ui); font-weight: 600; font-size: 13px; color: var(--muted); letter-spacing: 0; margin-left: 4px; }
  .kpi .v.pos { color: var(--good); }
  .kpi .v.neg { color: var(--bad); }
  .kpi .v.wrn { color: var(--warn); }
  .kpi .d { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
  .kpi .d .up { color: var(--good); font-weight: 600; }
  .kpi .d .dn { color: var(--bad); font-weight: 600; }

  /* the ticket */
  .ticket { --c: var(--c-ss); position: relative; display: grid; grid-template-columns: 128px minmax(0, 1fr) auto; background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--r); }
  .ticket::before, .ticket::after { content: ""; position: absolute; left: 118px; box-sizing: border-box; width: 20px; height: 11px; background: var(--ground); border: 1px solid var(--line-2); z-index: 1; }
  .ticket::before { top: -1px; border-top: 0; border-radius: 0 0 10px 10px; }
  .ticket::after { bottom: -1px; border-bottom: 0; border-radius: 10px 10px 0 0; }
  .tk-s::before, .tk-s::after { content: ""; display: none; position: absolute; top: -12px; box-sizing: border-box; width: 11px; height: 22px; background: var(--ground); border: 1px solid var(--line-2); z-index: 1; }
  .tk-s::before { left: -1px; border-left: 0; border-radius: 0 11px 11px 0; }
  .tk-s::after { right: -1px; border-right: 0; border-radius: 11px 0 0 11px; }
  .stub { background: var(--c); color: var(--on-series); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 20px 10px; border-radius: calc(var(--r) - 1px) 0 0 calc(var(--r) - 1px); }
  .stub .dw { font-family: var(--f-m); font-weight: 700; font-size: 10.5px; letter-spacing: 0.18em; text-transform: uppercase; }
  .stub .dy { font-family: var(--f-d); font-weight: 900; font-size: 58px; line-height: 0.86; letter-spacing: -0.05em; }
  .stub .cd { margin-top: 6px; font-family: var(--f-m); font-weight: 700; font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; border: 1.5px solid currentColor; border-radius: var(--r-pill); padding: 3px 8px; }
  .tk { padding: 22px 26px; display: flex; flex-direction: column; justify-content: center; gap: 8px; border-right: 2px dashed var(--tear); min-width: 0; }
  .tk .kick { font-family: var(--f-m); font-weight: 700; font-size: 10.5px; letter-spacing: 0.16em; text-transform: uppercase; color: oklch(from var(--c) var(--series-l) c h); display: flex; align-items: center; gap: 8px; }
  .tk .kick .sd { background: currentColor; }
  .tk .kick .pulse { position: relative; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--bad); }
  .tk .kick .pulse::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--bad); animation: tk-ring 1.6s ease-out infinite; }
  .ticket.live .kick { color: var(--strong); }
  .ticket.live .tk { background: linear-gradient(90deg, color-mix(in oklab, var(--c) 9%, transparent), transparent 70%); }
  .ticket.live .stub .cd { background: var(--on-series); border-color: var(--on-series); color: var(--c); }
  .stub .cd i { display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: currentColor; vertical-align: 1px; animation: tk-blink 1.6s ease-in-out infinite; }
  @keyframes tk-ring { from { transform: scale(0.6); opacity: 0.9; } to { transform: scale(1.8); opacity: 0; } }
  @keyframes tk-blink { 50% { opacity: 0.35; } }
  @media (prefers-reduced-motion: reduce) { .tk .kick .pulse::after, .stub .cd i { animation: none; } }
  .tk h2 { font-family: var(--f-d); font-weight: 900; font-size: 28px; line-height: 0.95; text-transform: uppercase; letter-spacing: -0.01em; color: var(--strong); }
  .tk .meta { color: var(--dim); font-size: 13.5px; }
  .tk-s { position: relative; padding: 18px 24px; display: flex; align-items: center; gap: 28px; }
  .tk-n { display: flex; flex-direction: column; gap: 6px; }
  .tk-n .v { font-family: var(--f-d); font-weight: 900; font-size: 30px; line-height: 1; color: var(--strong); }
  .tk-n .v small { font: inherit; letter-spacing: inherit; color: var(--muted); }
  .tk-n .l { font-family: var(--f-m); font-weight: 700; font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
  .tk-a { display: flex; flex-direction: column; gap: 8px; }
  .ticket.sm { grid-template-columns: 84px minmax(0, 1fr); }
  .ticket.sm::before, .ticket.sm::after { display: none; }
  .ticket.sm .stub { border-radius: calc(var(--r) - 1px) 0 0 0; }
  .ticket.sm .tk-s::before, .ticket.sm .tk-s::after { display: block; }
  .ticket.sm .dy { font-size: 40px; }
  .ticket.sm .tk { padding: 16px; border-right: 0; }
  .ticket.sm h2 { font-size: 21px; }
  .ticket.sm .tk-s { grid-column: 1 / -1; padding: 14px 16px; gap: 18px; justify-content: space-between; border-top: 2px dashed var(--tear); }

  /* inputs */
  .field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
  .field > label, .lbl { font-size: 12.5px; font-weight: 600; color: var(--dim); display: flex; align-items: center; gap: 6px; }
  .field > label em, .lbl em { font-style: normal; color: var(--accent); }
  .input { height: 38px; width: 100%; padding: 0 12px; background: var(--well); border: 1px solid var(--line-2); border-radius: var(--r-sm); color: var(--ink); font: 14px var(--f-ui); outline: none; }
  .input::placeholder { color: var(--placeholder); }
  .input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
  textarea.input { height: auto; min-height: 88px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
  .sel { position: relative; }
  .sel select { appearance: none; -webkit-appearance: none; padding-right: 34px; }
  .sel svg { position: absolute; right: 11px; top: 50%; width: 15px; height: 15px; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
  .money { position: relative; }
  .money > span { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 14px; }
  .money .input { padding-left: 24px; font-variant-numeric: tabular-nums; }

  /* pickers */
  .seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--track); border: 1px solid var(--line-2); border-radius: 5px; }
  .seg button, .seg a, .seg label { position: relative; height: 30px; padding: 0 12px; border-radius: var(--r-xs); border: 0; background: none; font-weight: 600; font-size: 13px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; cursor: pointer; }
  .seg button:hover, .seg a:hover, .seg label:hover { color: var(--ink); }
  .seg input { position: absolute; inset: 0; opacity: 0; margin: 0; width: 100%; height: 100%; cursor: pointer; }
  .seg .on, .seg [aria-pressed="true"], .seg [aria-current="page"], .seg label:has(input:checked) { background: var(--float); color: var(--strong); box-shadow: inset 0 0 0 1px var(--line-2); }
  .seg label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 1px; }
  .seg.w { display: flex; }
  .seg.w button, .seg.w a, .seg.w label { flex: 1; justify-content: center; }
  .step { display: inline-flex; align-items: stretch; height: 38px; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--well); overflow: hidden; }
  .step button { width: 36px; border: 0; background: none; color: var(--dim); display: grid; place-items: center; }
  .step button:hover { background: var(--fill); color: var(--ink); }
  .step button svg { width: 14px; height: 14px; }
  .step input { all: unset; width: 40px; text-align: center; color: var(--strong); font-weight: 600; border-left: 1px solid var(--line); border-right: 1px solid var(--line); font-variant-numeric: tabular-nums; }
  .step:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
  .step.sm { height: 32px; }
  .step.sm button { width: 30px; }
  .step.sm input { width: 52px; font-size: 13px; }
  .check { position: relative; display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--dim); cursor: pointer; }
  .switch { width: 36px; height: 20px; border-radius: var(--r-pill); background: var(--raised); border: 1px solid var(--line-2); position: relative; flex: none; }
  .switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--muted); }
  .sw-in { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
  .sw-in:checked + .switch { background: var(--accent); border-color: var(--accent); }
  .sw-in:checked + .switch::after { left: 18px; background: var(--accent-ink); }
  .sw-in:focus-visible + .switch { outline: 2px solid var(--accent); outline-offset: 2px; }

  @media (width < 1100px) {
    .pg.five { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .ph h1 { font-size: 30px; }
    .cols, .cols.side-l, .cols.three, .cols.even.fold { grid-template-columns: minmax(0, 1fr); }
    .kpis, .kpis.k6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .li2 { grid-template-columns: minmax(0, 1fr); }
    .li2 > .li:nth-child(odd) { border-right: 0; }
    .li2 > .li:nth-last-child(2):nth-child(odd) { border-bottom: 1px solid var(--line); }
    .kpis.k4-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ticket { grid-template-columns: 112px minmax(0, 1fr); }
    .ticket::before, .ticket::after { display: none; }
    .stub { border-radius: calc(var(--r) - 1px) 0 0 0; }
    .tk-s::before, .tk-s::after { display: block; }
    .tk { border-right: 0; }
    .tk-s { grid-column: 1 / -1; border-top: 2px dashed var(--tear); justify-content: space-between; }
  }

  @media (width < 700px) {
    .ph { flex-direction: column; align-items: stretch; gap: 14px; padding-bottom: 16px; }
    .ph h1 { font-size: 26px; }
    .ph-a { justify-content: stretch; }
    .ph-a .btn { flex: 1; }
    .ph-a .btn-i { flex: none; }
    .trail { display: none; }
    .pgh-bar { min-height: 0; padding: 0; flex-direction: column; align-items: stretch; gap: 0; background: none; border-bottom: 0; }
    .crumbs { min-height: 48px; padding: 0 var(--pad-x, 0px) 0 6px; flex-wrap: nowrap; gap: 6px; font-size: 15px; background: var(--side); border-bottom: 1px solid var(--line); }
    .crumbs .cr-p:not(.cr-up), .crumbs .cr-s { display: none; }
    .crumbs .cr-up { display: inline-flex; align-items: center; gap: 2px; min-height: 44px; padding: 0 6px; flex: none; }
    .crumbs .cr-up svg { display: block; width: 18px; height: 18px; }
    .crumbs h1 { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .crumbs:not(:has(.cr-up)) { padding-left: var(--pad-x, 0px); }
    .pgh-a { padding: 14px var(--pad-x, 0px) 0; justify-content: stretch; }
    .pgh-a .btn { flex: 1; height: 44px; }
    .pgh-a .btn-i { flex: none; width: 44px; }
    .pgh-sub { padding-top: 14px; }
    .pgh-bar:has(> .pgh-a > .btn-p:only-child) { flex-direction: row; align-items: center; background: var(--side); border-bottom: 1px solid var(--line); }
    .pgh-bar:has(> .pgh-a > .btn-p:only-child) .crumbs { flex: 1; min-width: 0; border-bottom: 0; }
    .pgh-bar:has(> .pgh-a > .btn-p:only-child) .pgh-a { padding: 0 var(--pad-x, 0px) 0 0; }
    .pgh-bar:has(> .pgh-a > .btn-p:only-child) .pgh-a .btn { flex: none; height: 36px; }
    .btn { height: 44px; }
    .btn-sm { height: 36px; }
    .btn-i { width: 44px; }
    .btn-i.btn-sm { width: 36px; }
    .input { height: 44px; font-size: 16px; }
    .seg button, .seg a, .seg label { height: 36px; }
    .step { height: 44px; }
    .kpis, .kpis.k4-2, .kpis.k6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .kpis.k3 { grid-template-columns: minmax(0, 1fr); }
    .kpis.k3 .kpi { flex-direction: row; align-items: baseline; justify-content: space-between; padding: 14px 16px; }
    .kpi { padding: 14px 14px 16px; gap: 8px; }
    .kpi .v { font-size: 22px; }
    .pnl-h { padding: 10px 16px; }
    .pnl-b { padding: 16px; }
    .pnl-f { padding: 12px 16px; }
    .li { padding: 12px 16px; flex-wrap: wrap; }
    .li-a { width: 100%; padding-left: 46px; }
    .li-a .btn { flex: 1; }
    .cols.even { grid-template-columns: minmax(0, 1fr); }
    .ticket { grid-template-columns: 84px minmax(0, 1fr); }
    .stub .dy { font-size: 40px; }
    .stub .cd { display: none; }
    .tk { padding: 16px 16px; }
    .tk h2 { font-size: 21px; }
    .tk-s { padding: 14px 16px 16px; flex-wrap: wrap; gap: 14px 0; justify-content: flex-start; }
    .tk-n { flex: 1; min-width: 0; gap: 5px; padding: 2px 14px; border-left: 1px solid var(--line); }
    .tk-n:first-child { padding-left: 0; border-left: 0; }
    .tk-n .v { font-size: 24px; }
    .tk-n .l { font-size: 9.5px; }
    .tk-a { flex-direction: row; width: 100%; flex-basis: 100%; }
    .chart { height: 180px; }
    .pg, .pg.five, .pg-w:has(> .pg-side[open]) .pg.five { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pg-w:has(> .pg-side[open]) { grid-template-columns: minmax(0, 1fr); }
    dialog.pg-side { position: fixed; inset: auto 0 0 0; width: 100%; max-height: calc(100vh - 56px); max-height: calc(100dvh - 56px); border-left: 0; border-top: 1px solid var(--line-2); border-radius: var(--r-sheet) var(--r-sheet) 0 0; background: var(--panel); box-shadow: var(--sh-sheet); }
    dialog.pg-side[open] { animation: sheet-up 0.25s cubic-bezier(0.22, 0.8, 0.28, 1); }
    .pg-side-h { padding: 14px 8px 12px 16px; }
    .pg-side-b { padding: 16px; overflow-y: auto; overscroll-behavior: contain; }
    .pg-side-img { display: block; width: 100%; height: 150px; object-fit: cover; border-radius: var(--r-sm); border: 1px solid var(--line); }
    .pg-side-x { padding: 12px 16px 20px; gap: 10px; }
    .pg-side-x .end { flex: 1; }
    .pg-side-x .btn { flex: 1; height: 44px; }
    .rline { grid-template-columns: 20px minmax(0, 1fr) auto; }
    .rline .amt { grid-column: 3; grid-row: 1; }
    .tk-a .btn { flex: 1; }
  }
}
