/* ==========================================================================
   KitSysCo Sorouh - Pure Monochrome 3D Tactile Buttons Engine
   Luxury Obsidian Black & Pure White | Deep Engraved Text & Vector Icons
   Strictly <= 250 lines compliant | Port 8080
   ========================================================================== */

:root {
  --mono-black-void: #000000;
  --mono-extrusion-dark: #020304;
  --mono-obsidian-top: #242832;
  --mono-obsidian-mid: #151820;
  --mono-obsidian-bot: #0a0c10;
  --mono-white-top: #ffffff;
  --mono-white-mid: #ededed;
  --mono-white-bot: #d5d5d5;
  --mono-white-extrusion: #6e6e6e;
  --mono-bevel-specular: rgba(255, 255, 255, 0.48);
  --mono-bevel-occlusion: #000000;
  --mono-border-subtle: rgba(255, 255, 255, 0.2);
  --mono-border-bright: #ffffff;
  --mono-led-off: rgba(255, 255, 255, 0.22);
  --mono-led-on: #ffffff;
}

/* 1. Master Obsidian 3D Button Chassis (Black & White Identity) */
.btn-action, .hud-btn, .btn-step, .btn-header, .btn-tool-rail,
.comp-tactile-btn, .shell > nav button, .shell > nav .glass-nav-btn,
.floating-panel-opener, .btn-home-link, .flame-sample-btn,
.safety-scenario-btn, .curriculum-grade-tab, .inst-tab-btn,
.btn-square-3d, .btn-rail-3d, .btn-tactile {
  position: relative !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-family: 'Cairo', -apple-system, sans-serif !important;
  font-weight: 800 !important;
  color: #ffffff !important;
  text-decoration: none !important;
  user-select: none !important;
  cursor: pointer !important;
  background: linear-gradient(180deg, var(--mono-obsidian-top) 0%, var(--mono-obsidian-mid) 52%, var(--mono-obsidian-bot) 100%) !important;
  border: 1px solid var(--mono-border-subtle) !important;
  border-radius: 9px !important;
  box-shadow: inset 0 1px 0 var(--mono-bevel-specular),
              inset 0 -1.5px 0 var(--mono-bevel-occlusion),
              0 3.5px 0 var(--mono-extrusion-dark),
              0 7px 16px rgba(0, 0, 0, 0.95) !important;
  /* Deeply Engraved Arabic Typography (Chiseled Carving Relief) */
  text-shadow: 0 -1.5px 0 #000000, 0 1px 1px rgba(255, 255, 255, 0.4) !important;
  transition: transform 0.08s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.08s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.12s ease !important;
  -webkit-tap-highlight-color: transparent !important;
  outline: none !important;
}

/* Hover State - Bright White Specular Elevation */
.btn-action:hover, .hud-btn:hover, .btn-step:hover, .btn-header:hover,
.btn-tool-rail:hover, .comp-tactile-btn:hover, .shell > nav button:hover,
.floating-panel-opener:hover, .flame-sample-btn:hover, .curriculum-grade-tab:hover {
  background: linear-gradient(180deg, #2e3442 0%, #1c202a 52%, #0e1116 100%) !important;
  border-color: var(--mono-border-bright) !important;
  transform: translateY(-1.5px) !important;
  box-shadow: inset 0 1px 1.5px #ffffff,
              inset 0 -1.5px 0 var(--mono-bevel-occlusion),
              0 5px 0 var(--mono-extrusion-dark),
              0 10px 22px rgba(0, 0, 0, 0.98) !important;
}

/* Active / Pressed State - Physical Mechanical Depression */
.btn-action:active, .btn-action.is-pressed,
.hud-btn:active, .hud-btn.is-pressed,
.btn-step:active, .btn-step.is-pressed,
.btn-header:active, .btn-header.is-pressed,
.btn-tool-rail:active, .btn-tool-rail.is-pressed,
.comp-tactile-btn:active, .comp-tactile-btn.is-pressed,
.shell > nav button:active, .shell > nav button.active,
.floating-panel-opener:active, .curriculum-grade-tab.active {
  transform: translateY(3px) scale(0.985) !important;
  box-shadow: inset 0 3px 7px rgba(0, 0, 0, 0.98),
              inset 0 -1px 0 rgba(255, 255, 255, 0.15),
              0 0.5px 0 var(--mono-extrusion-dark),
              0 2px 6px rgba(0, 0, 0, 0.9) !important;
}

/* 2. Primary 3D Inverted White Button (Pure White & Deep Black Relief) */
.btn-action.highlight,
.hud-btn-run,
.btn-tactile-primary,
.btn-step.btn-next,
.comp-stage-direct-btn:hover .comp-btn-badge {
  background: linear-gradient(180deg, var(--mono-white-top) 0%, var(--mono-white-mid) 52%, var(--mono-white-bot) 100%) !important;
  color: #000000 !important;
  border: 1px solid #ffffff !important;
  box-shadow: inset 0 1.5px 0 #ffffff,
              inset 0 -1.5px 0 rgba(0, 0, 0, 0.4),
              0 3.5px 0 var(--mono-white-extrusion),
              0 8px 18px rgba(0, 0, 0, 0.7) !important;
  /* Inverted Engraved Black Text */
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.9), 0 -1px 0 rgba(0, 0, 0, 0.4) !important;
}
.btn-action.highlight:hover, .hud-btn-run:hover, .btn-tactile-primary:hover {
  background: linear-gradient(180deg, #ffffff 0%, #f5f5f5 52%, #e2e2e2 100%) !important;
  transform: translateY(-1.5px) !important;
  box-shadow: inset 0 2px 0 #ffffff, 0 5px 0 var(--mono-white-extrusion), 0 10px 22px rgba(0, 0, 0, 0.8) !important;
}
.btn-action.highlight:active, .hud-btn-run:active, .btn-tactile-primary:active {
  transform: translateY(3px) scale(0.985) !important;
  box-shadow: inset 0 3px 6px rgba(0, 0, 0, 0.6), 0 0.5px 0 var(--mono-white-extrusion) !important;
}

/* 3. Secondary HUD Action Buttons (Strict Monochrome Obsidian) */
.hud-btn-stop, .hud-btn-auto {
  background: linear-gradient(180deg, #1c2028 0%, #11141a 52%, #080a0e 100%) !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.25) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4),
              inset 0 -1px 0 #000000,
              0 3.5px 0 var(--mono-extrusion-dark),
              0 6px 14px rgba(0, 0, 0, 0.95) !important;
}
.hud-btn-stop:hover, .hud-btn-auto:hover {
  border-color: #ffffff !important;
  background: linear-gradient(180deg, #282e3b 0%, #171b23 52%, #0c0f14 100%) !important;
}

/* 4. Deep Recessed Icon Well (Engraved Bed) */
.icon-well, .square-icon-well, .tactile-icon-well, .hud-icon-well {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 26px !important;
  height: 26px !important;
  border-radius: 6px !important;
  background: linear-gradient(180deg, #040507 0%, #0d0f14 100%) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  box-shadow: inset 0 3px 6px rgba(0, 0, 0, 0.98),
              inset 0 -1px 0 rgba(255, 255, 255, 0.2),
              0 1px 0 rgba(255, 255, 255, 0.08) !important;
  margin-left: 6px !important;
  flex-shrink: 0 !important;
}

/* 5. Deeply Engraved Vector Icons (Chiseled SVG Relief) */
.btn-action svg, .hud-btn svg, .btn-step svg, .btn-header svg,
.btn-tool-rail svg, .comp-tactile-btn svg, .shell > nav svg,
.icon-well svg, .square-icon-well svg, .tactile-icon {
  stroke: #ffffff !important;
  color: #ffffff !important;
  /* Opposing Top Shadow & Bottom Specular Highlight = Engraved Inset Effect */
  filter: drop-shadow(0 -1.5px 0 #000000)
          drop-shadow(0 1px 1px rgba(255, 255, 255, 0.45)) !important;
  transition: transform 0.1s ease !important;
}
.btn-action.highlight svg, .hud-btn-run svg, .btn-tactile-primary svg {
  stroke: #000000 !important;
  color: #000000 !important;
  filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.8))
          drop-shadow(0 -1px 0 rgba(0, 0, 0, 0.5)) !important;
}

/* 6. Pure White Luminous Micro-LED Indicator (Strictly Monochrome) */
.btn-led-dot {
  position: absolute;
  top: 5px;
  right: 6px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--mono-led-off);
  box-shadow: 0 0 2px rgba(255, 255, 255, 0.3);
  pointer-events: none;
  transition: all 0.15s ease;
}
.btn-action.highlight .btn-led-dot,
.hud-btn-run .btn-led-dot,
.btn-led-dot.led-on,
.active .btn-led-dot {
  background: var(--mono-led-on) !important;
  box-shadow: 0 0 5px #ffffff, 0 0 10px rgba(255, 255, 255, 0.85) !important;
}

/* 7. Tool Rail Buttons (Strict Monochrome Obsidian & Engraved Icons) */
.sidebar-tools-rail {
  display: flex !important;
  flex-direction: column !important;
  gap: 7px !important;
  z-index: 40 !important;
}
.btn-tool-rail {
  width: 40px !important;
  height: 40px !important;
  min-width: 40px !important;
  min-height: 40px !important;
  padding: 0 !important;
  border-radius: 9px !important;
}
.btn-tool-rail svg { width: 20px !important; height: 20px !important; }

/* 8. Mobile & Tablet Ergonomic Harmonization */
@media screen and (max-width: 768px), screen and (max-height: 500px) {
  .btn-action, .btn-header {
    min-height: 40px !important; height: 40px !important;
    padding: 0 10px !important; font-size: 11.5px !important; border-radius: 8px !important;
  }
  .btn-tool-rail {
    width: 42px !important; height: 42px !important;
    min-width: 42px !important; min-height: 42px !important;
  }
  .btn-home-link {
    min-width: 42px !important; min-height: 40px !important; height: 40px !important;
  }
  .hud-actions-col {
    display: flex !important; flex-wrap: nowrap !important;
    gap: 6px !important; overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important; scrollbar-width: none !important;
  }
  .hud-actions-col::-webkit-scrollbar { display: none !important; }
  .hud-btn {
    min-height: 40px !important; height: 40px !important;
    padding: 0 12px !important; font-size: 11.5px !important;
    white-space: nowrap !important; flex-shrink: 0 !important;
  }
}
