/* ---------- BUTTON ---------- */
.button {
  position: relative; isolation: isolate;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 36px; padding: 0 16px; border: 0;
  border-radius: 24px;
  font: 500 14px/1 "Geist", sans-serif;
  background: var(--button-bg, transparent);
  color: var(--button-fg, currentColor);
  cursor: var(--cursor-interactive);
  outline: none; user-select: none; white-space: nowrap;
  transition: transform 250ms var(--ease-smooth), background-color 100ms ease, box-shadow 100ms ease;
}
.button:hover { background: var(--button-bg-hover, var(--button-bg)); }
.button:active { background: var(--button-bg-pressed, var(--button-bg-hover)); transform: scale(0.97); }
.button:focus-visible { box-shadow: 0 0 0 2px var(--background), 0 0 0 4px var(--focus); }
.button[disabled], .button[aria-disabled="true"] { opacity: var(--disabled-opacity); cursor: var(--cursor-disabled); pointer-events: none; }
.button svg { width: 16px; height: 16px; flex: none; }

.button--sm { height: 32px; padding: 0 12px; font-size: 13px; }
.button--lg { height: 40px; padding: 0 20px; font-size: 16px; }

.button--primary {
  --button-bg: var(--color-accent); --button-bg-hover: var(--color-accent-hover); --button-bg-pressed: var(--color-accent-hover);
  --button-fg: var(--color-accent-foreground);
}
.button--secondary {
  --button-bg: var(--color-default); --button-bg-hover: var(--color-default-hover); --button-bg-pressed: var(--color-default-hover);
  --button-fg: var(--color-accent-soft-foreground);
}
.button--tertiary {
  --button-bg: var(--color-default); --button-bg-hover: var(--color-default-hover); --button-bg-pressed: var(--color-default-hover);
  --button-fg: var(--color-default-foreground);
}
.button--ghost {
  --button-bg: transparent; --button-bg-hover: var(--color-default); --button-bg-pressed: var(--color-default);
  --button-fg: var(--color-default-foreground);
}
.button--outline {
  --button-bg: transparent; --button-bg-hover: color-mix(in srgb, var(--color-default) 60%, transparent); --button-bg-pressed: var(--color-default);
  --button-fg: var(--color-default-foreground);
  border: 1px solid var(--color-border);
}
.button--danger {
  --button-bg: var(--color-danger); --button-bg-hover: color-mix(in oklab, var(--danger) 90%, var(--danger-foreground) 10%);
  --button-bg-pressed: var(--button-bg-hover); --button-fg: var(--color-danger-foreground);
}
.button--danger-soft {
  --button-bg: var(--color-danger-soft); --button-bg-hover: color-mix(in oklab, var(--danger) 20%, transparent);
  --button-bg-pressed: var(--button-bg-hover); --button-fg: var(--color-danger-soft-foreground);
}
.button--icon { width: 36px; padding: 0; }
.button--icon.button--sm { width: 32px; }
.button--icon.button--lg { width: 40px; }

/* ---------- INPUT ---------- */
.field-group { display: flex; flex-direction: column; gap: 6px; width: 100%; max-width: 360px; }
.label { font-size: 13px; font-weight: 500; color: var(--foreground); }
.label-helper { font-size: 12px; color: var(--muted); }
.input {
  height: 36px; padding: 0 12px;
  width: 100%;
  border-radius: var(--radius-field);
  background: var(--color-field);
  color: var(--color-field-foreground);
  border: 1px solid var(--color-field-border);
  box-shadow: var(--shadow-field);
  font: 400 14px/1 "Geist", sans-serif;
  outline: none;
  transition: background-color 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}
.input::placeholder { color: var(--color-field-placeholder); }
.input:hover { background: var(--color-field-hover); }
.input:focus { border-color: var(--color-field-border-focus); box-shadow: var(--shadow-field), 0 0 0 2px var(--background), 0 0 0 4px var(--focus); }
.input[data-invalid] { border-color: var(--danger); box-shadow: var(--shadow-field), 0 0 0 2px var(--background), 0 0 0 4px var(--danger); }
.input--secondary { background: var(--color-default); box-shadow: none; }
.input--secondary:hover { background: var(--color-default-hover); }

.textarea { height: 96px; padding: 10px 12px; resize: vertical; font-family: "Geist", sans-serif; }

.input-group { display: flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 12px;
  border-radius: var(--radius-field);
  background: var(--color-field);
  border: 1px solid var(--color-field-border);
  box-shadow: var(--shadow-field);
  width: 100%; max-width: 360px;
}
.input-group input { flex: 1; border: 0; background: transparent; outline: none; font: 400 14px/1 "Geist", sans-serif; color: inherit; }
.input-group svg { width: 16px; height: 16px; color: var(--muted); flex: none; }

/* ---------- CHIP ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 2px;
  padding: 2px 10px; border-radius: 16px;
  font: 500 12px/20px "Geist", sans-serif;
  background: var(--chip-bg, var(--color-default));
  color: var(--chip-fg, currentColor);
}
.chip--accent { --chip-fg: var(--color-accent); }
.chip--success { --chip-fg: var(--color-success); }
.chip--warning { --chip-fg: var(--color-warning); }
.chip--danger { --chip-fg: var(--color-danger); }
.chip--primary.chip--accent { --chip-bg: var(--color-accent); --chip-fg: var(--color-accent-foreground); }
.chip--primary.chip--success { --chip-bg: var(--color-success); --chip-fg: var(--color-success-foreground); }
.chip--primary.chip--warning { --chip-bg: var(--color-warning); --chip-fg: var(--color-warning-foreground); }
.chip--primary.chip--danger { --chip-bg: var(--color-danger); --chip-fg: var(--color-danger-foreground); }
.chip--soft.chip--accent { --chip-bg: var(--color-accent-soft); --chip-fg: var(--color-accent-soft-foreground); }
.chip--soft.chip--success { --chip-bg: var(--color-success-soft); --chip-fg: var(--color-success-soft-foreground); }
.chip--soft.chip--warning { --chip-bg: var(--color-warning-soft); --chip-fg: var(--color-warning-soft-foreground); }
.chip--soft.chip--danger { --chip-bg: var(--color-danger-soft); --chip-fg: var(--color-danger-soft-foreground); }
.chip--sm { padding: 0 8px; font-size: 11px; line-height: 18px; }
.chip--lg { padding: 4px 14px; font-size: 14px; border-radius: 20px; }
.chip .dot { width: 6px; height: 6px; border-radius: 999px; background: currentColor; margin-right: 2px; }

/* ---------- BADGE ---------- */
.badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 28px; min-width: 28px; padding: 0 8px;
  font: 500 12px/1.34 "Geist", sans-serif;
  border-radius: 24px; border: 1px solid var(--background);
  background: var(--badge-bg, var(--color-default));
  color: var(--badge-fg, var(--color-default-foreground));
}
.badge--sm { min-height: 16px; min-width: 16px; padding: 0 4px; font-size: 10px; border-radius: 12px; }
.badge--lg { min-height: 32px; min-width: 32px; padding: 0 12px; font-size: 14px; border-radius: 16px; }
.badge--primary.badge--accent { --badge-bg: var(--color-accent); --badge-fg: var(--color-accent-foreground); }
.badge--primary.badge--success { --badge-bg: var(--color-success); --badge-fg: var(--color-success-foreground); }
.badge--primary.badge--warning { --badge-bg: var(--color-warning); --badge-fg: var(--color-warning-foreground); }
.badge--primary.badge--danger { --badge-bg: var(--color-danger); --badge-fg: var(--color-danger-foreground); }
.badge--soft.badge--accent { --badge-bg: var(--color-accent-soft); --badge-fg: var(--color-accent-soft-foreground); }
.badge--soft.badge--success { --badge-bg: var(--color-success-soft); --badge-fg: var(--color-success-soft-foreground); }
.badge--soft.badge--warning { --badge-bg: var(--color-warning-soft); --badge-fg: var(--color-warning-soft-foreground); }
.badge--soft.badge--danger { --badge-bg: var(--color-danger-soft); --badge-fg: var(--color-danger-soft-foreground); }
.badge-anchor { position: relative; display: inline-flex; }
.badge-anchor .badge.top-right { position: absolute; top: 0; right: 0; transform: translate(25%, -25%); }

/* ---------- SWITCH ---------- */
.switch { display: inline-flex; align-items: center; gap: 12px; cursor: var(--cursor-interactive); }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch__control {
  position: relative; display: flex; align-items: center;
  width: 40px; height: 20px; border-radius: 999px;
  background: var(--color-default);
  transition: background-color 250ms var(--ease-smooth);
}
.switch__thumb {
  margin-left: 2px;
  width: 22px; height: 16px; border-radius: 999px;
  background: var(--white); box-shadow: var(--shadow-field);
  transition: margin-left 300ms var(--ease-out-fluid), background-color 200ms ease;
}
.switch[data-selected="true"] .switch__control { background: var(--color-accent); }
.switch[data-selected="true"] .switch__thumb { margin-left: calc(100% - 24px); background: var(--accent-foreground); }
.switch__label { font-size: 14px; font-weight: 500; color: var(--foreground); }
.switch--sm .switch__control { width: 32px; height: 16px; }
.switch--sm .switch__thumb { width: 16.5px; height: 12px; }
.switch--sm[data-selected="true"] .switch__thumb { margin-left: calc(100% - 18.5px); }
.switch--lg .switch__control { width: 48px; height: 24px; }
.switch--lg .switch__thumb { width: 27.5px; height: 20px; }
.switch--lg[data-selected="true"] .switch__thumb { margin-left: calc(100% - 29.5px); }

/* ---------- CHECKBOX & RADIO ---------- */
.check {
  display: inline-flex; align-items: center; gap: 8px;
  cursor: var(--cursor-interactive);
  font-size: 14px; font-weight: 500; color: var(--foreground);
}
.check input { position: absolute; opacity: 0; pointer-events: none; }
.check .box {
  width: 18px; height: 18px; border-radius: 6px;
  background: var(--color-default);
  display: inline-flex; align-items: center; justify-content: center;
  transition: background 150ms ease;
}
.check[data-selected="true"] .box { background: var(--color-accent); }
.check[data-selected="true"] .box svg { stroke: var(--accent-foreground); opacity: 1; }
.check .box svg { width: 11px; height: 8px; stroke: var(--accent-foreground); opacity: 0; transition: opacity 120ms ease; fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.check .circle {
  width: 18px; height: 18px; border-radius: 999px;
  background: var(--color-default);
  display: inline-flex; align-items: center; justify-content: center;
}
.check[data-selected="true"] .circle { background: var(--color-accent); }
.check[data-selected="true"] .circle::after { content: ""; width: 6px; height: 6px; border-radius: 999px; background: var(--accent-foreground); }

/* ---------- CARD ---------- */
.card {
  position: relative; display: flex; flex-direction: column; gap: 12px;
  padding: 16px; overflow: hidden;
  border-radius: 24px; box-shadow: var(--shadow-surface);
  background: var(--surface); color: var(--surface-foreground);
}
.card--secondary { background: var(--surface-secondary); }
.card--tertiary { background: var(--surface-tertiary); }
.card__title { font-size: 14px; line-height: 1.4; font-weight: 500; color: var(--foreground); }
.card__description { font-size: 13px; line-height: 1.45; color: var(--muted); margin: 0; }
.card__footer { display: flex; align-items: center; gap: 8px; margin-top: 4px; }

/* ---------- ALERT ---------- */
.alert {
  display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: start;
  padding: 12px 14px; border-radius: 16px;
  background: var(--alert-bg, var(--color-default));
  color: var(--alert-fg, var(--color-default-foreground));
  border: 1px solid var(--alert-border, transparent);
}
.alert .icon { width: 20px; height: 20px; color: var(--alert-accent, currentColor); margin-top: 2px; }
.alert .content { display: flex; flex-direction: column; gap: 2px; }
.alert .content .t { font-size: 13px; font-weight: 500; }
.alert .content .d { font-size: 13px; color: color-mix(in oklab, var(--alert-fg) 75%, transparent); }
.alert--accent { --alert-bg: var(--color-accent-soft); --alert-fg: var(--foreground); --alert-accent: var(--color-accent); }
.alert--success { --alert-bg: var(--color-success-soft); --alert-fg: var(--foreground); --alert-accent: var(--color-success); }
.alert--warning { --alert-bg: var(--color-warning-soft); --alert-fg: var(--foreground); --alert-accent: var(--color-warning); }
.alert--danger  { --alert-bg: var(--color-danger-soft);  --alert-fg: var(--foreground); --alert-accent: var(--color-danger); }

/* ---------- TOOLTIP ---------- */
.tip {
  display: inline-flex; padding: 6px 10px; border-radius: 10px;
  background: var(--foreground); color: var(--background);
  font-size: 12px; font-weight: 500;
  box-shadow: var(--shadow-overlay);
}

/* ---------- TABS ---------- */
.tabs { display: inline-flex; padding: 2px; gap: 2px; background: var(--color-default); border-radius: 12px; }
.tabs button {
  border: 0; background: transparent; color: var(--muted);
  font: 500 13px/1 "Geist", sans-serif; padding: 8px 14px; border-radius: 10px;
  cursor: pointer; transition: all 150ms ease;
}
.tabs button.active { background: var(--surface); color: var(--foreground); box-shadow: var(--shadow-surface); }

/* ---------- AVATAR ---------- */
.avatar {
  width: 36px; height: 36px; border-radius: 999px;
  background: var(--color-default); color: var(--foreground);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 500;
  overflow: hidden; flex: none;
}
.avatar--sm { width: 28px; height: 28px; font-size: 11px; }
.avatar--lg { width: 48px; height: 48px; font-size: 16px; }
.avatar.gradient-1 { background: linear-gradient(135deg, oklch(0.65 0.19 253), oklch(0.72 0.2 325)); color: white; }
.avatar.gradient-2 { background: linear-gradient(135deg, oklch(0.75 0.18 150), oklch(0.82 0.13 76)); color: white; }
.avatar.gradient-3 { background: linear-gradient(135deg, oklch(0.6 0.22 25), oklch(0.72 0.18 50)); color: white; }

.stack-h { display: flex; }
.stack-h .avatar { border: 2px solid var(--background); margin-left: -8px; }
.stack-h .avatar:first-child { margin-left: 0; }

/* ---------- MENU ---------- */
.menu {
  min-width: 220px;
  padding: 8px; border-radius: 20px;
  background: var(--color-overlay); box-shadow: var(--shadow-overlay);
  display: flex; flex-direction: column; gap: 2px;
}
.menu .item {
  display: flex; align-items: center; gap: 10px; min-height: 36px;
  padding: 6px 8px; border-radius: 12px;
  font-size: 13px; font-weight: 500; color: var(--foreground);
  cursor: var(--cursor-interactive);
  transition: transform 250ms var(--ease-smooth), background 120ms ease;
}
.menu .item:hover { background: var(--color-default); }
.menu .item.danger { color: var(--color-danger); }
.menu .item .kbd {
  margin-left: auto; padding: 2px 6px; border-radius: 6px;
  background: var(--color-default); font: 500 11px/1 "JetBrains Mono", monospace; color: var(--muted);
}
.menu .sep { height: 1px; background: var(--separator); margin: 4px 0; }

/* ---------- PROGRESS ---------- */
.progress { width: 100%; height: 8px; border-radius: 999px; background: var(--color-default); overflow: hidden; }
.progress > div { height: 100%; background: var(--color-accent); border-radius: 999px; }
.progress-circle { position: relative; width: 48px; height: 48px; }
.progress-circle svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.progress-circle .bg { stroke: var(--color-default); fill: none; stroke-width: 4; }
.progress-circle .fg { stroke: var(--color-accent); fill: none; stroke-width: 4; stroke-linecap: round; }

/* ---------- SLIDER ---------- */
.slider { width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 10px; }
.slider__track { position: relative; height: 4px; background: var(--color-default); border-radius: 999px; }
.slider__fill { position: absolute; left: 0; top: 0; height: 100%; background: var(--color-accent); border-radius: 999px; }
.slider__thumb { position: absolute; top: 50%; width: 16px; height: 16px; border-radius: 999px; background: var(--white); transform: translate(-50%, -50%); box-shadow: 0 0 0 2px var(--color-accent), var(--shadow-field); }

/* ---------- TABLE ---------- */
table.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
table.tbl thead th {
  background: var(--color-default);
  font-size: 12px; font-weight: 500; color: var(--muted);
  text-align: left; padding: 12px 16px;
  border-bottom: 1px solid var(--separator);
}
table.tbl tbody td { padding: 14px 16px; border-bottom: 1px solid var(--separator); vertical-align: middle; }
table.tbl tbody tr:last-child td { border-bottom: 0; }

/* ---------- MODAL ---------- */
.modal {
  width: 100%; max-width: 420px;
  border-radius: 24px; padding: 20px;
  background: var(--color-overlay); box-shadow: var(--shadow-overlay);
  display: flex; flex-direction: column; gap: 12px;
}
.modal h4 { margin: 0; font-size: 18px; font-weight: 500; letter-spacing: -0.015em; }
.modal p { margin: 0; font-size: 14px; color: var(--muted); line-height: 1.5; }
</content>
</invoke>