/* =============================================================
   qml.css — Shared stylesheet for QML Lab & QML Studio
   Covers: qml-lab.html  AND  qml-studio.html
   Visual style: IBM Quantum Composer (matches styles.css)
   ============================================================= */

/* ─────────────────────────────────────────────────────────────
   QML Studio Layer Overrides
   Ensures feature names and theta labels are permanently visible
   at the bottom of gates after being dropped/mapped.
   ───────────────────────────────────────────────────────────── */

/* Allow labels to overflow the slot boundary */
.gate-slot {
    overflow: visible !important;
}

/* Force parameter visibility with a light, non-dominating style */
.gate-param {
    opacity: 1 !important;
    visibility: visible !important;
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    font-size: 0.65rem !important;
    font-weight: 500 !important;
    color: #64748b !important;
    /* Slate grey - darker for clarity */
    box-shadow: none !important;
    transform: translateX(-50%) !important;
    z-index: 100 !important;
    pointer-events: none;
    white-space: nowrap;
    margin-top: 4px;
}

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800&family=IBM+Plex+Mono:wght@400;600&display=swap');

/* ── Reset ──────────────────────────────────────────────────── */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ── Design Tokens (mirrors styles.css :root) ───────────────── */
:root {
    /* IBM Quantum Composer Colors */
    --ibm-red: #FA4D56;
    --ibm-purple: #6929C4;
    --ibm-blue: #0F62FE;
    --ibm-teal: #007D79;
    --ibm-light-blue: #1192E8;
    --ibm-green: #198038;
    --ibm-orange: #FF832B;
    --ibm-grey: #525252;
    --ibm-light-grey: #D1D1D1;
    --ibm-bg: #F8FAFC;

    /* Core palette */
    --primary: #4F46E5;
    --primary-dark: #3730A3;
    --secondary: #7C3AED;
    --success: #198038;
    --danger: #FA4D56;
    --dark: #0F172A;
    --light: #F8FAFC;
    --border: #E2E8F0;

    /* Modern Design Tokens */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-std: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --glass-bg: rgba(255, 255, 255, 0.9);
    --glass-blur: blur(12px);

    /* QML-specific aliases */
    --bg-main: #fbfcfe;
    --bg-panel: #ffffff;
    --border-std: #e2e8f0;
    --accent-indigo: #4f46e5;
    --accent-slate: #1e293b;
    --text-main: #0F172A;
    --text-dim: #64748b;
    --font-ui: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'IBM Plex Mono', monospace;
}

/* ── Global Headings (matches styles.css) ───────────────────── */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-ui);
    color: var(--dark);
    line-height: 1.2;
    margin-bottom: 0.5em;
}

h1 {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -0.025em;
}

h2 {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

h3 {
    font-size: 1.25rem;
    font-weight: 600;
}

/* ── Base Body (matches styles.css body) ────────────────────── */
body,
body.std-lab {
    font-family: var(--font-ui);
    background: var(--bg-main);
    color: var(--dark);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
}

/* ── Header (IBM Quantum Composer white header) ─────────────── */
.std-header {
    height: 64px;
    background: white;
    border-bottom: 1px solid #e5e7eb;
    color: var(--dark);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 200;
}

/* Logo */
.std-logo {
    font-weight: 800;
    font-size: 1.25rem;
    letter-spacing: -0.02em;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 8px;
}

.std-logo .accent {
    color: var(--ibm-blue);
}

.std-logo .version {
    font-size: 0.7rem;
    font-family: var(--font-mono);
    color: #94a3b8;
    margin-left: 8px;
    font-weight: 400;
    background: var(--light);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 2px 6px;
}

/* Pulse dot */
@keyframes pulse-opacity {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.3;
    }
}

.pulse {
    display: inline-block;
    color: var(--ibm-red);
    margin-right: 6px;
    animation: pulse-opacity 1.2s ease-in-out infinite;
}

/* Header action buttons row */
.std-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* ── Workspace Layout ───────────────────────────────────────── */
.std-workspace {
    flex: 1;
    display: grid;
    grid-template-columns: 300px 1fr 360px;
    gap: 16px;
    padding: 16px;
    min-height: 0;
}

/* ── Panels (white card, matches styles.css section) ────────── */
.std-panel {
    background: var(--bg-panel);
    border: 1px solid var(--border-std);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: var(--transition-std);
}

.std-panel:hover {
    box-shadow: var(--shadow-md);
}

.panel-header {
    padding: 12px 16px;
    background: var(--ibm-bg);
    border-bottom: 1px solid var(--border-std);
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--ibm-grey);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    flex-shrink: 0;
}

.panel-body {
    padding: 20px;
    flex: 1;
    overflow-y: auto;
    font-size: 0.875rem;
}

.panel-body.scrollable {
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

/* ── Form Controls ──────────────────────────────────────────── */
.control-group {
    margin-bottom: 20px;
}

.control-group label {
    display: block;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-dim);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.std-select,
.std-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-std);
    border-radius: var(--radius-sm);
    font-family: var(--font-ui);
    font-size: 0.875rem;
    background: #ffffff;
    color: var(--dark);
    box-sizing: border-box;
    transition: var(--transition-fast);
}

.std-select:focus,
.std-input:focus {
    outline: none;
    border-color: var(--ibm-blue);
    box-shadow: 0 0 0 3px rgba(15, 98, 254, 0.1);
}

/* General input / select / textarea (matches styles.css) */
input[type="text"],
input[type="number"],
select,
textarea {
    border-radius: 4px;
    border: 1px solid var(--border);
    padding: 6px 12px;
    font-size: 0.875rem;
    font-family: var(--font-ui);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Engineering Pipeline block ─────────────────────────────── */
.engineering-cluster {
    background: var(--ibm-bg);
    padding: 12px;
    border-radius: 4px;
    border: 1px solid var(--border-std);
    margin-bottom: 12px;
}

.engineering-cluster>label {
    color: var(--ibm-blue);
    margin-bottom: 10px;
    display: block;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.sub-control {
    margin-bottom: 10px;
}

.sub-control label {
    display: block;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-dim);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ── Toggle Switch ──────────────────────────────────────────── */
input[type="checkbox"] {
    appearance: none;
    width: 32px;
    height: 18px;
    background: #e2e8f0;
    border-radius: 20px;
    position: relative;
    cursor: pointer;
    transition: background 0.25s;
    vertical-align: middle;
}

input[type="checkbox"]:checked {
    background: var(--ibm-blue);
}

input[type="checkbox"]::after {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    background: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: transform 0.25s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

input[type="checkbox"]:checked::after {
    transform: translateX(14px);
}

/* ── Status Box ─────────────────────────────────────────────── */
.status-box {
    background: var(--ibm-bg);
    border: 1px solid var(--border-std);
    border-radius: 4px;
    padding: 12px 14px;
    margin-bottom: 14px;
}

.status-box .label {
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--text-dim);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.status-box .status-val {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--dark);
    font-weight: 600;
}

/* ── Feature Palette ────────────────────────────────────────── */
.feature-palette {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 12px;
    max-height: 300px;
    overflow-y: auto;
    padding-right: 4px;
}

.qml-var {
    box-sizing: border-box;
    background: #ffffff;
    border: 1px solid var(--border-std);
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--dark);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.qml-var:hover {
    border-color: var(--ibm-blue);
    background: rgba(15, 98, 254, 0.04);
    color: var(--ibm-blue);
}

.qml-var.active {
    border-width: 2px;
    border-color: var(--ibm-blue);
    color: var(--ibm-blue);
    box-shadow: 0 0 0 3px rgba(15, 98, 254, 0.15);
}

.qml-var .var-status {
    font-weight: 900;
    font-size: 0.9rem;
}

.qml-var .var-name {
    flex-grow: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── Modeler Toolbar ────────────────────────────────────────── */
.modeler-toolbar {
    padding: 12px 20px;
    background: #ffffff;
    border-bottom: 1px solid var(--border-std);
    display: flex;
    gap: 20px;
    align-items: center;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.gate-group,
.param-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    border-right: 1px solid #e2e8f0;
    padding-right: 20px;
}

.modeler-toolbar>div:last-child,
.modeler-toolbar .gate-group:last-child {
    border-right: none;
    padding-right: 0;
}

.gate-group label,
.param-group label {
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--text-dim);
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* Gate button row inside gate-group */
.gate-group>div,
.param-group>div {
    display: flex;
    gap: 6px;
    align-items: center;
}

/* ── QML Gate Buttons (IBM color coding from styles.css) ─────── */
.qml-gate {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: grab;
    color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.1);
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    font-family: var(--font-ui);
}

.qml-gate:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
    filter: brightness(1.08);
}

.qml-gate:active {
    cursor: grabbing;
    transform: scale(0.95);
}

/* IBM color coding — matches styles.css gate-slot colors */
.h-gate {
    background: var(--ibm-red);
}

/* Hadamard: IBM Red */
.rx-gate,
.ry-gate,
.rz-gate {
    background: var(--ibm-orange);
}

/* Rotation: IBM Orange */
.x-gate,
.y-gate,
.z-gate {
    background: var(--ibm-green);
}

/* Pauli: IBM Green */
.cx-gate,
.cz-gate {
    background: var(--ibm-light-blue);
}

/* Two-qubit: IBM Light Blue */
.swap-gate {
    background: var(--ibm-grey);
    min-width: 50px;
    width: auto;
    height: 46px;
    padding: 0 6px;
    font-size: 0.85rem;
    font-weight: 700;
}

/* SWAP: IBM Grey */
.s-gate,
.t-gate {
    background: var(--ibm-teal);
}

/* Phase: IBM Teal */

/* Parameter / variable chip */
.theta-var {
    background: var(--ibm-purple);
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-family: var(--font-mono);
    cursor: grab;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.15s;
}

.theta-var:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

/* ── Canvas Viewport ─────────────────────────────────────────── */
.canvas-viewport {
    flex: 1;
    padding: 24px 32px;
    background: #FAFAFA;
    overflow: auto;
    border-top: 1px solid var(--border-std);
}

.circuit-canvas {
    display: flex !important;
    flex-direction: column !important;
    width: 10000px !important;
    /* Forces the scrollable area to be large */
    min-width: 100% !important;
    gap: 15px !important;
    background: #FAFAFA;
}

.qubit-wire {
    display: flex;
    align-items: center;
    position: relative;
    min-height: 50px;
    width: 100% !important;
    /* Spans the full 10,000px of the canvas */
    min-width: 100% !important;
}

.qubit-wire::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 1px;
    background: rgba(0, 0, 0, 0.08);
    /* Continuous grey wire */
    pointer-events: none;
    z-index: 1;
}

/* Visual "knots" (dots), placeholder boxes, and plus symbols on the wire */
.qubit-wire::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    height: 50px;
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='50' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='25' y='4' width='50' height='42' rx='4' fill='none' stroke='black' stroke-opacity='0.06' stroke-width='2' stroke-dasharray='4 4'/%3E%3Ccircle cx='50' cy='25' r='1.5' fill='black' fill-opacity='0.12'/%3E%3Ctext x='50' y='29' font-family='Arial' font-size='12' fill='black' fill-opacity='0.2' text-anchor='middle'%3E+%3C/text%3E%3C/svg%3E");
    background-size: 100px 50px;
    background-position: 80px center;
    /* Perfect alignment: 65px label + 40px padding + 25px half-slot - 50px SVG center */
    background-repeat: repeat-x;
    pointer-events: none;
    z-index: 2;
}

/* Remove redundant borders and plus text from active empty slots to prevent "double boxes/pluses" */
.gate-slot.empty,
.qml-slot.empty {
    border: none !important;
    background: transparent !important;
    color: transparent !important;
    /* Hides the HTML plus symbol */
    font-size: 0 !important;
    /* Ensures no layout shift from hidden text */
    box-shadow: none !important;
    pointer-events: auto;
    /* Keep click/drag functionality */
}

.gate-slot.empty:hover,
.qml-slot.empty:hover {
    background: rgba(15, 98, 254, 0.05) !important;
    border: 1px solid rgba(15, 98, 254, 0.3) !important;
}

/* Wire label (qubit label — matches .qubit-label in styles.css) */
.wire-label,
.qubit-label {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--dark);
    font-weight: 700;
    min-width: 65px;
    text-align: center;
    background: rgba(250, 250, 250, 0.98) !important;
    backdrop-filter: blur(8px);
    z-index: 100 !important;
    flex-shrink: 0;
    padding: 12px 10px;
    border-right: 1px solid rgba(0, 0, 0, 0.1);
    position: sticky !important;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Auto-measure indicator (measurement gate at the end) should also be stable */
.auto-measure-indicator {
    position: sticky !important;
    right: 0;
    z-index: 100 !important;
    background: rgba(250, 250, 250, 0.98) !important;
    backdrop-filter: blur(8px);
    padding: 0 15px;
    border-left: 1px solid rgba(0, 0, 0, 0.1);
    min-width: 65px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-left: auto !important;
    /* Forces it to the end of the 10,000px line */
}

/* Remove the mask that was causing the "breakdown" in infinite wires */
.auto-measure-indicator::after {
    display: none !important;
}

/* Gate slots and wires */
.wire-line {
    display: flex;
    align-items: center;
    gap: 50px;
    flex: 1;
    position: relative;
    padding: 0 40px;
    min-width: max-content !important;
    /* Force wire to match gate count width */
}

/* Remove the 100% override to allow the infinite -10000px line to work */
.wire-line::before {
    display: none !important;
    /* Hide the sub-line, we use the parent wire line */
}

/* Gate drop slot (matches styles.css .gate-slot.empty) */
.qml-slot {
    width: 50px;
    height: 50px;
    border: 2px dashed rgba(198, 198, 198, 0.5);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    background: transparent;
    opacity: 0.7;
    flex-shrink: 0;
    position: relative;
    z-index: 5;
}

.qml-slot:hover {
    opacity: 1;
    border-color: var(--ibm-blue);
    border-style: solid;
    background: rgba(15, 98, 254, 0.05);
    box-shadow: 0 0 0 2px rgba(15, 98, 254, 0.1);
}

/* Gate placed in a slot */
.qml-gate-inst {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    color: white;
    font-weight: 700;
    font-size: 0.8rem;
    font-family: var(--font-ui);
    position: relative;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
    cursor: pointer;
    transition: all 0.15s;
}

.qml-gate-inst:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.qml-gate-inst::after {
    content: attr(data-var);
    position: absolute;
    bottom: -18px;
    font-size: 0.6rem;
    font-family: var(--font-mono);
    color: var(--ibm-blue);
    white-space: nowrap;
}

/* ── Analytics & Telemetry Panel ─────────────────────────────── */
.hyper-controls {
    margin-bottom: 16px;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.metric-card {
    background: var(--ibm-bg);
    padding: 12px;
    border-radius: 4px;
    text-align: center;
    border: 1px solid var(--border-std);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.metric-card .lbl {
    display: block;
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--text-dim);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.metric-card .val {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--dark);
    font-family: var(--font-mono);
}

.viz-container {
    margin-bottom: 20px;
}

.log-container {
    margin-bottom: 14px;
}

.mini-header {
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--text-dim);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.std-chart {
    width: 100%;
    height: 160px;
}

.std-viz {
    width: 100%;
    height: 200px;
}

/* Terminal log (dark — matches styles.css dark aesthetic) */
.std-log {
    background: #161616;
    color: #a8b8d8;
    height: 120px;
    padding: 12px 14px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    overflow-y: auto;
    border: 1px solid #262626;
    line-height: 1.6;
}

/* ── Buttons (mirrors styles.css .btn system) ───────────────── */
.std-btn {
    border: none;
    padding: 10px 18px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-family: var(--font-ui);
    letter-spacing: 0.01em;
}

.std-btn:active {
    transform: scale(0.97);
}

/* Primary: IBM Blue */
.btn-primary {
    background: var(--ibm-blue);
    color: white;
    box-shadow: 0 1px 3px rgba(15, 98, 254, 0.3);
}

.btn-primary:hover {
    background: var(--primary-dark);
    box-shadow: 0 4px 8px rgba(15, 98, 254, 0.25);
    transform: translateY(-1px);
}

/* Secondary: Light grey */
.btn-secondary {
    background: #E0E0E0;
    color: var(--dark);
    border: 1px solid #c6c6c6;
}

.btn-secondary:hover {
    background: #C6C6C6;
    transform: translateY(-1px);
}

/* Template buttons: matches styles.css .editor-controls .btn */
.btn-template {
    background: white;
    color: var(--dark);
    border: 1px solid var(--border-std);
    padding: 5px 10px;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-template:hover {
    background: var(--ibm-blue);
    color: white;
    border-color: var(--ibm-blue);
    transform: translateY(-1px);
}

/* ── Miscellaneous ──────────────────────────────────────────── */
#qubit-slider {
    accent-color: var(--ibm-blue);
    cursor: pointer;
}

.benchmarking-active {
    border-color: #f59e0b !important;
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2);
}

/* ── Custom Scrollbars (matches styles.css / gate-palette-scroll) */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 20px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}



/* ── Base ───────────────────────────────────────────────────── */
/* Works for both pages: qml-lab uses body.std-lab, qml-studio
   has no wrapper class — so we target both with a broad reset. */
body,
body.std-lab {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: var(--font-ui);
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── Header ─────────────────────────────────────────────────── */
.std-header {
    height: 64px;
    background: var(--accent-slate);
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.std-logo {
    font-weight: 800;
    font-size: 1.2rem;
    letter-spacing: 1px;
}

.std-logo .accent {
    color: var(--accent-indigo);
}

.std-logo .version {
    font-size: 0.7rem;
    font-family: var(--font-mono);
    color: #94a3b8;
    margin-left: 10px;
}

@keyframes pulse-opacity {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }
}

.pulse {
    display: inline-block;
    color: #ef4444;
    margin-right: 8px;
    animation: pulse-opacity 1s infinite;
}

.std-actions {
    display: flex;
    gap: 12px;
}

/* ── Workspace Layout ───────────────────────────────────────── */
.std-workspace {
    flex: 1;
    display: grid;
    grid-template-columns: 320px 1fr 360px;
    gap: 16px;
    padding: 16px;
}

.std-panel {
    background: var(--bg-panel);
    border: 1px solid var(--border-std);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.panel-header {
    padding: 12px 16px;
    background: #f1f5f9;
    border-bottom: 1px solid var(--border-std);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-dim);
    letter-spacing: 0.5px;
    border-radius: 12px 12px 0 0;
}

.panel-body {
    padding: 20px;
    flex: 1;
    overflow-y: auto;
}

.panel-body.scrollable {
    overflow-y: auto;
}

/* ── Form Controls ──────────────────────────────────────────── */
.control-group {
    margin-bottom: 20px;
}

.control-group label {
    display: block;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-dim);
    margin-bottom: 8px;
}

.std-select,
.std-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-std);
    border-radius: 6px;
    font-family: var(--font-ui);
    font-size: 0.85rem;
    background: #fdfdfd;
    box-sizing: border-box;
}

/* ── Engineering Pipeline (Studio-only block) ───────────────── */
.engineering-cluster {
    background: #f8fafc;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.engineering-cluster>label {
    color: var(--accent-indigo);
    margin-bottom: 12px;
    display: block;
}

.sub-control {
    margin-bottom: 10px;
}

.sub-control label {
    display: block;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-dim);
    margin-bottom: 6px;
}

/* Toggle switch (used in Studio PCA-LITE control) */
input[type="checkbox"] {
    appearance: none;
    width: 32px;
    height: 18px;
    background: #e2e8f0;
    border-radius: 20px;
    position: relative;
    cursor: pointer;
    transition: background 0.3s;
}

input[type="checkbox"]:checked {
    background: var(--accent-indigo);
}

input[type="checkbox"]::after {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    background: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: transform 0.3s;
}

input[type="checkbox"]:checked::after {
    transform: translateX(14px);
}

/* ── Status Box ─────────────────────────────────────────────── */
.status-box {
    background: #f8fafc;
    border: 1px solid var(--border-std);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
}

.status-box .label {
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--text-dim);
    margin-bottom: 4px;
}

.status-box .status-val {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--accent-slate);
}

/* ── Feature Palette ────────────────────────────────────────── */
.feature-palette {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 12px;
    max-height: 300px;
    overflow-y: auto;
    padding-right: 4px;
}

.qml-var {
    box-sizing: border-box;
    background: #fdfdfd;
    border: 1px solid var(--border-std);
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-dim);
}

.qml-var:hover {
    border-color: var(--accent-indigo);
    background: #f5f7ff;
    color: var(--text-main);
}

.qml-var.active {
    border-width: 2px;
    border-color: var(--accent-indigo);
    color: var(--accent-indigo);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
}

.qml-var .var-status {
    font-weight: 900;
    font-size: 0.9rem;
}

.qml-var .var-name {
    flex-grow: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── Circuit Modeler ────────────────────────────────────────── */
.modeler-toolbar {
    padding: 12px 20px;
    background: #f8fafc;
    border-bottom: 1px solid var(--border-std);
    display: flex;
    gap: 24px;
    align-items: center;
}

.gate-group,
.param-group {
    display: flex;
    gap: 8px;
}

.gate-group label,
.param-group label {
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--text-dim);
    display: block;
    margin-bottom: 4px;
}

.qml-gate {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: grab;
    color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Gate colours */
.h-gate {
    background: #6366f1;
}

.rx-gate {
    background: #06b6d4;
}

.ry-gate {
    background: #f59e0b;
}

.rz-gate {
    background: #8b5cf6;
}

.x-gate {
    background: #10b981;
}

.cx-gate {
    background: #3b82f6;
}

.cz-gate {
    background: #d946ef;
}

.swap-gate {
    background: #64748b;
}

.theta-var {
    background: #d946ef;
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-family: var(--font-mono);
    cursor: grab;
}

/* ── Canvas ─────────────────────────────────────────────────── */
.canvas-viewport {
    flex: 1;
    padding: 40px;
    background: white;
    overflow: auto;
}

.std-canvas {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.qml-wire {
    display: flex;
    align-items: center;
    gap: 16px;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 8px;
}

.wire-label {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: #94a3b8;
    width: 40px;
}

.qml-slot {
    width: 44px;
    height: 44px;
    border: 2px dashed #e2e8f0;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}

.qml-slot:hover {
    border-color: var(--accent-indigo);
    background: #f5f3ff;
}

.qml-gate-inst {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    color: white;
    font-weight: 800;
    font-size: 0.85rem;
    position: relative;
}

.qml-gate-inst::after {
    content: attr(data-var);
    position: absolute;
    bottom: -18px;
    font-size: 0.6rem;
    font-family: var(--font-mono);
    color: var(--accent-indigo);
}

/* ── Analytics & Telemetry ──────────────────────────────────── */
.hyper-controls {
    margin-bottom: 20px;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.metric-card {
    background: #f8fafc;
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid #e2e8f0;
}

.metric-card .lbl {
    display: block;
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--text-dim);
    margin-bottom: 4px;
}

.metric-card .val {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--accent-slate);
    font-family: var(--font-mono);
}

.viz-container {
    margin-bottom: 24px;
}

.log-container {
    margin-bottom: 16px;
}

.mini-header {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-dim);
    margin-bottom: 8px;
}

.std-chart {
    width: 100%;
    height: 160px;
}

.std-viz {
    width: 100%;
    height: 200px;
}

.std-log {
    background: #0f172a;
    color: #94a3b8;
    height: 120px;
    padding: 12px;
    border-radius: 8px;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    overflow-y: auto;
    border: 1px solid #1e293b;
}

/* ── Buttons ────────────────────────────────────────────────── */
.std-btn {
    border: none;
    padding: 10px 18px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: white;
    color: var(--accent-slate);
}

.btn-primary:hover {
    background: #f1f5f9;
    transform: translateY(-1px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.18);
}

.btn-template {
    background: #f1f5f9;
    color: var(--accent-slate);
    border: 1px solid var(--border-std);
    padding: 6px 12px;
    font-size: 0.65rem;
    text-transform: uppercase;
}

.btn-template:hover {
    background: var(--accent-indigo);
    color: white;
    border-color: var(--accent-indigo);
}

/* ── Misc ───────────────────────────────────────────────────── */
#qubit-slider {
    accent-color: var(--accent-indigo);
    cursor: pointer;
}

.benchmarking-active {
    border-color: #f59e0b !important;
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2);
}

/* ── Custom Scrollbars ──────────────────────────────────────── */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* =============================================================
   EXTENDED DESIGN SYSTEM
   Patterns ported from landing.css + styles.css
   ============================================================= */

/* ── Extended Design Tokens ─────────────────────────────────── */
:root {
    /* IBM Quantum Composer Colors */
    --ibm-red: #FA4D56;
    --ibm-purple: #6929C4;
    --ibm-blue: #0F62FE;
    --ibm-teal: #007D79;
    --ibm-light-blue: #1192E8;
    --ibm-green: #198038;
    --ibm-orange: #FF832B;
    --ibm-grey: #525252;
    --ibm-light-grey: #D1D1D1;
    --ibm-bg: #F4F4F4;

    /* Landing palette */
    --primary-color: #4f46e5;
    --secondary-color: #7c3aed;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.4);
    --text-primary-l: #111827;
    --text-secondary-l: #4b5563;

    /* Shared */
    --primary: #4F46E5;
    --primary-dark: #3730A3;
    --secondary: #7C3AED;
    --success: #198038;
    --danger: #FA4D56;
    --dark: #0F172A;
    --light: #F8FAFC;
    --border: #E5E7EB;
}

/* ── Global Font Headings ───────────────────────────────────── */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Outfit', 'Poppins', sans-serif;
    color: var(--dark);
    line-height: 1.2;
    margin-bottom: 0.5em;
}

/* ── Nav Link Styles (shared header navigation) ─────────────── */
.nav-link {
    text-decoration: none;
    color: #4b5563;
    font-weight: 500;
    font-size: 1rem;
    padding: 8px 0;
    position: relative;
    transition: color 0.2s;
}

.nav-link:hover {
    color: var(--ibm-blue);
}

.nav-link.active {
    color: var(--ibm-blue);
    font-weight: 600;
}

.nav-link.active::after {
    content: '';
    display: block;
    width: 100%;
    height: 2px;
    background: var(--ibm-blue);
    position: absolute;
    bottom: 0;
    left: 0;
    border-radius: 2px;
}

/* ── Logo Icon ──────────────────────────────────────────────── */
.logo-icon {
    width: 40px;
    height: 40px;
    background: var(--primary);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

/* ── Hero Section (Landing-style) ───────────────────────────── */
.hero {
    position: relative;
    padding: 120px 20px;
    text-align: center;
    overflow: hidden;
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.hero-content {
    max-width: 800px;
    position: relative;
    z-index: 10;
}

.hero h1 {
    font-size: clamp(2.5rem, 8vw, 4.5rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 24px;
    color: var(--primary-color);
    letter-spacing: -0.02em;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-secondary-l);
    margin-bottom: 40px;
    line-height: 1.6;
}

.cta-group {
    display: flex;
    gap: 16px;
    justify-content: center;
}

.btn-landing {
    padding: 16px 32px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1.1rem;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.btn-primary-landing {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.4);
}

.btn-primary-landing:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 25px -5px rgba(79, 70, 229, 0.4);
}

.btn-secondary-landing {
    background: white;
    color: #4f46e5;
    border: 1px solid rgba(79, 70, 229, 0.2);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.btn-secondary-landing:hover {
    background: #f1f5f9;
    transform: translateY(-2px);
}

/* ── Features Section (Landing-style) ──────────────────────── */
.features {
    padding: 80px 20px;
    background: white;
    position: relative;
}

.container-landing {
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    text-align: center;
    margin-bottom: 60px;
}

.section-title h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: #111827;
}

.section-title p {
    color: var(--text-secondary-l);
    font-size: 1.1rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 32px;
}

.feature-card {
    padding: 40px;
    border-radius: 24px;
    background: #ffffff;
    border: 1px solid #f1f5f9;
    transition: all 0.3s ease;
    cursor: default;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.08);
    border-color: rgba(79, 70, 229, 0.1);
}

.feature-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: rgba(79, 70, 229, 0.1);
    color: #4f46e5;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
}

.feature-card h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: #111827;
}

.feature-card p {
    color: var(--text-secondary-l);
    line-height: 1.6;
}

/* ── Stats Grid (Landing-style) ─────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 24px;
    margin-top: 80px;
    text-align: center;
}

.stat-item h4 {
    font-size: 3rem;
    font-weight: 800;
    color: #4f46e5;
    margin-bottom: 8px;
}

.stat-item p {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary-l);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ── Footer (Landing-style) ─────────────────────────────────── */
.footer-landing {
    background: #0f172a;
    color: white;
    padding: 60px 20px;
    text-align: center;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-logo {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 24px;
    display: block;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-bottom: 40px;
}

.footer-links a {
    color: #94a3b8;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: white;
}

.copyright {
    color: #64748b;
    font-size: 0.9rem;
}

/* ── General App Footer ─────────────────────────────────────── */
.footer {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    padding: 20px 0;
    text-align: center;
    color: #525252;
    font-size: 0.8125rem;
}

.footer p {
    margin: 4px 0;
}

/* ── IBM-Colored Button Base ────────────────────────────────── */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-family: 'Outfit', sans-serif;
}

.btn-ibm-primary {
    background: var(--ibm-blue);
    color: white;
}

.btn-ibm-primary:hover {
    background: var(--primary-dark);
}

.btn-ibm-secondary {
    background: #E0E0E0;
    color: var(--dark);
}

.btn-ibm-secondary:hover {
    background: #C6C6C6;
}

.btn,
.std-btn {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn:active,
.std-btn:active {
    transform: scale(0.98);
}

/* ── Expand Button ──────────────────────────────────────────── */
.expand-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    color: #9ca3af;
    transition: all 0.2s;
    padding: 6px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.expand-btn:hover {
    color: var(--dark);
    background-color: #f3f4f6;
    transform: scale(1.1);
}

/* ── Help Button ────────────────────────────────────────────── */
.btn-help {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(79, 70, 229, 0.05);
    border: 1px solid rgba(79, 70, 229, 0.1);
    padding: 6px 14px;
    border-radius: 8px;
    color: #4F46E5;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-help:hover {
    background: #4F46E5;
    color: white;
    transform: translateY(-1px);
}

/* ── Premium Logout Button ──────────────────────────────────── */
.premium-logout-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #ffffff;
    border: 1.5px solid #fecaca;
    color: #ef4444;
    padding: 10px 20px;
    border-radius: 14px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 6px -1px rgba(239, 68, 68, 0.05);
}

.premium-logout-btn:hover {
    background: #ef4444;
    color: #ffffff;
    border-color: #ef4444;
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(239, 68, 68, 0.2);
}

.premium-logout-btn:active {
    transform: scale(0.96);
}

.premium-logout-btn i {
    width: 18px;
    height: 18px;
    transition: transform 0.3s ease;
}

.premium-logout-btn:hover i {
    transform: translateX(2px);
}

/* ── Modal Overlay (simple expand) ─────────────────────────── */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.expanded-content {
    background: white;
    width: 95%;
    height: 92%;
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    position: relative;
    padding: 40px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: scaleUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.expanded-content h2 {
    margin-bottom: 24px;
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--dark);
    letter-spacing: -0.02em;
}

.close-modal-btn {
    position: absolute;
    top: 25px;
    right: 25px;
    background: #f1f5f9;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    color: #64748b;
    z-index: 100;
}

.close-modal-btn:hover {
    background: #e2e8f0;
    color: #1e293b;
    transform: rotate(90deg);
}

/* ── Ultra-Premium Astra Modal ──────────────────────────────── */
.astra-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.astra-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.astra-modal-window {
    background: #ffffff;
    width: 95%;
    max-width: 480px;
    border-radius: 28px;
    padding: 0;
    box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.3);
    transform: scale(0.9) translateY(40px);
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.8);
}

.astra-modal-overlay.active .astra-modal-window {
    transform: scale(1) translateY(0);
}

.astra-modal-header {
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    padding: 40px 40px 20px 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    text-align: center;
}

.astra-modal-icon {
    width: 72px;
    height: 72px;
    background: #ffffff;
    border-radius: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.06);
    border: 1px solid #f1f5f9;
}

.astra-modal-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0;
    letter-spacing: -0.02em;
}

.astra-modal-body {
    padding: 0 40px 40px 40px;
    font-size: 1.05rem;
    line-height: 1.6;
    color: #64748b;
    text-align: center;
}

.astra-modal-footer {
    padding: 0 40px 40px 40px;
    display: flex;
    gap: 16px;
}

.astra-btn {
    flex: 1;
    padding: 18px;
    border-radius: 16px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    font-family: 'Outfit', sans-serif;
    letter-spacing: 0.01em;
}

.astra-btn-primary {
    background: #0f172a;
    color: white;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.2);
}

.astra-btn-primary:hover {
    background: #1e293b;
    transform: translateY(-2px);
    box-shadow: 0 15px 30px rgba(15, 23, 42, 0.3);
}

.astra-btn-secondary {
    background: #f1f5f9;
    color: #475569;
}

.astra-btn-secondary:hover {
    background: #e2e8f0;
    color: #1e293b;
    transform: translateY(-2px);
}

.modal-close-x {
    position: absolute;
    top: 20px;
    right: 20px;
    background: #ffffff;
    border: 1.5px solid #f1f5f9;
    width: 36px;
    height: 36px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 100;
}

.modal-close-x:hover {
    color: #ef4444;
    border-color: #fee2e2;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.1);
}

/* Modal icon type colours */
.type-success .astra-modal-icon {
    background: #ecfdf5;
    border-color: #10b981;
    color: #10b981;
}

.type-error .astra-modal-icon {
    background: #fef2f2;
    border-color: #ef4444;
    color: #ef4444;
}

.type-warning .astra-modal-icon {
    background: #fffbeb;
    border-color: #f59e0b;
    color: #f59e0b;
}

.type-info .astra-modal-icon {
    background: #eff6ff;
    border-color: #3b82f6;
    color: #3b82f6;
}

/* ── Notification Toast System ──────────────────────────────── */
.notification-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.notification-toast {
    min-width: 320px;
    max-width: 480px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 14px;
    pointer-events: auto;
    position: relative;
    overflow: hidden;
    animation: toastSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    transition: all 0.3s ease;
}

.notification-toast::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 6px;
    background: #3b82f6;
}

.notification-toast.error::before {
    background: #ef4444;
}

.notification-toast.success::before {
    background: #10b981;
}

.notification-toast.warning::before {
    background: #f59e0b;
}

.notification-toast.hide {
    opacity: 0;
    transform: translateX(40px) scale(0.95);
}

.notification-close {
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    transition: all 0.2s;
}

.notification-close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #4b5563;
}

/* ── Tour Popover (Astra guide) ─────────────────────────────── */
.astra-tour-popover {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    border-radius: 16px !important;
    padding: 24px !important;
    max-width: 320px !important;
}

.driver-popover-title {
    font-family: 'Outfit', sans-serif;
    font-weight: 700 !important;
    font-size: 1.1rem !important;
    color: #111827 !important;
    margin-bottom: 8px !important;
}

.driver-popover-description {
    font-family: 'Outfit', sans-serif;
    font-size: 0.9rem !important;
    color: #4b5563 !important;
    line-height: 1.6 !important;
}

.driver-popover-arrow {
    border-color: rgba(255, 255, 255, 0.95) !important;
}

.driver-popover-navigation-btns button {
    font-family: 'Outfit', sans-serif !important;
    font-weight: 600 !important;
    border-radius: 8px !important;
    padding: 6px 16px !important;
    text-shadow: none !important;
    transition: all 0.2s !important;
}

.driver-popover-next-btn {
    background: #4F46E5 !important;
    color: white !important;
    border: none !important;
}

.driver-popover-prev-btn {
    background: #f1f5f9 !important;
    color: #475569 !important;
    border: 1px solid #e2e8f0 !important;
}

.driver-popover-close-btn {
    color: #94a3b8 !important;
}

.driver-popover-progress-text {
    font-size: 0.75rem !important;
    color: #94a3b8 !important;
    margin-top: 12px !important;
}

/* ── Examples Grid (styles.css style) ──────────────────────── */
.examples-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    grid-auto-rows: 1fr;
    gap: 20px;
    padding: 10px 4px;
}

.example-category-head {
    grid-column: 1 / -1;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #94a3b8;
    font-weight: 700;
    margin-top: 32px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.example-category-head::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #f1f5f9;
}

.example-category-head:first-child {
    margin-top: 0;
}

.example-btn {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    padding: 24px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: left;
    position: relative;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    height: 100%;
    min-height: 110px;
}

.example-btn:hover {
    transform: translateY(-4px);
    border-color: #3b82f6;
    box-shadow: 0 12px 20px -8px rgba(59, 130, 246, 0.12);
    background: #f8faff;
}

.example-icon-box {
    width: 44px;
    height: 44px;
    background: #eff6ff;
    color: #3b82f6;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.example-btn:hover .example-icon-box {
    background: #3b82f6;
    color: #ffffff;
    transform: rotate(10deg) scale(1.1);
}

.example-btn-text {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.example-btn-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: #1e293b;
    transition: color 0.3s ease;
}

.example-btn:hover .example-btn-title {
    color: #1e40af;
}

.example-btn-desc {
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 2px;
}

.example-btn-arrow {
    font-size: 1.2rem;
    color: #3b82f6;
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.3s ease;
    margin-left: auto;
}

.example-btn:hover .example-btn-arrow {
    opacity: 1;
    transform: translateX(0);
}

/* ── Result Bar Charts ──────────────────────────────────────── */
.result-bar {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    gap: 12px;
}

.result-label {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    min-width: 70px;
    font-size: 0.875rem;
}

.result-bar-container {
    flex: 1;
    background: var(--light);
    border-radius: 4px;
    height: 28px;
    position: relative;
    overflow: hidden;
}

.result-bar-fill {
    height: 100%;
    background: var(--ibm-blue);
    border-radius: 4px;
    transition: width 0.4s ease;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 8px;
    color: white;
    font-weight: 600;
    font-size: 0.75rem;
}

/* ── Vertical Probability Bar Chart ─────────────────────────── */
.chart-container-v {
    display: flex;
    position: relative;
    padding: 50px 20px 60px 20px;
    flex: 1;
    min-height: 0;
    width: 100%;
    background: transparent;
    border-radius: 8px;
    margin-top: 0;
}

.chart-y-axis-v {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding-right: 15px;
    height: 100%;
    margin-top: 0;
    font-size: 0.75rem;
    color: #64748b;
    text-align: right;
    width: 55px;
    font-weight: 700;
    font-family: 'IBM Plex Mono', monospace;
}

.chart-area-v {
    flex: 1;
    position: relative;
    height: 100%;
    border-left: 2px solid #e2e8f0;
    border-bottom: 2px solid #e2e8f0;
    padding-top: 0;
}

.chart-grid-v {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    pointer-events: none;
}

.grid-line-v {
    width: 100%;
    height: 1px;
    background: #f1f1f1;
}

.chart-bars-container-v {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: space-evenly;
    align-items: flex-end;
    padding: 0 50px;
    z-index: 5;
    gap: 12px;
}

.bar-wrapper-v {
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    justify-content: flex-end;
    flex: 1;
    position: relative;
    padding-top: 0;
}

.bar-track-v {
    width: 36px;
    height: 100%;
    background: rgba(244, 244, 244, 0.4);
    border-radius: 4px 4px 0 0;
    position: relative;
    display: flex;
    align-items: flex-end;
    margin-bottom: 0;
}

.bar-fill-v {
    width: 100%;
    background: #0f62fe;
    border-radius: 4px 4px 0 0;
    transition: height 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    min-height: 0;
}

.bar-fill-v:hover {
    filter: brightness(1.1);
    cursor: pointer;
}

.bar-label-v {
    position: absolute;
    bottom: -32px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.75rem;
    color: #374151;
    font-weight: 700;
    font-family: 'IBM Plex Mono', monospace;
    white-space: nowrap;
}

.bar-value-v {
    position: absolute;
    top: -36px;
    left: 50%;
    transform: translateX(-50%) translateY(5px);
    background: white;
    color: #1a1a1a;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    white-space: nowrap;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    pointer-events: none;
    text-align: center;
    z-index: 1000;
}

.bar-value-v::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid white;
}

.bar-fill-v:hover .bar-value-v {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* Expanded chart overrides */
.expanded-content .chart-container-v {
    height: 100% !important;
    flex: 1;
    min-height: 350px;
    padding-bottom: 60px;
    margin-top: 25px;
    width: 100% !important;
    max-width: none !important;
}

.expanded-content .chart-bars-container-v {
    max-width: none !important;
    padding: 0 100px;
}

.expanded-content .bar-track-v {
    width: 42px;
    border-radius: 6px 6px 0 0;
}

.expanded-content .bar-fill-v {
    border-radius: 6px 6px 0 0;
}

.expanded-content .bar-label-v {
    font-size: 0.85rem;
    bottom: -35px;
    font-weight: 700;
}

.expanded-content .chart-y-axis-v {
    font-size: 0.85rem;
    width: 55px;
    padding-right: 15px;
}

/* ── Drag-and-Drop Visual Feedback ──────────────────────────── */
.gate-slot.moving {
    opacity: 0.5;
    cursor: grabbing !important;
    transform: scale(0.95);
    transition: all 0.2s ease;
}

/* ── Placeholder / Empty State ──────────────────────────────── */
.placeholder {
    text-align: center;
    color: #8D8D8D;
    padding: 60px 20px;
    font-size: 0.875rem;
}

/* ── Benchmarking Active Highlight ──────────────────────────── */
.benchmarking-active {
    border-color: #f59e0b !important;
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2);
}

/* ── Keyframe Animations ────────────────────────────────────── */
@keyframes scaleUp {
    from {
        transform: scale(0.96);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes toastSlideIn {
    from {
        transform: translateX(100%) scale(0.9);
        opacity: 0;
    }

    to {
        transform: translateX(0) scale(1);
        opacity: 1;
    }
}

/* ── Responsive: Landing CTA stack on mobile ────────────────── */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 3rem;
    }

    .cta-group {
        flex-direction: column;
    }
}