/* ============================================================
   CAD Icons Catalog — Flutter
   Design System: shadcn/ui & Iconsax.io inspired
   Monochrome (Zinc/Slate) + ~10% Blue Accent
   ============================================================ */

:root {
  /* Light Theme (Clean Monochrome + Blue Accent) */
  --background: #ffffff;
  --foreground: #09090b; /* zinc-950 */
  --card: #ffffff;
  --card-foreground: #09090b;
  --card-hover: #f4f4f5; /* zinc-100 */
  
  --popover: #ffffff;
  --popover-foreground: #09090b;

  --muted: #f4f4f5; /* zinc-100 */
  --muted-foreground: #71717a; /* zinc-500 */
  
  --border: #e4e4e7; /* zinc-200 */
  --border-subtle: #f4f4f5; /* zinc-100 */
  --input: #e4e4e7;

  /* Blue Accent (~10% usage strictly) */
  --primary: #2563eb; /* blue-600 */
  --primary-hover: #1d4ed8; /* blue-700 */
  --primary-foreground: #ffffff;
  --primary-subtle: rgba(37, 99, 235, 0.08);

  --secondary: #f4f4f5;
  --secondary-foreground: #18181b;
  --secondary-hover: #e4e4e7;

  --ring: rgba(37, 99, 235, 0.35);

  --radius: 8px;
  --radius-sm: 6px;
  --radius-lg: 12px;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  --icon-color: #09090b;
}

html.dark {
  /* Dark Theme (Crisp Zinc-950 + Subtle Zinc Borders) */
  --background: #09090b; /* zinc-950 */
  --foreground: #fafafa; /* zinc-50 */
  --card: #09090b;
  --card-foreground: #fafafa;
  --card-hover: #18181b; /* zinc-900 */

  --popover: #09090b;
  --popover-foreground: #fafafa;

  --muted: #18181b; /* zinc-900 */
  --muted-foreground: #a1a1aa; /* zinc-400 */

  --border: #27272a; /* zinc-800 */
  --border-subtle: #1f1f23;
  --input: #27272a;

  /* Blue Accent (~10% usage strictly) */
  --primary: #2563eb;
  --primary-hover: #3b82f6;
  --primary-foreground: #ffffff;
  --primary-subtle: rgba(37, 99, 235, 0.15);

  --secondary: #27272a;
  --secondary-foreground: #fafafa;
  --secondary-hover: #3f3f46;

  --ring: rgba(59, 130, 246, 0.35);

  --icon-color: #fafafa;
}

/* ============================================================
   Base Reset
   ============================================================ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-sans);
  background-color: var(--background);
  color: var(--foreground);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.15s ease, color 0.15s ease;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

code, kbd {
  font-family: var(--font-mono);
}

/* ============================================================
   Buttons & UI Primitives (shadcn style)
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1;
  padding: 0.5rem 0.875rem;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-sm {
  padding: 0.375rem 0.65rem;
  font-size: 0.775rem;
  height: 32px;
}

.btn-xs {
  padding: 0.25rem 0.5rem;
  font-size: 0.7rem;
  height: 26px;
}

.btn-icon {
  width: 32px;
  height: 32px;
  padding: 0;
}

.btn-primary {
  background-color: var(--primary);
  color: var(--primary-foreground);
}
.btn-primary:hover {
  background-color: var(--primary-hover);
}

.btn-outline {
  border: 1px solid var(--border);
  background-color: transparent;
  color: var(--foreground);
}
.btn-outline:hover {
  background-color: var(--muted);
  border-color: var(--muted-foreground);
}

.btn-ghost {
  background-color: transparent;
  color: var(--muted-foreground);
}
.btn-ghost:hover {
  background-color: var(--muted);
  color: var(--foreground);
}

.btn-secondary {
  background-color: var(--secondary);
  color: var(--secondary-foreground);
}
.btn-secondary:hover {
  background-color: var(--secondary-hover);
}

/* ============================================================
   Site Header (Minimalist Sticky Navbar)
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background-color: var(--background);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
}

.header-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0.65rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.brand-logo {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background-color: var(--primary-subtle);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(37, 99, 235, 0.2);
}

.brand-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.brand-title {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.brand-badge {
  font-size: 0.675rem;
  font-family: var(--font-mono);
  font-weight: 500;
  padding: 0.1rem 0.4rem;
  border-radius: 9999px;
  background-color: var(--muted);
  color: var(--muted-foreground);
  border: 1px solid var(--border);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

html.dark .sun-icon { display: block; }
html.dark .moon-icon { display: none; }
html:not(.dark) .sun-icon { display: none; }
html:not(.dark) .moon-icon { display: block; }

/* ============================================================
   Page Container & Hero Section
   ============================================================ */
.page-container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem 1.5rem;
  width: 100%;
  flex: 1;
}

.hero-section {
  text-align: center;
  margin-bottom: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  background-color: var(--muted);
  border: 1px solid var(--border);
  color: var(--muted-foreground);
  margin-bottom: 0.75rem;
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--primary);
}

.hero-title {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--foreground);
  margin-bottom: 0.35rem;
}

.hero-desc {
  font-size: 0.925rem;
  color: var(--muted-foreground);
  max-width: 580px;
}

.hero-desc code {
  color: var(--primary);
  background-color: var(--primary-subtle);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-size: 0.85em;
}

/* ============================================================
   Toolbar: Search & Dropdowns (shadcn Select Style)
   ============================================================ */
.toolbar-section {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1.25rem;
}

.search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.search-icon {
  position: absolute;
  left: 0.85rem;
  color: var(--muted-foreground);
  pointer-events: none;
}

#searchInput {
  width: 100%;
  height: 38px;
  padding: 0 3.5rem 0 2.5rem;
  font-size: 0.85rem;
  font-family: inherit;
  color: var(--foreground);
  background-color: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  outline: none;
  transition: all 0.15s ease;
}

#searchInput:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--ring);
}

#searchInput::placeholder {
  color: var(--muted-foreground);
  font-size: 0.825rem;
}

.clear-btn {
  position: absolute;
  right: 2.85rem;
  color: var(--muted-foreground);
  font-size: 0.75rem;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  display: none;
}
.clear-btn.visible { display: block; }
.clear-btn:hover { color: var(--foreground); }

.kbd-badge {
  position: absolute;
  right: 0.75rem;
  padding: 0.15rem 0.45rem;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--muted-foreground);
  background-color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 4px;
  pointer-events: none;
}

.controls-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ============================================================
   Dropdown Component (shadcn Select replica)
   ============================================================ */
.dropdown {
  position: relative;
}

.dropdown-trigger {
  height: 38px;
  padding: 0 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--foreground);
  background-color: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all 0.15s ease;
  white-space: nowrap;
}

.dropdown-trigger:hover {
  background-color: var(--card-hover);
  border-color: var(--muted-foreground);
}

.select-icon, .chevron-icon {
  color: var(--muted-foreground);
  flex-shrink: 0;
}

.selected-text {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.select-badge {
  font-size: 0.7rem;
  font-family: var(--font-mono);
  padding: 0.05rem 0.35rem;
  border-radius: 10px;
  background-color: var(--muted);
  color: var(--muted-foreground);
  border: 1px solid var(--border);
}

.dropdown-content {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 240px;
  max-height: 320px;
  overflow-y: auto;
  z-index: 50;
  background-color: var(--popover);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.35rem;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.25), 0 8px 10px -6px rgba(0, 0, 0, 0.2);
  animation: dropdownIn 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes dropdownIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 0.65rem;
  font-size: 0.8125rem;
  color: var(--foreground);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.1s ease;
}

.dropdown-item:hover {
  background-color: var(--muted);
}

.dropdown-item.active {
  background-color: var(--primary-subtle);
  color: var(--primary);
  font-weight: 600;
}

.item-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow: hidden;
}

.item-count {
  font-size: 0.7rem;
  font-family: var(--font-mono);
  color: var(--muted-foreground);
  background-color: var(--muted);
  padding: 0.05rem 0.3rem;
  border-radius: 4px;
}

/* Color Dropdown Specifics */
.color-preview-circle {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.color-menu {
  min-width: 200px;
  padding: 0.5rem;
}

.color-menu-header {
  font-size: 0.725rem;
  font-weight: 600;
  color: var(--muted-foreground);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.25rem 0.35rem 0.5rem 0.35rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.5rem;
}

.color-options-grid {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.color-swatch-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.35rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  color: var(--foreground);
  transition: background-color 0.12s;
  width: 100%;
  text-align: left;
}

.color-swatch-item:hover {
  background-color: var(--muted);
}

.color-swatch-item.active {
  background-color: var(--primary-subtle);
  color: var(--primary);
  font-weight: 600;
}

.swatch-circle {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.color-custom-row {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.custom-label {
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

#gridCustomColorInput {
  width: 28px;
  height: 24px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
}

/* ============================================================
   Segmented Control (shadcn Toggle Group)
   ============================================================ */
.segmented-control {
  display: inline-flex;
  align-items: center;
  background-color: var(--muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2px;
  height: 38px;
}

.segment-btn, .bg-opt-btn {
  padding: 0.25rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted-foreground);
  border-radius: var(--radius-sm);
  transition: all 0.12s ease;
  height: 100%;
}

.segment-btn:hover, .bg-opt-btn:hover {
  color: var(--foreground);
}

.segment-btn.active, .bg-opt-btn.active {
  background-color: var(--card);
  color: var(--foreground);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  font-weight: 600;
}

/* ============================================================
   Meta Status Row
   ============================================================ */
.meta-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  font-size: 0.8125rem;
  color: var(--muted-foreground);
  flex-wrap: wrap;
  gap: 0.5rem;
}

.count-number {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--foreground);
}

.active-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background-color: var(--primary-subtle);
  color: var(--primary);
  border: 1px solid rgba(37, 99, 235, 0.2);
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  margin-left: 0.5rem;
}

.active-chip button {
  font-size: 0.7rem;
  color: var(--primary);
  opacity: 0.75;
}
.active-chip button:hover { opacity: 1; }

.meta-copy-hint {
  font-size: 0.775rem;
  color: var(--muted-foreground);
}

/* ============================================================
   Icons Grid & Cards (Minimalist Iconsax Style)
   ============================================================ */
.icons-grid {
  display: grid;
  gap: 0.75rem;
}

.icons-grid.size-sm {
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
}
.icons-grid.size-md {
  grid-template-columns: repeat(auto-fill, minmax(135px, 1fr));
}
.icons-grid.size-lg {
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
}

.icon-card {
  background-color: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 0.5rem 0.75rem 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  cursor: pointer;
  transition: all 0.15s ease;
  aspect-ratio: 1 / 1;
  justify-content: center;
}

.icon-card:hover {
  background-color: var(--card-hover);
  border-color: var(--muted-foreground);
}

.icon-card-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--icon-color);
  transition: transform 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  margin-bottom: 0.5rem;
}

.icons-grid.size-sm .icon-card-preview { width: 28px; height: 28px; }
.icons-grid.size-md .icon-card-preview { width: 36px; height: 36px; }
.icons-grid.size-lg .icon-card-preview { width: 48px; height: 48px; }

.icon-card-preview svg {
  width: 100%;
  height: 100%;
  display: block;
}

.icon-card:hover .icon-card-preview {
  transform: scale(1.08);
}

.icon-card-title {
  font-size: 0.725rem;
  font-family: var(--font-mono);
  color: var(--muted-foreground);
  max-width: 90%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 0.15s ease;
}

.icon-card:hover .icon-card-title {
  color: var(--foreground);
}

/* Quick Copy pill on hover (Iconsax style) */
.card-quick-pill {
  position: absolute;
  bottom: 0.4rem;
  background-color: var(--foreground);
  color: var(--background);
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  opacity: 0;
  transform: translateY(4px);
  pointer-events: none;
  transition: all 0.15s ease;
}

.icon-card:hover .card-quick-pill {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.card-quick-pill:hover {
  background-color: var(--primary);
  color: #ffffff;
}

/* ============================================================
   Empty State (shadcn style)
   ============================================================ */
.empty-state {
  text-align: center;
  padding: 4rem 1.5rem;
  background-color: var(--card);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
  margin: 2rem 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.empty-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted-foreground);
  margin-bottom: 0.85rem;
}

.empty-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.empty-desc {
  font-size: 0.825rem;
  color: var(--muted-foreground);
  margin-bottom: 1.25rem;
}

/* ============================================================
   Detail Dialog / Sheet (shadcn Dialog style)
   ============================================================ */
.dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.dialog-backdrop {
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.dialog-content {
  position: relative;
  z-index: 101;
  background-color: var(--popover);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.5);
  width: 100%;
  max-width: 820px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: dialogScaleIn 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes dialogScaleIn {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1); }
}

.dialog-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dialog-title {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.dialog-category-badge {
  font-size: 0.7rem;
  font-family: var(--font-mono);
  color: var(--muted-foreground);
  background-color: var(--muted);
  border: 1px solid var(--border);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  margin-left: 0.5rem;
}

.dialog-nav-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.dialog-body {
  padding: 1.25rem;
  overflow-y: auto;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1.25rem;
}

/* Left: Preview Box & Settings */
.preview-column {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.canvas-box {
  width: 100%;
  height: 190px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
}

.canvas-box.checker-dark {
  background-color: #09090b;
  background-image: linear-gradient(45deg, #18181b 25%, transparent 25%),
                    linear-gradient(-45deg, #18181b 25%, transparent 25%),
                    linear-gradient(45deg, transparent 75%, #18181b 75%),
                    linear-gradient(-45deg, transparent 75%, #18181b 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0px;
}

.canvas-box.checker-light {
  background-color: #f4f4f5;
  background-image: linear-gradient(45deg, #e4e4e7 25%, transparent 25%),
                    linear-gradient(-45deg, #e4e4e7 25%, transparent 25%),
                    linear-gradient(45deg, transparent 75%, #e4e4e7 75%),
                    linear-gradient(-45deg, transparent 75%, #e4e4e7 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0px;
}

.canvas-box.solid-dark { background: #000000; }
.canvas-box.solid-light { background: #ffffff; }

.svg-stage {
  display: flex;
  align-items: center;
  justify-content: center;
}
.svg-stage svg {
  width: 100%;
  height: 100%;
}

.preview-settings {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.setting-item {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.setting-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted-foreground);
}

.slider-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.slider-value {
  font-size: 0.725rem;
  font-family: var(--font-mono);
  color: var(--muted-foreground);
}

.range-slider {
  width: 100%;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
  accent-color: var(--primary);
}

.modal-palette {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.m-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid var(--border);
  transition: transform 0.12s, box-shadow 0.12s;
}
.m-dot:hover { transform: scale(1.15); }
.m-dot.active {
  box-shadow: 0 0 0 2px var(--background), 0 0 0 4px var(--primary);
}

.custom-picker-btn {
  position: relative;
  overflow: hidden;
  background: conic-gradient(red, yellow, lime, aqua, blue, magenta, red);
  cursor: pointer;
}
.custom-picker-btn input[type="color"] {
  position: absolute;
  opacity: 0;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.w-full { width: 100%; }

/* Right: Code Column & shadcn Tabs */
.code-column {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.tabs-list {
  display: inline-flex;
  align-items: center;
  background-color: var(--muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2px;
  width: 100%;
}

.tab-trigger {
  flex: 1;
  padding: 0.35rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted-foreground);
  border-radius: var(--radius-sm);
  text-align: center;
  transition: all 0.12s ease;
}

.tab-trigger:hover { color: var(--foreground); }
.tab-trigger.active {
  background-color: var(--card);
  color: var(--foreground);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  font-weight: 600;
}

.tab-panels {
  display: flex;
  flex-direction: column;
}

.tab-pane {
  display: none;
  flex-direction: column;
  gap: 0.5rem;
}
.tab-pane.active { display: flex; }

.snippet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.snippet-tag {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--muted-foreground);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

pre {
  background-color: var(--muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.775rem;
  line-height: 1.55;
  color: var(--foreground);
  max-height: 210px;
}

.snippet-callout {
  font-size: 0.75rem;
  color: var(--muted-foreground);
  background-color: var(--primary-subtle);
  border-left: 2px solid var(--primary);
  padding: 0.4rem 0.65rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.snippet-callout code {
  color: var(--primary);
}

.enum-copy-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  background-color: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem 0.75rem;
}

.enum-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow: hidden;
}

.enum-label {
  font-size: 0.725rem;
  color: var(--muted-foreground);
}

.enum-info code {
  font-size: 0.775rem;
  color: var(--primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ============================================================
   Guide Dialog & Cards
   ============================================================ */
.guide-dialog-width {
  max-width: 640px;
}

.guide-dialog-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.guide-card {
  display: flex;
  gap: 0.85rem;
  padding: 0.85rem;
  background-color: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.guide-step-badge {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background-color: var(--primary);
  color: var(--primary-foreground);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

.guide-step-body {
  flex: 1;
}

.guide-step-body h4 {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.guide-step-body pre {
  margin-top: 0.35rem;
}

.guide-hint {
  font-size: 0.8rem;
  color: var(--muted-foreground);
}

/* ============================================================
   Toast (shadcn Sonner style)
   ============================================================ */
.toast-wrapper {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 200;
  animation: toastSlideUp 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes toastSlideUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.toast-card {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background-color: var(--foreground);
  color: var(--background);
  padding: 0.55rem 0.85rem;
  border-radius: var(--radius);
  font-size: 0.8rem;
  font-weight: 500;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
}

.toast-icon-check {
  color: var(--primary);
  font-weight: bold;
}

/* ============================================================
   Site Footer
   ============================================================ */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.25rem 1.5rem;
  font-size: 0.775rem;
  color: var(--muted-foreground);
  margin-top: auto;
}

.footer-inner {
  max-width: 1320px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.footer-links a:hover {
  color: var(--foreground);
}

/* Utility */
.hidden { display: none !important; }

/* Responsive adjustments */
@media (max-width: 768px) {
  .toolbar-section {
    grid-template-columns: 1fr;
  }
  .controls-row {
    flex-wrap: wrap;
  }
  .dialog-body {
    grid-template-columns: 1fr;
  }
  .canvas-box {
    height: 150px;
  }
}
