/* ==========================================================================
   AuraCraft — Minimal Luxury Gemstone Studio Stylesheet
   Refined, Uncluttered, Modern Fine Jewelry Aesthetic
   ========================================================================== */

:root {
  /* Refined, Calm Color System */
  --bg-app: #0e1015;
  --bg-panel: #141720;
  --bg-card: #1a1e29;
  --bg-hover: #222736;
  --bg-active: #2a3042;
  
  /* Subtle Borders & Dividers */
  --border-subtle: rgba(255, 255, 255, 0.07);
  --border-medium: rgba(255, 255, 255, 0.12);
  --border-focus: rgba(201, 169, 110, 0.4);

  /* Refined Champagne Gold & Accents */
  --accent-gold: #c9a96e;
  --accent-gold-light: #e6d3af;
  --accent-gold-muted: rgba(201, 169, 110, 0.12);
  --accent-green: #34d399;
  
  /* Clean Typography Colors */
  --text-main: #f1f3f7;
  --text-muted: #8e95a5;
  --text-subtle: #5f6677;

  /* Sizing & Radius */
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-pill: 9999px;
  --transition-fast: 0.15s ease;
  --transition-smooth: 0.25s ease;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-app);
  color: var(--text-main);
  min-height: 100vh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   Universal Luxury Custom Scrollbar System
   ========================================================================== */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(201, 169, 110, 0.35) rgba(14, 16, 21, 0.6);
}

::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

::-webkit-scrollbar-track {
  background: rgba(14, 16, 21, 0.5);
  border-radius: 6px;
}

::-webkit-scrollbar-thumb {
  background: rgba(201, 169, 110, 0.28);
  border-radius: 6px;
  border: 1px solid rgba(14, 16, 21, 0.6);
  transition: background 0.2s ease, border-color 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(201, 169, 110, 0.58);
  border-color: rgba(201, 169, 110, 0.2);
}

::-webkit-scrollbar-corner {
  background: transparent;
}

/* App Container Layout */
.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  width: 100vw;
  overflow: hidden;
}

/* ==========================================================================
   1. Clean Minimal Top Header
   ========================================================================== */
/* ==========================================================================
   1. Clean Minimal Top Header & Multi-View Navigation (Epic 6)
   ========================================================================== */
.studio-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 20px;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
  z-index: 50;
  gap: 12px;
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.brand-logo-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--accent-gold-muted);
  border: 1px solid rgba(201, 169, 110, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-gold);
  font-size: 14px;
}

.brand-text h1 {
  font-family: 'Cinzel', Georgia, serif;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-main);
  line-height: 1.1;
}

.brand-text .tagline {
  font-size: 0.62rem;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* Primary Multi-Page View Navigation Tabs */
.view-nav-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-card);
  padding: 3px 4px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.nav-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-xs);
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.nav-tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.04);
}

.nav-tab-btn.active {
  background: var(--bg-panel);
  color: var(--accent-gold-light);
  font-weight: 600;
  border-color: rgba(201, 169, 110, 0.3);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.nav-tab-btn i {
  font-size: 0.8rem;
}
.nav-tab-btn.active i {
  color: var(--accent-gold);
}

/* Live Dynamic Price Ticker */
.header-price-ticker {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-pill);
  padding: 4px 14px 4px 16px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.header-price-ticker:hover {
  background: var(--bg-hover);
  border-color: var(--accent-gold);
  transform: translateY(-1px);
}

.ticker-content {
  display: flex;
  align-items: center;
  gap: 10px;
}

.price-main {
  display: flex;
  align-items: baseline;
  color: var(--accent-gold-light);
  font-weight: 700;
}

.price-currency {
  font-size: 0.85rem;
  margin-right: 2px;
}

.price-val {
  font-size: 1.15rem;
  font-family: 'Space Grotesk', monospace;
  letter-spacing: -0.5px;
}

.price-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.price-mrp-strike {
  font-size: 0.65rem;
  color: var(--text-subtle);
  text-decoration: line-through;
  font-family: 'Space Grotesk', monospace;
}

.price-discount-tag {
  font-size: 0.62rem;
  color: var(--accent-green);
  font-weight: 600;
}

.pricing-gear-btn {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  transition: all var(--transition-fast);
}

.header-price-ticker:hover .pricing-gear-btn {
  color: var(--accent-gold);
  border-color: var(--accent-gold);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  transition: all var(--transition-fast);
}

.action-btn:hover:not(:disabled) {
  background: var(--bg-hover);
  border-color: var(--border-medium);
}

.action-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.action-btn.primary {
  background: #2563eb;
  color: #fff;
  border-color: #3b82f6;
}
.action-btn.primary:hover:not(:disabled) {
  background: #1d4ed8;
}

.action-btn.gold {
  background: var(--accent-gold);
  color: #0e1015;
  font-weight: 600;
  border-color: var(--accent-gold);
}
.action-btn.gold:hover:not(:disabled) {
  background: var(--accent-gold-light);
}

.action-btn.danger {
  color: #f87171;
}
.action-btn.danger:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.25);
}

/* ==========================================================================
   2. Multi-View Architecture & Dynamic Workspace Grid (Epic 6)
   ========================================================================== */
.views-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  position: relative;
}

.app-view {
  display: none;
  width: 100%;
  height: 100%;
  min-height: 0;
  animation: fadeInView 0.2s ease-out;
}

.app-view.active {
  display: flex;
}

.app-view.studio-main.active {
  display: grid;
}

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

/* Studio Workspace Grid with Resizable Drawers */
:root {
  --left-sidebar-w: 320px;
  --right-sidebar-w: 330px;
}

.studio-main {
  display: grid;
  grid-template-columns: minmax(0, var(--left-sidebar-w, 320px)) 6px minmax(0, 1fr) 6px minmax(0, var(--right-sidebar-w, 330px));
  flex: 1;
  min-height: 0;
  overflow: hidden;
  transition: grid-template-columns 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.studio-main.palette-collapsed {
  grid-template-columns: 0px 0px minmax(0, 1fr) 6px minmax(0, var(--right-sidebar-w, 330px));
}
.studio-main.details-collapsed {
  grid-template-columns: minmax(0, var(--left-sidebar-w, 320px)) 6px minmax(0, 1fr) 0px 0px;
}
.studio-main.palette-collapsed.details-collapsed,
.studio-main.zen-mode {
  grid-template-columns: 0px 0px minmax(0, 1fr) 0px 0px;
}

.studio-main.palette-collapsed .palette-sidebar,
.studio-main.palette-collapsed #resizer-left,
.studio-main.details-collapsed .details-sidebar,
.studio-main.details-collapsed #resizer-right,
.studio-main.zen-mode .palette-sidebar,
.studio-main.zen-mode .details-sidebar,
.studio-main.zen-mode .sidebar-resizer {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
}

/* Sidebar Resizer Gutters */
.sidebar-resizer {
  width: 6px;
  cursor: col-resize;
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  touch-action: none;
  background: transparent;
  transition: background var(--transition-fast);
}

.sidebar-resizer:hover,
.sidebar-resizer.is-resizing {
  background: rgba(201, 169, 110, 0.18);
}

.sidebar-resizer .resizer-line {
  width: 2px;
  height: 32px;
  background: var(--border-medium);
  border-radius: 2px;
  transition: all var(--transition-fast);
}

.sidebar-resizer:hover .resizer-line,
.sidebar-resizer.is-resizing .resizer-line {
  background: var(--accent-gold);
  height: 54px;
  box-shadow: 0 0 8px rgba(201, 169, 110, 0.5);
}

/* Left Sidebar: Stones Catalog */
.palette-sidebar {
  background: var(--bg-panel);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
  transition: opacity 0.2s ease;
}

/* Right Sidebar: Details & BOM */
.details-sidebar {
  background: var(--bg-panel);
  border-left: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  min-width: 0;
  transition: opacity 0.2s ease;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.panel-header-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.panel-collapse-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  width: 24px;
  height: 24px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  transition: all var(--transition-fast);
}
.panel-collapse-btn:hover {
  color: var(--accent-gold);
  border-color: var(--accent-gold);
  background: var(--bg-hover);
}

/* Sidebar Internal Sub-Tabs */
.sidebar-subtabs {
  display: flex;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-subtle);
  padding: 2px 4px;
  gap: 4px;
  flex-shrink: 0;
}

.subtab-btn {
  flex: 1;
  padding: 6px 8px;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-radius: var(--radius-xs);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: all var(--transition-fast);
}
.subtab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.03);
}
.subtab-btn.active {
  color: var(--accent-gold-light);
  background: var(--bg-panel);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.subtab-pane {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

/* Stage Floating Toggles */
.stage-floating-toggles {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 20;
  pointer-events: auto;
}

.stage-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  background: rgba(18, 21, 26, 0.85);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 500;
  cursor: pointer;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  transition: all var(--transition-fast);
}
.stage-toggle-btn:hover {
  color: var(--text-main);
  border-color: var(--accent-gold);
  background: rgba(26, 30, 38, 0.95);
}
.stage-toggle-btn.zen-btn {
  color: var(--accent-gold-light);
}
.stage-toggle-btn.zen-btn.active {
  background: var(--accent-gold);
  color: #0d0f12;
  font-weight: 600;
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-title i {
  color: var(--accent-gold);
  font-size: 0.95rem;
}

.panel-title h2 {
  font-family: 'Cinzel', serif;
  font-size: 0.95rem;
  letter-spacing: 0.4px;
  color: var(--text-main);
}

.badge {
  background: var(--bg-card);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: 0.7rem;
  font-weight: 500;
}

/* Search & Placement Tool Bar */
.palette-filter-bar {
  padding: 10px 14px 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-box i.fa-magnifying-glass {
  position: absolute;
  left: 10px;
  color: var(--text-subtle);
  font-size: 0.8rem;
}

.search-box input {
  width: 100%;
  padding: 7px 28px 7px 32px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 0.8rem;
  font-family: inherit;
  outline: none;
  transition: all var(--transition-fast);
}

.search-box input:focus {
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 2px rgba(201, 169, 110, 0.15);
}

.clear-search-btn {
  position: absolute;
  right: 8px;
  background: none;
  border: none;
  color: var(--text-subtle);
  cursor: pointer;
  font-size: 0.8rem;
}

/* Tool Mode Bar */
.palette-mode-selector {
  display: flex;
  align-items: center;
}

.tool-btn-group {
  display: flex;
  gap: 3px;
  background: var(--bg-card);
  padding: 3px;
  border-radius: var(--radius-sm);
  width: 100%;
  border: 1px solid var(--border-subtle);
}

.tool-mode-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 5px 6px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: all var(--transition-fast);
}

.tool-mode-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.03);
}

.tool-mode-btn.active {
  background: rgba(201, 169, 110, 0.16);
  color: var(--accent-gold-light);
  font-weight: 600;
  border: 1px solid rgba(201, 169, 110, 0.35);
}

/* Active Stone Live Banner */
.active-stone-banner {
  margin: 10px 14px 2px;
  padding: 8px 12px;
  background: linear-gradient(135deg, rgba(26, 30, 38, 0.95) 0%, rgba(18, 21, 26, 0.98) 100%);
  border: 1px solid rgba(201, 169, 110, 0.28);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.active-stone-preview {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 0 8px rgba(201, 169, 110, 0.35));
}

.active-stone-details {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.active-stone-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.active-stone-title-row strong {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stone-rate-pill {
  font-size: 0.68rem;
  background: rgba(201, 169, 110, 0.15);
  color: var(--accent-gold-light);
  border: 1px solid rgba(201, 169, 110, 0.35);
  padding: 1px 7px;
  border-radius: var(--radius-pill);
  font-family: 'Space Grotesk', monospace;
  font-weight: 600;
}

.active-stone-subtext {
  font-size: 0.68rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

/* Stones Grid (Clean 2-Column Responsive Layout) */
.stones-grid-container {
  flex: 1;
  overflow-y: auto;
  padding: 8px 14px 20px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  min-height: 0;
}

.stones-grid-container::-webkit-scrollbar { width: 4px; }
.stones-grid-container::-webkit-scrollbar-thumb { background: var(--border-medium); border-radius: 4px; }

.stone-card {
  background: linear-gradient(180deg, rgba(26, 30, 38, 0.7) 0%, rgba(18, 21, 26, 0.9) 100%);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 8px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: grab;
  position: relative;
  transition: all var(--transition-fast);
  user-select: none;
}

.stone-card:hover {
  background: var(--bg-hover);
  border-color: rgba(201, 169, 110, 0.45);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

.stone-card.active {
  border-color: var(--accent-gold);
  background: linear-gradient(180deg, rgba(201, 169, 110, 0.15) 0%, rgba(18, 21, 26, 0.95) 100%);
  box-shadow: 0 0 14px rgba(201, 169, 110, 0.25), inset 0 0 0 1px rgba(201, 169, 110, 0.4);
}

.stone-bubble {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  margin-bottom: 6px;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.45));
  transition: transform var(--transition-fast);
}

.stone-card:hover .stone-bubble {
  transform: scale(1.06);
}

.stone-card .stone-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.25;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.stone-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-top: 3px;
  padding: 0 2px;
}

.stone-card .stone-card-sub {
  font-size: 0.64rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stone-card-rate {
  font-size: 0.69rem;
  color: var(--accent-gold-light);
  font-family: 'Space Grotesk', monospace;
  font-weight: 600;
}

.stone-chakra-tag {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.6);
}

/* Presets Ribbon */
.presets-section {
  padding: 10px 16px;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-panel);
}

.presets-section .section-title {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.presets-section .section-title i {
  color: var(--accent-gold);
  font-size: 0.75rem;
}

.presets-section .section-title h3 {
  font-family: 'Cinzel', serif;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.preset-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.preset-chip {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 4px 8px;
  border-radius: var(--radius-xs);
  font-size: 0.68rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all var(--transition-fast);
}

.preset-chip:hover {
  background: var(--bg-hover);
  color: var(--text-main);
  border-color: var(--border-medium);
}

.preset-dot { width: 6px; height: 6px; border-radius: 50%; }
.chakra-dot { background: #3b82f6; }
.wealth-dot { background: #eab308; }
.shield-dot { background: #64748b; }
.love-dot { background: #ec4899; }
.clarity-dot { background: #06b6d4; }
.royal-dot { background: #8b5cf6; }

/* ==========================================================================
   Center: Canvas Viewport & Controls (Streamlined Minimalist Luxury)
   ========================================================================== */
.stage-section {
  display: flex;
  flex-direction: column;
  background: #08090b;
  position: relative;
  overflow: hidden;
  height: 100%;
}

/* Floating Glassmorphic Stage Island (Top Center) */
.stage-floating-island {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px;
  background: rgba(18, 20, 24, 0.88);
  border: 1px solid rgba(212, 175, 55, 0.28);
  border-radius: var(--radius-pill);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 16px rgba(212, 175, 55, 0.08);
  z-index: 30;
  max-width: 94%;
}

.stage-island-btn {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all var(--transition-fast);
}
.stage-island-btn:hover {
  color: var(--text-main);
  border-color: var(--accent-gold);
  background: rgba(255, 255, 255, 0.05);
}
.stage-island-btn.zen-btn {
  color: var(--accent-gold-light);
  border-color: rgba(212, 175, 55, 0.4);
}
.stage-island-btn.zen-btn.active {
  background: var(--accent-gold);
  color: #0c0d10;
  font-weight: 600;
}

.island-group {
  display: flex;
  align-items: center;
  gap: 4px;
}

.island-group.bits-group {
  gap: 6px;
}

.island-value-badge {
  font-family: 'Space Grotesk', monospace;
  font-size: 0.75rem;
  font-weight: 600;
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
  padding: 3px 8px;
  border-radius: 4px;
  white-space: nowrap;
}

.island-subtext {
  font-size: 0.68rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.island-divider {
  width: 1px;
  height: 18px;
  background: rgba(255, 255, 255, 0.12);
  margin: 0 3px;
}

.island-select {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-size: 0.72rem;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  outline: none;
  cursor: pointer;
  transition: border-color var(--transition-fast);
}
.island-select:hover, .island-select:focus {
  border-color: var(--accent-gold);
}
.island-select option {
  background: #16181d;
  color: #fff;
}

.step-btn {
  width: 22px;
  height: 22px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  border-radius: 50%;
  font-weight: bold;
  font-size: 0.8rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}
.step-btn:hover {
  background: var(--accent-gold);
  color: #0c0d10;
  border-color: var(--accent-gold);
}

.segmented-control {
  display: flex;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  padding: 2px;
  gap: 2px;
}

.segment-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.segment-btn:hover {
  color: #fff;
}
.segment-btn.active {
  background: var(--accent-gold);
  color: #0c0d10;
  font-weight: 600;
}

/* Canvas Viewport */
.canvas-viewport {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: radial-gradient(circle at 50% 50%, #151820 0%, #08090b 80%);
}

#bracelet-canvas {
  width: 100%;
  max-width: 620px;
  height: auto;
  aspect-ratio: 1 / 1;
  z-index: 10;
  cursor: crosshair;
}

/* Unified Floating Canvas Action Dock (Bottom Center) */
.canvas-floating-dock {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  background: rgba(16, 18, 22, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-pill);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
  z-index: 25;
}

.dock-btn {
  width: 32px;
  height: 32px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-size: 0.8rem;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}
.dock-btn:hover:not(:disabled) {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
}
.dock-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.dock-btn.active {
  color: var(--accent-gold-light);
  background: rgba(212, 175, 55, 0.15);
  border-color: var(--accent-gold);
}
.dock-btn.danger:hover {
  color: #ff6b6b;
  background: rgba(255, 107, 107, 0.12);
  border-color: rgba(255, 107, 107, 0.3);
}

.dock-divider {
  width: 1px;
  height: 16px;
  background: rgba(255, 255, 255, 0.1);
  margin: 0 2px;
}

.bead-hover-card {
  position: absolute;
  pointer-events: none;
  background: var(--bg-panel);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 40;
  transform: translate(-50%, -120%);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  min-width: 210px;
}

.hover-stone-icon { width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0; }
.hover-header-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.hover-stone-info h4 { font-size: 0.8rem; color: var(--text-main); font-family: 'Cinzel', serif; }
.hover-stone-price { font-size: 0.72rem; color: var(--accent-gold-light); font-family: 'Space Grotesk', monospace; font-weight: 600; }
.hover-stone-info p { font-size: 0.68rem; color: var(--text-muted); }
.hover-meta { font-size: 0.64rem; color: var(--text-subtle); margin-top: 1px; }

.center-stage-pill {
  position: absolute;
  top: 66px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(18, 20, 24, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 3px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.68rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  pointer-events: none;
  z-index: 15;
  backdrop-filter: blur(8px);
}
.pill-dot { width: 5px; height: 5px; background: var(--accent-gold); border-radius: 50%; }

.sequence-ribbon-container {
  padding: 6px 14px 8px;
  background: var(--bg-panel);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 3px;
  z-index: 20;
}

.sequence-ribbon-container.compact-ribbon {
  padding: 4px 12px 6px;
}

.ribbon-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.68rem;
  color: var(--text-subtle);
}

.ribbon-title { display: flex; align-items: center; gap: 5px; }
.ribbon-actions { display: flex; gap: 4px; }

.mini-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.65rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.mini-btn:hover { background: var(--bg-hover); color: var(--text-main); }

.sequence-ribbon {
  display: flex;
  align-items: center;
  gap: 5px;
  overflow-x: auto;
  padding: 3px 2px;
  scrollbar-width: thin;
}
.sequence-ribbon::-webkit-scrollbar { height: 3px; }
.sequence-ribbon::-webkit-scrollbar-thumb { background: var(--border-medium); border-radius: 3px; }

.ribbon-bead-item {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  flex-shrink: 0;
  cursor: pointer;
  position: relative;
  transition: transform var(--transition-fast);
}
.ribbon-bead-item:hover { transform: scale(1.15); }
.ribbon-bead-item.active-slot { outline: 2px solid var(--accent-gold); outline-offset: 1px; }

/* ==========================================================================
   Right Panel: Details & Metaphysical Balance
   ========================================================================== */
.details-sidebar {
  background: var(--bg-panel);
  border-left: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 12px;
  gap: 10px;
}

.details-sidebar::-webkit-scrollbar { width: 4px; }
.details-sidebar::-webkit-scrollbar-thumb { background: var(--border-medium); border-radius: 3px; }

.panel-box {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.panel-box-header {
  display: flex;
  align-items: center;
  gap: 6px;
}

.panel-box-header i { color: var(--accent-gold); font-size: 0.85rem; }
.panel-box-header h3 { font-family: 'Cinzel', serif; font-size: 0.85rem; letter-spacing: 0.4px; color: var(--text-main); }
.mini-count { margin-left: auto; font-size: 0.68rem; color: var(--text-subtle); }

.mini-icon-btn {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--accent-gold);
  cursor: pointer;
  font-size: 0.85rem;
  transition: transform var(--transition-fast);
}
.mini-icon-btn:hover { transform: scale(1.15); }

/* Product & SKU Metadata Card (Epic 2) */
.product-meta-card {
  border-color: rgba(201, 169, 110, 0.2);
  background: var(--bg-card);
}

.status-badge {
  margin-left: auto;
  font-size: 0.64rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-badge.active {
  background: rgba(52, 211, 153, 0.12);
  color: var(--accent-green);
  border: 1px solid rgba(52, 211, 153, 0.3);
}

.status-badge.draft {
  background: rgba(251, 191, 36, 0.12);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.3);
}

.status-badge.sample {
  background: rgba(96, 165, 250, 0.12);
  color: #60a5fa;
  border: 1px solid rgba(96, 165, 250, 0.3);
}

.status-badge.archived {
  background: rgba(148, 163, 184, 0.12);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.product-meta-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.meta-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.meta-field label {
  font-size: 0.65rem;
  color: var(--text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.title-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.title-input-wrapper input {
  width: 100%;
  padding: 5px 28px 5px 8px;
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  color: var(--text-main);
  font-size: 0.76rem;
  font-weight: 500;
  font-family: inherit;
  outline: none;
  transition: border-color var(--transition-fast);
}

.title-input-wrapper input:focus {
  border-color: var(--border-focus);
}

.title-wand-btn {
  position: absolute;
  right: 6px;
  background: none;
  border: none;
  color: var(--accent-gold);
  cursor: pointer;
  font-size: 0.75rem;
  transition: transform var(--transition-fast);
}

.title-wand-btn:hover {
  transform: scale(1.2);
}

.sku-badge-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sku-badge {
  flex: 1;
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  padding: 5px 8px;
  font-family: 'Space Grotesk', monospace;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-gold-light);
  letter-spacing: 0.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.copy-sku-btn {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  width: 28px;
  height: 28px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  transition: all var(--transition-fast);
}

.copy-sku-btn:hover {
  color: var(--accent-gold);
  border-color: var(--accent-gold);
}

.meta-inline-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.meta-inline-grid select {
  padding: 4px 6px;
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  color: var(--text-main);
  font-size: 0.72rem;
  font-family: inherit;
  outline: none;
}

/* Pricing Quick Card in Sidebar */
.pricing-quick-card {
  border-color: rgba(201, 169, 110, 0.25);
  background: linear-gradient(180deg, rgba(26, 30, 41, 0.95), rgba(20, 23, 32, 0.95));
}

.quick-price-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.price-highlight-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.price-tag-big {
  display: flex;
  align-items: baseline;
  color: var(--accent-gold-light);
  font-weight: 700;
}
.price-tag-big .cur { font-size: 1rem; margin-right: 2px; }
.price-tag-big .val { font-size: 1.45rem; font-family: 'Space Grotesk', monospace; }

.price-mrp-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.2;
}

.price-mrp-side .mrp {
  font-size: 0.72rem;
  color: var(--text-subtle);
  text-decoration: line-through;
  font-family: 'Space Grotesk', monospace;
}

.price-mrp-side .save-tag {
  font-size: 0.68rem;
  color: var(--accent-green);
  font-weight: 600;
}

.price-mini-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  background: var(--bg-panel);
  padding: 6px;
  border-radius: var(--radius-xs);
}

.mini-stat {
  display: flex;
  flex-direction: column;
  font-size: 0.65rem;
}
.mini-stat span { color: var(--text-subtle); }
.mini-stat strong { color: var(--text-main); font-family: 'Space Grotesk', monospace; }

/* Energy & Chakra */
.energy-meter-group { display: flex; flex-direction: column; gap: 8px; }
.energy-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-subtle);
}
.energy-label span { display: block; font-size: 0.64rem; color: var(--text-subtle); text-transform: uppercase; }
.energy-label strong { font-size: 0.78rem; color: var(--text-main); }
.element-icons { display: flex; gap: 4px; }
.el-badge {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.62rem;
  color: var(--text-subtle);
}
.el-badge.active { background: var(--bg-active); color: var(--accent-gold-light); border-color: var(--border-medium); }

.chakra-bars { display: flex; flex-direction: column; gap: 5px; }
.chakra-bar-item { display: flex; align-items: center; gap: 6px; font-size: 0.68rem; }
.chakra-name { width: 65px; color: var(--text-muted); font-size: 0.65rem; }
.chakra-track { flex: 1; height: 4px; background: var(--bg-panel); border-radius: 2px; overflow: hidden; }
.chakra-fill { height: 100%; border-radius: 2px; transition: width 0.25s ease; }
.chakra-pct { width: 24px; text-align: right; font-size: 0.65rem; color: var(--text-subtle); font-family: 'Space Grotesk', monospace; }

/* Deep Dive Card */
.deepdive-header { display: flex; align-items: center; gap: 10px; }
.stone-large-thumb { width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0; border: 1px solid rgba(255, 255, 255, 0.15); }
.deepdive-title-area { flex: 1; }
.deepdive-name-row { display: flex; align-items: center; justify-content: space-between; }
.deepdive-title-area h3 { font-family: 'Cinzel', serif; font-size: 0.95rem; color: var(--text-main); }
.deepdive-price-pill { font-size: 0.68rem; color: var(--accent-gold-light); font-family: 'Space Grotesk', monospace; font-weight: 600; }
.deepdive-title-area .sub { font-size: 0.68rem; color: var(--text-muted); }
.deepdive-description { font-size: 0.72rem; color: var(--text-muted); line-height: 1.4; }
.deepdive-attributes { display: grid; grid-template-columns: 1fr; gap: 4px; background: var(--bg-panel); padding: 8px; border-radius: var(--radius-xs); }
.attr-item { display: flex; justify-content: space-between; font-size: 0.68rem; }
.attr-label { color: var(--text-subtle); }
.attr-val { color: var(--text-main); font-weight: 500; }
.attr-val.italic { font-style: italic; color: var(--accent-gold-light); }

.apply-to-all-btn {
  width: 100%;
  padding: 7px 10px;
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  border-radius: var(--radius-xs);
  font-size: 0.72rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all var(--transition-fast);
}
.apply-to-all-btn:hover { background: var(--bg-hover); border-color: var(--border-medium); }

/* Bill of Materials */
.bom-list { display: flex; flex-direction: column; gap: 4px; max-height: 150px; overflow-y: auto; }
.bom-list::-webkit-scrollbar { width: 3px; }
.bom-list::-webkit-scrollbar-thumb { background: var(--border-medium); }
.bom-item { display: flex; align-items: center; justify-content: space-between; padding: 5px 6px; background: var(--bg-panel); border-radius: 4px; font-size: 0.72rem; }
.bom-stone-info { display: flex; align-items: center; gap: 6px; }
.bom-mini-dot { width: 10px; height: 10px; border-radius: 50%; }
.bom-count { font-family: 'Space Grotesk', monospace; font-weight: 600; color: var(--text-main); }
.bom-footer { border-top: 1px solid var(--border-subtle); padding-top: 6px; }
.bom-specs { display: flex; justify-content: space-between; font-size: 0.68rem; color: var(--text-subtle); }
.bom-specs strong { color: var(--text-main); }

/* ==========================================================================
   Modals & Pricing Inspector (Epic 1)
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}

.modal-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  width: 100%;
  max-width: 500px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-height: 90vh;
}

.modal-card.wide {
  max-width: 780px;
}

.modal-header {
  padding: 12px 18px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal-title {
  display: flex;
  align-items: center;
  gap: 8px;
}
.modal-title i { color: var(--accent-gold); }
.modal-title h3 { font-family: 'Cinzel', serif; font-size: 0.95rem; }

/* Modal Tab Header */
.modal-tab-header {
  display: flex;
  gap: 4px;
  background: var(--bg-card);
  padding: 3px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-subtle);
}

.modal-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition-fast);
}

.modal-tab-btn.active {
  background: var(--bg-active);
  color: var(--text-main);
  font-weight: 600;
}

.close-modal-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
}
.close-modal-btn:hover { color: var(--text-main); }

.modal-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
}

/* Pricing Summary Banner */
.pricing-summary-banner {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 10px;
}

.sum-box {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
}

.sum-box.highlight {
  border-color: var(--accent-gold);
  background: var(--accent-gold-muted);
}

.sum-label { font-size: 0.65rem; color: var(--text-subtle); text-transform: uppercase; }
.sum-val { font-size: 1.25rem; color: var(--text-main); font-family: 'Space Grotesk', monospace; font-weight: 700; margin: 2px 0; }
.sum-box.highlight .sum-val { color: var(--accent-gold-light); }
.text-green { color: var(--accent-green) !important; }
.text-gold { color: var(--accent-gold-light) !important; }
.sum-sub { font-size: 0.65rem; color: var(--text-muted); }

/* Pricing Tiers Grid */
.pricing-tiers-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.tier-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tier-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 6px;
}

.tier-name {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tier-step {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  font-size: 0.62rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-gold);
  font-weight: 700;
}

.tier-name strong { font-size: 0.78rem; color: var(--text-main); }
.tier-amount { font-family: 'Space Grotesk', monospace; font-size: 0.85rem; font-weight: 700; color: var(--accent-gold-light); }

.tier-rows-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.tier-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--text-muted);
}
.tier-row strong { color: var(--text-main); font-family: 'Space Grotesk', monospace; }
.tier-row.highlight {
  background: var(--bg-panel);
  padding: 4px 6px;
  border-radius: 4px;
}

.tier-table-wrapper {
  max-height: 120px;
  overflow-y: auto;
}
.tier-table-wrapper::-webkit-scrollbar { width: 3px; }
.tier-table-wrapper::-webkit-scrollbar-thumb { background: var(--border-medium); }

.tier-item-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.68rem;
}
.tier-item-table th { color: var(--text-subtle); font-weight: 500; text-align: left; padding: 3px 4px; }
.tier-item-table td { padding: 4px 4px; border-top: 1px solid var(--border-subtle); color: var(--text-muted); }

/* Configurator Form */
.config-instructions {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  padding: 8px 12px;
  font-size: 0.72rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}
.config-instructions i { color: var(--accent-gold); }

.config-sections-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.config-box {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.config-box.full-width { grid-column: span 2; }
.config-box h4 { font-size: 0.78rem; color: var(--accent-gold); display: flex; align-items: center; gap: 6px; }

.config-inputs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.input-group.full-width { grid-column: span 2; }
.input-group label { font-size: 0.68rem; color: var(--text-muted); }
.input-group input, .input-group select {
  padding: 5px 8px;
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  color: var(--text-main);
  font-size: 0.75rem;
  font-family: inherit;
  outline: none;
}
.input-group input:focus, .input-group select:focus { border-color: var(--border-focus); }

.stone-rates-scroll-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  max-height: 140px;
  overflow-y: auto;
  padding-right: 4px;
}
.stone-rates-scroll-grid::-webkit-scrollbar { width: 3px; }
.stone-rates-scroll-grid::-webkit-scrollbar-thumb { background: var(--border-medium); }

.stone-rate-input-item {
  display: flex;
  flex-direction: column;
  background: var(--bg-panel);
  padding: 4px 6px;
  border-radius: 4px;
  border: 1px solid var(--border-subtle);
}
.stone-rate-input-item span { font-size: 0.64rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stone-rate-input-item input {
  padding: 2px 4px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--accent-gold-light);
  font-size: 0.72rem;
  font-family: 'Space Grotesk', monospace;
  outline: none;
  margin-top: 2px;
  border-radius: 3px;
}

.modal-footer {
  padding: 10px 18px;
  background: var(--bg-card);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* Export & Summary Modals */
.export-preview-box {
  width: 100%;
  aspect-ratio: 1/1;
  max-height: 300px;
  background: #090b0e;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.export-preview-box img { max-width: 100%; max-height: 100%; object-fit: contain; }
.export-options label { display: block; font-size: 0.75rem; color: var(--text-muted); margin-bottom: 6px; }

.summary-grid {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 16px;
}
.summary-left { display: flex; flex-direction: column; gap: 10px; }
.summary-preview-thumb { width: 100%; aspect-ratio: 1/1; background: #090b0e; border-radius: var(--radius-sm); border: 1px solid var(--border-subtle); }
.summary-preview-thumb canvas { width: 100%; height: 100%; }
.summary-highlight-card { background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-xs); padding: 8px; }
.summary-highlight-card h4 { font-size: 0.72rem; color: var(--accent-gold); font-family: 'Cinzel', serif; margin-bottom: 3px; }
.summary-highlight-card p { font-size: 0.68rem; color: var(--text-muted); line-height: 1.3; }
.summary-right h4 { font-family: 'Cinzel', serif; font-size: 0.85rem; margin-bottom: 6px; }
.summary-table-wrapper { max-height: 160px; overflow-y: auto; border: 1px solid var(--border-subtle); border-radius: var(--radius-xs); margin-bottom: 10px; }
.specs-table { width: 100%; border-collapse: collapse; font-size: 0.72rem; }
.specs-table th { background: var(--bg-card); padding: 6px 8px; text-align: left; color: var(--text-muted); font-weight: 500; }
.specs-table td { padding: 6px 8px; border-top: 1px solid var(--border-subtle); }
.summary-specs-list { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; background: var(--bg-card); padding: 8px; border-radius: var(--radius-xs); }
.spec-row { display: flex; flex-direction: column; font-size: 0.68rem; }
.spec-row span { color: var(--text-subtle); }
.spec-row strong { color: var(--text-main); font-family: 'Space Grotesk', monospace; }

/* Toast Notifications (Enhanced Epic 5) */
.toast-notification {
  position: fixed;
  bottom: 24px;
  right: 24px;
  min-width: 280px;
  max-width: 380px;
  background: rgba(18, 21, 26, 0.95);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  color: var(--text-main);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  z-index: 9999;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(12px);
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
  overflow: hidden;
}

.toast-notification.active {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.toast-icon-wrapper {
  font-size: 1.1rem;
  margin-top: 1px;
}
.toast-notification.success { border-left: 3px solid #10b981; }
.toast-notification.success .toast-icon-wrapper i { color: #10b981; }
.toast-notification.warning { border-left: 3px solid #f59e0b; }
.toast-notification.warning .toast-icon-wrapper i { color: #f59e0b; }
.toast-notification.error { border-left: 3px solid #ef4444; }
.toast-notification.error .toast-icon-wrapper i { color: #ef4444; }
.toast-notification.info { border-left: 3px solid var(--accent-gold); }
.toast-notification.info .toast-icon-wrapper i { color: var(--accent-gold); }

.toast-content-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.toast-title {
  font-size: 0.76rem;
  font-weight: 600;
  color: #fff;
  text-transform: capitalize;
}
.toast-text {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.toast-close-btn {
  background: transparent;
  border: none;
  color: var(--text-subtle);
  cursor: pointer;
  padding: 2px 4px;
  font-size: 0.8rem;
  transition: color var(--transition-fast);
}
.toast-close-btn:hover {
  color: #fff;
}

.toast-progress-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  background: var(--accent-gold);
  width: 100%;
  transform-origin: left;
  transition: transform linear;
}
.toast-notification.success .toast-progress-bar { background: #10b981; }
.toast-notification.warning .toast-progress-bar { background: #f59e0b; }
.toast-notification.error .toast-progress-bar { background: #ef4444; }

/* ==========================================================================
   My Collections Gallery Modal (Epic 3)
   ========================================================================== */
.collections-modal-card {
  max-width: 960px;
  width: 95%;
  max-height: 90vh;
}

.collection-toolbar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 18px;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border-subtle);
}

.collection-search-box {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}
.collection-search-box i.fa-magnifying-glass {
  position: absolute;
  left: 10px;
  font-size: 0.75rem;
  color: var(--text-subtle);
  pointer-events: none;
}
.collection-search-box input {
  width: 100%;
  padding: 8px 30px 8px 30px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  color: var(--text-main);
  font-size: 0.78rem;
  outline: none;
  transition: border-color var(--transition-fast);
}
.collection-search-box input:focus {
  border-color: var(--accent-gold);
}

.collection-filter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.collection-cat-pills {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
}
.col-pill {
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.68rem;
  font-weight: 500;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
}
.col-pill:hover {
  border-color: var(--accent-gold);
  color: var(--text-main);
}
.col-pill.active {
  background: var(--accent-gold);
  color: #0d0f12;
  font-weight: 600;
  border-color: var(--accent-gold);
}

.collection-status-filter {
  padding: 4px 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  color: var(--text-main);
  font-size: 0.72rem;
  outline: none;
  cursor: pointer;
}

.collection-modal-body {
  max-height: 520px;
  overflow-y: auto;
  padding: 16px 18px;
  background: #090b0e;
}

.collection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.collection-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all var(--transition-fast);
}
.collection-card:hover {
  border-color: rgba(201, 169, 110, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.collection-thumb-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16/11;
  background: radial-gradient(circle at center, #171b21 0%, #0a0c0f 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--border-subtle);
}
.collection-thumb-canvas {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.collection-badge-overlay {
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
}
.collection-category-badge {
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  background: rgba(13, 15, 18, 0.75);
  border: 1px solid var(--border-subtle);
  color: var(--accent-gold-light);
  padding: 2px 6px;
  border-radius: var(--radius-pill);
  backdrop-filter: blur(4px);
}

.collection-card-body {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.collection-card-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: #fff;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.collection-sku-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.collection-card-sku {
  font-family: 'Space Grotesk', monospace;
  font-size: 0.68rem;
  color: var(--accent-gold);
  background: rgba(201, 169, 110, 0.08);
  padding: 1px 5px;
  border-radius: 3px;
  border: 1px solid rgba(201, 169, 110, 0.2);
}
.collection-card-specs {
  font-size: 0.68rem;
  color: var(--text-subtle);
}

.collection-price-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 4px;
}
.collection-card-price {
  font-family: 'Space Grotesk', monospace;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent-gold-light);
}
.collection-card-mrp {
  font-family: 'Space Grotesk', monospace;
  font-size: 0.72rem;
  color: var(--text-subtle);
  text-decoration: line-through;
}

.collection-card-actions {
  display: flex;
  gap: 6px;
  padding: 8px 12px;
  background: var(--bg-panel);
  border-top: 1px solid var(--border-subtle);
}
.col-action-btn {
  flex: 1;
  padding: 5px 8px;
  border-radius: var(--radius-xs);
  font-size: 0.7rem;
  font-weight: 500;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all var(--transition-fast);
}
.col-action-btn:hover {
  background: var(--border-subtle);
  color: #fff;
}
.col-action-btn.primary {
  background: var(--accent-gold);
  border-color: var(--accent-gold);
  color: #0d0f12;
  font-weight: 600;
}
.col-action-btn.primary:hover {
  background: var(--accent-gold-light);
}
.col-action-btn.danger:hover {
  background: rgba(248, 113, 113, 0.15);
  border-color: rgba(248, 113, 113, 0.4);
  color: var(--accent-red);
}

.collection-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
}
.collection-empty-state .empty-icon {
  font-size: 2.4rem;
  color: var(--text-subtle);
  margin-bottom: 12px;
}
.collection-empty-state h4 {
  font-family: 'Cinzel', serif;
  font-size: 1.1rem;
  color: var(--text-main);
  margin-bottom: 6px;
}
.collection-empty-state p {
  max-width: 380px;
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 16px;
}

/* ==========================================================================
   Share & Backup/Restore Modals (Epic 4)
   ========================================================================== */
.share-actions-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.social-share-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: var(--radius-xs);
  font-size: 0.74rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-main);
  transition: all var(--transition-fast);
}
.social-share-btn:hover {
  transform: translateY(-1px);
}
.social-share-btn.whatsapp {
  border-color: rgba(37, 211, 102, 0.3);
  color: #25d366;
}
.social-share-btn.whatsapp:hover {
  background: rgba(37, 211, 102, 0.12);
}
.social-share-btn.twitter {
  border-color: rgba(255, 255, 255, 0.3);
  color: #ffffff;
}
.social-share-btn.twitter:hover {
  background: rgba(255, 255, 255, 0.08);
}
.social-share-btn.email {
  border-color: rgba(201, 169, 110, 0.3);
  color: var(--accent-gold-light);
}
.social-share-btn.email:hover {
  background: rgba(201, 169, 110, 0.12);
}

.backup-export-cards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.backup-option-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.backup-card-icon {
  font-size: 1.6rem;
  color: var(--accent-gold);
}
.backup-card-info h4 {
  font-size: 0.85rem;
  color: #fff;
  margin-bottom: 4px;
}
.backup-card-info p {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.import-dropzone {
  border: 2px dashed var(--border-medium);
  background: var(--bg-panel);
  border-radius: var(--radius-sm);
  padding: 30px 20px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  flex-direction: column;
  align-items: center;
}
.import-dropzone:hover, .import-dropzone.dragover {
  border-color: var(--accent-gold);
  background: rgba(201, 169, 110, 0.05);
}
.import-dropzone .dropzone-icon {
  font-size: 2.2rem;
  color: var(--accent-gold);
  margin-bottom: 8px;
}
.import-dropzone h4 {
  font-size: 0.9rem;
  color: #fff;
  margin-bottom: 4px;
}
.import-dropzone p {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.import-file-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  padding: 8px 12px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-subtle);
  font-size: 0.78rem;
  color: #fff;
}
.import-file-badge i {
  color: var(--accent-gold);
}

.import-modes-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.import-mode-label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  padding: 10px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: border-color var(--transition-fast);
}
.import-mode-label:has(input:checked) {
  border-color: var(--accent-gold);
  background: rgba(201, 169, 110, 0.06);
}
.import-mode-label strong {
  display: block;
  font-size: 0.76rem;
  color: #fff;
  margin-bottom: 2px;
}
.import-mode-label small {
  display: block;
  font-size: 0.66rem;
  color: var(--text-muted);
  line-height: 1.3;
}



/* ==========================================================================
   Full-Page Luxury Views Layout & Components (Epic 6)
   ========================================================================== */
.view-page-container {
  flex: 1;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 16px 24px 30px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.view-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
  gap: 16px;
  flex-wrap: wrap;
}

.view-header-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.view-header-title i {
  font-size: 1.6rem;
  color: var(--accent-gold);
  background: var(--bg-card);
  border: 1px solid rgba(201, 169, 110, 0.3);
  padding: 10px;
  border-radius: var(--radius-sm);
}

.view-header-title h2 {
  font-family: 'Cinzel', serif;
  font-size: 1.25rem;
  color: #fff;
  letter-spacing: 0.5px;
}

.view-header-title p {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.view-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Settings Subtabs & Panes (Screen 3) */
.settings-subtabs {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 6px;
  width: fit-content;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}

.settings-subtab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.settings-subtab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.04);
}

.settings-subtab-btn.active {
  background: var(--accent-gold-gradient);
  color: #0c0d12;
  font-weight: 700;
  box-shadow: 0 2px 10px rgba(201, 169, 110, 0.35);
}

.settings-subtab-btn i {
  font-size: 0.88rem;
}

.settings-pane {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

/* Presets Full Section in Sidebar */
.presets-section-full {
  padding: 12px 14px;
}
.presets-intro-text p {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.35;
  margin-bottom: 10px;
}
.preset-chips-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.preset-card-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  cursor: pointer;
  text-align: left;
  transition: all var(--transition-fast);
}
.preset-card-chip:hover {
  border-color: var(--accent-gold);
  background: var(--bg-hover);
  transform: translateX(2px);
}
.preset-card-chip strong {
  display: block;
  font-size: 0.78rem;
  color: #fff;
}
.preset-card-chip small {
  display: block;
  font-size: 0.68rem;
  color: var(--text-muted);
}

/* Gemstones Full Catalog View (Epic 6) */
.catalog-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  background: var(--bg-panel);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.catalog-search-box {
  position: relative;
  flex: 1;
  min-width: 240px;
  display: flex;
  align-items: center;
}
.catalog-search-box i.fa-magnifying-glass {
  position: absolute;
  left: 12px;
  color: var(--text-subtle);
  font-size: 0.8rem;
  pointer-events: none;
}
.catalog-search-box input {
  width: 100%;
  padding: 8px 32px 8px 32px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  color: var(--text-main);
  font-size: 0.78rem;
  outline: none;
}
.catalog-search-box input:focus { border-color: var(--accent-gold); }

.catalog-cat-pills {
  display: flex;
  gap: 6px;
  overflow-x: auto;
}
.catalog-pill {
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 500;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
}
.catalog-pill:hover { border-color: var(--accent-gold); color: #fff; }
.catalog-pill.active {
  background: var(--accent-gold);
  color: #0d0f12;
  font-weight: 600;
  border-color: var(--accent-gold);
}

.gemstones-fullgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  padding-bottom: 20px;
}

.gemstone-fullcard {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all var(--transition-fast);
}
.gemstone-fullcard:hover {
  border-color: rgba(201, 169, 110, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.gemstone-fullcard-top {
  display: flex;
  align-items: center;
  gap: 12px;
}
.gemstone-large-sphere {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: inset -4px -4px 8px rgba(0, 0, 0, 0.6), 0 4px 10px rgba(0, 0, 0, 0.4);
}
.gemstone-fullcard-meta {
  flex: 1;
}
.gemstone-fullcard-name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.gemstone-fullcard-name {
  font-family: 'Cinzel', serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
}
.gemstone-fullcard-price {
  font-family: 'Space Grotesk', monospace;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-gold-light);
  background: rgba(201, 169, 110, 0.1);
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid rgba(201, 169, 110, 0.2);
}
.gemstone-fullcard-chakra {
  font-size: 0.68rem;
  color: var(--text-muted);
}

.gemstone-fullcard-desc {
  font-size: 0.73rem;
  color: var(--text-muted);
  line-height: 1.35;
  flex: 1;
}

.gemstone-fullcard-properties {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  background: var(--bg-panel);
  padding: 6px 8px;
  border-radius: var(--radius-xs);
  font-size: 0.66rem;
}
.gemstone-fullcard-properties span { color: var(--text-subtle); }
.gemstone-fullcard-properties strong { color: var(--text-main); }

.gemstone-fullcard-actions {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}

/* Design Inspector Waterfall Component */
.waterfall-sidebar-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sidebar-waterfall-scroll {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  max-height: calc(100vh - 210px);
  padding-right: 2px;
}

.tier-card.sidebar-tier {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tier-card.sidebar-tier.highlight {
  border-color: rgba(201, 169, 110, 0.4);
  background: linear-gradient(180deg, rgba(26, 30, 41, 0.95), rgba(20, 23, 32, 0.95));
}

.tier-item-table.compact {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.72rem;
}

.tier-item-table.compact th {
  font-size: 0.62rem;
  color: var(--text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 4px;
  border-bottom: 1px solid var(--border-subtle);
  text-align: left;
}

.tier-item-table.compact td {
  padding: 3px 4px;
  color: var(--text-muted);
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.tier-item-table.compact td:last-child {
  text-align: right;
  font-weight: 600;
  font-family: 'Space Grotesk', monospace;
  color: var(--text-main);
}

/* Pricing Fullpage View */
.settings-main-header {
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.pricing-fullpage-grid {
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  gap: 16px;
  align-items: start;
}

.pricing-card-pane {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.pane-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-subtle);
}
.pane-heading i { color: var(--accent-gold); }
.pane-heading h3 {
  font-family: 'Cinzel', serif;
  font-size: 0.92rem;
  color: #fff;
}

/* Enhanced Stone Rates Filter Toolbar & List in Settings */
.rates-filter-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.rates-search-box {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
}

.rates-search-box i {
  position: absolute;
  left: 10px;
  color: var(--text-subtle);
  font-size: 0.76rem;
  pointer-events: none;
}

.rates-search-box input {
  width: 100%;
  padding: 7px 10px 7px 30px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  color: var(--text-main);
  font-size: 0.78rem;
  font-family: inherit;
  outline: none;
  transition: all var(--transition-fast);
}
.rates-search-box input:focus {
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 2px rgba(201, 169, 110, 0.15);
}

.enhanced-stone-rates-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 520px;
  overflow-y: auto;
  padding-right: 4px;
}

.enhanced-stone-rates-grid::-webkit-scrollbar { width: 4px; }
.enhanced-stone-rates-grid::-webkit-scrollbar-thumb { background: var(--border-medium); border-radius: 4px; }

.stone-rate-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: linear-gradient(90deg, rgba(26, 30, 38, 0.85) 0%, rgba(18, 21, 26, 0.95) 100%);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  padding: 8px 12px;
  transition: all var(--transition-fast);
}

.stone-rate-card:hover {
  border-color: rgba(201, 169, 110, 0.45);
  background: var(--bg-hover);
}

.stone-rate-card.is-custom {
  border-color: rgba(201, 169, 110, 0.6);
  background: linear-gradient(90deg, rgba(201, 169, 110, 0.12) 0%, rgba(18, 21, 26, 0.95) 100%);
}

.stone-rate-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.stone-rate-canvas {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.5));
}

.stone-rate-info {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex-wrap: wrap;
}

.stone-rate-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: #f0f2f5;
  white-space: nowrap;
}

.stone-base-tag {
  font-size: 0.66rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  padding: 1px 6px;
  border-radius: 3px;
  border: 1px solid var(--border-subtle);
  font-family: 'Space Grotesk', monospace;
}

.stone-rate-control {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.stone-rate-input-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  padding: 2px 6px;
}

.stone-rate-symbol {
  font-size: 0.72rem;
  color: var(--accent-gold);
  font-weight: 600;
}

.stone-rate-input-wrap input {
  width: 66px;
  padding: 3px 2px;
  background: transparent;
  border: none;
  color: #fff;
  font-family: 'Space Grotesk', monospace;
  font-size: 0.82rem;
  font-weight: 600;
  text-align: right;
  outline: none;
}
.stone-rate-input-wrap input:focus {
  color: var(--accent-gold-light);
}

.btn-reset-single-rate {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-subtle);
  cursor: pointer;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  border-radius: var(--radius-xs);
  transition: all var(--transition-fast);
}
.btn-reset-single-rate:hover {
  color: var(--accent-gold);
  border-color: var(--accent-gold);
  background: rgba(201, 169, 110, 0.15);
}

/* Spec Sheet Screen Card */
.specsheet-screen-card {
  background: #ffffff;
  color: #111827;
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
  padding: 24px;
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
}

/* Share & Backup Hub */
.share-backup-hub-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.hub-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.hub-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-subtle);
}
.hub-card-header i { color: var(--accent-gold); font-size: 1.1rem; }
.hub-card-header h3 { font-family: 'Cinzel', serif; font-size: 0.95rem; color: #fff; }
.hub-card-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.hub-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
}
.hub-input-row {
  display: flex;
  gap: 8px;
}
.hub-input-row input {
  flex: 1;
  padding: 8px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  color: var(--text-main);
  font-family: 'Space Grotesk', monospace;
  font-size: 0.76rem;
  outline: none;
}
.hub-social-row {
  display: flex;
  gap: 8px;
}
.hub-design-summary-box {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.hub-design-summary-box .summary-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: #fff;
}
.hub-design-summary-box .summary-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* ==========================================================================
   PRINTABLE MANUFACTURING SPEC SHEET (Epic 5)
   ========================================================================== */
#printable-spec-sheet {
  display: none;
}

@media screen {
  .printable-spec-sheet {
    display: none !important;
  }
}

@media print {
  @page {
    size: A4 portrait;
    margin: 8mm 10mm;
  }

  *, *::before, *::after {
    box-shadow: none !important;
    text-shadow: none !important;
  }

  html, body {
    background: #ffffff !important;
    color: #111827 !important;
    font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, sans-serif !important;
    font-size: 11pt !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    height: auto !important;
    overflow: visible !important;
  }

  /* Hide all interactive screen elements */
  .app-container,
  .modal-backdrop,
  .toast-notification,
  header,
  aside,
  button,
  .pricing-gear-btn,
  .action-btn {
    display: none !important;
  }

  /* Display printable spec sheet */
  #printable-spec-sheet.printable-spec-sheet {
    display: block !important;
    position: relative !important;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    background: #ffffff !important;
    color: #111827 !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .print-sheet-inner {
    width: 100%;
    margin: 0 auto;
  }

  .print-header {
    margin-bottom: 8px;
  }

  .print-brand-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .print-brand-left {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .print-logo-mark {
    width: 38px;
    height: 38px;
    border: 2px solid #b58c38;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #b58c38;
  }

  .print-brand-title {
    font-family: 'Cinzel', serif !important;
    font-size: 1.5rem !important;
    font-weight: 700 !important;
    letter-spacing: 2px !important;
    color: #111827 !important;
    margin: 0 !important;
    line-height: 1.1;
  }

  .print-brand-sub {
    font-size: 0.6rem !important;
    letter-spacing: 2.5px !important;
    color: #6b7280 !important;
    margin: 2px 0 0 0 !important;
    font-weight: 600 !important;
  }

  .print-meta-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
  }

  .print-doc-badge {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 1px;
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    padding: 3px 8px;
    border-radius: 3px;
    color: #1f2937;
  }

  .print-meta-grid {
    display: flex;
    gap: 8px;
    font-size: 0.68rem;
    color: #374151;
  }
  .print-meta-grid .meta-lbl {
    font-weight: 600;
    color: #6b7280;
  }
  .print-meta-grid strong {
    font-family: 'Space Grotesk', monospace;
    color: #111827;
  }

  .print-divider.gold {
    border: none;
    height: 2px;
    background: linear-gradient(90deg, #b58c38 0%, #e2c275 50%, #b58c38 100%);
    margin: 6px 0 10px 0;
  }

  .print-section {
    margin-bottom: 10px;
    page-break-inside: avoid;
  }

  .print-overview-grid {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 14px;
  }

  .print-render-card {
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 8px;
    background: #fafafa;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .print-img-wrapper {
    width: 100%;
    aspect-ratio: 1/1;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
  }

  .print-img-wrapper img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
  }

  .print-dimensions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }

  .print-dim-item {
    display: flex;
    flex-direction: column;
    gap: 1px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    padding: 4px 6px;
    border-radius: 3px;
  }

  .dim-lbl {
    font-size: 0.55rem;
    font-weight: 600;
    color: #6b7280;
    letter-spacing: 0.5px;
  }

  .print-dim-item strong {
    font-size: 0.68rem;
    color: #111827;
    font-family: 'Space Grotesk', monospace;
  }

  .print-details-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .print-title-box {
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 6px;
  }

  .print-cat-badge {
    display: inline-block;
    font-size: 0.58rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: #fef3c7;
    border: 1px solid #fde68a;
    color: #92400e;
    padding: 2px 6px;
    border-radius: 3px;
    margin-bottom: 3px;
  }

  .print-title-box h2 {
    font-family: 'Cinzel', serif !important;
    font-size: 1.15rem !important;
    color: #111827 !important;
    margin: 0 !important;
    line-height: 1.25;
  }

  .print-barcode-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    padding: 8px 12px;
  }

  .print-barcode-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    flex: 1;
  }

  .print-simulated-barcode {
    display: inline-flex;
    align-items: flex-end;
    height: 34px;
    gap: 1.5px;
    padding: 0 4px;
  }

  .barcode-bar {
    background: #111827;
    height: 100%;
    display: inline-block;
  }
  .barcode-bar.w1 { width: 1.5px; }
  .barcode-bar.w2 { width: 3px; }
  .barcode-bar.w3 { width: 4.5px; }
  .barcode-bar.space1 { width: 1.5px; background: transparent; }
  .barcode-bar.space2 { width: 3px; background: transparent; }

  .print-sku-display {
    font-family: 'Space Grotesk', monospace;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: #111827;
  }

  .print-qrcode-box {
    border: 1px solid #d1d5db;
    background: #ffffff;
    border-radius: 3px;
    padding: 4px 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
  }

  .print-simulated-qr {
    font-size: 1.8rem;
    color: #111827;
    line-height: 1;
  }

  .qr-lbl {
    font-size: 0.52rem;
    font-weight: 700;
    color: #6b7280;
    letter-spacing: 0.5px;
  }

  .print-energy-box {
    background: #fffbeb;
    border-left: 3px solid #b58c38;
    border-radius: 0 3px 3px 0;
    padding: 6px 8px;
  }
  .print-energy-box h4 {
    font-size: 0.65rem;
    font-weight: 700;
    color: #92400e;
    margin: 0 0 2px 0;
    letter-spacing: 0.5px;
  }
  .print-energy-box p {
    font-size: 0.65rem;
    color: #4b5563;
    margin: 0;
    line-height: 1.3;
  }

  .print-bead-sequence-box h4 {
    font-size: 0.65rem;
    font-weight: 700;
    color: #374151;
    margin: 0 0 4px 0;
    letter-spacing: 0.5px;
  }
  .print-sequence-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
  }
  .print-seq-chip {
    font-size: 0.58rem;
    font-family: 'Space Grotesk', monospace;
    padding: 1px 4px;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 2px;
    color: #1f2937;
  }

  .print-section-heading {
    font-family: 'Cinzel', serif !important;
    font-size: 0.78rem !important;
    font-weight: 700 !important;
    color: #111827 !important;
    letter-spacing: 0.8px !important;
    border-bottom: 1.5px solid #111827;
    padding-bottom: 2px;
    margin: 8px 0 6px 0 !important;
  }

  .print-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.68rem;
  }

  .print-table th {
    background: #f3f4f6 !important;
    color: #111827 !important;
    font-weight: 700 !important;
    padding: 4px 6px;
    border: 1px solid #d1d5db;
    text-transform: uppercase;
    font-size: 0.62rem;
    letter-spacing: 0.5px;
  }

  .print-table td {
    padding: 3px 6px;
    border: 1px solid #e5e7eb;
    color: #1f2937;
  }

  .print-table tbody tr:nth-child(even) td {
    background: #f9fafb;
  }

  .print-table-total-row td {
    background: #f3f4f6 !important;
    border-top: 2px solid #111827 !important;
    font-weight: 700 !important;
    color: #111827 !important;
  }

  .print-cost-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
  }

  .print-cost-card {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 3px;
    padding: 4px 6px;
    display: flex;
    flex-direction: column;
    gap: 1px;
  }
  .print-cost-card.highlight {
    background: #fffbeb;
    border-color: #b58c38;
  }
  .print-cost-card.discount {
    background: #f0fdf4;
    border-color: #86efac;
  }
  .print-cost-card.mrp {
    background: #f3f4f6;
    border-color: #111827;
    border-width: 1.5px;
  }

  .cost-card-lbl {
    font-size: 0.55rem;
    color: #6b7280;
    font-weight: 600;
  }
  .cost-card-val {
    font-family: 'Space Grotesk', monospace;
    font-size: 0.8rem;
    font-weight: 700;
    color: #111827;
  }
  .cost-card-val.text-gold {
    color: #92400e;
  }

  .print-qc-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 12px;
    margin-top: 4px;
  }

  .print-qc-checklist {
    display: flex;
    flex-direction: column;
    gap: 3px;
  }

  .print-qc-item {
    font-size: 0.62rem;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 5px;
  }

  .print-checkbox {
    display: inline-block;
    width: 11px;
    height: 11px;
    border: 1.5px solid #4b5563;
    border-radius: 2px;
    flex-shrink: 0;
  }

  .print-signoff-box {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    align-items: flex-end;
  }

  .signoff-field {
    display: flex;
    flex-direction: column;
    gap: 2px;
  }

  .signoff-line {
    border-bottom: 1.5px solid #111827;
    height: 18px;
    display: block;
  }

  .signoff-lbl {
    font-size: 0.55rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
  }

  .print-footer {
    text-align: center;
    border-top: 1px solid #e5e7eb;
    padding-top: 4px;
    margin-top: 8px;
  }
  .print-footer p {
    font-size: 0.55rem;
    color: #9ca3af;
    margin: 0;
    letter-spacing: 0.5px;
  }
}

/* ==========================================================================
   Comprehensive Multi-Device Responsive Architecture
   (Desktop > 1200px, Laptop 992-1200px, Tablet 768-992px, Mobile < 768px)
   ========================================================================== */

/* Mobile Drawer Overlay Backdrop */
.mobile-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 85;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.mobile-drawer-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

/* Mobile Stage Bar (Hidden on desktop/tablet by default) */
.mobile-stage-bar {
  display: none;
}

/* 1. Large Laptops / Medium Desktops (<= 1200px) */
@media (max-width: 1200px) {
  :root {
    --left-sidebar-w: 280px;
    --right-sidebar-w: 290px;
  }
  .studio-main,
  .app-view.studio-main.active {
    grid-template-columns: minmax(0, var(--left-sidebar-w, 280px)) 6px minmax(0, 1fr) 6px minmax(0, var(--right-sidebar-w, 290px));
  }
  .stage-floating-island {
    padding: 6px 10px;
    gap: 8px;
  }
  .collections-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }
  .config-sections-grid {
    grid-template-columns: 1fr;
  }
}

/* 2. Tablets & Small Laptops (<= 992px) */
@media (max-width: 992px) {
  :root {
    --left-sidebar-w: 250px;
    --right-sidebar-w: 260px;
  }
  .studio-main,
  .app-view.studio-main.active {
    grid-template-columns: minmax(0, var(--left-sidebar-w, 250px)) 6px minmax(0, 1fr) 6px minmax(0, var(--right-sidebar-w, 260px));
  }
  .studio-header {
    padding: 8px 14px;
    gap: 10px;
  }
  .brand-text .tagline {
    display: none;
  }
  .view-nav-tabs {
    gap: 4px;
    padding: 3px;
  }
  .nav-tab-btn {
    padding: 6px 10px;
    font-size: 0.76rem;
  }
  .header-actions .action-btn {
    padding: 6px 10px;
    font-size: 0.76rem;
  }
  
  /* Stage Island Wrap */
  .stage-floating-island {
    max-width: 96%;
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .backup-grid {
    grid-template-columns: 1fr;
  }
}

/* 3. Mobile Devices & Small Tablets (<= 768px): Stage-First Layout */
@media (max-width: 768px) {
  :root {
    --header-height: 54px;
  }

  .app-container {
    height: 100dvh;
    min-height: 100dvh;
  }

  /* Header compact mobile */
  .studio-header {
    padding: 6px 10px;
    gap: 6px;
    flex-wrap: nowrap;
    height: var(--header-height, 54px);
  }

  .brand-badge .brand-logo-icon {
    width: 28px;
    height: 28px;
    font-size: 0.85rem;
  }

  .brand-text h1 {
    font-size: 1rem;
    letter-spacing: 0.8px;
  }

  .view-nav-tabs {
    gap: 2px;
    padding: 2px;
  }

  .nav-tab-btn {
    padding: 5px 8px;
    font-size: 0.72rem;
    gap: 4px;
  }

  .header-actions {
    gap: 4px;
  }

  .header-actions .action-btn {
    padding: 6px 9px;
    font-size: 0.72rem;
  }
  .header-actions .action-btn span {
    display: none; /* Icon-only in mobile header */
  }

  /* Studio: Stage-First Fullscreen Canvas (Override Grid) */
  .studio-main,
  .app-view.studio-main.active {
    display: block !important;
    position: relative !important;
    width: 100% !important;
    height: calc(100dvh - var(--header-height, 54px)) !important;
    overflow: hidden !important;
  }

  .sidebar-resizer {
    display: none !important;
  }

  /* Left Gemstone Drawer -> Slide-in Touch Sheet */
  .palette-sidebar {
    position: fixed !important;
    top: var(--header-height, 54px) !important;
    bottom: 0 !important;
    left: 0 !important;
    width: min(340px, 86vw) !important;
    height: calc(100dvh - var(--header-height, 54px)) !important;
    z-index: 100 !important;
    background: var(--bg-panel) !important;
    border-right: 1px solid var(--border-medium) !important;
    box-shadow: 12px 0 50px rgba(0, 0, 0, 0.85) !important;
    transform: translate3d(-105%, 0, 0) !important;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
    display: flex !important;
    flex-direction: column !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: none;
    overflow: hidden;
  }

  .palette-sidebar.mobile-open {
    transform: translate3d(0, 0, 0) !important;
    pointer-events: auto !important;
  }

  /* Right Design Inspector -> Slide-in Touch Sheet */
  .details-sidebar {
    position: fixed !important;
    top: var(--header-height, 54px) !important;
    bottom: 0 !important;
    right: 0 !important;
    width: min(360px, 90vw) !important;
    height: calc(100dvh - var(--header-height, 54px)) !important;
    z-index: 100 !important;
    background: var(--bg-panel) !important;
    border-left: 1px solid var(--border-medium) !important;
    box-shadow: -12px 0 50px rgba(0, 0, 0, 0.85) !important;
    transform: translate3d(105%, 0, 0) !important;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
    display: flex !important;
    flex-direction: column !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: none;
    overflow: hidden;
  }

  .details-sidebar.mobile-open {
    transform: translate3d(0, 0, 0) !important;
    pointer-events: auto !important;
  }

  /* Drawer Header Close Button styling on Mobile */
  .palette-sidebar .panel-collapse-btn,
  .details-sidebar .panel-collapse-btn {
    background: rgba(255, 255, 255, 0.08);
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-main);
  }

  /* Stage Section */
  .stage-section {
    width: 100%;
    height: 100%;
    padding: 8px;
    display: flex;
    flex-direction: column;
  }

  .stage-floating-island {
    position: absolute;
    top: 8px;
    left: 8px;
    right: 8px;
    transform: none;
    max-width: 100%;
    padding: 6px 8px;
    font-size: 0.75rem;
    gap: 6px;
    z-index: 40;
    justify-content: space-between;
  }

  .stage-floating-island .island-divider {
    display: none;
  }

  .stage-floating-island .stage-island-btn,
  #btn-toggle-zen-mode,
  #cord-type-select {
    display: none; /* Simplified on small stage island */
  }

  #bead-size-selector .segment-btn {
    padding: 3px 6px;
    font-size: 0.68rem;
  }

  .canvas-viewport {
    flex: 1;
    width: 100%;
    min-height: 0;
  }

  .canvas-floating-dock {
    bottom: 64px; /* Float above mobile stage bar */
    padding: 4px 8px;
    gap: 4px;
  }

  .dock-btn {
    width: 32px;
    height: 32px;
    font-size: 0.8rem;
  }

  .center-stage-pill {
    bottom: 110px;
    font-size: 0.68rem;
    padding: 4px 10px;
    max-width: 90%;
    text-align: center;
  }

  .sequence-ribbon-container {
    display: none; /* Hidden on mobile to maximize 3D stage */
  }

  /* Mobile Stage Bottom Action Bar */
  .mobile-stage-bar {
    display: flex;
    align-items: center;
    justify-content: space-around;
    position: absolute;
    bottom: 8px;
    left: 8px;
    right: 8px;
    z-index: 45;
    background: rgba(18, 20, 29, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 4px 6px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
  }

  .mobile-bar-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.65rem;
    font-family: inherit;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 44px;
    min-width: 54px;
  }

  .mobile-bar-btn i {
    font-size: 0.95rem;
    color: var(--accent-gold);
  }

  .mobile-bar-btn:active,
  .mobile-bar-btn.active {
    background: rgba(212, 175, 55, 0.15);
    color: var(--text-primary);
  }

  /* Collections View on Mobile */
  .view-page-container {
    padding: 12px 10px 80px;
    gap: 12px;
  }

  .view-page-header {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .view-page-header .view-page-actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 6px;
  }

  .collections-toolbar {
    flex-direction: column;
    gap: 8px;
  }

  .collections-toolbar .search-box {
    width: 100%;
    min-width: 100%;
  }

  .collections-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  /* Settings View on Mobile */
  .settings-grid-layout {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .config-grid-row {
    grid-template-columns: 1fr;
  }

  .stone-rate-card {
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 10px;
  }

  .stone-rate-info {
    min-width: 130px;
  }

  .stone-rate-input-wrap {
    margin-left: auto;
  }

  /* Modal Dialogs on Mobile */
  .modal-dialog {
    max-width: 95vw;
    margin: 10px;
    max-height: 90vh;
    padding: 16px;
  }

  .modal-header h3 {
    font-size: 1.1rem;
  }

  .share-recipe-card,
  .share-qr-section {
    padding: 12px;
  }
}

/* 4. Extra Small Phones (<= 480px) */
@media (max-width: 480px) {
  .brand-text h1 {
    font-size: 0.95rem;
  }

  .nav-tab-btn span {
    display: none; /* Icon-only tabs on extra-compact phones */
  }

  .nav-tab-btn {
    padding: 6px 10px;
    font-size: 0.9rem;
  }

  .bits-group .island-subtext {
    display: none;
  }

  .stone-rate-card {
    padding: 6px 8px;
  }

  .stone-rate-name {
    font-size: 0.78rem;
  }
}

/* 5. Touch Target & Pointer Precision Optimization */
@media (hover: none) and (pointer: coarse) {
  .nav-tab-btn,
  .action-btn,
  .dock-btn,
  .step-btn,
  .segment-btn,
  .tool-mode-btn,
  .modal-btn,
  .mobile-bar-btn {
    min-height: 44px;
  }

  .stone-card {
    cursor: pointer;
    touch-action: manipulation;
  }

  .canvas-viewport canvas {
    touch-action: none; /* Direct touch handling for 3D orbital gestures */
  }
}

/* 6. Ultra-Compact Mobile Screens (<= 360px, down to 300px) */
@media (max-width: 360px) {
  :root {
    --header-height: 48px;
  }

  /* Header */
  .studio-header {
    padding: 4px 6px;
    gap: 4px;
    height: var(--header-height, 48px);
  }

  .brand-badge .brand-logo-icon {
    width: 24px;
    height: 24px;
    font-size: 0.75rem;
  }

  .brand-text h1 {
    font-size: 0.85rem;
    letter-spacing: 0.5px;
  }

  .view-nav-tabs {
    gap: 1px;
    padding: 1px;
  }

  .nav-tab-btn {
    padding: 4px 6px;
    font-size: 0.75rem;
    min-height: 36px;
    min-width: 36px;
  }

  .header-actions {
    gap: 3px;
  }

  .header-actions .action-btn {
    padding: 4px 6px;
    font-size: 0.7rem;
    min-height: 36px;
    min-width: 34px;
  }

  /* Drawers */
  .palette-sidebar {
    width: 92vw !important;
    max-width: 290px !important;
  }

  .details-sidebar {
    width: 94vw !important;
    max-width: 295px !important;
  }

  .stones-grid-container {
    padding: 6px 6px 16px;
    gap: 6px;
  }

  .stone-card {
    padding: 6px 4px;
  }

  .stone-card .stone-title {
    font-size: 0.72rem;
  }

  .stone-card .stone-price {
    font-size: 0.65rem;
  }

  .active-stone-banner {
    margin: 6px 6px 2px;
    padding: 6px 8px;
    gap: 6px;
  }

  .active-stone-preview {
    width: 26px;
    height: 26px;
  }

  .active-stone-title-row strong {
    font-size: 0.76rem;
  }

  .palette-mode-selector .tool-mode-btn span {
    display: none; /* Icon-only in ultra-compact view */
  }
  .palette-mode-selector .tool-mode-btn {
    padding: 6px;
  }

  /* Stage Floating Controls */
  .stage-floating-island {
    top: 4px;
    left: 4px;
    right: 4px;
    padding: 3px 6px;
    gap: 4px;
  }

  .bits-group .step-btn {
    width: 22px;
    height: 22px;
    font-size: 0.75rem;
  }

  .bits-group .island-value-badge {
    font-size: 0.7rem;
  }

  #bead-size-selector .segment-btn {
    padding: 2px 4px;
    font-size: 0.62rem;
  }

  .canvas-floating-dock {
    bottom: 50px;
    padding: 3px 4px;
    gap: 3px;
  }

  .dock-btn {
    width: 26px;
    height: 26px;
    font-size: 0.7rem;
  }

  .center-stage-pill {
    bottom: 90px;
    font-size: 0.62rem;
    padding: 3px 8px;
  }

  /* Mobile Stage Bottom Action Bar */
  .mobile-stage-bar {
    bottom: 4px;
    left: 4px;
    right: 4px;
    padding: 2px 4px;
  }

  .mobile-bar-btn {
    min-height: 38px;
    min-width: 44px;
    font-size: 0.58rem;
    padding: 4px;
  }

  .mobile-bar-btn i {
    font-size: 0.82rem;
  }

  /* Collections View */
  .view-page-container {
    padding: 8px 6px 60px;
    gap: 8px;
  }

  .collection-product-card {
    padding: 8px 6px;
  }

  /* Settings View */
  .config-box {
    padding: 10px 8px;
  }

  .stone-rate-card {
    padding: 6px 4px;
    gap: 4px;
  }

  .stone-rate-name {
    font-size: 0.72rem;
  }

  .stone-rate-input-wrap input {
    width: 52px;
    font-size: 0.7rem;
    padding: 2px 4px;
  }

  .btn-reset-single-rate {
    width: 22px;
    height: 22px;
    font-size: 0.65rem;
  }

  /* Auth Gate Card on 300px */
  .auth-gate-card {
    max-width: 280px;
    padding: 18px 14px 16px;
    gap: 12px;
  }

  .auth-brand-icon {
    width: 42px;
    height: 42px;
    font-size: 1.1rem;
    margin-bottom: 4px;
  }

  .auth-gate-brand h2 {
    font-size: 1.1rem;
  }

  .auth-pin-display {
    gap: 10px;
  }

  .pin-dot {
    width: 11px;
    height: 11px;
  }

  .auth-numpad {
    max-width: 220px;
    gap: 6px;
  }

  .numpad-btn {
    font-size: 1.1rem;
    max-width: 52px;
  }
}

/* ==========================================================================
   Atelier Access Security Gate & PIN Lock
   ========================================================================== */
.auth-gate-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: radial-gradient(circle at center, rgba(20, 24, 34, 0.98) 0%, rgba(9, 11, 15, 0.99) 100%);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.auth-gate-card {
  background: linear-gradient(180deg, rgba(28, 33, 46, 0.95) 0%, rgba(15, 18, 25, 0.99) 100%);
  border: 1px solid rgba(201, 169, 110, 0.35);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.85), 0 0 35px rgba(201, 169, 110, 0.12);
  border-radius: 20px;
  width: 100%;
  max-width: 350px;
  padding: 28px 22px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  position: relative;
}

.auth-gate-card.shake {
  animation: authShake 0.4s ease-in-out;
}

@keyframes authShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}

.auth-brand-icon {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(201, 169, 110, 0.22) 0%, rgba(201, 169, 110, 0.05) 100%);
  border: 1px solid rgba(201, 169, 110, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: var(--accent-gold);
  box-shadow: 0 0 20px rgba(201, 169, 110, 0.25);
  margin: 0 auto 8px;
}

.auth-gate-brand h2 {
  font-family: 'Cinzel', serif;
  font-size: 1.3rem;
  color: var(--text-main);
  letter-spacing: 1px;
}

.auth-subtitle {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.auth-pin-display {
  display: flex;
  gap: 14px;
  justify-content: center;
  margin: 4px 0;
}

.pin-dot {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 1.5px solid rgba(201, 169, 110, 0.4);
  background: rgba(255, 255, 255, 0.04);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.pin-dot.filled {
  background: var(--accent-gold);
  border-color: var(--accent-gold);
  box-shadow: 0 0 10px rgba(201, 169, 110, 0.7);
  transform: scale(1.15);
}

.auth-input-wrap {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.auth-numpad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  width: 100%;
  max-width: 250px;
}

.numpad-btn {
  aspect-ratio: 1;
  max-width: 66px;
  margin: 0 auto;
  width: 100%;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-main);
  font-family: 'Space Grotesk', monospace;
  font-size: 1.25rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  user-select: none;
}

.numpad-btn:hover {
  background: rgba(201, 169, 110, 0.15);
  border-color: rgba(201, 169, 110, 0.35);
  color: var(--accent-gold-light);
}

.numpad-btn:active {
  transform: scale(0.92);
  background: rgba(201, 169, 110, 0.3);
}

.numpad-btn.action {
  font-size: 0.95rem;
  color: var(--text-muted);
}

.numpad-btn.action.gold {
  background: linear-gradient(135deg, var(--accent-gold) 0%, #b38f50 100%);
  color: #111;
  font-weight: 700;
  border: none;
  box-shadow: 0 4px 15px rgba(201, 169, 110, 0.3);
}

.auth-status-msg {
  font-size: 0.72rem;
  color: var(--text-subtle);
  min-height: 18px;
}

.auth-status-msg.error {
  color: #f87171;
}

.auth-status-msg.success {
  color: #34d399;
}

.remember-session-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  color: var(--text-muted);
  cursor: pointer;
}

.remember-session-label input {
  accent-color: var(--accent-gold);
  cursor: pointer;
}


