/* CR-4A7B8C9D
   CLIPRENDER DESIGN SYSTEM -- components.css
   Shared component styles for Section 22 admin surfaces.
*/

[x-cloak] {
  display: none !important;
}

.admin-kill-switches {
  min-height: 100vh;
  background: var(--color-background);
}

.admin-kill-switches .page-shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--space-9) var(--space-8);
}

.admin-kill-switches .page-header {
  display: grid;
  gap: var(--space-3);
  padding-bottom: var(--space-6);
  border-bottom: 1px solid var(--gray-a6);
}

.admin-kill-switches .page-header h1 {
  font-size: 32px;
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -1.2px;
}

.admin-kill-switches .page-description {
  max-width: 700px;
  font-size: 16px;
}

.admin-kill-switches .page-content {
  padding-top: var(--space-6);
}

.admin-kill-switches .loading-state {
  padding: var(--space-6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-4);
  background: var(--surface-1);
  color: var(--text-secondary);
}

.admin-kill-switches .kill-switch-table-wrapper {
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-5);
  background: var(--surface-1);
  box-shadow: var(--shadow-2);
}

.admin-kill-switches .kill-switch-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-kill-switches .kill-switch-table th,
.admin-kill-switches .kill-switch-table td {
  padding: 14px 20px;
  text-align: left;
  border-bottom: 1px solid var(--gray-a3);
}

.admin-kill-switches .kill-switch-table th {
  background: var(--gray-a2);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border-subtle);
}

.admin-kill-switches .kill-switch-table tbody tr {
  transition: background var(--duration-fast) var(--ease-default);
}

.admin-kill-switches .kill-switch-table tbody tr:hover,
.admin-kill-switches .kill-switch-table tbody tr:focus-within {
  background: var(--gray-a2);
}

.admin-kill-switches .kill-switch-table tbody tr:last-child td {
  border-bottom: none;
}

.admin-kill-switches .cell-name {
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 12px;
}

.admin-kill-switches .cell-description {
  color: var(--text-secondary);
  font-size: 13px;
}

.admin-kill-switches .toggle-switch {
  position: relative;
  width: 28px;
  height: 16px;
  border: none;
  border-radius: var(--radius-full);
  background: var(--accent-a3);
  cursor: pointer;
  transition:
    background var(--duration-slow) var(--ease-default),
    transform var(--duration-slow) var(--ease-default),
    opacity var(--duration-slow) var(--ease-default);
}

.admin-kill-switches .toggle-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  border-radius: var(--radius-full);
  background: var(--text-muted);
  transition:
    transform var(--duration-slow) var(--ease-default),
    background var(--duration-slow) var(--ease-default);
}

.admin-kill-switches .toggle-switch[data-state="on"] {
  background: var(--success);
}

.admin-kill-switches .toggle-switch[data-state="on"]::after {
  transform: translateX(12px);
  background: var(--accent-9);
}

.admin-kill-switches .toggle-switch:not(:disabled):hover {
  transform: scale(1.03);
}

.admin-kill-switches .toggle-switch:not(:disabled):active {
  transform: scale(0.97);
}

.admin-kill-switches .toggle-switch:focus-visible {
  outline: 2px solid var(--accent-9);
  outline-offset: 2px;
}

.admin-kill-switches .toggle-switch:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.admin-kill-switches .dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: grid;
  place-items: center;
  padding: var(--space-4);
  background: var(--overlay-scrim);
}

.admin-kill-switches .dialog-panel {
  width: min(380px, 100%);
  max-height: 85vh;
  overflow-y: auto;
  border: 1px solid var(--gray-a6);
  border-radius: var(--radius-4);
  background: var(--surface-1);
}

.admin-kill-switches .dialog-header,
.admin-kill-switches .dialog-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: var(--space-4) var(--space-5);
  background: var(--surface-2);
}

.admin-kill-switches .dialog-header {
  border-bottom: 1px solid var(--gray-a6);
}

.admin-kill-switches .dialog-header h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.3px;
}

.admin-kill-switches .dialog-icon {
  color: var(--error);
  font-size: 24px;
  line-height: 1;
}

.admin-kill-switches .dialog-body {
  padding: var(--space-5);
}

.admin-kill-switches .dialog-footer {
  justify-content: flex-end;
  border-top: 1px solid var(--gray-a6);
}

.admin-kill-switches .btn-cancel,
.admin-kill-switches .btn-confirm-destructive {
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-4);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  transition:
    background var(--duration-normal) var(--ease-default),
    border-color var(--duration-normal) var(--ease-default),
    color var(--duration-normal) var(--ease-default),
    opacity var(--duration-normal) var(--ease-default),
    transform var(--duration-normal) var(--ease-default);
}

.admin-kill-switches .btn-cancel {
  border: 1px solid var(--gray-a6);
  background: transparent;
  color: var(--text-primary);
}

.admin-kill-switches .btn-confirm-destructive {
  border: 1px solid var(--error);
  background: var(--error);
  color: var(--text-primary);
  font-weight: 500;
}

.admin-kill-switches .btn-cancel:not(:disabled):hover {
  border-color: var(--border-interactive);
  background: var(--gray-a3);
}

.admin-kill-switches .btn-confirm-destructive:not(:disabled):hover {
  background: var(--error);
  opacity: 0.92;
}

.admin-kill-switches .btn-cancel:not(:disabled):active,
.admin-kill-switches .btn-confirm-destructive:not(:disabled):active {
  transform: translateY(1px);
}

.admin-kill-switches .btn-cancel:focus-visible {
  outline: 2px solid var(--accent-9);
  outline-offset: 2px;
}

.admin-kill-switches .btn-confirm-destructive:focus-visible {
  outline: 2px solid var(--error);
  outline-offset: 2px;
}

.admin-kill-switches .btn-cancel:disabled,
.admin-kill-switches .btn-confirm-destructive:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

@media (max-width: 768px) {
  .admin-kill-switches .page-shell {
    padding: var(--space-8) var(--space-4);
  }

  .admin-kill-switches .page-header h1 {
    font-size: 28px;
    font-weight: 400;
  }

  .admin-kill-switches .dialog-overlay {
    align-items: end;
  }

  .admin-kill-switches .dialog-panel {
    width: 100%;
    max-height: calc(100vh - 80px);
  }
}


/* ========================================
   Section 35: Dashboard Page Shells
   ======================================== */

.dashboard-grid--section-35 .dashboard-header {
  background: var(--bg-base);
}

.dashboard-shell__avatar-badge {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-subtle);
  border-radius: 50%;
  background: var(--gray-a2);
  color: var(--text-secondary);
  font-size: 10px;
  font-family: var(--font-mono);
}

.dashboard-shell-header__brand {
  display: inline-flex;
  align-items: center;
}

.dashboard-shell-header__meta {
  gap: 10px;
}

.dashboard-shell-header__badge {
  background: var(--gray-a2);
}

.dashboard-shell-sidebar__brand {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
  background: transparent;
}

.dashboard-shell-sidebar__brand-link {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.dashboard-shell-sidebar__brand-mark {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-3);
  background: var(--gray-a2);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
}

.dashboard-shell-sidebar__brand-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.dashboard-shell-sidebar__eyebrow,
.dashboard-shell-sidebar__section-title,
.dashboard-shell-sidebar__utility-label,
.dashboard-shell-context__eyebrow,
.dashboard-shell-context__stat-label {
  color: var(--text-tertiary);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dashboard-shell-sidebar__workspace,
.dashboard-shell-sidebar__utility-title {
  color: var(--text-primary);
  font-size: 13px;
  letter-spacing: -0.2px;
}

.dashboard-shell-sidebar__brand-note,
.dashboard-shell-sidebar__utility-copy,
.dashboard-shell-sidebar__nav-meta,
.dashboard-shell-context__description {
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.55;
}

.dashboard-shell-sidebar__content {
  gap: 14px;
  padding: 0 8px;
}

.dashboard-shell-sidebar__section {
  display: grid;
  gap: 4px;
}

.dashboard-shell-sidebar__section-items {
  display: grid;
  gap: 2px;
}

.dashboard-grid--section-35 .dashboard-sidebar__nav-item {
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  border: none;
  border-radius: var(--radius-2);
  position: relative;
  transition: background var(--duration-normal) var(--ease-default),
              color var(--duration-normal) var(--ease-default);
}

.dashboard-shell-sidebar__copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.dashboard-grid--section-35 .dashboard-sidebar__nav-label {
  color: inherit;
  font-size: 13px;
  font-weight: 500;
}

.dashboard-grid--section-35 .dashboard-sidebar__nav-item:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}

.dashboard-grid--section-35 .dashboard-sidebar__nav-item--active {
  background: var(--surface-active);
  color: var(--text-primary);
}

.dashboard-grid--section-35 .dashboard-sidebar__nav-item--active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 2px;
  background: var(--accent-9);
  border-radius: 0 2px 2px 0;
}

.dashboard-shell-sidebar__utility {
  margin-top: 18px;
}

.dashboard-shell-sidebar__utility-card {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-4);
  background: var(--surface-1);
}

.dashboard-shell-main__inner {
  max-width: 1120px;
  margin: 0 auto;
  display: grid;
  gap: 0;
}

.dashboard-shell-context {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  padding: 18px 20px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-5);
  background: var(--surface-1);
}

.dashboard-shell-context__intro {
  display: grid;
  gap: 8px;
}

.dashboard-shell-context__title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.dashboard-shell-context__workspace {
  color: var(--text-primary);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.6px;
}

.dashboard-shell-context__badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 11px;
}

.dashboard-shell-context__stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(112px, 1fr));
  gap: 10px;
}

.dashboard-shell-context__stat {
  display: grid;
  gap: 6px;
  align-content: start;
  padding-left: 12px;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.dashboard-shell-context__stat-value {
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.4;
}

.dashboard-shell-main__content {
  display: grid;
}

.dashboard-page {
  display: grid;
  gap: 24px;
}

.dashboard-page--dense {
  gap: var(--space-5);
}

.dashboard-page__header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-subtle);
}

.dashboard-page__header--compact {
  align-items: center;
}

.dashboard-page__title {
  color: var(--text-primary);
  font-size: 24px;
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.5px;
}

.dashboard-page__description {
  margin-top: 6px;
  max-width: 720px;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.6;
}

.dashboard-page__actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.dashboard-page__skeleton {
  width: 100%;
  min-height: 24px;
}

.dashboard-panel {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-5);
  background: var(--surface-1);
}

.dashboard-panel__header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.1px;
  color: var(--text-primary);
  background: var(--gray-a2);
}

.dashboard-panel__body {
  padding: var(--space-5);
}

.dashboard-panel__footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border-subtle);
}

.dashboard-inline-feedback {
  min-height: 20px;
  color: var(--text-tertiary);
  font-size: 12px;
}

.dashboard-back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 13px;
}

.dashboard-back-link:hover {
  color: var(--text-primary);
}

.dashboard-chip-button,
.dashboard-icon-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 14px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 13px;
  cursor: pointer;
  transition: background var(--duration-normal) var(--ease-default), border-color var(--duration-normal) var(--ease-default), color var(--duration-normal) var(--ease-default);
}

.dashboard-icon-toggle {
  width: 32px;
  padding: 0;
}

.dashboard-chip-button:hover,
.dashboard-icon-toggle:hover,
.dashboard-chip-button[data-active='true'],
.dashboard-icon-toggle[data-active='true'] {
  color: var(--text-primary);
  border-color: var(--border-interactive);
  background: var(--surface-active);
}

.dashboard-chip-button:focus-visible,
.dashboard-icon-toggle:focus-visible,
.dashboard-toggle:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

.dashboard-chip-button--wide {
  width: 100%;
  justify-content: flex-start;
}

.dashboard-search-field {
  position: relative;
  flex: 1 1 280px;
}

.dashboard-search-field i {
  position: absolute;
  top: 50%;
  left: 14px;
  transform: translateY(-50%);
  color: var(--text-tertiary);
}

.dashboard-search-field input,
.dashboard-form-grid input,
.dashboard-form-grid textarea,
.dashboard-form-grid select {
  width: 100%;
  border: 1px solid var(--border-subtle);
  background: var(--gray-a2);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 13px;
}

.dashboard-search-field input {
  height: 36px;
  padding: 0 14px 0 40px;
  border-radius: var(--radius-full);
}

.dashboard-form-grid input,
.dashboard-form-grid select {
  min-height: 36px;
  padding: 0 14px;
}

.dashboard-form-grid textarea {
  min-height: 96px;
  padding: 12px 14px;
  resize: vertical;
}

.dashboard-form-grid input[disabled],
.dashboard-form-grid textarea[disabled],
.dashboard-form-grid select[disabled],
.dashboard-form-grid input[readonly],
.dashboard-form-grid textarea[readonly] {
  opacity: 0.8;
  cursor: not-allowed;
}

.dashboard-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: var(--radius-full);
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
}

.dashboard-status-badge--neutral {
  background: var(--gray-a2);
  color: var(--text-secondary);
  border-color: var(--border-subtle);
}

.dashboard-status-badge--success {
  background: var(--success-muted);
  color: var(--success);
  border-color: rgba(45, 164, 78, 0.35);
}

.dashboard-status-badge--warning {
  background: var(--warning-muted);
  color: var(--warning);
  border-color: rgba(212, 167, 44, 0.35);
}

.dashboard-status-badge--error {
  background: var(--error-muted);
  color: var(--error);
  border-color: rgba(229, 72, 77, 0.35);
}

.dashboard-status-badge--info {
  background: var(--info-muted);
  color: var(--info);
  border-color: rgba(59, 130, 246, 0.35);
}

.dashboard-stack-list {
  display: grid;
  gap: 12px;
}

.dashboard-list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.dashboard-list-row:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.dashboard-form-grid,
.dashboard-metadata-list {
  display: grid;
  gap: 14px;
}

.dashboard-metadata-list div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.dashboard-metadata-list span {
  color: var(--text-tertiary);
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.dashboard-metadata-list strong {
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 400;
  text-align: right;
}

.dashboard-empty {
  display: grid;
  place-items: center;
  gap: 12px;
  padding: 40px 20px;
  text-align: center;
}

.dashboard-empty i {
  font-size: 28px;
  color: var(--text-tertiary);
}

.dashboard-empty__actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.dashboard-mono {
  font-family: var(--font-mono);
  font-size: 12px;
}

.workspace-selector__grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.workspace-selector__card,
.workspace-selector__new-card {
  min-height: 200px;
  padding: 20px;
  border-radius: var(--radius-5);
}

.workspace-selector__card {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 20px;
}

.workspace-selector__card-top,
.workspace-selector__card-actions,
.workspace-selector__stats {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.workspace-selector__card-title {
  font-size: 15px;
  letter-spacing: -0.3px;
}

.workspace-selector__card-meta {
  margin-top: 6px;
  font-size: 11px;
  color: var(--text-tertiary);
}

.workspace-selector__card-stats {
  display: grid;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 13px;
}

.workspace-selector__card-stats p {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.workspace-selector__new-card {
  display: grid;
  place-content: center;
  gap: 10px;
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-5);
  background: transparent;
  color: var(--text-secondary);
  text-align: center;
  cursor: pointer;
  transition: border-color var(--duration-normal) var(--ease-default), background var(--duration-normal) var(--ease-default), color var(--duration-normal) var(--ease-default);
}

.workspace-selector__new-card:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.02);
}

.workspace-selector__new-card i {
  font-size: 24px;
  color: var(--text-primary);
}

.workspace-selector__new-card small {
  color: var(--text-tertiary);
}

.workspace-selector__card:hover,
.workspace-selector__new-card:hover {
  border-color: var(--border-interactive);
}

.workspace-selector__stats {
  flex-wrap: wrap;
  border-top: 1px solid var(--border-subtle);
  background: var(--surface-1);
  border-radius: var(--radius-5);
  padding: 16px 20px;
}

.workspace-selector__stats-item {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-secondary);
}

.workspace-selector__stats-item strong {
  font-weight: 500;
  color: var(--text-primary);
}

.asset-library__toolbar,
.asset-library__toolbar-actions,
.dashboard-toolbar__actions,
.billing-page__toggles,
.usage-overage-tabs {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.asset-library__toolbar {
  padding: 12px 16px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-5);
  background: var(--surface-1);
}

.asset-library__layout {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 16px;
}

.asset-library__filters {
  align-self: start;
}

.dashboard-filter-group {
  display: grid;
  gap: 10px;
}

.dashboard-filter-group + .dashboard-filter-group {
  margin-top: 20px;
}

.dashboard-filter-group h2 {
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.dashboard-filter-group label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 13px;
}

.asset-library__content {
  display: grid;
  gap: 16px;
}

.asset-library__bulk-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-4);
  background: var(--surface-1);
}

.asset-library__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
}

.asset-library__card {
  position: relative;
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: var(--radius-5);
}

.asset-library__select {
  position: absolute;
  top: 12px;
  right: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
}

.asset-library__select[data-selected='true'] {
  color: var(--text-primary);
}

.asset-library__thumb {
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 10;
  border: 1px solid var(--gray-a5);
  border-radius: var(--radius-4);
  background: var(--surface-2);
}

.asset-library__thumb i {
  font-size: 28px;
  color: var(--text-tertiary);
}

.asset-library__meta {
  display: grid;
  gap: 10px;
}

.asset-library__meta h2 {
  font-size: 15px;
  letter-spacing: -0.3px;
}

.asset-library__meta-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.dashboard-upload-zone {
  display: grid;
  place-items: center;
  gap: 10px;
  min-height: 160px;
  padding: 32px 24px;
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-5);
  background: transparent;
  text-align: center;
  transition: border-color var(--duration-normal) var(--ease-default), background var(--duration-normal) var(--ease-default), color var(--duration-normal) var(--ease-default);
}

.dashboard-upload-zone[data-drag-active='true'] {
  border-color: var(--border-hover);
  background: rgba(255, 255, 255, 0.02);
}

.dashboard-upload-zone i {
  font-size: 28px;
  color: var(--text-tertiary);
}

.dashboard-video-player {
  border: 1px solid var(--border-default);
  background: var(--bg-raised);
}

.dashboard-video-player__frame {
  display: grid;
  place-items: center;
  gap: 10px;
  aspect-ratio: 16 / 9;
  color: var(--text-tertiary);
}

.dashboard-video-player__frame i {
  font-size: 32px;
}

.project-detail__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.project-detail__actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.project-detail__actions--secondary {
  justify-content: flex-end;
}

.render-studio__layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 16px;
}

.render-studio__rail {
  align-self: start;
}

.render-studio__rail-groups,
.render-studio__content {
  display: grid;
  gap: 14px;
}

.render-studio__rail-group {
  display: grid;
  gap: 6px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.render-studio__rail-group:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.render-studio__rail-group h2 {
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.2px;
}

.render-studio__rail-group p {
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.55;
}

.dashboard-timeline {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
}

.dashboard-timeline__segment {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: var(--bg-overlay);
  color: var(--text-secondary);
  font-size: 13px;
}

.dashboard-settings-page .dashboard-settings-grid {
  display: grid;
  gap: 16px;
}

.notifications-grid__header,
.notifications-grid__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 80px 80px;
  gap: 12px;
  align-items: center;
}

.notifications-grid__header {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-default);
  color: var(--text-tertiary);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.notifications-grid__row {
  padding: 14px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.notifications-grid__row:last-child {
  border-bottom: none;
}

.dashboard-toggle {
  position: relative;
  width: 36px;
  height: 20px;
  border: none;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.12);
  cursor: pointer;
}

.dashboard-toggle span {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--text-tertiary);
  transition: transform var(--duration-normal) var(--ease-spring), background var(--duration-normal) var(--ease-spring);
}

.dashboard-toggle[data-state='on'] {
  background: var(--success);
}

.dashboard-toggle[data-state='on'] span {
  transform: translateX(16px);
  background: var(--text-primary);
}

.billing-plan-card,
.dashboard-limit-bars,
.dashboard-cost-items {
  display: grid;
  gap: 16px;
}

.billing-plan-card__top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.billing-plan-card__top h2 {
  font-size: 18px;
  letter-spacing: -0.5px;
}

.billing-plan-card__top p {
  margin-top: 6px;
  color: var(--text-primary);
}

.billing-plan-card__top small {
  margin-top: 6px;
  display: inline-block;
  color: var(--text-tertiary);
}

.billing-plan-card__actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.billing-plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.billing-plan-grid__card {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: var(--bg-overlay);
}

.billing-plan-grid__card h2 {
  font-size: 16px;
  letter-spacing: -0.4px;
}

.dashboard-limit-row {
  display: grid;
  gap: 10px;
}

.dashboard-limit-row > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.dashboard-limit-row span {
  color: var(--text-secondary);
}

.dashboard-limit-row strong {
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 12px;
}

.usage-metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.usage-metrics-grid__value {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 500;
}

.dashboard-chart-placeholder {
  display: grid;
  place-items: center;
  min-height: 140px;
  margin-top: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: var(--bg-overlay);
  color: var(--text-tertiary);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.dashboard-cost-bar {
  display: grid;
  grid-template-columns: 6fr 2fr 1fr;
  gap: 4px;
}

.dashboard-cost-bar__segment {
  min-height: 18px;
}

.dashboard-cost-bar__segment--included {
  background: var(--accent-primary);
}

.dashboard-cost-bar__segment--boost {
  background: var(--info);
}

.dashboard-cost-bar__segment--overage {
  background: var(--warning);
}

.cr-progress__fill[data-width='25'] {
  width: 25%;
}

.cr-progress__fill[data-width='34'] {
  width: 34%;
}

.cr-progress__fill[data-width='78'] {
  width: 78%;
}

@media (min-width: 768px) and (max-width: 1023px) {
  .workspace-selector__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .usage-metrics-grid,
  .project-detail__grid,
  .render-studio__layout {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 1024px) {
  .workspace-selector__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1023px) {
  .asset-library__layout,
  .project-detail__grid,
  .usage-metrics-grid,
  .render-studio__layout {
    grid-template-columns: 1fr;
  }

  .asset-library__filters {
    order: 2;
  }

  .asset-library__content {
    order: 1;
  }
}

@media (max-width: 767px) {
  .dashboard-shell-context {
    grid-template-columns: 1fr;
    padding: 16px;
  }

  .dashboard-shell-context__stats {
    grid-template-columns: 1fr;
  }

  .dashboard-shell-sidebar__nav-meta,
  .dashboard-shell-sidebar__brand-note,
  .dashboard-shell-sidebar__utility {
    display: none;
  }

  .dashboard-page__header,
  .asset-library__toolbar,
  .asset-library__toolbar-actions,
  .billing-plan-card__top,
  .billing-plan-card__actions,
  .workspace-selector__card-top,
  .workspace-selector__card-actions,
  .workspace-selector__stats {
    flex-direction: column;
    align-items: stretch;
  }

  .dashboard-page__header {
    align-items: stretch;
  }

  .dashboard-page__title {
    font-size: 26px;
  }

  .asset-library__grid,
  .billing-plan-grid,
  .dashboard-timeline {
    grid-template-columns: 1fr;
  }

  .dashboard-main {
    padding-left: 12px;
    padding-right: 12px;
  }

  .usage-overage-tabs,
  .billing-page__toggles,
  .dashboard-toolbar__actions,
  .dashboard-empty__actions {
    width: 100%;
  }

  .notifications-grid__header {
    display: none;
  }

  .notifications-grid__row {
    grid-template-columns: 1fr 1fr;
  }
}

/* Section 29: preview tooltip system */

.cr-preview-tooltip-demo {
  min-height: 100vh;
  padding: var(--space-8);
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  align-items: flex-start;
  background: var(--bg-base);
}

.cr-preview-tooltip-demo--narrow {
  width: min(100%, 280px);
  margin: 0 auto;
}

.cr-preview-tooltip-demo--player {
  width: min(100%, 320px);
  margin: 0 auto;
}

.cr-preview-tooltip-wrapper {
  position: relative;
  display: inline-block;
}

.cr-preview-tooltip-trigger {
  padding: var(--space-2) var(--space-4);
  background: var(--bg-overlay);
  color: var(--text-primary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-full);
  font-family: var(--font-sans);
  font-size: 13px;
  letter-spacing: -0.2px;
  cursor: pointer;
  transition:
    background var(--duration-normal) var(--ease-default),
    border-color var(--duration-normal) var(--ease-default),
    color var(--duration-normal) var(--ease-default);
}

.cr-preview-tooltip-trigger:hover,
.cr-preview-tooltip-trigger:focus-visible {
  background: var(--bg-hover);
  border-color: var(--border-hover);
  outline: none;
}

.cr-preview-tooltip-panel,
.cr-tooltip-video-player {
  width: 280px;
  max-width: 280px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.cr-preview-tooltip-panel {
  position: absolute;
  z-index: 50;
}

.cr-preview-tooltip-panel.side-top {
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
}

.cr-preview-tooltip-panel.side-bottom {
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
}

.cr-preview-tooltip-panel.side-left {
  right: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%);
}

.cr-preview-tooltip-panel.side-right {
  left: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%);
}

.cr-preview-tooltip-video-zone,
.cr-tooltip-video-player {
  position: relative;
  background: var(--bg-base);
}

.cr-preview-tooltip-video-zone {
  width: 100%;
  aspect-ratio: 16 / 9;
}

.cr-preview-tooltip-player-shell {
  position: absolute;
  inset: 0;
}

.cr-tooltip-video-player {
  width: min(100%, 320px);
  aspect-ratio: 16 / 9;
}

.cr-preview-tooltip-video,
.cr-tooltip-video-player__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.cr-preview-tooltip-poster,
.cr-tooltip-video-player__poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
  opacity: 1;
  transition: opacity var(--duration-page) var(--ease-default);
}

.video-playing .cr-preview-tooltip-poster,
.video-playing .cr-tooltip-video-player__poster,
.playing + .cr-preview-tooltip-poster,
.playing + .cr-tooltip-video-player__poster {
  opacity: 0;
}

.cr-preview-tooltip-error,
.cr-tooltip-video-player__error {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--overlay-mask);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 12px;
  letter-spacing: -0.2px;
}

.cr-preview-tooltip-body {
  padding: 6px 8px 8px;
  font-family: var(--font-sans);
}

.cr-preview-tooltip-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.cr-preview-tooltip-title {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.2px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cr-preview-tooltip-badge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
  flex-shrink: 0;
}

.cr-preview-tooltip-description {
  margin: 0 0 6px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.4;
  letter-spacing: -0.1px;
}

.cr-preview-tooltip-metadata {
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.cr-preview-tooltip-metadata-label {
  font-size: 11px;
  color: var(--text-tertiary);
}

.cr-preview-tooltip-metadata-value {
  padding: 1px 4px;
  border-radius: var(--radius-sm);
  background: var(--bg-overlay);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 11px;
}

.cr-preview-tooltip-bottom-sheet {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 100;
  width: 100%;
  max-height: 80vh;
  margin: 0;
  padding: 0;
  background: var(--bg-secondary);
  border: 1px solid var(--border-default);
  border-bottom: none;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  overflow: hidden;
}

.cr-preview-tooltip-bottom-sheet::backdrop {
  background: var(--overlay-mask);
}

.cr-preview-tooltip-sheet-handle {
  display: flex;
  justify-content: center;
  padding: 8px 0 4px;
}

.cr-preview-tooltip-sheet-bar {
  width: 32px;
  height: 4px;
  background: var(--border-default);
  border-radius: var(--radius-full);
}

.cr-preview-tooltip-demo__controls {
  padding-top: var(--space-4);
  display: flex;
  gap: var(--space-2);
}

.cr-preview-tooltip-badge--transition-fades {
  background: rgba(130, 100, 255, 0.25);
  color: rgba(180, 160, 255, 0.95);
}

.cr-preview-tooltip-badge--transition-wipes {
  background: rgba(59, 130, 246, 0.25);
  color: rgba(130, 180, 255, 0.95);
}

.cr-preview-tooltip-badge--transition-slides {
  background: rgba(45, 164, 78, 0.25);
  color: rgba(120, 220, 140, 0.95);
}

.cr-preview-tooltip-badge--transition-covers {
  background: rgba(212, 167, 44, 0.25);
  color: rgba(240, 210, 100, 0.95);
}

.cr-preview-tooltip-badge--transition-reveals {
  background: rgba(255, 100, 100, 0.25);
  color: rgba(255, 160, 160, 0.95);
}

.cr-preview-tooltip-badge--transition-circles {
  background: rgba(100, 220, 220, 0.25);
  color: rgba(160, 240, 240, 0.95);
}

.cr-preview-tooltip-badge--transition-slices {
  background: rgba(255, 160, 100, 0.25);
  color: rgba(255, 200, 160, 0.95);
}

.cr-preview-tooltip-badge--transition-diagonals {
  background: rgba(200, 130, 255, 0.25);
  color: rgba(220, 180, 255, 0.95);
}

.cr-preview-tooltip-badge--transition-squeezes {
  background: rgba(220, 100, 220, 0.25);
  color: rgba(240, 160, 240, 0.95);
}

.cr-preview-tooltip-badge--transition-opens-closes {
  background: rgba(180, 160, 100, 0.25);
  color: rgba(220, 210, 160, 0.95);
}

.cr-preview-tooltip-badge--transition-wind {
  background: rgba(100, 160, 220, 0.25);
  color: rgba(160, 200, 240, 0.95);
}

.cr-preview-tooltip-badge--transition-special {
  background: rgba(255, 100, 180, 0.25);
  color: rgba(255, 160, 210, 0.95);
}

.cr-preview-tooltip-badge--transition-smooth {
  background: rgba(100, 200, 130, 0.25);
  color: rgba(160, 230, 180, 0.95);
}

.cr-preview-tooltip-badge--transition-core {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(200, 200, 200, 0.95);
}

.cr-preview-tooltip-badge--transition-rectangles {
  background: rgba(160, 200, 80, 0.25);
  color: rgba(200, 230, 140, 0.95);
}

.cr-preview-tooltip-badge--scene-type {
  background: rgba(96, 165, 250, 0.25);
  color: rgba(130, 190, 255, 0.95);
}

.cr-preview-tooltip-badge--caption {
  background: rgba(255, 160, 100, 0.2);
  color: rgba(255, 200, 160, 0.95);
}

.cr-preview-tooltip-badge--lut-warm {
  background: rgba(255, 160, 80, 0.25);
  color: rgba(255, 200, 140, 0.95);
}

.cr-preview-tooltip-badge--lut-cool {
  background: rgba(80, 160, 255, 0.25);
  color: rgba(140, 200, 255, 0.95);
}

.cr-preview-tooltip-badge--lut-cinematic {
  background: rgba(255, 140, 60, 0.25);
  color: rgba(255, 190, 120, 0.95);
}

.cr-preview-tooltip-badge--lut-vintage {
  background: rgba(200, 160, 100, 0.25);
  color: rgba(230, 200, 150, 0.95);
}

.cr-preview-tooltip-badge--lut-stylized {
  background: rgba(180, 100, 220, 0.25);
  color: rgba(210, 160, 240, 0.95);
}

.cr-preview-tooltip-badge--preset {
  background: rgba(100, 220, 180, 0.25);
  color: rgba(160, 240, 210, 0.95);
}

@media (max-width: 767px) {
  .cr-preview-tooltip-panel {
    display: none !important;
  }
}

@media (min-width: 768px) {
  .cr-preview-tooltip-bottom-sheet {
    display: none !important;
  }
}

/* Section 31: dev component showcase */

.showcase-layout {
  display: flex;
  min-height: 100vh;
  background: var(--bg-base);
}

.showcase-sidebar {
  position: sticky;
  top: 0;
  width: 16rem;
  height: 100vh;
  overflow-y: auto;
  flex-shrink: 0;
  padding: var(--space-4) 0;
  border-right: 1px solid var(--border-default);
  background: var(--bg-secondary);
}

.showcase-sidebar__title {
  padding: var(--space-3) var(--space-4);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.2px;
}

.showcase-nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  width: 100%;
  padding: var(--space-2) var(--space-4);
  border-left: 2px solid transparent;
  color: var(--text-secondary);
  text-decoration: none;
  transition:
    color var(--duration-normal) var(--ease-default),
    background var(--duration-normal) var(--ease-default),
    border-color var(--duration-normal) var(--ease-default);
}

.showcase-nav-item:hover,
.showcase-nav-item:focus-visible {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.showcase-nav-item.is-active {
  border-left-color: var(--accent-primary);
  background: var(--bg-active);
  color: var(--accent-primary);
}

.showcase-nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 18px;
  padding: 0 6px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-full);
  background: var(--bg-overlay);
  color: var(--text-tertiary);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
}

.showcase-main {
  flex: 1;
  min-width: 0;
  padding: var(--space-8);
}

.showcase-header {
  margin-bottom: var(--space-12);
}

.showcase-header h1 {
  margin-bottom: var(--space-2);
  font-size: 32px;
  line-height: 1.15;
  letter-spacing: -1.2px;
}

.showcase-header p {
  max-width: 640px;
  color: var(--text-secondary);
  font-size: 14px;
}

.showcase-section {
  margin-bottom: 80px;
  scroll-margin-top: var(--space-8);
}

.showcase-section__heading {
  margin-bottom: var(--space-2);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border-default);
  color: var(--text-primary);
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -0.8px;
}

.showcase-section__description {
  margin-bottom: var(--space-6);
  color: var(--text-tertiary);
  font-size: 13px;
}

.showcase-slot,
.showcase-section-stack {
  display: grid;
  gap: var(--space-6);
}

.showcase-component-group {
  display: grid;
  gap: var(--space-3);
}

.showcase-component-group__title {
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.3px;
}

.showcase-demo {
  display: grid;
  gap: var(--space-3);
  padding: var(--space-4);
  border: 1px solid var(--border-default);
  background: var(--bg-raised);
}

.showcase-demo__label {
  color: var(--text-tertiary);
  font-family: var(--font-mono);
  font-size: 11px;
}

.showcase-frame {
  display: block;
  width: 100%;
  border: 1px solid var(--border-subtle);
  background: var(--bg-base);
}

.showcase-frame--compact {
  height: 240px;
}

.showcase-frame--medium {
  height: 320px;
}

.showcase-frame--tall {
  height: 420px;
}

.showcase-static-card {
  display: grid;
  gap: var(--space-3);
  padding: var(--space-4);
  border: 1px solid var(--border-subtle);
  background: var(--bg-base);
}

.showcase-static-list {
  display: grid;
  gap: var(--space-2);
}

.showcase-static-list__item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  border: 1px solid var(--border-subtle);
  background: var(--bg-overlay);
  color: var(--text-primary);
  font-size: 13px;
}

.showcase-static-handle {
  width: 10px;
  height: 16px;
  border-left: 2px solid var(--text-tertiary);
  border-right: 2px solid var(--text-tertiary);
  opacity: 0.7;
}

.showcase-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.showcase-static-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-full);
  background: var(--bg-overlay);
  color: var(--text-primary);
  font-size: 12px;
}

.showcase-static-pill--muted {
  color: var(--text-secondary);
}

.showcase-static-pill--destructive {
  color: var(--error);
}

.showcase-static-search {
  width: min(100%, 360px);
  padding: 12px 18px;
  border: 1px solid var(--border-default);
  background: var(--bg-input);
  color: var(--text-tertiary);
  font-size: 13px;
}

.showcase-static-placeholder {
  display: grid;
  place-items: center;
  min-height: 220px;
  border: 1px dashed var(--border-subtle);
  background: var(--bg-overlay);
  color: var(--text-secondary);
  font-size: 13px;
  text-align: center;
}

.showcase-static-cropper {
  position: relative;
  min-height: 220px;
  border: 1px solid var(--border-subtle);
  background:
    linear-gradient(90deg, transparent 49%, rgba(255, 255, 255, 0.04) 50%, transparent 51%),
    linear-gradient(transparent 49%, rgba(255, 255, 255, 0.04) 50%, transparent 51%),
    var(--bg-overlay);
  background-size: 48px 48px;
}

.showcase-static-cropper__box {
  position: absolute;
  inset: 18% 22%;
  border: 1px solid var(--accent-primary);
}

.showcase-static-cropper__handle {
  position: absolute;
  width: 12px;
  height: 12px;
  border: 1px solid var(--accent-primary);
  background: var(--bg-base);
}

.showcase-static-cropper__handle--tl {
  top: 18%;
  left: 22%;
  transform: translate(-50%, -50%);
}

.showcase-static-cropper__handle--tr {
  top: 18%;
  right: 22%;
  transform: translate(50%, -50%);
}

.showcase-static-cropper__handle--bl {
  bottom: 18%;
  left: 22%;
  transform: translate(-50%, 50%);
}

.showcase-static-cropper__handle--br {
  right: 22%;
  bottom: 18%;
  transform: translate(50%, 50%);
}

.dev-guard-error {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: var(--space-8);
  background: var(--bg-base);
}

.dev-guard-error__message {
  text-align: center;
  color: var(--text-secondary);
}

.dev-guard-error__code {
  margin-bottom: var(--space-2);
  color: var(--text-primary);
  font-size: 48px;
  font-weight: 400;
  letter-spacing: -2px;
}

@media (max-width: 768px) {
  .showcase-layout {
    flex-direction: column;
  }

  .showcase-sidebar {
    display: flex;
    flex-wrap: nowrap;
    width: 100%;
    height: auto;
    overflow-x: auto;
    overflow-y: hidden;
    border-right: none;
    border-bottom: 1px solid var(--border-default);
    padding: var(--space-2) 0;
    z-index: 20;
  }

  .showcase-sidebar__title {
    display: none;
  }

  .showcase-nav-item {
    flex-shrink: 0;
    border-left: none;
    border-bottom: 2px solid transparent;
    padding: var(--space-2) var(--space-3);
    white-space: nowrap;
  }

  .showcase-nav-item.is-active {
    border-bottom-color: var(--accent-primary);
  }

  .showcase-main {
    padding: var(--space-4);
  }

  .showcase-frame--tall {
    height: 360px;
  }
}

/* Section 25: data display components */

.component-page {
  width: min(100%, 960px);
  margin: 0 auto;
  padding: var(--space-12) var(--space-8);
}

.component-page--narrow {
  max-width: 680px;
}

.component-page--wide {
  max-width: 960px;
}

.component-stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}

.component-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-4);
}

.component-demo-surface {
  min-height: 100vh;
  padding: var(--space-8);
  background: var(--bg-base);
}

.component-demo-surface--wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: var(--space-4);
}

.component-demo-shell {
  display: grid;
  gap: var(--space-4);
}

.component-demo-section {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-8);
}

.component-demo-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
}

html[data-embedded="true"] .component-page,
html[data-embedded="true"] .component-demo-surface,
html[data-embedded="true"] .cr-media-page {
  min-height: auto;
  padding: var(--space-5);
}

html[data-embedded="true"] .component-stack,
html[data-embedded="true"] .component-demo-shell,
html[data-embedded="true"] .cr-waveform-stack,
html[data-embedded="true"] .cr-trim-slider-stack {
  gap: var(--space-5);
}

html[data-embedded="true"] .component-demo-section {
  gap: var(--space-3);
  padding: var(--space-5);
}

@keyframes cr-rainbow-shift {
  0% {
    background-position: 0%;
  }

  100% {
    background-position: 200%;
  }
}

@keyframes cr-button-spin {
  to {
    transform: rotate(360deg);
  }
}

.cr-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: var(--radius-btn);
  outline: none;
  background: transparent;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.2px;
  white-space: nowrap;
  text-decoration: none;
  text-overflow: ellipsis;
  cursor: pointer;
  transition:
    background var(--duration-normal) var(--ease-default),
    border-color var(--duration-normal) var(--ease-default),
    color var(--duration-normal) var(--ease-default),
    opacity var(--duration-normal) var(--ease-default),
    transform var(--duration-normal) var(--ease-default);
}

.cr-btn--sm {
  min-height: 28px;
  padding: 0 10px;
  font-size: 13px;
}

.cr-btn--md {
  min-height: 32px;
  padding: 0 14px;
}

.cr-btn--lg {
  min-height: 36px;
  padding: 0 18px;
}

.cr-btn--xl {
  min-height: 40px;
  padding: 0 22px;
  font-size: 15px;
}

.cr-btn--primary {
  background: var(--accent-primary);
  color: var(--text-on-accent);
  border-color: rgba(255, 255, 255, 0.9);
}

.cr-btn--primary:hover {
  background: var(--accent-primary-hover);
}

.cr-btn--secondary {
  background: var(--bg-raised);
  color: var(--text-primary);
  border-color: var(--border-default);
}

.cr-btn--secondary:hover {
  border-color: var(--border-hover);
  background: var(--bg-hover);
}

.cr-btn--ghost {
  background: transparent;
  color: var(--text-secondary);
  border: none;
}

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

.cr-btn--danger {
  background: transparent;
  color: var(--error);
  border-color: var(--error);
}

.cr-btn--danger:hover {
  background: var(--error-muted);
}

.cr-btn--danger-solid {
  background: var(--error);
  color: var(--text-primary);
  border-color: var(--error);
}

.cr-btn--danger-solid:hover {
  background: #c93c40;
}

.cr-btn--rainbow,
.cr-btn--rainbow-outline {
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  outline: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
  background:
    linear-gradient(#0a0a0a, #0a0a0a),
    linear-gradient(#0a0a0a 50%, rgba(10, 10, 10, 0.6) 80%, rgba(10, 10, 10, 0)),
    linear-gradient(90deg, hsl(var(--color-1)), hsl(var(--color-5)), hsl(var(--color-3)), hsl(var(--color-4)), hsl(var(--color-2)));
  background-size: 200%;
  background-clip: padding-box, border-box, border-box;
  background-origin: border-box;
  animation: cr-rainbow-shift var(--speed, 2s) linear infinite;
}

.cr-btn--rainbow-outline {
  background:
    linear-gradient(#000000, #000000),
    linear-gradient(#000000 50%, rgba(0, 0, 0, 0.6) 80%, rgba(0, 0, 0, 0)),
    linear-gradient(90deg, hsl(var(--color-1)), hsl(var(--color-5)), hsl(var(--color-3)), hsl(var(--color-4)), hsl(var(--color-2)));
  background-size: 200%;
  background-clip: padding-box, border-box, border-box;
  background-origin: border-box;
}

.cr-btn--rainbow:hover,
.cr-btn--rainbow-outline:hover {
  transform: translateY(-1px);
}

.cr-btn--rainbow:active,
.cr-btn--rainbow-outline:active {
  transform: scale(0.97);
}

.cr-rainbow-glow-wrap {
  position: relative;
  display: inline-flex;
}

.cr-rainbow-glow {
  position: absolute;
  right: 18%;
  bottom: -18%;
  left: 18%;
  z-index: 0;
  height: 28%;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, hsl(var(--color-1)), hsl(var(--color-5)), hsl(var(--color-3)), hsl(var(--color-4)), hsl(var(--color-2)));
  background-size: 200%;
  filter: blur(14px);
  opacity: 0.68;
  animation: cr-rainbow-shift var(--speed, 2s) linear infinite;
  pointer-events: none;
}

.cr-rainbow-glow-wrap > .cr-btn {
  z-index: 1;
}

.cr-rainbow-glow-wrap[data-disabled="true"] .cr-rainbow-glow {
  opacity: 0.28;
  animation: none;
}

.cr-btn__label {
  position: relative;
  z-index: 1;
}

.cr-btn__logomark {
  width: 20px;
  height: 17px;
  flex-shrink: 0;
}

.cr-btn--sm .cr-btn__logomark {
  width: 16px;
  height: 14px;
}

.cr-btn--lg .cr-btn__logomark,
.cr-btn--xl .cr-btn__logomark {
  width: 22px;
  height: 18px;
}

.cr-btn:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

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

.cr-btn--rainbow[disabled],
.cr-btn--rainbow[aria-disabled="true"],
.cr-btn--rainbow-outline[disabled],
.cr-btn--rainbow-outline[aria-disabled="true"] {
  animation: none;
}

.cr-btn--loading {
  pointer-events: none;
}

.cr-btn__spinner {
  animation: cr-button-spin 0.75s linear infinite;
}

.cr-btn--error,
.cr-btn--error[aria-invalid="true"] {
  border-color: hsl(var(--color-1));
}

@media (prefers-reduced-motion: reduce) {
  .cr-btn,
  .cr-rainbow-glow,
  .cr-btn--rainbow,
  .cr-btn--rainbow-outline,
  .cr-btn__spinner {
    animation: none;
    transition: none;
  }
}

/* === Branded Primary Button (§8 -- Mid-Emphasis Tier) ===
   White background, black text, black logomark.
   Sits between generic Secondary and the Rainbow tier.
   Use for meaningful-but-not-transformative page CTAs:
   auth submit, form confirmations, onboarding steps. */

.cr-btn--branded {
  border-radius: var(--radius-full);
  background: var(--accent-primary);               /* #ffffff */
  color: var(--text-on-accent);                     /* #000000 */
  border: 1px solid rgba(255, 255, 255, 0.9);
  font-family: var(--font-sans);
  font-weight: 500;
  letter-spacing: -0.2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.cr-btn--branded:hover {
  background: var(--accent-10);
  border-color: #ffffff;
}

.cr-btn--branded:active {
  filter: brightness(0.9);
  transform: scale(0.97);
}

.cr-btn--branded[disabled],
.cr-btn--branded[aria-disabled="true"] {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.cr-btn--branded .cr-btn__logomark {
  color: var(--text-on-accent);                     /* black */
}

.cr-btn-skeleton {
  display: inline-block;
  border-radius: var(--radius-btn);
  background: var(--bg-hover);
}

.cr-btn-skeleton--sm {
  min-height: 28px;
  width: 80px;
}

.cr-btn-skeleton--md {
  min-height: 32px;
  width: 100px;
}

.cr-btn-skeleton--lg {
  min-height: 36px;
  width: 120px;
}

.cr-btn-skeleton--xl {
  min-height: 40px;
  width: 140px;
}

/* ═══ Radix-Inspired Button Variants (DESIGN_SYSTEM.md §8) ═══ */

.cr-btn-sm { min-height: 28px; padding: 0 10px; font-size: 13px; }
.cr-btn-md { min-height: 32px; padding: 0 12px; font-size: 14px; }
.cr-btn-lg { min-height: 36px; padding: 0 16px; font-size: 14px; }
.cr-btn-xl { min-height: 40px; padding: 0 20px; font-size: 15px; }

.cr-btn-solid {
  background: var(--accent-9);
  color: var(--accent-contrast);
  border-color: rgba(255, 255, 255, 0.90);
}
.cr-btn-solid:hover { background: var(--accent-10); }

.cr-btn-soft {
  background: var(--accent-a3);
  color: var(--accent-11);
  border-color: transparent;
}
.cr-btn-soft:hover { background: var(--accent-a4); }

.cr-btn-surface {
  background: var(--gray-a2);
  color: var(--gray-12);
  border-color: var(--gray-a6);
}
.cr-btn-surface:hover { border-color: var(--gray-a8); background: var(--gray-a3); }

.cr-btn-outline {
  background: transparent;
  color: var(--gray-12);
  border-color: var(--gray-a6);
}
.cr-btn-outline:hover { border-color: var(--gray-a8); background: var(--gray-a3); }

.cr-btn-ghost {
  background: transparent;
  color: var(--gray-11);
  border-color: transparent;
}
.cr-btn-ghost:hover { color: var(--gray-12); background: var(--gray-a3); }

.cr-btn-branded {
  background: var(--accent-9);
  color: var(--accent-contrast);
  border-color: rgba(255, 255, 255, 0.90);
  border-radius: var(--radius-full);
}
.cr-btn-branded:hover { background: var(--accent-10); }

.cr-btn-destructive-outline {
  background: transparent;
  color: var(--red-11);
  border-color: var(--red-6);
}
.cr-btn-destructive-outline:hover { background: var(--red-3); border-color: var(--red-9); }

.cr-btn-destructive-surface {
  background: var(--red-3);
  color: var(--red-11);
  border-color: var(--red-6);
}
.cr-btn-destructive-surface:hover { background: var(--red-4); }

.cr-card {
  position: relative;
  overflow: clip;
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-5);
  transition: border-color var(--duration-normal) var(--ease-default),
              background var(--duration-normal) var(--ease-default);
}

.cr-card:hover {
  border-color: var(--border-interactive);
}

.cr-card--rainbow {
  padding-bottom: 2px;
  overflow: visible;
}

.cr-card--rainbow::after {
  content: '';
  position: absolute;
  right: 18%;
  bottom: -10px;
  left: 18%;
  z-index: -1;
  height: 18px;
  background: linear-gradient(
    90deg,
    hsl(var(--color-1)),
    hsl(var(--color-2)),
    hsl(var(--color-3)),
    hsl(var(--color-4)),
    hsl(var(--color-5))
  );
  filter: blur(14px);
  opacity: 0.5;
}

.cr-card-header {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-default);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.3px;
  color: var(--text-primary);
}

.cr-card-body {
  padding: var(--space-6);
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.5;
}

.cr-card-footer {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 8px 14px;
  border-top: 1px solid var(--border-default);
}

.cr-card-meta {
  font-size: 12px;
  color: var(--text-tertiary);
}

.cr-card-rainbow-border {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  background: linear-gradient(
    90deg,
    hsl(var(--color-1)),
    hsl(var(--color-2)),
    hsl(var(--color-3)),
    hsl(var(--color-4)),
    hsl(var(--color-5))
  );
}

.cr-media-page {
  min-height: 100vh;
  padding: var(--space-8);
  display: grid;
  place-items: center;
  background: var(--bg-base);
}

.cr-waveform-stack,
.cr-trim-slider-stack {
  display: grid;
  gap: var(--space-12);
  width: min(100%, 600px);
}

.cr-waveform {
  position: relative;
  width: 100%;
  padding-block: var(--space-2);
}

.cr-waveform__container {
  width: 100%;
  cursor: pointer;
  border-radius: var(--radius-sm);
}

.cr-waveform__stall-dot {
  position: absolute;
  top: var(--space-1);
  right: var(--space-1);
  width: 4px;
  height: 4px;
  border-radius: var(--radius-full);
  background: var(--warning);
  animation: cr-waveform-pulse 1.5s ease-in-out infinite;
}

@keyframes cr-waveform-pulse {
  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.3;
  }
}

.cr-trim-slider {
  position: relative;
  width: 100%;
  padding-block: var(--space-2) var(--space-8);
}

.cr-trim-slider__track {
  position: relative;
  width: 100%;
  height: 6px;
  background: var(--bg-overlay);
  border-radius: var(--radius-full);
  cursor: pointer;
}

.cr-trim-slider__track-selected {
  position: absolute;
  top: 0;
  height: 100%;
  background: var(--accent-primary);
  border-radius: var(--radius-full);
  pointer-events: none;
}

.cr-trim-slider__inputs {
  position: absolute;
  top: var(--space-2);
  left: 0;
  width: 100%;
  height: 6px;
}

.cr-trim-slider__range-input {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 100%;
  height: 16px;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  pointer-events: none;
  z-index: 2;
}

.cr-trim-slider__range-input::-webkit-slider-runnable-track {
  height: 16px;
  background: transparent;
}

.cr-trim-slider__range-input::-moz-range-track {
  height: 16px;
  border: none;
  background: transparent;
}

.cr-trim-slider__range-input::-webkit-slider-thumb {
  width: 16px;
  height: 16px;
  margin-top: 0;
  border: 2px solid var(--text-primary);
  border-radius: var(--radius-full);
  background: var(--accent-primary);
  cursor: grab;
  pointer-events: all;
  appearance: none;
  -webkit-appearance: none;
  box-shadow: var(--shadow-md);
}

.cr-trim-slider__range-input::-webkit-slider-thumb:active {
  cursor: grabbing;
}

.cr-trim-slider__range-input::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border: 2px solid var(--text-primary);
  border-radius: var(--radius-full);
  background: var(--accent-primary);
  cursor: grab;
  box-shadow: var(--shadow-md);
}

.cr-trim-slider__timecodes {
  display: flex;
  justify-content: space-between;
  margin-top: var(--space-2);
}

.cr-trim-slider__timecode {
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.cr-trim-slider__stall-dot {
  position: absolute;
  top: 0;
  right: 0;
  width: 4px;
  height: 4px;
  border-radius: var(--radius-full);
  background: var(--warning);
  animation: cr-trim-slider-pulse 1.5s ease-in-out infinite;
}

@keyframes cr-trim-slider-pulse {
  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.3;
  }
}

.cr-data-table-frame {
  overflow-x: auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-5);
  background: var(--surface-1);
}

.cr-data-table {
  width: 100%;
  border-collapse: collapse;
}

.cr-data-table thead tr {
  background: var(--gray-a2);
}

.cr-data-table th {
  padding: 12px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.cr-data-table td {
  padding: 12px 16px;
  color: var(--text-secondary);
}

.cr-data-table tbody tr {
  border-bottom: 1px solid var(--border-subtle);
  transition: background-color var(--duration-normal) var(--ease-default);
}

.cr-data-table tbody tr:hover,
.cr-data-table tbody tr:focus-within {
  background: var(--surface-hover);
}

.cr-table-select-cell {
  width: 40px;
}

.cr-sort-button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.cr-sort-button:hover,
.cr-sort-button:focus-visible {
  color: var(--text-primary);
}

.cr-sort-button:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

.cr-sort-button i {
  font-size: 12px;
}

.cr-row-checkbox {
  width: 16px;
  height: 16px;
  accent-color: var(--accent-primary);
  cursor: pointer;
}

.cr-pagination-demo {
  display: flex;
  justify-content: flex-start;
}

.cr-pagination {
  display: flex;
  align-items: center;
  gap: 4px;
}

.cr-pagination-button,
.cr-pagination-nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border: 0;
  border-radius: var(--radius-lg);
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition:
    background-color var(--duration-normal) var(--ease-default),
    color var(--duration-normal) var(--ease-default),
    opacity var(--duration-normal) var(--ease-default);
}

.cr-pagination-button:hover:not(:disabled):not(.is-active),
.cr-pagination-nav:hover:not(:disabled) {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.cr-pagination-button.is-active {
  background: var(--accent-muted);
  color: var(--accent-primary);
}

.cr-pagination-button:disabled,
.cr-pagination-nav:disabled {
  opacity: 0.5;
  pointer-events: none;
}

.cr-pagination-nav i {
  font-size: 16px;
}

.cr-pagination-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  color: var(--text-tertiary);
  font-size: 13px;
}

.cr-pagination-slot {
  display: inline-flex;
}

.cr-tabs {
  width: 100%;
}

.cr-tabs-list {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border-default);
}

.cr-tabs-trigger {
  margin-bottom: -1px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-bottom-color: transparent;
  background: transparent;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition:
    background-color var(--duration-normal) var(--ease-default),
    border-color var(--duration-normal) var(--ease-default),
    color var(--duration-normal) var(--ease-default);
}

.cr-tabs-trigger:hover:not(.is-active) {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.cr-tabs-trigger.is-active {
  background: var(--accent-muted);
  color: var(--accent-primary);
  border-color: var(--border-default);
  border-bottom-color: var(--bg-raised);
}

.cr-tabs-trigger:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: -2px;
}

.cr-tabs-panel {
  padding: 16px 0;
  color: var(--text-secondary);
}

.cr-accordion-item {
  border-bottom: 1px solid var(--border-default);
}

.cr-accordion-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 48px;
  padding: 12px 0;
  border: 0;
  background: transparent;
  color: var(--text-primary);
  text-align: left;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color var(--duration-normal) var(--ease-default);
}

.cr-accordion-trigger:hover {
  background: var(--bg-hover);
}

.cr-accordion-trigger:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

.cr-accordion-chevron {
  flex-shrink: 0;
  margin-left: var(--space-2);
  color: var(--text-tertiary);
  font-size: 16px;
  transition:
    transform var(--duration-slow) var(--ease-default),
    color var(--duration-slow) var(--ease-default);
}

.cr-accordion-chevron.is-expanded {
  transform: rotate(90deg);
  color: var(--text-primary);
}

.cr-accordion-content {
  padding: 0 0 16px;
  color: var(--text-secondary);
}

.cr-stat-card,
.cr-kpi-card,
.cr-chart-wrapper {
  background: var(--bg-raised);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  transition: border-color var(--duration-slow) var(--ease-default);
}

.cr-stat-card:hover,
.cr-kpi-card:hover {
  border-color: var(--border-hover);
}

.cr-stat-card,
.cr-kpi-card {
  min-width: 200px;
  padding: 20px;
}

.cr-stat-card {
  display: grid;
  gap: 8px;
}

.cr-stat-label,
.cr-kpi-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.cr-stat-value,
.cr-kpi-value {
  color: var(--text-primary);
  font-family: var(--font-mono);
  line-height: 1.2;
}

.cr-stat-value {
  font-size: 32px;
}

.cr-kpi-value {
  font-size: 28px;
}

.cr-stat-trend,
.cr-kpi-change {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 500;
}

.cr-stat-trend--up,
.cr-kpi-change--up {
  color: hsl(var(--color-5));
}

.cr-stat-trend--down,
.cr-kpi-change--down {
  color: hsl(var(--color-1));
}

.cr-stat-trend--neutral,
.cr-kpi-change--neutral {
  color: var(--text-tertiary);
}

.cr-stat-comparison {
  margin-left: 6px;
  font-size: 12px;
  color: var(--text-tertiary);
}

.cr-stat-sparkline {
  width: 100%;
  height: 40px;
}

.cr-stat-area {
  fill: rgba(255, 255, 255, 0.05);
}

.cr-stat-line {
  fill: none;
  stroke: var(--accent-primary);
  stroke-width: 1.5;
}

.cr-skeleton {
  background: linear-gradient(90deg, var(--bg-overlay), #1b1b1b, var(--bg-overlay));
  background-size: 200% 100%;
  animation: shimmer 1.5s linear infinite;
}

.cr-skeleton--label {
  width: 40%;
  height: 13px;
}

.cr-skeleton--value {
  width: 60%;
  height: 32px;
}

.cr-skeleton--sparkline {
  width: 100%;
  height: 40px;
}

.cr-kpi-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cr-kpi-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--accent-muted);
  color: var(--text-primary);
  font-size: 20px;
}

.cr-kpi-icon--info {
  background: rgba(59, 130, 246, 0.15);
  color: var(--info);
}

.cr-chart-wrapper {
  width: 100%;
  min-height: 300px;
  padding: 24px;
}

.cr-chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.cr-chart-title {
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.3px;
  color: var(--text-primary);
}

.cr-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.cr-chart-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
}

.cr-chart-legend-item[data-visible='false'] {
  opacity: 0.4;
}

.cr-chart-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.cr-chart-legend-dot[data-series-tone='primary'] {
  background: var(--accent-primary);
}

.cr-chart-legend-dot[data-series-tone='secondary'] {
  background: var(--text-tertiary);
}

.cr-chart-area {
  position: relative;
  width: 100%;
}

.cr-chart-svg {
  display: block;
  width: 100%;
  height: auto;
}

.chart-y-label,
.chart-x-label {
  font-family: var(--font-mono);
  font-size: 11px;
  fill: var(--text-tertiary);
}

.chart-grid-line {
  stroke: rgba(255, 255, 255, 0.04);
  stroke-width: 1;
}

.cr-chart-area-fill[data-series-tone='primary'] {
  fill: var(--accent-primary);
  fill-opacity: 0.05;
}

.cr-chart-area-fill[data-series-tone='secondary'] {
  fill: var(--text-tertiary);
  fill-opacity: 0.05;
}

.cr-chart-line[data-series-tone='primary'] {
  fill: none;
  stroke: var(--accent-primary);
  stroke-width: 2;
}

.cr-chart-line[data-series-tone='secondary'] {
  fill: none;
  stroke: var(--text-tertiary);
  stroke-width: 2;
}

.cr-chart-bar[data-series-tone='primary'] {
  fill: var(--accent-primary);
  fill-opacity: 0.8;
}

.cr-chart-bar[data-series-tone='secondary'] {
  fill: var(--text-tertiary);
  fill-opacity: 0.4;
}

.cr-chart-tooltip {
  display: none;
  position: absolute;
  inset: auto auto 0 0;
  padding: 8px 12px;
  border: 1px solid var(--border-default);
  background: var(--bg-overlay);
  color: var(--text-primary);
  font-size: 12px;
}

@media (max-width: 768px) {
  .component-page {
    padding: var(--space-8) var(--space-4);
  }

  .cr-chart-wrapper {
    min-height: 200px;
    padding: 20px;
  }

  .cr-chart-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Section 26: feedback components */

@keyframes cr-fade-out-right {
  from {
    opacity: 1;
    transform: translateX(0);
  }

  to {
    opacity: 0;
    transform: translateX(20px);
  }
}

@keyframes cr-rainbow-flow {
  from {
    background-position: 0%;
  }

  to {
    background-position: 200%;
  }
}

@keyframes cr-spin-slow {
  to {
    transform: rotate(360deg);
  }
}

.feedback-trigger-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.feedback-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 var(--space-5);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-btn);
  background: var(--bg-raised);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.2px;
  cursor: pointer;
  transition:
    background var(--duration-interaction) var(--ease-default),
    border-color var(--duration-interaction) var(--ease-default),
    transform var(--duration-interaction) var(--ease-default);
}

.feedback-trigger:hover {
  background: var(--bg-hover);
  border-color: var(--border-hover);
}

.feedback-trigger:active {
  transform: translateY(1px);
}

.feedback-trigger:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

.feedback-panel {
  border: 1px solid var(--border-default);
  background: var(--bg-raised);
}

.feedback-panel--padded {
  padding: var(--space-6);
}

.feedback-stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.feedback-row {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.cr-status-probe {
  min-height: 1px;
}

.cr-toaster {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 600;
  display: flex;
  flex-direction: column-reverse;
  gap: var(--space-2);
  pointer-events: none;
}

.cr-toast {
  min-width: 320px;
  max-width: 420px;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border-default);
  background: var(--bg-raised);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  pointer-events: auto;
  animation: fadeInUp 300ms var(--ease-out) forwards;
}

.cr-toast.is-removing {
  animation: cr-fade-out-right 200ms var(--ease-default) forwards;
}

.cr-toast--success {
  border-left: 2px solid var(--success);
}

.cr-toast--error {
  border-left: 2px solid var(--error);
}

.cr-toast--warning {
  border-left: 2px solid var(--warning);
}

.cr-toast--info {
  border-left: 2px solid var(--info);
}

.cr-toast--loading {
  border-left: 2px solid var(--text-tertiary);
}

.cr-toast__body {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
}

.cr-toast__icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  font-size: 16px;
}

.cr-toast--success .cr-toast__icon {
  color: var(--success);
}

.cr-toast--error .cr-toast__icon {
  color: var(--error);
}

.cr-toast--warning .cr-toast__icon {
  color: var(--warning);
}

.cr-toast--info .cr-toast__icon {
  color: var(--info);
}

.cr-toast--loading .cr-toast__icon {
  color: var(--text-tertiary);
}

.cr-toast--neutral .cr-toast__icon {
  color: var(--text-tertiary);
}

.cr-toast__content {
  flex: 1;
  min-width: 0;
}

.cr-toast__title,
.cr-toast__custom-title {
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.1px;
}

.cr-toast__description {
  margin-top: 2px;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.5;
}

.cr-toast__dismiss,
.cr-alert__dismiss,
.cr-empty-state__action,
.cr-error-boundary__reset {
  transition:
    background var(--duration-interaction) var(--ease-default),
    border-color var(--duration-interaction) var(--ease-default),
    color var(--duration-interaction) var(--ease-default),
    transform var(--duration-interaction) var(--ease-default);
}

.cr-toast__dismiss {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border: none;
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
}

.cr-toast__dismiss:hover,
.cr-toast__dismiss:focus-visible,
.cr-alert__dismiss:hover,
.cr-alert__dismiss:focus-visible {
  color: var(--text-primary);
}

.cr-toast__dismiss:active,
.cr-alert__dismiss:active,
.cr-empty-state__action:active,
.cr-error-boundary__reset:active {
  transform: translateY(1px);
}

.cr-toast__dismiss:focus-visible,
.cr-alert__dismiss:focus-visible,
.cr-empty-state__action:focus-visible,
.cr-error-boundary__reset:focus-visible,
.cr-alert__dismiss:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

.cr-toast__spinner {
  width: 14px;
  height: 14px;
  border: 1.5px solid var(--border-default);
  border-top-color: var(--text-primary);
  border-radius: 50%;
  animation: cr-spin-slow 0.8s linear infinite;
}

.cr-toast__custom-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  width: 100%;
}

.cr-toast__custom-copy {
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.5;
}

.cr-alert-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.cr-alert {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border-default);
  border-left-width: 3px;
  background: var(--bg-raised);
}

.cr-alert--success {
  border-left-color: var(--success);
  background: var(--success-muted);
}

.cr-alert--warning {
  border-left-color: var(--warning);
  background: var(--warning-muted);
}

.cr-alert--error {
  border-left-color: var(--error);
  background: var(--error-muted);
}

.cr-alert--info {
  border-left-color: var(--info);
  background: var(--info-muted);
}

.cr-alert__icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  font-size: 16px;
}

.cr-alert--success .cr-alert__icon {
  color: var(--success);
}

.cr-alert--warning .cr-alert__icon {
  color: var(--warning);
}

.cr-alert--error .cr-alert__icon {
  color: var(--error);
}

.cr-alert--info .cr-alert__icon {
  color: var(--info);
}

.cr-alert__body {
  flex: 1;
  min-width: 0;
}

.cr-alert__title {
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.1px;
}

.cr-alert__description {
  margin-top: 2px;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.5;
}

.cr-alert__dismiss {
  position: absolute;
  top: 10px;
  right: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border: none;
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
}

.cr-progress-demo {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.cr-progress {
  position: relative;
  width: 100%;
}

.cr-progress__label {
  margin-bottom: 6px;
  color: var(--text-secondary);
  font-size: 12px;
  letter-spacing: -0.1px;
}

.cr-progress__row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cr-progress__track {
  position: relative;
  flex: 1;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 2px;
}

.cr-progress__track--sm {
  height: 4px;
}

.cr-progress__track--md {
  height: 8px;
}

.cr-progress__track--lg {
  height: 12px;
}

.cr-progress__fill {
  height: 100%;
  border-radius: inherit;
  transition: width 300ms var(--ease-out);
}

.cr-progress__fill--default {
  background: var(--accent-primary);
}

.cr-progress__fill--success {
  background: var(--success);
}

.cr-progress__fill--warning {
  background: var(--warning);
}

.cr-progress__fill--error {
  background: var(--error);
}

.cr-progress__fill--rainbow,
.cr-progress__glow {
  background: linear-gradient(90deg,
    hsl(var(--color-1)),
    hsl(var(--color-5)),
    hsl(var(--color-3)),
    hsl(var(--color-4)),
    hsl(var(--color-2))
  );
  background-size: 200%;
  animation: cr-rainbow-flow 2s linear infinite;
}

.cr-progress__glow {
  position: absolute;
  right: 30%;
  bottom: -4px;
  left: 5%;
  height: 6px;
  filter: blur(8px);
  opacity: 0.45;
  pointer-events: none;
}

.cr-progress__value {
  min-width: 36px;
  color: var(--text-tertiary);
  font-family: var(--font-mono);
  font-size: 12px;
  text-align: right;
  white-space: nowrap;
}

.cr-progress[data-stale='true'] .cr-progress__fill {
  animation: pulse 2s ease-in-out infinite;
  filter: saturate(0.3);
}

.cr-progress__fill[data-width='0'] {
  width: 0%;
}

.cr-progress__fill[data-width='42'] {
  width: 42%;
}

.cr-progress__fill[data-width='50'] {
  width: 50%;
}

.cr-progress__fill[data-width='60'] {
  width: 60%;
}

.cr-progress__fill[data-width='67'] {
  width: 67%;
}

.cr-progress__fill[data-width='75'] {
  width: 75%;
}

.cr-progress__fill[data-width='80'] {
  width: 80%;
}

.cr-progress__fill[data-width='90'] {
  width: 90%;
}

.cr-progress__fill[data-width='100'] {
  width: 100%;
}

.cr-progress__glow[data-width='80'] {
  width: 80%;
}

.cr-skeleton-demo,
.cr-empty-state-demo,
.cr-error-boundary-demo {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.cr-skeleton {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.04) 25%,
    rgba(255, 255, 255, 0.08) 50%,
    rgba(255, 255, 255, 0.04) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s ease infinite;
}

.cr-skeleton--text {
  width: 100%;
  height: 16px;
  border-radius: var(--radius-full);
}

.cr-skeleton--title {
  width: 60%;
  height: 24px;
  border-radius: var(--radius-full);
}

.cr-skeleton--card {
  width: 100%;
  height: 200px;
}

.cr-skeleton--avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
}

.cr-skeleton-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.cr-skeleton[data-custom-size='true'] {
  width: 200px;
  height: 40px;
}

.cr-empty-state,
.cr-error-boundary-fallback {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 240px;
  padding: var(--space-16) var(--space-6);
  text-align: center;
}

.cr-empty-state__icon,
.cr-error-boundary__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-4);
  font-size: 32px;
}

.cr-empty-state__icon {
  color: var(--text-tertiary);
  opacity: 0.5;
}

.cr-error-boundary__icon {
  color: var(--error);
}

.cr-empty-state__title,
.cr-error-boundary__title {
  margin-bottom: var(--space-2);
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.3px;
}

.cr-empty-state__description,
.cr-error-boundary__message,
.cr-error-boundary__custom-copy {
  max-width: 320px;
  color: var(--text-tertiary);
  font-size: 13px;
  line-height: 1.6;
}

.cr-empty-state__description,
.cr-error-boundary__message {
  margin-bottom: var(--space-6);
}

.cr-empty-state__action,
.cr-error-boundary__reset {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 var(--space-5);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-btn);
  background: transparent;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.cr-empty-state__action:hover,
.cr-error-boundary__reset:hover {
  border-color: var(--border-hover);
  background: var(--bg-hover);
}

.cr-boundary-shell {
  border: 1px solid var(--border-default);
  background: var(--bg-raised);
  min-height: 120px;
}

.cr-boundary-content,
.cr-boundary-content--muted {
  padding: var(--space-4);
}

.cr-boundary-content {
  color: var(--text-primary);
}

.cr-boundary-content--muted {
  color: var(--text-secondary);
  font-size: 12px;
}

.cr-boundary-nested {
  margin: var(--space-2);
}

.cr-error-boundary__custom-copy {
  margin-bottom: var(--space-4);
}

@media (prefers-reduced-motion: reduce) {
  .cr-toast,
  .cr-toast.is-removing,
  .cr-toast__spinner,
  .cr-progress__fill--rainbow,
  .cr-progress__glow,
  .cr-skeleton {
    animation: none;
  }
}

/* ── Section 30: Timeline Components (DAW) ── */

/* Timeline Bar */
.cr-timeline-bar {
  position: relative;
  height: 32px;
  background: var(--bg-secondary);
  cursor: pointer;
  user-select: none;
  overflow: hidden;
}

.cr-timeline-bar:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

/* Scene Block */
.cr-scene-block {
  position: relative;
  min-height: 60px;
  padding: 4px 8px 3px;
  background: rgba(130, 100, 255, 0.35);
  border: 1px solid rgba(130, 100, 255, 0.5);
  cursor: pointer;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 2px;
  color: rgba(255, 255, 255, 0.9);
  transition: filter var(--duration-fast) var(--ease-default), border-color var(--duration-fast) var(--ease-default);
}

.cr-scene-block:hover {
  filter: brightness(1.15);
}

.cr-scene-block.is-selected {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 1px var(--accent-primary);
}

.cr-scene-block:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

.cr-scene-block__header {
  display: flex;
  align-items: center;
  gap: 4px;
  line-height: 1;
}

.cr-scene-block__number {
  font-size: 9px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 0.03em;
}

.cr-scene-block__type-badge {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  width: fit-content;
  padding: 1px 5px;
  border-radius: 3px;
  background: var(--scene-type-badge-color, rgba(59, 130, 246, 0.3));
  color: var(--scene-type-badge-text, rgba(130, 180, 255, 0.95));
  font-size: 8px;
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: 1.4;
  white-space: nowrap;
}

.cr-scene-block__type-badge--ken-burns,
.cr-scene-block__type-badge--image {
  --scene-type-badge-color: rgba(45, 164, 78, 0.3);
  --scene-type-badge-text: rgba(120, 220, 140, 0.95);
}

.cr-scene-block__type-badge--video,
.cr-scene-block__type-badge--default {
  --scene-type-badge-color: rgba(59, 130, 246, 0.3);
  --scene-type-badge-text: rgba(130, 180, 255, 0.95);
}

.cr-scene-block__type-badge--fullscreen {
  --scene-type-badge-color: rgba(130, 100, 255, 0.3);
  --scene-type-badge-text: rgba(180, 160, 255, 0.95);
}

.cr-scene-block__type-badge--split-screen {
  --scene-type-badge-color: rgba(212, 167, 44, 0.3);
  --scene-type-badge-text: rgba(240, 210, 100, 0.95);
}

.cr-scene-block__type-badge--parallax {
  --scene-type-badge-color: rgba(100, 220, 220, 0.3);
  --scene-type-badge-text: rgba(160, 240, 240, 0.95);
}

.cr-scene-block__type-badge--overlay {
  --scene-type-badge-color: rgba(255, 100, 100, 0.3);
  --scene-type-badge-text: rgba(255, 160, 160, 0.95);
}

.cr-scene-block__body {
  display: grid;
  gap: 2px;
}

.cr-scene-block__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cr-scene-block__asset-name {
  margin-top: 0;
  color: rgba(255, 255, 255, 0.55);
  font-size: 9px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cr-scene-block__duration {
  color: rgba(255, 255, 255, 0.3);
  font-size: 8px;
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
  line-height: 1;
}

.cr-scene-block__lut-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  position: absolute;
  top: 4px;
  right: 4px;
  background: var(--scene-lut-dot-color, transparent);
  cursor: help;
}

/* ═══════════════════════════════════════════════
   Section 32 — Root Layout: Fallback Shell
   ═══════════════════════════════════════════════ */

.cr-fallback-shell {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  padding: var(--space-12);
}

.cr-fallback-shell__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  text-align: center;
}

.cr-fallback-shell__icon {
  font-size: 48px;
  color: var(--text-tertiary);
}

.cr-fallback-shell__message {
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 400;
  letter-spacing: -0.2px;
  color: var(--text-secondary);
}

.cr-fallback-shell__retry {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  height: 36px;
  padding: 0 16px;
  background: var(--accent-primary);
  color: var(--text-on-accent);
  border: 1px solid var(--accent-primary);
  border-radius: var(--radius-btn);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.2px;
  cursor: pointer;
  transition: background var(--duration-interaction) var(--ease-default);
}

.cr-fallback-shell__retry:hover {
  background: var(--accent-primary-hover);
}

.cr-fallback-shell__retry:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

[x-cloak] {
  display: none !important;
}

/* ========================================
   Section 34: Dashboard Sidebar
   ======================================== */

.dashboard-sidebar__content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.dashboard-sidebar__section-label {
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
  padding: 12px 12px 4px;
  transition: opacity 100ms ease-in-out;
}

.dashboard-sidebar__section-label--hidden {
  opacity: 0;
  height: 0;
  overflow: hidden;
  padding: 0;
  margin: 0;
  pointer-events: none;
}

.dashboard-sidebar__nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: none;
  border-left: 2px solid transparent;
  border-radius: var(--radius-3);
  background: transparent;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 400;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 150ms var(--ease-default), color 150ms var(--ease-default);
  width: 100%;
  text-align: left;
  text-decoration: none;
}

.dashboard-sidebar__nav-item:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}

.dashboard-sidebar__nav-item:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: -2px;
}

.dashboard-sidebar__nav-item--active {
  background: var(--surface-active);
  color: var(--text-primary);
  border-left-color: var(--accent-primary);
}

.dashboard-sidebar__nav-icon {
  flex-shrink: 0;
  color: inherit;
}

.dashboard-sidebar__nav-label {
  white-space: nowrap;
  overflow: hidden;
  transition: opacity 100ms ease-in-out;
}

.dashboard-sidebar__nav-label--hidden {
  opacity: 0;
  width: 0;
  overflow: hidden;
}

.dashboard-sidebar__divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 8px 0;
}

.dashboard-sidebar__footer {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border-default);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dashboard-sidebar__footer-avatar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dashboard-sidebar__avatar-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-overlay);
  border: 1px solid var(--border-default);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  flex-shrink: 0;
}

.dashboard-sidebar__collapse-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
  border-radius: var(--radius-2);
  transition: color 150ms var(--ease-default);
}

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

.dashboard-sidebar__collapse-btn:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: -2px;
}

/* ========================================
   Section 34: Dashboard Header
   ======================================== */

.dashboard-header__left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.dashboard-header__logo {
  height: 28px;
  width: auto;
  display: block;
  flex-shrink: 0;
}

.dashboard-header__breadcrumb-sep {
  font-size: 12px;
  color: var(--text-tertiary);
  opacity: 0.5;
  line-height: 1;
}

.dashboard-header__breadcrumb {
  font-size: 13px;
  font-weight: 400;
  line-height: 1;
  color: var(--text-tertiary);
}

.dashboard-header__breadcrumb-link {
  text-decoration: none;
  transition: color 150ms var(--ease-default);
}

.dashboard-header__breadcrumb-link:hover {
  color: var(--text-primary);
}

.dashboard-header__workspace-name {
  font-size: 13px;
  font-weight: 400;
  letter-spacing: -0.2px;
  color: var(--text-primary);
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dashboard-header__workspace-cta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--text-tertiary);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: color 150ms var(--ease-default);
}

.dashboard-header__workspace-cta:hover {
  color: var(--text-primary);
}

.dashboard-header__right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dashboard-header__badge {
  font-family: var(--font-mono);
  font-size: 11px;
  background: var(--gray-a2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 4px 10px;
  color: var(--text-secondary);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.dashboard-header__badge--tests .ph {
  font-size: 13px;
}

.dashboard-header__badge--clickable {
  cursor: pointer;
  transition: border-color 150ms var(--ease-default);
}

.dashboard-header__badge--clickable:hover {
  border-color: var(--border-hover);
}

.dashboard-header__badge-wrapper,
.dashboard-header__avatar-wrapper {
  position: relative;
}

.dashboard-header__icon-btn {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: var(--radius-2);
  position: relative;
  transition: color 150ms var(--ease-default);
}

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

.dashboard-header__icon-btn:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: -2px;
}

.dashboard-header__notification-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--error);
}

.dashboard-header__avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--border-default);
  background: var(--bg-overlay);
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dashboard-header__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.dashboard-header__dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--bg-raised);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-4);
  z-index: 300;
  min-width: 200px;
  padding: 4px 0;
}

.dashboard-header__dropdown--avatar {
  min-width: 200px;
}

.dashboard-header__dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 12px;
  background: none;
  border: none;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 400;
  color: var(--text-secondary);
  cursor: pointer;
  text-align: left;
  transition: background 150ms var(--ease-default), color 150ms var(--ease-default);
}

.dashboard-header__dropdown-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.dashboard-header__dropdown-item--danger:hover {
  color: var(--error);
}

.dashboard-header__dropdown-divider {
  height: 1px;
  background: var(--border-default);
  margin: 4px 0;
}

/* ========================================
   Section 34: Workspace Tabs
   ======================================== */

.workspace-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-default);
  gap: 0;
}

.workspace-tabs__tab {
  margin-bottom: -1px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-bottom-color: transparent;
  position: relative;
  z-index: 0;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  cursor: pointer;
  transition:
    background-color var(--duration-normal) var(--ease-default),
    border-color var(--duration-normal) var(--ease-default),
    color var(--duration-normal) var(--ease-default);
}

.workspace-tabs__tab:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.workspace-tabs__tab:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: -2px;
}

.workspace-tabs__tab--active {
  margin-left: -1px;
  margin-right: -1px;
  background: var(--accent-muted);
  color: var(--accent-primary);
  border-color: var(--border-default);
  border-bottom-color: var(--bg-raised);
  z-index: 1;
}

.workspace-tabs__content {
  padding: 16px 0;
}

@media (min-width: 768px) {
  .dashboard-tabs-wrapper {
    margin-left: -32px;
    margin-right: -32px;
  }

  .workspace-tabs {
    padding-left: 32px;
    padding-right: 32px;
  }

  .workspace-tabs__content {
    padding-left: 32px;
    padding-right: 32px;
  }
}

/* ========================================
   Section 34: Bottom Tab Bar
   ======================================== */

.bottom-tab-bar__tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 12px;
  border: none;
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 10px;
  transition: color 150ms var(--ease-default);
}

.bottom-tab-bar__tab:hover,
.bottom-tab-bar__tab--active {
  color: var(--text-primary);
}

.bottom-tab-bar__label {
  font-size: 10px;
  font-weight: 500;
}

/* ========================================
   Section 34: Mobile Header Compaction
   ======================================== */

@media (max-width: 767px) {
  /* Hide breadcrumbs and workspace name in header on mobile — shown in secondary bar */
  .dashboard-header__breadcrumb-sep,
  .dashboard-header__breadcrumb,
  .dashboard-header__workspace-name,
  .dashboard-header__workspace-cta {
    display: none;
  }

  /* Hide workspace tabs on mobile — bottom tab bar replaces them */
  .workspace-tabs {
    display: none !important;
  }

  .dashboard-header__workspace-name {
    font-size: 13px;
    max-width: 140px;
  }

  .dashboard-header__logo {
    height: 22px;
  }

  /* Compact right-side items */
  .dashboard-header__right {
    gap: 8px;
  }

  .dashboard-header__badge {
    font-size: 10px;
    padding: 2px 8px;
  }

  .dashboard-header__icon-btn {
    width: 28px;
    height: 28px;
  }

  .dashboard-header__avatar {
    width: 24px;
    height: 24px;
  }

  .dashboard-header__left {
    gap: 6px;
  }

  /* Mobile breadcrumb bar — replaces workspace tabs on small screens */
  .dashboard-mobile-breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 0;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--border-default);
    font-family: var(--font-sans);
    font-size: 12px;
    color: var(--text-tertiary);
  }

  .dashboard-mobile-breadcrumb__sep {
    opacity: 0.4;
  }

  .dashboard-mobile-breadcrumb__segment {
    color: var(--text-tertiary);
  }

  .dashboard-mobile-breadcrumb__link {
    text-decoration: none;
  }

  .dashboard-mobile-breadcrumb__link:hover {
    color: var(--text-primary);
  }

  .dashboard-mobile-breadcrumb__workspace {
    color: var(--text-primary);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
  }
}

/* Desktop: hide mobile breadcrumb bar */
@media (min-width: 768px) {
  .dashboard-mobile-breadcrumb {
    display: none;
  }
}