/* Ledgerline components. Every value comes from tokens.css. Shared by the product and the system site. */
@font-face { font-family: 'Plex Sans'; src: url(../fonts/plex-sans-latin.woff2) format('woff2'); font-weight: 100 700; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Plex Sans'; src: url(../fonts/plex-sans-latin-ext.woff2) format('woff2'); font-weight: 100 700; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Plex Mono'; src: url(../fonts/plex-mono-400.woff2) format('woff2'); font-weight: 400; font-display: swap; unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2212; }
@font-face { font-family: 'Plex Mono'; src: url(../fonts/plex-mono-500.woff2) format('woff2'); font-weight: 500; font-display: swap; unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2212; }
@font-face { font-family: 'Plex Mono'; src: url(../fonts/plex-mono-400-ext.woff2) format('woff2'); font-weight: 400 500; font-display: swap; unicode-range: U+0100-02BA, U+20A0-20AB, U+20AD-20C0; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--ll-color-bg); color: var(--ll-color-text); font-family: var(--ll-font-sans); font-size: var(--ll-type-md-size); line-height: var(--ll-type-md-line); font-feature-settings: 'tnum' 1, 'zero' 0; -webkit-font-smoothing: antialiased; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
a { color: var(--ll-color-accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
:focus-visible { outline: 2px solid var(--ll-color-focus); outline-offset: 2px; border-radius: 2px; }
::selection { background: var(--ll-color-accent-soft); }
.ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.ic-sm { width: 14px; height: 14px; }
.ic-lg { width: 22px; height: 22px; }
.mono { font-family: var(--ll-font-mono); font-size: .93em; letter-spacing: -.01em; }
.num { font-variant-numeric: tabular-nums; text-align: right; }
.sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--ll-color-accent); color: var(--ll-color-accent-fg); padding: 10px 16px; border-radius: var(--ll-radius-md); }
.skip:focus { top: 12px; }
.overline { font-size: var(--ll-type-2xs-size); line-height: var(--ll-type-2xs-line); font-weight: 500; letter-spacing: var(--ll-type-2xs-track); text-transform: uppercase; color: var(--ll-color-text-muted); }
[hidden] { display: none !important; }

/* Button */
.btn { --b-bg: var(--ll-color-surface); --b-fg: var(--ll-color-text); --b-bd: var(--ll-color-border-strong);
  display: inline-flex; align-items: center; justify-content: center; gap: var(--ll-space-3); min-height: var(--ll-density-control); padding: 0 var(--ll-space-5);
  border: 1px solid var(--b-bd); background: var(--b-bg); color: var(--b-fg); border-radius: var(--ll-radius-md); font-weight: 500; font-size: var(--ll-type-md-size); white-space: nowrap; text-decoration: none;
  transition: background var(--ll-motion-instant) var(--ll-motion-ease), border-color var(--ll-motion-instant), color var(--ll-motion-instant), transform var(--ll-motion-instant); position: relative; }
.btn:hover { --b-bg: var(--ll-color-surface-sunken); }
.btn:active { transform: translateY(1px); }
.btn--primary { --b-bg: var(--ll-color-accent); --b-fg: var(--ll-color-accent-fg); --b-bd: var(--ll-color-accent); }
.btn--primary:hover { --b-bg: var(--ll-color-accent-hover); --b-bd: var(--ll-color-accent-hover); }
.btn--quiet { --b-bg: transparent; --b-bd: transparent; color: var(--ll-color-text); }
.btn--quiet:hover { --b-bg: var(--ll-color-surface-sunken); }
.btn.btn--quiet[disabled] { --b-bg: transparent; --b-bd: transparent; }
.btn--soft { --b-bg: var(--ll-color-accent-soft); --b-bd: transparent; --b-fg: var(--ll-color-accent); }
.btn--soft:hover { --b-bd: var(--ll-color-accent); }
.btn--danger { --b-bg: var(--ll-color-danger-fg); --b-fg: var(--ll-color-surface); --b-bd: var(--ll-color-danger-fg); }
.btn--danger:hover { filter: brightness(1.08); }
.btn--icon { padding: 0; width: var(--ll-density-control); }
.btn--sm { min-height: 32px; padding: 0 var(--ll-space-4); font-size: var(--ll-type-sm-size); }
.btn--sm.btn--icon { width: 32px; padding: 0; }
.btn[disabled], .btn[aria-disabled="true"] { --b-bg: var(--ll-color-surface-sunken); --b-fg: var(--ll-color-text-subtle); --b-bd: var(--ll-color-border); cursor: not-allowed; transform: none; filter: none; }
.btn[aria-disabled="true"] .ic-lock { display: block; }
.btn .ic-lock { display: none; }
.btn.is-loading { color: transparent !important; pointer-events: none; }
.btn.is-loading::after { content: ''; position: absolute; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--b-fg); border-right-color: transparent; animation: ll-spin .7s linear infinite; }
.btn.is-loading .ic { opacity: 0; }
@keyframes ll-spin { to { transform: rotate(360deg); } }
@media (pointer: coarse) { .btn--sm { min-height: 44px; } .btn--sm.btn--icon { width: 44px; } }

/* Field, input, select, textarea */
.field { display: grid; gap: var(--ll-space-2); min-width: 0; }
.field > label, .field > .field-label { font-weight: 500; font-size: var(--ll-type-sm-size); }
.field-hint { color: var(--ll-color-text-muted); font-size: var(--ll-type-xs-size); line-height: var(--ll-type-xs-line); }
.field-error { color: var(--ll-color-danger-fg); font-size: var(--ll-type-xs-size); line-height: var(--ll-type-xs-line); display: flex; gap: 6px; align-items: flex-start; font-weight: 500; }
.field-error .ic { width: 14px; height: 14px; margin-top: 1px; }
.input, .select, .textarea { width: 100%; min-height: var(--ll-density-control); padding: 0 var(--ll-space-4); background: var(--ll-color-surface); border: 1px solid var(--ll-color-border-strong); border-radius: var(--ll-radius-md); color: var(--ll-color-text); transition: border-color var(--ll-motion-quick), box-shadow var(--ll-motion-quick); }
.textarea { padding: var(--ll-space-3) var(--ll-space-4); min-height: 88px; resize: vertical; line-height: var(--ll-type-md-line); }
.input::placeholder, .textarea::placeholder { color: var(--ll-color-text-subtle); opacity: 1; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--ll-color-text-muted); }
.input:focus-visible, .select:focus-visible, .textarea:focus-visible { outline: none; border-color: var(--ll-color-focus); box-shadow: 0 0 0 1px var(--ll-color-focus), 0 0 0 4px var(--ll-color-accent-soft); }
.input[aria-invalid="true"], .textarea[aria-invalid="true"], .select[aria-invalid="true"] { border-color: var(--ll-color-danger-fg); box-shadow: 0 0 0 1px var(--ll-color-danger-fg); }
.input:disabled, .select:disabled, .textarea:disabled { background: var(--ll-color-surface-sunken); color: var(--ll-color-text-subtle); border-color: var(--ll-color-border); cursor: not-allowed; }
.select { appearance: none; -webkit-appearance: none; padding-right: 36px; background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%); background-position: calc(100% - 18px) 52%, calc(100% - 13px) 52%; background-size: 5px 5px; background-repeat: no-repeat; cursor: pointer; text-overflow: ellipsis; }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap > .ic { position: absolute; left: 12px; color: var(--ll-color-text-muted); pointer-events: none; }
.input-wrap > .input { padding-left: 38px; }
.input-wrap > .kbd { position: absolute; right: 10px; }
@media (pointer: coarse) { .input, .select, .textarea { font-size: 16px; } }

/* Checkbox and radio */
.check { display: inline-flex; align-items: center; gap: var(--ll-space-3); cursor: pointer; min-height: 32px; }
.check input { appearance: none; -webkit-appearance: none; margin: 0; width: 18px; height: 18px; flex: none; border: 1.5px solid var(--ll-color-border-strong); border-radius: var(--ll-radius-sm); background: var(--ll-color-surface); display: grid; place-content: center; cursor: pointer; transition: background var(--ll-motion-instant), border-color var(--ll-motion-instant); }
.check input[type="radio"] { border-radius: 50%; }
.check input::before { content: ''; width: 10px; height: 10px; transform: scale(0); transition: transform var(--ll-motion-quick) var(--ll-motion-ease); background: var(--ll-color-accent-fg); clip-path: polygon(14% 52%, 0 66%, 38% 100%, 100% 22%, 86% 8%, 38% 72%); }
.check input[type="radio"]::before { clip-path: circle(50%); width: 8px; height: 8px; }
.check input:checked, .check input:indeterminate { background: var(--ll-color-accent); border-color: var(--ll-color-accent); }
.check input:checked::before { transform: scale(1); }
.check input:indeterminate::before { transform: scale(1); clip-path: inset(40% 8% 40% 8%); }
.check input:hover:not(:disabled) { border-color: var(--ll-color-accent); }
.check input:focus-visible { outline: 2px solid var(--ll-color-focus); outline-offset: 2px; }
.check input:disabled { background: var(--ll-color-surface-sunken); border-color: var(--ll-color-border); cursor: not-allowed; }
.check input:disabled:checked { background: var(--ll-color-border-strong); border-color: var(--ll-color-border-strong); }
.check:has(input:disabled) { color: var(--ll-color-text-subtle); cursor: not-allowed; }
.check-hit { position: relative; display: inline-grid; place-items: center; width: 44px; height: 44px; margin: -13px -12px; cursor: pointer; }
.check-hit input { position: relative; }

/* Badge / status. Shape icon plus word, so colour is never the only signal. */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 8px 0 6px; border-radius: var(--ll-radius-sm); font-size: var(--ll-type-xs-size); font-weight: 500; white-space: nowrap; background: var(--ll-color-neutral-bg); color: var(--ll-color-neutral-fg); line-height: 1; }
.badge .ic { width: 14px; height: 14px; stroke-width: 2.2; }
.badge--ok { background: var(--ll-color-ok-bg); color: var(--ll-color-ok-fg); }
.badge--warn { background: var(--ll-color-warn-bg); color: var(--ll-color-warn-fg); }
.badge--danger { background: var(--ll-color-danger-bg); color: var(--ll-color-danger-fg); }
.badge--info { background: var(--ll-color-info-bg); color: var(--ll-color-info-fg); }
.badge--violet { background: var(--ll-color-violet-bg); color: var(--ll-color-violet-fg); }
.badge--outline { background: transparent; box-shadow: inset 0 0 0 1px currentColor; }
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: var(--ll-type-xs-size); color: var(--ll-color-text-muted); white-space: nowrap; }
.tag--late { color: var(--ll-color-danger-fg); font-weight: 500; }
.tag--soon { color: var(--ll-color-warn-fg); font-weight: 500; }

/* Chip (filter toggle) */
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 12px; border-radius: var(--ll-radius-pill); border: 1px solid var(--ll-color-border-strong); background: var(--ll-color-surface); color: var(--ll-color-text); font-size: var(--ll-type-sm-size); font-weight: 500; white-space: nowrap; transition: background var(--ll-motion-quick), border-color var(--ll-motion-quick); }
.chip:hover { background: var(--ll-color-surface-sunken); }
.chip[aria-pressed="true"] { background: var(--ll-color-accent-soft); border-color: var(--ll-color-accent); color: var(--ll-color-accent); }
.chip[aria-pressed="true"]::before { content: ''; width: 9px; height: 6px; border-left: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg) translate(1px, -2px); }
.chip .count { color: var(--ll-color-text-muted); font-weight: 400; }
.chip[aria-pressed="true"] .count { color: inherit; }
@media (pointer: coarse) { .chip { min-height: 44px; } }

/* Tabs */
.tabs { display: flex; gap: var(--ll-space-1); border-bottom: 1px solid var(--ll-color-border); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { position: relative; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 var(--ll-space-5); border: 0; background: none; color: var(--ll-color-text-muted); font-weight: 500; white-space: nowrap; }
.tab:hover { color: var(--ll-color-text); }
.tab[aria-selected="true"] { color: var(--ll-color-text); }
.tab[aria-selected="true"]::after { content: ''; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 3px; background: var(--ll-color-margin); border-radius: 2px 2px 0 0; }
.tab .count { font-size: var(--ll-type-xs-size); min-width: 22px; height: 20px; padding: 0 6px; border-radius: var(--ll-radius-pill); background: var(--ll-color-surface-sunken); color: var(--ll-color-text-muted); display: inline-grid; place-items: center; }
.tab[aria-selected="true"] .count { background: var(--ll-color-text); color: var(--ll-color-surface); }
.tab:focus-visible { outline-offset: -2px; }

/* Table: ruled like a ledger, red margin on the left */
.tbl-wrap { position: relative; background: var(--ll-color-surface); border: 1px solid var(--ll-color-border); border-radius: var(--ll-radius-md); overflow: auto; }
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--ll-type-md-size); }
:root[data-density="compact"] .tbl { font-size: var(--ll-type-sm-size); }
.tbl th, .tbl td { padding: 0 var(--ll-density-cell-x); height: var(--ll-density-row); text-align: left; vertical-align: middle; border-bottom: 1px solid var(--ll-color-rule); white-space: nowrap; }
.tbl thead th { position: sticky; top: 0; z-index: 2; height: 40px; background: var(--ll-color-surface-sunken); border-bottom: 3px double var(--ll-color-border-strong); font-size: var(--ll-type-2xs-size); font-weight: 500; letter-spacing: .04em; text-transform: uppercase; color: var(--ll-color-text-muted); }
.tbl th.num, .tbl td.num { text-align: right; }
.tbl .c-margin { width: 52px; padding-left: 18px; padding-right: 4px; box-shadow: inset 4px 0 0 -1px transparent; position: relative; }
.tbl tbody .c-margin::after, .tbl thead .c-margin::after { content: ''; position: absolute; top: 0; bottom: -1px; right: 0; width: 5px; border-left: 1px solid var(--ll-color-margin); border-right: 1px solid var(--ll-color-margin); opacity: .55; }
.th-sort { display: inline-flex; align-items: center; gap: 4px; margin: 0 -6px; padding: 0 6px; height: 32px; border: 0; background: none; font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; border-radius: var(--ll-radius-sm); }
.th-sort:hover { color: var(--ll-color-text); background: var(--ll-color-surface); }
.th-sort .ic { width: 13px; height: 13px; opacity: .45; }
[aria-sort="ascending"] .th-sort, [aria-sort="descending"] .th-sort { color: var(--ll-color-text); }
[aria-sort="ascending"] .th-sort .ic, [aria-sort="descending"] .th-sort .ic { opacity: 1; }
.num .th-sort { flex-direction: row-reverse; }
.tbl tbody tr { transition: background var(--ll-motion-quick); }
.tbl tbody tr:hover { background: color-mix(in srgb, var(--ll-color-surface-sunken) 55%, transparent); cursor: pointer; }
.tbl tbody tr.is-selected { background: var(--ll-color-surface-selected); }
.tbl tbody tr.is-active { background: var(--ll-color-surface-selected); box-shadow: inset 3px 0 0 var(--ll-color-accent); }
.tbl tbody tr:focus-visible { outline: 2px solid var(--ll-color-focus); outline-offset: -2px; }
.tbl tbody tr.is-flash { animation: ll-flash 1.6s var(--ll-motion-ease); }
@keyframes ll-flash { 0%, 30% { background: var(--ll-color-ok-bg); } 100% { background: transparent; } }
.tbl tfoot td { height: 48px; background: var(--ll-color-surface); border-bottom: 0; border-top: 1px solid var(--ll-color-border-strong); font-weight: 600; }
.total { border-bottom: 3px double currentColor; padding-bottom: 1px; }
.cell-2 { display: grid; gap: 1px; min-width: 0; }
.cell-2 > :first-child { font-weight: 500; overflow: hidden; text-overflow: ellipsis; }
.cell-2 > :last-child { color: var(--ll-color-text-muted); font-size: var(--ll-type-xs-size); overflow: hidden; text-overflow: ellipsis; }
:root[data-density="compact"] .c-rec .cell-2 > :last-child, :root[data-density="compact"] .c-rider .cell-2 > :last-child, :root[data-density="compact"] .num .cell-2 > :last-child { display: none; }
:root[data-density="compact"] .c-due .cell-2 { display: flex; gap: 8px; align-items: center; }
:root[data-density="compact"] .c-due .cell-2 > :last-child:not(.tag) { display: none; }
.id-btn { border: 0; background: none; padding: 4px 6px; margin: -4px -6px; border-radius: var(--ll-radius-sm); font-family: var(--ll-font-mono); font-size: .93em; font-weight: 500; color: var(--ll-color-accent); text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 3px; }
.id-btn:hover { text-decoration-color: currentColor; }

/* Banner */
.banner { display: flex; align-items: flex-start; gap: var(--ll-space-4); padding: var(--ll-space-4) var(--ll-space-5); border-radius: var(--ll-radius-md); border: 1px solid; background: var(--ll-color-info-bg); color: var(--ll-color-info-fg); border-color: color-mix(in srgb, currentColor 30%, transparent); }
.banner .ic { margin-top: 1px; }
.banner-body { flex: 1; min-width: 0; color: var(--ll-color-text); }
.banner-body b { color: inherit; }
.banner-actions { display: flex; gap: var(--ll-space-3); flex-wrap: wrap; }
.banner--danger { background: var(--ll-color-danger-bg); color: var(--ll-color-danger-fg); }
.banner--warn { background: var(--ll-color-warn-bg); color: var(--ll-color-warn-fg); }
.banner--neutral { background: var(--ll-color-neutral-bg); color: var(--ll-color-neutral-fg); }
@media (max-width: 600px) { .banner { flex-wrap: wrap; } .banner-actions { width: 100%; padding-left: 34px; } }

/* Toast */
.toasts { position: fixed; z-index: 60; left: 50%; bottom: 20px; transform: translateX(-50%); display: grid; gap: var(--ll-space-3); width: min(440px, calc(100vw - 32px)); pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: var(--ll-space-4); padding: var(--ll-space-3) var(--ll-space-3) var(--ll-space-3) var(--ll-space-5); min-height: 52px; background: var(--ll-color-text); color: var(--ll-color-surface); border-radius: var(--ll-radius-lg); box-shadow: var(--ll-elevation-2); animation: ll-toast-in var(--ll-motion-base) var(--ll-motion-ease); }
.toast-msg { flex: 1; min-width: 0; font-size: var(--ll-type-sm-size); }
.toast .btn { --b-bg: transparent; --b-fg: var(--ll-color-surface); --b-bd: transparent; min-height: 40px; }
.toast .btn:hover { --b-bg: color-mix(in srgb, var(--ll-color-surface) 14%, transparent); }
.toast .ic-status { color: var(--ll-color-surface); }
.toast.is-leaving { animation: ll-toast-out var(--ll-motion-base) var(--ll-motion-ease-exit) forwards; }
@keyframes ll-toast-in { from { opacity: 0; transform: translateY(12px); } }
@keyframes ll-toast-out { to { opacity: 0; transform: translateY(8px); } }

/* Modal (native dialog) */
.modal { width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 32px); padding: 0; border: 1px solid var(--ll-color-border); border-radius: var(--ll-radius-lg); background: var(--ll-color-surface-raised); color: var(--ll-color-text); box-shadow: var(--ll-elevation-3); overflow: hidden; }
.modal[open] { display: flex; flex-direction: column; animation: ll-modal-in var(--ll-motion-base) var(--ll-motion-ease); }
.modal::backdrop { background: rgba(12, 16, 22, .48); }
.modal-head { display: flex; align-items: flex-start; gap: var(--ll-space-4); padding: var(--ll-space-6) var(--ll-space-6) var(--ll-space-4); border-bottom: 1px solid var(--ll-color-border); }
.modal-head h2 { font-size: var(--ll-type-xl-size); line-height: var(--ll-type-xl-line); font-weight: 600; letter-spacing: var(--ll-type-xl-track); }
.modal-head p { color: var(--ll-color-text-muted); margin-top: 2px; }
.modal-head .btn { margin: -6px -10px 0 auto; }
.modal-body { padding: var(--ll-space-6); overflow: auto; display: grid; gap: var(--ll-space-6); }
.modal-foot { display: flex; gap: var(--ll-space-3); justify-content: flex-end; padding: var(--ll-space-4) var(--ll-space-6); border-top: 1px solid var(--ll-color-border); background: var(--ll-color-surface); flex-wrap: wrap; }
.modal-foot .spacer { margin-right: auto; align-self: center; color: var(--ll-color-text-muted); font-size: var(--ll-type-xs-size); }
@keyframes ll-modal-in { from { opacity: 0; transform: translateY(8px) scale(.99); } }
@media (max-width: 600px) {
  .modal { width: 100vw; max-width: 100vw; max-height: 92dvh; margin: auto 0 0; border-radius: var(--ll-radius-lg) var(--ll-radius-lg) 0 0; }
  .modal-foot .btn { flex: 1; }
  .modal-foot .spacer { width: 100%; }
}

/* Side panel */
.panel { position: fixed; z-index: 40; top: 0; right: 0; bottom: 0; width: min(460px, 100vw); display: flex; flex-direction: column; background: var(--ll-color-surface-raised); border-left: 1px solid var(--ll-color-border); box-shadow: var(--ll-elevation-3); transform: translateX(104%); visibility: hidden; transition: transform var(--ll-motion-base) var(--ll-motion-ease), visibility 0s linear var(--ll-motion-base); }
.panel.is-open { transform: none; visibility: visible; transition: transform var(--ll-motion-base) var(--ll-motion-ease), visibility 0s; }
.panel-head { padding: var(--ll-space-5) var(--ll-space-6); border-bottom: 1px solid var(--ll-color-border); display: grid; gap: var(--ll-space-3); }
.panel-body { flex: 1; overflow: auto; padding: var(--ll-space-6); display: grid; align-content: start; gap: var(--ll-space-7); overscroll-behavior: contain; }
.panel-foot { padding: var(--ll-space-4) var(--ll-space-6); border-top: 1px solid var(--ll-color-border); display: flex; gap: var(--ll-space-3); flex-wrap: wrap; background: var(--ll-color-surface); }

/* Empty state */
.empty { display: grid; justify-items: center; text-align: center; gap: var(--ll-space-4); padding: var(--ll-space-10) var(--ll-space-6); color: var(--ll-color-text-muted); }
.empty h2, .empty h3 { color: var(--ll-color-text); font-size: var(--ll-type-lg-size); line-height: var(--ll-type-lg-line); font-weight: 600; }
.empty p { max-width: 42ch; }
.empty-art { width: 112px; height: 72px; }
.empty-actions { display: flex; gap: var(--ll-space-3); flex-wrap: wrap; justify-content: center; margin-top: var(--ll-space-2); }

/* Skeleton */
.skel { display: block; border-radius: var(--ll-radius-sm); background: linear-gradient(90deg, var(--ll-color-surface-sunken) 0 40%, color-mix(in srgb, var(--ll-color-surface-sunken) 40%, var(--ll-color-surface)) 50%, var(--ll-color-surface-sunken) 60% 100%); background-size: 300% 100%; animation: ll-shimmer 1.4s linear infinite; height: 12px; }
@keyframes ll-shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }
.skel--text { height: 12px; }
.skel--title { height: 22px; width: 50%; }
.skel--num { height: 28px; width: 60%; }
.skel--block { height: 180px; }

/* Kbd */
.kbd { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border: 1px solid var(--ll-color-border-strong); border-bottom-width: 2px; border-radius: 4px; font-family: var(--ll-font-mono); font-size: 11px; color: var(--ll-color-text-muted); background: var(--ll-color-surface); }

/* Live dot */
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ll-color-ok-fg); box-shadow: 0 0 0 0 color-mix(in srgb, var(--ll-color-ok-fg) 50%, transparent); animation: ll-pulse 2.4s infinite; flex: none; }
.live-dot.is-off { background: var(--ll-color-text-subtle); animation: none; }
.live-dot.is-stale { background: var(--ll-color-warn-fg); animation: none; }
@keyframes ll-pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ll-color-ok-fg) 45%, transparent); } 70%, 100% { box-shadow: 0 0 0 7px transparent; } }

/* Switch */
.switch { display: flex; align-items: center; justify-content: space-between; gap: var(--ll-space-4); min-height: 44px; width: 100%; padding: 0; border: 0; background: none; text-align: left; }
.switch-track { width: 36px; height: 20px; border-radius: 999px; background: var(--ll-color-border-strong); position: relative; flex: none; transition: background var(--ll-motion-quick); }
.switch-track::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--ll-color-surface-raised); transition: transform var(--ll-motion-quick) var(--ll-motion-ease); }
.switch[aria-checked="true"] .switch-track { background: var(--ll-color-accent); }
.switch[aria-checked="true"] .switch-track::after { transform: translateX(16px); }
.switch-text { display: grid; gap: 1px; }
.switch-text small { color: var(--ll-color-text-muted); font-size: var(--ll-type-xs-size); line-height: var(--ll-type-xs-line); }

/* Segmented control */
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: var(--ll-radius-md); background: var(--ll-color-surface-sunken); border: 1px solid var(--ll-color-border); }
.seg button { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 0 10px; border: 0; border-radius: 4px; background: none; color: var(--ll-color-text-muted); font-weight: 500; font-size: var(--ll-type-sm-size); }
.seg button[aria-pressed="true"] { background: var(--ll-color-surface-raised); color: var(--ll-color-text); box-shadow: var(--ll-elevation-1); }
@media (pointer: coarse) { .seg button { min-height: 40px; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; scroll-behavior: auto !important; }
  .skel { animation: none; }
  .live-dot { animation: none; }
}
