/* ==========================================================================
   OJANVU QUANTUM CLOUD - PRODUCTION DESIGN SYSTEM
   Single-Screen Ratio Viewport Architecture | OpenAI Codex Clean Theme
   ========================================================================== */

:root {
  --color-canvas: #ffffff;
  --color-surface: #f8f9fb;
  --color-surface-hover: #f0f1f5;
  --color-border: #e6e8eb;
  --color-border-hover: #cbced4;
  --color-border-subtle: #f0f2f5;

  --color-text-primary: #0d0d0d;
  --color-text-secondary: #222222;
  --color-text-muted: #555566;
  --color-text-dim: #777788;

  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  --radius-pill: 9999px;
  --radius-card: 12px;
}

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

html, body {
  height: 100vh;
  overflow: hidden;
  background-color: var(--color-canvas);
  color: var(--color-text-secondary);
  font-family: var(--font-primary);
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: -0.012em;
  -webkit-font-smoothing: antialiased;
}

/* Subtle Geometric Grid from ojanvu.com */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(0, 0, 0, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 0, 0, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(circle at 50% 20%, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.12) 70%, transparent 100%);
  -webkit-mask-image: radial-gradient(circle at 50% 20%, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.12) 70%, transparent 100%);
}

/* ==========================================================================
   NAVIGATION BAR (FLOATING PILL, STRICT 48PX HEIGHT)
   ========================================================================== */
.navbar-wrapper {
  position: fixed;
  top: 10px;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  justify-content: center;
  padding: 0 20px;
  pointer-events: none;
}

.navbar-inner {
  pointer-events: auto;
  width: 100%;
  max-width: 100%;
  height: 50px;
  background-color: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.04);
  white-space: nowrap;
}

.nav-brand {
  text-decoration: none;
  display: flex;
  align-items: center;
}

.brand-text {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--color-text-primary);
}

.nav-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-tab {
  background: transparent;
  border: 1px solid transparent;
  padding: 6px 14px;
  font-family: var(--font-primary);
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-muted);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.15s ease;
}

.nav-tab:hover {
  background-color: var(--color-surface);
  color: var(--color-text-primary);
}

.nav-tab.active {
  background-color: var(--color-surface);
  border-color: var(--color-border);
  color: var(--color-text-primary);
  font-weight: 600;
}

.nav-action {
  display: flex;
  align-items: center;
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.btn-primary {
  background-color: #0d0d0d;
  color: #ffffff;
  border: 1px solid #0d0d0d;
  border-radius: var(--radius-pill);
  padding: 7px 18px;
  font-family: var(--font-primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  text-decoration: none;
}

.btn-primary:hover {
  background-color: #262626;
  border-color: #262626;
}

.btn-secondary {
  background-color: #ffffff;
  color: #0d0d0d;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  padding: 7px 16px;
  font-family: var(--font-primary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.btn-secondary:hover {
  background-color: var(--color-surface);
  border-color: var(--color-border-hover);
}

.btn-tool {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 3px 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-muted);
  cursor: pointer;
}

.btn-tool:hover {
  background-color: #ffffff;
  border-color: var(--color-border);
  color: #0d0d0d;
}

.pill-btn {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  padding: 5px 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.pill-btn:hover {
  border-color: var(--color-border-hover);
  color: #0d0d0d;
}

.pill-btn.active {
  background-color: #0d0d0d;
  color: #ffffff;
  border-color: #0d0d0d;
}

.w-full {
  width: 100%;
}

/* ==========================================================================
   PAGE VIEWPORT & PANELS (STRICT SINGLE SCREEN)
   ========================================================================== */
.page-viewport {
  max-width: 100%;
  width: 100%;
  margin: 66px 0 0;
  height: calc(100vh - 74px);
  padding: 0 20px 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.view-panel {
  display: none;
  height: 100%;
  width: 100%;
  flex-direction: column;
  overflow: hidden;
}

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

.view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  flex-shrink: 0;
}

.view-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--color-text-primary);
}

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

.status-badge {
  display: inline-flex;
  align-items: center;
  background-color: #0d0d0d;
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
}

/* ==========================================================================
   VIEW 1: COMPILER & EDITOR WORKSPACE
   ========================================================================== */
#compilerSection {
  position: relative;
}

.editor-container {
  flex: 1;
  min-height: 0;
  background-color: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.03);
  position: relative;
}

.editor-header {
  height: 38px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--color-border);
  background-color: var(--color-surface);
  flex-shrink: 0;
}

.editor-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--color-text-dim);
}

.editor-body {
  flex: 1;
  min-height: 0;
  display: flex;
  overflow: hidden;
  background-color: #ffffff;
  /* High-Tech Quantum Grid / Dot Matrix Canvas Texture */
  background-image: 
    radial-gradient(circle at 1px 1px, rgba(13, 13, 13, 0.08) 1.25px, transparent 1.25px);
  background-size: 22px 22px;
  background-position: 8px 8px;
  position: relative;
}

.editor-gutter {
  width: 48px;
  padding: 12px 10px;
  overflow-y: hidden;
  text-align: right;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.6;
  color: #94a3b8;
  background-color: #fafafc;
  border-right: 1px solid var(--color-border);
  user-select: none;
  flex-shrink: 0;
  z-index: 1;
}

#qasmEditor {
  flex: 1;
  height: 100%;
  padding: 12px 16px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  color: var(--color-text-primary);
  border: none;
  outline: none;
  resize: none;
  background: transparent;
  overflow-y: auto;
  white-space: pre;
  position: relative;
  z-index: 1;
}

/* ==========================================================================
   VIEW 2: CONFIGURE & SUBMIT
   ========================================================================== */
.config-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 18px;
  flex: 1;
  min-height: 0;
  align-items: start;
}

.panel-card {
  background-color: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  padding: 20px 24px;
}

.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--color-text-dim);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  height: 40px;
  background-color: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  padding: 0 16px;
  font-family: var(--font-primary);
  font-size: 13.5px;
  color: var(--color-text-primary);
  outline: none;
  transition: border-color 0.15s ease;
}

textarea,
textarea.form-input,
textarea.matrix-editor-textarea,
.matrix-editor-textarea,
.matrix-code-editor {
  border-radius: 6px !important;
  height: auto;
  min-height: 140px;
  padding: 10px 12px !important;
  font-family: var(--font-mono) !important;
  font-size: 11.5px !important;
  line-height: 1.55 !important;
  white-space: pre !important;
  overflow-x: auto !important;
  tab-size: 2 !important;
  font-variant-numeric: tabular-nums !important;
  background-color: #fbfcfd !important;
  border: 1px solid var(--color-border) !important;
  box-sizing: border-box !important;
}

.form-input:focus {
  border-color: #0d0d0d;
}

.form-input.mono {
  font-family: var(--font-mono);
}

.select-input {
  cursor: pointer;
}

.shots-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.shots-input {
  width: 130px;
  flex-shrink: 0;
  font-weight: 600;
}

.shot-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.form-action {
  margin-top: 24px;
}

.dark-summary {
  background-color: #0d0d0d;
  color: #ffffff;
  border: 1px solid #1a1a1a;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 18px 20px;
  min-height: 340px;
}

.summary-boxes-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.summary-panel-title {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #94a3b8;
  text-transform: uppercase;
}

.summary-status-badge {
  display: inline-flex;
  align-items: center;
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  border: 1px solid rgba(74, 222, 128, 0.3);
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
}

.summary-boxes-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  flex: 1;
}

.summary-box {
  background: #151518;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 6px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.summary-box:hover {
  border-color: rgba(255, 255, 255, 0.16);
  background-color: #1a1a1e;
}

.summary-box-label {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #8c8c9e;
  text-transform: uppercase;
}

.summary-box-value {
  font-family: var(--font-mono);
  font-size: 14.5px;
  font-weight: 700;
  color: #ffffff;
  margin-top: 3px;
  letter-spacing: -0.01em;
}

.summary-box-sub {
  font-size: 10.5px;
  color: #64748b;
  margin-top: 2px;
}

.summary-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 12px;
  margin-top: 12px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: #8c8c9e;
  display: flex;
  justify-content: space-between;
}

/* ==========================================================================
   VIEW 3: EXECUTION RESULTS (SINGLE SCREEN FIT)
   ========================================================================== */
.metrics-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 12px;
  flex-shrink: 0;
}

.metric-card {
  background-color: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  padding: 10px 16px;
}

.metric-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--color-text-dim);
  display: block;
}

.metric-val {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text-primary);
  margin-top: 2px;
  display: block;
}

.analytics-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  margin-bottom: 12px;
}

#histogramCard, #circuitDiagramCard {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

.card-heading {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--color-text-primary);
  margin-bottom: 8px;
  flex-shrink: 0;
}

.histogram-frame {
  flex: 1;
  min-height: 210px;
  height: 210px;
  min-width: 0;
  max-width: 100%;
  display: flex;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
}

/* Mathematical Quantum Histogram Frame */
.quantum-graph-wrapper {
  display: flex;
  width: 100%;
  height: 100%;
  min-height: 240px;
  position: relative;
  box-sizing: border-box;
  overflow: hidden;
  background: #ffffff;
  border-radius: 6px;
}

/* Y-Axis: Fixed on left */
.qgraph-y-axis {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-end;
  padding: 18px 8px 36px 0;
  width: 62px;
  flex-shrink: 0;
  border-right: 1.5px solid #0f172a;
  position: relative;
  user-select: none;
  background: #ffffff;
  z-index: 5;
  box-sizing: border-box;
}

.qgraph-y-title {
  position: absolute;
  top: 50%;
  left: -24px;
  transform: rotate(-90deg) translateX(-50%);
  transform-origin: 0 0;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #64748b;
  white-space: nowrap;
}

.qgraph-y-tick {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  color: #475569;
  line-height: 1;
  position: relative;
}

.qgraph-y-tick::after {
  content: "";
  display: inline-block;
  width: 5px;
  height: 1.5px;
  background: #0f172a;
}

/* Plot Area: Horizontally scrollable */
.qgraph-plot-scroll {
  flex: 1;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

/* Background Grid Lines across scrollable width */
.qgraph-grid-container {
  position: absolute;
  top: 18px;
  left: 0;
  right: 0;
  bottom: 36px;
  min-width: 100%;
  width: max-content;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  pointer-events: none;
  z-index: 1;
  box-sizing: border-box;
}

.qgraph-grid-line {
  width: 100%;
  min-width: 100%;
  height: 1px;
  border-bottom: 1px dashed #e2e8f0;
}

/* Bars Layer on top of grid lines */
.qgraph-bars-layer {
  display: flex;
  align-items: flex-end;
  height: 100%;
  min-height: 100%;
  padding: 18px 24px 0;
  position: relative;
  z-index: 2;
  box-sizing: border-box;
  width: max-content;
  min-width: 100%;
}

.qgraph-bar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  flex-shrink: 0;
  height: 100%;
  cursor: pointer;
  position: relative;
  box-sizing: border-box;
}

.qgraph-bar-pill {
  background-color: #0d0d0d;
  border-radius: 4px 4px 0 0;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.qgraph-x-baseline {
  position: absolute;
  bottom: 36px;
  left: 0;
  width: 100%;
  min-width: 100%;
  height: 1.5px;
  background: #0f172a;
  z-index: 3;
  pointer-events: none;
}

.qgraph-x-label {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
  color: #0f172a;
  margin-top: 6px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.qgraph-x-tick {
  width: 1.5px;
  height: 5px;
  background: #0f172a;
  margin: 0 auto;
}

.qgraph-plot-scroll::-webkit-scrollbar,
.histogram-scroll-wrapper::-webkit-scrollbar,
.circuit-frame::-webkit-scrollbar,
#modalCircuitScrollContainer::-webkit-scrollbar,
#modalHistogramContainer::-webkit-scrollbar {
  height: 6px;
  width: 6px;
}

.qgraph-plot-scroll::-webkit-scrollbar-track,
.histogram-scroll-wrapper::-webkit-scrollbar-track,
.circuit-frame::-webkit-scrollbar-track,
#modalCircuitScrollContainer::-webkit-scrollbar-track,
#modalHistogramContainer::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 4px;
}

.qgraph-plot-scroll::-webkit-scrollbar-thumb,
.histogram-scroll-wrapper::-webkit-scrollbar-thumb,
.circuit-frame::-webkit-scrollbar-thumb,
#modalCircuitScrollContainer::-webkit-scrollbar-thumb,
#modalHistogramContainer::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.qgraph-plot-scroll::-webkit-scrollbar-thumb:hover,
.histogram-scroll-wrapper::-webkit-scrollbar-thumb:hover,
.circuit-frame::-webkit-scrollbar-thumb:hover,
#modalCircuitScrollContainer::-webkit-scrollbar-thumb:hover,
#modalHistogramContainer::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.histogram-bar-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
}

.histogram-count-label {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: 6px;
}

.histogram-solid-bar {
  width: 54px;
  background-color: #0d0d0d;
  border-radius: 4px 4px 0 0;
  min-height: 12px;
}

.histogram-basis-state {
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text-primary);
}

.circuit-frame {
  flex: 1;
  min-height: 210px;
  height: 210px;
  min-width: 0;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 10px 16px;
  overflow-x: auto;
  overflow-y: hidden;
  box-sizing: border-box;
}

.wire-row {
  display: flex;
  align-items: center;
}

.wire-qubit-id {
  width: 44px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text-primary);
  flex-shrink: 0;
}

.wire-horizontal-line {
  flex: 1;
  height: 1.5px;
  background-color: #cbced4;
  position: relative;
}

.wire-gate-badge {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  background-color: #ffffff;
  border: 1.5px solid #0d0d0d;
  border-radius: 4px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: #0d0d0d;
}

.wire-cnot-control {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  background-color: #0d0d0d;
  border-radius: 50%;
  width: 10px;
  height: 10px;
  z-index: 2;
}

.wire-cnot-line {
  position: absolute;
  width: 1.5px;
  background-color: #0d0d0d;
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 1;
}

#resultsSection {
  overflow-y: auto;
  padding-bottom: 28px;
}

#resultsSection .analytics-grid {
  min-height: 280px;
  flex: none;
}

.counts-card {
  padding: 16px 20px;
  flex-shrink: 0;
  height: auto;
  min-height: auto;
  display: flex;
  flex-direction: column;
  margin-bottom: 24px;
}

.counts-header {
  margin-bottom: 4px;
}

.counts-code {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.5;
  color: var(--color-text-primary);
  overflow: visible;
  max-height: none;
  white-space: pre-wrap;
  background-color: var(--color-surface);
  padding: 12px 16px;
  border-radius: 6px;
  border: 1px solid var(--color-border);
}

/* ==========================================================================
   EXECUTION TIMELINE & LATENCY BREAKDOWN
   ========================================================================== */
.timeline-card {
  margin-bottom: 14px;
  padding: 16px 20px;
}

.timeline-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 10px 18px;
  position: relative;
}

.timeline-step {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  z-index: 2;
  min-width: 160px;
}

.step-marker {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.step-marker.completed {
  background: #0d0d0d;
  border-color: #0d0d0d;
}

.step-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ffffff;
}

.step-content {
  display: flex;
  flex-direction: column;
}

.step-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--color-text-dim);
}

.step-time {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text-primary);
  margin-top: 2px;
}

.step-desc {
  font-size: 11px;
  color: var(--color-text-muted);
}

.timeline-connector {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  margin: 0 16px;
  min-width: 120px;
}

.connector-line {
  position: absolute;
  top: 13px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--color-border);
  z-index: 1;
}

.connector-badge {
  z-index: 2;
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  padding: 3px 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-muted);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

.connector-badge.active {
  background: #0d0d0d;
  border-color: #0d0d0d;
  color: #ffffff;
}

.timeline-metrics-bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  align-items: center;
  border-top: 1px solid var(--color-border-subtle);
  padding-top: 14px;
  margin-top: 4px;
}

.tl-metric-item {
  display: flex;
  flex-direction: column;
}

.tl-sub-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--color-text-dim);
}

.tl-sub-val {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text-primary);
  margin-top: 2px;
}

.tl-divider {
  width: 1px;
  height: 28px;
  background: var(--color-border);
  margin: 0 16px;
}

/* ==========================================================================
   RESULT CIRCUIT PROGRAM VIEWER
   ========================================================================== */
.circuit-display-card {
  padding: 16px 20px;
  margin-bottom: 24px;
}

.result-circuit-viewer {
  display: flex;
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  overflow: hidden;
  max-height: 380px;
}

.result-circuit-viewer .editor-gutter {
  width: 44px;
  padding: 12px 10px;
  text-align: right;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
  color: #94a3b8;
  background-color: #fafafc;
  border-right: 1px solid var(--color-border);
  user-select: none;
  flex-shrink: 0;
  overflow: hidden;
}

.result-code-pre {
  flex: 1;
  padding: 12px 16px;
  margin: 0;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--color-text-primary);
  background: transparent;
  overflow-y: auto;
  white-space: pre;
}

/* ==========================================================================
   VIEW 4: SUBMITTED JOBS
   ========================================================================== */
.table-wrapper {
  flex: 1;
  min-height: 0;
  background-color: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  overflow-y: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-dim);
  padding: 10px 16px;
  background-color: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.data-table td {
  padding: 10px 16px;
  font-size: 13px;
  border-bottom: 1px solid var(--color-border-subtle);
  color: var(--color-text-secondary);
}

.data-table tr:last-child td {
  border-bottom: none;
}

/* ==========================================================================
   VIEW 5: API & SDK
   ========================================================================== */
.api-key-row {
  display: flex;
  gap: 10px;
  max-width: 600px;
  margin-top: 6px;
}

.sdk-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  flex: 1;
  min-height: 0;
}

.sdk-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.code-box {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 12px 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.55;
  color: var(--color-text-primary);
  max-height: 320px;
  overflow-y: auto;
}

/* ==========================================================================
   VIEW 6: PROFILE, AUTH MODAL & ADVANCED USER CONTROLS
   ========================================================================== */

#resultsSection, #jobsSection, #apiSection, #profileSection {
  overflow-y: auto;
  padding-bottom: 32px;
}

.brand-logo-img {
  height: 35px;
  width: auto;
  object-fit: contain;
  display: block;
}

.btn-ghost {
  background: transparent;
  border: 1px solid transparent;
  color: var(--color-text-primary);
  font-family: var(--font-primary);
  font-size: 13px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-ghost:hover {
  background-color: var(--color-surface);
  border-color: var(--color-border);
}

.user-pill-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  border: 1px solid var(--color-border);
  padding: 4px 12px 4px 6px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: var(--font-primary);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--color-text-primary);
}

.user-pill-btn:hover {
  border-color: var(--color-border-hover);
  background: var(--color-surface);
}

.user-avatar-circle {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #0d0d0d;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-avatar-large {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #0d0d0d;
  color: #ffffff;
  font-size: 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-org-badge {
  font-size: 10px;
  font-weight: 600;
  background: var(--color-surface);
  color: var(--color-text-muted);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--color-border);
}

.circuit-stats-pill {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--color-text-dim);
  background: var(--color-surface);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-border);
}

.header-title-block {
  display: flex;
  align-items: center;
  gap: 14px;
}

.pill-filter {
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.15s ease;
}

.pill-filter.active, .pill-filter:hover {
  background: #0d0d0d;
  color: #ffffff;
  border-color: #0d0d0d;
}

.sdk-tab-btn {
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.15s ease;
}

.sdk-tab-btn.active, .sdk-tab-btn:hover {
  background: #0d0d0d;
  color: #ffffff;
  border-color: #0d0d0d;
}

.process-tab-btn {
  background: #ffffff;
  border: 1px solid var(--color-border);
  color: #475569;
  font-size: 11.5px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.process-tab-btn:hover {
  background: #f8fafc;
  color: #0d0d0d;
  border-color: #94a3b8;
}

.process-tab-btn.active {
  background: #0d0d0d;
  color: #ffffff;
  border-color: #0d0d0d;
}

/* Modal Dialog System */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(13, 13, 13, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-dialog {
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: 16px;
  width: 100%;
  max-width: 460px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
  overflow: hidden;
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.modal-close-btn {
  background: transparent;
  border: none;
  font-size: 20px;
  line-height: 1;
  color: var(--color-text-dim);
  cursor: pointer;
  padding: 4px;
}

.modal-close-btn:hover {
  color: var(--color-text-primary);
}

.modal-tab-bar {
  display: flex;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
}

.modal-tab-btn {
  flex: 1;
  padding: 12px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.modal-tab-btn.active {
  color: var(--color-text-primary);
  border-bottom-color: #0d0d0d;
  background: #ffffff;
}

.modal-body {
  padding: 20px 24px;
}

.notice-box {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.45;
}

.notice-warning {
  background-color: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
}

.notice-info {
  background-color: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
}

.notice-title {
  font-weight: 700;
  margin-bottom: 2px;
}

/* ==========================================================================
   CIRCUIT LIBRARY ICON & CLEAN AVATAR STYLES
   ========================================================================== */
.btn-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-pill);
  background-color: #ffffff;
  border: 1px solid var(--color-border);
  color: var(--color-text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.btn-icon:hover {
  background-color: var(--color-surface);
  border-color: var(--color-border-hover);
  color: #0d0d0d;
}

.library-dropdown-wrap {
  position: relative;
  display: inline-block;
}

.library-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 250;
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  min-width: 270px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.library-menu-header {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-dim);
  padding: 6px 10px 4px;
}

.library-menu-item {
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  padding: 8px 10px;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  cursor: pointer;
  transition: all 0.12s ease;
}

.library-menu-item:hover {
  background-color: var(--color-surface);
}

.library-menu-item .circuit-name {
  font-family: var(--font-primary);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--color-text-primary);
}

.library-menu-item .circuit-desc {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--color-text-dim);
}

.user-avatar-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.15s ease;
}

.user-avatar-btn:hover .user-avatar-circle {
  box-shadow: 0 0 0 2px #0d0d0d;
  transform: scale(1.05);
}

.user-avatar-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #0d0d0d;
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(0, 0, 0, 0.1);
  transition: all 0.15s ease;
}

/* ==============================================================================
   MATHEMATICAL FORMULATIONS & KATEX DISPLAY STYLING
   ============================================================================== */
.math-eq-container {
  padding: 8px 14px;
  background: #f8fafc;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  overflow-x: auto;
  overflow-y: hidden;
  color: #0f172a;
  display: flex;
  align-items: center;
  min-height: 46px;
  margin-top: 6px;
}

.math-eq-container .katex-display {
  margin: 0 !important;
  text-align: left !important;
}

.math-eq-container .katex {
  font-size: 1.08em;
  color: #0f172a;
}

/* VQE Type Selector Pills */
.vqe-type-btn {
  padding: 5px 12px;
  font-size: 11.5px;
  border-radius: 4px;
  border: 1px solid var(--color-border);
  background: #ffffff;
  color: #334155;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.15s ease;
}

/* Unified Algorithm Type Selector Pills Across All Solvers */
.algo-type-btn,
.vqe-type-btn,
.qubo-algo-btn,
.fep-algo-btn,
.linear-algo-btn {
  padding: 5px 12px;
  font-size: 11.5px;
  border-radius: 4px;
  border: 1px solid var(--color-border);
  background: #ffffff;
  color: #334155;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.15s ease;
}

.algo-type-btn:hover,
.vqe-type-btn:hover,
.qubo-algo-btn:hover,
.fep-algo-btn:hover,
.linear-algo-btn:hover {
  border-color: #0d0d0d;
}

.algo-type-btn.active,
.vqe-type-btn.active,
.qubo-algo-btn.active,
.fep-algo-btn.active,
.linear-algo-btn.active {
  background: #0d0d0d;
  color: #ffffff;
  border-color: #0d0d0d;
  font-weight: 600;
}

/* Unified Benchmark Template Pills Across All Solvers */
.benchmark-btn,
.vqe-benchmark-btn,
.qubo-benchmark-btn,
.fep-benchmark-btn,
.linear-benchmark-btn {
  padding: 3px 10px;
  font-size: 11px;
  border-radius: 4px;
  border: 1px solid var(--color-border);
  background: #ffffff;
  color: #334155;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.15s ease;
}

.benchmark-btn:hover,
.vqe-benchmark-btn:hover,
.qubo-benchmark-btn:hover,
.fep-benchmark-btn:hover,
.linear-benchmark-btn:hover {
  border-color: #0d0d0d;
}

.benchmark-btn.active,
.vqe-benchmark-btn.active,
.qubo-benchmark-btn.active,
.fep-benchmark-btn.active,
.linear-benchmark-btn.active {
  background: #0d0d0d;
  color: #ffffff;
  border-color: #0d0d0d;
  font-weight: 600;
}

/* Quick Add Term Pills */
.quick-add-term-btn {
  padding: 3px 8px;
  font-size: 10.5px;
  border-radius: 4px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #334155;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.12s ease;
}

.quick-add-term-btn:hover {
  background: #e2e8f0;
  border-color: #94a3b8;
  color: #0f172a;
}

/* Pauli Operator Cell & Inputs */
.pauli-input-text {
  font-family: var(--font-mono);
  font-size: 11px;
  height: 26px;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 2px 8px;
  background: #ffffff;
  width: 100%;
}

.pauli-input-coeff {
  font-family: var(--font-mono);
  font-size: 11px;
  height: 26px;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 2px 8px;
  background: #ffffff;
  text-align: right;
  width: 100%;
}
