/* ==========================================================================
   Magnolab Engineering Design & Calculation Suite
   Visual Theme: Blueprint Blues & Grays, Precision Grid Signature, IBM Plex
   Fully Responsive & Mobile-Optimized for Handhelds, Tablets & Desktops
   ========================================================================== */

:root {
  /* Magnolab Brand Identity */
  --ink: #10202E;
  --blue-deep: #1B3A5C;
  --blue-mid: #2E5C8A;
  --blue-line: #7FA8C9;
  --gray-bg: #F4F6F8;
  --gray-panel: #E7ECF0;
  --white: #FFFFFF;
  --line: #D3DCE3;
  --navy: #93C5FD;

  /* Theme Dynamic Variables (Dark Mode Default) */
  --bg-main: #0B141E;
  --bg-header: #10202E;
  --bg-sidebar: #0E1A27;
  --bg-card: #132334;
  --bg-panel: #16293D;
  --bg-input: #09121B;
  --bg-hover: #1C334A;
  --border-color: #21384F;
  --border-focus: #38BDF8;
  --grid-line: rgba(127, 168, 201, 0.06);

  --text-primary: #F8FAFC;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;

  --accent-blue: #38BDF8;
  --accent-cyan: #06B6D4;
  --accent-emerald: #10B981;
  --accent-amber: #F59E0B;
  --accent-rose: #FF6A5F;

  --badge-pass-bg: rgba(16, 185, 129, 0.15);
  --badge-pass-color: #34D399;
  --badge-pass-border: rgba(16, 185, 129, 0.3);

  --badge-fail-bg: rgba(255, 106, 95, 0.15);
  --badge-fail-color: #FF6A5F;
  --badge-fail-border: rgba(255, 106, 95, 0.3);

  --font-family: 'IBM Plex Sans', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, Menlo, Monaco, Consolas, monospace;

  --radius-sm: 3px;
  --radius-md: 4px;
  --radius-lg: 6px;
  --header-height: 48px;
  --sidebar-width: 224px;
}

[data-theme="light"] {
  --navy: #1B3A5C;
  --bg-main: #F4F6F8;
  --bg-header: #FFFFFF;
  --bg-sidebar: #FFFFFF;
  --bg-card: #FFFFFF;
  --bg-panel: #E7ECF0;
  --bg-input: #FFFFFF;
  --bg-hover: #E9F0F6;
  --border-color: #D3DCE3;
  --border-focus: #1B3A5C;
  --grid-line: rgba(27, 58, 92, 0.035);

  --text-primary: #10202E;
  --text-secondary: #445566;
  --text-muted: #7A8B99;

  --accent-blue: #1B3A5C;
  --accent-cyan: #0E8A8A;
  --accent-emerald: #1B7A4A;
  --accent-amber: #C9971C;
  --accent-rose: #DC2626;

  --badge-pass-bg: #E4F4EB;
  --badge-pass-color: #1B7A4A;
  --badge-pass-border: #BCE3CC;

  --badge-fail-bg: #FEE2E2;
  --badge-fail-color: #DC2626;
  --badge-fail-border: #FECACA;
}

/* ==========================================================================
   Base & Blueprint Grid Reset
   ========================================================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  height: 100%;
  width: 100%;
  font-family: var(--font-family);
  background-color: var(--bg-main);
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 28px 28px;
  color: var(--text-primary);
  line-height: 1.45;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

.katex {
  font-size: 1.05em !important;
}

/* App Outer Wrapper */
.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

/* ==========================================================================
   1. Top Global Header
   ========================================================================== */
.app-header {
  height: var(--header-height);
  background-color: var(--bg-header);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  flex-shrink: 0;
  z-index: 40;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-logo-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  line-height: 1;
}

.magnolab-logo-img {
  height: 32px;
  width: auto;
  max-width: 155px;
  object-fit: contain;
  display: block;
}

.magnolab-logo-svg {
  display: block;
  max-width: 190px;
  height: auto;
}

[data-theme="dark"] .ml-brand-text,
[data-theme="dark"] .ml-sub-text {
  fill: #FFFFFF;
}
[data-theme="dark"] .ml-disc {
  fill: #1B3A5C;
}
[data-theme="dark"] .ml-m-text {
  fill: #38BDF8;
}
[data-theme="dark"] .ml-swirl-fins {
  stroke: url(#ml-swirl-dark);
}

.header-software-tag {
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--border-color);
  padding-left: 14px;
  margin-left: 6px;
}

.header-software-tag .tag-title {
  font-weight: 700;
  font-size: 13px;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.header-software-tag .tag-sub {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--blue-line);
  letter-spacing: 0.08em;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-search {
  position: relative;
  width: 320px;
}

.header-search .search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 13px;
  pointer-events: none;
}

.header-search input {
  width: 100%;
  padding: 7px 12px 7px 32px;
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 12.5px;
  outline: none;
  font-family: var(--font-family);
  transition: border-color 0.15s ease;
}

.header-search input:focus {
  border-color: var(--border-focus);
}

.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background-color: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--accent-emerald);
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.5);
}

.theme-btn {
  font-weight: 600;
  font-size: 12px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
}

.mobile-toggle-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  padding: 6px;
  cursor: pointer;
  border-radius: var(--radius-sm);
}

/* ==========================================================================
   2. Layout Body & Sidebar
   ========================================================================== */
.app-body {
  display: flex;
  flex: 1;
  height: calc(100vh - var(--header-height));
  position: relative;
  overflow: hidden;
}

/* Sidebar Navigation */
.app-sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  z-index: 30;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-drawer-header {
  display: none;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  align-items: center;
  justify-content: space-between;
}

.drawer-title {
  font-weight: 700;
  font-size: 14px;
}

.drawer-close-btn {
  background: none;
  border: none;
  font-size: 24px;
  line-height: 1;
  color: var(--text-secondary);
  cursor: pointer;
}

.sidebar-nav {
  padding: 12px 10px;
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nav-group-title {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--blue-line);
  padding: 12px 10px 4px;
  font-weight: 600;
}

.nav-btn, .nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  background: none;
  border: none;
  font-family: var(--font-family);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: all 0.15s ease;
  text-decoration: none;
}

.nav-btn:hover, .nav-item:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
}

.nav-btn.active, .nav-item.active {
  background-color: var(--blue-deep);
  color: #FFFFFF;
  font-weight: 600;
}

[data-theme="light"] .nav-btn.active,
[data-theme="light"] .nav-item.active {
  background-color: #1B3A5C;
  color: #FFFFFF;
}

.nav-icon {
  font-size: 15px;
  width: 20px;
  text-align: center;
}

.nav-text {
  flex: 1;
}

.nav-badge, .badge {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 3px;
  background-color: rgba(255, 255, 255, 0.1);
  color: inherit;
}

[data-theme="light"] .nav-badge,
[data-theme="light"] .badge {
  background-color: #E2ECF5;
  color: #1B3A5C;
}

.nav-btn.active .nav-badge,
.nav-item.active .badge {
  background-color: rgba(255, 255, 255, 0.25);
  color: #FFFFFF;
}

.sidebar-footer {
  padding: 10px 12px;
  border-top: 1px solid var(--border-color);
  background-color: var(--bg-panel);
}

.magnolab-creds {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.magnolab-creds strong {
  font-size: 11.5px;
  color: var(--text-primary);
}

.magnolab-creds span {
  font-size: 10px;
  color: var(--text-secondary);
}

.magnolab-creds small {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--blue-line);
}

/* ==========================================================================
   3. Main Workspace Area & Cockpit Selectors (Compact & Minimalistic)
   ========================================================================== */
.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  position: relative;
}

.tab-pane {
  display: none;
  flex-direction: column;
  height: 100%;
  overflow-y: auto;
  padding: 12px 16px 18px;
}

.tab-pane.active {
  display: flex;
}

/* Cockpit Secondary Selector Bar */
.cockpit-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  flex-shrink: 0;
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
}

.cockpit-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.cockpit-select {
  flex: 1;
  min-width: 260px;
  padding: 7px 12px;
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 13px;
  font-weight: 500;
  outline: none;
  cursor: pointer;
}

.cockpit-select:focus {
  border-color: var(--border-focus);
}

.cockpit-pill {
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-family: var(--font-family);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.cockpit-pill:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
}

.cockpit-pill.active {
  background-color: var(--blue-mid);
  color: #FFFFFF;
  border-color: var(--blue-mid);
  font-weight: 600;
}

[data-theme="light"] .cockpit-pill {
  background-color: #FFFFFF;
  color: #1B3A5C;
  border-color: #CBD5E1;
}

[data-theme="light"] .cockpit-pill.active {
  background-color: #1B3A5C;
  border-color: #1B3A5C;
  color: #FFFFFF;
}

/* ==========================================================================
   4. High-Density Workbench Grid Layout
   ========================================================================== */
.content-area {
  flex: 1;
}

.workbench-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
  flex-wrap: wrap;
  gap: 6px;
}

.workbench-header h2 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.workbench-header p {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
  max-width: 82ch;
}

.workbench-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(350px, 440px);
  gap: 14px;
  align-items: start;
}

.workbench-left {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.workbench-left .cockpit-bar {
  flex-wrap: wrap;
  white-space: normal;
}

.workbench-right {
  min-width: 340px;
  display: flex;
  flex-direction: column;
}

.workbench-right .card {
  padding: 12px 14px;
}

.workbench-right .form-group {
  margin-bottom: 8px;
  min-width: 0;
}

.workbench-right .form-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 3px;
}

/* Cards */
.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 10px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.card-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.card-badge {
  font-family: var(--font-mono);
  font-size: 10.5px;
  padding: 2px 7px;
  border-radius: 3px;
  background-color: rgba(56, 189, 248, 0.12);
  color: var(--accent-blue);
  border: 1px solid rgba(56, 189, 248, 0.25);
  font-weight: 600;
}

[data-theme="light"] .card-badge {
  background-color: #E7F0F7;
  color: #1B3A5C;
  border-color: #C2D8EC;
}

/* Status Badges */
.badge-pass {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 3px;
  background-color: var(--badge-pass-bg);
  color: var(--badge-pass-color);
  border: 1px solid var(--badge-pass-border);
}

.badge-fail {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 3px;
  background-color: var(--badge-fail-bg);
  color: var(--badge-fail-color);
  border: 1px solid var(--badge-fail-border);
}

/* Forms & Inputs */
.form-group {
  margin-bottom: 8px;
}

.form-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 3px;
}

.form-label small {
  color: var(--accent-blue);
  font-family: var(--font-mono);
}

.form-control {
  width: 100%;
  padding: 5px 9px;
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 12.5px;
  outline: none;
  min-height: 32px;
  transition: border-color 0.15s ease;
}

.form-control:focus {
  border-color: var(--border-focus);
}

/* Grids */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

/* Checklists & Steps */
.checklist {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.checklist li {
  display: flex;
  gap: 9px;
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.45;
}

.check-icon {
  color: var(--accent-emerald);
  font-weight: 700;
  flex-shrink: 0;
}

.step-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background-color: var(--blue-mid);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

/* Results Box */
.calc-result-box {
  background-color: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}

.result-metric {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--border-color);
  font-size: 12.5px;
}

.result-metric:last-child {
  border-bottom: none;
}

.metric-label {
  color: var(--text-secondary);
}

.metric-val {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text-primary);
}

.metric-highlight {
  color: var(--accent-blue);
  font-size: 13.5px;
  font-weight: 700;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  font-family: var(--font-family);
  font-size: 12.5px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}

.btn-primary {
  background-color: var(--blue-deep);
  color: #FFFFFF;
  border-color: var(--blue-deep);
}

.btn-primary:hover {
  background-color: var(--ink);
}

[data-theme="light"] .btn-primary {
  background-color: #1B3A5C;
  color: #FFFFFF;
}

[data-theme="light"] .btn-primary:hover {
  background-color: #10202E;
}

.btn-secondary {
  background-color: var(--bg-card);
  color: var(--text-primary);
  border-color: var(--border-color);
}

.btn-secondary:hover {
  background-color: var(--bg-hover);
}

.btn-sm {
  padding: 4px 10px;
  font-size: 11.5px;
}

.btn-icon {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-primary);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 4px;
  min-width: 32px;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}

.btn-icon:hover {
  background: var(--bg-hover);
}

/* Data Tables */
.data-table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background-color: var(--bg-card);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  text-align: left;
}

.data-table th {
  background-color: var(--bg-panel);
  color: var(--text-secondary);
  font-weight: 600;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border-color);
  font-family: var(--font-family);
  white-space: nowrap;
}

.data-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
  vertical-align: middle;
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr:hover td {
  background-color: var(--bg-hover);
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  backdrop-filter: blur(3px);
  padding: 16px;
}

.modal-overlay.hidden {
  display: none;
}

.modal-dialog {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  width: 100%;
  max-width: 900px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border-color);
  background-color: var(--bg-panel);
}

.modal-title {
  font-weight: 700;
  font-size: 14px;
}

.modal-body {
  padding: 18px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 18px;
  border-top: 1px solid var(--border-color);
  background-color: var(--bg-panel);
}

/* Mobile Bottom Navigation Bar */
.mobile-bottom-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 56px;
  background-color: var(--bg-header);
  border-top: 1px solid var(--border-color);
  z-index: 40;
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
}

.mobile-nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-family);
  font-size: 10px;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 0;
}

.mobile-nav-btn .m-icon {
  font-size: 16px;
}

.mobile-nav-btn.active {
  color: var(--accent-blue);
  font-weight: 700;
}

[data-theme="light"] .mobile-nav-btn.active {
  color: #1B3A5C;
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.6);
  z-index: 25;
  backdrop-filter: blur(2px);
}

/* ==========================================================================
   4.5 Minimalistic UI, Interactive Hotspots & Slide-out Insight Drawer
   ========================================================================== */

/* Minimalistic Info Icon Button (?) beside inputs */
.info-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--gray-panel);
  color: var(--blue-mid);
  border: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  cursor: pointer;
  margin-left: 6px;
  vertical-align: middle;
  transition: all 0.15s ease;
  user-select: none;
  padding: 0;
  line-height: 1;
}

.info-btn:hover, .info-btn:focus-visible {
  background: var(--blue-deep);
  color: #FFFFFF;
  border-color: var(--blue-deep);
  outline: none;
}

/* Interactive Engineering Schematics & Hotspot System */
.hotspot-canvas-container {
  position: relative;
  width: 100%;
  min-height: 175px;
  height: auto !important;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  overflow: visible !important;
  user-select: none;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  padding: 6px;
}

.hotspot-canvas-container svg {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: 240px;
}

#studio-schematic-svg {
  min-height: 175px !important;
  height: auto !important;
  overflow: visible !important;
  padding: 8px !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  justify-content: center !important;
  background: var(--bg-primary);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  margin-bottom: 12px;
}

#studio-schematic-svg svg {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: 240px;
}

/* Snapshot Card Layout (Verified Real Handbook / ASME Figures) */
.calc-snapshot-card {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  padding: 8px 10px;
  text-align: left;
  box-sizing: border-box;
}

.calc-snapshot-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 5px;
}

.calc-snapshot-title {
  font-size: 11.5px;
  font-weight: 700;
  color: #1b3a5c;
  line-height: 1.25;
}

.calc-snapshot-subtitle {
  font-size: 10px;
  color: #64748b;
  font-weight: 500;
}

.calc-snapshot-status {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #ffffff;
  flex-shrink: 0;
}

.calc-snapshot-status.pass {
  background: #16a34a;
}

.calc-snapshot-status.fail {
  background: #dc2626;
}

.calc-snapshot-body {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 8px;
  align-items: stretch;
}

.calc-snapshot-img-wrap {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 132px;
  max-height: 165px;
  overflow: hidden;
}

.calc-snapshot-img {
  max-width: 100%;
  max-height: 155px;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  cursor: zoom-in;
}

.calc-snapshot-metrics {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  font-size: 10.5px;
}

.calc-snapshot-metric-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 6px;
  border-bottom: 1px dashed #e2e8f0;
  padding-bottom: 2px;
}

.calc-snapshot-metric-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.calc-snapshot-metric-lbl {
  color: #64748b;
  font-size: 10px;
}

.calc-snapshot-metric-val {
  color: #1b3a5c;
  font-weight: 700;
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-align: right;
}

.calc-snapshot-pins {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding-top: 2px;
}

.calc-insight-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e3a8a;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.3;
  cursor: pointer;
}

.calc-insight-chip:hover {
  background: #dbeafe;
  border-color: #60a5fa;
}

.calc-insight-chip-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #1b3a5c;
  color: #ffffff;
  font-size: 9px;
  font-weight: 700;
}

@media (max-width: 640px) {
  .calc-snapshot-body {
    grid-template-columns: 1fr;
  }
}

.hotspot-pin {
  cursor: pointer;
  pointer-events: all !important;
}

.hotspot-pin:hover {
  /* Intentionally do NOT transform or scale on hover to keep SVG pin 100% stationary */
}

/* Eliminate AI/game-like animated radar pulse rings: causes continuous mouseenter/mouseleave oscillation */
.hotspot-pulse-circle {
  display: none !important;
  pointer-events: none !important;
}

.hotspot-badge-dot {
  fill: #1B3A5C;
  stroke: #FFFFFF;
  stroke-width: 2px;
  filter: drop-shadow(0 1px 3px rgba(16, 32, 46, 0.3));
  transition: fill 0.15s ease, stroke 0.15s ease;
  pointer-events: all !important;
}

.hotspot-pin:hover .hotspot-badge-dot {
  fill: #2E5C8A;
  stroke: #38BDF8;
}

.hotspot-num-label {
  fill: #FFFFFF;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  text-anchor: middle;
  dominant-baseline: central;
  pointer-events: none;
  user-select: none;
}

/* Floating Hotspot Hover Tooltip - strictly non-interactive */
.hotspot-floating-tooltip {
  position: absolute;
  pointer-events: none !important;
  background: #10202E;
  color: #FFFFFF;
  border: 1px solid #7FA8C9;
  border-radius: 4px;
  padding: 8px 12px;
  font-size: 11.5px;
  font-family: var(--font-main);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  z-index: 1000;
  max-width: 280px;
  line-height: 1.4;
  opacity: 0;
  transform: none !important;
  transition: opacity 0.12s ease;
}

.hotspot-floating-tooltip.visible {
  opacity: 1;
  transform: translateY(0);
}

.hotspot-floating-tooltip .tt-title {
  font-weight: 700;
  color: #7FA8C9;
  font-size: 12px;
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.hotspot-floating-tooltip .tt-code {
  font-size: 9.5px;
  font-family: var(--font-mono);
  color: #A3BED6;
}

/* Deep Technical Insight Slide-out Drawer */
.insight-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(16, 32, 46, 0.55);
  backdrop-filter: blur(3px);
  z-index: 1100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.insight-drawer-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.insight-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 480px;
  max-width: 92vw;
  background: var(--bg-card);
  z-index: 1150;
  box-shadow: -8px 0 32px rgba(16, 32, 46, 0.28);
  border-left: 1px solid var(--border-color);
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

.insight-drawer.open {
  transform: translateX(0);
}

.insight-drawer-header {
  padding: 16px 20px;
  background: var(--ink);
  color: #FFFFFF;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  border-bottom: 2px solid var(--blue-mid);
}

.insight-drawer-title-box {
  flex: 1;
}

.insight-drawer-category {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--blue-line);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.insight-drawer-title {
  font-size: 16px;
  font-weight: 700;
  color: #FFFFFF;
  line-height: 1.3;
}

.insight-drawer-close {
  background: transparent;
  border: none;
  color: #7FA8C9;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
  transition: color 0.15s ease;
}

.insight-drawer-close:hover {
  color: #FFFFFF;
}

.insight-drawer-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.insight-section {
  background: var(--bg-page);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}

.insight-section-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--blue-deep);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.insight-section-title::before {
  content: "";
  display: inline-block;
  width: 3px;
  height: 13px;
  background: var(--blue-mid);
  border-radius: 1px;
}

.insight-text {
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.55;
  margin: 0;
}

.insight-code-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  background: var(--blue-subtle);
  color: var(--blue-deep);
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid var(--line);
  font-weight: 600;
}

.insight-callout-box {
  background: #FEF9C3;
  border-left: 3px solid #CA8A04;
  padding: 10px 14px;
  border-radius: 4px;
  font-size: 12.5px;
  color: #713F12;
  line-height: 1.5;
}

/* Minimalist Calculation Standard Evaluation Banner */
.std-eval-banner {
  background: linear-gradient(90deg, #F0F5FA 0%, #E7ECF0 100%);
  border-left: 4px solid var(--blue-deep);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.std-eval-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.std-eval-label {
  font-size: 11px;
  color: var(--text-secondary);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.std-eval-standard {
  font-size: 13px;
  font-weight: 700;
  color: var(--blue-deep);
  font-family: var(--font-mono);
}

.std-eval-badge {
  background: var(--blue-deep);
  color: #FFFFFF;
  padding: 3px 9px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
}

/* Download Calculation Report Action Bar */
.calc-action-bar {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border-color);
  flex-wrap: wrap;
}

.btn-download-report {
  flex: 1;
  min-width: 190px;
  background: var(--blue-deep);
  color: #FFFFFF;
  font-weight: 600;
  font-size: 13px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(27, 58, 92, 0.25);
}

.btn-download-report:hover {
  background: #142C47;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(27, 58, 92, 0.35);
}

.btn-preview-report {
  background: var(--bg-card);
  color: var(--blue-deep);
  font-weight: 600;
  font-size: 13px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-preview-report:hover {
  background: var(--gray-panel);
  border-color: var(--blue-line);
}

/* ==========================================================================
   5. Mobile Responsiveness Breakpoints
   ========================================================================== */
@media (max-width: 900px) {
  .workbench-grid {
    grid-template-columns: 1fr;
  }

  .mobile-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* Off-canvas sidebar */
  .app-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    transform: translateX(-100%);
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.4);
    z-index: 50;
  }

  .app-sidebar.open {
    transform: translateX(0);
  }

  .sidebar-drawer-header {
    display: flex;
  }

  .sidebar-backdrop.active {
    display: block;
  }

  .header-search {
    width: 200px;
  }

  .header-software-tag {
    display: none;
  }

  .tab-pane {
    padding: 12px 14px 70px; /* Extra bottom padding for mobile bar */
  }
}

@media (max-width: 768px) {
  .mobile-bottom-bar {
    display: flex;
  }

  .hide-mobile {
    display: none !important;
  }

  .header-search {
    width: 140px;
  }

  .header-search input {
    font-size: 11.5px;
    padding-left: 26px;
  }

  .header-search .search-icon {
    left: 8px;
    font-size: 11px;
  }

  .grid-3 {
    grid-template-columns: 1fr;
  }

  .grid-2 {
    grid-template-columns: 1fr;
  }

  .cockpit-select {
    min-width: 180px;
  }

  .modal-dialog {
    max-height: 98vh;
    border-radius: var(--radius-sm);
  }
}

@media (max-width: 480px) {
  .header-search {
    display: none;
  }

  .magnolab-logo-svg {
    max-width: 145px;
  }

  .magnolab-logo-img {
    height: 32px;
    max-width: 140px;
  }

  .cockpit-bar {
    padding: 8px 10px;
  }

  .card {
    padding: 12px 14px;
  }
}

/* ==========================================================================
   6. Report & Print Styles
   ========================================================================== */
.printable-report {
  background: #FFFFFF;
  color: #10202E;
  border: 1px solid #CBD5E1;
  border-radius: 6px;
  padding: 22px 24px;
  font-size: 12.5px;
  line-height: 1.45;
  box-shadow: 0 2px 10px rgba(16, 32, 46, 0.08);
}

.report-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  border-bottom: 2px solid #1B3A5C;
  padding-bottom: 12px;
}

.report-company {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #1B3A5C;
  text-transform: uppercase;
}

.report-title {
  font-size: 16px;
  font-weight: 700;
  color: #0F172A;
  margin-top: 2px;
}

.report-subtitle {
  font-size: 11.5px;
  color: #475569;
  margin-top: 2px;
}

.report-header-right {
  min-width: 210px;
  background: #F8FAFC;
  border: 1px solid #CBD5E1;
  border-radius: 4px;
  padding: 8px 10px;
  font-size: 11px;
}

.report-meta-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 1px 0;
}

.report-meta-item span {
  color: #64748B;
}

.report-section {
  margin-top: 16px;
}

.report-section-title {
  font-size: 12px;
  font-weight: 700;
  color: #1B3A5C;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1.5px solid #2E5C8A;
  padding-bottom: 4px;
  margin: 0 0 8px 0;
}

.report-table-wrapper {
  width: 100%;
  overflow-x: auto;
}

.report-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 12px;
  background: #FFFFFF;
  color: #1E293B;
}

.report-table th,
.report-table td {
  border: 1px solid #CBD5E1;
  padding: 6px 8px;
  text-align: left;
  vertical-align: middle;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}

.report-table th {
  background: #E2E8F0;
  color: #1B3A5C;
  font-weight: 700;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.report-table tbody tr:nth-child(even) {
  background: #F8FAFC;
}

.report-formula-code {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: #0F172A;
  background: #F1F5F9;
  padding: 2px 5px;
  border-radius: 3px;
  display: inline-block;
  max-width: 100%;
  white-space: normal;
  word-break: break-word;
}

.report-sub-text {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #334155;
}

.report-val {
  font-weight: 700;
  color: #1B3A5C;
}

.compliance-box {
  padding: 12px 14px;
  border-radius: 5px;
  border: 1px solid #CBD5E1;
}

.compliance-pass {
  background: #ECFDF5;
  border-color: #10B981;
  color: #065F46;
}

.compliance-fail {
  background: #FEF2F2;
  border-color: #EF4444;
  color: #991B1B;
}

.compliance-badge {
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.report-notes-list {
  margin: 6px 0 0 0;
  padding-left: 18px;
  color: #334155;
  font-size: 12px;
}

.report-notes-list li {
  margin-bottom: 4px;
}

.sign-off-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 10px;
}

.sign-off-box {
  border: 1px solid #CBD5E1;
  padding: 10px;
  border-radius: 4px;
  background: #F8FAFC;
  text-align: center;
}

.sign-role {
  font-size: 10px;
  font-weight: 700;
  color: #1B3A5C;
  text-transform: uppercase;
}

.sign-space {
  height: 36px;
  border-bottom: 1px dashed #94A3B8;
  margin-bottom: 6px;
}

.sign-name {
  font-weight: 600;
  font-size: 11.5px;
  color: #0F172A;
}

.sign-date {
  font-size: 10px;
  color: #64748B;
}

.pe-stamp-inner {
  height: 52px;
  border: 1.5px dashed #94A3B8;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 6px;
  padding: 4px;
}

.report-footer {
  margin-top: 18px;
  padding-top: 10px;
  border-top: 1px solid #CBD5E1;
  font-size: 10.5px;
  color: #64748B;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

@media print {
  body {
    background: #FFFFFF !important;
    color: #000000 !important;
    overflow: visible !important;
  }
  .app-sidebar, .app-header, .cockpit-bar, .mobile-bottom-bar, .modal-footer, .modal-header button {
    display: none !important;
  }
  .modal-overlay {
    position: static !important;
    background: transparent !important;
    padding: 0 !important;
  }
  .modal-dialog {
    max-width: 100% !important;
    box-shadow: none !important;
    border: none !important;
  }
  .printable-report {
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
  }
}

/* ==========================================================================
   7. Selected Component Specification Inspector & Pure Engineering Schematics
   ========================================================================== */
.comp-schematic-card {
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.comp-schematic-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: #FFFFFF;
  min-height: 280px;
}

.comp-schematic-img {
  max-width: 100%;
  max-height: 280px;
  object-fit: contain;
  display: block;
}

.selected-spec-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.selected-spec-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.selected-spec-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.3;
}

.selected-spec-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 3px;
}

.spec-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(135px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.spec-tile {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 5px;
  padding: 9px 12px;
  transition: border-color 0.15s ease;
}

.spec-tile:hover {
  border-color: var(--blue-mid);
}

.spec-tile.highlight {
  background: #EFF6FF;
  border-color: #93C5FD;
}

[data-theme="dark"] .spec-tile.highlight {
  background: #1E293B;
  border-color: #38BDF8;
}

.spec-label {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 3px;
  display: block;
}

.spec-value {
  font-family: var(--font-mono);
  font-size: 14.5px;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.2;
}

.spec-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
  font-family: var(--font-mono);
}

.spec-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
}

.toggle-full-table-btn {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  color: var(--blue-deep);
  font-weight: 600;
  font-size: 12.5px;
  padding: 8px 14px;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.toggle-full-table-btn:hover {
  background: var(--blue-soft);
  border-color: var(--blue-mid);
}

/* ==========================================================================
   INTERACTIVE AUTOCOMPLETE SEARCH SUGGESTIONS
   ========================================================================== */
.search-wrapper-relative {
  position: relative !important;
}

.search-suggestions-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  min-width: 320px;
  max-width: 100%;
  max-height: 380px;
  overflow-y: auto;
  background: #FFFFFF;
  border: 1px solid var(--border-color, #E2E8F0);
  border-radius: 8px;
  box-shadow: 0 12px 28px -4px rgba(16, 32, 46, 0.15), 0 6px 12px -2px rgba(16, 32, 46, 0.08);
  z-index: 9999;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.suggestion-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  background: transparent;
}

.suggestion-item:hover,
.suggestion-item.suggestion-active {
  background: #F1F5F9;
}

.suggestion-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.suggestion-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--navy, #10202E);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.suggestion-title mark {
  background: rgba(46, 92, 138, 0.15);
  color: #1B3A5C;
  font-weight: 700;
  padding: 0 1px;
  border-radius: 2px;
}

.suggestion-desc {
  font-size: 11px;
  color: var(--text-secondary, #64748B);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

.suggestion-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: 0.5px;
  white-space: nowrap;
  flex-shrink: 0;
}

.badge-calc {
  background: #EFF6FF;
  color: #1D4ED8;
  border: 1px solid #BFDBFE;
}

.badge-std {
  background: #FAF5FF;
  color: #7E22CE;
  border: 1px solid #E9D5FF;
}

.badge-mat {
  background: #ECFDF5;
  color: #047857;
  border: 1px solid #A7F3D0;
}

.badge-comp {
  background: #FFFBEB;
  color: #B45309;
  border: 1px solid #FDE68A;
}

.badge-term {
  background: #ECFEFF;
  color: #0E7490;
  border: 1px solid #A5F3FC;
}

/* Medium Screens Layout - Stack Workbench when viewport <= 1180px */
@media (max-width: 1180px) {
  .workbench-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }
  .workbench-right {
    min-width: 0 !important;
    width: 100% !important;
  }
}

/* Magnolab Main Website Navigation Pill */
#magnolab-home-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  padding: 5px 10px;
}

/* Mobile Adjustments for Hotspots & Schematics */
@media (max-width: 768px) {
  .hotspot-canvas-container {
    min-height: 145px !important;
    padding: 6px !important;
    overflow: visible !important;
  }
  .hotspot-canvas-container svg {
    max-height: 200px !important;
    width: 100% !important;
    height: auto !important;
  }
  #studio-schematic-svg {
    min-height: 145px !important;
    padding: 6px !important;
  }
}


/* Direct Vector PDF Export Button in Workbench */
.btn-direct-pdf {
  flex: 1;
  min-width: 170px;
  background: #1B3A5C;
  color: #FFFFFF;
  font-weight: 700;
  font-size: 13px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid #10202E;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-direct-pdf:hover {
  background: #10202E;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(16, 32, 46, 0.2);
}

/* Tablet & Mobile Responsiveness for Calculation Workbenches */
@media (max-width: 992px) {
  .grid-2 {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }
  .calc-result-box {
    margin-top: 10px !important;
    width: 100% !important;
    min-width: 0 !important;
  }
  .calc-action-bar {
    flex-direction: column !important;
  }
  .btn-download-report, .btn-preview-report, .btn-direct-pdf {
    width: 100% !important;
    min-width: 100% !important;
  }
}

