/* Modernized White Matte Engineering Theme - MechLogic */

:root {
  /* Matte White Palette Tokens */
  --bg-primary: #f8f9fa;       /* Off-white canvas */
  --bg-secondary: #ffffff;     /* Flat white cards/panels */
  --bg-tertiary: #f1f3f5;      /* Softer gray for headers/sidebars */
  --fg-primary: #121416;       /* Soft rich charcoal for main text */
  --fg-secondary: #495057;     /* Medium gray for supporting text */
  --fg-muted: #868e96;         /* Light slate gray for tags and limits */
  
  --border-primary: #121416;   /* Hard sharp contrast boundary line */
  --border-secondary: #dee2e6; /* Soft separator boundaries */
  --accent-color: #121416;     /* Pure monochrome emphasis */
  --accent-hover: #ffffff;     /* For text inversion effects */
  
  --brand-accent: #6c757d;     /* Premium Dark Gray */
  --brand-accent-light: rgba(108, 117, 125, 0.08); /* Faint tint of gray */
  
  --font-sans: 'Outfit', 'Inter', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --transition-speed: 0.12s;
  
  --gap-large: 24px;
  --gap-medium: 16px;
  --gap-small: 8px;
}

/* Base Styles & Structural Defaults */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-primary);
  color: var(--fg-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  height: 100vh;
  overflow: hidden;
}

/* Background Engineering Grid Effect (Matte blueprint theme) */
.grid-bg {
  background-size: 20px 20px;
  background-image: 
    linear-gradient(to right, rgba(18, 20, 22, 0.02) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(18, 20, 22, 0.02) 1px, transparent 1px);
}

/* App Main Wrapper Flex Layout */
#app-wrapper {
  display: flex;
  flex-direction: column;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

/* ==========================================
   PRIMARY SIDEBAR: Side Menu Tray
   ========================================== */
#sidebar-tray {
  background-color: var(--bg-secondary);
  border-right: 1px solid var(--border-primary);
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  user-select: none;
  z-index: 10;
}

.sidebar-header {
  padding: 24px 20px;
  border-bottom: 1px solid var(--border-secondary);
}

.logo-text {
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: 0.1em;
  color: var(--fg-primary);
}

.logo-sub {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.2em;
  color: var(--fg-secondary);
  margin-top: 4px;
}

/* Navigation Links */
.nav-menu {
  flex: 1;
  padding: 20px 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  color: var(--fg-secondary);
  text-decoration: none;
  font-weight: 500;
  letter-spacing: 0.02em;
  position: relative;
  transition: background-color var(--transition-speed), color var(--transition-speed);
}

.nav-icon {
  width: 18px;
  height: 18px;
  margin-right: 12px;
  color: var(--fg-secondary);
  transition: color var(--transition-speed);
}

.nav-label {
  font-size: 0.95rem;
}

/* Nav States */
.nav-item:hover {
  background-color: var(--bg-tertiary);
  color: var(--fg-primary);
}

.nav-item:hover .nav-icon {
  color: var(--fg-primary);
}

.nav-item.active {
  background-color: var(--fg-primary);
  color: var(--bg-secondary);
  font-weight: 600;
}

.nav-item.active .nav-icon {
  color: var(--bg-secondary);
}

.nav-indicator {
  position: absolute;
  right: 0;
  top: 0;
  width: 4px;
  height: 100%;
  background-color: var(--accent-color);
  display: none;
}

.nav-item.active .nav-indicator {
  display: block;
}

/* Locked status indicators */
.nav-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-left: auto;
}

.nav-status-dot.locked {
  background-color: #f03e3e; /* Red locked */
  box-shadow: 0 0 4px #ffc9c9;
}

.nav-status-dot.unlocked {
  background-color: #37b24d; /* Green unlocked */
  box-shadow: 0 0 4px #b2f2bb;
}

/* Sidebar Monitor Widgets */
.sidebar-system-stats {
  padding: 20px;
  border-top: 1px solid var(--border-secondary);
  background-color: var(--bg-tertiary);
  font-family: var(--font-mono);
  font-size: 10px;
}

.stat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.status-badge {
  background-color: #37b24d;
  color: #ffffff;
  padding: 1px 4px;
  font-size: 8px;
  font-weight: 800;
}

.status-badge.pulse {
  animation: badgePulse 2s infinite ease-in-out;
}

@keyframes badgePulse {
  0% { opacity: 1; }
  50% { opacity: 0.5; }
  100% { opacity: 1; }
}

.stat-metric {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}

.metric-lbl {
  color: var(--fg-secondary);
}

.metric-val {
  color: var(--fg-primary);
  font-weight: 600;
}

.stat-progress-bar {
  height: 3px;
  background-color: var(--border-secondary);
  width: 100%;
  margin-top: 6px;
}

.stat-progress-bar div {
  height: 100%;
  background-color: var(--accent-color);
  transition: width 0.5s ease;
}

/* ==========================================
   MAIN CONTENT AREA
   ========================================== */
#content-container {
  display: flex;
  flex-direction: row;
  flex: 1;
  width: 100%;
  height: calc(100% - 72px);
  overflow: hidden;
}

/* Header Banner */
#main-header {
  position: relative;
  z-index: 2000;
  background-color: var(--bg-secondary);
  background-size: 15px 15px;
  background-image: 
    linear-gradient(to right, rgba(108, 117, 125, 0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(108, 117, 125, 0.03) 1px, transparent 1px);
  border-bottom: 1px solid var(--border-primary);
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
  user-select: none;
}

.breadcrumb-container {
  font-family: var(--font-mono);
  font-size: 11px;
  margin-bottom: 4px;
  letter-spacing: 0.05em;
}

.bc-root {
  color: var(--fg-muted);
}

.bc-sep {
  color: var(--fg-muted);
  margin: 0 6px;
}

.bc-active {
  color: var(--fg-primary);
  font-weight: bold;
}

.header-title {
  font-weight: 800;
  font-size: 1.5rem;
  letter-spacing: -0.01em;
}

.header-subtitle {
  font-size: 0.85rem;
  color: var(--fg-secondary);
}

.env-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  border: 1px solid var(--border-primary);
  padding: 4px 10px;
  background-color: var(--bg-secondary);
  font-weight: 600;
}

/* Page Viewport Area */
#page-viewport {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  min-width: 0;
  max-width: 100%;
}

.view-page {
  display: none;
  flex: 1;
  min-height: 0;
  width: 100%;
  overflow-y: auto;
  box-sizing: border-box;
}

.view-page.active {
  display: block;
}

#home-page.active {
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100% !important;
  min-width: 0;
  max-width: 100%;
}

/* ==========================================
   PAGE 1: ENGINEERING TOOLS SYSTEM LAYOUT
   ========================================== */
.tools-layout {
  display: block;
  height: 100%;
  width: 100%;
}

body.tools-active #menu-btn-services,
body.tools-active #menu-btn-resume {
  display: none !important;
}

/* Tools Sub-navigation Panel */
#tools-subnav {
  background-color: var(--bg-secondary);
  border-right: 1px solid var(--border-secondary);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  user-select: none;
}

.subnav-title {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--fg-secondary);
  letter-spacing: 0.1em;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-secondary);
}

.subnav-list {
  list-style: none;
  flex: 1;
}

.subnav-item {
  display: flex;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-secondary);
  cursor: pointer;
  transition: background-color var(--transition-speed);
}

.subnav-item:hover {
  background-color: var(--bg-primary);
}

.subnav-item.active {
  background-color: var(--bg-tertiary);
}

.tool-dot {
  width: 6px;
  height: 6px;
  background-color: var(--fg-muted);
  border-radius: 50%;
  margin-right: 12px;
  flex-shrink: 0;
}

.subnav-item.active .tool-dot {
  background-color: var(--accent-color);
  box-shadow: 0 0 4px var(--fg-primary);
}

.tool-logo {
  width: 16px;
  height: 16px;
  margin-right: 12px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.subnav-item:hover .tool-logo {
  transform: scale(1.12);
}


.tool-info {
  flex: 1;
  margin-right: 8px;
}

.tool-name {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--fg-primary);
}

.tool-desc {
  font-size: 11px;
  color: var(--fg-secondary);
  margin-top: 2px;
}

.tool-badge {
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 700;
  padding: 1px 4px;
  border: 1px solid transparent;
}

.tool-badge.wasm {
  border-color: var(--border-primary);
  background-color: var(--bg-secondary);
}

.tool-badge.js {
  background-color: var(--fg-primary);
  color: var(--bg-secondary);
}

.subnav-help-box {
  padding: 16px;
  margin: 16px;
  border: 1px dotted var(--fg-muted);
  font-size: 11px;
  color: var(--fg-secondary);
}

.help-title {
  font-family: var(--font-mono);
  font-weight: bold;
  color: var(--fg-primary);
  margin-bottom: 4px;
}

/* Tool Workspace Viewport */
#tool-workspace {
  height: 100%;
  overflow-y: auto;
  padding: 24px;
}

.tool-viewactive {
  display: none;
  height: 100%;
  flex-direction: column;
}

.tool-viewactive.active {
  display: flex;
}

/* Header toolbar for individual tools */
.tool-header-panel {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-shrink: 0;
}

.th-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.th-left .title {
  font-weight: 700;
  letter-spacing: -0.01em;
}

.th-left .lbl {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--fg-secondary);
}

/* Select Form Control Dropdowns */
select {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 4px 8px;
  border: 1px solid var(--border-primary);
  background-color: var(--bg-secondary);
  color: var(--fg-primary);
  outline: none;
  cursor: pointer;
}

select option {
  background-color: var(--bg-secondary);
  color: var(--fg-primary);
}



/* ==========================================
   POLISHED BLACK-BOX CALCULATOR GRIDS
   ========================================== */
.calculator-grid {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 20px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.calc-inputs-panel {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.calc-results-panel {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100%;
}

.section-title {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--fg-secondary);
  border-bottom: 1px solid var(--border-secondary);
  padding-bottom: 6px;
  margin-bottom: 16px;
  text-transform: uppercase;
}

.input-row {
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.input-row label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--fg-primary);
}

/* Text Input Forms */
input[type="number"], input[type="text"], input[type="password"] {
  width: 100%;
  padding: 8px 12px;
  font-family: var(--font-mono);
  font-size: 13px;
  border: 1px solid var(--border-primary);
  background-color: var(--bg-secondary);
  color: var(--fg-primary);
  outline: none;
  transition: box-shadow 0.15s ease;
}

input:focus, textarea:focus, select:focus { box-shadow: 2px 2px 0px var(--border-primary); background-color: var(--bg-secondary) !important; outline: none; }

input:disabled {
  background-color: var(--bg-tertiary);
  color: var(--fg-muted);
  border-color: var(--border-secondary);
  cursor: not-allowed;
}

.field-hint {
  font-size: 10px;
  color: var(--fg-muted);
  margin-top: 2px;
}

.calc-action-row {
  margin-top: 10px;
  display: flex;
  gap: 12px;
}

/* Equation Formulas Preview Box */
.py-code-preview-box {
  margin-top: 24px;
  border: 1px dotted var(--border-primary);
}

.box-header {
  background-color: var(--bg-tertiary);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  padding: 4px 8px;
  border-bottom: 1px dotted var(--border-primary);
  color: var(--fg-secondary);
}

.formula-block {
  padding: 12px;
  background-color: var(--bg-secondary);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.6;
}

.formula-item {
  margin-bottom: 8px;
  display: flex;
  flex-direction: column;
}

.formula-item:last-child {
  margin-bottom: 0;
}

.formula-lbl {
  font-weight: bold;
  color: var(--fg-muted);
  font-size: 9px;
  text-transform: uppercase;
}

.formula-eqn {
  color: var(--fg-primary);
  font-weight: 600;
}

.variable-legend {
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px dotted var(--border-secondary);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.variable-legend strong {
  font-size: 9px;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: 2px;
}

.variable-legend span {
  font-size: 10px;
  color: var(--fg-secondary);
}

/* Plot and Canvas Graph Container */
.plot-container {
  padding: 16px;
  background-color: #ffffff;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 280px;
  border-bottom: 1px solid var(--border-primary);
  flex-shrink: 0;
}

canvas {
  width: 100%;
  height: 100%;
}

/* Results Coordinates Table Container with Scroll */
.results-table-container {
  flex: 1;
  overflow-y: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.data-table th, .data-table td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-secondary);
}

.data-table th {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  background-color: var(--bg-primary);
  border-bottom: 1px solid var(--border-primary);
  position: sticky;
  top: 0;
  z-index: 1;
}

.data-table tr:last-child td {
  border-bottom: none;
}

/* Buttons style */
.btn-primary {
  background-color: var(--accent-color);
  color: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 8px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all var(--transition-speed);
}

.btn-primary:hover {
  background-color: var(--bg-secondary);
  color: var(--fg-primary);
}

.btn-secondary {
  background-color: var(--bg-secondary);
  color: var(--fg-primary);
  border: 1px solid var(--border-primary);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 8px 16px;
  cursor: pointer;
  transition: all var(--transition-speed);
}

.btn-secondary:hover {
  background-color: var(--bg-tertiary);
}

/* ==========================================
   OHM'S LAW INTERACTIVE CIRCUITS
   ========================================== */
.standalone-calculator {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  padding: 24px;
}

.calc-intro {
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 1px dotted var(--border-secondary);
  color: var(--fg-secondary);
}

.ohms-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 24px;
}

.input-with-checkbox {
  display: flex;
  gap: 12px;
  align-items: center;
}

.input-with-checkbox input[type="number"] {
  flex: 1;
}

.check-lbl {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  white-space: nowrap;
}

.circuit-schematic-card {
  border: 1px solid var(--border-primary);
  background-color: var(--bg-secondary);
}

.circuit-schematic-card .card-header {
  background-color: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-primary);
  padding: 10px 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.schematic-container {
  padding: 16px;
  background-color: #ffffff;
  display: flex;
  justify-content: center;
  align-items: center;
}

.circuit-svg {
  width: 100%;
  max-width: 360px;
  height: auto;
}

.results-table-card {
  border: 1px solid var(--border-primary);
  background-color: var(--bg-secondary);
}

.results-table-card .card-header {
  background-color: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-primary);
  padding: 10px 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.formula-text {
  font-family: var(--font-mono);
  color: var(--fg-secondary);
  font-size: 12px;
}

/* Converter Panel */
.converter-box {
  max-width: 600px;
  margin: 0 auto;
}

.selector-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.selector-row select {
  font-size: 13px;
  padding: 6px 12px;
}

.converter-grid {
  display: grid;
  grid-template-columns: 1fr 40px 1fr;
  align-items: center;
  gap: 16px;
}

.converter-arrow {
  text-align: center;
  color: var(--fg-muted);
}

.converter-panel-from, .converter-panel-to {
  background-color: var(--bg-primary);
  border: 1px solid var(--border-primary);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.converter-panel-from select, .converter-panel-to select {
  font-size: 13px;
  padding: 6px;
}

/* ==========================================
   PAGE 2: ENGINEERING SERVICES LAYOUT
   ========================================== */
.services-container { padding: 24px; height: auto; max-width: 1200px; margin: 0 auto; width: 100%; box-sizing: border-box; }

.view-header-desc {
  margin-bottom: 24px;
}

.view-header-desc h2 {
  font-weight: 800;
  font-size: 1.6rem;
  letter-spacing: -0.01em;
}

.view-header-desc p {
  color: var(--fg-secondary);
  margin-top: 4px;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.service-card {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-primary);
    padding: 32px;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.service-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.4);
    border-color: var(--fg-muted);
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: transparent;
    transition: background-color 0.3s ease;
}

.service-card:hover::before {
    background-color: var(--fg-primary);
}

.service-icon {
    transition: transform 0.3s ease, color 0.3s ease;
}

.service-card:hover .service-icon {
    transform: scale(1.1);
}

.card-num {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--fg-muted);
  margin-bottom: 8px;
}

.card-title {
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border-secondary);
  padding-bottom: 8px;
}

.card-desc {
  color: var(--fg-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 16px;
}

.card-bullets {
  list-style: none;
  margin-top: auto;
  font-family: var(--font-mono);
  font-size: 11px;
}

.card-bullets li {
  position: relative;
  padding-left: 14px;
  margin-bottom: 6px;
  color: var(--fg-primary);
}

.card-bullets li::before {
  content: "»";
  position: absolute;
  left: 0;
  color: var(--fg-muted);
}

/* Projects Highlight Section styles */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.project-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  padding: 20px;
  display: flex;
  flex-direction: column;
}

.proj-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--fg-muted);
  margin-bottom: 8px;
}

.proj-code {
  font-weight: 700;
  color: var(--fg-primary);
}

.proj-title {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin-bottom: 8px;
}

.proj-desc {
  font-size: 0.88rem;
  color: var(--fg-secondary);
  line-height: 1.5;
  margin-bottom: 16px;
}

.proj-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
}

.tag-sm {
  font-family: var(--font-mono);
  font-size: 9px;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-secondary);
  padding: 2px 6px;
  font-weight: 600;
}

/* Estimates Widget */
#service-calculator-widget {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-primary);
}

.widget-header {
  background-color: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-primary);
  padding: 12px 20px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.widget-body {
  padding: 24px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  align-items: center;
}

/* Custom range inputs */
input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 0;
  background: #25262b;
  border: 1px solid var(--border-primary);
  outline: none;
  margin: 8px 0;
  transition: background 0.2s, border-color 0.2s;
}

input[type="range"]:hover {
  background: #2b303b;
  border-color: var(--brand-accent);
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 0;
  background: var(--brand-accent);
  border: 1.5px solid #ffffff;
  cursor: pointer;
  box-shadow: 0 0 8px rgba(108, 117, 125, 0.6);
  transition: transform 0.15s, background-color 0.15s;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.25);
  background-color: #adb5bd;
}

input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 0;
  background: var(--brand-accent);
  border: 1.5px solid #ffffff;
  cursor: pointer;
  box-shadow: 0 0 8px rgba(108, 117, 125, 0.6);
  transition: transform 0.15s, background-color 0.15s;
}

input[type="range"]::-moz-range-thumb:hover {
  transform: scale(1.25);
  background-color: #adb5bd;
}

.range-val-bar {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--fg-secondary);
  margin-top: 6px;
}

.range-val-bar strong {
  font-size: 12px;
  color: var(--fg-primary);
}

/* Checkbox component styling */
.chk-container {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  user-select: none;
}

.chk-container input {
  display: none;
}

.custom-chk {
  width: 16px;
  height: 16px;
  border: 1px solid var(--border-primary);
  background-color: #ffffff;
  display: inline-block;
  position: relative;
  flex-shrink: 0;
}

.chk-container input:checked + .custom-chk::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 8px;
  height: 8px;
  background-color: var(--accent-color);
}

.widget-result {
  background-color: var(--bg-primary);
  border: 1px solid var(--border-primary);
  padding: 20px;
  text-align: center;
}

.result-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--fg-secondary);
}

.result-price {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--fg-primary);
  margin: 10px 0;
}

.result-breakdown {
  font-size: 11px;
  color: var(--fg-secondary);
  font-family: var(--font-mono);
}

/* ==========================================
   PAGE 3: LOCKED / UNLOCKED PORTFOLIO LAYOUT
   ========================================== */
.lock-panel-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
  padding: 24px;
}

.lock-card {
  width: 100%;
  max-width: 440px;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  padding: 30px;
  text-align: center;
  box-shadow: 4px 4px 0px rgba(0, 0, 0, 0.05);
}

.lock-icon {
  margin-bottom: 16px;
  color: var(--fg-muted);
}

.lock-title {
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: 0.02em;
  margin-bottom: 8px;
}

.lock-desc {
  font-size: 13px;
  color: var(--fg-secondary);
  line-height: 1.5;
  margin-bottom: 24px;
}

.passcode-input-group {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.passcode-input-group input {
  text-align: center;
  letter-spacing: 0.2em;
  font-size: 1.1rem;
}

.lock-hint {
  font-size: 11px;
  color: var(--fg-secondary);
  margin-bottom: 20px;
}

.lock-hint .code-word {
  font-family: var(--font-mono);
  color: var(--fg-primary);
  border-bottom: 1px dotted var(--fg-primary);
}

/* Security Keypad UI */
.lock-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  max-width: 220px;
  margin: 0 auto;
}

.keypad-btn {
  background-color: var(--bg-primary);
  border: 1px solid var(--border-secondary);
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  padding: 10px;
  cursor: pointer;
  transition: all var(--transition-speed);
}

.keypad-btn:hover {
  background-color: var(--bg-tertiary);
  border-color: var(--border-primary);
}

.keypad-btn.delete {
  font-size: 10px;
  font-weight: 700;
  background-color: #ffe3e3;
  color: #e03131;
  border-color: #ffc9c9;
}

.keypad-btn.submit {
  font-size: 10px;
  font-weight: 700;
  background-color: #e3faf2;
  color: #0ca678;
  border-color: #c3fae8;
}

.error-msg {
  color: #f03e3e;
  font-size: 11px;
  font-family: var(--font-mono);
  margin-top: 16px;
}

.error-msg.hide {
  display: none;
}

/* State B: Portfolio Unlocked Content Frame */
.unlocked-content-wrapper {
  padding: 24px;
  height: 100%;
  overflow-y: auto;
}

.unlocked-content-wrapper.hide {
  display: none;
}

.unlocked-alert {
  background-color: #e6fcf5;
  border: 1px solid #0ca678;
  padding: 10px 16px;
  color: #0c8569;
  font-family: var(--font-mono);
  font-size: 11px;
  margin-bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.badge {
  font-weight: bold;
  padding: 2px 4px;
  background-color: #0ca678;
  color: #ffffff;
  margin-right: 8px;
}

.resume-columns {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 24px;
}

.resume-sec {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  padding: 24px;
  margin-bottom: 24px;
}

.sec-header {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--fg-secondary);
  border-bottom: 2px solid var(--border-primary);
  padding-bottom: 6px;
  margin-bottom: 20px;
}

.job-block {
  margin-bottom: 24px;
}

.job-block:last-child {
  margin-bottom: 0;
}

.job-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 4px;
}

.job-title {
  font-weight: 800;
  font-size: 1.1rem;
}

.job-date {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-secondary);
}

.job-company {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--fg-muted);
  margin-bottom: 8px;
}

.job-body {
  font-size: 0.9rem;
  color: var(--fg-secondary);
  line-height: 1.6;
}

.job-list {
  margin-top: 10px;
  list-style: none;
  font-size: 0.88rem;
  color: var(--fg-secondary);
}

.job-list li {
  position: relative;
  padding-left: 14px;
  margin-bottom: 4px;
}

.job-list li::before {
  content: "-";
  position: absolute;
  left: 0;
  color: var(--fg-muted);
}

/* Skills display tags */
.skill-group {
  margin-bottom: 16px;
}

.skill-group:last-child {
  margin-bottom: 0;
}

.skill-lbl {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--fg-muted);
  margin-bottom: 8px;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-secondary);
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 600;
}

/* Portfolio Project Card */
.portfolio-card {
  border: 1px solid var(--border-secondary);
  padding: 16px;
  margin-bottom: 12px;
  transition: border-color var(--transition-speed);
}

.portfolio-card:hover {
  border-color: var(--border-primary);
}

.portfolio-card:last-child {
  margin-bottom: 0;
}

.p-num {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  color: var(--fg-muted);
}

.p-title {
  font-weight: 700;
  font-size: 0.95rem;
  margin: 4px 0 8px 0;
}

.p-desc {
  font-size: 0.85rem;
  color: var(--fg-secondary);
  line-height: 1.5;
}

/* ==========================================
   PORTAL FOOTER
   ========================================== */
#portal-footer {
  height: 32px;
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border-primary);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 24px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--fg-secondary);
  user-select: none;
  flex-shrink: 0;
}

.divider {
  color: var(--border-secondary);
  margin: 0 8px;
}

/* ==========================================
   TOAST NOTIFICATION POPUPS
   ========================================== */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background-color: var(--bg-secondary);
  border: 1.5px solid var(--border-primary);
  padding: 12px 20px;
  z-index: 200;
  box-shadow: 4px 4px 0px var(--border-primary);
  transition: opacity 0.25s, transform 0.25s;
}

.toast.hide {
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
}

.toast-body {
  display: flex;
  align-items: center;
  gap: 10px;
}

.toast-indicator {
  width: 8px;
  height: 8px;
  background-color: #37b24d;
  border-radius: 50%;
}

.toast-text {
  font-weight: 600;
  font-size: 0.85rem;
}

/* Hide helper class */
.hide {
  display: none !important;
}

/* Responsive adjustments */
@media (max-width: 900px) {
  #app-wrapper {
    grid-template-columns: 1fr;
  }
  #sidebar-tray {
    display: none;
  }
  #page-viewport {
    width: 100% !important;
    max-width: 100% !important;
  }
  .tools-layout {
    grid-template-columns: 1fr;
  }
  #tools-subnav {
    display: none;
  }
  .calculator-grid {
    grid-template-columns: 1fr;
  }
  .resume-columns {
    grid-template-columns: 1fr;
  }
}

/* ==========================================
   CURVEVIEW COMPONENT STYLES
   ========================================== */
.cv-ctx-menu {
  position: absolute;
  background-color: #25262b !important;
  border: 1px solid #2c2e33 !important;
  color: #c1c2c5 !important;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5) !important;
  font-family: var(--font-sans);
  border-radius: 4px;
  overflow: hidden;
}

.cv-ctx-item {
  padding: 8px 12px;
  cursor: pointer;
  transition: background-color var(--transition-speed);
}

.cv-ctx-item:hover {
  background-color: #2c2e33 !important;
  color: #ffffff !important;
}

#cv-table-body td {
  padding: 6px 12px !important;
  border-bottom: 1px solid #2c2e33 !important;
  font-family: var(--font-mono);
  font-size: 10px;
  vertical-align: middle;
}

#cv-table-body tr {
  cursor: pointer;
}

#cv-table-body tr:hover {
  background-color: #25262b;
}

#cv-table-body tr.selected {
  background-color: #2d3748 !important;
}

#curveview-canvas {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: auto;
}

#btn-import-cv-csv + input[type="file"],
#btn-open-cvp + input[type="file"] {
  display: none;
}

/* ==========================================
   GATEWAY SELECTOR (HOME LANDING PAGE)
   ========================================== */
body.home-active #sidebar-tray {
  display: none !important;
}

body.home-active #app-wrapper {
  grid-template-columns: 1fr !important;
}

body.home-active #main-header {
  display: none !important;
}

.gateway-screen {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 40px;
  background-color: var(--bg-primary);
  box-sizing: border-box;
  text-align: center;
}

.gateway-logo-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 24px;
}

.gateway-logo-block .logo-icon {
  margin-bottom: 16px;
  stroke: var(--brand-accent);
}

.gateway-brand {
  font-family: var(--font-sans);
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--fg-primary);
  margin: 0;
}

.gateway-tagline {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.25em;
  color: var(--fg-secondary);
  text-transform: uppercase;
  margin-top: 8px;
}

.gateway-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  width: 100%;
  max-width: 900px;
  margin: 32px 0;
}

.gateway-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  padding: 36px 32px;
  border-radius: 8px;
  cursor: pointer;
  transition: transform var(--transition-speed), box-shadow var(--transition-speed), border-color var(--transition-speed);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  justify-content: space-between;
  box-shadow: 0 4px 12px rgba(18, 20, 22, 0.02);
}

.gateway-card:hover {
  transform: translateY(-4px);
  border-color: var(--brand-accent);
  box-shadow: 0 8px 24px rgba(108, 117, 125, 0.08);
}

.gate-icon {
  margin-bottom: 20px;
  color: var(--brand-accent);
  background-color: var(--brand-accent-light);
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gate-title {
  font-family: var(--font-sans);
  font-size: 1.2rem;
  font-weight: 800;
  margin-bottom: 12px;
  color: var(--fg-primary);
}

.gate-desc {
  font-size: 0.9rem;
  color: var(--fg-secondary);
  line-height: 1.6;
  margin-bottom: 24px;
  flex: 1;
}

.gateway-footer {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--fg-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-top: 16px;
}

@media (max-width: 768px) {
  .gateway-split {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

.tools-cta-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(108, 117, 125, 0.08);
}

/* Sidebar Hidden Layout Mode (for landing pages) */
body.sidebar-hidden #sidebar-tray {
  display: none !important;
}

body.sidebar-hidden #app-wrapper {
  grid-template-columns: 1fr !important;
}

body.sidebar-hidden #page-viewport {
  width: 100% !important;
  max-width: 100% !important;
}

body:not(.sidebar-hidden) #page-viewport {
  width: calc(100% - 240px) !important;
  max-width: calc(100% - 240px) !important;
}

.pub-nav-item {
  color: var(--fg-muted) !important;
  text-decoration: none;
  padding: 8px 0;
  transition: color var(--transition-speed);
  display: inline-flex;
  align-items: center;
}

.pub-nav-item > span:first-child {
  border-bottom: 2px solid transparent;
  padding-bottom: 8px;
  transition: border-color var(--transition-speed);
}

.pub-nav-item:hover {
  color: var(--fg-primary) !important;
}

.pub-nav-item.active {
  color: var(--fg-primary) !important;
}

.pub-nav-item.active > span:first-child {
  border-color: var(--brand-accent) !important;
}



/* Sidebar Collapsible Categories */
.sidebar-category {
  display: flex;
  flex-direction: column;
}

.category-header {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 800;
  color: var(--fg-muted);
  letter-spacing: 0.1em;
  padding: 6px 16px 8px 16px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  transition: color var(--transition-speed);
}

.category-header:hover {
  color: var(--fg-primary);
}

.category-header .category-chevron {
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  color: var(--fg-muted);
}

.category-header:hover .category-chevron {
  color: var(--fg-primary);
}

/* Collapsible behavior */
.sidebar-category.collapsed .subnav-list {
  max-height: 0 !important;
  opacity: 0 !important;
  margin: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  pointer-events: none;
}

.sidebar-category .subnav-list {
  max-height: 500px; /* Large enough for the list content */
  opacity: 1;
  transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease, padding 0.3s ease, margin 0.3s ease;
  overflow: hidden;
}

.sidebar-category.collapsed .category-chevron {
  transform: rotate(-90deg);
}

/* Unified Personal Finance Web App Subnav Tabs */
.finance-subnav-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--fg-muted);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: bold;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  user-select: none;
}

.finance-subnav-btn:hover {
  color: var(--fg-primary);
  background: rgba(255, 255, 255, 0.02);
}

.finance-subnav-btn.active {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border-primary);
  color: var(--fg-primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.finance-subtab-content {
  display: none;
  animation: finFadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.finance-subtab-content.active {
  display: block;
}

@keyframes finFadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================================================
   FASTENER STRESS ANALYZER DASHBOARD ADDITIONS
   ========================================================================== */

.fastener-dashboard-grid {
  grid-template-columns: 290px 1fr 330px !important;
}

@media (max-width: 1200px) {
  .fastener-dashboard-grid {
    grid-template-columns: 310px 1fr !important;
    grid-template-rows: auto auto;
    overflow-y: auto !important;
  }
  .fastener-col-analytics {
    grid-column: span 2;
    border-top: 1px solid var(--border-primary);
  }
}

@media (max-width: 850px) {
  .fastener-dashboard-grid {
    grid-template-columns: 1fr !important;
    grid-template-rows: auto;
  }
  .fastener-col-analytics {
    grid-column: span 1;
  }
  .fastener-col-schematic {
    border-left: none !important;
    border-right: none !important;
    border-top: 1px solid var(--border-primary);
    border-bottom: 1px solid var(--border-primary);
  }
}

/* Premium Range Sliders */
.premium-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 0;
  background: #25262b;
  border: 1px solid var(--border-primary);
  outline: none;
  margin: 8px 0;
  transition: background 0.2s, border-color 0.2s;
}

.premium-slider:hover {
  background: #2b303b;
  border-color: var(--brand-accent);
}

.premium-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 0;
  background: var(--brand-accent);
  border: 1.5px solid #ffffff;
  cursor: pointer;
  box-shadow: 0 0 8px rgba(108, 117, 125, 0.6);
  transition: transform 0.15s, background-color 0.15s;
}

.premium-slider::-webkit-slider-thumb:hover {
  transform: scale(1.25);
  background-color: #adb5bd;
}

.premium-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 0;
  background: var(--brand-accent);
  border: 1.5px solid #ffffff;
  cursor: pointer;
  box-shadow: 0 0 8px rgba(108, 117, 125, 0.6);
  transition: transform 0.15s, background-color 0.15s;
}

.premium-slider::-moz-range-thumb:hover {
  transform: scale(1.25);
  background-color: #adb5bd;
}

/* Safety Status Badge Styles */
.badge-safe {
  border: 1.5px solid #22c55e !important;
  color: #22c55e !important;
  background-color: rgba(34, 197, 94, 0.08) !important;
}

.badge-warn {
  border: 1.5px solid #eab308 !important;
  color: #eab308 !important;
  background-color: rgba(234, 179, 8, 0.08) !important;
}

.badge-fail {
  border: 1.5px solid #ef4444 !important;
  color: #ef4444 !important;
  background-color: rgba(239, 68, 68, 0.08) !important;
  animation: pulse-border 1.5s infinite;
}

@keyframes pulse-border {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
  70% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* stress glow animations */
@keyframes stress-pulse {
  0% { transform: scale(1); opacity: 0.35; }
  50% { transform: scale(1.15); opacity: 0.75; }
  100% { transform: scale(1); opacity: 0.35; }
}

.pulse-stress-active {
  transform-origin: 138px 125px;
  animation: stress-pulse 1.2s infinite ease-in-out;
}

.fastener-results-table tbody tr:hover {
  background-color: rgba(255, 255, 255, 0.02);
}

.fastener-results-table td {
  padding: 6px 10px !important;
}

/* Force dark background and white text on all input/select elements in calculators to override browser theme clashes */
.calc-inputs-panel input[type="number"],
.calc-inputs-panel select,
.calc-inputs-panel select option {
  background-color: #1a1b1e !important;
  color: #ffffff !important;
}

/* Hide children of locked tools when user is not authenticated */
.lock-hidden {
  display: none !important;
}

/* Hide locked sidebar items by default */
.locked-tool-item {
  display: none !important;
}
/* Show locked sidebar items when authenticated */
.tools-authorized .locked-tool-item {
  display: flex !important;
}

/* Hide unlock trigger from sidebar when authenticated */
.tools-authorized .unlock-trigger-item {
  display: none !important;
}

/* ==========================================
   WEALTHOS FINANCIAL TERMINAL (TOS STYLE)
   ========================================== */

/* Terminal Main Wrapper */
.tos-terminal-container {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 180px);
  min-height: 850px;
  background-color: #0b0c10;
  color: #ffffff;
  font-family: var(--font-sans);
  box-sizing: border-box;
  width: 100%;
}

/* top status bar */
.tos-system-bar {
  background-color: #16171d !important;
  border-bottom: 1px solid #2d3139 !important;
}

/* Sidebar elements */
.tos-sidebar {
  width: 260px;
  border-right: 1px solid #2d3139 !important;
  background-color: #121317 !important;
}

.tos-pane-header {
  background-color: #16171d !important;
  border-bottom: 1px solid #2d3139 !important;
  padding: 6px 12px;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: bold;
  color: #8a8d98;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* metric widget cards */
.tos-metric-card {
  background-color: #1c1d22 !important;
  border: 1px solid #2d3139 !important;
  padding: 8px 12px;
}

.tos-metric-label {
  font-size: 8px;
  font-family: var(--font-mono);
  color: #8a8d98;
}

.tos-metric-val {
  font-size: 1.3rem;
  font-weight: 800;
  margin-top: 4px;
  font-family: var(--font-mono);
}

.tos-metric-val.green {
  color: #00ff66 !important;
}

.tos-metric-val.blue {
  color: #00bcff !important;
}

/* Watchlist styling */
.tos-watchlist-container {
  padding: 8px;
  box-sizing: border-box;
}

.tos-watchlist-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 10px;
  color: #c1c2c5;
}

.tos-watchlist-table th {
  font-family: var(--font-mono);
  font-size: 8.5px;
  color: #8a8d98;
  border-bottom: 1px solid #2d3139;
  padding: 4px 2px;
}

.tos-watchlist-table td {
  padding: 6px 2px;
  border-bottom: 1px solid rgba(45, 49, 57, 0.5);
  cursor: pointer;
  transition: background-color 0.2s;
}

.tos-watchlist-table tbody tr:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

/* Watchlist tick flashing animations */
@keyframes flashGreen {
  0% { background-color: rgba(0, 255, 102, 0.35); }
  100% { background-color: transparent; }
}

@keyframes flashRed {
  0% { background-color: rgba(255, 51, 51, 0.35); }
  100% { background-color: transparent; }
}

.flash-up {
  animation: flashGreen 1.2s ease-out;
}

.flash-down {
  animation: flashRed 1.2s ease-out;
}

/* Webull Style Top Horizontal Tab Bar & Buttons */
.webull-tab-bar {
  display: flex;
  background-color: #16171d;
  border-bottom: 1px solid #2d3139;
  height: 38px;
  box-sizing: border-box;
  width: 100%;
  flex-shrink: 0 !important;
}

.tos-quick-link-btn {
  width: auto !important;
  text-align: center !important;
  padding: 0 20px !important;
  font-family: var(--font-sans) !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  border: none !important;
  border-right: 1px solid #2d3139 !important;
  cursor: pointer;
  transition: all 0.2s;
  background-color: transparent !important;
  color: #8a8d98 !important;
  height: 100% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-left: none !important;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.tos-quick-link-btn:hover {
  background-color: #1c1d22 !important;
  color: #ffffff !important;
}

.tos-quick-link-btn.active {
  background-color: #121317 !important;
  color: #00ff66 !important;
  border-bottom: 2px solid #00ff66 !important;
}

/* Webull Style Typography Overrides for WealthOS (excluding console) */
.tos-system-bar,
.tos-sidebar,
.tos-account-summary-panel,
.tos-watchlist-container,
.tos-watchlist-table,
.tos-watchlist-table th,
.tos-watchlist-table td,
.tos-metric-card,
.tos-metric-label,
.tos-metric-val,
.tos-chart-toolbar,
.tos-workspace-main,
.tos-workspace-main *,
.tos-active-chart-title,
.tos-chart-hover-info,
.webull-tab-bar,
.webull-tab-bar button {
  font-family: var(--font-sans) !important;
}

/* Main workspace panel viewports */
.tos-workspace-main {
  flex: 1;
  background-color: #0b0c10;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
}

.tos-workspace-tab-content {
  display: none;
  flex-direction: column;
  flex: 1;
}

.tos-workspace-tab-content.active {
  display: flex !important;
}

/* input styles override */
.tos-terminal-container input[type="number"],
.tos-terminal-container input[type="text"],
.tos-terminal-container input[type="date"] {
  background-color: #1a1b1e !important;
  color: #ffffff !important;
  border: 1px solid #2d3139 !important;
  padding: 6px 10px !important;
  font-family: var(--font-mono) !important;
  font-size: 10.5px !important;
  outline: none;
  width: 100%;
  box-sizing: border-box;
}

.tos-terminal-container input[type="number"]:focus,
.tos-terminal-container input[type="text"]:focus,
.tos-terminal-container input[type="date"]:focus {
  border-color: #00ff66 !important;
}

/* custom card hub override */
.custom-tool-card {
  border: 1px solid #2d3139 !important;
  background-color: #121317 !important;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 2px 2px 0px rgba(0, 0, 0, 0.2);
  position: relative;
  overflow: hidden;
}

.custom-tool-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 2px;
  height: 100%;
  background-color: #2d3139;
  transition: background-color 0.25s;
}

.custom-tool-card:hover {
  transform: translateY(-2px);
  border-color: #00ff66 !important;
  box-shadow: 0 4px 16px rgba(0, 255, 102, 0.12);
}

.custom-tool-card:hover::before {
  background-color: #00ff66;
}

.tool-status-dot.active {
  background-color: #00ff66 !important;
  box-shadow: 0 0 8px #00ff66;
}

/* persistent console styling */
.tos-console-bar {
  background-color: #0b0c10 !important;
  border-top: 1px solid #2d3139 !important;
}

.tos-console-header {
  background-color: #16171d !important;
  border-bottom: 1px solid #2d3139 !important;
}

#tos-console-log {
  background-color: #050608 !important;
  color: #00ff66 !important;
  font-family: var(--font-mono) !important;
  font-size: 10px !important;
  position: relative;
  overflow: auto;
}

#tos-console-log::after {
  content: " ";
  display: block;
  position: absolute;
  top: 0; left: 0; bottom: 0; right: 0;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.04), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.04));
  z-index: 10;
  background-size: 100% 3px, 6px 100%;
  pointer-events: none;
}

#tos-console-input {
  border: none !important;
  background: transparent !important;
  outline: none !important;
  color: #ffffff !important;
  caret-color: #00ff66;
}

/* ==========================================
   DYNAMIC DARK/LIGHT FILTER OVERLAY
   ========================================== */
#tool-finance-dashboard,
#halvorsen-canvas,
#curveview-canvas {
  filter: invert(1) hue-rotate(180deg);
}

/* Reduce text boldness in WealthOS to prevent blurry sub-pixel rendering under invert filter */
#tool-finance-dashboard,
#tool-finance-dashboard * {
  font-weight: 400 !important;
  -webkit-font-smoothing: antialiased !important;
  -moz-osx-font-smoothing: grayscale !important;
  text-rendering: optimizeLegibility !important;
}
#tool-finance-dashboard strong,
#tool-finance-dashboard h2,
#tool-finance-dashboard h3,
#tool-finance-dashboard h4,
#tool-finance-dashboard th,
#tool-finance-dashboard .tos-metric-val,
#tool-finance-dashboard .tos-pane-header,
#tool-finance-dashboard .tos-quick-link-btn,
#tool-finance-dashboard .panel-section-title,
#tool-finance-dashboard .webull-tab-bar button.active {
  font-weight: 600 !important;
}

/* Ensure WealthOS sub-tool inputs and labels use hardcoded dark colors for perfect light-theme inversion */
#tool-finance-dashboard label {
  color: #c1c2c5 !important;
}

#tool-finance-dashboard input[type="text"],
#tool-finance-dashboard input[type="number"],
#tool-finance-dashboard input[type="password"],
#tool-finance-dashboard select,
#tool-finance-dashboard textarea {
  background-color: #121317 !important;
  color: #ffffff !important;
  border: 1px solid #2d3139 !important;
}

#tool-finance-dashboard input:focus,
#tool-finance-dashboard select:focus {
  border-color: #00ff66 !important;
  outline: none !important;
}

/* ==========================================
   HIGH-DENSITY ENGINEERING TERMINAL WORKSPACE
   ========================================== */
#tools-page .tool-viewactive:not(#tool-finance-dashboard) {
  height: 100% !important;
}

#tools-page .tool-viewactive:not(#tool-finance-dashboard) .tool-header-panel {
  background-color: var(--bg-tertiary) !important;
  border: 1px solid var(--border-primary) !important;
  border-bottom: none !important;
  padding: 8px 16px !important;
  margin-bottom: 0 !important;
  font-family: var(--font-mono) !important;
  font-size: 10px !important;
  font-weight: bold !important;
  height: 36px !important;
  box-sizing: border-box !important;
  border-radius: 0 !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
}

#tools-page .tool-viewactive:not(#tool-finance-dashboard) .tool-header-panel .title {
  color: var(--fg-primary) !important;
  font-size: 11px !important;
  font-weight: 800 !important;
  text-transform: uppercase !important;
}

#tools-page .tool-viewactive:not(#tool-finance-dashboard) .tool-header-panel .lbl {
  color: var(--brand-accent) !important;
  font-size: 9px !important;
}

#tools-page .tool-viewactive:not(#tool-finance-dashboard) .calculator-grid,
#tools-page .tool-viewactive:not(#tool-finance-dashboard) .curve-view-grid,
#tools-page .tool-viewactive:not(#tool-finance-dashboard) .stream-grid {
  display: grid !important;
  grid-template-columns: 280px 1fr !important;
  gap: 0 !important;
  flex: 1 !important;
  min-height: 0 !important;
  border: 1px solid var(--border-primary) !important;
  box-sizing: border-box !important;
  height: calc(100% - 36px) !important;
  background-color: var(--bg-secondary) !important;
  border-radius: 0 !important;
}

#tools-page .tool-viewactive:not(#tool-finance-dashboard) .calc-inputs-panel {
  background-color: var(--bg-secondary) !important;
  border: none !important;
  border-right: 1px solid var(--border-primary) !important;
  padding: 16px !important;
  overflow-y: auto !important;
  box-sizing: border-box !important;
  border-radius: 0 !important;
}

#tools-page .tool-viewactive:not(#tool-finance-dashboard) .calc-results-panel {
  background-color: var(--bg-primary) !important;
  border: none !important;
  padding: 16px !important;
  overflow-y: auto !important;
  box-sizing: border-box !important;
  border-radius: 0 !important;
}

#tools-page .tool-viewactive:not(#tool-finance-dashboard) .section-title {
  background-color: var(--bg-tertiary) !important;
  border: 1px solid var(--border-primary) !important;
  color: var(--fg-primary) !important;
  padding: 4px 8px !important;
  margin-bottom: 12px !important;
  margin-top: 16px !important;
  font-family: var(--font-mono) !important;
  font-size: 9px !important;
  font-weight: bold !important;
  letter-spacing: 0.05em !important;
  text-transform: uppercase !important;
  border-radius: 0 !important;
}

#tools-page .tool-viewactive:not(#tool-finance-dashboard) .section-title:first-child {
  margin-top: 0 !important;
}

#tools-page .tool-viewactive:not(#tool-finance-dashboard) input[type="number"],
#tools-page .tool-viewactive:not(#tool-finance-dashboard) input[type="text"],
#tools-page .tool-viewactive:not(#tool-finance-dashboard) select {
  font-family: var(--font-mono) !important;
  font-size: 11px !important;
  padding: 6px 10px !important;
  border: 1px solid var(--border-primary) !important;
  background-color: var(--bg-secondary) !important;
  color: var(--fg-primary) !important;
  border-radius: 0 !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

#tools-page .tool-viewactive:not(#tool-finance-dashboard) label {
  font-family: var(--font-mono) !important;
  font-size: 10px !important;
  color: var(--fg-secondary) !important;
  margin-bottom: 2px !important;
  font-weight: bold !important;
}

#tools-page .tool-viewactive:not(#tool-finance-dashboard) .field-hint,
#tools-page .tool-viewactive:not(#tool-finance-dashboard) .field-limits {
  font-family: var(--font-mono) !important;
  font-size: 9px !important;
  color: var(--fg-muted) !important;
  margin-top: 4px !important;
}

#tools-page .tool-viewactive:not(#tool-finance-dashboard) .btn-primary {
  background-color: var(--accent-color) !important;
  color: var(--accent-hover) !important;
  border: 1px solid var(--border-primary) !important;
  font-family: var(--font-mono) !important;
  font-size: 11px !important;
  font-weight: bold !important;
  padding: 8px 16px !important;
  border-radius: 0 !important;
  cursor: pointer !important;
  width: 100% !important;
  text-align: center !important;
  box-sizing: border-box !important;
}

#tools-page .tool-viewactive:not(#tool-finance-dashboard) .btn-primary:hover {
  background-color: var(--bg-secondary) !important;
  color: var(--fg-primary) !important;
}

#tools-page .tool-viewactive:not(#tool-finance-dashboard) .btn-secondary {
  background-color: transparent !important;
  color: var(--fg-primary) !important;
  border: 1px solid var(--border-primary) !important;
  font-family: var(--font-mono) !important;
  font-size: 11px !important;
  padding: 6px 12px !important;
  border-radius: 0 !important;
  cursor: pointer !important;
  box-sizing: border-box !important;
}

#tools-page .tool-viewactive:not(#tool-finance-dashboard) .btn-secondary:hover {
  background-color: var(--bg-tertiary) !important;
}

#tools-page .tool-viewactive:not(#tool-finance-dashboard) table.data-table {
  border-collapse: collapse !important;
  width: 100% !important;
  font-family: var(--font-mono) !important;
  font-size: 10px !important;
  color: var(--fg-secondary) !important;
  border: 1px solid var(--border-primary) !important;
}

#tools-page .tool-viewactive:not(#tool-finance-dashboard) table.data-table th {
  background-color: var(--bg-tertiary) !important;
  border-bottom: 1.5px solid var(--border-primary) !important;
  color: var(--fg-primary) !important;
  font-size: 9px !important;
  font-weight: bold !important;
  padding: 6px 12px !important;
  text-align: left !important;
}

#tools-page .tool-viewactive:not(#tool-finance-dashboard) table.data-table td {
  padding: 6px 12px !important;
  border-bottom: 1px solid var(--border-secondary) !important;
  background-color: var(--bg-secondary) !important;
  color: var(--fg-primary) !important;
}

#tools-page .tool-viewactive:not(#tool-finance-dashboard) table.data-table tbody tr:hover td {
  background-color: var(--bg-tertiary) !important;
}

#tools-page .tool-viewactive:not(#tool-finance-dashboard) .plot-container,
#tools-page .tool-viewactive:not(#tool-finance-dashboard) .schematic-container {
  background-color: var(--bg-secondary) !important;
  border: 1px solid var(--border-primary) !important;
  border-radius: 0 !important;
  padding: 12px !important;
  box-sizing: border-box !important;
  margin-bottom: 16px !important;
}

/* ==========================================
   NAVIGATION DROPDOWN MENU
   ========================================== */
.pub-nav-item-dropdown-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 100%;
}

.nav-dropdown-menu.open {
  display: block !important;
}

.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-top: none;
  min-width: 180px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  z-index: 3000;
  padding: 4px 0;
}

.nav-dropdown-menu .dropdown-tool-item {
  font-family: var(--font-mono) !important;
  font-size: 10px !important;
  letter-spacing: 0.05em !important;
  text-transform: uppercase !important;
  color: var(--fg-secondary) !important;
  transition: background-color var(--transition-speed), color var(--transition-speed);
  cursor: pointer;
}

.nav-dropdown-menu .dropdown-tool-item:hover {
  background-color: var(--bg-tertiary) !important;
  color: var(--fg-primary) !important;
}

.nav-dropdown-menu .dropdown-tool-item.active {
  color: var(--brand-accent) !important;
  background-color: var(--bg-tertiary) !important;
}

/* Reset inputs inside Accounts Grid and Rebalancer Holdings Grid table cells to look clean and inline */
#tos-fin-accounts-grid input,
#tos-fin-accounts-grid select,
#tos-rebal-grid-body input {
  background-color: transparent !important;
  border: none !important;
  padding: 2px 4px !important;
  width: 100% !important;
  box-sizing: border-box !important;
  color: #ffffff !important;
}

#tos-fin-accounts-grid select {
  background-color: #1a1b1e !important; /* Keep slight background for select dropdown */
}





