/* ==========================================================================
   OMNI COLOR — COMPONENTS STYLESHEET
   File: assets/css/components.css
   Purpose: Buttons, forms, cards, badges, tabs, accordions, modals, toasts,
            swatches, inputs, dropdowns, tooltips, alerts, tables, pagination,
            progress, avatars, chips, code blocks, FAQ, CTA, breadcrumbs UI
   Author: Omni Color
   Version: 1.0.0
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. BUTTON — BASE
   -------------------------------------------------------------------------- */
.btn {
  --btn-height: var(--button-height-md);
  --btn-padding-x: var(--space-4);
  --btn-font-size: var(--fs-sm);
  --btn-gap: var(--space-2);
  --btn-bg: var(--brand-primary);
  --btn-bg-hover: var(--brand-primary-hover);
  --btn-bg-active: var(--brand-primary-active);
  --btn-fg: var(--neutral-0);
  --btn-border: transparent;
  --btn-shadow: var(--shadow-xs);
  --btn-shadow-hover: var(--shadow-sm);

  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--btn-gap);
  height: var(--btn-height);
  padding-inline: var(--btn-padding-x);
  font-family: inherit;
  font-size: var(--btn-font-size);
  font-weight: var(--fw-semibold);
  line-height: 1;
  letter-spacing: var(--ls-tight);
  color: var(--btn-fg);
  background-color: var(--btn-bg);
  border: 1px solid var(--btn-border);
  border-radius: var(--radius-md);
  box-shadow: var(--btn-shadow);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  text-decoration: none;
  -webkit-appearance: none;
  appearance: none;
  transition:
    background-color var(--duration-fast) var(--ease-out),
    border-color var(--duration-fast) var(--ease-out),
    color var(--duration-fast) var(--ease-out),
    box-shadow var(--duration-fast) var(--ease-out),
    transform var(--duration-instant) var(--ease-out);
}

.btn:hover {
  background-color: var(--btn-bg-hover);
  box-shadow: var(--btn-shadow-hover);
  color: var(--btn-fg);
}

.btn:active {
  background-color: var(--btn-bg-active);
  transform: translateY(1px);
  box-shadow: var(--btn-shadow);
}

.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 var(--focus-ring-width) var(--focus-ring-color);
}

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
  box-shadow: none;
}

.btn svg {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

/* Button sizes */
.btn--xs {
  --btn-height: 1.75rem;
  --btn-padding-x: var(--space-2);
  --btn-font-size: var(--fs-xs);
  --btn-gap: var(--space-1);
}

.btn--sm {
  --btn-height: var(--button-height-sm);
  --btn-padding-x: var(--space-3);
  --btn-font-size: var(--fs-xs);
}

.btn--lg {
  --btn-height: var(--button-height-lg);
  --btn-padding-x: var(--space-6);
  --btn-font-size: var(--fs-base);
}

.btn--xl {
  --btn-height: 3.5rem;
  --btn-padding-x: var(--space-8);
  --btn-font-size: var(--fs-lg);
}

.btn--block {
  width: 100%;
}

.btn--icon {
  --btn-padding-x: 0;
  width: var(--btn-height);
}

.btn--pill {
  border-radius: var(--radius-full);
}

/* Button variants */
.btn--primary {
  --btn-bg: var(--brand-primary);
  --btn-bg-hover: var(--brand-primary-hover);
  --btn-bg-active: var(--brand-primary-active);
  --btn-fg: var(--neutral-0);
}

.btn--secondary {
  --btn-bg: var(--surface-muted);
  --btn-bg-hover: var(--neutral-200);
  --btn-bg-active: var(--neutral-300);
  --btn-fg: var(--text-primary);
  --btn-shadow: none;
  --btn-shadow-hover: none;
}

[data-theme="dark"] .btn--secondary {
  --btn-bg-hover: var(--neutral-700);
  --btn-bg-active: var(--neutral-600);
}

.btn--outline {
  --btn-bg: transparent;
  --btn-bg-hover: var(--surface-muted);
  --btn-bg-active: var(--surface-sunken);
  --btn-fg: var(--text-primary);
  --btn-border: var(--border-default);
  --btn-shadow: none;
  --btn-shadow-hover: none;
}

.btn--ghost {
  --btn-bg: transparent;
  --btn-bg-hover: var(--surface-muted);
  --btn-bg-active: var(--surface-sunken);
  --btn-fg: var(--text-secondary);
  --btn-shadow: none;
  --btn-shadow-hover: none;
}

.btn--ghost:hover {
  color: var(--text-primary);
}

.btn--success {
  --btn-bg: var(--success-600);
  --btn-bg-hover: var(--success-700);
  --btn-bg-active: var(--success-700);
  --btn-fg: var(--neutral-0);
}

.btn--warning {
  --btn-bg: var(--warning-500);
  --btn-bg-hover: var(--warning-600);
  --btn-bg-active: var(--warning-700);
  --btn-fg: var(--neutral-0);
}

.btn--danger {
  --btn-bg: var(--danger-600);
  --btn-bg-hover: var(--danger-700);
  --btn-bg-active: var(--danger-700);
  --btn-fg: var(--neutral-0);
}

.btn--info {
  --btn-bg: var(--info-600);
  --btn-bg-hover: var(--info-700);
  --btn-bg-active: var(--info-700);
  --btn-fg: var(--neutral-0);
}

.btn--gradient {
  background-image: var(--gradient-brand);
  background-color: var(--brand-primary);
  color: var(--neutral-0);
}

.btn--gradient:hover {
  background-color: var(--brand-primary-hover);
  color: var(--neutral-0);
  filter: brightness(1.05);
}

.btn--link {
  --btn-bg: transparent;
  --btn-bg-hover: transparent;
  --btn-bg-active: transparent;
  --btn-fg: var(--brand-primary);
  --btn-shadow: none;
  --btn-shadow-hover: none;
  padding-inline: 0;
  height: auto;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.btn--link:hover {
  color: var(--brand-primary-hover);
  text-decoration-thickness: 2px;
}

/* --------------------------------------------------------------------------
   2. FORM ELEMENTS
   -------------------------------------------------------------------------- */
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.form-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--text-primary);
  line-height: 1.3;
}

.form-label__required {
  color: var(--danger-600);
}

.form-label__optional {
  font-size: var(--fs-xs);
  font-weight: var(--fw-regular);
  color: var(--text-tertiary);
}

.form-hint {
  font-size: var(--fs-xs);
  color: var(--text-tertiary);
  line-height: 1.45;
}

.form-error {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--fs-xs);
  color: var(--danger-600);
  line-height: 1.4;
}

.form-error svg {
  width: 0.875rem;
  height: 0.875rem;
  flex-shrink: 0;
}

/* Text input */
.input {
  display: block;
  width: 100%;
  height: var(--input-height-md);
  padding-inline: var(--space-3);
  font-family: inherit;
  font-size: var(--fs-sm);
  line-height: 1;
  color: var(--text-primary);
  background-color: var(--surface-base);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
  transition:
    border-color var(--duration-fast) var(--ease-out),
    box-shadow var(--duration-fast) var(--ease-out),
    background-color var(--duration-fast) var(--ease-out);
  -webkit-appearance: none;
  appearance: none;
}

.input:hover:not(:disabled) {
  border-color: var(--border-strong);
}

.input:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 var(--focus-ring-width) var(--focus-ring-color);
}

.input:disabled,
.input[readonly] {
  background-color: var(--surface-muted);
  color: var(--text-tertiary);
  cursor: not-allowed;
}

.input--invalid,
.input[aria-invalid="true"] {
  border-color: var(--danger-500);
}

.input--invalid:focus,
.input[aria-invalid="true"]:focus {
  box-shadow: 0 0 0 var(--focus-ring-width) rgba(239, 68, 68, 0.3);
}

.input--sm {
  height: var(--input-height-sm);
  font-size: var(--fs-xs);
  padding-inline: var(--space-2);
}

.input--lg {
  height: var(--input-height-lg);
  font-size: var(--fs-base);
  padding-inline: var(--space-4);
}

.input--mono {
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}

/* Textarea */
.textarea {
  display: block;
  width: 100%;
  min-height: 6rem;
  padding: var(--space-3);
  font-family: inherit;
  font-size: var(--fs-sm);
  line-height: var(--lh-relaxed);
  color: var(--text-primary);
  background-color: var(--surface-base);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
  resize: vertical;
  transition:
    border-color var(--duration-fast) var(--ease-out),
    box-shadow var(--duration-fast) var(--ease-out);
}

.textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 var(--focus-ring-width) var(--focus-ring-color);
}

/* Select */
.select {
  position: relative;
  display: inline-flex;
  width: 100%;
}

.select select {
  display: block;
  width: 100%;
  height: var(--input-height-md);
  padding-inline: var(--space-3) var(--space-8);
  font-family: inherit;
  font-size: var(--fs-sm);
  color: var(--text-primary);
  background-color: var(--surface-base);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  transition:
    border-color var(--duration-fast) var(--ease-out),
    box-shadow var(--duration-fast) var(--ease-out);
}

.select select:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 var(--focus-ring-width) var(--focus-ring-color);
}

.select::after {
  content: "";
  position: absolute;
  top: 50%;
  right: var(--space-3);
  width: 0.5rem;
  height: 0.5rem;
  border-right: 2px solid var(--text-tertiary);
  border-bottom: 2px solid var(--text-tertiary);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}

/* Checkbox & Radio */
.checkbox,
.radio {
  display: inline-flex;
  align-items: flex-start;
  gap: var(--space-2);
  cursor: pointer;
  font-size: var(--fs-sm);
  line-height: 1.4;
  color: var(--text-primary);
  user-select: none;
}

.checkbox input[type="checkbox"],
.radio input[type="radio"] {
  flex-shrink: 0;
  width: 1.125rem;
  height: 1.125rem;
  margin-top: 1px;
  accent-color: var(--brand-primary);
  cursor: pointer;
}

.checkbox--card,
.radio--card {
  display: flex;
  width: 100%;
  padding: var(--space-3);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  transition:
    border-color var(--duration-fast) var(--ease-out),
    background-color var(--duration-fast) var(--ease-out);
}

.checkbox--card:hover,
.radio--card:hover {
  border-color: var(--border-strong);
  background-color: var(--surface-sunken);
}

.checkbox--card:has(input:checked),
.radio--card:has(input:checked) {
  border-color: var(--brand-primary);
  background-color: var(--brand-primary-soft);
}

/* Switch */
.switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
  user-select: none;
}

.switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.switch__track {
  position: relative;
  width: 2.25rem;
  height: 1.25rem;
  border-radius: var(--radius-full);
  background-color: var(--neutral-300);
  transition: background-color var(--duration-fast) var(--ease-out);
  flex-shrink: 0;
}

.switch__thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background-color: var(--neutral-0);
  box-shadow: var(--shadow-xs);
  transition: transform var(--duration-normal) var(--ease-spring);
}

.switch input:checked + .switch__track {
  background-color: var(--brand-primary);
}

.switch input:checked + .switch__track .switch__thumb {
  transform: translateX(1rem);
}

.switch input:focus-visible + .switch__track {
  box-shadow: 0 0 0 var(--focus-ring-width) var(--focus-ring-color);
}

.switch__label {
  font-size: var(--fs-sm);
  color: var(--text-primary);
}

/* Range input */
.range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 1.25rem;
  background: transparent;
  cursor: pointer;
}

.range::-webkit-slider-runnable-track {
  width: 100%;
  height: 0.375rem;
  border-radius: var(--radius-full);
  background-color: var(--surface-muted);
}

.range::-moz-range-track {
  width: 100%;
  height: 0.375rem;
  border-radius: var(--radius-full);
  background-color: var(--surface-muted);
}

.range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 1.125rem;
  height: 1.125rem;
  margin-top: -0.375rem;
  border-radius: 50%;
  background-color: var(--brand-primary);
  border: 2px solid var(--surface-base);
  box-shadow: var(--shadow-md);
  transition: transform var(--duration-fast) var(--ease-out);
}

.range::-moz-range-thumb {
  width: 1.125rem;
  height: 1.125rem;
  border-radius: 50%;
  background-color: var(--brand-primary);
  border: 2px solid var(--surface-base);
  box-shadow: var(--shadow-md);
  transition: transform var(--duration-fast) var(--ease-out);
}

.range:hover::-webkit-slider-thumb { transform: scale(1.1); }
.range:hover::-moz-range-thumb { transform: scale(1.1); }

.range:focus-visible {
  outline: none;
}

.range:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 var(--focus-ring-width) var(--focus-ring-color);
}

/* Input group (input + button) */
.input-group {
  display: flex;
  width: 100%;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
}

.input-group > .input {
  border-radius: 0;
  box-shadow: none;
}

.input-group > .input:first-child {
  border-top-left-radius: var(--radius-md);
  border-bottom-left-radius: var(--radius-md);
}

.input-group > .input:last-child {
  border-top-right-radius: var(--radius-md);
  border-bottom-right-radius: var(--radius-md);
}

.input-group > .input:not(:first-child) {
  border-left: none;
}

.input-group > .btn {
  border-radius: 0;
  box-shadow: none;
}

.input-group > .btn:last-child {
  border-top-right-radius: var(--radius-md);
  border-bottom-right-radius: var(--radius-md);
}

.input-group > .btn:first-child {
  border-top-left-radius: var(--radius-md);
  border-bottom-left-radius: var(--radius-md);
}

/* Color input (native) */
.color-input-native {
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--surface-base);
  cursor: pointer;
  overflow: hidden;
  flex-shrink: 0;
}

.color-input-native::-webkit-color-swatch-wrapper {
  padding: 0;
}

.color-input-native::-webkit-color-swatch {
  border: none;
  border-radius: calc(var(--radius-md) - 1px);
}

.color-input-native::-moz-color-swatch {
  border: none;
  border-radius: calc(var(--radius-md) - 1px);
}

/* Hex input */
.hex-input {
  display: inline-flex;
  align-items: center;
  height: var(--input-height-md);
  padding-inline: var(--space-3);
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  letter-spacing: 0.02em;
  color: var(--text-primary);
  background-color: var(--surface-base);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
  text-transform: uppercase;
  width: 100%;
  transition: border-color var(--duration-fast) var(--ease-out),
    box-shadow var(--duration-fast) var(--ease-out);
}

.hex-input:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 var(--focus-ring-width) var(--focus-ring-color);
}

.hex-input__prefix {
  color: var(--text-tertiary);
  margin-right: 2px;
}

.hex-input input {
  border: none;
  outline: none;
  background: transparent;
  flex: 1;
  min-width: 0;
  font: inherit;
  color: inherit;
  text-transform: inherit;
}

/* Numeric field */
.num-field {
  display: inline-flex;
  align-items: center;
  height: var(--input-height-md);
  background-color: var(--surface-base);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
  transition: border-color var(--duration-fast) var(--ease-out),
    box-shadow var(--duration-fast) var(--ease-out);
}

.num-field:focus-within {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 var(--focus-ring-width) var(--focus-ring-color);
}

.num-field__label {
  padding-inline: var(--space-3);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: var(--ls-wide);
  border-right: 1px solid var(--border-subtle);
  height: 100%;
  display: inline-flex;
  align-items: center;
  background-color: var(--surface-muted);
}

.num-field__input {
  width: 100%;
  height: 100%;
  padding-inline: var(--space-3);
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--text-primary);
  text-align: right;
}

/* --------------------------------------------------------------------------
   3. CARD
   -------------------------------------------------------------------------- */
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background-color: var(--surface-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xs);
  transition:
    border-color var(--duration-fast) var(--ease-out),
    box-shadow var(--duration-fast) var(--ease-out),
    transform var(--duration-fast) var(--ease-out);
  overflow: hidden;
}

.card--interactive {
  cursor: pointer;
}

.card--interactive:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card--interactive:focus-visible {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 var(--focus-ring-width) var(--focus-ring-color);
}

.card--flat {
  box-shadow: none;
}

.card--elevated {
  box-shadow: var(--shadow-md);
}

.card--bordered {
  border-width: 2px;
}

.card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-5);
  border-bottom: 1px solid var(--border-subtle);
}

.card__body {
  flex: 1 1 auto;
  padding: var(--space-5);
}

.card__footer {
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--border-subtle);
  background-color: var(--surface-sunken);
}

.card__title {
  font-size: var(--fs-base);
  font-weight: var(--fw-semibold);
  color: var(--text-primary);
  line-height: 1.35;
  margin: 0;
}

.card__subtitle {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  margin-top: var(--space-1);
  line-height: var(--lh-relaxed);
}

.card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-lg);
  background-color: var(--brand-primary-soft);
  color: var(--brand-primary);
  flex-shrink: 0;
}

.card__icon svg {
  width: 1.25rem;
  height: 1.25rem;
}

.card__icon--lg {
  width: 3rem;
  height: 3rem;
}

.card__icon--lg svg {
  width: 1.5rem;
  height: 1.5rem;
}

/* Tool card */
.tool-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-5);
  background-color: var(--surface-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  text-decoration: none;
  color: inherit;
  transition:
    border-color var(--duration-fast) var(--ease-out),
    box-shadow var(--duration-fast) var(--ease-out),
    transform var(--duration-fast) var(--ease-out);
}

.tool-card:hover {
  border-color: var(--brand-primary);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
  color: inherit;
}

.tool-card:focus-visible {
  outline: none;
  box-shadow: 0 0 0 var(--focus-ring-width) var(--focus-ring-color);
}

.tool-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: var(--radius-lg);
  background-color: var(--brand-primary-soft);
  color: var(--brand-primary);
  flex-shrink: 0;
  transition: background-color var(--duration-fast) var(--ease-out);
}

.tool-card:hover .tool-card__icon {
  background-color: var(--brand-primary);
  color: var(--neutral-0);
}

.tool-card__icon svg {
  width: 1.375rem;
  height: 1.375rem;
}

.tool-card__title {
  font-size: var(--fs-base);
  font-weight: var(--fw-semibold);
  color: var(--text-primary);
  line-height: 1.3;
}

.tool-card__desc {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  line-height: var(--lh-relaxed);
}

.tool-card__meta {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  margin-top: auto;
  padding-top: var(--space-2);
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  color: var(--brand-primary);
}

.tool-card__meta svg {
  width: 0.875rem;
  height: 0.875rem;
}

/* --------------------------------------------------------------------------
   4. BADGE / CHIP / PILL
   -------------------------------------------------------------------------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  line-height: 1.6;
  color: var(--text-secondary);
  background-color: var(--surface-muted);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  white-space: nowrap;
  transition:
    background-color var(--duration-fast) var(--ease-out),
    border-color var(--duration-fast) var(--ease-out),
    color var(--duration-fast) var(--ease-out);
}

.chip--interactive {
  cursor: pointer;
}

.chip--interactive:hover {
  background-color: var(--surface-sunken);
  border-color: var(--border-default);
  color: var(--text-primary);
}

.chip--brand {
  background-color: var(--brand-primary-soft);
  border-color: transparent;
  color: var(--brand-primary-text);
}

.chip--success {
  background-color: var(--success-100);
  border-color: transparent;
  color: var(--success-700);
}

.chip--warning {
  background-color: var(--warning-100);
  border-color: transparent;
  color: var(--warning-700);
}

.chip--danger {
  background-color: var(--danger-100);
  border-color: transparent;
  color: var(--danger-700);
}

.chip__dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background-color: currentColor;
  flex-shrink: 0;
}

.chip__remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  margin-left: 2px;
  border-radius: 50%;
  color: currentColor;
  opacity: 0.6;
  cursor: pointer;
}

.chip__remove:hover {
  opacity: 1;
  background-color: rgba(0, 0, 0, 0.08);
}

/* --------------------------------------------------------------------------
   5. TABS
   -------------------------------------------------------------------------- */
.tabs {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.tabs__list {
  display: flex;
  gap: var(--space-1);
  padding: 3px;
  background-color: var(--surface-muted);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  position: relative;
}

.tabs__list::-webkit-scrollbar {
  display: none;
}

.tabs__trigger {
  flex: 1 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--text-secondary);
  background-color: transparent;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  white-space: nowrap;
  transition:
    color var(--duration-fast) var(--ease-out),
    background-color var(--duration-fast) var(--ease-out),
    box-shadow var(--duration-fast) var(--ease-out);
}

.tabs__trigger:hover {
  color: var(--text-primary);
}

.tabs__trigger[aria-selected="true"] {
  color: var(--text-primary);
  background-color: var(--surface-raised);
  box-shadow: var(--shadow-xs);
}

.tabs__trigger svg {
  width: 1rem;
  height: 1rem;
}

.tabs__panel {
  padding: 0;
}

.tabs__panel[hidden] {
  display: none;
}

/* Underline tabs (alternative) */
.tabs--underline .tabs__list {
  background: transparent;
  border-bottom: 1px solid var(--border-subtle);
  border-radius: 0;
  padding: 0;
  gap: var(--space-5);
}

.tabs--underline .tabs__trigger {
  padding: var(--space-3) 0;
  border-radius: 0;
  position: relative;
  background: transparent;
  box-shadow: none;
}

.tabs--underline .tabs__trigger[aria-selected="true"] {
  color: var(--brand-primary);
  background: transparent;
  box-shadow: none;
}

.tabs--underline .tabs__trigger[aria-selected="true"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background-color: var(--brand-primary);
  border-radius: var(--radius-full);
}

/* --------------------------------------------------------------------------
   6. ACCORDION
   -------------------------------------------------------------------------- */
.accordion {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.accordion__item {
  background-color: var(--surface-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color var(--duration-fast) var(--ease-out),
    box-shadow var(--duration-fast) var(--ease-out);
}

.accordion__item[open] {
  border-color: var(--border-default);
  box-shadow: var(--shadow-xs);
}

.accordion__trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  width: 100%;
  padding: var(--space-4) var(--space-5);
  font-size: var(--fs-base);
  font-weight: var(--fw-semibold);
  text-align: left;
  color: var(--text-primary);
  background: transparent;
  cursor: pointer;
  list-style: none;
  transition: background-color var(--duration-fast) var(--ease-out);
}

.accordion__trigger::-webkit-details-marker {
  display: none;
}

.accordion__trigger:hover {
  background-color: var(--surface-sunken);
}

.accordion__trigger:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 var(--focus-ring-width) var(--focus-ring-color);
}

.accordion__icon {
  flex-shrink: 0;
  width: 1.25rem;
  height: 1.25rem;
  color: var(--text-tertiary);
  transition: transform var(--duration-normal) var(--ease-out);
}

.accordion__item[open] .accordion__icon {
  transform: rotate(180deg);
}

.accordion__content {
  padding: 0 var(--space-5) var(--space-5);
  font-size: var(--fs-sm);
  line-height: var(--lh-relaxed);
  color: var(--text-secondary);
}

.accordion__content p + p {
  margin-top: var(--space-3);
}

/* --------------------------------------------------------------------------
   7. MODAL / DIALOG
   -------------------------------------------------------------------------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  background-color: var(--surface-overlay);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--duration-fast) var(--ease-out),
    visibility var(--duration-fast) var(--ease-out);
}

.modal.is-open {
  opacity: 1;
  visibility: visible;
}

.modal__panel {
  width: 100%;
  max-width: 32rem;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  background-color: var(--surface-raised);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-2xl);
  overflow: hidden;
  transform: translateY(12px) scale(0.98);
  transition: transform var(--duration-normal) var(--ease-spring);
}

.modal.is-open .modal__panel {
  transform: translateY(0) scale(1);
}

.modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.modal__title {
  font-size: var(--fs-lg);
  font-weight: var(--fw-semibold);
  color: var(--text-primary);
  line-height: 1.3;
  margin: 0;
}

.modal__subtitle {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  margin-top: var(--space-1);
  line-height: var(--lh-relaxed);
}

.modal__body {
  flex: 1 1 auto;
  padding: var(--space-6);
  overflow-y: auto;
}

.modal__footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--border-subtle);
  background-color: var(--surface-sunken);
  flex-shrink: 0;
}

.modal__close {
  flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   8. TOAST / NOTIFICATION
   -------------------------------------------------------------------------- */
.toast {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  min-width: 16rem;
  max-width: 24rem;
  background-color: var(--neutral-900);
  color: var(--neutral-0);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  pointer-events: auto;
  font-size: var(--fs-sm);
  line-height: 1.4;
  opacity: 0;
  transform: translateY(8px);
  animation: slideUp var(--duration-normal) var(--ease-out) forwards;
}

[data-theme="dark"] .toast {
  background-color: var(--surface-raised);
  border: 1px solid var(--border-default);
}

.toast.is-leaving {
  animation: fadeOut var(--duration-fast) var(--ease-out) forwards;
}

.toast__icon {
  flex-shrink: 0;
  width: 1.125rem;
  height: 1.125rem;
  margin-top: 1px;
}

.toast--success .toast__icon { color: var(--success-500); }
.toast--error .toast__icon { color: var(--danger-500); }
.toast--warning .toast__icon { color: var(--warning-500); }
.toast--info .toast__icon { color: var(--info-500); }

.toast__message {
  flex: 1;
  font-weight: var(--fw-medium);
}

.toast__action {
  flex-shrink: 0;
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  color: var(--brand-accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* --------------------------------------------------------------------------
   9. ALERT / CALLOUT
   -------------------------------------------------------------------------- */
.alert {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-4);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  font-size: var(--fs-sm);
  line-height: var(--lh-relaxed);
  background-color: var(--surface-sunken);
  color: var(--text-secondary);
}

.alert__icon {
  flex-shrink: 0;
  width: 1.25rem;
  height: 1.25rem;
  margin-top: 1px;
}

.alert__content {
  flex: 1;
  min-width: 0;
}

.alert__title {
  font-weight: var(--fw-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-1);
  font-size: var(--fs-sm);
}

.alert--info {
  background-color: var(--info-50);
  border-color: var(--info-200);
  color: var(--info-900);
}

.alert--info .alert__icon { color: var(--info-600); }
.alert--info .alert__title { color: var(--info-900); }

.alert--success {
  background-color: var(--success-50);
  border-color: var(--success-200);
  color: var(--success-900);
}

.alert--success .alert__icon { color: var(--success-600); }
.alert--success .alert__title { color: var(--success-900); }

.alert--warning {
  background-color: var(--warning-50);
  border-color: var(--warning-200);
  color: var(--warning-900);
}

.alert--warning .alert__icon { color: var(--warning-600); }
.alert--warning .alert__title { color: var(--warning-900); }

.alert--danger {
  background-color: var(--danger-50);
  border-color: var(--danger-200);
  color: var(--danger-900);
}

.alert--danger .alert__icon { color: var(--danger-600); }
.alert--danger .alert__title { color: var(--danger-900); }

[data-theme="dark"] .alert--info { background-color: #0c1f42; border-color: #1e3a8a; color: #bfdbfe; }
[data-theme="dark"] .alert--success { background-color: #052e16; border-color: #166534; color: #bbf7d0; }
[data-theme="dark"] .alert--warning { background-color: #451a03; border-color: #92400e; color: #fde68a; }
[data-theme="dark"] .alert--danger { background-color: #450a0a; border-color: #991b1b; color: #fecaca; }

[data-theme="dark"] .alert--info .alert__title,
[data-theme="dark"] .alert--success .alert__title,
[data-theme="dark"] .alert--warning .alert__title,
[data-theme="dark"] .alert--danger .alert__title {
  color: inherit;
}

/* --------------------------------------------------------------------------
   10. SWATCH
   -------------------------------------------------------------------------- */
.swatch {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--space-2);
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
  border-radius: var(--radius-md);
  transition: transform var(--duration-fast) var(--ease-out);
}

.swatch:hover {
  transform: translateY(-2px);
}

.swatch:focus-visible {
  outline: none;
}

.swatch__color {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-md);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08), var(--shadow-xs);
  overflow: hidden;
  background-color: var(--surface-muted);
}

/* Checkerboard for transparency */
.swatch__color--checker {
  background-image:
    linear-gradient(45deg, #d1d5db 25%, transparent 25%),
    linear-gradient(-45deg, #d1d5db 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #d1d5db 75%),
    linear-gradient(-45deg, transparent 75%, #d1d5db 75%);
  background-size: 12px 12px;
  background-position: 0 0, 0 6px, 6px -6px, -6px 0px;
  background-color: #f3f4f6;
}

.swatch__fill {
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.swatch__label {
  font-size: var(--fs-xs);
  font-family: var(--font-mono);
  font-weight: var(--fw-medium);
  color: var(--text-secondary);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  padding: 0 var(--space-1);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.swatch__actions {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  display: flex;
  gap: 2px;
  opacity: 0;
  transition: opacity var(--duration-fast) var(--ease-out);
}

.swatch:hover .swatch__actions,
.swatch:focus-within .swatch__actions {
  opacity: 1;
}

.swatch__action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: var(--radius-sm);
  background-color: rgba(255, 255, 255, 0.9);
  color: var(--neutral-800);
  backdrop-filter: blur(4px);
  box-shadow: var(--shadow-xs);
  transition: background-color var(--duration-fast) var(--ease-out);
}

.swatch__action:hover {
  background-color: rgba(255, 255, 255, 1);
}

.swatch__action svg {
  width: 0.875rem;
  height: 0.875rem;
}

.swatch--sm .swatch__color { aspect-ratio: 1 / 1; }
.swatch--lg .swatch__color { aspect-ratio: 4 / 3; }
.swatch--auto .swatch__color { aspect-ratio: auto; min-height: 5rem; }

/* --------------------------------------------------------------------------
   11. COPY BUTTON
   -------------------------------------------------------------------------- */
.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  color: var(--text-secondary);
  background-color: var(--surface-muted);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition:
    background-color var(--duration-fast) var(--ease-out),
    border-color var(--duration-fast) var(--ease-out),
    color var(--duration-fast) var(--ease-out);
  white-space: nowrap;
}

.copy-btn:hover {
  background-color: var(--surface-sunken);
  border-color: var(--border-default);
  color: var(--text-primary);
}

.copy-btn.is-copied {
  background-color: var(--success-50);
  border-color: var(--success-500);
  color: var(--success-700);
}

.copy-btn svg {
  width: 0.875rem;
  height: 0.875rem;
  flex-shrink: 0;
}

.copy-btn__label {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   12. TABLE
   -------------------------------------------------------------------------- */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  background-color: var(--surface-raised);
  -webkit-overflow-scrolling: touch;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
}

.table th,
.table td {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

.table th {
  background-color: var(--surface-sunken);
  font-weight: var(--fw-semibold);
  color: var(--text-primary);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: var(--ls-wide);
  white-space: nowrap;
}

.table tr:last-child td {
  border-bottom: none;
}

.table tbody tr:hover {
  background-color: var(--surface-sunken);
}

.table td code {
  font-size: 0.8125rem;
}

/* --------------------------------------------------------------------------
   13. PROGRESS BAR
   -------------------------------------------------------------------------- */
.progress {
  width: 100%;
  height: 0.5rem;
  background-color: var(--surface-muted);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress__bar {
  height: 100%;
  background-color: var(--brand-primary);
  border-radius: inherit;
  transition: width var(--duration-normal) var(--ease-out);
}

.progress--lg {
  height: 0.75rem;
}

.progress--sm {
  height: 0.375rem;
}

/* --------------------------------------------------------------------------
   14. SPINNER / LOADER
   -------------------------------------------------------------------------- */
.spinner {
  display: inline-block;
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid var(--border-default);
  border-top-color: var(--brand-primary);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

.spinner--sm { width: 1rem; height: 1rem; border-width: 2px; }
.spinner--lg { width: 2rem; height: 2rem; border-width: 3px; }

/* --------------------------------------------------------------------------
   15. EMPTY STATE
   -------------------------------------------------------------------------- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--space-10) var(--space-6);
  color: var(--text-tertiary);
}

.empty-state__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 4rem;
  height: 4rem;
  margin-bottom: var(--space-4);
  border-radius: 50%;
  background-color: var(--surface-muted);
  color: var(--text-tertiary);
}

.empty-state__icon svg {
  width: 2rem;
  height: 2rem;
}

.empty-state__title {
  font-size: var(--fs-lg);
  font-weight: var(--fw-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.empty-state__text {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  max-width: 24rem;
  margin-bottom: var(--space-5);
}

/* --------------------------------------------------------------------------
   16. TOOLTIP
   -------------------------------------------------------------------------- */
.tooltip-wrap {
  position: relative;
  display: inline-flex;
}

.tooltip {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  padding: var(--space-2) var(--space-3);
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  line-height: 1.3;
  color: var(--neutral-0);
  background-color: var(--neutral-900);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--duration-fast) var(--ease-out),
    visibility var(--duration-fast) var(--ease-out);
  z-index: var(--z-tooltip);
}

.tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--neutral-900);
}

.tooltip-wrap:hover .tooltip,
.tooltip-wrap:focus-within .tooltip {
  opacity: 1;
  visibility: visible;
}

/* --------------------------------------------------------------------------
   17. CODE BLOCK
   -------------------------------------------------------------------------- */
.code-block {
  position: relative;
  background-color: var(--surface-code);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.code-block__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--border-subtle);
  background-color: var(--surface-sunken);
}

.code-block__lang {
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: var(--ls-wide);
  font-family: var(--font-mono);
}

.code-block__copy {
  font-size: var(--fs-xs);
}

.code-block pre {
  margin: 0;
  padding: var(--space-4);
  border: none;
  border-radius: 0;
  background: transparent;
  font-size: var(--fs-sm);
  line-height: var(--lh-relaxed);
  overflow-x: auto;
}

.code-block pre code {
  background: none;
  padding: 0;
  font-size: inherit;
  color: inherit;
}

/* --------------------------------------------------------------------------
   18. PAGINATION
   -------------------------------------------------------------------------- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  flex-wrap: wrap;
  margin-top: var(--space-8);
}

.pagination__item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  height: 2.25rem;
  padding: 0 var(--space-3);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--text-secondary);
  background-color: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  text-decoration: none;
  transition:
    background-color var(--duration-fast) var(--ease-out),
    border-color var(--duration-fast) var(--ease-out),
    color var(--duration-fast) var(--ease-out);
}

.pagination__item:hover {
  background-color: var(--surface-muted);
  color: var(--text-primary);
}

.pagination__item[aria-current="page"] {
  background-color: var(--brand-primary);
  color: var(--neutral-0);
  font-weight: var(--fw-semibold);
}

.pagination__item--disabled {
  opacity: 0.4;
  pointer-events: none;
}

.pagination__ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  height: 2.25rem;
  color: var(--text-tertiary);
}

/* --------------------------------------------------------------------------
   19. FAQ / DETAILS-SUMMARY
   -------------------------------------------------------------------------- */
.faq {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.faq__item {
  background-color: var(--surface-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 0;
}

.faq__item summary {
  list-style: none;
  cursor: pointer;
  padding: var(--space-4) var(--space-5);
  font-size: var(--fs-base);
  font-weight: var(--fw-semibold);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  border-radius: inherit;
}

.faq__item summary::-webkit-details-marker {
  display: none;
}

.faq__item[open] summary {
  border-bottom: 1px solid var(--border-subtle);
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.faq__item summary::after {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-right: 2px solid var(--text-tertiary);
  border-bottom: 2px solid var(--text-tertiary);
  transform: rotate(45deg);
  transition: transform var(--duration-normal) var(--ease-out);
  flex-shrink: 0;
  margin-top: -3px;
}

.faq__item[open] summary::after {
  transform: rotate(-135deg);
  margin-top: 3px;
}

.faq__answer {
  padding: var(--space-4) var(--space-5);
  font-size: var(--fs-sm);
  line-height: var(--lh-relaxed);
  color: var(--text-secondary);
}

.faq__answer p + p {
  margin-top: var(--space-3);
}

/* --------------------------------------------------------------------------
   20. STEPPER / NUMBERED LIST
   -------------------------------------------------------------------------- */
.stepper {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  counter-reset: step;
}

.stepper__item {
  display: flex;
  gap: var(--space-4);
  counter-increment: step;
}

.stepper__item::before {
  content: counter(step);
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background-color: var(--brand-primary-soft);
  color: var(--brand-primary);
  font-weight: var(--fw-semibold);
  font-size: var(--fs-sm);
  font-family: var(--font-mono);
}

.stepper__content {
  flex: 1;
  min-width: 0;
  padding-top: 0.125rem;
}

.stepper__title {
  font-size: var(--fs-base);
  font-weight: var(--fw-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-1);
}

.stepper__text {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  line-height: var(--lh-relaxed);
}

/* --------------------------------------------------------------------------
   21. STAT
   -------------------------------------------------------------------------- */
.stat {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.stat__value {
  font-size: clamp(1.5rem, 2vw + 1rem, 2rem);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-tight);
  color: var(--text-primary);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.stat__label {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
}

/* --------------------------------------------------------------------------
   22. COMPARISON / CONTRAST BOX
   -------------------------------------------------------------------------- */
.contrast-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-subtle);
  text-align: center;
  min-height: 6rem;
  overflow: hidden;
}

.contrast-box__label {
  font-size: var(--fs-xl);
  font-weight: var(--fw-semibold);
  margin-bottom: var(--space-2);
}

.contrast-box__meta {
  font-size: var(--fs-xs);
  opacity: 0.8;
  font-family: var(--font-mono);
}

/* --------------------------------------------------------------------------
   23. KEYBOARD HINT
   -------------------------------------------------------------------------- */
.kbd-hint {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 2px 6px;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: var(--fw-medium);
  color: var(--text-tertiary);
  background-color: var(--surface-base);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  line-height: 1;
}

/* --------------------------------------------------------------------------
   24. AVATAR
   -------------------------------------------------------------------------- */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background-color: var(--brand-primary-soft);
  color: var(--brand-primary);
  font-weight: var(--fw-semibold);
  font-size: var(--fs-sm);
  overflow: hidden;
  flex-shrink: 0;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar--sm { width: 1.75rem; height: 1.75rem; font-size: var(--fs-xs); }
.avatar--lg { width: 3rem; height: 3rem; font-size: var(--fs-base); }

/* --------------------------------------------------------------------------
   25. CTA BANNER
   -------------------------------------------------------------------------- */
.cta-banner {
  position: relative;
  padding: var(--space-10) var(--space-6);
  border-radius: var(--radius-2xl);
  background: var(--gradient-brand);
  color: var(--neutral-0);
  text-align: center;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.cta-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.15), transparent 55%),
    radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.1), transparent 55%);
  pointer-events: none;
}

.cta-banner__title {
  position: relative;
  font-size: clamp(1.5rem, 2.5vw + 1rem, 2.25rem);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-tighter);
  color: var(--neutral-0);
  margin-bottom: var(--space-3);
  line-height: var(--lh-tight);
}

.cta-banner__text {
  position: relative;
  font-size: var(--fs-base);
  line-height: var(--lh-relaxed);
  color: rgba(255, 255, 255, 0.9);
  max-width: 34rem;
  margin-inline: auto;
  margin-bottom: var(--space-6);
}

.cta-banner__actions {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  justify-content: center;
}

.cta-banner .btn--primary {
  background-color: var(--neutral-0);
  color: var(--brand-primary);
}

.cta-banner .btn--primary:hover {
  background-color: var(--neutral-100);
  color: var(--brand-primary-hover);
}

.cta-banner .btn--outline {
  border-color: rgba(255, 255, 255, 0.5);
  color: var(--neutral-0);
  background-color: rgba(255, 255, 255, 0.06);
}

.cta-banner .btn--outline:hover {
  background-color: rgba(255, 255, 255, 0.14);
  color: var(--neutral-0);
  border-color: var(--neutral-0);
}

/* --------------------------------------------------------------------------
   26. FEATURE LIST
   -------------------------------------------------------------------------- */
.feature-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.feature-list__item {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  font-size: var(--fs-sm);
  line-height: var(--lh-relaxed);
  color: var(--text-secondary);
}

.feature-list__icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  background-color: var(--success-100);
  color: var(--success-700);
  margin-top: 2px;
}

.feature-list__icon svg {
  width: 0.75rem;
  height: 0.75rem;
}

/* --------------------------------------------------------------------------
   27. SEPARATOR WITH LABEL
   -------------------------------------------------------------------------- */
.sep-label {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--text-tertiary);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: var(--ls-wider);
  font-weight: var(--fw-medium);
}

.sep-label::before,
.sep-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background-color: var(--border-subtle);
}

/* --------------------------------------------------------------------------
   28. TAG LIST
   -------------------------------------------------------------------------- */
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

/* --------------------------------------------------------------------------
   29. METRIC ROW
   -------------------------------------------------------------------------- */
.metric-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: var(--fs-sm);
}

.metric-row:last-child {
  border-bottom: none;
}

.metric-row__label {
  color: var(--text-secondary);
}

.metric-row__value {
  font-family: var(--font-mono);
  font-weight: var(--fw-medium);
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------------------
   30. LIBRARY GRID ITEM
   -------------------------------------------------------------------------- */
.lib-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  background-color: var(--surface-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: inherit;
  transition:
    border-color var(--duration-fast) var(--ease-out),
    box-shadow var(--duration-fast) var(--ease-out),
    transform var(--duration-fast) var(--ease-out);
}

.lib-item:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
  color: inherit;
}

.lib-item__swatch {
  flex-shrink: 0;
  width: 3rem;
  height: 3rem;
  border-radius: var(--radius-md);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.lib-item__info {
  flex: 1;
  min-width: 0;
}

.lib-item__name {
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--text-primary);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lib-item__value {
  font-size: var(--fs-xs);
  font-family: var(--font-mono);
  color: var(--text-tertiary);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   31. QUOTE / BLOCKQUOTE
   -------------------------------------------------------------------------- */
.quote {
  padding: var(--space-4) var(--space-5);
  border-left: 3px solid var(--brand-primary);
  background-color: var(--surface-sunken);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-size: var(--fs-md);
  line-height: var(--lh-relaxed);
  color: var(--text-primary);
  font-style: italic;
}

.quote__cite {
  display: block;
  margin-top: var(--space-3);
  font-size: var(--fs-sm);
  font-style: normal;
  color: var(--text-tertiary);
}

/* --------------------------------------------------------------------------
   32. NAV PILLS (horizontal scroll)
   -------------------------------------------------------------------------- */
.nav-pills {
  display: flex;
  gap: var(--space-2);
  overflow-x: auto;
  padding-bottom: var(--space-1);
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.nav-pills::-webkit-scrollbar { display: none; }

.nav-pills__item {
  flex: 0 0 auto;
  padding: var(--space-2) var(--space-4);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--text-secondary);
  background-color: var(--surface-muted);
  border: 1px solid transparent;
  border-radius: var(--radius-full);
  cursor: pointer;
  white-space: nowrap;
  transition:
    color var(--duration-fast) var(--ease-out),
    background-color var(--duration-fast) var(--ease-out),
    border-color var(--duration-fast) var(--ease-out);
}

.nav-pills__item:hover {
  color: var(--text-primary);
  background-color: var(--surface-sunken);
}

.nav-pills__item[aria-selected="true"],
.nav-pills__item.is-active {
  color: var(--brand-primary);
  background-color: var(--brand-primary-soft);
  border-color: var(--brand-primary-soft);
}

/* --------------------------------------------------------------------------
   33. TOOLBAR
   -------------------------------------------------------------------------- */
.toolbar {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  padding: var(--space-3) 0;
}

.toolbar__group {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.toolbar__spacer {
  flex: 1;
}

/* --------------------------------------------------------------------------
   34. PRESET BUTTON
   -------------------------------------------------------------------------- */
.preset-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  color: var(--text-secondary);
  background-color: var(--surface-raised);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition:
    border-color var(--duration-fast) var(--ease-out),
    background-color var(--duration-fast) var(--ease-out),
    color var(--duration-fast) var(--ease-out);
  white-space: nowrap;
}

.preset-btn:hover {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
}

.preset-btn__chip {
  width: 0.875rem;
  height: 0.875rem;
  border-radius: var(--radius-xs);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
  flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   35. LIST (definition / description)
   -------------------------------------------------------------------------- */
.def-list {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: var(--space-2) var(--space-5);
  font-size: var(--fs-sm);
}

.def-list dt {
  font-weight: var(--fw-semibold);
  color: var(--text-primary);
}

.def-list dd {
  color: var(--text-secondary);
  line-height: var(--lh-relaxed);
}

@media (max-width: 30rem) {
  .def-list {
    grid-template-columns: 1fr;
    gap: var(--space-1);
  }
  .def-list dd {
    margin-bottom: var(--space-2);
  }
}

/* --------------------------------------------------------------------------
   36. RATING / SCORE
   -------------------------------------------------------------------------- */
.score {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-weight: var(--fw-semibold);
}

.score--pass {
  color: var(--success-700);
}

.score--fail {
  color: var(--danger-700);
}

.score__value {
  font-size: var(--fs-sm);
  font-variant-numeric: tabular-nums;
}

.score__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.125rem;
  height: 1.125rem;
  border-radius: 50%;
  background-color: currentColor;
  color: var(--neutral-0);
  font-size: 0.625rem;
}

/* --------------------------------------------------------------------------
   37. CHECKERBOARD BACKGROUND (transparency preview)
   -------------------------------------------------------------------------- */
.checkerboard {
  background-image:
    linear-gradient(45deg, #cfd4dc 25%, transparent 25%),
    linear-gradient(-45deg, #cfd4dc 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #cfd4dc 75%),
    linear-gradient(-45deg, transparent 75%, #cfd4dc 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0px;
  background-color: #f3f4f6;
}

[data-theme="dark"] .checkerboard {
  background-image:
    linear-gradient(45deg, #2a3446 25%, transparent 25%),
    linear-gradient(-45deg, #2a3446 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #2a3446 75%),
    linear-gradient(-45deg, transparent 75%, #2a3446 75%);
  background-color: #1a2231;
}

/* --------------------------------------------------------------------------
   38. LOADING BUTTON STATE
   -------------------------------------------------------------------------- */
.btn.is-loading {
  pointer-events: none;
  color: transparent !important;
  position: relative;
}

.btn.is-loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1rem;
  height: 1rem;
  margin: -0.5rem 0 0 -0.5rem;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
  color: var(--btn-fg);
}

/* --------------------------------------------------------------------------
   39. MOBILE TAP TARGETS
   -------------------------------------------------------------------------- */
@media (max-width: 47.99rem) {
  .btn,
  .icon-button,
  .chip,
  .nav-pills__item,
  .preset-btn {
    min-height: 2.5rem;
  }

  .icon-button {
    min-width: 2.5rem;
  }
}

/* --------------------------------------------------------------------------
   40. PRINT
   -------------------------------------------------------------------------- */
@media print {
  .btn,
  .chip,
  .tabs__list,
  .pagination,
  .toast-container,
  .modal,
  .search-overlay,
  .mobile-drawer {
    display: none !important;
  }

  .card,
  .accordion__item,
  .faq__item {
    box-shadow: none !important;
    border: 1px solid #d1d5db !important;
    page-break-inside: avoid;
  }
}

/* --------------------------------------------------------------------------
   END OF FILE
   -------------------------------------------------------------------------- */