/* Pages built from Polaris web components (PolarisHelper#polaris_page). The
   shell is <s-page>, which brings its own width and padding, so the page's own
   column steps aside; the ground is the app's mint, as on every other page. */
.page-content:has(> s-page) { max-width: none; padding: 0; }
body:has(s-page) { background: var(--bg); }

/* The four plan cards (settings/plans): by the width of the page, not the window. */
.plan-grid { container-type: inline-size; display: grid; gap: 16px; }
@container (min-width: 720px) { .plan-grid { grid-template-columns: repeat(3, 1fr); } }

/* A submit button whose form is posting (app.js, SendInvoicePending). <s-button>
   spins by itself; a plain button greys out and takes no clicks. */
button[aria-busy="true"] { opacity: 0.6; cursor: progress; pointer-events: none; }

/* Onboarding (onboardings/show): a Polaris page, so the public shell's own
   brand header and width give way to <s-page>. The invoice number's preview is
   the one bespoke piece - monospaced, with the brand colour on the prefix and
   suffix the merchant chose. Buttons and fields stay Polaris' own. */
.public-shell:has([data-onboarding]) { max-width: none; padding: 0; }
.public-shell:has([data-onboarding]) .public-brand { display: none; }
.public-content:has([data-onboarding]) { display: block; }
.public-shell:has([data-onboarding]) form { margin: 0; }
.ob-idnum { margin: 0; text-align: center; font: 500 clamp(22px, 4vw, 28px)/1.2 var(--font-mono); overflow-wrap: anywhere; }
.ob-frame { color: var(--accent); }
.ob-mini-id { font: 500 12px var(--font-mono); }

/* Home (dashboards/show), design A "Briefing". One grid for the whole page: a
   fluid main column beside a fixed 360px rail, 16px apart (--home-rail,
   --home-gap). Every two-card row uses it, so the rail's cards line up from top
   to bottom; a row's cards stretch to the taller one, so they're always the same
   height; and the figures row splits its card on the same lines. The cards are
   drawn here rather than by <s-section>, whose box doesn't stretch to fill a grid
   cell; they copy its surface, radius and shadow. Polaris draws everything
   inside them. Below 880px of page width the rail drops under the main column. */
.home-brief { --home-rail: 360px; --home-gap: 16px; container-type: inline-size; display: grid; gap: var(--home-gap); }
.home-row { display: grid; grid-template-columns: minmax(0, 1fr) var(--home-rail); gap: var(--home-gap); align-items: stretch; }
.home-rail { display: grid; grid-template-rows: auto 1fr auto; gap: var(--home-gap); min-width: 0; }
.home-card { min-width: 0; background: #fff; border-radius: 12px; box-shadow: 0 0 0 1px #e3e3e3, 0 1px 0 rgba(26, 26, 26, .07); overflow: hidden; }
.home-pad { display: flex; flex-direction: column; gap: 12px; padding: 16px; }
.home-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 28px; }
.home-figure { font-size: 22px; font-weight: 650; line-height: 28px; color: #303030; font-variant-numeric: tabular-nums; }
.home-meter { height: 6px; border-radius: 3px; background: #ebebeb; overflow: hidden; }
.home-meter i { display: block; height: 100%; background: #303030; }
.home-bulk { margin: 0; }

/* The work: the heading, the groups as equal tabs, the open group's orders. */
.home-work { display: flex; flex-direction: column; }
.home-work-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 16px 16px 12px; }
.home-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid #ebebeb; border-bottom: 1px solid #e3e3e3; }
.home-tab { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 12px; color: #616161; font-weight: 550; text-decoration: none; box-shadow: inset 0 -2px 0 transparent; }
.home-tab + .home-tab { border-left: 1px solid #ebebeb; }
a.home-tab:hover { color: #303030; background: #f7f7f7; text-decoration: none; }
a.home-tab:focus-visible { outline: 2px solid #005bd3; outline-offset: -2px; }
.home-tab.is-open { color: #303030; box-shadow: inset 0 -2px 0 #303030; }
.home-tab.is-empty { color: #616161; font-weight: 450; }
.home-tab.is-empty .home-sw { opacity: .35; }
.home-tab-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.home-pill { padding: 0 8px; border-radius: 999px; background: #ebebeb; color: #303030; font-size: 12px; font-weight: 600; line-height: 20px; font-variant-numeric: tabular-nums; }
.home-task { display: flex; flex-direction: column; flex: 1; }
.home-task-bar { display: flex; align-items: center; gap: 16px; min-height: 64px; padding: 10px 16px; box-sizing: border-box; }
.home-task-bar > s-stack { flex: 1; min-width: 0; }
.home-task-bar > s-link { white-space: nowrap; }
.home-task-note { padding: 0 16px 12px; }
.home-task-more { padding: 12px 16px; }
.home-clear { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; margin: 16px; padding: 16px; border-radius: 8px; background: #f7f7f7; }

/* Coverage: one bar per lane, split by status, with a fixed key. The gap
   colours differ in lightness as well as hue, and each matches its tab. */
.home-cov-line { display: flex; justify-content: space-between; gap: 12px; font-variant-numeric: tabular-nums; }
.home-bar { display: flex; gap: 2px; height: 8px; border-radius: 4px; overflow: hidden; background: #ebebeb; }
.home-bar-seg { flex-basis: 0; min-width: 4px; }
.home-key { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 16px; color: #616161; font-size: 12px; font-variant-numeric: tabular-nums; }
.home-key-item { display: inline-flex; align-items: center; gap: 6px; }
.home-sw { display: inline-block; flex: none; width: 10px; height: 10px; border-radius: 3px; }
:is(.home-bar-seg, .home-sw).is-sent, :is(.home-bar-seg, .home-sw).is-noted { background: #00876a; }
:is(.home-bar-seg, .home-sw).is-sending { background: #8a8a8a; }
:is(.home-bar-seg, .home-sw).is-none { background: #1f4f99; }
:is(.home-bar-seg, .home-sw).is-failed { background: #c70a24; }
:is(.home-bar-seg, .home-sw).is-owed { background: #d96b00; }
.home-fill { min-height: 0; }
.home-upcoming { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 12px; align-items: start; padding-top: 12px; border-top: 1px solid #ebebeb; }

/* Figures: the first three share the main column; the last sits over the rail,
   its divider in the middle of the 16px gap. */
.home-figures-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; min-height: 52px; padding: 8px 16px; box-sizing: border-box; border-bottom: 1px solid #ebebeb; }
.home-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) calc(var(--home-rail) + var(--home-gap) / 2); }
.home-kpi { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 16px; }
.home-kpi + .home-kpi { border-left: 1px solid #ebebeb; }
.home-kpi-body { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.home-kpi-body > div { display: grid; min-width: 0; }
.home-spark { flex: none; width: 96px; height: 32px; }
.home-spark svg { display: block; }

/* Total sales by day (home.js) and the breakdown. The chart fills its card, so
   it's as tall as the breakdown beside it; the plot is drawn at the host's size
   and positioned over it, so the drawing never feeds back into the height. */
.home-chart { position: relative; flex: 1; min-height: 220px; }
.home-plot { position: absolute; inset: 0; touch-action: pan-y; }
.home-plot svg { display: block; overflow: visible; }
.home-plot .grid { stroke: #ebebeb; stroke-width: 1; }
.home-plot .base { stroke: #d4d4d4; stroke-width: 1; }
.home-plot .tick { fill: #616161; font-size: 11px; font-variant-numeric: tabular-nums; }
.home-plot .xhair { stroke: #8a8a8a; stroke-width: 1; }
.home-legend { display: flex; flex-wrap: wrap; gap: 16px; color: #616161; font-size: 12px; }
.home-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.home-legend i { display: inline-block; width: 14px; height: 0; border-top: 2px solid #00876a; }
.home-legend i.is-prev { border-top: 2px dashed #a8a8a8; }
.home-tip { position: absolute; z-index: 3; pointer-events: none; min-width: 190px; padding: 8px 10px; border: 1px solid #e3e3e3; border-radius: 10px; background: #fff; box-shadow: 0 4px 16px rgba(0, 0, 0, .08); font-size: 12px; }
.home-tip-date { margin-bottom: 6px; color: #616161; }
.home-tip-row { display: grid; grid-template-columns: 12px auto 1fr; gap: 8px; align-items: center; padding: 2px 0; }
.home-tip-row i { width: 12px; height: 2px; border-radius: 1px; }
.home-tip-row strong { color: #303030; font-variant-numeric: tabular-nums; }
.home-tip-row span { color: #616161; }
.home-table { position: absolute; inset: 0; overflow: auto; }
.home-ledger { display: grid; }
.home-ledger-row { display: grid; grid-template-columns: minmax(0, 1fr) auto 64px; gap: 12px; align-items: center; min-height: 32px; font-variant-numeric: tabular-nums; }
.home-ledger-row > :nth-child(n+2) { text-align: right; }
.home-ledger-row.is-total { border-top: 1px solid #ebebeb; }
.home-ledger-rates { padding-top: 4px; border-top: 1px solid #ebebeb; }

@container (max-width: 880px) {
  .home-row { grid-template-columns: minmax(0, 1fr); }
  .home-rail { grid-template-rows: none; }
  .home-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-kpi:nth-child(3) { border-left: 0; }
  .home-kpi:nth-child(n+3) { border-top: 1px solid #ebebeb; }
}
@container (max-width: 520px) {
  .home-tabs { grid-template-columns: minmax(0, 1fr); }
  .home-tab { justify-content: flex-start; }
  .home-tab + .home-tab { border-left: 0; border-top: 1px solid #ebebeb; }
  .home-task-bar { flex-wrap: wrap; }
  .home-work-head { flex-direction: column; gap: 4px; }
  .home-kpis { grid-template-columns: minmax(0, 1fr); }
  .home-kpi + .home-kpi { border-left: 0; border-top: 1px solid #ebebeb; }
}

/* Orders and Draft orders lists in Polaris (orders/index): Polaris draws the
   section, views, search, popovers, table, checkboxes and badges. These are the
   joins it has no component for. */
/* s-page brings its own top padding; the wide-page rule above would add 20px
   more over the title, and the 18px list gap left the sync line adrift. */
.page-content:has(> s-page > .orders-page.is-polaris) { padding-top: 0; }
.orders-page.is-polaris { gap: 10px; }
.orders-statusline .trig-lock { position: static; }
.orders-toolbar { margin: 0; }
.orders-bulk { margin: 0; }
s-table-row.is-drawer-open > s-table-cell { background: var(--accent-weak); }
/* The drawer's Polaris panel (an order's or a draft's) scrolls as one column,
   invoice included. */
.odrawer-body.is-polaris { display: block; flex: 1 1 auto; height: auto; min-height: 0; overflow: auto; padding: 18px 22px 24px; background: var(--bg); }
.odrawer-body.is-polaris .odrawer-title { font-family: inherit; font-size: 18px; }
.odrawer-body.is-polaris .odrawer-total { font-size: 22px; font-weight: 600; }
.odrawer-body.is-polaris .odrawer-send { margin: 0; }
.odrawer-body.is-polaris .odrawer-doc { overflow: visible; padding: 0; background: none; }

/* Automatic invoices in Polaris (the automatic_invoices views). Polaris draws the
   fields, buttons, badges and banners; these are the joins it has no component
   for: the setup's step bar, the schedule rows that open in place, and the
   summary's label/value lines. */
.setup-steps { display: flex; flex-wrap: wrap; gap: 4px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.setup-step { appearance: none; border: 0; background: none; font: inherit; font-size: 13px; font-weight: 600; color: var(--muted); display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 8px; cursor: pointer; }
.setup-step:hover:not([disabled]) { background: var(--hover); color: var(--text); }
.setup-step[disabled] { cursor: default; opacity: .55; }
.setup-step:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.setup-step-num { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; box-shadow: inset 0 0 0 1.5px var(--control-line); }
.setup-step[aria-current="step"] { color: var(--text); }
.setup-step[aria-current="step"] .setup-step-num { background: #303030; color: #fff; box-shadow: none; }
.setup-panel:focus { outline: none; }
.setup-panel[hidden], [data-chan-panel][hidden], [data-setup-fold-body][hidden], [data-when-section][hidden],
[data-reminder-cadence][hidden], [data-docket-sample][hidden], [data-docket-flag][hidden], [data-timing][hidden], [data-connect-error][hidden] { display: none !important; }

.sched-table { border-top: 1px solid var(--line); }
.sched-head,
.sched-row > summary { display: grid; grid-template-columns: 20px minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1.5fr) auto minmax(0, 1.3fr); gap: 12px; align-items: center; padding: 10px 16px; }
.run-row > summary { grid-template-columns: 20px auto minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); }
.sched-head { font-size: 12px; font-weight: 600; color: var(--muted); background: #f7f7f7; padding-top: 7px; padding-bottom: 7px; }
.sched-row { border-top: 1px solid var(--line-soft); }
.sched-row[hidden], s-table-row[hidden], [data-sched-empty][hidden], [data-history-empty][hidden] { display: none !important; }
.sched-row > summary { cursor: pointer; list-style: none; font-size: 13px; }
.sched-row > summary::-webkit-details-marker { display: none; }
.sched-row > summary:hover { background: #f7f7f7; }
.sched-row > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.sched-row[open] > summary { background: #f7f7f7; }
.sched-row.is-paused > summary { color: var(--muted); }
.sched-cell { display: flex; flex-direction: column; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.sched-cell.is-problem { color: var(--red); }
.sched-caret { display: grid; place-items: center; color: var(--muted); transition: transform .15s ease; }
.sched-row[open] .sched-caret { transform: rotate(90deg); }
.sched-detail { padding: 6px 16px 16px 48px; background: #f7f7f7; }
.sched-stats { padding: 12px 16px; border-top: 1px solid var(--line-soft); }
/* The list fitted to the window (bootFitWindow): rows scroll, the foot stays. */
.sched-fit { display: flex; flex-direction: column; height: var(--fit-height, auto); }
.sched-fit > .sched-table { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; }
.sched-table.is-sentence .sched-head,
.sched-table.is-sentence .sched-row > summary { grid-template-columns: 20px minmax(0, 1fr) minmax(140px, 220px) 110px; padding-top: 14px; padding-bottom: 14px; }
.sched-table.is-sentence .sched-head { padding-top: 7px; padding-bottom: 7px; }
.sched-sentence { color: var(--muted); line-height: 28px; }
.ssb-chip { display: inline; padding: 2px 8px; border-radius: 6px; font-weight: 550; color: #303030; background: #f1f1f1; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.ssb-chip.is-when { background: #e4f1ff; color: #00408a; }
.ssb-chip.is-doc { background: #f3ecff; color: #4a1f8f; }
.ssb-chip.is-to { background: #e3f5ea; color: #0c5132; }
.ssb-chip.is-missing { background: #fff1e3; color: #5e4200; }
.sched-row.is-paused .ssb-chip { opacity: .7; }
@media (max-width: 760px) {
  .sched-table.is-sentence .sched-row > summary { grid-template-columns: 20px 1fr; }
}
@media (max-width: 760px) {
  .sched-head { display: none; }
  .sched-row > summary, .run-row > summary { grid-template-columns: 20px 1fr; }
  .sched-row > summary > .sched-cell:not(:nth-child(2)) { grid-column: 2; }
  .sched-detail { padding-left: 16px; }
}
@media (prefers-reduced-motion: reduce) { .sched-caret { transition: none; } }

.docket-lines { display: grid; grid-template-columns: 58px 1fr; gap: 6px 10px; margin: 0; font-size: 13px; }
.docket-lines dt { color: var(--muted); }
.docket-lines dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.is-mono { font-family: var(--font-mono); font-size: 12px; }
.docket-body { white-space: pre-line; }

/* The schedule setup as one sentence (automatic_invoices/_setup): each
   highlighted part is a button opening its fields below. Wide, the form is
   fitted to the window (app.js bootFitWindow sets --fit-height) so the sentence
   and Save stay put and only the fields scroll. */
.ssb { display: flex; flex-direction: column; height: var(--fit-height, auto); }
.ssb-head { display: grid; gap: 8px; padding: 20px 20px 16px; border-bottom: 1px solid #ebebeb; }
.ssb-sentence { margin: 0; font-size: 20px; line-height: 44px; font-weight: 500; color: #616161; }
.ssb-tok { appearance: none; font: inherit; font-weight: 600; line-height: 1.4; padding: 2px 10px; border-radius: 8px; border: 1px dashed transparent; cursor: pointer; transition: box-shadow .12s ease; }
.ssb-tok.is-when { background: #e4f1ff; color: #00408a; }
.ssb-tok.is-doc { background: #f3ecff; color: #4a1f8f; }
.ssb-tok.is-to { background: #e3f5ea; color: #0c5132; }
.ssb-tok.is-missing { background: #fff1e3; color: #5e4200; border-color: #c4790f; }
.ssb-tok:hover:not([disabled]) { box-shadow: inset 0 0 0 1px currentColor; }
.ssb-tok[aria-current="step"] { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #303030; }
.ssb-tok[disabled] { cursor: default; opacity: .5; }
.ssb-tok:focus-visible { outline: 2px solid #005bd3; outline-offset: 4px; }
.ssb-body { flex: 1; min-height: 0; overflow: auto; padding: 20px; overscroll-behavior: contain; }
.ssb-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px; border-top: 1px solid #ebebeb; }
@media (max-width: 760px) {
  .ssb-sentence { font-size: 17px; line-height: 38px; }
  .ssb-head, .ssb-body { padding-left: 16px; padding-right: 16px; }
}
@media (prefers-reduced-motion: reduce) { .ssb-tok { transition: none; } }

.docket-mail { display: grid; gap: 10px; padding: 12px 14px; border: 1px solid #e3e3e3; border-radius: 10px; font-size: 13px; }
.docket-mail .docket-body { margin: 0; line-height: 1.5; }
.docket-file { margin: 0; display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: #f7f7f7; border-radius: 8px; font-size: 12px; overflow-wrap: anywhere; }
.docket-lines dd.is-missing { color: #8a5a00; }
.docket-checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; font-size: 13px; }
.docket-checks li { display: flex; gap: 8px; align-items: flex-start; overflow-wrap: anywhere; }
.docket-checks li.is-todo { color: #5e4200; }
.docket-k { color: var(--muted); margin-right: 2px; }
.docket-mark { flex: none; width: 18px; height: 18px; margin-top: 1px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; }
.is-ok .docket-mark { background: #cdfee1; color: #0c5132; }
.is-ok .docket-mark::before { content: "\2713"; }
.is-todo .docket-mark { background: #ffd79d; color: #5e4200; }
.is-todo .docket-mark::before { content: "!"; }

/* The order page in Polaris (orders/show, design P2). Polaris draws the page,
   sections, table, badges, buttons and Send dialogs; these are the document
   rows and their two folds (app.js bootFolds), and the totals' label/value
   column. */
.odp-docs-head, .odp-docmore { appearance: none; font: inherit; color: inherit; background: none; border: 0; cursor: pointer; text-align: left; width: 100%; display: flex; align-items: center; gap: 12px; }
.odp-docs-head { padding: 14px 16px; }
.odp-docs-titles { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.odp-fold:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: var(--radius); }
.odp-fold-chev { flex: none; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; color: var(--muted); transition: transform .18s ease; }
.odp-fold:hover .odp-fold-chev { background: var(--hover); color: var(--text); }
.odp-fold[aria-expanded="true"] .odp-fold-chev { transform: rotate(90deg); }
.odp-fold[aria-expanded="true"] .odp-fold-chev.is-flip { transform: rotate(180deg); }
.odp-fold[aria-expanded="false"] .odp-fold-chev.is-flip { transform: none; }
.odp-docmore { padding: 10px 16px; border-top: 1px solid var(--line-soft); font-size: 13px; color: var(--muted); }
.odp-docmore:hover { background: var(--hover); color: var(--text); }
#odp-docs-body { border-top: 1px solid var(--line-soft); }
#odp-docs-body[hidden], #odp-docs-off[hidden], [data-send-other][hidden], .odp-docs [data-fold-text][hidden] { display: none !important; }
.odp-docrow { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 16px; border-top: 1px solid var(--line-soft); }
#odp-docs-body > .odp-docrow:first-child { border-top: 0; }
.odp-docrow-ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-weak); color: var(--accent); }
.odp-docrow-ico svg { width: 18px; height: 18px; }
.odp-docrow.is-locked .odp-docrow-ico { opacity: .6; }
.odp-docrow-info { min-width: 0; }
.odp-head { display: flex; flex-direction: column; gap: 4px; padding: 0 2px 4px; }
.odp-head-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
/* Below 490px s-page drops its padding and sections run edge to edge; the
   header keeps the sections' 16px content inset. */
@media (max-width: 489.98px) { .odp-head { padding-inline: 16px; } }
.odp-head-title { margin: 0 4px 0 0; font-size: 20px; line-height: 28px; font-weight: 650; letter-spacing: -.01em; color: var(--text); font-variant-numeric: tabular-nums; }
.odp-totals { display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; margin: 0; font-size: 13px; font-variant-numeric: tabular-nums; }
.odp-totals dt { color: var(--muted); }
.odp-totals dt span { margin-left: 12px; opacity: .8; }
.odp-totals dd { margin: 0; text-align: right; font-weight: 500; }
.odp-totals .is-total { padding-top: 6px; border-top: 1px solid var(--line-soft); color: var(--text); font-weight: 650; font-size: 14px; }
@media (max-width: 640px) {
  .odp-docrow { grid-template-columns: 36px minmax(0, 1fr); }
  .odp-docrow-acts { grid-column: 2; }
}
@media (prefers-reduced-motion: reduce) { .odp-fold-chev { transition: none; } }

/* Delivery (/delivery): Shopify's settings layout - each area's name on the
   left, its card on the right. Polaris overrides [hidden] on its own elements,
   so every panel the page's script toggles needs it restated. */
.dlv-area { scroll-margin-top: 80px; }
.dlv-docpanel[hidden],
[data-sd-panel][hidden],
[data-sd-optional-body][hidden] { display: none !important; }
.dlv-mail-body { white-space: pre-line; }
.dlv-page code[data-copy] { cursor: copy; word-break: break-all; font-size: 12px; }
.dlv-page code[data-copy].is-copied { background: var(--hover); outline: 1px solid var(--line); }

/* Templates (/templates and each library, design C): the entries on the left and
   the picked one's panel on the right, its document drawn on a sample order at
   print width and zoomed to fit (app.js bootTemplateWorkspace). Polaris draws the
   sections, buttons and fields; these are the list rows and the preview stage. */
.tplw { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 16px; align-items: start; }
.tplw-list { display: grid; padding: 6px 6px 10px; }
.tplw-group { margin: 0; padding: 12px 10px 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
/* Design-family filter: links, narrowed on the server (InvoiceThemes.families). */
.tplw-families { display: flex; flex-wrap: wrap; gap: 6px; padding: 2px 10px 8px; }
.tplw-item { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 10px; align-items: center; padding: 7px 10px; border-radius: 8px; color: inherit; text-decoration: none; }
.tplw-item:hover { background: var(--hover); }
.tplw-item:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.tplw-item[aria-current="true"] { background: var(--accent-weak); box-shadow: inset 0 0 0 1px var(--accent-line); }
.tplw-thumb { display: block; width: 34px; height: 44px; overflow: hidden; border-radius: 4px; background: #fff; box-shadow: 0 0 0 1px var(--line); pointer-events: none; }
/* format_thumb drawn at a card's size and zoomed down to a list icon. */
.tplw-thumb .fthumb { width: 120px; height: 156px; zoom: .2834; }
.tplw-thumb .theme-card-thumb { width: 120px; height: 156px; zoom: .2834; border: 0; }
.tplw-thumb.is-new { display: grid; place-items: center; font-size: 16px; font-weight: 600; color: var(--muted); background: var(--panel-subtle); box-shadow: inset 0 0 0 1px var(--line); }
.tplw-thumb.is-paper { display: grid; place-items: center; padding: 4px; }
.tplw-thumb.is-paper .pack-thumb-paper { width: 100%; max-height: 100%; }
.tplw-item-text { display: grid; min-width: 0; }
.tplw-item-name s-badge { margin-left: 2px; }
.tplw-item-name { display: flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 600; }
.tplw-item-name .crown-icon { width: 13px; height: 13px; color: var(--muted); }
.tplw-item-sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tplw-pane[hidden] { display: none !important; }
.tplw-panes { position: sticky; top: 16px; min-width: 0; }
.tplw-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line-soft); }
.tplw-stage { background: var(--panel-subtle); padding: 16px; min-height: 360px; max-height: 76vh; overflow: auto; display: grid; justify-items: center; align-content: start; }
.tplw-stage > * { box-shadow: 0 0 0 1px var(--line), 0 10px 26px -16px rgba(0, 0, 0, .35); background: #fff; }
/* A fixed page width, so a narrow panel shows the page smaller rather than reflowed. */
.tplw-stage .template-preview { position: relative; top: auto; margin: 0; width: 640px; max-width: none; }
.tplw-stage .template-preview[data-theme] { width: var(--t-sheet, 640px); }
.tplw-stage:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.tplw-stage-note { margin: auto; color: var(--muted); font-size: 13px; box-shadow: none !important; background: none !important; }
.tplw-foot { padding: 12px 16px; border-top: 1px solid var(--line-soft); }
.tplw-assign { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; }
.tplw-assign s-select { flex: 1 1 260px; }
@media (max-width: 899px) {
  .tplw { grid-template-columns: 1fr; }
  .tplw-panes { position: static; }
  .tplw-stage { max-height: none; }
}

/* Template editors' settings tabs (design B, app.js bootEditorTabs): each of the
   editor's groups is a tab, so the settings column is short instead of a long
   stack of accordions. Underlined in the ink, like Polaris tabs; the brand
   colour stays on the document. */
.ed-tabs { display: flex; gap: 2px; margin: -4px -4px 4px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.ed-tabs[hidden] { display: none; }
.ed-tabs::-webkit-scrollbar { display: none; }
.ed-tabs [role="tab"] { appearance: none; border: 0; background: none; font: inherit; font-size: 13px; font-weight: 600; color: var(--muted); padding: 9px 12px 10px; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; cursor: pointer; border-radius: 6px 6px 0 0; }
.ed-tabs [role="tab"]:hover { color: var(--text); background: var(--hover); }
.ed-tabs [role="tab"][aria-selected="true"] { color: var(--text); border-bottom-color: var(--text); }
.ed-tabs [role="tab"]:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
[data-ed-panel][hidden] { display: none !important; }
/* Inside a tab every section is open, so its header is a title, not a toggle. */
.acc-item.is-static .acc-header { cursor: default; }

/* Settings overview (design C): the "Finish setting up" checklist, the account
   summary and one list of settings. Polaris draws the sections, badges and
   buttons; these are the rows and the checklist's marks and bar. */
.setx-progress { height: 6px; border-radius: 99px; background: var(--line-soft); overflow: hidden; }
.setx-progress i { display: block; height: 100%; background: var(--text); border-radius: 99px; }
.setx-steps { display: grid; }
.setx-step { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line-soft); }
.setx-step-mark { width: 20px; height: 20px; border-radius: 50%; border: 1.5px dashed var(--muted); display: grid; place-items: center; }
.setx-step.is-done .setx-step-mark { border: 0; background: var(--text); color: #fff; }
.setx-step-text { display: grid; gap: 2px; min-width: 0; }
.setx-step.is-done .setx-step-text s-text { color: var(--muted); }
.setx-account { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.setx-who { display: grid; min-width: 0; }
.setx-stats { display: flex; flex-wrap: wrap; gap: 8px 26px; margin: 0 0 0 auto; }
.setx-stats div { display: flex; flex-direction: column-reverse; }
.setx-stats dt { font-size: 12px; color: var(--muted); }
.setx-stats dd { margin: 0; font-weight: 650; font-variant-numeric: tabular-nums; }
.setx-group { margin: 0; padding: 12px 16px 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
[role="group"]:not(:first-child) > .setx-group { border-top: 1px solid var(--line-soft); margin-top: 4px; }
.setx-row { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto 16px; gap: 12px; align-items: center; padding: 11px 16px; color: inherit; text-decoration: none; }
a.setx-row:hover { background: var(--hover); }
a.setx-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 8px; }
.setx-row-text { display: grid; gap: 1px; min-width: 0; }
.setx-row-title { font-weight: 600; }
.setx-row-body { font-size: 12.5px; color: var(--muted); }
.setx-chev { color: var(--muted); }
.setx-end { display: flex; align-items: center; justify-content: flex-end; min-width: max-content; }
@media (max-width: 640px) {
  .setx-stats { margin-left: 0; }
  .setx-row { grid-template-columns: 32px minmax(0, 1fr) 16px; }
  .setx-row > .setx-end { grid-column: 2; justify-content: flex-start; }
  .setx-row > .setx-chev, .setx-row > :nth-child(4) { grid-row: 1; grid-column: 3; }
  .setx-step { grid-template-columns: 22px minmax(0, 1fr); }
  .setx-step > .setx-end { grid-column: 2; justify-content: flex-start; }
}
/* E-invoicing's on/off rows: what it does on the left, its one button on the right. */
.einv-switch { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.einv-switch + .einv-switch { padding-top: 14px; border-top: 1px solid var(--line-soft); }
.setx-history { overflow-x: auto; }
.setx-history table { width: 100%; border-collapse: collapse; font-size: 13px; }
.setx-history th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 8px 16px; background: var(--panel-subtle); border-block: 1px solid var(--line-soft); }
.setx-history td { padding: 9px 16px; border-bottom: 1px solid var(--line-soft); }
.setx-history tr:last-child td { border-bottom: 0; }

/* Vendors (design A, list and detail). The section's tabs are links to its
   pages, underlined in ink like Polaris tabs; the list is a plain table (s-table
   fails axe's aria-required-children) that turns into cards on a phone. */
.vtabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.vtabs::-webkit-scrollbar { display: none; }
.vtabs-tab { padding: 8px 12px 9px; font-weight: 600; font-size: 13px; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; border-radius: 6px 6px 0 0; }
.vtabs-tab:hover { color: var(--text); background: var(--hover); }
.vtabs-tab[aria-current="page"] { color: var(--text); border-bottom-color: var(--text); }
.vtabs-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.vlist-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--panel); border-radius: 12px; box-shadow: 0 1px 0 rgba(0, 0, 0, .05), 0 0 0 1px var(--line); }
.vlist-metrics > div { display: grid; align-content: start; gap: 2px; padding: 12px 16px; border-left: 1px solid var(--line-soft); min-width: 0; }
.vlist-metrics > div:first-child { border-left: 0; }
.vlist-metrics span { font-size: 12px; color: var(--muted); }
.vlist-metrics b { font-size: 18px; font-weight: 650; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.vlist-table { overflow-x: auto; border-top: 1px solid var(--line-soft); }
.vlist-table table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.vlist-table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 8px 14px; background: var(--panel-subtle); border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
.vlist-table td { padding: 10px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.vlist-table tr:last-child td { border-bottom: 0; }
.vlist-table .r { text-align: right; white-space: nowrap; }
.vlist-table tbody tr { cursor: pointer; }
.vlist-table tbody tr:hover td { background: var(--hover); }
.vlist-name { font-weight: 600; color: var(--text); text-decoration: none; }
.vlist-name:hover { text-decoration: underline; }
.vlist-sub { display: block; font-size: 12px; color: var(--muted); }
td .vlist-sub { display: inline; }
.vlist-name + .vlist-sub { display: block; }
.vlist-owed { font-weight: 600; }
.vlist-foot { padding: 10px 14px; border-top: 1px solid var(--line-soft); }
@media (max-width: 760px) {
  .vlist-metrics { grid-template-columns: 1fr 1fr; }
  .vlist-metrics > div:nth-child(3) { border-left: 0; }
  .vlist-metrics > div:nth-child(n+3) { border-top: 1px solid var(--line-soft); }
  .vlist-table thead { display: none; }
  .vlist-table tr { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 12px 14px; border-bottom: 1px solid var(--line-soft); }
  .vlist-table td { display: flex; justify-content: space-between; gap: 12px; padding: 0; border: 0; grid-column: 1 / -1; }
  .vlist-table td:first-child { grid-column: 1; }
  .vlist-table td[data-label="Status"] { grid-column: 2; grid-row: 1; }
  .vlist-table td[data-label]:not([data-label="Status"])::before { content: attr(data-label); color: var(--muted); font-size: 12px; }
}

/* A vendor's page (design A): its numbers and orders on the left, and on the
   right what you owe them, their rule, portal and payouts - so none of it sits
   under the orders. */
.vpage-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.vpage-owed { font-size: 26px; font-weight: 650; font-variant-numeric: tabular-nums; line-height: 1.2; }
.vpage-facts { display: grid; gap: 4px; margin: 0; font-size: 13px; }
.vpage-facts div { display: flex; justify-content: space-between; gap: 12px; }
.vpage-facts dt { color: var(--muted); }
.vpage-facts dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.vpage-payouts { list-style: none; margin: 0; padding: 0; display: grid; }
.vpage-payouts li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; padding: 8px 0; border-top: 1px solid var(--line-soft); font-size: 13px; }
.vpage-payouts li:first-child { border-top: 0; }
.vpage-payouts a { font-weight: 600; color: var(--text); }
.vpage-payouts-period { grid-column: 1; color: var(--muted); font-size: 12px; }
.vpage-payouts-end { grid-column: 2; grid-row: 1 / 3; display: grid; justify-items: end; gap: 2px; font-variant-numeric: tabular-nums; }
#vendor-breakdown-results { border-top: 1px solid var(--line-soft); }
#vendor-breakdown-results .table-footer { padding: 10px 14px; }
@media (max-width: 1000px) { .vpage-grid { grid-template-columns: 1fr; } }
.vpage-facts-total { border-top: 1px solid var(--line-soft); padding-top: 6px; margin-top: 2px; font-weight: 650; }
.vpage-facts-total dt { color: var(--text); }
/* Sortable headers in the plain vendor/payout tables: the link fills the cell
   and keeps the header's weight. */
.vlist-table th .th-sort { color: inherit; font: inherit; }
.vlist-table th.r .th-sort { flex-direction: row-reverse; }

/* Vendor payouts board (design B): a column per stage, a card per payout whose
   button is its next step. Columns scroll sideways on a tablet and stack on a phone. */
.vboard { display: grid; grid-template-columns: repeat(4, minmax(230px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 4px; align-items: start; }
.vboard-col { display: grid; gap: 8px; align-content: start; background: var(--panel-subtle); border-radius: 12px; padding: 10px; box-shadow: inset 0 0 0 1px var(--line-soft); min-width: 0; }
.vboard-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.vboard-head h2 { margin: 0; font-size: 13px; font-weight: 650; }
.vboard-head b { font-size: 13px; font-variant-numeric: tabular-nums; }
.vboard-count { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 10px; background: var(--line); font-size: 12px; text-align: center; }
.vboard-hint, .vboard-empty { margin: 0; font-size: 12px; color: var(--muted); }
.vboard-empty { padding: 8px 2px; }
.vboard-card { display: grid; gap: 4px; background: var(--panel); border-radius: 10px; padding: 10px 12px; box-shadow: 0 1px 0 rgba(0, 0, 0, .05), 0 0 0 1px var(--line); min-width: 0; }
.vboard-card-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.vboard-card-top b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.vboard-vendor { font-weight: 600; color: var(--text); text-decoration: none; overflow-wrap: anywhere; }
.vboard-vendor:hover { text-decoration: underline; }
.vboard-meta { font-size: 12px; color: var(--muted); }
.vboard-card-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; margin-top: 4px; }
@media (max-width: 640px) { .vboard { grid-template-columns: 1fr; overflow-x: visible; } }

/* A payout's progress strip: Created -> Approved -> Statement -> Paid, and the
   total with the one next step beside it. */
.vflow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: center; }
.vflow-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.vflow-step { display: flex; gap: 8px; align-items: flex-start; min-width: 0; font-size: 13px; }
.vflow-step b { display: block; }
.vflow-note { display: block; font-size: 12px; color: var(--muted); }
.vflow-dot { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; box-shadow: inset 0 0 0 1.5px var(--control-line); color: var(--muted); }
.vflow-step.is-done .vflow-dot { background: #303030; color: #fff; box-shadow: none; }
.vflow-step.is-now .vflow-dot { box-shadow: inset 0 0 0 2px #303030; color: var(--text); }
.vflow-step.is-todo b, .vflow-step.is-skipped b { color: var(--muted); font-weight: 600; }
.vflow-next { display: grid; justify-items: end; gap: 4px; text-align: right; }
.vflow-total { font-size: 22px; font-weight: 650; font-variant-numeric: tabular-nums; line-height: 1.2; }
@media (max-width: 760px) {
  .vflow { grid-template-columns: 1fr; }
  .vflow-steps { grid-template-columns: 1fr 1fr; }
  .vflow-next { justify-items: start; text-align: left; }
}

/* Payout schedules list (design C). */
/* Polaris sets its own display on its elements, so a field the chosen
   frequency or recipient doesn't use needs [hidden] to win. */
[data-psched-when][hidden], [data-psched-when-recipient][hidden] { display: none !important; }
.vsched-list { list-style: none; margin: 0; padding: 0; }
.vsched-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px 16px; padding: 12px 16px; border-top: 1px solid var(--line-soft); }
.vsched-row:first-child { border-top: 0; }
.vsched-main { display: grid; gap: 3px; min-width: 0; flex: 1 1 340px; }
.vsched-main .vlist-sub { display: block; }

/* The document desk (orders/show, draft_orders/show): the order on the left, the
   document it sends on the right, fitted to one screen. Each side scrolls on
   its own; app.js bootDocumentDesk sets the height from where the desk starts
   and the paper's zoom from the room it has. Below 1040px the two stack and
   the page scrolls as any other. */
.odd { display: grid; grid-template-columns: minmax(340px, 420px) minmax(0, 1fr); gap: 16px; height: var(--odd-height, calc(100vh - 140px)); min-height: 420px; }
.odd-order { min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: 12px; padding: 2px 6px 16px 2px; overscroll-behavior: contain; }
.odd-order > * { flex-shrink: 0; }
.odd-desk { min-width: 0; min-height: 0; display: flex; flex-direction: column; overflow: hidden; background: #fff; border-radius: 12px; box-shadow: 0 1px 0 rgba(26, 26, 26, .07), 0 0 0 1px rgba(26, 26, 26, .07); }
.odd-tabs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 8px 10px; background: #f7f7f7; border-bottom: 1px solid #ebebeb; }
.odd-tab { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 8px; font-size: 13px; font-weight: 550; line-height: 20px; color: #4a4a4a; text-decoration: none; white-space: nowrap; }
.odd-tab:hover { background: #ebebeb; color: #303030; }
.odd-tab:focus-visible, .odd-more summary:focus-visible { outline: 2px solid #005bd3; outline-offset: 1px; }
.odd-tab[aria-current="page"] { background: #fff; color: #1a1a1a; box-shadow: 0 1px 0 rgba(26, 26, 26, .07), inset 0 0 0 1px #d4d4d4; }
.odd-tab.is-locked { color: #8a8a8a; gap: 6px; }
.odd-tab.is-locked:hover { background: none; }
.odd-dot { width: 6px; height: 6px; border-radius: 50%; background: #b5b5b5; flex: none; }
.odd-tab.is-sent .odd-dot { background: #29845a; }
.odd-tab.is-failed .odd-dot { background: #e51c00; }
.odd-more { margin-left: auto; position: relative; }
.odd-more summary { list-style: none; display: inline-flex; align-items: center; gap: 4px; padding: 6px 10px; border-radius: 8px; font-size: 13px; font-weight: 550; color: #616161; cursor: pointer; }
.odd-more summary::-webkit-details-marker { display: none; }
.odd-more summary:hover, .odd-more[open] summary { background: #ebebeb; color: #303030; }
.odd-more-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; width: min(340px, 80vw); padding: 6px; background: #fff; border-radius: 12px; box-shadow: 0 8px 24px rgba(0, 0, 0, .14), 0 0 0 1px rgba(0, 0, 0, .06); }
.odd-more-note { margin: 0; padding: 6px 10px 2px; }
.odd-more-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 10px; border-radius: 8px; }
.odd-more-row + .odd-more-row { border-top: 1px solid #f1f1f1; }
.odd-desk-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid #ebebeb; }
.odd-desk-title { flex: 1 1 260px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.odd-paper-wrap { flex: 1; min-height: 0; overflow: auto; display: flex; justify-content: center; align-items: flex-start; padding: 24px; background: #f1f1f1; overscroll-behavior: contain; }
.odd-paper-wrap > s-banner { width: 100%; }
.odd-paper { flex: none; width: 760px; zoom: var(--odd-zoom, .8); background: #fff; box-shadow: 0 2px 12px rgba(0, 0, 0, .08), 0 0 0 1px rgba(0, 0, 0, .05); }
.odd-paper .template-preview { position: relative; top: auto; box-shadow: none; border: 0; }
.odd-paper .pack-sheet { border: 0; border-radius: 0; }
.odd-balance { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.odd-small > :last-child { white-space: nowrap; }
.odd-balance-amount { font-size: 20px; line-height: 28px; font-weight: 650; font-variant-numeric: tabular-nums; }
.odd-meter { height: 6px; border-radius: 3px; background: #f1f1f1; overflow: hidden; }
.odd-meter span { display: block; height: 100%; min-width: 2px; border-radius: 3px; background: var(--accent); }
.odd-items { list-style: none; margin: 0; padding: 0; }
.odd-items li { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid #f1f1f1; }
.odd-item-name { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.odd-item-amount { min-width: 72px; text-align: right; font-size: 13px; font-variant-numeric: tabular-nums; }
.odd-addresses { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding-top: 12px; border-top: 1px solid #f1f1f1; }
@media (max-width: 1039.98px) {
  .odd { display: flex; flex-direction: column; height: auto; min-height: 0; }
  .odd-order { overflow: visible; padding: 0; }
  .odd-paper-wrap { padding: 16px; }
}
@media (max-width: 489.98px) {
  .odd-addresses { grid-template-columns: 1fr; }
  .odd-desk { border-radius: 0; }
}
.odd-tab.is-outbox .odd-dot { background: #b28400; }
.odd-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* One kit for the vendor, staff and schedule pages (2026-11 redesign), so the
   same things look and line up the same on each: a warning banner with its one
   action, figures in .vlist-metrics, tables in .vlist-table, period links above
   a filter, a person's initials, and form buttons at the end of their card.
   s-banner is display: contents, so in a flex column it needs a box of its own. */
.pk-banner { display: block; min-width: 0; }
.pk-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.pk-nowrap { white-space: nowrap; }
.pk-warn { color: #8a5a00; }
.pk-who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.pk-who-text { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0; }
.pk-tags { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.pk-tags:empty { display: none; }
.pk-av { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--accent-weak); color: var(--accent-strong); font-size: 11.5px; font-weight: 650; display: grid; place-items: center; letter-spacing: .02em; }
.pk-av.is-large { width: 44px; height: 44px; font-size: 15px; }
.pk-metric-text { font-size: 15px !important; line-height: 1.6; }
.vlist-table tfoot tr { background: var(--panel-subtle); }
.vlist-table tfoot td { font-weight: 650; border-top: 1px solid var(--line-soft); border-bottom: 0; }
.vlist-table tbody.is-static tr { cursor: default; }
.vlist-table tbody.is-static tr:hover td { background: transparent; }
.vlist-table .pk-act { text-align: right; white-space: nowrap; padding-top: 4px; padding-bottom: 4px; }

/* Period links: the common ranges, one click each. Ink when current, like the tabs. */
.period-links { display: flex; flex-wrap: wrap; gap: 6px; }
.period-link { display: inline-flex; align-items: center; min-height: 28px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--control-line); background: var(--panel); color: var(--text); font-size: 13px; font-weight: 550; text-decoration: none; white-space: nowrap; }
.period-link:hover { background: var(--hover); }
.period-link[aria-current="true"] { background: #303030; border-color: #303030; color: #fff; }
.period-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* A section whose heading and filter sit above a full-width table. */
.pk-section-head { padding: 16px 16px 0; }
.pk-section-pad { padding: 12px 16px 16px; }

/* A staff member's header: initials, how they're named, and their status. */
.pk-person { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.pk-person-text { display: grid; min-width: 0; flex: 1 1 220px; }
.pk-person-badges { display: flex; flex-wrap: wrap; gap: 6px; }

/* A location's card: its name and figures, the rename fold, then its people. */
.pk-loc { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding: 16px; }
.pk-loc-icon { flex: none; width: 36px; height: 36px; border-radius: 9px; background: var(--accent-weak); color: var(--accent-strong); display: grid; place-items: center; }
.pk-loc-name { display: grid; min-width: 0; flex: 1 1 200px; }
.pk-loc-name h2 { margin: 0; font-size: 15px; font-weight: 650; overflow-wrap: anywhere; }
.pk-loc-name span { font-size: 12px; color: var(--muted); }
.pk-loc-stats { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 0; }
.pk-loc-stats div { display: flex; flex-direction: column-reverse; }
.pk-loc-stats dt { font-size: 12px; color: var(--muted); }
.pk-loc-stats dd { margin: 0; font-weight: 650; font-variant-numeric: tabular-nums; }
.pk-rename, .pk-fold { display: block; }
.pk-rename { padding: 0 16px 12px; }
.pk-rename > summary, .pk-fold > summary { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--accent-strong); list-style: none; border-radius: 6px; }
.pk-rename > summary::-webkit-details-marker, .pk-fold > summary::-webkit-details-marker { display: none; }
.pk-rename > summary::before, .pk-fold > summary::before { content: ""; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); transition: transform .15s ease; }
.pk-rename[open] > summary::before, .pk-fold[open] > summary::before { transform: rotate(45deg); }
.pk-rename > summary:focus-visible, .pk-fold > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pk-rename[open] > summary, .pk-fold[open] > summary { margin-bottom: 12px; }
@media (max-width: 640px) { .pk-loc-stats { width: 100%; } }
@media (prefers-reduced-motion: reduce) { .pk-rename > summary::before, .pk-fold > summary::before { transition: none; } }
/* Two cards side by side (a staff member's name and rule), stacking when narrow. */
.pk-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 16px; align-items: start; }
/* A vendor's share of the list's sales, under the figure. */
.vlist-bar { display: block; width: 100%; max-width: 120px; height: 4px; margin: 5px 0 0 auto; border-radius: 2px; background: var(--line-soft); overflow: hidden; }
.vlist-bar i { display: block; height: 100%; border-radius: 2px; background: var(--accent); }
@media (max-width: 760px) {
  .vlist-bar { display: none; }
  .vlist-table tfoot td:empty { display: none; }
}
/* The Default commission tab: the rule's fields on the left, the worked example
   beside them so it stays in view while the fields change; stacked when narrow. */
.cf-split { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px 24px; align-items: start; }
.cf-split-main { min-width: 0; grid-column: 1; grid-row: 1; }
.cf-split-aside { position: sticky; top: 16px; min-width: 0; grid-column: 2; grid-row: 1 / span 2; }
.cf-split-actions { grid-column: 1; grid-row: 2; display: flex; justify-content: flex-end; }
.cf-split-aside .cf-preview { max-width: none; }
@media (max-width: 900px) {
  .cf-split { grid-template-columns: 1fr; }
  .cf-split-main, .cf-split-aside, .cf-split-actions { grid-column: 1; grid-row: auto; }
  .cf-split-aside { position: static; }
}
/* Before the first payout: what a payout is, the steps to one (ticked when in
   place), and the empty board saying what lands in each column. */
.pk-start { display: flex; flex-wrap: wrap; gap: 16px 32px; align-items: flex-start; }
.pk-start-text { flex: 1 1 380px; min-width: 0; display: grid; gap: 8px; }
.pk-start-actions { flex: 0 0 auto; display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.pk-steps { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 8px; counter-reset: pk-step; font-size: 13px; }
.pk-steps li { display: flex; align-items: center; gap: 10px; counter-increment: pk-step; }
.pk-step-mark { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--accent); color: var(--accent-strong); display: grid; place-items: center; font-size: 11.5px; font-weight: 650; }
.pk-step-mark::before { content: counter(pk-step); }
.pk-steps li.is-done .pk-step-mark { background: var(--accent); color: #fff; }
.pk-steps li.is-done .pk-step-mark::before { content: "\2713"; }
.vboard.is-empty { grid-template-columns: repeat(3, minmax(220px, 1fr)); }
.vboard-ghost { margin: 0; padding: 18px 14px; border: 1.5px dashed var(--control-line); border-radius: 10px; font-size: 12.5px; color: var(--muted); background: var(--panel); min-height: 64px; }
@media (max-width: 640px) { .vboard.is-empty { grid-template-columns: 1fr; } .pk-start-actions { flex-basis: 100%; justify-content: flex-start; } }
/* Settings overview: the store card carries what's left to set up underneath. */
.setx-account { padding: 16px; }
.setx-next { display: grid; gap: 4px; padding: 12px 16px 14px; border-top: 1px solid var(--line-soft); background: var(--panel-subtle); border-radius: 0 0 12px 12px; }
.setx-next-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding-bottom: 4px; }
.setx-pips { display: inline-flex; gap: 4px; }
.setx-pips i { width: 22px; height: 6px; border-radius: 3px; background: var(--line); }
.setx-pips i.is-done { background: var(--text); }
.setx-next .setx-step:first-child { border-top: 0; }
.setx-done { margin: 4px 0 0; display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); }
.setx-step-mark.is-done { flex: none; border: 0; background: var(--text); color: #fff; }
/* The schedule's triggers as tiles (automatic_invoices/_setup_trigger): two
   groups, each a grid of radio cards. The tile is the radio's label, so a click
   anywhere on it picks the trigger; the chosen one is outlined in ink. */
.ssb-modes { margin: 0; padding: 0; border: 0; min-width: 0; display: grid; gap: 8px; }
.ssb-modes legend { padding: 0; margin-bottom: 8px; font-size: 13px; font-weight: 600; color: #303030; }
.ssb-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 190px), 1fr)); gap: 8px; }
.ssb-tile { position: relative; display: flex; align-items: flex-start; gap: 10px; min-height: 64px; padding: 11px 12px; border: 1px solid #e3e3e3; border-radius: 10px; background: #fff; cursor: pointer; box-sizing: border-box; }
.ssb-tile:hover { border-color: #b5b5b5; }
.ssb-tile input { flex: none; width: 16px; height: 16px; margin: 2px 0 0; accent-color: #303030; cursor: inherit; }
.ssb-tile:has(input:checked) { border-color: #303030; box-shadow: inset 0 0 0 1px #303030; background: #fafafa; }
.ssb-tile:has(input:focus-visible) { outline: 2px solid #005bd3; outline-offset: 2px; }
.ssb-tile.is-locked { cursor: not-allowed; background: #f7f7f7; }
.ssb-tile.is-locked .ssb-tile-label { color: #616161; }
.ssb-tile-text { display: grid; gap: 2px; min-width: 0; }
.ssb-tile-label { font-size: 13px; font-weight: 600; color: #303030; }
.ssb-tile-desc { font-size: 12px; line-height: 1.4; color: #616161; }
/* A page's intro line: below 490px s-page drops its padding, so it keeps the
   sections' 16px inset rather than touching the screen's edge. */
.pk-intro { display: block; min-width: 0; }
@media (max-width: 489.98px) { .pk-intro { padding-inline: 16px; } }
@media (max-width: 489.98px) { .pk-person { padding-inline: 16px; } }
/* settings_area's heading column keeps the sections' inset when s-page drops its padding. */
@media (max-width: 489.98px) { .dlv-area > :first-child { padding-inline: 16px; } }
@media (max-width: 760px) { .vlist-table tfoot td { border-top: 0; } .vlist-table tfoot tr { border-top: 1px solid var(--line-soft); } }
/* A table too wide for a tablet (a staff member's orders) turns into cards
   there too, as every list does on a phone, instead of scrolling sideways. */
@media (max-width: 900px) {
  .vlist-table.pk-cards-md thead { display: none; }
  .vlist-table.pk-cards-md tr { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 12px 14px; border-bottom: 1px solid var(--line-soft); }
  .vlist-table.pk-cards-md td { display: flex; justify-content: space-between; gap: 12px; padding: 0; border: 0; grid-column: 1 / -1; }
  .vlist-table.pk-cards-md td:first-child { grid-column: 1; }
  .vlist-table.pk-cards-md td[data-label]::before { content: attr(data-label); color: var(--muted); font-size: 12px; }
  .vlist-table.pk-cards-md .pk-act { justify-content: flex-start; }
}
