/*
  Panamá PortOps-AI v1.0 — Minimalist Vanguard Maritime Tech Design System
  Author: Desarrollado v1.0.0 Miguel Benítez
  License: GNU General Public License v3.0 (GPL-3.0)
*/

:root {
  --bg-base: #060913;
  --bg-surface: #0d1527;
  --bg-card: rgba(16, 26, 48, 0.7);
  --bg-card-hover: rgba(23, 37, 68, 0.85);
  --bg-input: rgba(10, 18, 36, 0.9);
  
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: #06b6d4;
  
  --text-main: #f8fafc;
  --text-muted: #cbd5e1;
  --text-dim: #94a3b8;
  
  --cyan-primary: #06b6d4;
  --cyan-bright: #22d3ee;
  --blue-vivid: #38bdf8;
  --emerald-success: #10b981;
  --amber-warn: #f59e0b;
  --amber-warning: #f59e0b;
  --rose-danger: #f43f5e;
  --purple-ai: #c084fc;

  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 20px rgba(6, 182, 212, 0.15);
  --shadow-card: 0 8px 32px 0 rgba(0, 0, 0, 0.37);

  --font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --control-height: 2.75rem;
  --content-gutter: clamp(0.75rem, 2vw, 2rem);
  --content-max: 1440px;
}

html, body {
  max-width: 100%;
  overflow-x: hidden;
}

/* Shared interaction and responsive contract for all feature panels. */
*, *::before, *::after { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; }
body { overflow-x: hidden; }
button, input, select, textarea { min-height: var(--control-height); font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
:where(button, a, input, select, textarea):focus-visible {
  outline: 3px solid var(--border-focus);
  outline-offset: 2px;
}
.data-table-wrap { width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; }
.data-table-wrap table { min-width: 42rem; }
.responsive-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); gap: 1rem; }
.status-message { border: 1px solid var(--border-color); border-radius: 0.6rem; padding: 0.85rem 1rem; }
.status-message[data-state="error"] { border-color: color-mix(in srgb, var(--rose-danger) 60%, transparent); color: var(--rose-danger); }
.status-message[data-state="warning"] { border-color: color-mix(in srgb, var(--amber-warn) 60%, transparent); color: var(--amber-warn); }
@media (max-width: 700px) {
  .nav-container, main, .content-container { padding-inline: var(--content-gutter); }
  .card, .panel, .modal-content { max-width: 100%; }
  .button, button { max-width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: 0.001ms !important; }
}

/* ==========================================================================
   MARITIME THEME CATALOG (CURATED 6 INDUSTRIAL COLORWAYS - WCAG AA COMPLIANT)
   ========================================================================== */

/* Theme 1: Atlántico Night / Cyber Ocean (Default) */
body.theme-cyber-ocean {
  --bg-base: #060913;
  --bg-surface: #0d1527;
  --bg-card: rgba(16, 26, 48, 0.75);
  --bg-card-hover: rgba(23, 37, 68, 0.9);
  --bg-input: rgba(10, 18, 36, 0.95);
  --border-color: rgba(6, 182, 212, 0.2);
  --border-focus: #06b6d4;
  --text-main: #f8fafc;
  --text-muted: #cbd5e1;
  --text-dim: #94a3b8;
  --cyan-primary: #06b6d4;
  --cyan-bright: #22d3ee;
  --blue-vivid: #38bdf8;
  --purple-ai: #c084fc;
  --shadow-glow: 0 0 25px rgba(6, 182, 212, 0.2);
}

/* Theme 2: Radar Balboa / Amber & Brass Nautical */
body.theme-radar-amber {
  --bg-base: #0a0907;
  --bg-surface: #16130e;
  --bg-card: rgba(28, 24, 18, 0.8);
  --bg-card-hover: rgba(38, 32, 22, 0.95);
  --bg-input: rgba(20, 16, 12, 0.95);
  --border-color: rgba(245, 158, 11, 0.22);
  --border-focus: #f59e0b;
  --text-main: #fef3c7;
  --text-muted: #fde68a;
  --text-dim: #cbd5e1;
  --cyan-primary: #f59e0b;
  --cyan-bright: #fbbf24;
  --blue-vivid: #f97316;
  --purple-ai: #e9d5ff;
  --shadow-glow: 0 0 25px rgba(245, 158, 11, 0.25);
}

/* Theme 3: Cuenca del Canal / Esmeralda Bio-Marino */
body.theme-canal-emerald {
  --bg-base: #040d0a;
  --bg-surface: #0a1c15;
  --bg-card: rgba(14, 34, 26, 0.8);
  --bg-card-hover: rgba(20, 48, 36, 0.95);
  --bg-input: rgba(8, 24, 18, 0.95);
  --border-color: rgba(16, 185, 129, 0.22);
  --border-focus: #10b981;
  --text-main: #ecfdf5;
  --text-muted: #d1fae5;
  --text-dim: #a7f3d0;
  --cyan-primary: #10b981;
  --cyan-bright: #34d399;
  --blue-vivid: #06b6d4;
  --purple-ai: #d8b4fe;
  --shadow-glow: 0 0 25px rgba(16, 185, 129, 0.25);
}

/* Theme 4: Titanio Táctico / Monocromo Portuario */
body.theme-tactical-mono {
  --bg-base: #090a0f;
  --bg-surface: #12151c;
  --bg-card: rgba(20, 24, 32, 0.85);
  --bg-card-hover: rgba(28, 34, 46, 0.98);
  --bg-input: rgba(14, 18, 24, 0.95);
  --border-color: rgba(255, 255, 255, 0.16);
  --border-focus: #38bdf8;
  --text-main: #ffffff;
  --text-muted: #e2e8f0;
  --text-dim: #cbd5e1;
  --cyan-primary: #38bdf8;
  --cyan-bright: #7dd3fc;
  --blue-vivid: #fb923c;
  --purple-ai: #c084fc;
  --shadow-glow: 0 0 25px rgba(56, 189, 248, 0.2);
}

/* Theme 5: Pacífico Sunset / Coral Neón & Púrpura */
body.theme-pacific-sunset {
  --bg-base: #0b0714;
  --bg-surface: #170d2b;
  --bg-card: rgba(28, 16, 52, 0.8);
  --bg-card-hover: rgba(40, 24, 72, 0.95);
  --bg-input: rgba(20, 10, 38, 0.95);
  --border-color: rgba(244, 63, 94, 0.25);
  --border-focus: #f43f5e;
  --text-main: #fff1f2;
  --text-muted: #ffe4e6;
  --text-dim: #fecdd3;
  --cyan-primary: #f43f5e;
  --cyan-bright: #fb7185;
  --blue-vivid: #f59e0b;
  --purple-ai: #f0abfc;
  --shadow-glow: 0 0 25px rgba(244, 63, 94, 0.25);
}

/* Theme 6: Midnight Cobalt / Azul Profundo de Alta Fidelidad */
body.theme-midnight-cobalt {
  --bg-base: #020617;
  --bg-surface: #0a1435;
  --bg-card: rgba(12, 28, 68, 0.8);
  --bg-card-hover: rgba(18, 40, 96, 0.95);
  --bg-input: rgba(6, 16, 42, 0.95);
  --border-color: rgba(56, 189, 248, 0.28);
  --border-focus: #0ea5e9;
  --text-main: #f0f9ff;
  --text-muted: #e0f2fe;
  --text-dim: #bae6fd;
  --cyan-primary: #38bdf8;
  --cyan-bright: #7dd3fc;
  --blue-vivid: #60a5fa;
  --purple-ai: #c084fc;
  --shadow-glow: 0 0 25px rgba(14, 165, 233, 0.3);
}

html {
  scroll-behavior: smooth;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-base);
  background-image: 
    radial-gradient(circle at 15% 10%, rgba(6, 182, 212, 0.07) 0%, transparent 40%),
    radial-gradient(circle at 85% 90%, rgba(139, 92, 246, 0.05) 0%, transparent 40%);
  background-attachment: fixed;
  color: var(--text-main);
  font-family: var(--font-stack);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Header & Top Navigation */
header {
  background: rgba(13, 21, 39, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}

.logo-group {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.logo-icon-wrapper {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.2), rgba(56, 189, 248, 0.05));
  border: 1px solid rgba(6, 182, 212, 0.4);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 15px rgba(6, 182, 212, 0.2);
}

.nav-svg-icon {
  width: 30px;
  height: 30px;
  filter: drop-shadow(0 0 6px rgba(0, 229, 255, 0.45));
}

.logo-text h1 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.version-badge {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--cyan-bright);
  background: rgba(6, 182, 212, 0.15);
  border: 1px solid rgba(6, 182, 212, 0.3);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  letter-spacing: 0.05em;
}

.author-signature {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
}

.nav-badges {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  white-space: nowrap;
}

.badge-icon {
  width: 16px;
  height: 16px;
}

.badge.healthy {
  border-color: rgba(16, 185, 129, 0.3);
  color: #34d399;
  background: rgba(16, 185, 129, 0.08);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--emerald-success);
  box-shadow: 0 0 8px var(--emerald-success);
  display: inline-block;
}

.badge.link-badge {
  color: var(--blue-vivid);
  text-decoration: none;
  border-color: rgba(56, 189, 248, 0.3);
  background: rgba(56, 189, 248, 0.08);
  transition: all 0.2s ease;
}

.badge.link-badge:hover {
  background: rgba(56, 189, 248, 0.18);
  border-color: var(--blue-vivid);
}

/* Tabs Navigation - Vanguard Modern Control Bar */
.tabs-nav {
  max-width: 1440px;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  margin: 1.25rem auto 0.75rem;
  padding: 0.5rem 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  background: rgba(13, 21, 39, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(6, 182, 212, 0.22);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 229, 255, 0.65) rgba(13, 21, 39, 0.8);
  touch-action: pan-x;
  overscroll-behavior-x: contain;
}

.tabs-nav::-webkit-scrollbar { height: 6px; }
.tabs-nav::-webkit-scrollbar-track { background: rgba(13, 21, 39, 0.8); border-radius: 999px; }
.tabs-nav::-webkit-scrollbar-thumb { background: linear-gradient(90deg, #00e5ff, #00f5d4); border-radius: 999px; }

.tab-btn {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid transparent;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.65rem 1.1rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  border-radius: 8px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
  user-select: none;
}

.tab-icon {
  width: 20px;
  height: 20px;
  color: var(--text-dim);
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}

.tab-btn:hover .tab-icon {
  color: var(--cyan-bright);
}

.tab-btn.active {
  color: #ffffff;
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.22), rgba(56, 189, 248, 0.1));
  border-color: rgba(6, 182, 212, 0.5);
  box-shadow: 0 0 18px rgba(6, 182, 212, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}

.tab-btn.active .tab-icon {
  color: var(--cyan-bright);
  filter: drop-shadow(0 0 6px var(--cyan-bright));
}

/* Main Content Layout */
main {
  flex: 1;
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.25s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Grids & Cards */
.dashboard-grid {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 1.5rem;
}

@media (max-width: 1080px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

.card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
  transition: border-color 0.2s ease;
}

.card:hover {
  border-color: rgba(255, 255, 255, 0.12);
}

.card.inner-card {
  background: rgba(10, 18, 36, 0.6);
  padding: 1.25rem;
}

.card-header {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 1.2rem;
}

.card-header-icon {
  width: 22px;
  height: 22px;
  color: var(--cyan-bright);
  flex-shrink: 0;
}

.card-header h2 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.card-subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.section-subtitle {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  margin-bottom: 0.85rem;
  font-weight: 600;
}

.divider {
  height: 1px;
  background: var(--border-color);
  margin: 1.25rem 0;
}

/* Forms & Inputs */
.form-group {
  margin-bottom: 1.1rem;
}

.form-group label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.slider-val {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--cyan-bright);
  font-weight: 600;
}

select, input[type="text"], input[type="password"], input[type="email"] {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.65rem 0.85rem;
  color: var(--text-main);
  font-size: 0.88rem;
  font-family: var(--font-stack);
  outline: none;
  transition: all 0.2s ease;
}

select:focus, input[type="text"]:focus, input[type="password"]:focus, input[type="email"]:focus {
  border-color: var(--cyan-bright);
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.25);
}

/* Chrome, Edge, Safari Dark Mode Autofill Override (Eliminates Pale Yellow Inputs) */
input:-webkit-autofill,
input:-webkit-autofill:hover, 
input:-webkit-autofill:focus, 
input:-webkit-autofill:active,
textarea:-webkit-autofill,
select:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 1000px #0b1528 inset !important;
  -webkit-text-fill-color: #F8FAFC !important;
  caret-color: #00E5FF !important;
  border-color: rgba(0, 229, 255, 0.5) !important;
  transition: background-color 5000s ease-in-out 0s;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--cyan-primary);
  height: 5px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  outline: none;
  cursor: pointer;
}

/* Base Button System (Modern Cybernetic Reset) */
.btn {
  appearance: none;
  -webkit-appearance: none;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.35rem;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.4;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  user-select: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}

.btn:focus-visible {
  outline: 2px solid var(--cyan-bright);
  outline-offset: 2px;
}

.btn-primary {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff !important;
  border: 1px solid rgba(56, 189, 248, 0.45);
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.4);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
  font-weight: 700;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(6, 182, 212, 0.5);
  filter: brightness(1.08);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: rgba(15, 23, 42, 0.85);
  color: #94A3B8;
  border: 1px solid rgba(148, 163, 184, 0.28);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.btn-secondary:hover {
  background: rgba(30, 41, 59, 0.95);
  color: #F1F5F9;
  border-color: rgba(0, 229, 255, 0.45);
  box-shadow: 0 4px 14px rgba(0, 229, 255, 0.15);
  transform: translateY(-1px);
}

.btn-secondary:active {
  transform: translateY(0);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #F87171;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.3);
  border-color: #EF4444;
  color: #FFFFFF;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.25);
  transform: translateY(-1px);
}

.btn-success {
  background: linear-gradient(135deg, #059669 0%, #10B981 100%);
  color: #FFFFFF;
  border: 1px solid rgba(16, 185, 129, 0.4);
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.25);
}

.btn-success:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.4);
  filter: brightness(1.08);
}

.btn-icon {
  width: 18px;
  height: 18px;
}

/* Overview Pillars Interactive Navigation Cards */
.overview-nav-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 229, 255, 0.22);
  border-color: rgba(0, 229, 255, 0.55) !important;
  background: rgba(0, 229, 255, 0.12) !important;
}

.overview-nav-card:focus-visible {
  outline: 2px solid var(--cyan-bright);
  outline-offset: 2px;
}

/* KPI Cards Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

@media (max-width: 900px) {
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 500px) {
  .kpi-grid {
    grid-template-columns: 1fr;
  }
}

.kpi-card {
  background: var(--bg-card);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.kpi-card.mini {
  padding: 0.85rem;
}

.kpi-title {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  font-weight: 600;
}

.kpi-value {
  font-size: 1.45rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text-main);
  margin: 0.35rem 0 0.15rem;
  letter-spacing: -0.02em;
}

.kpi-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Benchmark Cards */
.benchmark-cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

@media (max-width: 960px) {
  .benchmark-cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.algo-stat-card {
  background: rgba(13, 21, 39, 0.7);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 1.2rem;
  position: relative;
  transition: all 0.2s ease;
}

.algo-stat-card.champion {
  border-color: rgba(6, 182, 212, 0.5);
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.08), rgba(13, 21, 39, 0.7));
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.15);
}

.algo-stat-card.baseline {
  border-color: rgba(244, 63, 94, 0.2);
}

.algo-badge-top {
  display: inline-block;
  font-size: 0;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  margin-bottom: 0.5rem;
  background: rgba(255, 255, 255, 0.06);
}

.algo-stat-card.champion .algo-badge-top {
  background: rgba(6, 182, 212, 0.2);
  color: var(--cyan-bright);
}

.algo-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.35rem;
}

.algo-metric {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.algo-metric .highlight {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--emerald-success);
}

.algo-submetric {
  font-size: 0.78rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

/* VIF Badges & Confounders */
.vif-badges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.65rem;
  margin-top: 0.5rem;
}

.vif-badge-item {
  background: rgba(10, 18, 36, 0.6);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 0.55rem 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.vif-name {
  font-size: 0.78rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vif-val {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--cyan-bright);
}

.confounder-card {
  background: rgba(10, 18, 36, 0.6);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.9rem 1.1rem;
  margin-bottom: 0.75rem;
}

.confounder-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--cyan-bright);
  margin-bottom: 0.35rem;
  display: flex;
  justify-content: space-between;
}

.confounder-type {
  font-size: 0.72rem;
  color: var(--text-dim);
  text-transform: uppercase;
}

.confounder-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.confounder-treatment {
  font-size: 0.82rem;
  color: var(--emerald-success);
}

/* Methodology Grid */
.methodology-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-top: 1rem;
}

@media (max-width: 1000px) {
  .methodology-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 650px) {
  .methodology-grid {
    grid-template-columns: 1fr;
  }
}

.method-card {
  background: rgba(10, 18, 36, 0.6);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 1.25rem;
}

.method-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--cyan-bright);
  background: rgba(6, 182, 212, 0.15);
  border: 1px solid rgba(6, 182, 212, 0.3);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  margin-bottom: 0.65rem;
}

.method-card h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.65rem;
}

.method-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.method-card code {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--cyan-bright);
  background: rgba(255, 255, 255, 0.05);
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
}

/* Tables */
.table-responsive {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

.data-table th, .data-table td {
  padding: 0.75rem 0.9rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.data-table th {
  color: var(--text-dim);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  background: rgba(0, 0, 0, 0.2);
}

.data-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.badge-tag {
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-weight: 500;
}

.badge-tag.balanced {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-tag.surplus {
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-tag.deficit {
  background: rgba(244, 63, 94, 0.12);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.3);
}

/* Footer */
footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border-color);
  padding: 2rem 1.5rem;
  margin-top: 3rem;
}

.footer-container {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.footer-brand {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
}

.footer-author {
  font-size: 0.88rem;
  color: var(--cyan-bright);
  font-weight: 600;
  margin: 0.25rem 0;
}

.footer-license {
  font-size: 0.78rem;
  color: var(--text-dim);
}

.footer-links {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.footer-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.82rem;
  transition: color 0.2s ease;
}

.footer-link:hover {
  color: var(--cyan-bright);
}

.footer-icon {
  width: 14px;
  height: 14px;
}

.footer-copyright {
  font-size: 0.78rem;
  color: var(--text-dim);
}
.benchmark-splits .table-help { color: #a5b4fc; font-size: .82rem; margin: .35rem 0 .7rem; }
.benchmark-splits .data-table th { color: #dbeafe; background: #111f3d; border-bottom: 2px solid #22d3ee; text-transform: uppercase; letter-spacing: .04em; }
.benchmark-splits .data-table tbody tr { cursor: pointer; outline: none; }
.benchmark-splits .data-table tbody tr:hover td, .benchmark-splits .data-table tbody tr:focus td { background: rgba(34,211,238,.12); }
.benchmark-splits .data-table tbody tr.is-selected td { background: rgba(20,184,166,.18); box-shadow: inset 0 2px 0 #2dd4bf, inset 0 -2px 0 #2dd4bf; }
.split-detail-panel { display:flex; flex-wrap:wrap; gap:.75rem 1.5rem; margin-top:.8rem; padding:.8rem 1rem; border:1px solid #2dd4bf; border-radius:8px; background:rgba(8,47,73,.45); color:#dbeafe; }
.split-detail-panel span { color:#a5b4fc; }
.footer-sources { display:flex; flex-wrap:wrap; gap:.45rem .8rem; align-items:center; margin:.8rem 0 .35rem; font-size:.78rem; }
.footer-sources-title { color:#94a3b8; font-weight:700; text-transform:uppercase; letter-spacing:.04em; }
.footer-sources a { color:#67e8f9; text-decoration:none; border-bottom:1px dotted #67e8f9; }
.footer-sources a:hover, .footer-sources a:focus { color:#5eead4; }

/* Interactive Educational Modal */
.modal-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(6, 9, 19, 0.85);
  backdrop-filter: blur(12px);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  padding: 1.5rem;
  animation: fadeIn 0.2s ease-out;
}

.modal-backdrop.open {
  display: flex;
}

.modal-dialog {
  background: #0d1527;
  border: 1px solid rgba(6, 182, 212, 0.4);
  border-radius: 14px;
  width: 100%;
  max-width: 780px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7), 0 0 30px rgba(6, 182, 212, 0.15);
  display: flex;
  flex-direction: column;
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  position: sticky;
  top: 0;
  background: #0d1527;
  z-index: 2;
}

.modal-title-group h2 {
  font-size: 1.25rem;
  color: var(--text-main);
  margin-top: 0.25rem;
  letter-spacing: -0.01em;
}

.modal-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--cyan-bright);
  background: rgba(6, 182, 212, 0.15);
  border: 1px solid rgba(6, 182, 212, 0.3);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  letter-spacing: 0.05em;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.5rem;
  transition: color 0.2s;
}

.modal-close:hover {
  color: var(--rose-danger);
}

.modal-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.modal-section {
  background: rgba(16, 26, 48, 0.6);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 1.1rem 1.25rem;
}

.modal-section-header {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.65rem;
}

.step-num {
  width: 24px;
  height: 24px;
  background: rgba(6, 182, 212, 0.2);
  color: var(--cyan-bright);
  border: 1px solid rgba(6, 182, 212, 0.4);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  font-family: var(--font-mono);
}

.modal-section h3 {
  font-size: 0.95rem;
  color: var(--text-main);
  font-weight: 600;
}

.modal-section p, .modal-section div {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.modal-section.what { border-left: 3px solid var(--blue-vivid); }
.modal-section.how { border-left: 3px solid var(--cyan-bright); }
.modal-section.why { border-left: 3px solid var(--emerald-success); }

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(10, 18, 36, 0.8);
}

.modal-author {
  font-size: 0.78rem;
  color: var(--text-dim);
  font-weight: 500;
}

/* Clickable card effects */
.clickable-card {
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  position: relative;
}

.clickable-card:hover {
  transform: translateY(-2px);
  border-color: rgba(6, 182, 212, 0.4) !important;
  box-shadow: 0 6px 20px rgba(6, 182, 212, 0.15) !important;
}

.click-hint {
  font-size: 0.7rem;
  color: var(--cyan-bright);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-top: 0.35rem;
}

/* ==========================================================================
   LANDING PAGE & RESPONSIVE MULTI-DEVICE WEBVIEW STYLES
   ========================================================================== */
.landing-container {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  max-width: 1300px;
  margin: 0 auto;
}

.landing-hero {
  background: radial-gradient(circle at 80% 20%, rgba(6, 182, 212, 0.12) 0%, rgba(15, 23, 42, 0.95) 70%);
  border: 1px solid rgba(6, 182, 212, 0.25);
  border-radius: 16px;
  padding: 2.25rem;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.hero-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 1.25rem;
}

.hero-law-badge {
  background: rgba(16, 185, 129, 0.15) !important;
  color: var(--emerald-success) !important;
  border: 1px solid rgba(16, 185, 129, 0.3) !important;
  font-weight: 600;
}

.hero-author-badge {
  background: rgba(6, 182, 212, 0.15) !important;
  color: var(--cyan-bright) !important;
  border: 1px solid rgba(6, 182, 212, 0.3) !important;
  font-weight: 600;
}

.hero-license-badge {
  background: rgba(245, 158, 11, 0.15) !important;
  color: var(--amber-warning) !important;
  border: 1px solid rgba(245, 158, 11, 0.3) !important;
}

.hero-title {
  font-size: clamp(1.8rem, 3.5vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-main);
  line-height: 1.2;
  margin-bottom: 0.75rem;
}

.version-highlight {
  color: var(--cyan-bright);
  font-size: 0.6em;
  padding: 0.1em 0.4em;
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid rgba(6, 182, 212, 0.3);
  border-radius: 6px;
  vertical-align: middle;
}

.hero-subtitle {
  font-size: clamp(1rem, 1.5vw, 1.2rem);
  color: var(--text-muted);
  max-width: 900px;
  line-height: 1.6;
  margin-bottom: 1.25rem;
}

.hero-description-box {
  background: rgba(10, 18, 36, 0.65);
  border-left: 4px solid var(--cyan-bright);
  border-radius: 8px;
  padding: 1.1rem 1.4rem;
  margin-bottom: 1.75rem;
}

.hero-description-box p {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 0.65rem;
}

.hero-description-box p:last-child {
  margin-bottom: 0;
}

.hero-stat-line {
  font-size: 0.85rem !important;
  color: var(--text-dim) !important;
  font-family: var(--font-mono);
}

.hero-cta-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
}

.hero-cta-group .btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.35rem;
  font-size: 0.92rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 44px;
}

.hero-cta-group .btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.hero-cta-group .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
}

.hero-cta-group .btn-outline {
  background: transparent;
  color: var(--cyan-bright);
  border: 1px solid rgba(6, 182, 212, 0.4);
  text-decoration: none;
}

.hero-cta-group .btn-outline:hover {
  background: rgba(6, 182, 212, 0.1);
  transform: translateY(-2px);
}

/* Capabilities Grid */
.landing-section-header {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-top: 0.5rem;
}

.section-svg-icon {
  width: 22px;
  height: 22px;
  color: var(--cyan-bright);
}

.landing-section-header h2 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-main);
}

.capabilities-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}

.capability-card {
  background: rgba(16, 26, 48, 0.75);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.capability-card:hover {
  transform: translateY(-4px);
  border-color: rgba(6, 182, 212, 0.5);
  box-shadow: 0 10px 25px rgba(6, 182, 212, 0.12);
}

.cap-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.9rem;
}

.cap-tag {
  font-size: 0;
  font-weight: 700;
  padding: 0.42rem;
  min-width: 2.25rem;
  min-height: 2.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}

.cap-tag.champion { background: rgba(16, 185, 129, 0.2); color: var(--emerald-success); }
.cap-tag.benchmark { background: rgba(59, 130, 246, 0.2); color: var(--blue-vivid); }
.cap-tag.diag { background: rgba(168, 85, 247, 0.2); color: #c084fc; }
.cap-tag.sim { background: rgba(245, 158, 11, 0.2); color: var(--amber-warning); }
.cap-tag .cap-icon { font-size: 1.35rem; line-height: 1; }
.cap-tag .cap-label { display: none; }

.cap-metric {
  text-align: right;
  line-height: 1.35;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--cyan-bright);
}

.capability-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.capability-card p {
  font-size: 0.86rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 1.25rem;
  flex-grow: 1;
}

.cap-footer {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--cyan-bright);
  display: flex;
  align-items: center;
}

/* Landing API Console */
.landing-api-console {
  background: rgba(10, 18, 36, 0.9);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 1.75rem;
}

.api-console-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 1.25rem;
}

.api-lang-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

.api-lang-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-dim);
  padding: 0.45rem 1rem;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 38px;
}

.api-lang-btn.active {
  background: rgba(6, 182, 212, 0.15);
  color: var(--cyan-bright);
  border-color: rgba(6, 182, 212, 0.4);
}

.code-preview-container {
  position: relative;
  background: #060b17;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
}

.code-preview-container pre {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.84rem;
  color: #a5f3fc;
  overflow-x: auto;
  line-height: 1.5;
}

.btn-copy {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text-main);
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-copy:hover {
  background: rgba(6, 182, 212, 0.2);
  border-color: var(--cyan-bright);
  color: var(--cyan-bright);
}

.copy-icon {
  width: 14px;
  height: 14px;
}

.live-test-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.live-test-status {
  font-size: 0.84rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

.live-response-box {
  background: #040812;
  border: 1px solid rgba(6, 182, 212, 0.3);
  border-radius: 8px;
  padding: 1rem;
  margin-top: 1rem;
}

.response-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.65rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.response-badge {
  background: rgba(16, 185, 129, 0.2);
  color: var(--emerald-success);
  font-size: 0.78rem;
  font-weight: 700;
  font-family: var(--font-mono);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

.response-time {
  color: var(--cyan-bright);
  font-size: 0.78rem;
  font-family: var(--font-mono);
}

.live-response-box pre {
  margin: 0;
  max-height: 280px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: #e2e8f0;
  line-height: 1.45;
}

/* ==========================================================================
   MULTI-DEVICE & WEBVIEW RESPONSIVE RULES (Mobile, Tablet, Desktop)
   ========================================================================== */
@media (max-width: 768px) {
  .landing-hero {
    padding: 1.35rem;
  }
  .hero-cta-group {
    flex-direction: column;
  }
  .hero-cta-group .btn {
    width: 100%;
    justify-content: center;
  }
  .capabilities-grid {
    grid-template-columns: 1fr;
  }
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .tabs-nav {
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.5rem;
  }
  .tab-btn {
    padding: 0.65rem 1rem;
    font-size: 0.85rem;
    flex-shrink: 0;
  }
  .nav-container {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
  .nav-badges {
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .capabilities-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .dashboard-grid {
    grid-template-columns: 320px 1fr;
  }
}

/* ==========================================================================
   SETTINGS MODAL & GLOSSARY STYLES
   ========================================================================== */
.btn-gear {
  background: rgba(6, 182, 212, 0.12) !important;
  border: 1px solid rgba(6, 182, 212, 0.35) !important;
  color: var(--cyan-bright) !important;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
  font-family: inherit;
}

.btn-gear:hover {
  background: rgba(6, 182, 212, 0.25) !important;
  border-color: var(--cyan-bright) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(6, 182, 212, 0.25);
}

.gear-badge-tag {
  background: rgba(255, 255, 255, 0.1);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-size: 0.72rem;
  margin-left: 0.25rem;
}

.settings-card {
  max-width: 1580px !important;
  width: min(96vw, 1580px) !important;
  min-height: 86vh !important;
  max-height: 94vh !important;
  border-radius: 20px !important;
  box-shadow: 0 30px 90px rgba(0,0,0,.65), 0 0 0 1px rgba(0,229,255,.12) !important;
}

.project-logo{width:52px;height:52px;object-fit:contain;display:block}.btn-gear{min-height:44px;border-radius:14px!important;border:1px solid rgba(0,229,255,.42)!important;background:linear-gradient(135deg,rgba(0,229,255,.16),rgba(0,245,212,.06))!important;transition:transform .2s,box-shadow .2s}.btn-gear:hover{transform:translateY(-2px);box-shadow:0 8px 24px rgba(0,229,255,.2)}.badge-icon{width:20px;height:20px}.settings-tabs-nav{position:sticky;top:0;z-index:3;display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:.55rem;padding:1rem 1.5rem;background:rgba(8,15,30,.96);backdrop-filter:blur(14px)}.settings-tab-btn{min-height:42px;border-radius:11px;font-size:.82rem;text-align:left}.settings-body{max-height:none;min-height:52vh}.settings-tab-content.active{animation:settingsIn .18s ease-out}@keyframes settingsIn{from{opacity:0;transform:translateY(5px)}to{opacity:1;transform:none}}@media(max-width:700px){.settings-card{width:100%!important;max-height:100vh!important;border-radius:0!important}.settings-tabs-nav{grid-template-columns:1fr 1fr;padding:.8rem}.settings-body{padding:1rem}.project-logo{width:44px;height:44px}}

.settings-subtitle {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
  line-height: 1.45;
}

.settings-tabs-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: rgba(10, 18, 36, 0.8);
  border-bottom: 1px solid var(--border-color);
}

.settings-tab-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-dim);
  padding: 0.45rem 0.9rem;
  border-radius: 6px;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.settings-tab-btn.active {
  background: rgba(6, 182, 212, 0.15);
  border-color: rgba(6, 182, 212, 0.4);
  color: var(--cyan-bright);
}

.settings-tab-btn:hover:not(.active) {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.04);
}

.settings-body {
  max-height: 65vh;
  overflow-y: auto;
  padding: 1.5rem;
}

.settings-tab-content {
  display: none;
}

.settings-tab-content.active {
  display: block;
}

.settings-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
}

.field-hint {
  display: block;
  font-size: 0.74rem;
  color: var(--text-dim);
  margin-top: 0.35rem;
  line-height: 1.4;
}

.settings-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.save-status-msg {
  font-size: 0.85rem;
  font-family: var(--font-mono);
  color: var(--emerald-success);
}

/* Extensibility Tab */
.extensibility-explainer {
  background: rgba(6, 182, 212, 0.08);
  border-left: 3px solid var(--cyan-bright);
  padding: 1rem 1.25rem;
  border-radius: 6px;
  margin-bottom: 1.25rem;
}

.extensibility-explainer h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--cyan-bright);
  margin-bottom: 0.35rem;
}

.extensibility-explainer p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin: 0;
}

.ext-simulator-box {
  background: rgba(16, 26, 48, 0.6);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 1.25rem;
}

.ext-simulator-box h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 1rem;
}

.ext-result-box {
  background: #040812;
  border: 1px solid rgba(6, 182, 212, 0.4);
  border-radius: 8px;
  padding: 1rem;
  margin-top: 1.25rem;
}

.ext-result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.formula-badge {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--cyan-bright);
  background: rgba(6, 182, 212, 0.12);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
}

.ext-result-details p {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin: 0.35rem 0;
  line-height: 1.5;
}

/* Glossary Grid */
.glossary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1rem;
}

.glossary-item {
  background: rgba(16, 26, 48, 0.7);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 1.1rem;
  transition: all 0.2s ease;
}

.glossary-item:hover {
  border-color: rgba(6, 182, 212, 0.35);
  background: rgba(16, 26, 48, 0.9);
}

.glossary-term {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--cyan-bright);
  margin-bottom: 0.45rem;
}

.glossary-item p {
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin: 0;
}

/* Export Tab */
.export-box {
  background: rgba(16, 26, 48, 0.6);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 1.5rem;
}

.export-box h3 {
  font-size: 1.05rem;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.export-box p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 1.25rem;
}

.export-btn-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
}

/* Provenance & Audit Card */
.provenance-card {
  background: rgba(6, 182, 212, 0.05);
  border: 1px solid rgba(6, 182, 212, 0.25);
  border-radius: 8px;
  padding: 1.2rem;
  margin-bottom: 1.5rem;
}

.provenance-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.prov-tag {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--cyan-bright);
  background: rgba(6, 182, 212, 0.15);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

.prov-legal {
  font-size: 0.76rem;
  color: var(--emerald-success);
  font-weight: 600;
}

.prov-title {
  font-size: 0.98rem;
  color: var(--text-main);
  font-weight: 700;
  margin: 0.35rem 0;
}

.prov-desc {
  font-size: 0.84rem !important;
  color: var(--text-muted) !important;
  line-height: 1.55 !important;
  margin-bottom: 0.85rem !important;
}

.prov-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.65rem;
  background: rgba(10, 18, 36, 0.6);
  border-radius: 6px;
  padding: 0.75rem;
}

.prov-meta-item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.prov-meta-label {
  font-size: 0.72rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.prov-meta-val {
  font-size: 0.8rem;
  color: var(--cyan-bright);
  font-family: var(--font-mono);
}

/* Custom Export Controls */
.export-controls-panel {
  background: rgba(10, 18, 36, 0.6);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.25rem;
}

.export-controls-panel h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 1rem;
}

.filename-input-group {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.filename-input-group input {
  flex-grow: 1;
  background: #040812;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  padding: 0.55rem 0.85rem;
  color: #e2e8f0;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.filename-input-group input:focus {
  border-color: var(--cyan-bright);
  outline: none;
}

.export-actions-row {
  display: flex;
  gap: 0.85rem;
  margin-top: 1.25rem;
  flex-wrap: wrap;
}

.export-preview-container {
  background: #040812;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.85rem;
}

.preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.65rem;
}

.preview-file-label {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
}

.preview-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
  font-family: var(--font-mono);
}

.preview-table th {
  background: rgba(255, 255, 255, 0.05);
  color: var(--cyan-bright);
  padding: 0.45rem 0.6rem;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  white-space: nowrap;
}

.preview-table td {
  padding: 0.45rem 0.6rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  white-space: nowrap;
}

/* Enterprise Box & Infrastructure Cards */
.enterprise-box {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.infra-card {
  background: rgba(16, 26, 48, 0.6);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 1.25rem;
}

.infra-card h4 {
  font-size: 0.96rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.4rem;
}

.infra-card p {
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 0.9rem;
}

.infra-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.85rem;
}

.infra-item {
  background: rgba(10, 18, 36, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 0.85rem;
}

.infra-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.35rem;
}

.infra-name {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--cyan-bright);
}

.infra-desc {
  font-size: 0.78rem !important;
  color: var(--text-muted) !important;
  margin-bottom: 0.4rem !important;
  line-height: 1.4 !important;
}

.infra-stat {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
}

/* MCP Tools Pills */
.mcp-tools-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.mcp-tool-pill {
  background: rgba(168, 85, 247, 0.15);
  color: #d8b4fe;
  border: 1px solid rgba(168, 85, 247, 0.3);
  padding: 0.25rem 0.65rem;
  border-radius: 20px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
}

/* RAG Query Box */
.rag-query-box {
  background: #040812;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1rem;
}

.rag-input-row {
  display: flex;
  gap: 0.65rem;
}

.rag-input-row input {
  flex-grow: 1;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  padding: 0.55rem 0.85rem;
  color: #e2e8f0;
  font-size: 0.85rem;
}

.rag-result-panel {
  background: rgba(6, 182, 212, 0.05);
  border: 1px solid rgba(6, 182, 212, 0.25);
  border-radius: 6px;
  padding: 0.85rem;
  font-size: 0.84rem;
  color: #cbd5e1;
  line-height: 1.55;
}

.rag-result-panel .rag-citation {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.76rem;
  color: var(--emerald-success);
  font-family: var(--font-mono);
}

.cuda-status-badge {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(10, 18, 36, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.65rem 0.85rem;
  border-radius: 6px;
  font-size: 0.84rem;
  color: var(--text-main);
}

/* ==========================================================================
   DYNAMIC INTERACTIVE API CONSOLE & ISO COMPLIANCE STYLES
   ========================================================================== */
.api-params-toolbar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  background: rgba(10, 18, 36, 0.7);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.api-param-item {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.api-param-item label {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--cyan-bright);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.api-param-item select {
  background: #040812;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  padding: 0.45rem 0.65rem;
  color: #e2e8f0;
  font-size: 0.82rem;
  cursor: pointer;
}

.api-param-item select:focus {
  border-color: var(--cyan-bright);
  outline: none;
}

.api-whatif-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  background: rgba(6, 182, 212, 0.04);
  border: 1px solid rgba(6, 182, 212, 0.15);
  border-radius: 8px;
  padding: 0.85rem 1rem;
  margin-bottom: 1.25rem;
}

.api-slider-group {
  flex: 1;
  min-width: 240px;
}

.api-slider-group label {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.highlight-val {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--cyan-bright);
}

.api-slider-group input[type="range"] {
  width: 100%;
  accent-color: var(--cyan-bright);
}

/* Pedagogical Response Breakdown */
.response-pedagogical-breakdown {
  background: rgba(16, 26, 48, 0.8);
  border: 1px solid rgba(6, 182, 212, 0.25);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.pedagogical-card {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.pedagogical-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--cyan-bright);
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.pedagogical-desc {
  font-size: 0.84rem;
  color: #cbd5e1;
  line-height: 1.55;
  margin: 0;
}

.pedagogical-metric-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.65rem;
  margin-top: 0.4rem;
}

.pedagogical-kpi-pill {
  background: rgba(10, 18, 36, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.pedagogical-kpi-pill .kpi-label {
  font-size: 0.7rem;
  color: var(--text-dim);
  text-transform: uppercase;
}

.pedagogical-kpi-pill .kpi-val {
  font-size: 0.95rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--cyan-bright);
}

.response-raw-toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.raw-label {
  font-size: 0.76rem;
  color: var(--text-dim);
  text-transform: uppercase;
  font-family: var(--font-mono);
}

/* ISO Compliance Box */
.iso-compliance-box {
  margin-top: 1.75rem;
  background: rgba(10, 18, 36, 0.85);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 10px;
  padding: 1.35rem;
}

.iso-box-header {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}

.iso-shield {
  font-size: 1.8rem;
  line-height: 1;
}

.iso-box-header h4 {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--emerald-success);
  margin: 0 0 0.35rem 0;
}

.iso-box-header p {
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
}

.iso-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.iso-item {
  background: rgba(16, 26, 48, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.iso-badge {
  font-size: 0.72rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--emerald-success);
  background: rgba(16, 185, 129, 0.12);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  display: inline-block;
  width: fit-content;
}

.iso-item strong {
  font-size: 0.86rem;
  color: var(--text-main);
}

.iso-item p {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin: 0;
}

.iso-item {
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  position: relative;
}

.iso-item:hover {
  border-color: var(--emerald-success);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.2);
}

.iso-item .iso-action-hint {
  font-size: 0.72rem;
  color: var(--emerald-success);
  margin-top: 0.35rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

/* ==========================================================================
   SETTINGS MODAL & ENTERPRISE GOVERNANCE WORKSTATION
   ========================================================================== */
.modal-dialog.settings-card {
  max-width: 1580px !important;
  width: 96vw !important;
  min-height: 86vh !important;
  max-height: 94vh !important;
  background: #090e1a;
  border: 1px solid rgba(6, 182, 212, 0.35);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 35px rgba(6, 182, 212, 0.15);
  display: flex;
  flex-direction: column;
}

/* Perspective Control Bar in Header */
.perspective-control-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(10, 20, 38, 0.85);
  border: 1px solid rgba(0, 229, 255, 0.3);
  padding: 0.3rem 0.65rem;
  border-radius: 8px;
}

.perspective-label {
  font-size: 0.76rem;
  color: var(--cyan-bright);
  font-weight: 600;
  margin: 0;
  white-space: nowrap;
}

.perspective-select {
  background: rgba(3, 7, 18, 0.9);
  border: 1px solid rgba(0, 245, 212, 0.35);
  border-radius: 5px;
  color: #F8FAFC;
  font-size: 0.76rem;
  padding: 0.25rem 0.5rem;
  cursor: pointer;
  outline: none;
}

.perspective-select:focus {
  border-color: var(--cyan-bright);
  box-shadow: 0 0 8px rgba(0, 229, 255, 0.3);
}

.badge-perspective {
  background: rgba(0, 245, 212, 0.15);
  color: #00F5D4;
  border: 1px solid #00F5D4;
  font-size: 0.72rem;
  padding: 0.2rem 0.5rem;
  white-space: nowrap;
}

.badge-dirty {
  background: rgba(245, 158, 11, 0.18);
  color: #FBBF24;
  border: 1px solid #F59E0B;
  font-size: 0.72rem;
  padding: 0.2rem 0.55rem;
  animation: pulse-dirty 1.5s infinite;
}

@keyframes pulse-dirty {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.75; transform: scale(0.98); }
}

/* Interactive Clickable Audit Cards */
.interactive-audit-card,
.interactive-db-card {
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.interactive-audit-card:hover,
.interactive-db-card:hover {
  transform: translateY(-2px);
  border-color: #00E5FF !important;
  box-shadow: 0 6px 18px rgba(0, 229, 255, 0.15);
}

/* Item Inspector Overlay Drawer */
.item-inspector-overlay {
  position: fixed;
  inset: 0;
  background: rgba(3, 7, 18, 0.75);
  backdrop-filter: blur(8px);
  z-index: 1050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  animation: fadeIn 0.18s ease-out;
}

.item-inspector-card {
  background: #0B132B;
  border: 1px solid rgba(0, 229, 255, 0.4);
  border-radius: 14px;
  width: min(92vw, 680px);
  max-height: 85vh;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.9), 0 0 30px rgba(0, 229, 255, 0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: scaleUp 0.18s ease-out;
}

@keyframes scaleUp {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.inspector-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  background: rgba(16, 26, 48, 0.85);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.inspector-badge {
  background: rgba(0, 229, 255, 0.15);
  color: #00E5FF;
  border: 1px solid rgba(0, 229, 255, 0.4);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.btn-close-inspector {
  background: transparent;
  border: none;
  color: #94A3B8;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.2rem;
  transition: color 0.15s;
}

.btn-close-inspector:hover {
  color: #F8FAFC;
}

.inspector-body {
  padding: 1.25rem;
  overflow-y: auto;
  font-size: 0.82rem;
  color: #CBD5E1;
  line-height: 1.5;
}

.inspector-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 1.25rem;
  background: rgba(16, 26, 48, 0.6);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  gap: 0.75rem;
}

/* Perspective Readonly Mode Indicators */
.perspective-mode-readonly input,
.perspective-mode-readonly select:not(#settings-role-perspective-select):not(#guardrail-role-select),
.perspective-mode-readonly textarea {
  pointer-events: none !important;
  opacity: 0.65 !important;
  background: rgba(15, 23, 42, 0.4) !important;
}

.perspective-mode-readonly button.btn-primary:not(#settings-action-btn) {
  opacity: 0.4 !important;
  pointer-events: none !important;
  cursor: not-allowed !important;
}

.settings-subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
  line-height: 1.4;
}

.settings-tabs-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.6rem 1.25rem;
  background: rgba(13, 21, 39, 0.95);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 75px;
  z-index: 5;
}

.settings-tab-btn {
  background: rgba(16, 26, 48, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.45rem 0.75rem;
  cursor: pointer;
  transition: all 0.18s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
}

.settings-tab-btn:hover {
  color: var(--text-main);
  border-color: rgba(6, 182, 212, 0.5);
  background: rgba(23, 37, 68, 0.8);
}

.settings-tab-btn.active {
  color: var(--cyan-bright);
  border-color: var(--cyan-primary);
  background: rgba(6, 182, 212, 0.16);
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.2);
}

.settings-tab-content {
  display: none;
  padding: 1.25rem 1.5rem;
  animation: fadeInTab 0.2s ease-out;
}

.settings-tab-content.active {
  display: block;
}

@keyframes fadeInTab {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Preset Cards Grid */
.preset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.85rem;
  margin-top: 1rem;
}

.preset-card {
  background: rgba(16, 26, 48, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.preset-card:hover {
  border-color: var(--cyan-primary);
  background: rgba(23, 37, 68, 0.85);
  transform: translateY(-2px);
}

.preset-card.active {
  border-color: var(--cyan-bright);
  background: rgba(6, 182, 212, 0.12);
  box-shadow: 0 0 16px rgba(6, 182, 212, 0.2);
}

.preset-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.4rem;
}

.preset-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
}

.preset-badge {
  font-size: 0.68rem;
  font-weight: 700;
  font-family: var(--font-mono);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
}

.preset-badge.champion {
  background: rgba(6, 182, 212, 0.2);
  color: var(--cyan-bright);
  border: 1px solid rgba(6, 182, 212, 0.4);
}

.preset-badge.conservative {
  background: rgba(16, 185, 129, 0.2);
  color: var(--emerald-success);
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.preset-badge.aggressive {
  background: rgba(245, 158, 11, 0.2);
  color: var(--amber-warn);
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.preset-badge.quantile {
  background: rgba(139, 92, 246, 0.2);
  color: var(--purple-ai);
  border: 1px solid rgba(139, 92, 246, 0.4);
}

.preset-desc {
  font-size: 0.77rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin-bottom: 0.75rem;
}

.preset-specs {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
  background: rgba(6, 9, 19, 0.6);
  padding: 0.45rem;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

/* Reproducibility & Provenance */
.prov-ministry-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0.85rem;
  margin: 1rem 0;
}

.ministry-link-card {
  background: rgba(16, 26, 48, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  transition: all 0.2s ease;
}

.ministry-link-card:hover {
  border-color: var(--blue-vivid);
  background: rgba(23, 37, 68, 0.8);
}

.ministry-link-card .m-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ministry-link-card .m-title {
  font-weight: 700;
  font-size: 0.84rem;
  color: var(--text-main);
}

.ministry-link-card .m-url {
  font-size: 0.74rem;
  color: var(--cyan-bright);
  text-decoration: none;
  word-break: break-all;
}

.ministry-link-card .m-url:hover {
  text-decoration: underline;
}

.repro-recipe-box {
  background: rgba(6, 9, 19, 0.75);
  border: 1px solid rgba(6, 182, 212, 0.25);
  border-radius: 8px;
  padding: 1rem;
  margin-top: 1rem;
}

.repro-recipe-box pre {
  background: #030712;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  padding: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--cyan-bright);
  overflow-x: auto;
  margin-top: 0.4rem;
}

/* Privacy Ley 81 Panel */
.privacy-step-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.65rem;
  margin: 1rem 0;
}

.privacy-step-item {
  background: rgba(16, 26, 48, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  padding: 0.65rem 0.8rem;
  font-size: 0.76rem;
}

.privacy-step-num {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--emerald-success);
  margin-bottom: 0.2rem;
}

.privacy-diff-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.76rem;
  margin-top: 0.75rem;
}

.privacy-diff-table th {
  background: rgba(13, 21, 39, 0.9);
  padding: 0.5rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-muted);
}

.privacy-diff-table td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.privacy-diff-table tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.tag-redacted {
  color: var(--rose-danger);
  font-family: var(--font-mono);
  font-weight: 700;
  background: rgba(244, 63, 94, 0.12);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}

.tag-hashed {
  color: var(--purple-ai);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  background: rgba(139, 92, 246, 0.12);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}

.tag-bucketed {
  color: var(--amber-warn);
  font-family: var(--font-mono);
  background: rgba(245, 158, 11, 0.12);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}

.crypto-cert-box {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 8px;
  padding: 0.85rem 1rem;
  margin-top: 1rem;
  font-size: 0.78rem;
}

/* RBAC Governance Panel */
.rbac-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
  margin: 1rem 0;
}

.rbac-table th {
  background: rgba(13, 21, 39, 0.9);
  padding: 0.5rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-muted);
}

.rbac-table td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.role-badge {
  font-size: 0.7rem;
  font-weight: 700;
  font-family: var(--font-mono);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  display: inline-block;
}

.role-badge.superadmin {
  background: rgba(244, 63, 94, 0.15);
  color: var(--rose-danger);
  border: 1px solid rgba(244, 63, 94, 0.3);
}

.role-badge.auditor {
  background: rgba(16, 185, 129, 0.15);
  color: var(--emerald-success);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.role-badge.operator {
  background: rgba(6, 182, 212, 0.15);
  color: var(--cyan-bright);
  border: 1px solid rgba(6, 182, 212, 0.3);
}

.role-badge.researcher {
  background: rgba(139, 92, 246, 0.15);
  color: var(--purple-ai);
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.revocation-btn {
  background: rgba(244, 63, 94, 0.15);
  color: var(--rose-danger);
  border: 1px solid rgba(244, 63, 94, 0.4);
  padding: 0.45rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.8rem;
  transition: all 0.2s ease;
}

.revocation-btn:hover {
  background: var(--rose-danger);
  color: #fff;
}

/* MCP Tool Runner & Souls */
.soul-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.85rem;
  margin: 1rem 0;
}

.soul-card {
  background: rgba(16, 26, 48, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.soul-card:hover {
  border-color: var(--purple-ai);
  background: rgba(23, 37, 68, 0.85);
}

.soul-card.active {
  border-color: var(--purple-ai);
  background: rgba(139, 92, 246, 0.15);
  box-shadow: 0 0 14px rgba(139, 92, 246, 0.2);
}

.soul-card .s-name {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-main);
}

.soul-card .s-desc {
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.json-rpc-viewer {
  background: #030712;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--emerald-success);
  max-height: 240px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

/* Responsive Webview Adaptations */
@media (max-width: 768px) {
  .nav-container {
    padding: 0.6rem 1rem;
  }

  .modal-dialog.settings-card {
    width: 98vw;
    max-height: 96vh;
    padding: 0.5rem;
  }

  .settings-tabs-nav {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    padding: 0.5rem;
  }

  .settings-tab-btn {
    font-size: 0.74rem;
    padding: 0.35rem 0.6rem;
  }

  .preset-grid,
  .prov-ministry-grid,
  .soul-cards-grid,
  .iso-grid {
    grid-template-columns: 1fr;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ==========================================================================
   THEME SELECTOR IN HEADER
   ========================================================================== */
.theme-selector-group {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(16, 26, 48, 0.65);
  border: 1px solid var(--border-color);
  padding: 0.25rem 0.6rem;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.theme-selector-group:hover {
  border-color: var(--cyan-primary);
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.15);
}

.theme-select {
  background: transparent;
  border: none;
  color: var(--text-main);
  font-family: var(--font-stack);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
}

.theme-select option {
  background: #0d1527;
  color: #f8fafc;
}

/* ==========================================================================
   INTERACTIVE METHODOLOGY WORKSTATION & DEEP-DIVE ARCHITECTURE
   ========================================================================== */
.methodology-header-banner {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.12), rgba(139, 92, 246, 0.08));
  border: 1px solid rgba(6, 182, 212, 0.25);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.methodology-header-banner h2 {
  font-size: 1.25rem;
  color: var(--text-main);
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.method-phases-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.method-phase-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 1.15rem;
  cursor: pointer;
  transition: all 0.22s ease-in-out;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.method-phase-card:hover {
  transform: translateY(-3px);
  border-color: var(--cyan-primary);
  background: var(--bg-card-hover);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), var(--shadow-glow);
}

.method-phase-card.active {
  border-color: var(--cyan-bright);
  background: rgba(6, 182, 212, 0.12);
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.25);
}

.method-phase-card.active::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--cyan-primary), var(--cyan-bright));
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
}

.phase-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.6rem;
}

.phase-number-badge {
  font-size: 0.7rem;
  font-weight: 700;
  font-family: var(--font-mono);
  background: rgba(6, 182, 212, 0.16);
  color: var(--cyan-bright);
  border: 1px solid rgba(6, 182, 212, 0.35);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}

.phase-category-tag {
  font-size: 0.68rem;
  color: var(--text-dim);
  text-transform: uppercase;
  font-weight: 600;
}

.method-phase-card h3 {
  font-size: 0.95rem;
  color: var(--text-main);
  margin-bottom: 0.45rem;
  line-height: 1.35;
}

.method-phase-card p {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin-bottom: 0.75rem;
}

.phase-action-cta {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--cyan-bright);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: auto;
}

/* Deep-Dive Workstation Panel */
.deepdive-workstation {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  margin-top: 1rem;
}

.deepdive-header {
  padding: 1.25rem 1.5rem;
  background: rgba(10, 18, 36, 0.85);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.deepdive-header-left h3 {
  font-size: 1.15rem;
  color: var(--cyan-bright);
  margin-top: 0.2rem;
}

.dim-nav-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.75rem 1.25rem;
  background: rgba(6, 9, 19, 0.75);
  border-bottom: 1px solid var(--border-color);
}

.dim-nav-btn {
  background: rgba(16, 26, 48, 0.6);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 600;
  padding: 0.4rem 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.dim-nav-btn:hover {
  color: var(--text-main);
  border-color: var(--cyan-primary);
  background: rgba(23, 37, 68, 0.8);
}

.dim-nav-btn.active {
  background: rgba(6, 182, 212, 0.16);
  border-color: var(--cyan-primary);
  color: var(--cyan-bright);
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.2);
}

.dim-content-box {
  padding: 1.5rem;
  min-height: 280px;
}

.dim-panel {
  display: none;
  animation: fadeInTab 0.2s ease-out;
}

.dim-panel.active {
  display: block;
}

/* Dimension Cards */
.real-context-card {
  background: rgba(244, 63, 94, 0.06);
  border: 1px solid rgba(244, 63, 94, 0.25);
  border-radius: 10px;
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.real-context-title {
  color: #fb7185;
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.obstacle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.obstacle-card {
  background: rgba(245, 158, 11, 0.06);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 8px;
  padding: 1rem;
}

.solution-card {
  background: rgba(16, 185, 129, 0.06);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 8px;
  padding: 1rem;
}

.math-formula-container {
  background: #040814;
  border: 1px solid rgba(6, 182, 212, 0.3);
  border-radius: 8px;
  padding: 1.25rem;
  margin: 1rem 0;
}

.math-title {
  font-size: 0.85rem;
  color: var(--cyan-bright);
  font-weight: 700;
  margin-bottom: 0.6rem;
}

.math-equation-display {
  font-family: var(--font-mono);
  font-size: 0.92rem;
  color: #e2e8f0;
  background: rgba(0, 0, 0, 0.4);
  padding: 0.85rem;
  border-radius: 6px;
  margin: 0.6rem 0;
  overflow-x: auto;
  border-left: 3px solid var(--cyan-primary);
}

.code-python-container {
  background: #030712;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  overflow: hidden;
  margin-top: 1rem;
}

.code-python-header {
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.74rem;
  font-family: var(--font-mono);
  color: var(--text-dim);
}

.code-python-body {
  padding: 1rem;
  font-family: var(--font-mono);
  font-size: 0.77rem;
  color: #a5f3fc;
  overflow-x: auto;
  line-height: 1.55;
  white-space: pre;
}

/* ==========================================================================
   DEVELOPER PORTAL & PARAMETERS SPECIFICATION TABLE
   ========================================================================== */
.api-spec-table-container {
  margin-top: 1.5rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  overflow: hidden;
}

.api-spec-header {
  padding: 1rem 1.25rem;
  background: rgba(10, 18, 36, 0.9);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.api-spec-header h4 {
  font-size: 0.9rem;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.api-spec-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}

.api-spec-table th {
  background: rgba(6, 9, 19, 0.8);
  padding: 0.6rem 0.85rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-muted);
  font-weight: 600;
}

.api-spec-table td {
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: top;
}

.api-spec-table tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.param-name-cell {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--cyan-bright);
}

.type-pill {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--purple-ai);
  background: rgba(139, 92, 246, 0.12);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  display: inline-block;
}

.rule-pill {
  font-size: 0.68rem;
  color: var(--emerald-success);
  background: rgba(16, 185, 129, 0.12);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  display: inline-block;
}

.guardrail-pill {
  font-size: 0.68rem;
  color: var(--amber-warn);
  background: rgba(245, 158, 11, 0.12);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  display: inline-block;
}

/* ========================================================================= */
/* HORIZONTAL PRESETS & ADVANCED HYPERPARAMETERS STYLING                    */
/* ========================================================================= */
.preset-grid.horizontal-preset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 0.85rem;
}

.preset-card {
  background: rgba(14, 23, 42, 0.7);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 0.95rem;
  cursor: pointer;
  transition: all 0.22s ease-in-out;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.preset-card:hover {
  transform: translateY(-2px);
  border-color: var(--cyan-bright);
  box-shadow: 0 4px 18px rgba(6, 182, 212, 0.15);
}

.preset-card.active {
  border-color: var(--cyan-bright);
  background: rgba(6, 182, 212, 0.08);
  box-shadow: 0 0 0 1px var(--cyan-bright), 0 4px 16px rgba(6, 182, 212, 0.18);
}

.preset-card-footer {
  margin-top: 0.75rem;
  display: flex;
  justify-content: flex-end;
}

.preset-info-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--cyan-bright);
  padding: 0.22rem 0.55rem;
  font-size: 0.72rem;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.preset-info-btn:hover {
  background: rgba(6, 182, 212, 0.15);
  border-color: var(--cyan-bright);
}

.info-popover-trigger {
  cursor: help;
  font-size: 0.78rem;
  margin-left: 0.25rem;
  opacity: 0.8;
  transition: opacity 0.15s;
}

.info-popover-trigger:hover {
  opacity: 1;
}

/* ========================================================================= */
/* INTERACTIVE DATABASE ADAPTERS & LIVE DIAGNOSTIC DRAWER                    */
/* ========================================================================= */
.interactive-db-card {
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  position: relative;
}

.interactive-db-card:hover {
  border-color: var(--cyan-bright) !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(6, 182, 212, 0.12);
}

.infra-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.5rem;
  gap: 0.5rem;
}

.btn-db-test {
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid rgba(6, 182, 212, 0.35);
  color: var(--cyan-bright);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-db-test:hover {
  background: var(--cyan-bright);
  color: #060913;
}

.db-diagnostic-drawer {
  background: rgba(8, 14, 28, 0.95);
  border: 1px solid rgba(6, 182, 212, 0.4);
  border-radius: 10px;
  padding: 1.1rem;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
  animation: fadeInDown 0.25s ease-out;
}

.db-diag-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 0.6rem;
  margin-bottom: 0.8rem;
}

.btn-close-diag {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 0.85rem;
  cursor: pointer;
}

.btn-close-diag:hover {
  color: var(--text-main);
}

.pulse-indicator {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulse-ring 1.6s infinite cubic-bezier(0.66, 0, 0, 1);
}

@keyframes pulse-ring {
  to {
    box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
  }
}

.db-diag-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.65rem;
}

.diag-metric-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  padding: 0.6rem;
}

.diag-metric-label {
  display: block;
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.diag-metric-val {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--emerald-success);
  margin-top: 0.2rem;
  font-family: var(--font-mono);
}

/* ========================================================================= */
/* GLOSSARY FILTER PILLS & ALPHABET BAR                                      */
/* ========================================================================= */
.glossary-category-pills {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.glossary-cat-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-dim);
  font-size: 0.74rem;
  padding: 0.25rem 0.6rem;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.glossary-cat-btn:hover {
  border-color: var(--cyan-bright);
  color: var(--cyan-bright);
}

.glossary-cat-btn.active {
  background: rgba(6, 182, 212, 0.15);
  border-color: var(--cyan-bright);
  color: var(--cyan-bright);
  font-weight: 600;
}

.glossary-alphabet-bar {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
  padding: 0.4rem 0.6rem;
  background: rgba(10, 16, 30, 0.6);
  border: 1px solid var(--border-color);
  border-radius: 6px;
}

.alpha-btn {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  cursor: pointer;
  color: var(--text-dim);
  transition: all 0.15s;
}

.alpha-btn:hover {
  background: rgba(6, 182, 212, 0.2);
  color: var(--cyan-bright);
}

.alpha-btn.active {
  background: var(--cyan-bright);
  color: #060913;
  font-weight: 700;
}

/* ========================================================================= */
/* CENTERED METHODOLOGY MODAL & CAMERA FOCUS PULSE                           */
/* ========================================================================= */
@keyframes workstationPulseGlow {
  0% {
    box-shadow: 0 0 0 0 rgba(6, 182, 212, 0.4);
    border-color: var(--cyan-bright);
  }
  50% {
    box-shadow: 0 0 25px 4px rgba(6, 182, 212, 0.25);
    border-color: #38bdf8;
  }
  100% {
    box-shadow: 0 0 0 0 rgba(6, 182, 212, 0);
    border-color: rgba(6, 182, 212, 0.3);
  }
}

.workstation-focus-pulse {
  animation: workstationPulseGlow 1.4s ease-out 1;
}

.phase-action-cta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-top: 0.75rem;
}

.cta-inspect-text {
  font-size: 0.75rem;
  color: var(--cyan-bright);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.btn-card-modal-pill {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-muted);
  font-size: 0.68rem;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.btn-card-modal-pill:hover {
  background: rgba(6, 182, 212, 0.2);
  border-color: var(--cyan-bright);
  color: #fff;
  transform: translateY(-1px);
}

.methodology-modal-dialog {
  max-width: 980px;
  width: 94vw;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
}

.mmodal-phase-navbar {
  display: flex;
  gap: 0.35rem;
  overflow-x: auto;
  padding: 0.6rem 0.8rem;
  background: rgba(4, 8, 18, 0.75);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  scrollbar-width: thin;
}

.mmodal-phase-tab {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-dim);
  font-size: 0.73rem;
  padding: 0.3rem 0.65rem;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.mmodal-phase-tab:hover {
  background: rgba(6, 182, 212, 0.12);
  border-color: rgba(6, 182, 212, 0.4);
  color: var(--cyan-bright);
}

.mmodal-phase-tab.active {
  background: rgba(6, 182, 212, 0.22);
  border-color: var(--cyan-bright);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.2);
}

.mmodal-phase-num {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  background: rgba(255, 255, 255, 0.1);
  padding: 0.05rem 0.25rem;
  border-radius: 3px;
  color: var(--cyan-bright);
}

.mmodal-dim-navbar {
  margin: 0;
  padding: 0.6rem 0.8rem;
  background: rgba(8, 14, 28, 0.6);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.mmodal-content-box {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
  background: rgba(4, 7, 16, 0.4);
}

/* ========================================================================= */
/* HIGH-FIDELITY MATHEMATICAL FORMULA VISUALIZATION (KaTeX Ready)            */
/* ========================================================================= */
.math-formula-container {
  background: linear-gradient(145deg, rgba(8, 14, 28, 0.8), rgba(4, 7, 16, 0.95));
  border: 1px solid rgba(6, 182, 212, 0.3);
  border-radius: 10px;
  padding: 1.25rem;
  position: relative;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

.math-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--cyan-bright);
  margin-bottom: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.math-equation-display {
  background: #020612;
  border: 1px solid rgba(6, 182, 212, 0.25);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin: 0.75rem 0;
  color: #f8fafc;
  overflow-x: auto;
  font-size: 1.05rem;
  line-height: 1.8;
  text-align: center;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.6);
}

/* Ensure KaTeX display equations look crisp and high-contrast */
.math-equation-display .katex-display {
  margin: 0.4em 0;
}

.math-equation-display .katex {
  font-size: 1.15em;
  color: #e0f2fe;
}

.math-action-bar {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.5rem;
  margin-bottom: 0.75rem;
}

.btn-copy-latex {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-dim);
  font-size: 0.72rem;
  padding: 0.25rem 0.6rem;
  border-radius: 5px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: all 0.15s ease;
}

.btn-copy-latex:hover {
  background: rgba(6, 182, 212, 0.15);
  border-color: var(--cyan-bright);
  color: var(--cyan-bright);
}

/* Variable dictionary table */
.math-vars-section {
  margin-top: 1rem;
}

.math-section-subtitle {
  font-size: 0.8rem;
  font-weight: 700;
  color: #38bdf8;
  margin-bottom: 0.45rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.math-vars-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
  background: rgba(6, 11, 24, 0.5);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 1rem;
}

.math-vars-table th {
  background: rgba(14, 23, 42, 0.8);
  color: var(--cyan-bright);
  text-align: left;
  padding: 0.45rem 0.7rem;
  font-weight: 600;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.math-vars-table td {
  padding: 0.45rem 0.7rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: #e2e8f0;
  vertical-align: top;
}

.math-vars-table tr:last-child td {
  border-bottom: none;
}

.math-vars-table td.var-symbol {
  font-family: var(--font-mono);
  color: #fbbf24;
  white-space: nowrap;
  font-weight: 600;
}

/* Step-by-step derivation steps */
.math-steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.math-step-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 6px;
  padding: 0.75rem;
}

.math-step-header {
  font-size: 0.76rem;
  font-weight: 700;
  color: #a7f3d0;
  margin-bottom: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.math-step-desc {
  font-size: 0.76rem;
  color: #cbd5e1;
  line-height: 1.5;
  margin: 0;
}

/* Interactive Math Sandbox Mini-tool */
.math-sandbox-box {
  background: rgba(3, 7, 18, 0.8);
  border: 1px dashed rgba(6, 182, 212, 0.4);
  border-radius: 8px;
  padding: 0.85rem 1rem;
  margin-top: 1rem;
}

.math-sandbox-header {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--cyan-bright);
  margin-bottom: 0.6rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.math-sandbox-controls {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

.math-sandbox-control-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.76rem;
  color: var(--text-dim);
}

.math-sandbox-input {
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  border-radius: 4px;
  padding: 0.2rem 0.4rem;
  font-size: 0.78rem;
  width: 90px;
  font-family: var(--font-mono);
}

.math-sandbox-result {
  background: rgba(6, 182, 212, 0.15);
  border: 1px solid rgba(6, 182, 212, 0.3);
  border-radius: 4px;
  padding: 0.25rem 0.6rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: #a5f3fc;
  font-family: var(--font-mono);
}

/* ========================================================================= */
/* SUBTLE PHASE STEPPER BUTTONS & WORKSTATION NAVIGATION                     */
/* ========================================================================= */
.phase-nav-step-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
  flex-wrap: wrap;
}

.btn-subtle-phase-nav {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.6rem;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-dim, #cbd5e1);
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.btn-subtle-phase-nav:hover {
  color: var(--cyan-bright, #06b6d4);
  border-color: rgba(6, 182, 212, 0.4);
  background: rgba(6, 182, 212, 0.08);
  transform: translateY(-1px);
}

.btn-subtle-phase-nav:active {
  transform: translateY(0) scale(0.98);
}

.phase-step-indicator {
  font-size: 0.72rem;
  font-weight: 700;
  font-family: var(--font-mono, monospace);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
}

.mmodal-phase-controls-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.45rem 1rem;
  background: rgba(3, 7, 18, 0.5);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

/* ========================================================================= */
/* TACTILE SIMULATION CONTROLS (PILLS, STEPPERS, PRESETS)                    */
/* ========================================================================= */
.sim-pill-group {
  display: flex;
  gap: 0.35rem;
  margin-top: 0.35rem;
}

.sim-pill-btn {
  flex: 1;
  padding: 0.4rem 0.5rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.sim-pill-btn:hover {
  border-color: rgba(6, 182, 212, 0.4);
  color: #e2e8f0;
}

.sim-pill-btn.active {
  background: rgba(6, 182, 212, 0.18);
  border-color: var(--cyan-bright, #06b6d4);
  color: #fff;
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.25);
}

.sim-stepper-control {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.35rem;
}

.sim-stepper-btn {
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #cbd5e1;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sim-stepper-btn:hover {
  background: rgba(6, 182, 212, 0.15);
  border-color: var(--cyan-bright, #06b6d4);
  color: #fff;
}

.sim-stepper-value {
  flex: 1;
  text-align: center;
  font-family: var(--font-mono, monospace);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--cyan-bright, #06b6d4);
  padding: 0.35rem 0.5rem;
  background: rgba(3, 7, 18, 0.8);
  border-radius: 6px;
  border: 1px solid rgba(6, 182, 212, 0.3);
}

.sim-presets-row {
  display: flex;
  gap: 0.3rem;
  margin-top: 0.4rem;
}

.sim-preset-btn {
  flex: 1;
  padding: 0.22rem 0.35rem;
  font-size: 0.72rem;
  font-family: var(--font-mono, monospace);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.sim-preset-btn:hover {
  border-color: rgba(6, 182, 212, 0.3);
  color: #e2e8f0;
}

.sim-preset-btn.active {
  background: rgba(6, 182, 212, 0.15);
  border-color: var(--cyan-bright, #06b6d4);
  color: #fff;
}

/* ========================================================================= */
/* INTERACTIVE & CLICKABLE KPI CARDS                                         */
/* ========================================================================= */
.interactive-kpi-card,
.clickable-kpi-card {
  cursor: pointer;
  position: relative;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

.interactive-kpi-card:hover,
.clickable-kpi-card:hover {
  border-color: var(--cyan-bright, #06b6d4) !important;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(6, 182, 212, 0.18);
}

.kpi-card-header-mini {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.info-icon-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  font-size: 0.68rem;
  color: var(--cyan-bright, #06b6d4);
  background: rgba(6, 182, 212, 0.15);
  border: 1px solid rgba(6, 182, 212, 0.3);
  opacity: 0.8;
  transition: all 0.2s ease;
}

.interactive-kpi-card:hover .info-icon-badge,
.clickable-kpi-card:hover .info-icon-badge {
  opacity: 1;
  background: var(--cyan-bright, #06b6d4);
  color: #030712;
}

/* ========================================================================= */
/* COMPACT PROPORTIONAL DIALOG (MATHEMATICAL DEDUCTION MODAL)                */
/* ========================================================================= */
.compact-proportional-dialog {
  max-width: 680px;
  width: 92%;
  border-radius: 12px;
  background: rgba(11, 23, 39, 0.97) !important;
  border: 1px solid rgba(6, 182, 212, 0.35) !important;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 30px rgba(6, 182, 212, 0.15) !important;
  backdrop-filter: blur(16px);
}

.cp-modal-body {
  padding: 1.25rem 1.5rem;
  max-height: 72vh;
  overflow-y: auto;
}

.cp-formula-card {
  background: rgba(3, 7, 18, 0.85);
  border: 1px solid rgba(6, 182, 212, 0.3);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin: 0.75rem 0;
  text-align: center;
}

.cp-formula-math {
  font-size: 1.15rem;
  color: #38bdf8;
  padding: 0.5rem 0;
  overflow-x: auto;
}

.cp-code-snippet {
  background: #030712;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 0.65rem 0.85rem;
  font-family: var(--font-mono, monospace);
  font-size: 0.78rem;
  color: #a5f3fc;
  overflow-x: auto;
  margin-top: 0.5rem;
}

.cp-section-block {
  margin-bottom: 1rem;
  padding: 0.75rem 0.9rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  border-left: 3px solid var(--cyan-bright, #06b6d4);
}

.cp-section-block h4 {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--cyan-bright, #06b6d4);
  margin: 0 0 0.4rem 0;
}

.cp-section-block p {
  font-size: 0.84rem;
  line-height: 1.55;
  color: #cbd5e1;
  margin: 0;
}

/* ========================================================================= */
/* WORM SIMULATION RUNS HISTORY TABLE                                        */
/* ========================================================================= */
.sim-history-table {
  width: 100%;
  font-size: 0.78rem;
}

.sim-history-table th {
  background: rgba(15, 23, 42, 0.9);
  padding: 0.5rem 0.6rem;
  color: #94a3b8;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sim-history-table td {
  padding: 0.45rem 0.6rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: #cbd5e1;
}

.sim-hash-cell {
  font-family: var(--font-mono, monospace);
  font-size: 0.72rem;
  color: var(--cyan-bright, #06b6d4);
  background: rgba(6, 182, 212, 0.08);
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
  border: 1px solid rgba(6, 182, 212, 0.2);
}

.sim-block-badge {
  font-family: var(--font-mono, monospace);
  font-size: 0.72rem;
  font-weight: 700;
  color: #10b981;
  background: rgba(16, 185, 129, 0.12);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.clickable-row {
  cursor: pointer;
  transition: background 0.15s ease;
}

.clickable-row:hover {
  background: rgba(6, 182, 212, 0.1) !important;
}

/* ========================================================================= */
/* V1.0.0 SECURITY HUD, IAM MODAL & DATA PLATFORM ENHANCEMENTS                 */
/* ========================================================================= */

.btn-security-hud {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(14, 165, 233, 0.15);
  border: 1px solid rgba(14, 165, 233, 0.35);
  color: #38bdf8;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.8rem;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
}

.btn-security-hud:hover {
  background: rgba(14, 165, 233, 0.28);
  border-color: #38bdf8;
  box-shadow: 0 0 12px rgba(14, 165, 233, 0.4);
}

.role-pill {
  background: rgba(139, 92, 246, 0.15);
  border: 1px solid rgba(139, 92, 246, 0.35);
  color: #c084fc;
  font-family: var(--font-mono, monospace);
  font-size: 0.76rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 9999px;
}

.worm-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #34d399;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.worm-badge:hover {
  background: rgba(16, 185, 129, 0.22);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.35);
}

/* Quality Gate Cards Grid */
.data-gate-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.data-gate-card {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 1rem;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.data-gate-card:hover {
  transform: translateY(-2px);
  border-color: rgba(6, 182, 212, 0.3);
}

.data-gate-card.passed {
  border-left: 4px solid #10b981;
}

.data-gate-card.failed {
  border-left: 4px solid #f43f5e;
}

.gate-badge-status {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  display: inline-block;
  margin-bottom: 0.5rem;
}

.gate-badge-status.pass {
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.gate-badge-status.fail {
  background: rgba(244, 63, 94, 0.2);
  color: #f43f5e;
  border: 1px solid rgba(244, 63, 94, 0.4);
}

.gate-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #f8fafc;
  margin-bottom: 0.35rem;
}

.gate-desc {
  font-size: 0.76rem;
  color: #94a3b8;
  line-height: 1.45;
}

.gate-score-pill {
  font-family: var(--font-mono, monospace);
  font-size: 0.78rem;
  color: #38bdf8;
  margin-top: 0.6rem;
  display: block;
}

/* Auth / IAM Modal */
.auth-iam-dialog {
  max-width: 820px;
  width: 95%;
  background: #090e1a;
  border: 1px solid rgba(14, 165, 233, 0.35);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.7), 0 0 30px rgba(14, 165, 233, 0.2);
  border-radius: 12px;
}

.auth-tabs-nav {
  display: flex;
  gap: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.75rem 1.5rem 0 1.5rem;
  background: rgba(15, 23, 42, 0.5);
  overflow-x: auto;
}

.auth-tab-btn {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: #94a3b8;
  padding: 0.6rem 0.9rem;
  font-size: 0.82rem;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.auth-tab-btn:hover {
  color: #f8fafc;
}

.auth-tab-btn.active {
  color: #38bdf8;
  border-bottom-color: #38bdf8;
  font-weight: 600;
}

.auth-tab-content {
  display: none;
  padding: 1.5rem;
}

.auth-tab-content.active {
  display: block;
}

.auth-input-group {
  margin-bottom: 1rem;
}

.auth-input-group label {
  display: block;
  font-size: 0.8rem;
  color: #cbd5e1;
  margin-bottom: 0.35rem;
  font-weight: 500;
}

.auth-input-group input, .auth-input-group select {
  width: 100%;
  padding: 0.55rem 0.85rem;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  color: #f8fafc;
  font-size: 0.85rem;
  transition: border-color 0.15s ease;
}

.auth-input-group input:focus, .auth-input-group select:focus {
  outline: none;
  border-color: #38bdf8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.25);
}

.auth-notice-box {
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 6px;
  padding: 0.75rem 1rem;
  font-size: 0.78rem;
  color: #93c5fd;
  margin-bottom: 1rem;
  line-height: 1.45;
}

.auth-notice-box.warning {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.3);
  color: #fde68a;
}

.token-viewer-pre {
  background: rgba(5, 8, 16, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 0.75rem;
  font-family: var(--font-mono, monospace);
  font-size: 0.74rem;
  color: #a5f3fc;
  max-height: 160px;
  overflow-y: auto;
  word-break: break-all;
  white-space: pre-wrap;
}

.rbac-roles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 0.6rem;
  margin: 1rem 0;
}

.rbac-role-card {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 0.65rem 0.8rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.rbac-role-card:hover {
  background: rgba(23, 37, 68, 0.9);
  border-color: #38bdf8;
}

.rbac-role-card.selected {
  border-color: #38bdf8;
  background: rgba(14, 165, 233, 0.12);
  box-shadow: 0 0 12px rgba(14, 165, 233, 0.25);
}

.rbac-role-name {
  font-weight: 700;
  font-size: 0.82rem;
  color: #f8fafc;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.rbac-role-badge {
  font-size: 0.68rem;
  color: #38bdf8;
  font-family: var(--font-mono, monospace);
}

.rbac-perms-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.75rem;
  max-height: 220px;
  overflow-y: auto;
  padding: 0.5rem;
  background: rgba(5, 8, 16, 0.6);
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.rbac-perm-tag {
  font-family: var(--font-mono, monospace);
  font-size: 0.72rem;
  padding: 0.2rem 0.45rem;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
  color: #7dd3fc;
  border-radius: 4px;
}

.worm-result-card {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 8px;
  padding: 1rem;
  margin-top: 1rem;
}

.worm-result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.worm-hash-line {
  font-family: var(--font-mono, monospace);
  font-size: 0.75rem;
  color: #a7f3d0;
  word-break: break-all;
  margin-top: 0.25rem;
}

/* =========================================================================
   PORTOPS-AI v1.0 MODERN OCEANIC ENHANCEMENTS (COT, PRESETS, ELEVATION)
   ========================================================================= */
.btn-flutter-switch:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 0 20px rgba(0, 229, 255, 0.7) !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.cot-step-card {
  transition: all 0.25s ease-in-out;
}

.cot-step-card:hover {
  background: rgba(0, 229, 255, 0.04) !important;
  border-color: rgba(0, 229, 255, 0.35) !important;
  transform: translateX(4px);
}

.btn-preset-pill {
  background: rgba(15, 23, 42, 0.9);
  color: #F8FAFC;
  border: 1px solid rgba(0, 229, 255, 0.3);
  border-radius: 20px;
  padding: 0.35rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-preset-pill:hover {
  background: rgba(0, 229, 255, 0.2);
  border-color: #00E5FF;
  color: #00E5FF;
  transform: translateY(-1px);
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 20px rgba(0, 229, 255, 0.5);
  transition: all 0.2s ease;
}

.tab-btn:hover {
  color: #00E5FF;
  border-color: rgba(0, 229, 255, 0.3);
  transition: all 0.2s ease;
}

/* =========================================================================
   PORTOPS-AI v1.0.0 RESIDUALS, KPI GRIDS, FIRST-RUN MODAL & ANALYSIS BOX
   ========================================================================= */

/* Diagnostics Dashboard Layout: Equal spacious 2-column layout */
#tab-diagnostics .dashboard-grid {
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 1.5rem;
}

@media (max-width: 1100px) {
  #tab-diagnostics .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

/* Universal KPI Grid & Cards */
.kpi-grid {
  display: grid;
  gap: 0.75rem;
}

.kpi-card {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
  border-radius: 8px;
  padding: 0.75rem;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.kpi-card.mini {
  padding: 0.65rem 0.8rem;
}

.clickable-kpi-card {
  cursor: pointer;
  border-color: rgba(6, 182, 212, 0.3);
  background: rgba(10, 20, 38, 0.7);
  user-select: none;
}

.clickable-kpi-card:hover {
  transform: translateY(-2px);
  border-color: #00E5FF;
  box-shadow: 0 4px 18px rgba(0, 229, 255, 0.25);
  background: rgba(14, 28, 54, 0.85);
}

.clickable-kpi-card:active {
  transform: translateY(0);
}

.kpi-card-header-mini {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.25rem;
}

.kpi-title {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  color: #94A3B8;
  letter-spacing: 0.03em;
}

.info-icon-badge {
  font-size: 0.72rem;
  color: #00E5FF;
  opacity: 0.8;
}

.kpi-value {
  font-size: 1.15rem;
  font-weight: 700;
  color: #F8FAFC;
  line-height: 1.25;
}

.kpi-sub {
  font-size: 0.74rem;
  color: var(--text-dim);
  margin-top: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 768px) {
  .kpi-grid[style*="repeat(4"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* Algorithm Bar-Click Analysis Box */
#algo-chart-analysis-box {
  animation: fadeIn 0.25s ease-out;
  transition: all 0.2s ease;
}

/* First-Run Setup Modal Styling */
#first-run-setup-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 10000;
  justify-content: center;
  align-items: center;
  padding: 1.5rem;
}

#first-run-setup-modal.open {
  display: flex !important;
}

#first-run-setup-modal .modal-dialog {
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* KaTeX and Math Formula Rendering Polish */
.cp-formula-math {
  font-size: 1.15rem;
  color: #38BDF8;
  padding: 0.5rem 0;
  overflow-x: auto;
  text-align: center;
}

.cp-formula-math .katex-display {
  margin: 0.5em 0 !important;
}

/* ==========================================================================
   Expansive First-Run Wizard & Modern Form Controls
   ========================================================================== */
#first-run-setup-modal .modal-dialog {
  max-width: 1420px !important;
  width: 96vw !important;
  min-height: 84vh !important;
  max-height: 94vh !important;
  display: flex !important;
  flex-direction: column !important;
  border-radius: 18px;
  background: linear-gradient(150deg, #090e1d 0%, #030712 100%) !important;
  border: 1px solid rgba(0, 229, 255, 0.45) !important;
  box-shadow: 0 30px 80px -15px rgba(0, 0, 0, 0.9), 0 0 50px rgba(0, 229, 255, 0.22) !important;
  overflow: hidden;
  animation: slideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.fr-nav-tabs {
  display: flex !important;
  flex-wrap: nowrap !important;
  overflow-x: auto !important;
  gap: 0.75rem !important;
  align-items: center !important;
  background: rgba(10, 18, 36, 0.95) !important;
  padding: 0.75rem 1.75rem !important;
  border-bottom: 1px solid rgba(0, 229, 255, 0.25) !important;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 229, 255, 0.4) transparent;
}

.fr-nav-tabs::-webkit-scrollbar {
  height: 6px;
}
.fr-nav-tabs::-webkit-scrollbar-thumb {
  background: rgba(0, 229, 255, 0.3);
  border-radius: 4px;
}

.fr-nav-tab {
  all: unset !important;
  box-sizing: border-box !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.6rem !important;
  padding: 0.65rem 1.35rem !important;
  border-radius: 9px !important;
  font-family: var(--font-sans) !important;
  font-size: 0.88rem !important;
  font-weight: 600 !important;
  color: #94A3B8 !important;
  background: rgba(15, 23, 42, 0.75) !important;
  border: 1px solid rgba(0, 229, 255, 0.18) !important;
  cursor: pointer !important;
  white-space: nowrap !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
  flex-shrink: 0 !important;
  user-select: none !important;
  -webkit-user-select: none !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3) !important;
}

.fr-nav-tab:hover {
  background: rgba(0, 229, 255, 0.12) !important;
  color: #F1F5F9 !important;
  border-color: rgba(0, 229, 255, 0.5) !important;
  box-shadow: 0 4px 14px rgba(0, 229, 255, 0.18) !important;
  transform: translateY(-1px) !important;
}

.fr-nav-tab.active {
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.35) 0%, rgba(0, 229, 255, 0.25) 100%) !important;
  color: #00E5FF !important;
  border-color: #00E5FF !important;
  box-shadow: 0 0 18px rgba(0, 229, 255, 0.35), inset 0 0 10px rgba(0, 229, 255, 0.12) !important;
  font-weight: 700 !important;
}

.fr-nav-tab.completed {
  color: #34D399 !important;
  border-color: rgba(52, 211, 153, 0.5) !important;
}

#btn-close-firstrun-top {
  all: unset !important;
  box-sizing: border-box !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 38px !important;
  height: 38px !important;
  border-radius: 50% !important;
  background: rgba(15, 23, 42, 0.8) !important;
  border: 1px solid rgba(148, 163, 184, 0.28) !important;
  color: #94A3B8 !important;
  font-size: 1.5rem !important;
  line-height: 1 !important;
  cursor: pointer !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
  user-select: none !important;
}

#btn-close-firstrun-top:hover {
  background: rgba(239, 68, 68, 0.2) !important;
  border-color: rgba(239, 68, 68, 0.6) !important;
  color: #EF4444 !important;
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.35) !important;
  transform: scale(1.06) !important;
}

#btn-close-firstrun-top:active {
  transform: scale(0.95) !important;
}

.fr-admin-card {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 1.2rem 1.4rem;
  margin-bottom: 1.1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.fr-admin-card:hover {
  border-color: rgba(0, 229, 255, 0.35);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.fr-admin-grid-inputs {
  display: grid;
  grid-template-columns: 1fr 1.3fr 1.2fr;
  gap: 1rem;
  align-items: end;
  margin-top: 0.75rem;
}

@media (max-width: 860px) {
  .fr-admin-grid-inputs {
    grid-template-columns: 1fr;
  }
}

.fr-role-chip {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  font-size: 0.72rem;
  font-family: var(--font-mono);
  font-weight: 600;
  letter-spacing: 0.5px;
}

.fr-infra-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.1rem;
  margin-bottom: 1.5rem;
}

.fr-infra-card {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 1.1rem 1.3rem;
  transition: all 0.2s ease;
}

.fr-infra-card.healthy {
  border-color: rgba(52, 211, 153, 0.5);
  background: rgba(16, 185, 129, 0.05);
}

.fr-crud-table-container {
  overflow-x: auto;
  border-radius: 10px;
  border: 1px solid rgba(0, 229, 255, 0.25);
  background: rgba(11, 19, 38, 0.6);
  margin-bottom: 1.25rem;
}

.fr-crud-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  text-align: left;
}

.fr-crud-table th {
  background: rgba(15, 23, 42, 0.95);
  color: #00E5FF;
  padding: 0.75rem 1rem;
  font-weight: 700;
  border-bottom: 1px solid rgba(0, 229, 255, 0.3);
}

.fr-crud-table td {
  padding: 0.7rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  color: #E2E8F0;
}

.fr-crud-table tr:hover td {
  background: rgba(0, 229, 255, 0.04);
}

.fr-split-layout {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 1.5rem;
}

@media (max-width: 768px) {
  .fr-split-layout {
    grid-template-columns: 1fr;
  }
}

.fr-briefing-panel {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 1.25rem;
}

.fr-briefing-item {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.fr-briefing-icon {
  font-size: 1.3rem;
  line-height: 1;
}

.fr-briefing-text h4 {
  font-size: 0.88rem;
  color: #F8FAFC;
  margin: 0 0 0.2rem 0;
}

.fr-briefing-text p {
  font-size: 0.78rem;
  color: #94A3B8;
  margin: 0;
  line-height: 1.4;
}

.password-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.password-input-wrapper input {
  width: 100%;
  padding-right: 2.6rem !important;
}

.btn-toggle-eye {
  position: absolute;
  right: 0.5rem;
  background: transparent;
  border: none;
  cursor: pointer;
  color: #94A3B8;
  font-size: 1.1rem;
  padding: 0.25rem;
  line-height: 1;
  transition: color 0.2s ease, transform 0.1s ease;
  user-select: none;
}

.btn-toggle-eye:hover {
  color: #00E5FF;
  transform: scale(1.1);
}

.paste-warning-box {
  margin-top: 0.4rem;
  padding: 0.45rem 0.75rem;
  background: rgba(239, 68, 68, 0.15);
  border-left: 3px solid #EF4444;
  border-radius: 4px;
  color: #FCA5A5;
  font-size: 0.78rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  animation: fadeIn 0.2s ease;
}

.portops-toast-host {
  position: fixed;
  z-index: 100000;
  top: 1rem;
  right: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: min(420px, calc(100vw - 2rem));
  pointer-events: none;
}

.portops-toast {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.85rem;
  align-items: flex-start;
  padding: 0.95rem 1rem;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(8, 19, 36, 0.98), rgba(12, 30, 54, 0.96));
  border: 1px solid rgba(0, 229, 255, 0.36);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.42), 0 0 28px rgba(0, 229, 255, 0.12);
  color: var(--text-main);
  backdrop-filter: blur(14px);
  pointer-events: auto;
  animation: toastSlideIn 0.18s ease-out;
}

.portops-toast-warning {
  border-color: rgba(245, 158, 11, 0.55);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.42), 0 0 28px rgba(245, 158, 11, 0.16);
}

.portops-toast-error {
  border-color: rgba(239, 68, 68, 0.6);
}

.portops-toast-success {
  border-color: rgba(16, 185, 129, 0.58);
}

.portops-toast-icon {
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(0, 229, 255, 0.14);
  color: var(--cyan-bright);
  font-weight: 900;
}

.portops-toast-body strong {
  display: block;
  color: var(--cyan-bright);
  font-size: 0.92rem;
  margin-bottom: 0.2rem;
}

.portops-toast-body p {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.45;
  font-size: 0.84rem;
}

.portops-toast-close {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.portops-toast-close:hover {
  color: var(--cyan-bright);
}

.portops-toast.closing {
  opacity: 0;
  transform: translateX(1rem);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

@keyframes toastSlideIn {
  from { opacity: 0; transform: translateX(1rem); }
  to { opacity: 1; transform: translateX(0); }
}

.password-match-indicator {
  margin-top: 0.35rem;
  font-size: 0.8rem;
  transition: all 0.2s ease;
}

.admin-lock-card {
  background: rgba(15, 23, 42, 0.85);
  border: 1px dashed rgba(245, 158, 11, 0.45);
  border-radius: 12px;
  padding: 2.5rem 2rem;
  text-align: center;
  max-width: 640px;
  margin: 2.5rem auto;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
}

.admin-lock-card .lock-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
}

.admin-lock-card h3 {
  color: #F59E0B;
  font-size: 1.25rem;
  margin: 0 0 0.5rem 0;
}

.admin-lock-card p {
  color: #94A3B8;
  font-size: 0.86rem;
  line-height: 1.5;
  margin: 0 0 1.25rem 0;
}


.interactive-nav-badge { cursor: pointer; }
.interactive-nav-badge:focus-visible, .iso-item:focus-visible, .capability-card:focus-visible { outline: 2px solid var(--cyan-bright); outline-offset: 3px; }
.theme-selector-group { min-height: 42px; }
.theme-select { min-height: 34px; border-radius: 9px; padding: .35rem 2rem .35rem .65rem !important; color: var(--text-main) !important; background: rgba(10,24,45,.92) !important; border: 1px solid rgba(0,229,255,.38) !important; color-scheme: dark; }
.theme-select:focus { outline: 2px solid var(--cyan-bright); outline-offset: 2px; }
.modal-audit-btn { margin-right: auto; }
.btn-security-hud { min-height: 42px; padding: .55rem .8rem !important; border-radius: 12px !important; border: 1px solid rgba(0,229,255,.38) !important; background: linear-gradient(135deg, rgba(0,229,255,.14), rgba(12,25,50,.92)) !important; color: var(--cyan-bright) !important; }
.btn-security-hud:hover, .btn-gear:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(0,229,255,.18); }
.hero-subtitle { color: #cbd5e1; max-width: 78ch; line-height: 1.7; }
.hero-badge-row .interactive-nav-badge { transition: transform .18s ease, border-color .18s ease, background .18s ease; }
.hero-badge-row .interactive-nav-badge:hover { transform: translateY(-2px); border-color: var(--cyan-bright); }
@media (max-width: 700px) { .tabs-nav { margin-inline: .5rem; } .capability-card { padding: 1.1rem; } .cap-metric { font-size: .72rem; max-width: 52%; } }

.markdown-output { line-height: 1.65; overflow-wrap: anywhere; }
.markdown-output > :first-child { margin-top: 0; }
.markdown-output > :last-child { margin-bottom: 0; }
.markdown-output h1, .markdown-output h2, .markdown-output h3, .markdown-output h4 { color: var(--cyan-bright); margin: 1rem 0 .5rem; line-height: 1.3; }
.markdown-output p { margin: .45rem 0; }
.markdown-output ul, .markdown-output ol { margin: .45rem 0 .75rem 1.35rem; padding: 0; }
.markdown-output li { margin: .3rem 0; }
.markdown-output code { font-family: var(--font-mono); background: rgba(15, 23, 42, .72); border: 1px solid var(--border-color); border-radius: 4px; padding: .08rem .3rem; }
.markdown-output pre { overflow: auto; padding: .8rem; border-radius: 8px; background: rgba(2, 8, 23, .88); border: 1px solid var(--border-color); }
.markdown-output pre code { border: 0; padding: 0; background: transparent; }
.markdown-output a { color: var(--cyan-bright); text-decoration-thickness: .08em; text-underline-offset: .18em; }

/* ==========================================================================
   CONVERSATIONAL CHAT THREAD & COT ASSISTANT
   ========================================================================== */
.cot-chat-thread {
  min-height: 380px;
  max-height: 540px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  padding: 1.25rem;
  background: rgba(3, 7, 18, 0.75);
  border: 1px solid rgba(0, 229, 255, 0.25);
  border-radius: 10px;
  box-shadow: inset 0 2px 12px rgba(0, 0, 0, 0.5);
  scroll-behavior: smooth;
}

.chat-bubble {
  max-width: 88%;
  animation: fadeInMsg 0.25s ease-out;
}

@keyframes fadeInMsg {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.chat-bubble.user-bubble {
  align-self: flex-end;
  background: linear-gradient(135deg, rgba(0, 119, 182, 0.45) 0%, rgba(2, 132, 199, 0.35) 100%);
  border: 1px solid rgba(0, 229, 255, 0.4);
  border-radius: 14px 14px 3px 14px;
  padding: 0.85rem 1.15rem;
  color: #F8FAFC;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.chat-bubble.assistant-bubble {
  align-self: flex-start;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(0, 245, 212, 0.35);
  border-radius: 14px 14px 14px 3px;
  padding: 1.1rem 1.35rem;
  color: #E2E8F0;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4);
}

.chat-bubble-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.65rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.78rem;
}

.chat-bubble-author {
  font-weight: 700;
  color: #00F5D4;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.chat-bubble-meta {
  color: #94A3B8;
  font-family: var(--font-mono);
  font-size: 0.72rem;
}

.cot-accordion-btn {
  background: rgba(0, 229, 255, 0.08);
  border: 1px solid rgba(0, 229, 255, 0.3);
  color: #00E5FF;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  font-size: 0.76rem;
  cursor: pointer;
  margin-top: 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.2s ease;
}

.cot-accordion-btn:hover {
  background: rgba(0, 229, 255, 0.18);
  border-color: #00E5FF;
}

.cot-accordion-body {
  margin-top: 0.65rem;
  padding: 0.75rem;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* ========================================================================== */
/* ADVANCED CARD HOVER & INTERACTIVE METADATA DISPLAY SYSTEM                  */
/* ========================================================================== */
.card-hover-preview {
  margin-top: 0.85rem;
  padding: 0.75rem 0.9rem;
  border-radius: 8px;
  background: rgba(8, 16, 36, 0.88);
  border: 1px solid rgba(0, 229, 255, 0.25);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: inset 0 0 12px rgba(0, 229, 255, 0.04);
}

.capability-card:hover .card-hover-preview,
.algo-stat-card:hover .card-hover-preview,
.interactive-audit-card:hover .card-hover-preview {
  border-color: rgba(0, 229, 255, 0.65);
  background: rgba(12, 24, 52, 0.95);
  box-shadow: 0 4px 18px rgba(0, 229, 255, 0.16), inset 0 0 16px rgba(0, 229, 255, 0.08);
  transform: translateY(-2px);
}

.card-hover-badge {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: #00E5FF;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  text-transform: uppercase;
}

.card-hover-desc {
  font-size: 0.8rem;
  color: #E2E8F0;
  line-height: 1.45;
  margin: 0;
}

.card-hover-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.35rem;
}

.hover-tag {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  background: rgba(0, 229, 255, 0.12);
  color: #38BDF8;
  border: 1px solid rgba(0, 229, 255, 0.25);
  font-family: var(--font-mono, monospace);
  white-space: nowrap;
}

/* Enhanced hover states for all interactive card components */
.capability-card:hover {
  transform: translateY(-5px) scale(1.008);
  border-color: rgba(0, 229, 255, 0.6);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5), 0 0 25px rgba(0, 229, 255, 0.18);
}

.algo-stat-card {
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.algo-stat-card:hover {
  transform: translateY(-4px) scale(1.015);
  border-color: rgba(0, 229, 255, 0.6);
  background: rgba(18, 30, 56, 0.95);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5), 0 0 20px rgba(0, 229, 255, 0.15);
}

.algo-stat-card.champion:hover {
  border-color: #00F5D4;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55), 0 0 28px rgba(0, 245, 212, 0.25);
}

.kpi-card.clickable-kpi-card:hover,
.kpi-card.interactive-kpi-card:hover {
  transform: translateY(-3px);
  border-color: rgba(0, 229, 255, 0.5);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 0 15px rgba(0, 229, 255, 0.12);
  cursor: pointer;
}

.preset-card:hover {
  transform: translateY(-3px);
  border-color: rgba(0, 229, 255, 0.55);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4), 0 0 18px rgba(0, 229, 255, 0.14);
}

.interactive-audit-card:hover {
  transform: translateY(-3px);
  border-color: rgba(52, 211, 153, 0.6) !important;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.4), 0 0 18px rgba(52, 211, 153, 0.15);
}

.method-phase-card:hover {
  transform: translateY(-4px);
  border-color: rgba(0, 229, 255, 0.6);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5), 0 0 22px rgba(0, 229, 255, 0.16);
}

.cot-step-card:hover {
  transform: translateY(-2px);
  border-color: rgba(0, 229, 255, 0.45) !important;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35), 0 0 14px rgba(0, 229, 255, 0.1);
}

.iso-item:hover {
  transform: translateY(-2px);
  border-color: rgba(0, 229, 255, 0.5) !important;
  box-shadow: 0 6px 18px rgba(0, 229, 255, 0.12);
  cursor: pointer;
}

/* Universal Floating Cyber Popover for Rich Tooltips on Hover */
.card-hover-popover {
  position: fixed;
  z-index: 99999;
  max-width: 340px;
  background: rgba(6, 12, 28, 0.96);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(0, 229, 255, 0.45);
  border-radius: 10px;
  padding: 0.85rem 1.1rem;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.7), 0 0 25px rgba(0, 229, 255, 0.22);
  pointer-events: none;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.card-hover-popover.active {
  opacity: 1;
  transform: translateY(0);
}

.popover-badge {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.7px;
  color: #00E5FF;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  text-transform: uppercase;
}

.popover-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: #F8FAFC;
  margin: 0;
}

.popover-body {
  font-size: 0.8rem;
  color: #CBD5E1;
  line-height: 1.45;
  margin: 0;
}

.popover-tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.25rem;
}

.popover-tag {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  background: rgba(0, 229, 255, 0.12);
  color: #38BDF8;
  border: 1px solid rgba(0, 229, 255, 0.25);
  font-family: var(--font-mono, monospace);
}

.popover-action-hint {
  font-size: 0.72rem;
  color: #94A3B8;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.2rem;
  font-style: italic;
}

/* ==========================================================================
   SKELETON LOADING & SHIMMER SYSTEM (WCAG AA & TACTILE INDUSTRIAL UI)
   Rounded symmetrical solid blocks representing architecture pre-load state
   ========================================================================== */

@keyframes skeleton-shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

@keyframes skeleton-pulse {
  0%, 100% {
    opacity: 0.65;
  }
  50% {
    opacity: 0.95;
  }
}

.skeleton-box {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.04) 0%,
    rgba(6, 182, 212, 0.12) 50%,
    rgba(255, 255, 255, 0.04) 100%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  border-radius: 8px;
  display: block;
  user-select: none;
  pointer-events: none;
}

.skeleton-pill {
  height: 24px;
  width: 90px;
  border-radius: 12px;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.05) 0%,
    rgba(56, 189, 248, 0.16) 50%,
    rgba(255, 255, 255, 0.05) 100%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  display: inline-block;
  user-select: none;
  pointer-events: none;
}

.skeleton-text {
  height: 14px;
  border-radius: 6px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.12) 50%, rgba(255, 255, 255, 0.04) 100%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  margin-bottom: 8px;
  user-select: none;
  pointer-events: none;
}
.skeleton-text.short { width: 45%; }
.skeleton-text.medium { width: 70%; }
.skeleton-text.long { width: 92%; }

.skeleton-title {
  height: 22px;
  width: 60%;
  border-radius: 6px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.06) 0%, rgba(6, 182, 212, 0.16) 50%, rgba(255, 255, 255, 0.06) 100%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  margin-bottom: 12px;
  user-select: none;
  pointer-events: none;
}

.skeleton-metric {
  height: 38px;
  width: 140px;
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.05) 0%, rgba(6, 182, 212, 0.2) 50%, rgba(255, 255, 255, 0.05) 100%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  margin: 8px 0;
  user-select: none;
  pointer-events: none;
}

.skeleton-chart {
  width: 100%;
  height: 320px;
  border-radius: 12px;
  background: linear-gradient(
    135deg,
    rgba(13, 21, 39, 0.95) 0%,
    rgba(23, 37, 68, 0.75) 50%,
    rgba(13, 21, 39, 0.95) 100%
  );
  border: 1px dashed rgba(6, 182, 212, 0.25);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 1.25rem;
  padding: 2rem;
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.35);
  position: relative;
  overflow: hidden;
  user-select: none;
  pointer-events: none;
}

.skeleton-chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  height: 180px;
  width: 85%;
  padding-bottom: 10px;
  border-bottom: 2px solid rgba(255, 255, 255, 0.08);
}

.skeleton-bar {
  flex: 1;
  border-radius: 6px 6px 0 0;
  background: linear-gradient(180deg, rgba(6, 182, 212, 0.4) 0%, rgba(6, 182, 212, 0.08) 100%);
  animation: skeleton-pulse 2s ease-in-out infinite;
}

.skeleton-bar:nth-child(1) { height: 45%; animation-delay: 0.1s; }
.skeleton-bar:nth-child(2) { height: 65%; animation-delay: 0.2s; }
.skeleton-bar:nth-child(3) { height: 85%; animation-delay: 0.3s; }
.skeleton-bar:nth-child(4) { height: 55%; animation-delay: 0.4s; }
.skeleton-bar:nth-child(5) { height: 75%; animation-delay: 0.5s; }
.skeleton-bar:nth-child(6) { height: 90%; animation-delay: 0.6s; }
.skeleton-bar:nth-child(7) { height: 60%; animation-delay: 0.7s; }
.skeleton-bar:nth-child(8) { height: 80%; animation-delay: 0.8s; }

.skeleton-card {
  border-radius: 12px;
  padding: 1.25rem;
  background: rgba(16, 26, 48, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 160px;
  box-shadow: var(--shadow-sm);
  user-select: none;
  pointer-events: none;
}

.skeleton-table-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.skeleton-table-cell {
  flex: 1;
  height: 14px;
  border-radius: 4px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.11) 50%, rgba(255, 255, 255, 0.04) 100%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.8s infinite;
}

.skeleton-notice {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: var(--cyan-bright);
  font-weight: 600;
  letter-spacing: 0.5px;
}

.stagger-fade-in {
  animation: fadeInStagger 0.32s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fadeInStagger {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================================================
   METHODOLOGY CAROUSEL & STEPPER CONTROLS
   Tactile slide progression and keyboard navigation for multi-phase flows
   ========================================================================== */

.methodology-carousel-toolbar {
  background: rgba(13, 21, 39, 0.85);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 0.85rem 1.25rem;
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(12px);
}

.methodology-carousel-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.btn-carousel-nav {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main);
  background: rgba(23, 37, 68, 0.9);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  min-height: 2.25rem;
}

.btn-carousel-nav:hover {
  background: rgba(6, 182, 212, 0.18);
  border-color: var(--cyan-primary);
  color: var(--cyan-bright);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(6, 182, 212, 0.2);
}

.btn-carousel-nav:active {
  transform: translateY(1px);
}

.methodology-step-pills {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  justify-content: center;
  flex: 1;
}

.method-step-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(16, 26, 48, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  min-height: 1.85rem;
}

.method-step-pill .step-pill-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 0.7rem;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
}

.method-step-pill:hover {
  background: rgba(6, 182, 212, 0.15);
  border-color: rgba(6, 182, 212, 0.35);
  color: var(--cyan-bright);
  transform: translateY(-2px);
}

.method-step-pill.active {
  background: rgba(6, 182, 212, 0.22);
  border-color: var(--cyan-primary);
  color: #ffffff;
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.35);
}

.method-step-pill.active .step-pill-num {
  background: var(--cyan-primary);
  color: #060913;
}

.carousel-meta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.4rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.75rem;
  color: var(--text-dim);
}

.carousel-counter-tag {
  font-weight: 700;
  color: var(--cyan-bright);
  font-family: var(--font-mono, monospace);
}

.carousel-kbd-hint {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.carousel-kbd-hint kbd {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  padding: 0.1rem 0.35rem;
  font-size: 0.7rem;
  font-family: var(--font-mono, monospace);
  color: var(--text-main);
}

/* Micro-interactions: Buttons, Cards & Badges */
button, .btn, .tab-btn {
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

button:hover:not(:disabled), .btn:hover:not(:disabled) {
  transform: translateY(-1.5px);
}

button:active:not(:disabled), .btn:active:not(:disabled) {
  transform: translateY(1px);
}

.card {
  transition: transform 0.24s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.24s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.24s ease;
}

.card:hover {
  border-color: rgba(6, 182, 212, 0.25);
}

/* ==========================================================================
   UNIVERSAL HIGH-FIDELITY SELECT & DROPDOWN STYLING WITH POINTER CURSOR
   Tactile feedback, modern dark chevron, mobile/touch native compatibility
   ========================================================================== */

button, select, option, [role="button"], .tab-btn, .btn, .interactive-nav-badge, .badge[onclick], .clickable-card, .clickable-kpi-card {
  cursor: pointer !important;
}

select, .custom-select, .theme-select {
  cursor: pointer !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  background-color: var(--bg-input, rgba(10, 18, 36, 0.95)) !important;
  color: var(--text-main, #f8fafc) !important;
  border: 1px solid var(--border-color, rgba(0, 229, 255, 0.25)) !important;
  border-radius: 8px !important;
  padding: 0.5rem 2.4rem 0.5rem 0.9rem !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2300E5FF' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 0.85rem center !important;
  background-size: 14px 14px !important;
  font-size: 0.86rem !important;
  font-family: inherit !important;
  min-height: 2.5rem !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
  color-scheme: dark !important;
}

select:hover, .custom-select:hover, .theme-select:hover {
  cursor: pointer !important;
  border-color: var(--cyan-primary, #06b6d4) !important;
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.25) !important;
  background-color: rgba(16, 26, 48, 0.98) !important;
}

select:focus, .custom-select:focus, .theme-select:focus {
  cursor: pointer !important;
  outline: none !important;
  border-color: var(--cyan-bright, #22d3ee) !important;
  box-shadow: 0 0 18px rgba(34, 211, 238, 0.35) !important;
}

select option {
  background-color: #0b1528 !important;
  color: #f8fafc !important;
  padding: 0.65rem 1rem !important;
  cursor: pointer !important;
  font-size: 0.88rem !important;
}

select option:checked, select option:hover {
  background-color: #0284c7 !important;
  color: #ffffff !important;
}

@media (max-width: 768px) {
  select, .custom-select, .theme-select {
    font-size: 16px !important;
    min-height: 44px !important;
    padding-right: 2.2rem !important;
  }
}

/* ==========================================================================
   SELECTABLE DATA TABLE ROWS & MODAL POPUP INSPECTION
   ========================================================================== */

.data-table tbody tr, .table-responsive tbody tr {
  cursor: pointer !important;
  transition: background-color 0.18s ease, transform 0.18s ease;
}

.data-table tbody tr:hover, .table-responsive tbody tr:hover {
  background-color: rgba(6, 182, 212, 0.12) !important;
}

.data-table tbody tr:active, .table-responsive tbody tr:active {
  background-color: rgba(6, 182, 212, 0.22) !important;
}

/* ==========================================================================
   HIGH CONTRAST ENTITY BADGE LINKS & STATUTORY BASIS (WCAG AA FIX)
   ========================================================================== */

.badge a, a.badge, .entity-link, .customs-entity-link {
  color: #00E5FF !important;
  text-decoration: none !important;
  font-weight: 600 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
}

.badge a:hover, a.badge:hover, .entity-link:hover, .customs-entity-link:hover {
  color: #ffffff !important;
  text-decoration: underline !important;
}

/* ==========================================================================
   FRAMEWORK PURPOSE & PROFILE SELECTION CARDS (FIRST-RUN INSTALLATION)
   ========================================================================== */

.fr-profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin: 1.25rem 0;
}

.fr-profile-card {
  background: rgba(16, 26, 48, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 1.25rem;
  cursor: pointer !important;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  position: relative;
  user-select: none;
}

.fr-profile-card:hover {
  cursor: pointer !important;
  transform: translateY(-3px);
  border-color: var(--cyan-primary);
  box-shadow: 0 6px 20px rgba(6, 182, 212, 0.25);
  background: rgba(23, 37, 68, 0.9);
}

.fr-profile-card.selected {
  border-color: #00E5FF !important;
  background: linear-gradient(145deg, rgba(6, 182, 212, 0.2) 0%, rgba(16, 26, 48, 0.9) 100%) !important;
  box-shadow: 0 0 24px rgba(0, 229, 255, 0.35) !important;
}

.fr-profile-icon {
  font-size: 2rem;
  margin-bottom: 0.2rem;
}

.fr-profile-title {
  font-size: 1rem;
  font-weight: 700;
  color: #F8FAFC;
  margin: 0;
}

.fr-profile-desc {
  font-size: 0.8rem;
  color: #CBD5E1;
  line-height: 1.45;
  margin: 0;
  flex: 1;
}

.fr-profile-features {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.4rem;
}

.fr-profile-tag {
  font-size: 0.7rem;
  font-weight: 600;
  background: rgba(0, 229, 255, 0.12);
  color: #38BDF8;
  border: 1px solid rgba(0, 229, 255, 0.25);
  border-radius: 4px;
  padding: 0.15rem 0.45rem;
}

.fr-profile-check {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: transparent;
  transition: all 0.2s ease;
}

.fr-profile-card.selected .fr-profile-check {
  background: #00E5FF;
  border-color: #00E5FF;
  color: #020617;
  font-weight: 900;
}

/* ==============================================================================
   PANAMÁ PORTOPS-AI v1.0.0 - MODERN UI SYSTEM & ENHANCED INTERACTIVITY
   Autor: Desarrollado v1.0.0 Miguel Benítez / Ing. Miguel Antonio Benítez González (UTP)
   Licencia: GNU General Public License v3.0 (GPL-3.0)
   ============================================================================== */

/* 1. Universal Pointer Hand Cursor on All Dropdowns, Selects & Interactive Elements */
select,
.form-select,
.theme-select,
.perspective-select,
select option,
button,
.tab-btn,
.settings-tab-btn,
.auth-tab-btn,
.badge[onclick],
.badge[role="button"],
.interactive-nav-badge,
.preset-card,
.rbac-role-card,
.fr-profile-card,
.table tbody tr,
.data-table tbody tr,
.rbac-table tbody tr,
.privacy-diff-table tbody tr,
.api-spec-table tbody tr,
.preview-table tbody tr,
.customs-tariff-row,
.btn-toggle-eye,
.modal-close,
.revocation-btn {
  cursor: pointer !important;
}

/* 2. Sleek Custom Dropdown Menu Design (Desktop) with Touch-Friendly Mobile Fallback */
select,
.form-select,
.theme-select,
.perspective-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-color: rgba(11, 21, 40, 0.9) !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2300E5FF' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 0.75rem center !important;
  background-size: 14px 14px !important;
  padding-right: 2.2rem !important;
  border: 1px solid rgba(0, 229, 255, 0.35) !important;
  border-radius: 8px !important;
  color: #F8FAFC !important;
  font-family: var(--font-stack);
  font-size: 0.85rem !important;
  font-weight: 500;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

select:hover,
.form-select:hover,
.theme-select:hover,
.perspective-select:hover {
  border-color: #00E5FF !important;
  box-shadow: 0 0 14px rgba(0, 229, 255, 0.28), 0 4px 12px rgba(0, 0, 0, 0.35) !important;
  transform: translateY(-1px);
}

select:focus,
.form-select:focus,
.theme-select:focus,
.perspective-select:focus {
  outline: none !important;
  border-color: #00E5FF !important;
  box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.35), 0 4px 14px rgba(0, 0, 0, 0.4) !important;
}

select option {
  background: #0B1528 !important;
  color: #F8FAFC !important;
  padding: 0.6rem 0.8rem;
  font-weight: 500;
}

select option:checked {
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.3), rgba(2, 132, 199, 0.4)) !important;
  color: #00E5FF !important;
  font-weight: 700;
}

/* Touchscreens and Mobile: Natural classic touch target */
@media (hover: none) and (pointer: coarse), (max-width: 768px) {
  select,
  .form-select,
  .theme-select,
  .perspective-select {
    min-height: 44px;
    font-size: 0.95rem !important;
    padding-right: 2rem !important;
  }
}

/* 3. Card Hangover Effects & Micro-Interactions */
.card,
.kpi-card,
.preset-card,
.editorial-card,
.method-card,
.rbac-role-card,
.fr-profile-card,
.fr-form-panel {
  transition: transform 0.24s cubic-bezier(0.16, 1, 0.3, 1), 
              box-shadow 0.24s cubic-bezier(0.16, 1, 0.3, 1), 
              border-color 0.24s ease !important;
  position: relative;
}

.card:hover,
.kpi-card:hover,
.editorial-card:hover,
.method-card:hover {
  transform: translateY(-3px);
  border-color: rgba(0, 229, 255, 0.4) !important;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45), 0 0 20px rgba(0, 229, 255, 0.12) !important;
}

.card .card-hover-hint {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  color: #38BDF8;
  opacity: 0;
  transform: translateY(4px);
  transition: all 0.2s ease;
  margin-top: 0.5rem;
}

.card:hover .card-hover-hint {
  opacity: 1;
  transform: translateY(0);
}

/* 4. Interactive Table Rows & Selection Styling */
table tbody tr,
.data-table tbody tr,
.rbac-table tbody tr,
.api-spec-table tbody tr {
  transition: background-color 0.18s ease, transform 0.15s ease, border-color 0.18s ease !important;
}

table tbody tr:hover,
.data-table tbody tr:hover,
.rbac-table tbody tr:hover,
.api-spec-table tbody tr:hover {
  background-color: rgba(0, 229, 255, 0.08) !important;
  color: #FFFFFF !important;
}

table tbody tr.row-selected,
.data-table tbody tr.row-selected,
.rbac-table tbody tr.row-selected {
  background: linear-gradient(90deg, rgba(0, 229, 255, 0.18), rgba(2, 132, 199, 0.08)) !important;
  border-left: 3px solid #00E5FF !important;
  box-shadow: inset 0 0 12px rgba(0, 229, 255, 0.12);
}

/* Floating Drawer / Popover for Selected Row Details */
#table-row-detail-modal {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  max-width: 440px;
  width: calc(100vw - 3rem);
  max-height: 80vh;
  background: rgba(11, 21, 40, 0.95);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(0, 229, 255, 0.5);
  border-radius: 14px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.65), 0 0 25px rgba(0, 229, 255, 0.2);
  z-index: 1050;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: slideUpDrawer 0.26s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUpDrawer {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.table-row-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 1.2rem;
  background: rgba(15, 23, 42, 0.85);
  border-bottom: 1px solid rgba(0, 229, 255, 0.25);
}

.table-row-detail-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: #00E5FF;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
}

.table-row-detail-body {
  padding: 1rem 1.2rem;
  overflow-y: auto;
  font-size: 0.8rem;
  line-height: 1.5;
  color: #CBD5E1;
}

.table-row-kv-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
}

.table-row-kv-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.4rem 0.6rem;
  background: rgba(15, 23, 42, 0.5);
  border-radius: 6px;
  border: 1px solid rgba(148, 163, 184, 0.15);
}

.table-row-kv-key {
  font-size: 0.72rem;
  color: #94A3B8;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.table-row-kv-val {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: #F8FAFC;
  font-weight: 600;
  max-width: 60%;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-row-detail-footer {
  padding: 0.75rem 1.2rem;
  background: rgba(15, 23, 42, 0.75);
  border-top: 1px solid rgba(148, 163, 184, 0.15);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

/* 5. Skeleton Loaders / Shimmers for Smooth Loading States */
@keyframes skeleton-shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.skeleton-box,
.skeleton-card,
.skeleton-line,
.skeleton-circle {
  background: linear-gradient(90deg, rgba(15, 23, 42, 0.75) 25%, rgba(56, 189, 248, 0.18) 50%, rgba(15, 23, 42, 0.75) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.8s infinite ease-in-out;
  border-radius: 8px;
  position: relative;
  overflow: hidden;
}

.skeleton-card {
  height: 180px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.15);
}

.skeleton-line {
  height: 14px;
  margin-bottom: 0.5rem;
  border-radius: 4px;
}

.skeleton-line.short {
  width: 45%;
}

.skeleton-line.medium {
  width: 70%;
}

.skeleton-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
}

/* 6. Strict Role Guardrails & Unauthenticated View Protection */
body.is-guest .auth-requires-login,
body:not(.is-authenticated) .auth-requires-login {
  display: none !important;
}

body.is-guest .settings-tab-btn.admin-requires-auth,
body:not(.is-authenticated) .settings-tab-btn.admin-requires-auth {
  display: none !important;
}

.guest-action-lock {
  pointer-events: none !important;
  opacity: 0.45 !important;
  filter: grayscale(0.8) !important;
  cursor: not-allowed !important;
}

/* =====================================================================
   PORTAL OPERACIONAL: MOTOR DE RECORRIDO GUIADO INTERACTIVO (TOUR)
   Desarrollado v1.0.0 Miguel Benítez / UTP - GNU GPL-3.0
   ===================================================================== */
#portops-tour-overlay-container {
  position: fixed;
  inset: 0;
  z-index: 99999;
  pointer-events: auto;
}

.portops-tour-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 15, 29, 0.72);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 1;
}

.portops-tour-focal-ring {
  position: absolute;
  z-index: 2;
  border-radius: 12px;
  border: 2px solid var(--cyan-bright);
  box-shadow: 0 0 0 9999px rgba(8, 14, 28, 0.68), 0 0 28px rgba(0, 229, 255, 0.75), inset 0 0 16px rgba(0, 229, 255, 0.35);
  pointer-events: none;
  transition: top 0.25s cubic-bezier(0.16, 1, 0.3, 1), left 0.25s cubic-bezier(0.16, 1, 0.3, 1), width 0.25s cubic-bezier(0.16, 1, 0.3, 1), height 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  animation: tourPulse 2s infinite ease-in-out;
}

@keyframes tourPulse {
  0% {
    box-shadow: 0 0 0 9999px rgba(8, 14, 28, 0.68), 0 0 20px rgba(0, 229, 255, 0.5), inset 0 0 10px rgba(0, 229, 255, 0.2);
  }
  50% {
    box-shadow: 0 0 0 9999px rgba(8, 14, 28, 0.68), 0 0 32px rgba(0, 229, 255, 0.85), inset 0 0 20px rgba(0, 229, 255, 0.45);
  }
  100% {
    box-shadow: 0 0 0 9999px rgba(8, 14, 28, 0.68), 0 0 20px rgba(0, 229, 255, 0.5), inset 0 0 10px rgba(0, 229, 255, 0.2);
  }
}

.portops-tour-popover {
  position: absolute;
  z-index: 3;
  width: min(440px, calc(100vw - 32px));
  background: var(--bg-card) !important;
  border: 1px solid var(--cyan-bright) !important;
  border-radius: 14px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.55), 0 0 24px rgba(0, 229, 255, 0.25) !important;
  padding: 1.25rem 1.4rem;
  box-sizing: border-box;
  outline: none;
  transition: top 0.28s cubic-bezier(0.16, 1, 0.3, 1), left 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.portops-tour-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.portops-tour-step-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: color-mix(in srgb, var(--cyan-bright) 15%, transparent);
  border: 1px solid var(--cyan-bright);
  color: var(--cyan-bright);
  font-size: 0.76rem;
  font-weight: 700;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  letter-spacing: 0.03em;
}

.tour-beacon-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cyan-bright);
  box-shadow: 0 0 8px var(--cyan-bright);
}

.portops-tour-btn-close {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 1.15rem;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  border-radius: 6px;
  line-height: 1;
  transition: all 0.18s ease;
}

.portops-tour-btn-close:hover {
  color: var(--rose-alert, #ef4444);
  background: rgba(239, 68, 68, 0.15);
  transform: scale(1.1);
}

.portops-tour-progress-bar {
  width: 100%;
  height: 4px;
  background: rgba(148, 163, 184, 0.2);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 1rem;
}

.portops-tour-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--cyan-primary), var(--cyan-bright));
  transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 0 8px var(--cyan-bright);
}

.portops-tour-title {
  margin: 0 0 0.5rem 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.35;
}

.portops-tour-desc {
  margin: 0 0 1.25rem 0;
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text-muted);
}

.portops-tour-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border-top: 1px solid var(--border-color);
  padding-top: 0.85rem;
}

.portops-tour-nav-buttons {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-finish-highlight {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
  border-color: #10b981 !important;
  color: #ffffff !important;
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.45) !important;
}

.btn-tour-interactive:hover {
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.3), rgba(99, 102, 241, 0.35)) !important;
  border-color: var(--cyan-bright) !important;
  box-shadow: 0 0 16px rgba(0, 229, 255, 0.45) !important;
  transform: translateY(-1px);
}



