/* ui.brvo.app — https://ui.brvo.app */
@layer ui.tokens, ui.base, ui.components;
@layer ui.tokens {
:where(:root) {
  color-scheme: light dark;

  /* Färg */
  --ui-bg: light-dark(#ffffff, #0d0e10);
  --ui-bg-2: light-dark(#f7f7f8, #141517);
  --ui-bg-3: light-dark(#efeff1, #1b1c1f);
  --ui-border: light-dark(#e3e4e7, #232428);
  --ui-border-strong: light-dark(#cfd0d4, #34353a);
  --ui-fg: light-dark(#1b1c1f, #e8e8ea);
  --ui-fg-2: light-dark(#5f6168, #9a9ca3);
  --ui-fg-3: light-dark(#8b8d94, #686a71);
  --ui-accent: light-dark(#5e6ad2, #7c86ec);
  --ui-accent-fg: #ffffff;
  --ui-danger: light-dark(#d93f3c, #f0605d);
  --ui-success: light-dark(#1f9d63, #43c487);
  --ui-warning: light-dark(#b7791f, #e2b340);
  --ui-info: light-dark(#2f7fd6, #5aa2ef);

  /* Typografi */
  --ui-font: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ui-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --ui-text: 13px;
  --ui-text-sm: 12px;
  --ui-text-lg: 15px;
  --ui-leading: 1.5;
  --ui-weight: 400;
  --ui-weight-strong: 550;

  /* Form */
  --ui-radius: 6px;
  --ui-radius-sm: 4px;
  --ui-radius-lg: 10px;
  --ui-line: 1px;
  --ui-h: 28px;
  --ui-h-sm: 24px;
  --ui-h-lg: 32px;
  --ui-pad: 10px;
  --ui-gap: 8px;
  --ui-space: 4px;

  /* Rörelse */
  --ui-ease: cubic-bezier(.2, .7, .3, 1);
  --ui-fast: 120ms;
  --ui-slow: 220ms;

  /* Djup */
  --ui-shadow: 0 1px 2px light-dark(rgb(0 0 0 / .06), rgb(0 0 0 / .4));
  --ui-shadow-lg: 0 8px 28px light-dark(rgb(0 0 0 / .12), rgb(0 0 0 / .5)), 0 0 0 var(--ui-line) var(--ui-border);
  --ui-focus: 0 0 0 2px var(--ui-bg), 0 0 0 4px color-mix(in srgb, var(--ui-accent) 70%, transparent);
}

:where([data-theme="light"]) { color-scheme: light; }
:where([data-theme="dark"]) { color-scheme: dark; }

:where([data-density="compact"]) {
  --ui-h: 24px; --ui-h-sm: 20px; --ui-h-lg: 28px; --ui-pad: 8px; --ui-gap: 6px; --ui-text: 12px;
}
:where([data-density="comfortable"]) {
  --ui-h: 34px; --ui-h-sm: 28px; --ui-h-lg: 40px; --ui-pad: 12px; --ui-gap: 10px; --ui-text: 14px;
}
}
@layer ui.base {
:where(.ui) {
  background: var(--ui-bg);
  color: var(--ui-fg);
  font: var(--ui-weight) var(--ui-text) / var(--ui-leading) var(--ui-font);
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  accent-color: var(--ui-accent);
}
:where(.ui) :where(*, *::before, *::after) { box-sizing: border-box; }
:where(.ui) :where(*) { margin: 0; }
:where(body.ui) { min-height: 100dvh; }

:where(.ui) :where(h1, h2, h3, h4) { font-weight: var(--ui-weight-strong); line-height: 1.25; letter-spacing: -0.011em; text-wrap: balance; }
:where(.ui) :where(h1) { font-size: 24px; letter-spacing: -0.02em; }
:where(.ui) :where(h2) { font-size: 18px; letter-spacing: -0.015em; }
:where(.ui) :where(h3) { font-size: 15px; }
:where(.ui) :where(h4) { font-size: var(--ui-text); }
:where(.ui) :where(p, li) { text-wrap: pretty; }
:where(.ui) :where(small) { font-size: var(--ui-text-sm); }
:where(.ui) :where(strong, b) { font-weight: var(--ui-weight-strong); }
:where(.ui) :where(a) { color: var(--ui-accent); text-decoration: none; }
:where(.ui) :where(a:hover) { text-decoration: underline; text-underline-offset: 2px; }
:where(.ui) :where(hr) { border: 0; border-top: var(--ui-line) solid var(--ui-border); }
:where(.ui) :where(ul, ol) { padding-left: 20px; }
:where(.ui) :where(img, svg, video, canvas) { display: block; max-width: 100%; }
:where(.ui) :where(::selection) { background: color-mix(in srgb, var(--ui-accent) 30%, transparent); }

:where(.ui) :where(code, kbd, samp, pre) { font-family: var(--ui-mono); font-size: 0.92em; }
:where(.ui) :where(:not(pre) > code) {
  padding: 1px 5px; border-radius: var(--ui-radius-sm);
  background: var(--ui-bg-3); border: var(--ui-line) solid var(--ui-border);
}
:where(.ui) :where(pre) {
  padding: 10px 12px; border-radius: var(--ui-radius); overflow: auto;
  background: var(--ui-bg-2); border: var(--ui-line) solid var(--ui-border); line-height: 1.55;
}
:where(.ui) :where(kbd) {
  display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 4px;
  font-size: 11px; line-height: 1; color: var(--ui-fg-2);
  border-radius: var(--ui-radius-sm); border: var(--ui-line) solid var(--ui-border-strong);
  border-bottom-width: 2px; background: var(--ui-bg-2);
}
:where(.ui) :where(mark) { background: color-mix(in srgb, var(--ui-warning) 30%, transparent); color: inherit; border-radius: 2px; padding: 0 2px; }

:where(.ui) :where(:focus-visible) { outline: none; box-shadow: var(--ui-focus); }
:where(.ui) :where([hidden]) { display: none; }

/* text helpers */
:where(.ui) :where(.muted) { color: var(--ui-fg-2); }
:where(.ui) :where(.subtle) { color: var(--ui-fg-3); }

@media (prefers-reduced-motion: reduce) {
  :where(.ui) :where(*, *::before, *::after) { transition-duration: 0s; animation-duration: 0s; animation-iteration-count: 1; }
}

/* a part of the page in another theme gets its own surface */
:where(.ui [data-theme], .ui[data-theme]) { background: var(--ui-bg); color: var(--ui-fg); }
}
/* layout */
@layer ui.components {
:where(.ui) :where(.stack) { display: flex; flex-direction: column; gap: var(--gap, var(--ui-gap)); }
:where(.ui) :where(.row) { display: flex; flex-wrap: wrap; align-items: center; gap: var(--gap, var(--ui-gap)); }
:where(.ui) :where(.row[data-nowrap]) { flex-wrap: nowrap; }
:where(.ui) :where(.row[data-justify="between"]) { justify-content: space-between; }
:where(.ui) :where(.row[data-justify="end"]) { justify-content: flex-end; }
:where(.ui) :where(.row[data-align="start"]) { align-items: flex-start; }
:where(.ui) :where(.spacer) { flex: 1; }
:where(.ui) :where(.grid) { display: grid; gap: var(--gap, calc(var(--ui-gap) * 2)); grid-template-columns: repeat(auto-fill, minmax(min(var(--min, 220px), 100%), 1fr)); }
:where(.ui) :where(.container) { width: 100%; max-width: var(--max, 1120px); margin-inline: auto; padding-inline: 16px; }
:where(.ui) :where(.split) { display: grid; grid-template-columns: var(--side, 240px) minmax(0, 1fr); gap: var(--gap, 0); min-height: 0; }
@media (max-width: 720px) { :where(.ui) :where(.split) { grid-template-columns: 1fr; } }
:where(.ui) :where(.divider) { display: flex; align-items: center; gap: 10px; color: var(--ui-fg-3); font-size: var(--ui-text-sm); }
:where(.ui) :where(.divider)::before, :where(.ui) :where(.divider)::after { content: ""; flex: 1; border-top: var(--ui-line) solid var(--ui-border); }
:where(.ui) :where(.divider:empty) { gap: 0; }
:where(.ui) :where(.divider:empty)::after { display: none; }
}
/* button */
@layer ui.components {
:where(.ui) :where(button, input[type="button"], input[type="submit"], input[type="reset"], a[data-button]) {
  --_bg: var(--ui-bg-2);
  --_fg: var(--ui-fg);
  --_bd: var(--ui-border-strong);
  --_hover: var(--ui-bg-3);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: var(--ui-h); padding: 0 var(--ui-pad);
  font: inherit; font-weight: 500; line-height: 1; white-space: nowrap; color: var(--_fg);
  background: var(--_bg); border: var(--ui-line) solid var(--_bd); border-radius: var(--ui-radius);
  box-shadow: var(--ui-shadow);
  cursor: pointer; user-select: none; text-decoration: none;
  transition: background var(--ui-fast) var(--ui-ease), border-color var(--ui-fast) var(--ui-ease), color var(--ui-fast) var(--ui-ease);
}
:where(.ui) :where(button, input[type="button"], input[type="submit"], input[type="reset"], a[data-button]):hover { background: var(--_hover); text-decoration: none; }
:where(.ui) :where(button, input[type="submit"], a[data-button]):active { translate: 0 0.5px; }
:where(.ui) :where(button, input[type="button"], input[type="submit"], input[type="reset"]):disabled,
:where(.ui) :where(a[data-button][aria-disabled="true"]) { opacity: .5; cursor: default; pointer-events: none; }
:where(.ui) :where(button, a[data-button]) :where(svg) { width: 14px; height: 14px; flex: none; }

:where(.ui) :where([data-variant="primary"], input[type="submit"]) {
  --_bg: var(--ui-accent); --_fg: var(--ui-accent-fg); --_bd: color-mix(in srgb, var(--ui-accent) 80%, black);
  --_hover: color-mix(in srgb, var(--ui-accent) 88%, white);
}
:where(.ui) :where(button, a[data-button])[data-variant="ghost"] {
  --_bg: transparent; --_bd: transparent; --_fg: var(--ui-fg-2); --_hover: var(--ui-bg-3); box-shadow: none;
}
:where(.ui) :where(button, a[data-button])[data-variant="ghost"]:hover { color: var(--ui-fg); }
:where(.ui) :where(button, a[data-button])[data-variant="danger"] {
  --_bg: var(--ui-danger); --_fg: #fff; --_bd: color-mix(in srgb, var(--ui-danger) 80%, black);
  --_hover: color-mix(in srgb, var(--ui-danger) 88%, white);
}
:where(.ui) :where(button, a[data-button])[data-variant="outline"] { --_bg: transparent; box-shadow: none; }

:where(.ui) :where(button, a[data-button], input[type="submit"])[data-size="sm"] { height: var(--ui-h-sm); padding: 0 calc(var(--ui-pad) - 3px); font-size: var(--ui-text-sm); border-radius: var(--ui-radius-sm); }
:where(.ui) :where(button, a[data-button], input[type="submit"])[data-size="lg"] { height: var(--ui-h-lg); padding: 0 calc(var(--ui-pad) + 4px); }
:where(.ui) :where(button, a[data-button])[data-icon] { width: var(--ui-h); padding: 0; }
:where(.ui) :where(button, a[data-button])[data-icon][data-size="sm"] { width: var(--ui-h-sm); }
:where(.ui) :where(button, a[data-button])[data-icon][data-size="lg"] { width: var(--ui-h-lg); }
:where(.ui) :where(button[aria-busy="true"]) { color: transparent; position: relative; pointer-events: none; }
:where(.ui) :where(button[aria-busy="true"])::after {
  content: ""; position: absolute; width: 12px; height: 12px; border-radius: 50%;
  border: 1.5px solid var(--_fg); border-right-color: transparent; animation: ui-spin .6s linear infinite;
}

:where(.ui) :where([role="group"].buttons, .buttons) { display: inline-flex; }
:where(.ui) :where(.buttons) > :where(*) { border-radius: 0; margin-left: calc(var(--ui-line) * -1); }
:where(.ui) :where(.buttons) > :where(:first-child) { border-radius: var(--ui-radius) 0 0 var(--ui-radius); margin-left: 0; }
:where(.ui) :where(.buttons) > :where(:last-child) { border-radius: 0 var(--ui-radius) var(--ui-radius) 0; }
:where(.ui) :where(.buttons) > :where(:hover, :focus-visible) { position: relative; z-index: 1; }
:where(.ui) :where(.buttons) > :where([aria-pressed="false"]) { color: var(--ui-fg-2); }
:where(.ui) :where(.buttons) > :where([aria-pressed="true"]) { background: var(--ui-bg-3); color: var(--ui-fg); box-shadow: inset 0 1px 2px light-dark(rgb(0 0 0 / .08), rgb(0 0 0 / .45)); }

@keyframes ui-spin { to { rotate: 1turn; } }
}
/* input */
@layer ui.components {
:where(.ui) :where(input:not([type="checkbox"], [type="radio"], [type="range"], [type="button"], [type="submit"], [type="reset"], [type="color"], [type="file"]), select, textarea) {
  width: 100%; height: var(--ui-h); padding: 0 calc(var(--ui-pad) - 2px);
  font: inherit; color: var(--ui-fg);
  background: var(--ui-bg); border: var(--ui-line) solid var(--ui-border-strong); border-radius: var(--ui-radius);
  transition: border-color var(--ui-fast) var(--ui-ease), box-shadow var(--ui-fast) var(--ui-ease);
}
:where(.ui) :where(textarea) { height: auto; min-height: calc(var(--ui-h) * 3); padding: 6px calc(var(--ui-pad) - 2px); resize: vertical; line-height: var(--ui-leading); field-sizing: content; }
:where(.ui) :where(input, select, textarea)::placeholder { color: var(--ui-fg-3); }
:where(.ui) :where(input, select, textarea):hover:not(:disabled, :focus) { border-color: color-mix(in srgb, var(--ui-border-strong) 60%, var(--ui-fg-3)); }
:where(.ui) :where(input, select, textarea):focus { outline: none; border-color: var(--ui-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ui-accent) 22%, transparent); }
:where(.ui) :where(input, select, textarea):disabled { opacity: .55; cursor: not-allowed; background: var(--ui-bg-2); }
:where(.ui) :where(input, select, textarea):user-invalid,
:where(.ui) :where(input, select, textarea)[aria-invalid="true"] { border-color: var(--ui-danger); }
:where(.ui) :where(input, select, textarea):user-invalid:focus,
:where(.ui) :where(input, select, textarea)[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--ui-danger) 22%, transparent); }
:where(.ui) :where(input, select)[data-size="sm"] { height: var(--ui-h-sm); font-size: var(--ui-text-sm); }
:where(.ui) :where(input, select)[data-size="lg"] { height: var(--ui-h-lg); }

:where(.ui) :where(select) {
  appearance: none; padding-right: 26px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--ui-fg-3) 50%), linear-gradient(135deg, var(--ui-fg-3) 50%, transparent 50%);
  background-position: calc(100% - 13px) 50%, calc(100% - 9px) 50%;
  background-size: 4px 4px; background-repeat: no-repeat;
}
:where(.ui) :where(select[multiple]) { height: auto; padding: 4px; background-image: none; }
:where(.ui) :where(input[type="search"])::-webkit-search-cancel-button { filter: grayscale(1); opacity: .5; }
:where(.ui) :where(input[type="file"]) { font: inherit; color: var(--ui-fg-2); }
:where(.ui) :where(input[type="file"])::file-selector-button {
  height: var(--ui-h); padding: 0 var(--ui-pad); margin-right: 8px; font: inherit; font-weight: 500; color: var(--ui-fg);
  background: var(--ui-bg-2); border: var(--ui-line) solid var(--ui-border-strong); border-radius: var(--ui-radius); cursor: pointer;
}
:where(.ui) :where(input[type="color"]) { width: var(--ui-h); height: var(--ui-h); padding: 2px; border: var(--ui-line) solid var(--ui-border-strong); border-radius: var(--ui-radius); background: var(--ui-bg); cursor: pointer; }

/* an input with something attached: <div class="input-group"><span>https://</span><input></div> */
:where(.ui) :where(.input-group) { display: flex; }
:where(.ui) :where(.input-group) > :where(*) { border-radius: 0; }
:where(.ui) :where(.input-group) > :where(* + *) { margin-left: calc(var(--ui-line) * -1); }
:where(.ui) :where(.input-group) > :where(:first-child) { border-radius: var(--ui-radius) 0 0 var(--ui-radius); }
:where(.ui) :where(.input-group) > :where(:last-child) { border-radius: 0 var(--ui-radius) var(--ui-radius) 0; }
:where(.ui) :where(.input-group) > :where(span) {
  display: inline-flex; align-items: center; padding: 0 8px; color: var(--ui-fg-2); white-space: nowrap;
  background: var(--ui-bg-2); border: var(--ui-line) solid var(--ui-border-strong);
}
:where(.ui) :where(.input-group) > :where(input, select):focus { position: relative; z-index: 1; }
}
/* checkbox */
@layer ui.components {
:where(.ui) :where(input[type="checkbox"]:not([role="switch"]), input[type="radio"]) {
  appearance: none; flex: none; display: inline-grid; place-content: center;
  width: 14px; height: 14px; margin: 0; vertical-align: -2px;
  background: var(--ui-bg); border: var(--ui-line) solid var(--ui-border-strong); border-radius: var(--ui-radius-sm);
  cursor: pointer; transition: background var(--ui-fast) var(--ui-ease), border-color var(--ui-fast) var(--ui-ease);
}
:where(.ui) :where(input[type="radio"]) { border-radius: 50%; }
:where(.ui) :where(input[type="checkbox"]:not([role="switch"]), input[type="radio"]):hover:not(:disabled) { border-color: var(--ui-fg-3); }
:where(.ui) :where(input[type="checkbox"]:not([role="switch"]), input[type="radio"]):checked,
:where(.ui) :where(input[type="checkbox"]:not([role="switch"])):indeterminate { background: var(--ui-accent); border-color: var(--ui-accent); }
:where(.ui) :where(input[type="checkbox"]:not([role="switch"]))::before {
  content: ""; width: 8px; height: 8px; background: var(--ui-accent-fg); scale: 0;
  clip-path: polygon(14% 44%, 0 59%, 39% 98%, 100% 21%, 86% 7%, 38% 70%);
  transition: scale var(--ui-fast) var(--ui-ease);
}
:where(.ui) :where(input[type="checkbox"]:not([role="switch"])):checked::before { scale: 1; }
:where(.ui) :where(input[type="checkbox"]:not([role="switch"])):indeterminate::before { scale: 1; clip-path: inset(40% 10%); }
:where(.ui) :where(input[type="radio"])::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--ui-accent-fg); scale: 0; transition: scale var(--ui-fast) var(--ui-ease); }
:where(.ui) :where(input[type="radio"]):checked::before { scale: 1; }
:where(.ui) :where(input[type="checkbox"], input[type="radio"]):disabled { opacity: .5; cursor: not-allowed; }
:where(.ui) :where(input[type="checkbox"], input[type="radio"]):user-invalid { border-color: var(--ui-danger); }

/* <label class="check"><input type="checkbox"> Text</label> */
:where(.ui) :where(label.check) { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
:where(.ui) :where(label.check:has(:disabled)) { color: var(--ui-fg-3); cursor: not-allowed; }
}
/* switch */
@layer ui.components {
:where(.ui) :where(input[type="checkbox"][role="switch"]) {
  appearance: none; flex: none; position: relative; margin: 0; vertical-align: -3px;
  width: 26px; height: 16px; border-radius: 999px; cursor: pointer;
  background: var(--ui-border-strong); border: 0;
  transition: background var(--ui-fast) var(--ui-ease);
}
:where(.ui) :where(input[type="checkbox"][role="switch"])::before {
  content: ""; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgb(0 0 0 / .3);
  transition: translate var(--ui-slow) var(--ui-ease);
}
:where(.ui) :where(input[type="checkbox"][role="switch"]):checked { background: var(--ui-accent); }
:where(.ui) :where(input[type="checkbox"][role="switch"]):checked::before { translate: 10px 0; }
:where(.ui) :where(input[type="checkbox"][role="switch"]):disabled { opacity: .5; cursor: not-allowed; }
:where(.ui) :where(input[type="checkbox"][role="switch"])[data-size="sm"] { width: 22px; height: 12px; }
:where(.ui) :where(input[type="checkbox"][role="switch"])[data-size="sm"]::before { width: 8px; height: 8px; }
}
/* range */
@layer ui.components {
:where(.ui) :where(input[type="range"]) {
  --_pct: 50%;
  appearance: none; width: 100%; height: 16px; margin: 0; background: transparent; cursor: pointer;
}
:where(.ui) :where(input[type="range"])::-webkit-slider-runnable-track {
  height: 4px; border-radius: 999px;
  background: linear-gradient(to right, var(--ui-accent) var(--_pct), var(--ui-border-strong) var(--_pct));
}
:where(.ui) :where(input[type="range"])::-moz-range-track { height: 4px; border-radius: 999px; background: var(--ui-border-strong); }
:where(.ui) :where(input[type="range"])::-moz-range-progress { height: 4px; border-radius: 999px; background: var(--ui-accent); }
:where(.ui) :where(input[type="range"])::-webkit-slider-thumb {
  appearance: none; width: 14px; height: 14px; margin-top: -5px; border-radius: 50%;
  background: #fff; border: var(--ui-line) solid var(--ui-border-strong); box-shadow: var(--ui-shadow);
}
:where(.ui) :where(input[type="range"])::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%; background: #fff; border: var(--ui-line) solid var(--ui-border-strong);
}
:where(.ui) :where(input[type="range"]):focus-visible { box-shadow: none; }
:where(.ui) :where(input[type="range"]):focus-visible::-webkit-slider-thumb { box-shadow: var(--ui-focus); }
:where(.ui) :where(input[type="range"]):disabled { opacity: .5; cursor: not-allowed; }
}
/* field */
@layer ui.components {
:where(.ui) :where(.field) { display: grid; gap: 6px; }
:where(.ui) :where(.field) > :where(label, .label) { font-weight: 500; color: var(--ui-fg); }
:where(.ui) :where(.field) > :where(small, .help) { color: var(--ui-fg-2); font-size: var(--ui-text-sm); }
:where(.ui) :where(.field) > :where(.error) { display: none; color: var(--ui-danger); font-size: var(--ui-text-sm); }
:where(.ui) :where(.field:has(:user-invalid, [aria-invalid="true"])) > :where(.error) { display: block; }
:where(.ui) :where(.field:has(:user-invalid, [aria-invalid="true"])) > :where(small, .help) { display: none; }
:where(.ui) :where(.field:has([required])) > :where(label)::after { content: " *"; color: var(--ui-fg-3); }
:where(.ui) :where(form.form) { display: grid; gap: 16px; }
:where(.ui) :where(fieldset) { border: var(--ui-line) solid var(--ui-border); border-radius: var(--ui-radius); padding: 12px; }
:where(.ui) :where(legend) { padding: 0 4px; color: var(--ui-fg-2); font-weight: 500; }
}
/* table */
@layer ui.components {
:where(.ui) :where(table) { width: 100%; border-collapse: separate; border-spacing: 0; font-variant-numeric: tabular-nums; }
:where(.ui) :where(th, td) { height: 32px; padding: 0 10px; text-align: left; vertical-align: middle; border-bottom: var(--ui-line) solid var(--ui-border); }
:where(.ui) :where(thead th) {
  height: 28px; font-size: var(--ui-text-sm); font-weight: 500; color: var(--ui-fg-2);
  background: var(--ui-bg); position: sticky; top: 0; z-index: 1;
}
:where(.ui) :where(tbody tr):hover { background: var(--ui-bg-2); }
:where(.ui) :where(td[data-num], th[data-num]) { text-align: right; }
:where(.ui) :where(caption) { caption-side: bottom; padding-top: 8px; color: var(--ui-fg-3); font-size: var(--ui-text-sm); text-align: left; }
:where(.ui) :where(table[data-striped] tbody tr:nth-child(even)) { background: color-mix(in srgb, var(--ui-bg-2) 60%, transparent); }
:where(.ui) :where(table[data-density="compact"]) :where(th, td) { height: 26px; padding: 0 8px; }
:where(.ui) :where(.table-wrap) { overflow: auto; border: var(--ui-line) solid var(--ui-border); border-radius: var(--ui-radius-lg); }
:where(.ui) :where(.table-wrap) :where(tbody tr:last-child td) { border-bottom: 0; }
}
/* card */
@layer ui.components {
:where(.ui) :where(.card) {
  display: flex; flex-direction: column; gap: var(--ui-gap);
  padding: 12px 14px; background: var(--ui-bg-2);
  border: var(--ui-line) solid var(--ui-border); border-radius: var(--ui-radius-lg);
}
:where(.ui) :where(.card) > :where(header) { display: flex; align-items: center; gap: 8px; font-weight: var(--ui-weight-strong); }
:where(.ui) :where(.card) > :where(header) :where(small) { font-weight: var(--ui-weight); color: var(--ui-fg-2); }
:where(.ui) :where(.card) > :where(footer) { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 4px; padding-top: 10px; border-top: var(--ui-line) solid var(--ui-border); }
:where(.ui) :where(.card[data-variant="flat"]) { background: transparent; }
:where(.ui) :where(a.card, .card[data-interactive]) { color: inherit; text-decoration: none; transition: border-color var(--ui-fast) var(--ui-ease), background var(--ui-fast) var(--ui-ease); }
:where(.ui) :where(a.card, .card[data-interactive]):hover { border-color: var(--ui-border-strong); background: var(--ui-bg-3); text-decoration: none; }
}
/* badge */
@layer ui.components {
:where(.ui) :where(.badge) {
  --_c: var(--ui-fg-2);
  display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 7px;
  font-size: var(--ui-text-sm); font-weight: 500; line-height: 1; white-space: nowrap; color: var(--ui-fg-2);
  background: var(--ui-bg-2); border: var(--ui-line) solid var(--ui-border); border-radius: var(--ui-radius-sm);
}
:where(.ui) :where(.badge[data-tone]) { color: var(--_c); background: color-mix(in srgb, var(--_c) 12%, transparent); border-color: color-mix(in srgb, var(--_c) 28%, transparent); }
:where(.ui) :where(.badge[data-tone="accent"]) { --_c: var(--ui-accent); }
:where(.ui) :where(.badge[data-tone="success"]) { --_c: var(--ui-success); }
:where(.ui) :where(.badge[data-tone="warning"]) { --_c: var(--ui-warning); }
:where(.ui) :where(.badge[data-tone="danger"]) { --_c: var(--ui-danger); }
:where(.ui) :where(.badge[data-tone="info"]) { --_c: var(--ui-info); }
:where(.ui) :where(.badge[data-dot])::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--_c); }
:where(.ui) :where(.badge[data-pill]) { border-radius: 999px; }
}
/* alert */
@layer ui.components {
:where(.ui) :where(.alert, [role="alert"], [role="status"].alert) {
  --_c: var(--ui-fg-2);
  display: grid; grid-template-columns: auto 1fr auto; align-items: start; gap: 4px 10px;
  padding: 10px 12px; border-radius: var(--ui-radius);
  background: color-mix(in srgb, var(--_c) 8%, var(--ui-bg));
  border: var(--ui-line) solid color-mix(in srgb, var(--_c) 30%, var(--ui-border));
}
:where(.ui) :where(.alert, [role="alert"])::before { content: ""; width: 8px; height: 8px; margin-top: 6px; border-radius: 50%; background: var(--_c); }
:where(.ui) :where(.alert, [role="alert"]) > :where(*) { grid-column: 2; }
:where(.ui) :where(.alert, [role="alert"]) > :where(strong) { color: var(--ui-fg); }
:where(.ui) :where(.alert, [role="alert"]) > :where(p) { color: var(--ui-fg-2); }
:where(.ui) :where(.alert, [role="alert"]) > :where(button:last-child:not(:first-child)) { grid-column: 3; grid-row: 1; }
:where(.ui) :where(.alert[data-tone="info"]) { --_c: var(--ui-info); }
:where(.ui) :where(.alert[data-tone="success"]) { --_c: var(--ui-success); }
:where(.ui) :where(.alert[data-tone="warning"]) { --_c: var(--ui-warning); }
:where(.ui) :where(.alert[data-tone="danger"], [role="alert"]:not([data-tone])) { --_c: var(--ui-danger); }
}
/* progress */
@layer ui.components {
:where(.ui) :where(progress, meter) {
  appearance: none; display: block; width: 100%; height: 6px; border: 0; border-radius: 999px; overflow: hidden;
  background: var(--ui-bg-3);
}
:where(.ui) :where(progress)::-webkit-progress-bar { background: var(--ui-bg-3); border-radius: 999px; }
:where(.ui) :where(progress)::-webkit-progress-value { background: var(--ui-accent); border-radius: 999px; transition: inline-size var(--ui-slow) var(--ui-ease); }
:where(.ui) :where(progress)::-moz-progress-bar { background: var(--ui-accent); border-radius: 999px; }
:where(.ui) :where(progress:not([value])) {
  background: linear-gradient(90deg, transparent, var(--ui-accent), transparent) var(--ui-bg-3);
  background-size: 40% 100%; background-repeat: no-repeat; animation: ui-indeterminate 1.1s var(--ui-ease) infinite;
}
:where(.ui) :where(progress:not([value]))::-webkit-progress-bar { background: transparent; }
:where(.ui) :where(progress:not([value]))::-moz-progress-bar { background: transparent; }
:where(.ui) :where(meter)::-webkit-meter-bar { background: var(--ui-bg-3); border: 0; border-radius: 999px; height: 6px; }
:where(.ui) :where(meter)::-webkit-meter-optimum-value { background: var(--ui-success); border-radius: 999px; }
:where(.ui) :where(meter)::-webkit-meter-suboptimum-value { background: var(--ui-warning); border-radius: 999px; }
:where(.ui) :where(meter)::-webkit-meter-even-less-good-value { background: var(--ui-danger); border-radius: 999px; }
:where(.ui) :where(meter):-moz-meter-optimum::-moz-meter-bar { background: var(--ui-success); }
:where(.ui) :where(meter):-moz-meter-sub-optimum::-moz-meter-bar { background: var(--ui-warning); }
:where(.ui) :where(meter):-moz-meter-sub-sub-optimum::-moz-meter-bar { background: var(--ui-danger); }
@keyframes ui-indeterminate { from { background-position: -60% 0; } to { background-position: 160% 0; } }
}
/* spinner */
@layer ui.components {
:where(.ui) :where(.spinner) {
  display: inline-block; width: 14px; height: 14px; flex: none; border-radius: 50%; vertical-align: -2px;
  border: 1.5px solid color-mix(in srgb, currentColor 25%, transparent); border-top-color: currentColor;
  animation: ui-spin .7s linear infinite; color: var(--ui-fg-2);
}
:where(.ui) :where(.spinner[data-size="sm"]) { width: 10px; height: 10px; }
:where(.ui) :where(.spinner[data-size="lg"]) { width: 22px; height: 22px; border-width: 2px; }
@keyframes ui-spin { to { rotate: 1turn; } }
}
/* skeleton */
@layer ui.components {
:where(.ui) :where(.skeleton) {
  display: block; height: 12px; border-radius: var(--ui-radius-sm);
  background: linear-gradient(90deg, var(--ui-bg-3) 0%, color-mix(in srgb, var(--ui-bg-3) 50%, var(--ui-border-strong)) 50%, var(--ui-bg-3) 100%);
  background-size: 200% 100%; animation: ui-shimmer 1.4s ease-in-out infinite;
}
:where(.ui) :where(.skeleton[data-shape="circle"]) { width: 28px; height: 28px; border-radius: 50%; }
:where(.ui) :where(.skeleton[data-shape="block"]) { height: 72px; border-radius: var(--ui-radius); }
@keyframes ui-shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
}
/* tabs */
@layer ui.components {
:where(.ui) :where(.tabs) { display: grid; gap: 12px; }
:where(.ui) :where(.tabs) > :where([role="tablist"], .tablist) { display: flex; gap: 2px; border-bottom: var(--ui-line) solid var(--ui-border); }
:where(.ui) :where(.tabs) :where([role="tablist"], .tablist) > :where(label, a, button) {
  position: relative; display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; margin-bottom: -1px;
  color: var(--ui-fg-2); font-weight: 500; cursor: pointer; user-select: none; text-decoration: none;
  background: none; border: 0; border-radius: 0; box-shadow: none;
  border-bottom: 2px solid transparent; transition: color var(--ui-fast) var(--ui-ease), border-color var(--ui-fast) var(--ui-ease);
}
:where(.ui) :where(.tabs) :where([role="tablist"], .tablist) > :where(label, a, button):hover { color: var(--ui-fg); background: none; text-decoration: none; }
:where(.ui) :where(.tabs) :where([role="tablist"], .tablist) > :where(label:has(:checked), [aria-selected="true"], [aria-current="page"]) { color: var(--ui-fg); border-bottom-color: var(--ui-fg); }
:where(.ui) :where(.tabs) :where([role="tablist"], .tablist) > :where(label:has(:focus-visible)) { box-shadow: var(--ui-focus); border-radius: var(--ui-radius-sm); }
:where(.ui) :where(.tabs) :where([role="tablist"], .tablist) :where(input[type="radio"]) { position: absolute; opacity: 0; pointer-events: none; }
:where(.ui) :where(.tabs) > :where(section, [role="tabpanel"]) { display: none; }
:where(.ui) :where(.tabs:has(> .tablist > label:nth-of-type(1) :checked)) > :where(section, [role="tabpanel"]):nth-of-type(1),
:where(.ui) :where(.tabs:has(> .tablist > label:nth-of-type(2) :checked)) > :where(section, [role="tabpanel"]):nth-of-type(2),
:where(.ui) :where(.tabs:has(> .tablist > label:nth-of-type(3) :checked)) > :where(section, [role="tabpanel"]):nth-of-type(3),
:where(.ui) :where(.tabs:has(> .tablist > label:nth-of-type(4) :checked)) > :where(section, [role="tabpanel"]):nth-of-type(4),
:where(.ui) :where(.tabs:has(> .tablist > label:nth-of-type(5) :checked)) > :where(section, [role="tabpanel"]):nth-of-type(5),
:where(.ui) :where(.tabs:has(> .tablist > label:nth-of-type(6) :checked)) > :where(section, [role="tabpanel"]):nth-of-type(6) { display: block; }
/* segmented look */
:where(.ui) :where(.tabs[data-variant="segmented"]) > :where(.tablist, [role="tablist"]) { display: inline-flex; width: fit-content; padding: 2px; border: 0; border-radius: var(--ui-radius); background: var(--ui-bg-3); }
:where(.ui) :where(.tabs[data-variant="segmented"]) :where(.tablist, [role="tablist"]) > :where(label, a, button) { height: calc(var(--ui-h) - 4px); margin: 0; border: 0; border-radius: calc(var(--ui-radius) - 2px); }
:where(.ui) :where(.tabs[data-variant="segmented"]) :where(.tablist, [role="tablist"]) > :where(label:has(:checked), [aria-selected="true"], [aria-current="page"]) { background: var(--ui-bg); box-shadow: var(--ui-shadow); }
}
