/* ============================================================
   ATTIO — COMPONENTS
   Buttons, badges, forms, cards, modals, menus, tables.
   Signature: tight tracking, whisper shadows, soft blue accent.
   ============================================================ */

/* ---------- BUTTON ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: var(--font-sans);
  font-weight: var(--fw-semibold);
  font-size: var(--text-sm);
  line-height: 1;
  letter-spacing: var(--ls-sm);
  border: 1px solid transparent;
  border-radius: var(--radius-lg);
  padding: 0 var(--space-4);
  height: 36px;
  cursor: pointer;
  transition:
    background var(--dur-fast) var(--ease-out),
    border-color var(--dur-fast) var(--ease-out),
    color var(--dur-fast),
    box-shadow var(--dur-fast),
    transform var(--dur-fast) var(--ease-out);
  white-space: nowrap;
}
.btn:focus-visible { outline: none; box-shadow: var(--ring-focus); }
.btn:active { transform: translateY(0.5px); }

.btn-sm { height: 28px; padding: 0 var(--space-3); font-size: var(--text-xs); border-radius: var(--radius-md); }
.btn-md { height: 36px; }
.btn-lg { height: 44px; padding: 0 var(--space-5); font-size: var(--text-base); }

/* Primary — black pill in light, white in dark */
.btn-primary {
  background: var(--black-100);
  color: var(--white-100);
  border-color: var(--black-100);
  box-shadow: var(--shadow-layer-2), inset 0 1px 0 rgba(255,255,255,0.08);
}
.btn-primary:hover { background: var(--black-300); border-color: var(--black-300); }
.btn-primary:active { background: var(--black-400); }
.btn-primary:disabled { background: var(--white-700); border-color: var(--white-700); color: var(--white-100); cursor: not-allowed; box-shadow: none; }

/* Accent — Attio blue */
.btn-accent {
  background: var(--blue-500);
  color: var(--white-100);
  border-color: var(--blue-500);
  box-shadow: var(--shadow-layer-2), inset 0 1px 0 rgba(255,255,255,0.18);
}
.btn-accent:hover { background: var(--blue-600); border-color: var(--blue-600); }

/* Secondary — bordered white surface */
.btn-secondary {
  background: var(--color-surface);
  color: var(--color-text-primary);
  border-color: var(--color-stroke-default);
  box-shadow: var(--shadow-layer-1);
}
.btn-secondary:hover { background: var(--color-surface-hover); border-color: var(--color-stroke-strong); }

/* Ghost — no border */
.btn-ghost {
  background: transparent;
  color: var(--color-text-secondary);
}
.btn-ghost:hover { background: var(--color-surface-hover); color: var(--color-text-primary); }

/* Danger */
.btn-danger {
  background: var(--red-500);
  color: #fff;
  border-color: var(--red-500);
}
.btn-danger:hover { background: var(--red-600); border-color: var(--red-600); }

/* Link-style */
.btn-link {
  background: transparent;
  color: var(--color-accent);
  border: none;
  padding: 0;
  height: auto;
  font-weight: var(--fw-semibold);
}
.btn-link:hover { color: var(--color-accent-hover); }

/* Icon only */
.btn-icon {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text-tertiary);
  border: 1px solid var(--color-stroke-default);
}
.btn-icon:hover { background: var(--color-surface-hover); color: var(--color-text-primary); }

/* ---------- BADGE ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-sm);
  border: 1px solid;
  line-height: 1.3;
  white-space: nowrap;
}
.badge-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
}
.badge-success { color: var(--color-success-fg); background: var(--color-success-bg); border-color: var(--color-success-border); }
.badge-info    { color: var(--blue-600);         background: var(--blue-100);         border-color: var(--blue-200); }
.badge-warn    { color: var(--color-warn-fg);    background: var(--color-warn-bg);    border-color: var(--color-warn-border); }
.badge-danger  { color: var(--color-danger-fg);  background: var(--color-danger-bg);  border-color: var(--color-danger-border); }
.badge-neutral { color: var(--color-text-secondary); background: var(--color-surface-sunken); border-color: var(--color-stroke-default); }

/* Tag — mono, tiny, data-flavored */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  background: var(--color-surface-sunken);
  color: var(--color-text-tertiary);
  border: 1px solid var(--color-stroke-default);
  line-height: 1.4;
  font-weight: var(--fw-medium);
}
.tag-accent { color: var(--blue-600); background: var(--blue-100); border-color: var(--blue-200); }

/* ---------- INPUT / FORM ---------- */
.field-label {
  display: block;
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-2);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-sm);
}
.field-help {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: var(--space-2);
  line-height: 1.5;
}
.input, .select, .textarea {
  width: 100%;
  background: var(--color-surface);
  border: 1px solid var(--color-stroke-default);
  border-radius: var(--radius-md);
  color: var(--color-text-primary);
  font-family: inherit;
  font-size: var(--text-sm);
  font-weight: var(--fw-medium);
  letter-spacing: var(--ls-sm);
  padding: 0 var(--space-3);
  height: 36px;
  box-shadow: var(--shadow-layer-1);
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast), background var(--dur-fast);
}
.textarea { padding: var(--space-3); height: auto; min-height: 96px; line-height: var(--lh-base); }
.input::placeholder, .textarea::placeholder { color: var(--color-text-subtle); font-weight: var(--fw-medium); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--color-stroke-strong); }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--blue-400);
  box-shadow: var(--ring-focus);
}
.input:disabled { background: var(--color-surface-sunken); color: var(--color-text-muted); cursor: not-allowed; }

.input-group {
  display: flex;
  align-items: center;
  background: var(--color-surface);
  border: 1px solid var(--color-stroke-default);
  border-radius: var(--radius-md);
  padding-left: var(--space-3);
  gap: var(--space-2);
  box-shadow: var(--shadow-layer-1);
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.input-group svg { color: var(--color-text-muted); flex-shrink: 0; }
.input-group .input {
  border: none; box-shadow: none;
  background: transparent;
  padding-left: 0;
  height: 34px;
}
.input-group:focus-within {
  border-color: var(--blue-400);
  box-shadow: var(--ring-focus);
}

/* Checkbox */
.checkbox {
  appearance: none;
  width: 16px; height: 16px;
  border: 1px solid var(--color-stroke-strong);
  background: var(--color-surface);
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: grid; place-items: center;
  flex-shrink: 0;
  transition: background var(--dur-fast), border-color var(--dur-fast);
}
.checkbox:hover { border-color: var(--color-text-muted); }
.checkbox:checked {
  background: var(--blue-500);
  border-color: var(--blue-500);
}
.checkbox:checked::after {
  content: '';
  width: 9px; height: 5px;
  border-left: 1.5px solid #fff;
  border-bottom: 1.5px solid #fff;
  transform: rotate(-45deg) translate(1px, -1px);
}

/* Radio */
.radio {
  appearance: none;
  width: 16px; height: 16px;
  border: 1px solid var(--color-stroke-strong);
  background: var(--color-surface);
  border-radius: 50%;
  cursor: pointer;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.radio:checked { border-color: var(--blue-500); border-width: 4px; }

/* Switch */
.switch {
  appearance: none;
  width: 32px; height: 18px;
  background: var(--color-stroke-strong);
  border-radius: var(--radius-pill);
  position: relative;
  cursor: pointer;
  transition: background var(--dur-fast);
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.06);
}
.switch::after {
  content: '';
  position: absolute; top: 2px; left: 2px;
  width: 14px; height: 14px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 2px rgba(0,0,0,0.15);
  transition: transform var(--dur-fast) var(--ease-out);
}
.switch:checked { background: var(--blue-500); }
.switch:checked::after { transform: translateX(14px); }

/* Field row */
.field-row { display: flex; align-items: center; gap: var(--space-3); font-size: var(--text-sm); color: var(--color-text-secondary); font-weight: var(--fw-medium); }

/* ---------- CARD ---------- */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-stroke-default);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  box-shadow: var(--shadow-layer-1);
  transition: border-color var(--dur-base) var(--ease-out), box-shadow var(--dur-base), transform var(--dur-base);
}
.card:hover {
  border-color: var(--color-stroke-strong);
  box-shadow: var(--shadow-layer-1), var(--shadow-layer-3);
}
.card-title {
  font-family: var(--font-display);
  color: var(--color-text-primary);
  font-size: var(--text-base);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-sm);
  margin: 0 0 var(--space-2);
}
.card-body {
  font-size: var(--text-sm);
  color: var(--color-text-tertiary);
  line-height: 1.55;
  margin: 0;
}
.card-feature {
  background: var(--color-surface);
  border: 1px solid var(--color-stroke-default);
  border-radius: var(--radius-2xl);
  padding: var(--space-6);
  box-shadow: var(--shadow-card);
}
.card-feature-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: var(--ls-caps);
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: var(--space-3);
  font-weight: var(--fw-medium);
}
.card-feature-title {
  font-family: var(--font-display);
  color: var(--color-text-primary);
  font-size: var(--text-xl);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-md);
  margin: 0 0 var(--space-2);
}

/* ---------- TOPBAR ---------- */
.topbar {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  padding: var(--space-2) var(--space-4);
  background: var(--color-surface);
  border: 1px solid var(--color-stroke-default);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-card);
  height: 52px;
}
.topbar-brand {
  display: flex; align-items: center; gap: var(--space-2);
  color: var(--color-text-primary);
  font-family: var(--font-display);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-md);
}
.topbar-brand .mark {
  width: 22px; height: 22px;
  background: var(--black-100);
  color: #fff;
  border-radius: 6px;
  display: grid; place-items: center;
  font-size: 12px;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
}
.topbar-brand .brand-logo {
  width: 28px; height: 28px;
  object-fit: contain;
  display: block;
}
.topbar-brand .brand-by {
  font-family: var(--font-mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--color-text-muted);
  background: var(--color-surface-sunken);
  border: 1px solid var(--color-stroke-default);
  border-radius: var(--radius-pill);
  padding: 2px 7px;
  font-weight: 500;
  white-space: nowrap;
}
.topbar-links {
  display: flex; gap: var(--space-1);
  margin-left: var(--space-2);
}
.topbar-link {
  padding: 6px var(--space-3);
  border-radius: var(--radius-md);
  color: var(--color-text-tertiary);
  font-size: var(--text-sm);
  font-weight: var(--fw-medium);
  display: inline-flex; align-items: center; gap: 4px;
  cursor: pointer;
  transition: color var(--dur-fast), background var(--dur-fast);
}
.topbar-link:hover { color: var(--color-text-primary); background: var(--color-surface-hover); }
.topbar-link.active,
.topbar-link[aria-current="page"] {
  color: var(--color-text-primary);
  background: var(--color-accent-soft-bg);
  border: 1px solid var(--color-accent-soft-border);
  font-weight: var(--fw-semibold);
}
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: var(--space-2); }

/* Theme toggle button */
.btn-theme-toggle {
  width: 32px; height: 32px;
  border: 1px solid var(--color-stroke-default);
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  display: grid; place-items: center;
  flex-shrink: 0;
  transition: background var(--dur-fast), color var(--dur-fast), border-color var(--dur-fast);
}
.btn-theme-toggle:hover {
  background: var(--color-surface-hover);
  color: var(--color-text-primary);
  border-color: var(--color-stroke-strong);
}
.btn-theme-toggle .icon-sun  { display: none; }
.btn-theme-toggle .icon-moon { display: block; }
[data-theme="dark"] .btn-theme-toggle .icon-sun  { display: block; }
[data-theme="dark"] .btn-theme-toggle .icon-moon { display: none; }

/* Dark mode topbar — increase contrast against near-black page background */
[data-theme="dark"] .topbar {
  background: var(--black-300);
  border-color: var(--black-500);
  box-shadow: 0 2px 12px rgba(0,0,0,0.55), 0 1px 3px rgba(0,0,0,0.40);
}

/* Tabs */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--color-stroke-subtle);
}
.tab {
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  color: var(--color-text-tertiary);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  transition: color var(--dur-fast), border-color var(--dur-fast);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-sm);
}
.tab:hover { color: var(--color-text-primary); }
.tab.active { color: var(--color-text-primary); border-bottom-color: var(--color-text-primary); }

/* Product sidebar */
.prod-sidebar {
  background: var(--color-surface);
  border: 1px solid var(--color-stroke-default);
  border-radius: var(--radius-xl);
  padding: var(--space-2);
  min-width: 220px;
  box-shadow: var(--shadow-layer-1);
}
.prod-sidebar .section-label {
  font-family: var(--font-sans);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: var(--ls-caps);
  color: var(--color-text-muted);
  padding: var(--space-2) var(--space-3) 4px;
  font-weight: var(--fw-semibold);
}
.prod-nav-item {
  display: flex; align-items: center; gap: var(--space-2);
  padding: 6px var(--space-3);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  color: var(--color-text-tertiary);
  cursor: pointer;
  font-weight: var(--fw-medium);
}
.prod-nav-item:hover { background: var(--color-surface-hover); color: var(--color-text-primary); }
.prod-nav-item.active { background: var(--color-accent-soft-bg); color: var(--color-accent); }

/* ---------- MODAL / DIALOG ---------- */
.modal-demo-wrap {
  position: relative;
  padding: var(--space-12) var(--space-6);
  background: var(--color-surface-sunken);
  border: 1px solid var(--color-stroke-default);
  border-radius: var(--radius-xl);
  overflow: hidden;
}
.modal-demo-wrap::before {
  content: '';
  position: absolute; inset: 0;
  background: rgba(35, 37, 41, 0.04);
  backdrop-filter: blur(1px);
}
.modal {
  position: relative;
  max-width: 440px;
  margin: 0 auto;
  background: var(--color-surface);
  border: 1px solid var(--color-stroke-default);
  border-radius: var(--radius-2xl);
  padding: var(--space-5);
  box-shadow: var(--shadow-modal);
}
.modal-title {
  font-family: var(--font-display);
  color: var(--color-text-primary);
  font-size: var(--text-lg);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-sm);
  margin: 0 0 var(--space-2);
}
.modal-body {
  color: var(--color-text-tertiary);
  font-size: var(--text-sm);
  margin: 0 0 var(--space-5);
  line-height: 1.55;
}
.modal-actions {
  display: flex; justify-content: flex-end; gap: var(--space-2);
}

/* Tooltip — inverted (dark on light page) */
.tooltip {
  display: inline-block;
  padding: 6px 10px;
  background: var(--black-200);
  color: #fff;
  border-radius: var(--radius-md);
  font-size: var(--text-xs);
  font-weight: var(--fw-medium);
  letter-spacing: var(--ls-sm);
  box-shadow: var(--shadow-popover);
  position: relative;
}
.tooltip::after {
  content: '';
  position: absolute; bottom: -4px; left: 50%; transform: translateX(-50%) rotate(45deg);
  width: 8px; height: 8px; background: var(--black-200);
}

/* Toast */
.toast {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface);
  border: 1px solid var(--color-stroke-default);
  border-radius: var(--radius-lg);
  color: var(--color-text-primary);
  font-size: var(--text-sm);
  font-weight: var(--fw-medium);
  box-shadow: var(--shadow-popover);
  min-width: 320px;
}
.toast-icon {
  width: 20px; height: 20px;
  border-radius: 50%;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.toast-close {
  margin-left: auto;
  color: var(--color-text-muted);
  cursor: pointer;
  background: none; border: none;
  padding: 2px;
}

/* ---------- DROPDOWN ---------- */
.dropdown {
  background: var(--color-surface);
  border: 1px solid var(--color-stroke-default);
  border-radius: var(--radius-xl);
  padding: var(--space-1);
  box-shadow: var(--shadow-popover);
  min-width: 260px;
}
.dropdown-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--dur-fast);
}
.dropdown-item:hover { background: var(--color-surface-hover); }
.dropdown-item .icon-slot {
  width: 28px; height: 28px;
  border-radius: var(--radius-md);
  background: var(--color-surface-sunken);
  border: 1px solid var(--color-stroke-subtle);
  display: grid; place-items: center;
  color: var(--color-text-tertiary);
  flex-shrink: 0;
}
.dropdown-item-title {
  color: var(--color-text-primary);
  font-size: var(--text-sm);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-sm);
  display: flex; align-items: center; gap: var(--space-2);
}
.dropdown-item-desc {
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  margin-top: 2px;
  line-height: 1.5;
}

/* ---------- DATA TABLE ---------- */
.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: var(--text-sm);
  background: var(--color-surface);
  border: 1px solid var(--color-stroke-default);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-layer-1);
}
.data-table thead th {
  text-align: left;
  padding: var(--space-3) var(--space-4);
  font-weight: var(--fw-semibold);
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: var(--ls-caps);
  background: var(--color-surface-sunken);
  border-bottom: 1px solid var(--color-stroke-default);
}
.data-table tbody td {
  padding: var(--space-3) var(--space-4);
  color: var(--color-text-secondary);
  border-bottom: 1px solid var(--color-stroke-subtle);
  font-weight: var(--fw-medium);
}
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: var(--color-surface-sunken); }

/* Attio-style record row: avatar + name + mono id */
.record-row {
  display: flex; align-items: center; gap: var(--space-3);
}
.record-avatar {
  width: 24px; height: 24px;
  border-radius: var(--radius-md);
  background: var(--blue-100);
  color: var(--blue-600);
  display: grid; place-items: center;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: var(--fw-semibold);
  flex-shrink: 0;
  border: 1px solid var(--blue-200);
}
.record-name {
  color: var(--color-text-primary);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-sm);
}

/* ---------- SWATCH / TOKEN CARDS ---------- */
.swatch-card {
  background: var(--color-surface);
  border: 1px solid var(--color-stroke-default);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-layer-1);
}
.swatch-preview {
  aspect-ratio: 16 / 9;
  border-bottom: 1px solid var(--color-stroke-subtle);
}
.swatch-meta {
  padding: var(--space-3) var(--space-4);
}
.swatch-name {
  color: var(--color-text-primary);
  font-size: var(--text-sm);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-sm);
  display: flex; align-items: center; justify-content: space-between;
}
.swatch-value {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--color-text-muted);
  margin-top: 4px;
}

.type-row {
  display: flex;
  align-items: baseline;
  gap: var(--space-8);
  padding: var(--space-5) 0;
  border-bottom: 1px solid var(--color-stroke-subtle);
}
.type-row:last-child { border-bottom: 0; }
.type-row .meta {
  flex-shrink: 0;
  width: 180px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--color-text-muted);
  letter-spacing: var(--ls-caps);
  text-transform: uppercase;
}
.type-row .sample {
  flex: 1;
  color: var(--color-text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-display);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-md);
}

/* ---------- ICON TILE ---------- */
.icon-tile {
  aspect-ratio: 1 / 1;
  background: var(--color-surface);
  border: 1px solid var(--color-stroke-default);
  border-radius: var(--radius-lg);
  display: grid;
  place-items: center;
  color: var(--color-text-tertiary);
  position: relative;
  transition: border-color var(--dur-fast), color var(--dur-fast), box-shadow var(--dur-fast);
  box-shadow: var(--shadow-layer-1);
}
.icon-tile:hover { border-color: var(--color-stroke-strong); color: var(--color-text-primary); box-shadow: var(--shadow-layer-2); }
.icon-tile .label {
  position: absolute; bottom: 4px; left: 0; right: 0;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--color-text-muted);
}

/* ---------- SPACING / RADIUS / ELEVATION DEMOS ---------- */
.spacing-demo {
  background: var(--color-surface);
  border: 1px solid var(--color-stroke-default);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  display: flex; align-items: center; gap: var(--space-4);
  box-shadow: var(--shadow-layer-1);
}
.spacing-bar {
  height: 24px;
  background: var(--blue-100);
  border: 1px solid var(--blue-200);
  border-radius: var(--radius-sm);
  position: relative;
}
.spacing-bar::before {
  content: attr(data-size);
  position: absolute;
  left: var(--space-2);
  top: 50%; transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--blue-600);
}
.spacing-label {
  flex-shrink: 0;
  width: 80px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--color-text-muted);
}

.radius-demo {
  aspect-ratio: 1.3;
  background: var(--color-surface);
  border: 1px solid var(--color-stroke-default);
  display: grid;
  place-items: end start;
  padding: var(--space-3);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--color-text-muted);
  box-shadow: var(--shadow-layer-1);
}

.shadow-demo {
  aspect-ratio: 1.5;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  display: grid;
  place-items: end start;
  padding: var(--space-3);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--color-text-muted);
  border: 1px solid var(--color-stroke-subtle);
}

/* ---------- LOGO GUIDANCE ---------- */
.logo-block {
  background: var(--color-surface);
  border: 1px solid var(--color-stroke-default);
  border-radius: var(--radius-xl);
  padding: var(--space-10);
  display: grid; place-items: center;
  aspect-ratio: 1.6;
  box-shadow: var(--shadow-layer-1);
}
.logo-block.inverse { background: var(--black-100); border-color: var(--black-300); }
.logo-block.inverse .brand-lockup { color: var(--white-100); }
.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--color-text-primary);
  font-family: var(--font-display);
  font-weight: var(--fw-semibold);
  font-size: 26px;
  letter-spacing: var(--ls-lg);
}
.brand-lockup .mark {
  width: 28px; height: 28px;
  background: currentColor;
  border-radius: 8px;
  position: relative;
}
.brand-lockup .mark::after {
  content: '';
  position: absolute; inset: 7px 7px auto auto;
  width: 10px; height: 10px;
  background: var(--color-surface);
  border-radius: 50%;
}
.logo-block.inverse .brand-lockup .mark::after { background: var(--black-100); }

/* ---------- Layout variants ---------- */
body[data-layout="single"] .app { grid-template-columns: 1fr; }
body[data-layout="single"] .sidebar { display: none; }
body[data-layout="single"] .main {
  max-width: 840px;
  margin: 0 auto;
  padding: var(--space-16) var(--space-8);
}

body[data-layout="twocol"] .app { grid-template-columns: 248px 1fr; }
body[data-layout="twocol"] .main {
  max-width: none;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: var(--space-16);
  padding: var(--space-12) var(--space-10);
}
body[data-layout="twocol"] .section { border-top: 1px solid var(--color-stroke-subtle); padding-top: var(--space-10); }
body[data-layout="twocol"] .section:first-of-type { border-top: 0; padding-top: 0; }
body[data-layout="twocol"] .aside-rail { display: block; }
body:not([data-layout="twocol"]) .aside-rail { display: none; }

.aside-rail {
  position: sticky;
  top: var(--space-8);
  align-self: start;
  font-size: var(--text-xs);
  color: var(--color-text-tertiary);
  border-left: 1px solid var(--color-stroke-subtle);
  padding-left: var(--space-4);
}
.aside-rail h4 {
  font-family: var(--font-sans);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: var(--ls-caps);
  color: var(--color-text-muted);
  margin: 0 0 var(--space-3);
  font-weight: var(--fw-semibold);
}
.aside-rail ul { list-style: none; padding: 0; margin: 0; }
.aside-rail li { padding: 4px 0; color: var(--color-text-tertiary); cursor: pointer; font-weight: var(--fw-medium); }
.aside-rail li:hover { color: var(--color-text-primary); }

/* ---------- Motion ---------- */
.fade-in { animation: fade-in 320ms var(--ease-out); }
@keyframes fade-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
