/**
 * Zeyn component library styles.
 *
 * Loaded after zeyn.css and read only its tokens (docs/theming.md), so themes, dark mode and
 * density apply here too. Inline styles in the markup only set custom properties:
 * --z-flex (row column weight), --z-stack-gap, --z-split, --z-progress.
 */

:root {
  --z-chart-1: #0f6674;
  --z-chart-2: #b35a00;
  --z-chart-3: #5b4bb7;
  --z-chart-4: #2e7d32;
  --z-chart-5: #b0306a;
  --z-chart-6: #4a5866;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --z-chart-1: #5cc4d1;
    --z-chart-2: #f0a95a;
    --z-chart-3: #a99cf0;
    --z-chart-4: #7fcf86;
    --z-chart-5: #ee86b5;
    --z-chart-6: #aeb9c4;
  }
}

:root[data-theme="dark"] {
  --z-chart-1: #5cc4d1;
  --z-chart-2: #f0a95a;
  --z-chart-3: #a99cf0;
  --z-chart-4: #7fcf86;
  --z-chart-5: #ee86b5;
  --z-chart-6: #aeb9c4;
}

/* Layout ------------------------------------------------------------------------------------ */

.z-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--z-gap);
  align-items: flex-start;
}

.z-col {
  flex: var(--z-flex, 1) 1 18rem;
  min-width: 0;
}

.z-row-compact { gap: calc(var(--z-space) * 2); align-items: center; }

.z-row-compact > .z-col { flex: 0 0 auto; }

.z-stack {
  display: flex;
  flex-direction: column;
  gap: calc(var(--z-space) * var(--z-stack-gap, 3));
  min-width: 0;
}

.z-panel,
.z-card {
  background: var(--z-surface);
  border: 1px solid var(--z-border);
  border-radius: var(--z-radius-lg);
  min-width: 0;
}

.z-panel-head {
  display: flex;
  align-items: center;
  gap: calc(var(--z-space) * 2);
  padding: calc(var(--z-space) * 2) calc(var(--z-space) * 3);
  border-bottom: 1px solid var(--z-border);
  flex-wrap: wrap;
}

.z-panel-head .z-toolbar {
  margin: 0 0 0 auto;
  padding: 0;
  border: 0;
  background: none;
}

.z-panel-title {
  margin: 0;
  font-size: var(--z-font-size);
  font-weight: 600;
}

.z-panel-toggle {
  display: inline-flex;
  align-items: center;
  gap: calc(var(--z-space) * 1.5);
  min-height: 24px;
  padding: 0 calc(var(--z-space) * 1);
  margin-left: calc(var(--z-space) * -1);
  border: 0;
  border-radius: var(--z-radius-sm);
  background: none;
  color: inherit;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.z-panel-toggle:hover { background: var(--z-hover); }

.z-chevron {
  width: 0.5rem;
  height: 0.5rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translate(-2px, -2px);
  transition: transform 0.15s;
}

[aria-expanded="false"] > .z-chevron { transform: rotate(-45deg); }

.z-panel-head:has([aria-expanded="false"]) { border-bottom-color: transparent; }

.z-panel-body,
.z-card {
  padding: calc(var(--z-space) * 3);
}

.z-panel-body > .z-node + .z-node,
.z-card > .z-node + .z-node { margin-top: var(--z-gap); }

.z-card-title {
  margin: 0 0 calc(var(--z-space) * 2);
  font-size: var(--z-font-size);
  font-weight: 600;
}

.z-tabs { min-width: 0; }

.z-tablist {
  display: flex;
  gap: calc(var(--z-space) * 1);
  border-bottom: 1px solid var(--z-border);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
}

.z-tab {
  position: relative;
  min-height: var(--z-control);
  padding: 0 calc(var(--z-space) * 3);
  border: 0;
  background: none;
  color: var(--z-text-muted);
  font: inherit;
  white-space: nowrap;
  cursor: pointer;
}

.z-tab:hover { color: var(--z-text); background: var(--z-hover); }

.z-tab[aria-selected="true"] {
  color: var(--z-accent);
  font-weight: 600;
}

.z-tab[aria-selected="true"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--z-accent);
}

.z-tab:focus-visible { outline-offset: -2px; }

.z-tabpanel { padding-top: var(--z-gap); }

.z-tabpanel:focus-visible {
  outline: 2px solid var(--z-focus);
  outline-offset: 2px;
  border-radius: var(--z-radius-sm);
}

.z-tabpanel[aria-busy="true"] { min-height: 6rem; }

.z-split {
  display: flex;
  min-height: 16rem;
  border: 1px solid var(--z-border);
  border-radius: var(--z-radius-lg);
  background: var(--z-surface);
  overflow: hidden;
}

.z-split-pane {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  padding: calc(var(--z-space) * 3);
}

.z-split > .z-split-pane:first-child { flex: 0 0 var(--z-split, 40%); }

.z-split > .z-split-pane:last-child { flex: 1 1 0; }

.z-split-bar {
  flex: 0 0 auto;
  width: 8px;
  cursor: col-resize;
  background: var(--z-surface-2);
  border-inline: 1px solid var(--z-border);
  position: relative;
  touch-action: none;
}

.z-split-bar::after {
  content: "";
  position: absolute;
  inset: 50% 2px auto;
  height: 24px;
  transform: translateY(-50%);
  border-inline: 1px solid var(--z-border-strong);
}

.z-split-bar:hover,
.z-split-bar[data-dragging] { background: var(--z-hover); }

.z-split-bar:focus-visible {
  outline: 2px solid var(--z-focus);
  outline-offset: -2px;
}

.z-split-v { flex-direction: column; min-height: 24rem; }

.z-split-v .z-split-bar {
  width: auto;
  height: 8px;
  cursor: row-resize;
  border-inline: 0;
  border-block: 1px solid var(--z-border);
}

.z-split-v .z-split-bar::after {
  inset: 2px auto 2px 50%;
  width: 24px;
  height: auto;
  transform: translateX(-50%);
  border-inline: 0;
  border-block: 1px solid var(--z-border-strong);
}

@media (max-width: 640px) {
  .z-split { flex-direction: column; }
  .z-split > .z-split-pane:first-child { flex-basis: auto; }
  .z-split-bar { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .z-chevron { transition: none; }
}

@media (forced-colors: active) {
  .z-tab[aria-selected="true"]::after { background: Highlight; }
  .z-split-bar { border-color: CanvasText; }
}

/* Popups ------------------------------------------------------------------------------------- */

.z-pop {
  position: fixed;
  inset: auto;
  left: var(--z-pop-x, 8px);
  top: var(--z-pop-y, 8px);
  margin: 0;
  padding: 0;
  max-width: calc(100vw - 16px);
  max-height: calc(100vh - 16px);
  overflow: auto;
  border: 1px solid var(--z-border);
  border-radius: var(--z-radius-lg);
  background: var(--z-surface);
  color: var(--z-text);
  box-shadow: var(--z-shadow-2);
  font: inherit;
  font-size: var(--z-font-size);
  overscroll-behavior: contain;
  animation: z-pop-in 0.12s ease-out;
}

.z-pop-fallback { z-index: 1000; }

.z-pop[data-side="top"] { animation-name: z-pop-in-up; }

@keyframes z-pop-in {
  from { opacity: 0; transform: translateY(-4px); }
}

@keyframes z-pop-in-up {
  from { opacity: 0; transform: translateY(4px); }
}

.z-pop.z-sheet {
  left: 0;
  right: 0;
  top: auto;
  bottom: 0;
  width: 100%;
  max-width: none;
  max-height: 88vh;
  border-radius: var(--z-radius-lg) var(--z-radius-lg) 0 0;
  border-bottom: 0;
  padding-bottom: env(safe-area-inset-bottom);
  animation: z-sheet-in 0.18s ease-out;
}

.z-pop.z-sheet::backdrop { background: var(--z-backdrop); }

@keyframes z-sheet-in {
  from { transform: translateY(100%); }
}

/* Date and time fields ------------------------------------------------------------------------ */

.z-date {
  position: relative;
  display: flex;
  align-items: stretch;
  min-width: 0;
}

.z-field .z-date input:not([type="checkbox"]) {
  flex: 1 1 auto;
  min-width: 0;
  border-start-end-radius: 0;
  border-end-end-radius: 0;
  font-variant-numeric: tabular-nums;
}

.z-date-open {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: var(--z-control);
  min-height: var(--z-control);
  margin-inline-start: -1px;
  padding: 0;
  border: 1px solid var(--z-border-strong);
  border-start-end-radius: var(--z-radius);
  border-end-end-radius: var(--z-radius);
  background: var(--z-surface-2);
  color: var(--z-text-muted);
  cursor: pointer;
}

.z-date-open:hover { background: var(--z-hover); color: var(--z-text); }

.z-date-open[aria-expanded="true"] { color: var(--z-accent); background: var(--z-brand-subtle); }

.z-date-open:focus-visible {
  outline: 2px solid var(--z-focus);
  outline-offset: 1px;
  position: relative;
  z-index: 1;
}

.z-date-icon {
  width: 16px;
  height: 16px;
  background: currentColor;
  -webkit-mask: var(--z-i) center / contain no-repeat;
  mask: var(--z-i) center / contain no-repeat;
  --z-i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round' stroke-linecap='round'%3E%3Crect x='4' y='5' width='16' height='15' rx='2'/%3E%3Cpath d='M4 10h16M8 3v4M16 3v4'/%3E%3C/svg%3E");
}

.z-time-icon {
  --z-i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='8.5'/%3E%3Cpath d='M12 7.5V12l3 2'/%3E%3C/svg%3E");
}

.z-date-zone {
  flex: none;
  display: inline-flex;
  align-items: center;
  margin-inline-start: -1px;
  padding: 0 calc(var(--z-space) * 2);
  border: 1px solid var(--z-border-strong);
  background: var(--z-surface-2);
  color: var(--z-text-muted);
  font-size: var(--z-font-size-xs);
  white-space: nowrap;
  cursor: help;
}

.z-field-hint {
  margin: 2px 0 0;
  color: var(--z-text-muted);
  font-size: var(--z-font-size-xs);
}

.z-range .z-date-range {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  align-items: end;
  gap: calc(var(--z-space) * 2);
}

.z-range-part { display: grid; gap: 2px; min-width: 0; }

.z-range-part label { font-size: var(--z-font-size-sm); color: var(--z-text-muted); font-weight: 600; }

.z-field .z-date-range input:not([type="checkbox"]) { border-radius: var(--z-radius); }

.z-date-range > .z-date-open { margin: 0; border-radius: var(--z-radius); height: var(--z-control); }

.z-filter-range[data-zeyn-date] { position: relative; }

.z-filter-range .z-filter-pick {
  width: 24px;
  min-height: 24px;
  margin: 0;
  border-radius: var(--z-radius-sm);
  border-color: var(--z-border);
}

.z-filter-range .z-filter-pick .z-date-icon { width: 14px; height: 14px; }

/* Picker panel -------------------------------------------------------------------------------- */

.z-picker {
  display: grid;
  grid-template-columns: auto auto;
  grid-template-areas: "cal clock" "foot foot";
  gap: 0;
}

.z-picker-range { grid-template-areas: "presets cal" "foot foot"; }

.z-picker-date { grid-template-columns: auto; grid-template-areas: "cal" "foot"; }

.z-picker-time { grid-template-columns: auto; grid-template-areas: "clock" "foot"; }

.z-cal { grid-area: cal; padding: calc(var(--z-space) * 3); min-width: 17.5rem; }

.z-cal-head {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-bottom: calc(var(--z-space) * 2);
}

.z-cal-nav,
.z-cal-title,
.z-cal-day,
.z-cal-pick button,
.z-presets button,
.z-picker .z-link {
  min-width: 32px;
  min-height: 32px;
  padding: 0 calc(var(--z-space) * 2);
  border: 1px solid transparent;
  border-radius: var(--z-radius);
  background: none;
  color: inherit;
  font: inherit;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}

.z-cal-nav { font-size: 1.25rem; line-height: 1; color: var(--z-text-muted); padding: 0; }

.z-cal-title { font-weight: 600; text-transform: capitalize; }

.z-cal-title:first-of-type { margin-inline-start: auto; }

.z-cal-title + .z-cal-title { margin-inline-end: auto; }

.z-cal-title[aria-pressed="true"] { background: var(--z-brand-subtle); color: var(--z-accent); }

.z-picker button:hover:not([aria-disabled="true"]) { background: var(--z-hover); }

.z-picker button:focus-visible,
.z-clock-col:focus-visible {
  outline: 2px solid var(--z-focus);
  outline-offset: -2px;
}

.z-cal-grid { border-collapse: separate; border-spacing: 0 2px; width: 100%; }

.z-cal-grid th {
  padding: 0 0 4px;
  color: var(--z-text-muted);
  font-size: var(--z-font-size-xs);
  font-weight: 600;
  text-align: center;
  text-transform: capitalize;
}

.z-cal-grid td { padding: 0; text-align: center; }

.z-cal-grid .z-cal-week {
  width: 2rem;
  color: var(--z-text-muted);
  font-size: var(--z-font-size-xs);
  font-weight: 400;
  border-inline-end: 1px solid var(--z-border);
}

.z-cal-day { width: 36px; height: 36px; padding: 0; }

.z-cal-day[aria-current="date"] { border-color: var(--z-border-strong); font-weight: 600; }

.z-cal-day.z-in-range { background: var(--z-brand-subtle); border-radius: 0; }

.z-cal-day[aria-pressed="true"],
.z-cal-day.z-range-start,
.z-cal-day.z-range-end {
  background: var(--z-primary);
  border-color: var(--z-primary);
  color: var(--z-on-primary);
  font-weight: 600;
}

.z-picker .z-cal-day[aria-pressed="true"]:hover,
.z-picker .z-cal-day.z-range-end:hover { background: var(--z-primary-hover); }

.z-cal-day[aria-disabled="true"],
.z-cal-pick button[aria-disabled="true"] {
  color: var(--z-text-muted);
  opacity: 0.55;
  text-decoration: line-through;
  cursor: not-allowed;
}

.z-cal-pick { display: grid; gap: 4px; min-height: 15.5rem; align-content: start; }

.z-cal-pick-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }

.z-cal-years .z-cal-pick-row { grid-template-columns: repeat(4, 1fr); }

.z-cal-pick [role="gridcell"] { display: grid; }

.z-cal-pick button { min-height: 40px; text-transform: capitalize; }

.z-cal-pick button[aria-pressed="true"] {
  background: var(--z-primary);
  color: var(--z-on-primary);
  font-weight: 600;
}

.z-clock {
  grid-area: clock;
  display: flex;
  gap: 2px;
  padding: calc(var(--z-space) * 3) calc(var(--z-space) * 2);
  border-inline-start: 1px solid var(--z-border);
}

.z-picker-time .z-clock { border: 0; }

.z-clock-col {
  width: 3.25rem;
  height: 15.5rem;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  scrollbar-width: thin;
  border-radius: var(--z-radius);
  padding-block: 6.25rem;
}

.z-clock-opt {
  display: grid;
  place-items: center;
  height: 36px;
  margin-inline: 2px;
  border-radius: var(--z-radius);
  font-variant-numeric: tabular-nums;
  scroll-snap-align: center;
  cursor: pointer;
}

.z-clock-opt:hover { background: var(--z-hover); }

.z-clock-opt[aria-selected="true"] {
  background: var(--z-primary);
  color: var(--z-on-primary);
  font-weight: 600;
}

.z-clock-col:focus-visible [aria-selected="true"] { box-shadow: 0 0 0 2px var(--z-surface), 0 0 0 4px var(--z-focus); }

.z-presets {
  grid-area: presets;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 9.5rem;
  padding: calc(var(--z-space) * 3) calc(var(--z-space) * 2);
  border-inline-end: 1px solid var(--z-border);
  background: var(--z-surface-2);
}

.z-presets button { text-align: start; white-space: nowrap; }

.z-picker-foot {
  grid-area: foot;
  display: flex;
  align-items: center;
  gap: calc(var(--z-space) * 1);
  padding: calc(var(--z-space) * 2) calc(var(--z-space) * 3);
  border-top: 1px solid var(--z-border);
  background: var(--z-surface-2);
  border-radius: 0 0 var(--z-radius-lg) var(--z-radius-lg);
}

.z-picker-foot .z-date-zone { border: 0; background: none; padding: 0; cursor: default; }

.z-grow { flex: 1; }

.z-picker .z-link { color: var(--z-accent); font-weight: 600; }

.z-picker-foot .z-button { min-height: 32px; }

.z-sheet.z-picker { grid-template-columns: 1fr; grid-template-areas: "presets" "cal" "clock" "foot"; }

.z-sheet .z-cal { min-width: 0; }

.z-sheet .z-cal-day { width: 100%; height: 44px; }

.z-sheet .z-clock { justify-content: center; border-inline-start: 0; border-top: 1px solid var(--z-border); }

.z-sheet .z-clock-opt { height: 44px; }

.z-sheet .z-presets { flex-direction: row; overflow-x: auto; border: 0; border-bottom: 1px solid var(--z-border); }

.z-sheet .z-picker-foot { border-radius: 0; }

.z-sheet.z-picker button { min-height: 44px; }

@media (pointer: coarse) {
  .z-cal-day,
  .z-clock-opt,
  .z-date-open { min-height: 44px; min-width: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  .z-pop,
  .z-pop.z-sheet { animation: none; }
}

@media (forced-colors: active) {
  .z-cal-day[aria-pressed="true"],
  .z-cal-day.z-range-start,
  .z-cal-day.z-range-end,
  .z-clock-opt[aria-selected="true"],
  .z-cal-pick button[aria-pressed="true"] { background: Highlight; color: HighlightText; forced-color-adjust: none; }
  .z-cal-day.z-in-range { outline: 1px solid Highlight; }
  .z-pop { border-color: CanvasText; }
}

/* Controls ----------------------------------------------------------------------------------- */

.z-native {
  position: absolute !important;
  inset-inline-start: 0;
  bottom: 0;
  width: 1px !important;
  min-width: 0 !important;
  height: 1px !important;
  min-height: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  opacity: 0;
  pointer-events: none;
}

.z-select,
.z-lookup,
.z-listbox-field,
.z-number { position: relative; min-width: 0; }

.z-select-button,
.z-lookup-box {
  display: flex;
  align-items: center;
  gap: calc(var(--z-space) * 2);
  min-height: var(--z-control);
  padding: 0 calc(var(--z-space) * 2.5);
  border: 1px solid var(--z-border-strong);
  border-radius: var(--z-radius);
  background: var(--z-surface);
  color: var(--z-text);
  cursor: pointer;
}

.z-select-button:hover,
.z-lookup-box:hover { border-color: var(--z-text-muted); }

.z-select-button:focus-visible,
.z-lookup-box:focus-within,
.z-listbox-inline:focus-visible {
  outline: 2px solid var(--z-focus);
  outline-offset: 1px;
}

.z-select-button[aria-invalid="true"],
.z-lookup-box:has([aria-invalid="true"]),
.z-listbox-inline[aria-invalid="true"] { border-color: var(--z-danger); }

.z-select-value {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.z-placeholder { color: var(--z-text-muted); }

.z-select-arrow {
  flex: none;
  width: 0.45rem;
  height: 0.45rem;
  margin-top: -3px;
  border-right: 2px solid var(--z-text-muted);
  border-bottom: 2px solid var(--z-text-muted);
  transform: rotate(45deg);
}

[aria-expanded="true"] > .z-select-arrow,
.z-lookup-box:has([aria-expanded="true"]) .z-select-arrow { transform: rotate(-135deg); margin-top: 3px; }

.z-lookup-box { flex-wrap: wrap; cursor: text; padding-block: 2px; gap: 4px; }

.z-field .z-lookup-box input.z-lookup-input:focus-visible { outline: none; }

.z-field .z-lookup-box input.z-lookup-input {
  flex: 1 1 8rem;
  min-width: 6rem;
  min-height: calc(var(--z-control) - 6px);
  padding: 0;
  border: 0;
  background: none;
  outline: none;
}

.z-lookup-toggle {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  margin-inline-start: auto;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.z-tags { display: contents; list-style: none; }

.z-tag {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  max-width: 100%;
  min-height: 24px;
  padding-inline-start: calc(var(--z-space) * 2);
  border-radius: var(--z-radius-sm);
  background: var(--z-brand-subtle);
  color: var(--z-text);
  font-size: var(--z-font-size-sm);
}

.z-tag-remove {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: var(--z-radius-sm);
  background: none;
  color: var(--z-text-muted);
  font-size: 1rem;
  cursor: pointer;
}

.z-tag-remove:hover { background: var(--z-hover); color: var(--z-text); }

.z-tag-remove:focus-visible { outline: 2px solid var(--z-focus); outline-offset: -2px; }

.z-list-pop {
  min-width: var(--z-pop-min, 12rem);
  max-height: min(20rem, 60vh);
  overflow: auto;
  padding: 4px;
}

.z-sheet.z-list-pop { max-height: 70vh; }

.z-listbox { display: grid; gap: 1px; }

.z-option {
  display: flex;
  align-items: center;
  gap: calc(var(--z-space) * 2);
  min-height: 32px;
  padding: 4px calc(var(--z-space) * 2.5);
  border-radius: var(--z-radius);
  cursor: pointer;
}

.z-option:hover { background: var(--z-hover); }

.z-option.z-active { background: var(--z-hover); box-shadow: inset 2px 0 0 var(--z-accent); }

.z-option[aria-selected="true"] { color: var(--z-accent); font-weight: 600; }

.z-option[aria-selected="true"]:not(:has(.z-option-check))::after {
  content: "";
  width: 0.35rem;
  height: 0.65rem;
  margin-inline-start: auto;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
}

.z-option-text { display: grid; min-width: 0; }

.z-option-hint { color: var(--z-text-muted); font-size: var(--z-font-size-xs); font-weight: 400; }

.z-option-check {
  flex: none;
  width: 16px;
  height: 16px;
  border: 1px solid var(--z-border-strong);
  border-radius: var(--z-radius-sm);
  background: var(--z-surface);
}

[aria-selected="true"] > .z-option-check {
  background: var(--z-primary);
  border-color: var(--z-primary);
  box-shadow: inset 0 0 0 3px var(--z-surface);
}

.z-option-more { color: var(--z-accent); font-weight: 600; justify-content: center; }

.z-list-note { padding: calc(var(--z-space) * 2.5); color: var(--z-text-muted); }

.z-list-group-label {
  padding: calc(var(--z-space) * 2) calc(var(--z-space) * 2.5) 2px;
  color: var(--z-text-muted);
  font-size: var(--z-font-size-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.z-listbox-field { display: grid; gap: 4px; }

.z-listbox-inline {
  max-height: 16rem;
  overflow: auto;
  padding: 4px;
  border: 1px solid var(--z-border-strong);
  border-radius: var(--z-radius);
  background: var(--z-surface);
}

.z-listbox-inline [aria-selected="true"] { background: var(--z-brand-subtle); }

.z-check {
  display: inline-flex;
  align-items: center;
  gap: calc(var(--z-space) * 2);
  min-height: var(--z-control);
}

.z-check label { margin: 0; cursor: pointer; }

.z-field input.z-checkbox,
.z-radio input {
  appearance: none;
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 1px solid var(--z-border-strong);
  border-radius: var(--z-radius-sm);
  background: var(--z-surface);
  cursor: pointer;
}

.z-radio input { border-radius: 50%; }

.z-field input.z-checkbox:checked {
  background: var(--z-primary);
  border-color: var(--z-primary);
}

.z-field input.z-checkbox:checked::after {
  content: "";
  width: 5px;
  height: 9px;
  margin-top: -2px;
  border-right: 2px solid var(--z-on-primary);
  border-bottom: 2px solid var(--z-on-primary);
  transform: rotate(45deg);
}

.z-radio input:checked { border-color: var(--z-primary); }

.z-radio input:checked::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--z-primary);
}

.z-field input.z-checkbox:focus-visible,
.z-radio input:focus-visible,
.z-switch:focus-visible + .z-switch-track {
  outline: 2px solid var(--z-focus);
  outline-offset: 2px;
}

.z-switch-wrap { position: relative; }

.z-field input.z-switch {
  position: absolute;
  inset-inline-start: 0;
  width: 36px;
  height: 20px;
  min-height: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.z-switch-track {
  position: relative;
  flex: none;
  width: 36px;
  height: 20px;
  border: 1px solid var(--z-border-strong);
  border-radius: 999px;
  background: var(--z-surface-2);
  pointer-events: none;
  transition: background 0.15s;
}

.z-switch-track::after {
  content: "";
  position: absolute;
  top: 2px;
  inset-inline-start: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--z-text-muted);
  transition: transform 0.15s;
}

.z-switch:checked + .z-switch-track { background: var(--z-primary); border-color: var(--z-primary); }

.z-switch:checked + .z-switch-track::after { background: var(--z-on-primary); transform: translateX(16px); }

:dir(rtl) .z-switch:checked + .z-switch-track::after { transform: translateX(-16px); }

.z-radios { margin: 0; padding: 0; border: 0; min-width: 0; }

.z-radios legend {
  padding: 0;
  margin-bottom: 4px;
  color: var(--z-text-muted);
  font-size: var(--z-font-size-sm);
  font-weight: 600;
}

.z-radios-list { display: flex; flex-wrap: wrap; gap: 2px calc(var(--z-space) * 4); }

.z-radio {
  display: inline-flex;
  align-items: center;
  gap: calc(var(--z-space) * 2);
  min-height: var(--z-control);
  cursor: pointer;
  color: var(--z-text);
  font-weight: 400;
}

.z-segmented .z-radios-list {
  display: inline-flex;
  gap: 0;
  padding: 2px;
  border: 1px solid var(--z-border-strong);
  border-radius: var(--z-radius);
  background: var(--z-surface-2);
}

.z-segmented .z-radio {
  position: relative;
  min-height: calc(var(--z-control) - 6px);
  padding: 0 calc(var(--z-space) * 3);
  border-radius: calc(var(--z-radius) - 1px);
}

.z-segmented .z-radio input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: inherit;
  opacity: 0;
}

.z-segmented .z-radio:hover { background: var(--z-hover); }

.z-segmented .z-radio:has(input:checked) {
  background: var(--z-surface);
  color: var(--z-accent);
  font-weight: 600;
  box-shadow: 0 1px 2px hsl(var(--z-shadow-color) / var(--z-shadow-strength));
}

.z-segmented .z-radio:has(input:focus-visible) { outline: 2px solid var(--z-focus); outline-offset: 1px; }

.z-number { display: flex; }

.z-field .z-number input {
  flex: 1;
  min-width: 0;
  border-start-end-radius: 0;
  border-end-end-radius: 0;
  font-variant-numeric: tabular-nums;
  text-align: end;
}

.z-steppers {
  display: grid;
  grid-template-rows: 1fr 1fr;
  margin-inline-start: -1px;
  border: 1px solid var(--z-border-strong);
  border-start-end-radius: var(--z-radius);
  border-end-end-radius: var(--z-radius);
  overflow: hidden;
}

.z-steppers button {
  display: grid;
  place-items: center;
  width: 24px;
  min-height: 0;
  padding: 0;
  border: 0;
  background: var(--z-surface-2);
  color: var(--z-text-muted);
  font: inherit;
  font-size: 0.75rem;
  line-height: 1;
  cursor: pointer;
}

.z-steppers button + button { border-top: 1px solid var(--z-border); }

.z-steppers button:hover { background: var(--z-hover); color: var(--z-text); }

.z-field textarea.z-textarea {
  field-sizing: content;
  min-height: calc(var(--z-control) * 2.5);
  max-height: 20rem;
  resize: vertical;
}

.z-counter {
  margin: 2px 0 0;
  color: var(--z-text-muted);
  font-size: var(--z-font-size-xs);
  font-variant-numeric: tabular-nums;
  text-align: end;
}

.z-counter.z-near { color: var(--z-warning); font-weight: 600; }

.z-field input[type="file"] {
  padding: 0;
  border: 1px dashed var(--z-border-strong);
  border-radius: var(--z-radius);
  background: var(--z-surface);
  color: var(--z-text-muted);
  cursor: pointer;
}

.z-field input[type="file"]::file-selector-button {
  min-height: calc(var(--z-control) - 2px);
  margin-inline-end: calc(var(--z-space) * 3);
  padding: 0 calc(var(--z-space) * 3);
  border: 0;
  border-inline-end: 1px solid var(--z-border);
  background: var(--z-surface-2);
  color: var(--z-text);
  font: inherit;
  cursor: pointer;
}

.z-field input[type="file"]:hover::file-selector-button { background: var(--z-hover); }

@media (pointer: coarse) {
  .z-option,
  .z-radio,
  .z-check,
  .z-tag-remove,
  .z-steppers button { min-height: 44px; }
  .z-tag-remove,
  .z-steppers button { min-width: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  .z-switch-track,
  .z-switch-track::after { transition: none; }
}

@media (forced-colors: active) {
  .z-option.z-active { outline: 2px solid Highlight; }
  .z-field input.z-checkbox:checked,
  .z-switch:checked + .z-switch-track,
  [aria-selected="true"] > .z-option-check { background: Highlight; forced-color-adjust: none; }
  .z-segmented .z-radio:has(input:checked) { outline: 2px solid Highlight; }
}

/* Lines -------------------------------------------------------------------------------------- */

.z-lines { display: grid; gap: calc(var(--z-space) * 2); min-width: 0; }

.z-lines-label {
  margin: 0;
  color: var(--z-text-muted);
  font-size: var(--z-font-size-sm);
  font-weight: 600;
}

.z-lines-scroll {
  overflow-x: auto;
  border: 1px solid var(--z-border);
  border-radius: var(--z-radius);
  background: var(--z-surface);
}

.z-lines-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--z-font-size-sm);
}

.z-lines-table th,
.z-lines-table td {
  padding: 3px calc(var(--z-space) * 1.5);
  border-bottom: 1px solid var(--z-border);
  text-align: start;
  vertical-align: top;
}

.z-lines-table thead th {
  background: var(--z-surface-2);
  color: var(--z-text-muted);
  font-size: var(--z-font-size-xs);
  font-weight: 600;
  white-space: nowrap;
  padding-block: calc(var(--z-space) * 1.5);
}

.z-lines-table .z-num { text-align: end; }

.z-lines-n { width: 2.5rem; color: var(--z-text-muted); font-variant-numeric: tabular-nums; padding-top: 9px !important; }

.z-field .z-lines-table input.z-cell {
  width: 100%;
  min-width: 5rem;
  min-height: 30px;
  border-color: transparent;
  background: transparent;
}

.z-field .z-lines-table input.z-cell:hover { border-color: var(--z-border); }

.z-field .z-lines-table input.z-cell:focus-visible { border-color: var(--z-border-strong); background: var(--z-surface); }

.z-field .z-lines-table input.z-cell[aria-invalid="true"] { border-color: var(--z-danger); background: var(--z-danger-subtle); }

.z-field .z-lines-table input.z-cell.z-num { text-align: end; font-variant-numeric: tabular-nums; }

.z-cell-error { display: block; color: var(--z-danger); font-size: var(--z-font-size-xs); }

.z-cell-error:empty { display: none; }

.z-lines-total { font-variant-numeric: tabular-nums; padding-top: 9px !important; white-space: nowrap; }

.z-lines-table tfoot th,
.z-lines-table tfoot td {
  border-bottom: 0;
  background: var(--z-surface-2);
  font-weight: 600;
  text-align: end;
  font-variant-numeric: tabular-nums;
  padding-block: calc(var(--z-space) * 2);
}

.z-lines-actions { width: 1%; white-space: nowrap; }

.z-icon-button {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--z-radius-sm);
  background: none;
  color: var(--z-text-muted);
  cursor: pointer;
}

.z-icon-button:hover { background: var(--z-hover); color: var(--z-text); }

.z-icon-button.z-danger:hover { color: var(--z-danger); background: var(--z-danger-subtle); }

.z-icon-button:focus-visible { outline: 2px solid var(--z-focus); outline-offset: -2px; }

tr:first-child > .z-lines-actions [data-zeyn-line-move="-1"],
tr:last-child > .z-lines-actions [data-zeyn-line-move="1"] { visibility: hidden; }

.z-lines-empty { margin: 0; color: var(--z-text-muted); font-size: var(--z-font-size-sm); }

.z-lines > .z-button { justify-self: start; }

@media (pointer: coarse) {
  .z-icon-button { width: 44px; height: 44px; }
}

/* Display components ------------------------------------------------------------------------- */

.z-tone-neutral { --z-tone: var(--z-text-muted); --z-tone-bg: var(--z-surface-2); }
.z-tone-info { --z-tone: var(--z-info); --z-tone-bg: var(--z-info-subtle, color-mix(in oklab, var(--z-info) var(--z-tint), var(--z-surface))); }
.z-tone-success { --z-tone: var(--z-success); --z-tone-bg: var(--z-success-subtle); }
.z-tone-warning { --z-tone: var(--z-warning); --z-tone-bg: var(--z-warning-subtle); }
.z-tone-danger { --z-tone: var(--z-danger); --z-tone-bg: var(--z-danger-subtle); }

.z-callout {
  display: flex;
  align-items: flex-start;
  gap: calc(var(--z-space) * 2.5);
  padding: calc(var(--z-space) * 3);
  border: 1px solid color-mix(in oklab, var(--z-tone) 35%, var(--z-surface));
  border-inline-start: 4px solid var(--z-tone);
  border-radius: var(--z-radius);
  background: var(--z-tone-bg);
  color: var(--z-text);
}

.z-callout p { margin: 0; }

.z-callout-body { flex: 1; display: grid; gap: 2px; }

.z-callout-title { font-weight: 600; }

.z-callout-icon {
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  background: var(--z-tone);
  -webkit-mask: var(--z-i) center / contain no-repeat;
  mask: var(--z-i) center / contain no-repeat;
  --z-i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 11v6M12 7.5v.5'/%3E%3C/svg%3E");
}

.z-tone-success .z-callout-icon { --z-i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M8 12.5l2.5 2.5L16 9.5'/%3E%3C/svg%3E"); }
.z-tone-warning .z-callout-icon,
.z-tone-danger .z-callout-icon { --z-i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3l10 18H2zM12 10v5M12 18v.5'/%3E%3C/svg%3E"); }

.z-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 20px;
  padding: 0 calc(var(--z-space) * 2);
  border: 1px solid color-mix(in oklab, var(--z-tone) 40%, var(--z-surface));
  border-radius: 999px;
  background: var(--z-tone-bg);
  color: var(--z-tone);
  font-size: var(--z-font-size-xs);
  font-weight: 600;
  white-space: nowrap;
}

.z-tone-neutral.z-badge { color: var(--z-text); }

.z-empty {
  display: grid;
  justify-items: center;
  gap: calc(var(--z-space) * 2);
  padding: calc(var(--z-space) * 8) calc(var(--z-space) * 4);
  border: 1px dashed var(--z-border-strong);
  border-radius: var(--z-radius-lg);
  text-align: center;
}

.z-empty p { margin: 0; }

.z-empty-title { font-weight: 600; font-size: 1rem; }

.z-empty-text { color: var(--z-text-muted); max-width: 40ch; }

.z-empty-icon {
  width: 40px;
  height: 40px;
  background: var(--z-text-muted);
  -webkit-mask: var(--z-i) center / contain no-repeat;
  mask: var(--z-i) center / contain no-repeat;
  --z-i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linejoin='round'%3E%3Cpath d='M3 13l3-8h12l3 8v6H3zM3 13h5l1 2h6l1-2h5'/%3E%3C/svg%3E");
}

.z-skeleton { display: grid; gap: calc(var(--z-space) * 2.5); padding: calc(var(--z-space) * 1) 0; }

.z-skeleton-line {
  display: block;
  width: var(--z-skeleton-width, 100%);
  height: 12px;
  border-radius: var(--z-radius-sm);
  background: linear-gradient(90deg, var(--z-hover) 25%, var(--z-surface-2) 50%, var(--z-hover) 75%);
  background-size: 200% 100%;
  animation: z-shimmer 1.4s linear infinite;
}

@keyframes z-shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

.z-progress { display: grid; gap: 4px; }

.z-progress-head { display: flex; justify-content: space-between; font-size: var(--z-font-size-sm); }

.z-progress-value { color: var(--z-text-muted); font-variant-numeric: tabular-nums; }

.z-progress-track {
  height: 8px;
  border-radius: 999px;
  background: var(--z-surface-2);
  border: 1px solid var(--z-border);
  overflow: hidden;
}

.z-progress-bar { display: block; width: var(--z-progress, 0%); height: 100%; background: var(--z-tone); border-radius: inherit; }

.z-details {
  display: grid;
  grid-template-columns: repeat(var(--z-columns, 2), minmax(0, 1fr));
  gap: calc(var(--z-space) * 3) calc(var(--z-space) * 6);
  margin: 0;
}

.z-details-item { display: grid; gap: 2px; min-width: 0; }

.z-details dt { color: var(--z-text-muted); font-size: var(--z-font-size-xs); font-weight: 600; }

.z-details dd { margin: 0; overflow-wrap: anywhere; }

@media (max-width: 640px) {
  .z-details { grid-template-columns: 1fr; }
}

.z-muted { color: var(--z-text-muted); }

.z-breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: var(--z-font-size-sm);
}

.z-breadcrumb li + li::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-inline-end: 6px;
  border-right: 1.5px solid var(--z-text-muted);
  border-top: 1.5px solid var(--z-text-muted);
  transform: rotate(45deg);
}

.z-breadcrumb a { color: var(--z-accent); text-decoration: none; display: inline-flex; min-height: 24px; align-items: center; }

.z-breadcrumb a:hover { text-decoration: underline; }

.z-breadcrumb [aria-current="page"] { color: var(--z-text); font-weight: 600; }

.z-timeline { margin: 0; padding: 0; list-style: none; display: grid; }

.z-timeline li {
  position: relative;
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: calc(var(--z-space) * 2);
  padding-bottom: calc(var(--z-space) * 4);
}

.z-timeline li:not(:last-child)::before {
  content: "";
  position: absolute;
  top: 14px;
  bottom: 0;
  inset-inline-start: 9px;
  width: 2px;
  background: var(--z-border);
}

.z-timeline-dot {
  width: 12px;
  height: 12px;
  margin: 4px;
  border-radius: 50%;
  background: var(--z-surface);
  border: 3px solid var(--z-tone, var(--z-accent));
}

.z-timeline p { margin: 0; }

.z-timeline-title { font-weight: 600; }

.z-timeline-when { color: var(--z-text-muted); font-size: var(--z-font-size-xs); }

.z-timeline-detail { margin-top: 2px !important; }

.z-steps {
  display: flex;
  gap: calc(var(--z-space) * 2);
  margin: 0 0 calc(var(--z-space) * 4);
  padding: 0;
  list-style: none;
  counter-reset: none;
  overflow-x: auto;
}

.z-steps li {
  flex: 1 1 0;
  display: flex;
  align-items: center;
  gap: calc(var(--z-space) * 2);
  min-width: 8rem;
  padding-bottom: calc(var(--z-space) * 2);
  border-bottom: 3px solid var(--z-border);
  color: var(--z-text-muted);
  font-size: var(--z-font-size-sm);
}

.z-step-n {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid var(--z-border-strong);
  font-weight: 600;
  font-size: var(--z-font-size-xs);
}

.z-steps [aria-current="step"] { color: var(--z-text); font-weight: 600; border-bottom-color: var(--z-accent); }

.z-steps [aria-current="step"] .z-step-n { background: var(--z-primary); border-color: var(--z-primary); color: var(--z-on-primary); }

.z-steps .z-step-done { border-bottom-color: var(--z-success); }

.z-steps .z-step-done .z-step-n { border-color: var(--z-success); color: var(--z-success); }

.z-step { margin: 0; padding: 0; border: 0; min-width: 0; display: grid; gap: var(--z-gap); }

.z-step-legend { padding: 0; margin-bottom: calc(var(--z-space) * 2); font-weight: 600; font-size: 1rem; }

.z-step[hidden] { display: none; }

.z-form-actions > [hidden] { display: none !important; }

.z-action { display: inline-block; }

.z-button.z-danger-button {
  border-color: var(--z-danger);
  color: var(--z-danger);
  background: var(--z-surface);
}

.z-button.z-danger-button:hover:not(:disabled) { background: var(--z-danger-subtle); }

.z-confirm-actions .z-danger-button { background: var(--z-danger); color: var(--z-surface); }

.z-confirm-actions .z-danger-button:hover:not(:disabled) { background: color-mix(in oklab, var(--z-danger) 86%, #000); }

dialog.z-confirm {
  width: min(28rem, calc(100vw - 32px));
  padding: calc(var(--z-space) * 5);
  border: 1px solid var(--z-border);
  border-radius: var(--z-radius-lg);
  background: var(--z-surface);
  color: var(--z-text);
  box-shadow: var(--z-shadow-2);
}

dialog.z-confirm::backdrop { background: var(--z-backdrop); }

.z-confirm h2 { margin: 0 0 calc(var(--z-space) * 2); font-size: 1rem; }

.z-confirm p { margin: 0 0 calc(var(--z-space) * 5); color: var(--z-text); }

.z-confirm-actions { display: flex; justify-content: flex-end; gap: calc(var(--z-space) * 2); }

@media (prefers-reduced-motion: reduce) {
  .z-skeleton-line { animation: none; }
}

@media (forced-colors: active) {
  .z-callout,
  .z-badge { border-color: CanvasText; }
  .z-progress-bar { background: Highlight; }
  .z-steps [aria-current="step"] { border-bottom-color: Highlight; }
}

/* Tree --------------------------------------------------------------------------------------- */

.z-tree [role="tree"],
.z-tree-group { margin: 0; padding: 0; list-style: none; }

.z-tree-item { outline: none; }

.z-tree-row {
  display: flex;
  align-items: center;
  gap: calc(var(--z-space) * 1.5);
  min-height: 30px;
  padding-inline: calc(var(--z-space) * 2 + var(--z-level, 0) * 1.25rem) calc(var(--z-space) * 2);
  border-radius: var(--z-radius);
  cursor: pointer;
}

.z-tree-row:hover { background: var(--z-hover); }

.z-tree-item:focus-visible > .z-tree-row { outline: 2px solid var(--z-focus); outline-offset: -2px; }

.z-tree-item[aria-selected="true"] > .z-tree-row { background: var(--z-brand-subtle); color: var(--z-accent); font-weight: 600; }

.z-tree-toggle { flex: none; display: inline-grid; place-items: center; width: 16px; height: 16px; }

[aria-expanded] > .z-tree-row > .z-tree-toggle::before {
  content: "";
  width: 6px;
  height: 6px;
  border-right: 2px solid var(--z-text-muted);
  border-bottom: 2px solid var(--z-text-muted);
  transform: rotate(-45deg);
  transition: transform 0.15s;
}

[aria-expanded="true"] > .z-tree-row > .z-tree-toggle::before { transform: rotate(45deg); }

[aria-busy="true"] > .z-tree-row > .z-tree-toggle::before { border-color: var(--z-accent); }

.z-tree-hint { margin-inline-start: auto; color: var(--z-text-muted); font-size: var(--z-font-size-xs); }

[aria-expanded="false"] > .z-tree-group { display: none; }

.z-tree-note { padding: 4px calc(var(--z-space) * 3); color: var(--z-text-muted); font-size: var(--z-font-size-sm); }

@media (pointer: coarse) {
  .z-tree-row { min-height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  [aria-expanded] > .z-tree-row > .z-tree-toggle::before { transition: none; }
}

@media (forced-colors: active) {
  .z-tree-item[aria-selected="true"] > .z-tree-row { outline: 2px solid Highlight; }
}

/* Charts ------------------------------------------------------------------------------------- */

.z-chart { margin: 0; display: grid; gap: calc(var(--z-space) * 2); min-width: 0; }

.z-chart-title { font-weight: 600; }

.z-chart-svg { width: 100%; height: auto; max-height: 18rem; overflow: visible; }

.z-chart-grid { stroke: var(--z-border); stroke-width: 1; }

.z-chart-axis { fill: var(--z-text-muted); font-size: 13px; font-family: var(--z-font); }

.z-chart-total { fill: var(--z-text); font-size: 22px; font-weight: 600; font-family: var(--z-font); }

.z-series-0 { --z-series: var(--z-chart-1); }
.z-series-1 { --z-series: var(--z-chart-2); }
.z-series-2 { --z-series: var(--z-chart-3); }
.z-series-3 { --z-series: var(--z-chart-4); }
.z-series-4 { --z-series: var(--z-chart-5); }
.z-series-5 { --z-series: var(--z-chart-6); }

.z-chart-bar { fill: var(--z-series); }

.z-chart-bar:hover,
.z-chart-point:hover { opacity: 0.8; }

.z-chart-line { fill: none; stroke: var(--z-series); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }

.z-chart-point { fill: var(--z-surface); stroke: var(--z-series); stroke-width: 2.5; }

.z-chart-track { fill: none; stroke: var(--z-surface-2); stroke-width: 34; }

.z-chart-slice { fill: none; stroke: var(--z-series); stroke-width: 34; }

.z-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: calc(var(--z-space) * 1) calc(var(--z-space) * 4);
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: var(--z-font-size-sm);
}

.z-chart-legend li { display: inline-flex; align-items: center; gap: calc(var(--z-space) * 1.5); }

.z-chart-swatch { width: 12px; height: 12px; border-radius: 3px; background: var(--z-series); }

.z-chart-data summary {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  color: var(--z-accent);
  font-size: var(--z-font-size-sm);
  cursor: pointer;
}

.z-chart-data summary:focus-visible { outline: 2px solid var(--z-focus); outline-offset: 2px; border-radius: var(--z-radius-sm); }

.z-chart-table { margin-top: calc(var(--z-space) * 2); border-collapse: collapse; font-size: var(--z-font-size-sm); }

.z-chart-table th,
.z-chart-table td { padding: 4px calc(var(--z-space) * 3); border-bottom: 1px solid var(--z-border); text-align: start; }

.z-chart-table .z-num { text-align: end; font-variant-numeric: tabular-nums; }

@media (forced-colors: active) {
  .z-chart-bar,
  .z-chart-swatch { fill: CanvasText; background: CanvasText; forced-color-adjust: none; }
}
