/* PUI preview styles. Values come from tokens.css. */
body { background: var(--background); color: var(--foreground); font-family: var(--font-sans); font-size: 14px; line-height: 20px; margin: 0; -webkit-font-smoothing: antialiased; }
.pui-stage { padding: 16px; display: flex; flex-direction: column; gap: 16px; }
.pui-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.pui-field { display: grid; gap: 8px; max-width: 320px; }
.pui-inline { display: flex; align-items: center; gap: 8px; }
.pui-muted { color: var(--muted-foreground); }
:where(.pui-btn, .pui-input, .pui-checkbox, .pui-switch, .pui-tabs__trigger, .pui-select select):focus-visible {
  outline: 2px solid var(--ring); outline-offset: 2px; }

.pui-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap; border: 1px solid transparent;
  border-radius: var(--radius-md); font: 500 14px/20px var(--font-sans); height: 36px; padding: 0 16px; cursor: pointer; transition: background-color .15s, color .15s; }
.pui-btn svg { width: 16px; height: 16px; fill: currentColor; }
.pui-btn:disabled { opacity: .5; pointer-events: none; }
.pui-btn:active { transform: translateY(1px); }
.pui-btn--default { background: var(--primary); color: var(--primary-foreground); box-shadow: var(--shadow-xs); }
.pui-btn--default:hover { background: color-mix(in oklab, var(--primary) 90%, var(--background)); }
.pui-btn--secondary { background: var(--secondary); color: var(--secondary-foreground); box-shadow: var(--shadow-xs); }
.pui-btn--secondary:hover { background: color-mix(in oklab, var(--secondary) 80%, var(--foreground) 6%); }
.pui-btn--outline { background: var(--background); color: var(--foreground); border-color: var(--input); box-shadow: var(--shadow-xs); }
.pui-btn--outline:hover, .pui-btn--ghost:hover { background: var(--accent); color: var(--accent-foreground); }
.pui-btn--ghost { background: transparent; color: var(--foreground); }
.pui-btn--destructive { background: var(--destructive); color: var(--destructive-foreground); box-shadow: var(--shadow-xs); }
.pui-btn--destructive:hover { background: color-mix(in oklab, var(--destructive) 90%, var(--background)); }
.pui-btn--link { background: transparent; color: var(--primary); text-decoration: underline; text-underline-offset: 4px; height: auto; padding: 0; }
.pui-btn--size-sm { height: 32px; padding: 0 12px; gap: 6px; }
.pui-btn--size-lg { height: 40px; padding: 0 24px; }
.pui-btn--size-icon { width: 36px; padding: 0; }

.pui-badge { display: inline-flex; align-items: center; gap: 4px; border: 1px solid transparent; border-radius: var(--radius-sm);
  padding: 2px 8px; font: 500 12px/16px var(--font-sans); white-space: nowrap; }
.pui-badge--default { background: var(--primary); color: var(--primary-foreground); }
.pui-badge--secondary { background: var(--secondary); color: var(--secondary-foreground); }
.pui-badge--outline { color: var(--foreground); border-color: var(--border); }
.pui-badge--destructive { background: var(--destructive); color: var(--destructive-foreground); }
.pui-badge--success { background: var(--success); color: var(--success-foreground); }
.pui-badge--warning { background: var(--warning); color: var(--warning-foreground); }

.pui-input { box-sizing: border-box; width: 100%; height: 36px; border: 1px solid var(--input); border-radius: var(--radius-md); background: transparent;
  color: var(--foreground); font: 400 14px/20px var(--font-sans); padding: 4px 12px; box-shadow: var(--shadow-xs); }
.pui-input::placeholder { color: var(--muted-foreground); }
.pui-input[aria-invalid="true"] { border-color: var(--destructive); }
.pui-input:disabled { opacity: .5; cursor: not-allowed; }
.pui-textarea { height: auto; min-height: 64px; padding: 8px 12px; resize: vertical; }
.pui-label { font: 500 14px/14px var(--font-sans); color: var(--foreground); }
.pui-select { position: relative; width: 100%; }
.pui-select select { appearance: none; box-sizing: border-box; width: 100%; height: 36px; border: 1px solid var(--input); border-radius: var(--radius-md);
  background: var(--background); color: var(--foreground); font: 400 14px/20px var(--font-sans); padding: 0 36px 0 12px; box-shadow: var(--shadow-xs); }
.pui-select svg { position: absolute; right: 12px; top: 10px; width: 16px; height: 16px; fill: var(--muted-foreground); pointer-events: none; }

.pui-checkbox { box-sizing: border-box; width: 16px; height: 16px; padding: 0; display: inline-grid; place-items: center; border: 1px solid var(--input);
  border-radius: var(--radius-sm); background: var(--background); color: var(--primary-foreground); cursor: pointer; box-shadow: var(--shadow-xs); }
.pui-checkbox:hover, .pui-select select:hover { border-color: var(--primary); }
.pui-checkbox[data-state="checked"], .pui-checkbox[data-state="indeterminate"] { background: var(--primary); border-color: var(--primary); }
.pui-checkbox svg { width: 14px; height: 14px; fill: currentColor; }
.pui-checkbox:disabled { opacity: .5; cursor: not-allowed; }
.pui-switch { box-sizing: border-box; width: 34px; height: 20px; padding: 1px; border: 1px solid var(--input); border-radius: var(--radius-full);
  background: var(--input); cursor: pointer; display: inline-flex; align-items: center; transition: background-color .15s; }
.pui-switch[data-state="checked"] { background: var(--primary); border-color: var(--primary); }
.pui-switch:hover { filter: brightness(0.95); }
.pui-optional { color: var(--muted-foreground); font-weight: 400; }
.pui-field__description { margin: 0; color: var(--muted-foreground); font-size: 14px; line-height: 20px; }
.pui-field__error { margin: 0; display: flex; gap: 6px; align-items: flex-start; color: var(--destructive); font-size: 14px; line-height: 20px; }
.pui-field__error svg { width: 16px; height: 16px; margin-top: 2px; flex-shrink: 0; fill: currentColor; }
.pui-password { display: flex; gap: 8px; align-items: center; }
.pui-password .pui-input { flex: 1; min-width: 0; }
.pui-switch__thumb { width: 16px; height: 16px; border-radius: var(--radius-full); background: var(--background); transition: transform .15s; }
.pui-switch[data-state="checked"] .pui-switch__thumb { transform: translateX(14px); background: var(--primary-foreground); }
.pui-switch:disabled { opacity: .5; cursor: not-allowed; }

.pui-card { background: var(--card); color: var(--card-foreground); border: 1px solid var(--border); border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 24px; padding: 24px 0; }
.pui-card__header { display: grid; gap: 6px; padding: 0 24px; }
.pui-card__title { font: 600 16px/20px var(--font-sans); }
.pui-card__description { color: var(--muted-foreground); font-size: 14px; line-height: 20px; }
.pui-card__content { padding: 0 24px; }
.pui-card__footer { display: flex; align-items: center; gap: 8px; padding: 0 24px; }

.pui-alert { display: grid; gap: 2px; border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 12px 16px; background: var(--card); color: var(--card-foreground); }
.pui-alert__title { font-weight: 500; }
.pui-alert__description { color: var(--muted-foreground); }
.pui-alert--destructive { color: var(--destructive); }
.pui-alert--destructive .pui-alert__description { color: var(--destructive); }

.pui-tabs { display: flex; flex-direction: column; gap: 8px; }
.pui-tabs__list { display: inline-flex; width: fit-content; gap: 2px; padding: 3px; border-radius: var(--radius-lg); background: var(--muted); }
.pui-tabs__trigger { border: 1px solid transparent; border-radius: var(--radius-md); background: transparent; color: var(--muted-foreground);
  font: 500 14px/20px var(--font-sans); padding: 4px 10px; cursor: pointer; }
.pui-tabs__trigger[data-state="active"] { background: var(--background); color: var(--foreground); box-shadow: var(--shadow-sm); }
.pui-tabs__content { font-size: 14px; }

.pui-table-wrap { width: 100%; overflow-x: auto; }
.pui-table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 20px; }
.pui-table th { text-align: left; font-weight: 500; color: var(--foreground); height: 40px; padding: 0 8px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.pui-table td { padding: 8px; border-bottom: 1px solid var(--border); }
.pui-table tbody tr:hover { background: color-mix(in oklab, var(--muted) 60%, transparent); }
.pui-table .num { text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.pui-table__caption { caption-side: bottom; padding-top: 12px; color: var(--muted-foreground); }

.pui-separator { background: var(--border); flex-shrink: 0; }
.pui-separator--horizontal { height: 1px; width: 100%; }
.pui-separator--vertical { width: 1px; align-self: stretch; }
.pui-skeleton { background: var(--muted); border-radius: var(--radius-md); animation: pui-pulse 2s ease-in-out infinite; }
@keyframes pui-pulse { 50% { opacity: .5; } }
@media (prefers-reduced-motion: reduce) { .pui-skeleton { animation: none; } * { transition: none !important; } }
.pui-avatar { position: relative; display: inline-flex; width: 32px; height: 32px; overflow: hidden; border-radius: var(--radius-full); flex-shrink: 0; }
.pui-avatar img { width: 100%; height: 100%; object-fit: cover; }
.pui-avatar__fallback { display: grid; place-items: center; width: 100%; height: 100%; background: var(--muted); color: var(--foreground); font-size: 12px; font-weight: 500; }
