/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 36px; padding: 0 14px;
  font-size: 13px; font-weight: 500; white-space: nowrap;
  border-radius: var(--radius); border: 1px solid transparent;
  background: hsl(var(--primary)); color: hsl(var(--primary-foreground));
  transition: background var(--dur), color var(--dur), border-color var(--dur), box-shadow var(--dur), transform var(--dur), opacity var(--dur);
  user-select: none; -webkit-tap-highlight-color: transparent;
}
.btn:hover { background: hsl(var(--primary) / 0.9); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; pointer-events: none; }
.btn [data-icon] svg { width: 16px; height: 16px; }
.btn-secondary { background: hsl(var(--secondary)); color: hsl(var(--secondary-foreground)); }
.btn-secondary:hover { background: hsl(var(--secondary) / 0.8); }
.btn-outline { background: hsl(var(--background)); color: hsl(var(--foreground)); border-color: hsl(var(--border)); box-shadow: var(--shadow-sm); }
.btn-outline:hover { background: hsl(var(--accent)); }
.btn-ghost { background: transparent; color: hsl(var(--foreground)); }
.btn-ghost:hover { background: hsl(var(--accent)); }
.btn-destructive { background: hsl(var(--destructive)); color: hsl(var(--destructive-foreground)); }
.btn-destructive:hover { background: hsl(var(--destructive) / 0.9); }
.btn-success { background: hsl(var(--success)); color: hsl(var(--success-foreground)); }
.btn-success:hover { background: hsl(var(--success) / 0.9); }
.btn-link { background: transparent; color: hsl(var(--foreground)); text-decoration: underline; text-underline-offset: 3px; padding: 0; height: auto; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12px; border-radius: var(--radius-sm); }
.btn-lg { height: 44px; padding: 0 20px; font-size: 14px; }
.btn-xl { height: 52px; padding: 0 24px; font-size: 15px; border-radius: var(--radius-lg); }
.btn-icon { width: 36px; padding: 0; }
.btn-icon.btn-sm { width: 30px; }
.btn-icon.btn-lg { width: 44px; }
.btn-block { width: 100%; }

/* Inputs */
.input, .select, .textarea {
  display: flex; width: 100%; height: 36px; padding: 0 12px;
  font-size: 13px; background: hsl(var(--background)); color: hsl(var(--foreground));
  border: 1px solid hsl(var(--input)); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); transition: border-color var(--dur), box-shadow var(--dur);
  outline: none;
}
.input::placeholder, .textarea::placeholder { color: hsl(var(--muted-foreground)); }
.input:focus, .select:focus, .textarea:focus { border-color: hsl(var(--ring)); box-shadow: 0 0 0 3px hsl(var(--ring) / 0.15); }
.input:disabled, .select:disabled { opacity: 0.6; cursor: not-allowed; background: hsl(var(--muted)); }
.input-sm { height: 30px; font-size: 12px; padding: 0 10px; }
.input-lg { height: 44px; font-size: 15px; }
.textarea { height: auto; min-height: 80px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.select {
  appearance: none; padding-right: 32px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}
.input-group { position: relative; display: flex; align-items: center; }
.input-group > [data-icon] { position: absolute; left: 11px; color: hsl(var(--muted-foreground)); pointer-events: none; }
.input-group > .input { padding-left: 34px; }
.input-group > .input-suffix { position: absolute; right: 10px; color: hsl(var(--muted-foreground)); font-size: 12px; pointer-events: none; }
.input-group > .input-prefix { position: absolute; left: 11px; color: hsl(var(--muted-foreground)); font-size: 12px; pointer-events: none; }
.input-group.has-prefix > .input { padding-left: 38px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.label { font-size: 12px; font-weight: 500; color: hsl(var(--foreground)); }
.label .req { color: hsl(var(--destructive)); margin-left: 2px; }
.hint { font-size: 11px; color: hsl(var(--muted-foreground)); }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.form-grid .col-span-2 { grid-column: span 2; }
@media (max-width: 560px) { .form-grid { grid-template-columns: 1fr; } .form-grid .col-span-2 { grid-column: span 1; } }

/* Switch */
.switch { position: relative; display: inline-flex; width: 38px; height: 22px; flex-shrink: 0; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track { position: absolute; inset: 0; background: hsl(var(--input)); border-radius: 999px; transition: background var(--dur); }
.switch .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; background: hsl(var(--background)); border-radius: 50%; box-shadow: var(--shadow); transition: transform var(--dur) var(--ease); }
.switch input:checked + .track { background: hsl(var(--primary)); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { box-shadow: 0 0 0 3px hsl(var(--ring) / 0.2); }

/* Checkbox */
.checkbox { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; }
.checkbox input { appearance: none; width: 16px; height: 16px; border: 1px solid hsl(var(--primary)); border-radius: 4px; display: grid; place-content: center; margin: 0; cursor: pointer; }
.checkbox input::before { content: ""; width: 10px; height: 10px; transform: scale(0); transition: transform 120ms; background: hsl(var(--primary-foreground)); clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%); }
.checkbox input:checked { background: hsl(var(--primary)); }
.checkbox input:checked::before { transform: scale(1); }

/* Segmented / Tabs */
.segmented { display: inline-flex; padding: 3px; background: hsl(var(--muted)); border-radius: var(--radius); gap: 2px; }
.segmented button {
  padding: 0 12px; height: 28px; font-size: 12px; font-weight: 500; border-radius: var(--radius-sm);
  color: hsl(var(--muted-foreground)); transition: all var(--dur); white-space: nowrap; display: inline-flex; align-items: center; gap: 6px;
}
.segmented button:hover { color: hsl(var(--foreground)); }
.segmented button.active { background: hsl(var(--background)); color: hsl(var(--foreground)); box-shadow: var(--shadow-sm); }
.segmented.lg button { height: 36px; font-size: 13px; padding: 0 16px; }
.tabs { display: flex; gap: 0; border-bottom: 1px solid hsl(var(--border)); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  position: relative; padding: 10px 14px; font-size: 13px; font-weight: 500; color: hsl(var(--muted-foreground));
  white-space: nowrap; transition: color var(--dur); display: inline-flex; align-items: center; gap: 6px;
}
.tabs button:hover { color: hsl(var(--foreground)); }
.tabs button.active { color: hsl(var(--foreground)); }
.tabs button.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: hsl(var(--primary)); border-radius: 2px 2px 0 0; }
.tabs .count { font-size: 11px; padding: 1px 6px; background: hsl(var(--muted)); border-radius: 999px; color: hsl(var(--muted-foreground)); font-weight: 500; }
.tabs button.active .count { background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); }

/* Chips */
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px;
  font-size: 12px; font-weight: 500; border: 1px solid hsl(var(--border)); border-radius: 999px;
  background: hsl(var(--background)); color: hsl(var(--foreground)); transition: all var(--dur); white-space: nowrap;
}
.chip:hover { background: hsl(var(--accent)); }
.chip.active { background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); border-color: hsl(var(--primary)); }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips.scroll::-webkit-scrollbar { display: none; }

/* Badges */
.badge {
  display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px;
  font-size: 11px; font-weight: 600; border-radius: 999px; white-space: nowrap; line-height: 1;
  border: 1px solid transparent;
}
.badge-default { background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); }
.badge-secondary { background: hsl(var(--secondary)); color: hsl(var(--secondary-foreground)); }
.badge-outline { border-color: hsl(var(--border)); color: hsl(var(--foreground)); }
.badge-success { background: hsl(var(--success) / 0.12); color: hsl(142 71% 32%); }
.dark .badge-success { color: hsl(142 71% 60%); }
.badge-warning { background: hsl(var(--warning) / 0.15); color: hsl(32 92% 36%); }
.dark .badge-warning { color: hsl(38 92% 62%); }
.badge-destructive { background: hsl(var(--destructive) / 0.12); color: hsl(0 72% 45%); }
.dark .badge-destructive { color: hsl(0 84% 70%); }
.badge-info { background: hsl(var(--info) / 0.12); color: hsl(217 91% 45%); }
.dark .badge-info { color: hsl(217 91% 70%); }
.badge-dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.grade { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 6px; font-size: 11px; font-weight: 700; font-family: var(--font-mono); border: 1px solid hsl(var(--border)); }
.grade-A { background: hsl(var(--success) / 0.12); color: hsl(142 71% 32%); border-color: hsl(var(--success) / 0.3); }
.grade-B { background: hsl(var(--info) / 0.12); color: hsl(217 91% 45%); border-color: hsl(var(--info) / 0.3); }
.grade-C { background: hsl(var(--warning) / 0.15); color: hsl(32 92% 36%); border-color: hsl(var(--warning) / 0.3); }
.dark .grade-A { color: hsl(142 71% 60%); }
.dark .grade-B { color: hsl(217 91% 70%); }
.dark .grade-C { color: hsl(38 92% 62%); }

/* Cards */
.card {
  background: hsl(var(--card)); color: hsl(var(--card-foreground));
  border: 1px solid hsl(var(--border)); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
}
.card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 20px 0; }
.card-title { font-size: 14px; font-weight: 600; }
.card-desc { font-size: 12px; color: hsl(var(--muted-foreground)); margin-top: 2px; }
.card-body { padding: 18px 20px; }
.card-footer { padding: 14px 20px; border-top: 1px solid hsl(var(--border)); display: flex; align-items: center; gap: 10px; }
.card-interactive { cursor: pointer; transition: border-color var(--dur), box-shadow var(--dur), transform var(--dur) var(--ease); }
.card-interactive:hover { border-color: hsl(var(--muted-foreground) / 0.4); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.card-interactive:active { transform: translateY(0); }

/* Spotlight card (React Bits inspired) */
.spotlight { position: relative; overflow: hidden; }
.spotlight::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 300ms;
  background: radial-gradient(400px circle at var(--mx, 50%) var(--my, 50%), hsl(var(--foreground) / 0.06), transparent 40%);
}
.spotlight:hover::before { opacity: 1; }

/* Stat */
.stat { padding: 18px 20px; display: flex; flex-direction: column; gap: 8px; }
.stat-label { font-size: 12px; color: hsl(var(--muted-foreground)); font-weight: 500; display: flex; align-items: center; justify-content: space-between; }
.stat-label [data-icon] { color: hsl(var(--muted-foreground)); }
.stat-value { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat-delta { font-size: 11px; display: flex; align-items: center; gap: 4px; color: hsl(var(--muted-foreground)); }
.stat-delta.up { color: hsl(142 71% 36%); }
.stat-delta.down { color: hsl(0 72% 50%); }
.dark .stat-delta.up { color: hsl(142 71% 60%); }
.dark .stat-delta.down { color: hsl(0 84% 70%); }
.stat-delta [data-icon] svg { width: 12px; height: 12px; }

/* Table */
.table-wrap { overflow-x: auto; border: 1px solid hsl(var(--border)); border-radius: var(--radius-lg); background: hsl(var(--card)); }
.table { width: 100%; font-size: 13px; }
.table th {
  text-align: left; padding: 10px 14px; font-size: 11px; font-weight: 500; color: hsl(var(--muted-foreground));
  background: hsl(var(--muted) / 0.5); border-bottom: 1px solid hsl(var(--border)); white-space: nowrap; letter-spacing: 0.02em;
}
.table td { padding: 12px 14px; border-bottom: 1px solid hsl(var(--border)); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background var(--dur); }
.table tbody tr:hover { background: hsl(var(--accent) / 0.5); }
.table tbody tr.clickable { cursor: pointer; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-top: 1px solid hsl(var(--border)); font-size: 12px; color: hsl(var(--muted-foreground)); flex-wrap: wrap; }
.pagination { display: flex; gap: 4px; }

/* Avatar */
.avatar {
  width: 32px; height: 32px; border-radius: 50%; background: hsl(var(--muted)); color: hsl(var(--foreground));
  display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; flex-shrink: 0; letter-spacing: 0.02em;
}
.avatar-sm { width: 26px; height: 26px; font-size: 10px; }
.avatar-lg { width: 44px; height: 44px; font-size: 14px; }

/* Device thumbnail (abstract device illustration) */
.thumb {
  width: 44px; height: 44px; border-radius: 10px; background: hsl(var(--muted)); display: inline-flex; align-items: center; justify-content: center;
  color: hsl(var(--muted-foreground)); flex-shrink: 0; border: 1px solid hsl(var(--border));
}
.thumb svg { width: 20px; height: 20px; }
.thumb-lg { width: 64px; height: 64px; border-radius: 14px; }
.thumb-lg svg { width: 28px; height: 28px; }
.thumb-xl { width: 100%; aspect-ratio: 1; height: auto; border-radius: 12px; }
.thumb-xl svg { width: 36%; height: 36%; }

/* Separator */
.sep { height: 1px; background: hsl(var(--border)); margin: 12px 0; }
.sep-v { width: 1px; align-self: stretch; background: hsl(var(--border)); }

/* Empty state */
.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 48px 24px; gap: 8px; color: hsl(var(--muted-foreground)); }
.empty-icon { width: 48px; height: 48px; border-radius: 12px; background: hsl(var(--muted)); display: grid; place-items: center; margin-bottom: 6px; }
.empty-icon svg { width: 22px; height: 22px; }
.empty-title { font-size: 14px; font-weight: 600; color: hsl(var(--foreground)); }
.empty-desc { font-size: 12px; max-width: 320px; }

/* Skeleton */
.skeleton { background: linear-gradient(90deg, hsl(var(--muted)) 25%, hsl(var(--accent)) 50%, hsl(var(--muted)) 75%); background-size: 800px 100%; animation: shimmer 1.4s infinite linear; border-radius: var(--radius-sm); }

/* Progress */
.progress { height: 6px; background: hsl(var(--muted)); border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: hsl(var(--primary)); border-radius: 999px; transition: width 600ms var(--ease); }
.progress.success > span { background: hsl(var(--success)); }
.progress.warning > span { background: hsl(var(--warning)); }
.progress.destructive > span { background: hsl(var(--destructive)); }

/* Toast */
.toast-stack { position: fixed; right: 16px; bottom: 16px; z-index: 1000; display: flex; flex-direction: column; gap: 8px; width: min(360px, calc(100vw - 32px)); pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px;
  background: hsl(var(--popover)); color: hsl(var(--popover-foreground)); border: 1px solid hsl(var(--border));
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); animation: fade-up 240ms var(--ease);
  font-size: 13px;
}
.toast.leaving { animation: fade-in 200ms reverse forwards; }
.toast [data-icon] { margin-top: 1px; }
.toast-success [data-icon] { color: hsl(var(--success)); }
.toast-error [data-icon] { color: hsl(var(--destructive)); }
.toast-warning [data-icon] { color: hsl(var(--warning)); }
.toast-title { font-weight: 600; }
.toast-desc { font-size: 12px; color: hsl(var(--muted-foreground)); margin-top: 1px; }
.toast-close { margin-left: auto; color: hsl(var(--muted-foreground)); }
@media (max-width: 768px) { .toast-stack { bottom: calc(var(--bottomnav-h) + 12px); left: 16px; right: 16px; width: auto; } }

/* Modal / Dialog */
.modal-backdrop { position: fixed; inset: 0; background: hsl(240 10% 3.9% / 0.6); backdrop-filter: blur(2px); z-index: 900; animation: fade-in 160ms; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal-backdrop.closing { animation: fade-in 160ms reverse forwards; }
.modal {
  width: 100%; max-width: 520px; max-height: calc(100vh - 32px); display: flex; flex-direction: column;
  background: hsl(var(--popover)); color: hsl(var(--popover-foreground)); border: 1px solid hsl(var(--border));
  border-radius: var(--radius-xl); box-shadow: var(--shadow-xl); animation: scale-in 200ms var(--ease);
}
.modal-sm { max-width: 400px; }
.modal-lg { max-width: 760px; }
.modal-xl { max-width: 980px; }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 22px 0; }
.modal-title { font-size: 16px; font-weight: 600; }
.modal-desc { font-size: 12px; color: hsl(var(--muted-foreground)); margin-top: 2px; }
.modal-body { padding: 18px 22px; overflow-y: auto; flex: 1; }
.modal-footer { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 14px 22px 20px; flex-wrap: wrap; }
.modal-footer .left { margin-right: auto; }
.modal-close { color: hsl(var(--muted-foreground)); }
@media (max-width: 640px) {
  .modal-backdrop { align-items: flex-end; padding: 0; }
  .modal { max-width: none; max-height: 92vh; border-radius: var(--radius-xl) var(--radius-xl) 0 0; animation: slide-up 260ms var(--ease); border-bottom: 0; }
  .modal::before { content: ""; width: 36px; height: 4px; background: hsl(var(--border)); border-radius: 999px; margin: 10px auto -4px; }
  .modal-footer { padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
  .modal-footer .btn { flex: 1; }
  .modal-footer .left { width: 100%; margin: 0; }
}

/* Drawer (side sheet) */
.drawer-backdrop { position: fixed; inset: 0; background: hsl(240 10% 3.9% / 0.5); z-index: 900; animation: fade-in 160ms; }
.drawer-backdrop.closing { animation: fade-in 160ms reverse forwards; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(480px, 100vw); background: hsl(var(--popover)); color: hsl(var(--popover-foreground));
  border-left: 1px solid hsl(var(--border)); box-shadow: var(--shadow-xl); display: flex; flex-direction: column; animation: slide-in-right 260ms var(--ease);
}
.drawer-lg { width: min(640px, 100vw); }
.drawer-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 22px; border-bottom: 1px solid hsl(var(--border)); }
.drawer-body { flex: 1; overflow-y: auto; padding: 20px 22px; }
.drawer-footer { padding: 14px 22px; border-top: 1px solid hsl(var(--border)); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.drawer-footer .left { margin-right: auto; }
@media (max-width: 640px) {
  .drawer { top: auto; left: 0; width: 100%; max-height: 92vh; border-left: 0; border-top: 1px solid hsl(var(--border)); border-radius: var(--radius-xl) var(--radius-xl) 0 0; animation: slide-up 260ms var(--ease); }
  .drawer-footer { padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
}

/* Dropdown menu */
.menu { position: absolute; z-index: 800; min-width: 180px; padding: 4px; background: hsl(var(--popover)); border: 1px solid hsl(var(--border)); border-radius: var(--radius); box-shadow: var(--shadow-lg); animation: scale-in 140ms var(--ease); transform-origin: top right; }
.menu-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; font-size: 13px; border-radius: var(--radius-sm); text-align: left; transition: background var(--dur); }
.menu-item:hover { background: hsl(var(--accent)); }
.menu-item.destructive { color: hsl(var(--destructive)); }
.menu-sep { height: 1px; background: hsl(var(--border)); margin: 4px 0; }
.menu-label { padding: 6px 10px; font-size: 11px; color: hsl(var(--muted-foreground)); font-weight: 500; }

/* Tooltip */
[data-tip] { position: relative; }
[data-tip]::after {
  content: attr(data-tip); position: absolute; right: 0; bottom: calc(100% + 6px); transform: translateY(2px);
  padding: 4px 8px; font-size: 11px; font-weight: 500; white-space: nowrap; border-radius: var(--radius-sm);
  background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); opacity: 0; pointer-events: none; transition: opacity var(--dur), transform var(--dur); z-index: 50;
}
[data-tip]:hover::after { opacity: 1; transform: translateY(0); }

/* Command palette */
.palette-backdrop { position: fixed; inset: 0; background: hsl(240 10% 3.9% / 0.5); z-index: 950; display: flex; justify-content: center; align-items: flex-start; padding-top: 12vh; animation: fade-in 120ms; }
.palette { width: min(600px, calc(100vw - 32px)); background: hsl(var(--popover)); border: 1px solid hsl(var(--border)); border-radius: var(--radius-xl); box-shadow: var(--shadow-xl); overflow: hidden; animation: scale-in 160ms var(--ease); }
.palette-input { display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid hsl(var(--border)); }
.palette-input input { flex: 1; height: 48px; border: 0; background: transparent; outline: none; font-size: 14px; }
.palette-input [data-icon] { color: hsl(var(--muted-foreground)); }
.palette-list { max-height: 360px; overflow-y: auto; padding: 6px; }
.palette-group { padding: 8px 10px 4px; font-size: 11px; font-weight: 500; color: hsl(var(--muted-foreground)); }
.palette-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--radius); font-size: 13px; cursor: pointer; }
.palette-item:hover, .palette-item.active { background: hsl(var(--accent)); }
.palette-item .pi-icon { width: 28px; height: 28px; border-radius: 6px; background: hsl(var(--muted)); display: grid; place-items: center; color: hsl(var(--muted-foreground)); }
.palette-item .pi-meta { font-size: 11px; color: hsl(var(--muted-foreground)); }
.palette-item .pi-trail { margin-left: auto; font-size: 11px; color: hsl(var(--muted-foreground)); font-family: var(--font-mono); }
.palette-empty { padding: 32px; text-align: center; color: hsl(var(--muted-foreground)); font-size: 13px; }

/* Keypad */
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.keypad button { height: 48px; font-size: 18px; font-weight: 500; border-radius: var(--radius); background: hsl(var(--secondary)); transition: background var(--dur), transform 80ms; font-family: var(--font-mono); }
.keypad button:hover { background: hsl(var(--accent)); }
.keypad button:active { transform: scale(0.97); }

/* Timeline */
.timeline { display: flex; flex-direction: column; gap: 0; }
.timeline-item { display: grid; grid-template-columns: 20px 1fr; gap: 12px; padding-bottom: 16px; position: relative; }
.timeline-item::before { content: ""; position: absolute; left: 9px; top: 18px; bottom: 0; width: 1px; background: hsl(var(--border)); }
.timeline-item:last-child::before { display: none; }
.timeline-dot { width: 20px; height: 20px; border-radius: 50%; border: 2px solid hsl(var(--border)); background: hsl(var(--background)); display: grid; place-items: center; }
.timeline-dot.done { background: hsl(var(--primary)); border-color: hsl(var(--primary)); color: hsl(var(--primary-foreground)); }
.timeline-dot.done svg { width: 10px; height: 10px; }
.timeline-dot.current { border-color: hsl(var(--primary)); }
.timeline-dot.current::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: hsl(var(--primary)); }
.timeline-title { font-size: 13px; font-weight: 500; }
.timeline-meta { font-size: 11px; color: hsl(var(--muted-foreground)); }

/* Alert */
.alert { display: flex; gap: 10px; padding: 12px 14px; border: 1px solid hsl(var(--border)); border-radius: var(--radius-lg); font-size: 13px; background: hsl(var(--card)); }
.alert [data-icon] { margin-top: 1px; flex-shrink: 0; }
.alert-title { font-weight: 600; }
.alert-desc { font-size: 12px; color: hsl(var(--muted-foreground)); margin-top: 1px; }
.alert-warning { border-color: hsl(var(--warning) / 0.4); background: hsl(var(--warning) / 0.06); }
.alert-warning [data-icon] { color: hsl(var(--warning)); }
.alert-destructive { border-color: hsl(var(--destructive) / 0.4); background: hsl(var(--destructive) / 0.06); }
.alert-destructive [data-icon] { color: hsl(var(--destructive)); }
.alert-info { border-color: hsl(var(--info) / 0.4); background: hsl(var(--info) / 0.06); }
.alert-info [data-icon] { color: hsl(var(--info)); }

/* Definition list */
.dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 13px; }
.dl dt { color: hsl(var(--muted-foreground)); }
.dl dd { margin: 0; text-align: right; font-weight: 500; }

/* Spinner */
.spinner { width: 16px; height: 16px; border: 2px solid hsl(var(--border)); border-top-color: hsl(var(--foreground)); border-radius: 50%; animation: spin 700ms linear infinite; }

/* Number stepper */
.stepper { display: inline-flex; align-items: center; border: 1px solid hsl(var(--border)); border-radius: var(--radius-sm); overflow: hidden; height: 28px; }
.stepper button { width: 28px; height: 100%; display: grid; place-items: center; color: hsl(var(--muted-foreground)); transition: background var(--dur), color var(--dur); }
.stepper button:hover { background: hsl(var(--accent)); color: hsl(var(--foreground)); }
.stepper button svg { width: 12px; height: 12px; }
.stepper span { min-width: 28px; text-align: center; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
