/* Generated from demos/graph/style.css by demos/sync_docs_demos.py. Do not edit. */
/* Graph MIS Demo - Dark / Light Theme */

:root, [data-theme="dark"] {
    --bg: #0b0f1a;
    --surface: #131929;
    --border: #1e2a42;
    --text: #c8d6e5;
    --text-muted: #5a6a82;
    --accent: #00d4ff;
    --accent-glow: rgba(0, 212, 255, 0.3);
    --node: #6b7280;
    --node-glow: rgba(107, 114, 128, 0.3);
    --node-fill: #131929;
    --node-selected: #ef4444;
    --node-selected-glow: rgba(239, 68, 68, 0.3);
    --node-selected-fill: #3d1010;
    --node-active: #ffd700;
    --node-active-glow: rgba(255, 215, 0, 0.3);
    --node-partition-a: #4d9fff;
    --node-partition-a-glow: rgba(77, 159, 255, 0.3);
    --node-partition-b: #ff4757;
    --node-partition-b-glow: rgba(255, 71, 87, 0.3);
    --edge-highlight: #a78bfa;
    --edge-highlight-glow: rgba(167, 139, 250, 0.35);
    --edge: #3a4a62;
    --edge-conflict: #ff3860;
    --edge-conflict-glow: rgba(255, 56, 96, 0.4);
    --btn-bg: #00d4ff;
    --btn-text: #0b0f1a;
    --accent-hover: #33ddff;
    --heading: #ffffff;
    --overlay-bg: rgba(11, 15, 26, 0.75);
    --grid-line: #1a2235;
    --grid-label: #2a3550;
    --th-bg: rgba(30, 42, 66, 0.5);
    --one-bg: rgba(0, 212, 255, 0.1);
    --selected-bg: rgba(239, 68, 68, 0.1);
    --radius: 6px;
}

[data-theme="light"] {
    --bg: #f0f2f5;
    --surface: #ffffff;
    --border: #d0d7de;
    --text: #1f2328;
    --text-muted: #656d76;
    --accent: #0969da;
    --accent-glow: rgba(9, 105, 218, 0.2);
    --node: #9ca3af;
    --node-glow: rgba(156, 163, 175, 0.2);
    --node-fill: #ffffff;
    --node-selected: #dc2626;
    --node-selected-glow: rgba(220, 38, 38, 0.25);
    --node-selected-fill: #fde8e8;
    --node-active: #bf8700;
    --node-active-glow: rgba(191, 135, 0, 0.25);
    --node-partition-a: #2563eb;
    --node-partition-a-glow: rgba(37, 99, 235, 0.25);
    --node-partition-b: #dc2626;
    --node-partition-b-glow: rgba(220, 38, 38, 0.25);
    --edge-highlight: #7c3aed;
    --edge-highlight-glow: rgba(124, 58, 237, 0.2);
    --edge: #8b949e;
    --edge-conflict: #cf222e;
    --edge-conflict-glow: rgba(207, 34, 46, 0.2);
    --btn-bg: #0969da;
    --btn-text: #ffffff;
    --accent-hover: #2188ff;
    --heading: #1f2328;
    --overlay-bg: rgba(255, 255, 255, 0.8);
    --grid-line: #d0d7de;
    --grid-label: #656d76;
    --th-bg: rgba(208, 215, 222, 0.4);
    --one-bg: rgba(9, 105, 218, 0.1);
    --selected-bg: rgba(220, 38, 38, 0.1);
}

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

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    padding: 2rem 1rem;
}

.app {
    width: 100%;
    max-width: 760px;
}

/* Header */
header {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.theme-btn {
    margin-left: auto;
    align-self: center;
}

.title-group {
    display: flex;
    flex-direction: column;
    gap: 0;
}

h1 {
    font-size: 1.4rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--heading);
}

.problem-desc {
    margin: 0;
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.3;
}

.badge {
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--accent);
    border: 1px solid var(--accent);
    border-radius: 3px;
    padding: 2px 8px;
}

/* Problem selector */
#problem-select {
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.35rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
}

/* Toolbar */
.toolbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

button {
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius);
    padding: 0.5rem 1.4rem;
    cursor: pointer;
    transition: all 0.15s;
}

#btn-solve {
    background: var(--accent);
    color: var(--btn-text);
    box-shadow: 0 0 12px var(--accent-glow);
}

#btn-solve:hover:not(:disabled) {
    background: var(--accent-hover);
    box-shadow: 0 0 20px var(--accent-glow);
}

#btn-solve:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

#btn-solve[aria-busy="true"] {
    position: relative;
    color: transparent;
}

#btn-solve[aria-busy="true"]::after {
    content: '';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--btn-text);
}

button.outline {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
}

button.outline:hover {
    color: var(--text);
    border-color: var(--text-muted);
}

#btn-theme {
    padding: 0.5rem 0.7rem;
    font-size: 1rem;
    line-height: 1;
}

.time-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.time-control label {
    white-space: nowrap;
}

.time-control input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 120px;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    outline: none;
}

.time-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    box-shadow: 0 0 6px var(--accent-glow);
}

.time-control input[type="range"]::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent);
    border: none;
    cursor: pointer;
    box-shadow: 0 0 6px var(--accent-glow);
}

#time-value {
    min-width: 2.5em;
    text-align: right;
    font-variant-numeric: tabular-nums;
    color: var(--accent);
    font-weight: 600;
}

/* Generation toolbar */
.gen-toolbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.gen-group {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.gen-group label {
    white-space: nowrap;
    font-weight: 500;
}

.gen-group input[type="number"] {
    width: 4em;
    padding: 0.35rem 0.4rem;
    font-family: inherit;
    font-size: 0.8rem;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-align: center;
    outline: none;
}

.gen-group input[type="number"]:focus {
    border-color: var(--accent);
}

/* Graph template selector */
#gen-type {
    padding: 0.35rem 0.5rem;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    outline: none;
    cursor: pointer;
}

#gen-type:focus {
    border-color: var(--accent);
}

.gen-params {
    display: flex;
    align-items: center;
}

.gen-param {
    display: none;
}

.gen-param.active {
    display: flex;
}

/* Canvas */
.canvas-wrap {
    position: relative;
    margin-bottom: 0.75rem;
}

#graph-canvas {
    width: 100%;
    height: auto;
    display: block;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: crosshair;
    background: var(--surface);
}

.canvas-hint {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.75rem;
    color: var(--text-muted);
    pointer-events: none;
    transition: opacity 0.3s;
}

.canvas-hint.hidden {
    opacity: 0;
}

/* Solving overlay */
.solving-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--overlay-bg);
    border-radius: var(--radius);
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--accent);
    text-shadow: 0 0 20px var(--accent-glow);
    letter-spacing: 0.05em;
    animation: pulse-glow 1.5s ease-in-out infinite;
    pointer-events: none;
}

@keyframes pulse-glow {
    0%, 100% { text-shadow: 0 0 20px var(--accent-glow); }
    50% { text-shadow: 0 0 40px var(--accent), 0 0 60px var(--accent-glow); }
}

.solving-overlay.hidden {
    display: none;
}

/* Status bar */
.status-bar {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-muted);
    padding: 0.25rem 0;
    min-height: 1.8em;
    margin-bottom: 0.3rem;
}

.status-bar.success {
    color: var(--node-selected);
}

.status-bar.error {
    color: var(--edge-conflict);
}

/* Result panels */
.result-panels {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.result-panels.hidden {
    display: none;
}

.panel {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    background: var(--surface);
}

.panel h2 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 0.75rem;
    letter-spacing: 0.03em;
}

.vector-dim, .expr-info {
    font-weight: 400;
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* Variable vector table */
.vector-wrap {
    overflow-x: auto;
}

.vector-wrap table {
    border-collapse: collapse;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.75rem;
}

.vector-wrap th,
.vector-wrap td {
    width: 2em;
    height: 2em;
    text-align: center;
    border: 1px solid var(--border);
    padding: 0;
}

.vector-wrap th {
    color: var(--text-muted);
    font-weight: 500;
    background: var(--th-bg);
}

.vector-wrap td {
    color: var(--text-muted);
}

.vector-wrap td.one {
    color: var(--node-selected);
    font-weight: 700;
    background: var(--selected-bg);
}

/* QUBO/HUBO expression */
.expr-box {
    max-height: 300px;
    overflow: auto;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.7rem;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.75rem;
    white-space: pre-wrap;
    word-break: break-all;
}

/* Build info footer */
.build-date {
    font-size: 0.65rem;
    color: var(--text-muted);
}

/* Responsive */
@media (max-width: 500px) {
    .toolbar { flex-wrap: wrap; }
    .time-control { margin-left: 0; width: 100%; }
    .time-control input[type="range"] { flex: 1; }
}
