:root {
  --bg1: #0b0f1a;
  --bg2: #0f1730;
  --text: #eaf0ff;
  --muted: #b8c4ff;
  --panel: rgba(255, 255, 255, 0.07);
  --panel2: rgba(255, 255, 255, 0.1);
  --border: rgba(255, 255, 255, 0.14);
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  --radius: 18px;
  --gap: 16px;
  --sidebarW: 33.3333vw;
}

* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
}
body {
  margin: 0;
  font-family:
    ui-sans-serif,
    system-ui,
    -apple-system,
    Segoe UI,
    Roboto,
    Helvetica,
    Arial;
  color: var(--text);
  background:
    radial-gradient(1200px 700px at 30% 20%, rgba(108, 140, 255, 0.22), transparent 55%), radial-gradient(900px 600px at 80% 60%, rgba(140, 96, 255, 0.18), transparent 55%),
    linear-gradient(180deg, var(--bg1), var(--bg2));
}

/* ---- Layout ---- */
.shell {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.topbar {
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(10px);
}

.brand {
  font-weight: 900;
  letter-spacing: -0.02em;
  text-decoration: none;
  cursor: pointer;
  color: inherit;
}

.crumb {
  color: rgba(234, 240, 255, 0.78);
  font-size: 13px;
}

.main {
  flex: 1;
  min-height: 0; /* allows children to scroll properly */
  display: grid;
  grid-template-columns: var(--sidebarW) 1fr;
  gap: var(--gap);
  padding: var(--gap);
  padding-bottom: 78px; /* space for bottom nav */
}

.panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--panel), rgba(255, 255, 255, 0.04));
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  overflow: hidden;
  min-height: 0;
}

.dialog {
  display: flex;
  flex-direction: column;
}

.dialog-head {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.h-title {
  margin: 0;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: -0.01em;
}
.h-sub {
  margin: 4px 0 0 0;
  font-size: 13px;
  color: rgba(234, 240, 255, 0.8);
  line-height: 1.35;
}

.dialog-body {
  padding: 14px 16px 16px 16px;
  overflow: auto; /* scrollable */
  min-height: 0;
  line-height: 1.5;
  color: rgba(234, 240, 255, 0.92);
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.dialog-body h3 {
  margin: 14px 0 8px;
  font-size: 14px;
}
.dialog-body p {
  margin: 10px 0;
}
.dialog-body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', monospace;
  font-size: 12px;
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.canvasWrap {
  position: relative;
  display: flex;
  flex-direction: column;
}

.canvasHead {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.badge {
  font-size: 12px;
  color: rgba(234, 240, 255, 0.85);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 6px 10px;
  border-radius: 999px;
}

.canvasArea {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

canvas#viz {
  display: block;
  width: 100%;
  height: 100%;
}

/* ---- Bottom nav ---- */
.bottomNav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 12px 16px;
  display: flex;
  justify-content: center;
  background: rgba(0, 0, 0, 0.22);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
}

.navInner {
  width: min(1100px, calc(100% - 16px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.progress {
  font-size: 13px;
  color: rgba(234, 240, 255, 0.85);
}

.btnRow {
  display: flex;
  gap: 10px;
}

.btn {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 14px;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.22);
}
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

@media (max-width: 920px) {
  .main {
    grid-template-columns: 1fr;
    padding-bottom: 86px;
  }
  :root {
    --sidebarW: 1fr;
  }
  .canvasWrap {
    min-height: 46vh;
  }
}

:root {
  --bg1: #0b0f1a;
  --bg2: #0f1730;
  --text: #eaf0ff;
  --muted: #b8c4ff;
  --card: rgba(255, 255, 255, 0.07);
  --card2: rgba(255, 255, 255, 0.1);
  --border: rgba(255, 255, 255, 0.14);
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
}
body {
  margin: 0;
  font-family:
    ui-sans-serif,
    system-ui,
    -apple-system,
    Segoe UI,
    Roboto,
    Helvetica,
    Arial;
  color: var(--text);
  background:
    radial-gradient(1200px 700px at 30% 20%, rgba(108, 140, 255, 0.22), transparent 55%), radial-gradient(900px 600px at 80% 60%, rgba(140, 96, 255, 0.18), transparent 55%),
    linear-gradient(180deg, var(--bg1), var(--bg2));
  overflow-x: hidden;
}

.page {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: clamp(24px, 4vw, 56px);
  gap: 32px;
}

.hero {
  width: min(1100px, 100%);
  text-align: center;
}

.title {
  margin: 0;
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.02;
  font-size: clamp(30px, 4.2vw, 56px);

  opacity: 0;
  transform: translateY(28px) scale(0.98);
  filter: blur(6px);
}

.title-line {
  display: block;
}

.title-sub {
  margin-top: 10px;
  font-weight: 800;
  font-size: clamp(18px, 2.2vw, 28px);
  color: rgba(234, 240, 255, 0.92);
  letter-spacing: -0.01em;
}

/* title “emerges up” */
.title.enter {
  animation: titleUp 900ms cubic-bezier(0.2, 0.9, 0.2, 1) forwards;
}

@keyframes titleUp {
  0% {
    opacity: 0;
    transform: translateY(28px) scale(0.98);
    filter: blur(6px);
  }
  70% {
    opacity: 1;
    transform: translateY(-6px) scale(1);
    filter: blur(0);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

.nav {
  width: min(900px, 100%);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  padding-top: 8px;
}

/* Balken are now buttons */
.bar {
  width: min(760px, 100%);
  display: block;
  text-align: left;

  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--card), rgba(255, 255, 255, 0.04));
  border: 1px solid var(--border);
  box-shadow: var(--shadow);

  color: var(--text);
  backdrop-filter: blur(8px);
  cursor: pointer;

  /* start hidden for staged animation */
  opacity: 0;
  transform: translateY(16px) translateX(0);
}

/* stairs arrangement */
.bar-1 {
  --stair: 0px;
  margin-left: 0px;
}
.bar-2 {
  --stair: 18px;
  margin-left: 18px;
}
.bar-3 {
  --stair: 36px;
  margin-left: 36px;
}

.bar.show {
  animation: barIn 650ms cubic-bezier(0.2, 0.9, 0.2, 1) forwards;
}

@keyframes barIn {
  0% {
    opacity: 0;
    transform: translateY(18px) translateX(var(--stair, 0px));
    filter: blur(6px);
  }
  70% {
    opacity: 1;
    transform: translateY(-4px) translateX(var(--stair, 0px));
    filter: blur(0);
  }
  100% {
    opacity: 1;
    transform: translateY(0) translateX(var(--stair, 0px));
    filter: blur(0);
  }
}

/* inner layout */
.bar-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 18px;
}

.bar-title {
  font-size: clamp(16px, 2vw, 20px);
  font-weight: 800;
}

.bar-cta {
  font-size: 13px;
  color: var(--muted);
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  text-decoration: none;
}

.bar:hover {
  background: linear-gradient(180deg, var(--card2), rgba(255, 255, 255, 0.06));
  border-color: rgba(255, 255, 255, 0.22);
}

.bar:focus-visible {
  outline: 3px solid rgba(150, 170, 255, 0.55);
  outline-offset: 3px;
}

/* EXPAND AREA */
.bar-desc {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-6px);
  padding: 0 18px;
  transition:
    max-height 260ms ease,
    opacity 200ms ease,
    transform 200ms ease,
    padding 260ms ease;
  color: rgba(234, 240, 255, 0.92);
  line-height: 1.45;
  font-size: 14px;
}

.bar.open .bar-desc {
  max-height: 220px; /* enough for your descriptions */
  opacity: 1;
  transform: translateY(0);
  padding: 0 18px 16px 18px;
}

/* small divider line when open */
.bar.open {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
}

@media (max-width: 520px) {
  .bar-2 {
    margin-left: 10px;
  }
  .bar-3 {
    margin-left: 20px;
  }
  .bar-main {
    padding: 16px 14px;
  }
  .bar.open .bar-desc {
    padding: 0 14px 14px 14px;
  }
  .bar-desc {
    padding: 0 14px;
  }
}

/* ===============================
   Graph Input Card
================================ */

.graphCard {
  margin-top: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  overflow: hidden;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.graphCardHead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0.9rem;
  background: rgba(255, 255, 255, 0.05);
  font-size: 0.85rem;
  opacity: 0.9;
}

.graphCardBody {
  padding: 0.9rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.matrixInput {
  width: 100%;
  height: 100%;
  white-space: pre-wrap;
  min-height: 140px;
  resize: none;
  overflow: auto;
  padding: 0.75rem;
  font-family: monospace;
  font-size: 0.85rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.25);
  color: #e0f7ff;
  outline: none;
  transition:
    border 0.2s ease,
    box-shadow 0.2s ease;
}

.matrixInput:focus {
  border-color: #00ffcc;
  box-shadow: 0 0 0 1px rgba(0, 255, 204, 0.4);
}

.graphActions {
  margin-top: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.btn.primary {
  background: linear-gradient(135deg, #00ffcc, #00c3ff);
  color: #002b33;
  font-weight: 600;
  border: none;
}

.btn.primary:hover {
  opacity: 0.9;
}

.statusText {
  white-space: pre-line;
  font-size: 0.8rem;
  opacity: 0.7;
}

.statusText.ok {
  color: #00ffcc;
}

.statusText.error {
  color: #ff6b6b;
}

.hint {
  font-size: 0.75rem;
  opacity: 0.6;
}

/* Tabs container */
.graphTabs {
  display: flex;
  gap: 0.4rem;
}

.tabBtn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
  color: #cfefff;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tabBtn:hover {
  border-color: #00ffcc;
}

.tabBtn.active {
  background: linear-gradient(135deg, #00ffcc, #00c3ff);
  color: #002b33;
  border: none;
}

/* Mode switching */
.graphMode {
  display: none;
  flex-grow: 1;
}

.graphMode.active {
  display: block;
}

/* --- Cylinder Controls --- */
.cylinder-controls {
  position: relative;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  padding: var(--gap);
  max-width: 420px;
  font-size: 14px;
  line-height: 1.4;
  color: var(--text);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
}

.cylinder-controls h3 {
  margin: 0 0 8px 0;
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
}

.cylinder-controls p {
  margin: 0 0 12px 0;
  color: rgba(234, 240, 255, 0.88);
}

.cylinder-controls label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
}

.cylinder-controls input[type='range'] {
  width: 100%;
  appearance: none;
  height: 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.12);
  cursor: pointer;
  margin-bottom: 6px;
}

.cylinder-controls input[type='range']::-webkit-slider-thumb {
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #00ffcc;
  border: 1px solid rgba(255, 255, 255, 0.3);
  cursor: pointer;
  transition: all 0.2s ease;
}
.cylinder-controls input[type='range']::-webkit-slider-thumb:hover {
  background: #00c3ff;
}

.cylinder-controls input[type='range']::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #00ffcc;
  border: 1px solid rgba(255, 255, 255, 0.3);
  cursor: pointer;
}

.cylinder-controls .readout {
  margin-bottom: 8px;
  font-size: 13px;
  color: var(--muted);
  min-height: 1.2em;
}

.cylinder-controls .buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.cylinder-controls button {
  padding: 6px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cylinder-controls button:hover {
  background: rgba(0, 255, 204, 0.12);
  border-color: rgba(0, 255, 204, 0.24);
}

.cylinder-controls .legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  color: var(--muted);
}

.cylinder-controls .legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.cylinder-controls .swatch {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.cylinder-controls .red {
  background: #ff6478;
}
.cylinder-controls .blue {
  background: #5da9ff;
}
.cylinder-controls .yellow {
  background: #ffe082;
}
.cylinder-controls .gray {
  background: rgba(255, 255, 255, 0.4);
}

#theme-toggle-btn {
  position: absolute;
  top: 15px;
  right: 15px;
  z-index: 50;
  border-radius: var(--radius);
  border: 0;
  padding: 10px 18px;
  background: var(--text);
  color: var(--bg1);
  cursor: pointer;
}

/* ===============================
   LIGHT MODE WRAPPER
   Toggle with JS by adding/removing `[theme='light']` on body
================================ */

html[theme='light'] {
  /* ---------------- Backgrounds ---------------- */
  --bg1: rgba(245, 247, 250, 1);
  --bg2: rgba(230, 233, 238, 1);
  --text: rgba(34, 34, 34, 1);
  --panel: rgba(255, 255, 255, 0.95);
  --panel2: rgba(255, 255, 255, 0.9);
  --card: rgba(255, 255, 255, 0.95);
  --card2: rgba(255, 255, 255, 0.9);
  --border: rgba(34, 34, 34, 0.12);
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  --radius: 18px;
  --gap: 16px;
  --sidebarW: 33.3333vw;
}

/* ---------------- Base Body ---------------- */
[theme='light'] html,
[theme='light'] body {
  height: 100%;
  margin: 0;
  font-family:
    ui-sans-serif,
    system-ui,
    -apple-system,
    Segoe UI,
    Roboto,
    Helvetica,
    Arial;
  color: var(--text);
  background:
    radial-gradient(1200px 700px at 30% 20%, rgba(108, 140, 255, 0.1), transparent 55%), radial-gradient(900px 600px at 80% 60%, rgba(140, 96, 255, 0.08), transparent 55%),
    linear-gradient(180deg, var(--bg1), var(--bg2));
  overflow-x: hidden;
}

/* ---------------- Layout ---------------- */
[theme='light'] .shell {
  height: 100%;
  display: flex;
  flex-direction: column;
}

[theme='light'] .topbar {
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(34, 34, 34, 0.08);
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(10px);
}

[theme='light'] .brand {
  font-weight: 900;
  letter-spacing: -0.02em;
  text-decoration: none;
  cursor: pointer;
  color: var(--text);
}

[theme='light'] .crumb {
  color: rgba(34, 34, 34, 0.78);
  font-size: 13px;
}

[theme='light'] .main {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: var(--sidebarW) 1fr;
  gap: var(--gap);
  padding: var(--gap);
  padding-bottom: 78px;
}

[theme='light'] .panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--panel), rgba(255, 255, 255, 0.95));
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  overflow: hidden;
  min-height: 0;
}

[theme='light'] .dialog {
  display: flex;
  flex-direction: column;
}

[theme='light'] .dialog-head {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(34, 34, 34, 0.1);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

[theme='light'] .h-title {
  margin: 0;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: -0.01em;
}

[theme='light'] .h-sub {
  margin: 4px 0 0 0;
  font-size: 13px;
  color: rgba(34, 34, 34, 0.8);
  line-height: 1.35;
}

[theme='light'] .dialog-body {
  padding: 14px 16px 16px 16px;
  overflow: auto;
  min-height: 0;
  line-height: 1.5;
  color: rgba(34, 34, 34, 0.92);
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

[theme='light'] .dialog-body h3 {
  margin: 14px 0 8px;
  font-size: 14px;
}

[theme='light'] .dialog-body p {
  margin: 10px 0;
}

[theme='light'] .dialog-body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', monospace;
  font-size: 12px;
  background: rgba(0, 0, 0, 0.04);
  padding: 2px 6px;
  border-radius: 8px;
  border: 1px solid rgba(34, 34, 34, 0.12);
}

/* ---------------- Canvas ---------------- */
[theme='light'] .canvasWrap {
  position: relative;
  display: flex;
  flex-direction: column;
}

[theme='light'] .canvasHead {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(34, 34, 34, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

[theme='light'] .badge {
  font-size: 12px;
  color: rgba(34, 34, 34, 0.85);
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(34, 34, 34, 0.12);
  padding: 6px 10px;
  border-radius: 999px;
}

[theme='light'] .canvasArea {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

[theme='light'] canvas#viz {
  display: block;
  width: 100%;
  height: 100%;
}

/* ---------------- Bottom nav ---------------- */
[theme='light'] .bottomNav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 12px 16px;
  display: flex;
  justify-content: center;
  background: rgba(255, 255, 255, 0.95);
  border-top: 1px solid rgba(34, 34, 34, 0.1);
  backdrop-filter: blur(10px);
}

[theme='light'] .navInner {
  width: min(1100px, calc(100% - 16px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

[theme='light'] .progress {
  font-size: 13px;
  color: rgba(34, 34, 34, 0.85);
}

[theme='light'] .btnRow {
  display: flex;
  gap: 10px;
}

[theme='light'] .btn {
  appearance: none;
  border: 1px solid rgba(34, 34, 34, 0.16);
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 14px;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

[theme='light'] .btn:hover {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(34, 34, 34, 0.22);
}

[theme='light'] .btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ---------------- Hero Section ---------------- */
[theme='light'] .page {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: clamp(24px, 4vw, 56px);
  gap: 32px;
}

[theme='light'] .hero {
  width: min(1100px, 100%);
  text-align: center;
}

[theme='light'] .title {
  color: var(--text);
  opacity: 0;
  transform: translateY(28px) scale(0.98);
  filter: blur(0);
}

[theme='light'] .title-sub {
  color: rgba(34, 34, 34, 0.92);
}

/* ---------------- Navigation Bars / Accordions ---------------- */
[theme='light'] .bar {
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
}

[theme='light'] .bar:hover {
  background: var(--panel2);
  border-color: rgba(34, 34, 34, 0.22);
}

[theme='light'] .bar-cta {
  font-size: 13px;
  color: rgba(102, 102, 102, 0.8);
  border: 1px solid rgba(34, 34, 34, 0.18);
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  text-decoration: none;
}

/* Expanded descriptions */
[theme='light'] .bar-desc {
  color: rgba(34, 34, 34, 0.92);
}

/* ---------------- Graph Cards ---------------- */
[theme='light'] .graphCard {
  border: 1px solid rgba(34, 34, 34, 0.08);
  background: rgba(255, 255, 255, 0.95);
}

[theme='light'] .graphCardHead {
  background: rgba(255, 255, 255, 0.9);
  color: rgba(34, 34, 34, 0.85);
}

[theme='light'] .matrixInput {
  border: 1px solid rgba(34, 34, 34, 0.1);
  background: rgba(245, 247, 250, 0.75);
  color: rgba(34, 34, 34, 0.95);
}

/* Buttons inside graph cards */
[theme='light'] .graphActions .btn.primary {
  background: linear-gradient(135deg, rgba(0, 255, 204, 1), rgba(0, 195, 255, 1));
  color: rgba(0, 43, 51, 1);
}

/* Status texts */
[theme='light'] .statusText.ok {
  color: rgba(0, 255, 204, 1);
}
[theme='light'] .statusText.error {
  color: rgba(255, 107, 107, 1);
}

/* Hints */
[theme='light'] .hint {
  color: rgba(102, 102, 102, 0.6);
}

/* Tabs */
[theme='light'] .tabBtn {
  background: transparent;
  border: 1px solid rgba(34, 34, 34, 0.15);
  color: rgba(34, 34, 34, 0.85);
}

[theme='light'] .tabBtn.active {
  background: linear-gradient(135deg, rgba(0, 255, 204, 1), rgba(0, 195, 255, 1));
  color: rgba(0, 43, 51, 1);
  border: none;
}

/* ---------------- Cylinder Controls ---------------- */
[theme='light'] .cylinder-controls {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(34, 34, 34, 0.12);
  color: var(--text);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

[theme='light'] .cylinder-controls input[type='range'] {
  background: rgba(0, 0, 0, 0.1);
}

[theme='light'] .cylinder-controls input[type='range']::-webkit-slider-thumb {
  background: rgba(0, 128, 255, 1);
  border: 1px solid rgba(0, 0, 0, 0.2);
}

[theme='light'] .cylinder-controls button {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(34, 34, 34, 0.16);
  color: var(--text);
}

[theme='light'] .cylinder-controls button:hover {
  background: rgba(0, 255, 204, 0.12);
  border-color: rgba(0, 255, 204, 0.24);
}

/* Cylinder legend swatches */
[theme='light'] .cylinder-controls .swatch.red {
  background: rgba(255, 100, 120, 1);
}
[theme='light'] .cylinder-controls .swatch.blue {
  background: rgba(93, 169, 255, 1);
}
[theme='light'] .cylinder-controls .swatch.yellow {
  background: rgba(255, 224, 130, 1);
}
[theme='light'] .cylinder-controls .swatch.gray {
  background: rgba(34, 34, 34, 0.4);
}

/* ---------------- Responsive Adjustments ---------------- */
@media (max-width: 920px) {
  [theme='light'] .main {
    grid-template-columns: 1fr;
    padding-bottom: 86px;
  }
  [theme='light'] :root {
    --sidebarW: 1fr;
  }
  [theme='light'] .canvasWrap {
    min-height: 46vh;
  }
}

@media (max-width: 520px) {
  [theme='light'] .bar-2 {
    margin-left: 10px;
  }
  [theme='light'] .bar-3 {
    margin-left: 20px;
  }
  [theme='light'] .bar-main {
    padding: 16px 14px;
  }
  [theme='light'] .bar.open .bar-desc {
    padding: 0 14px 14px 14px;
  }
  [theme='light'] .bar-desc {
    padding: 0 14px;
  }
}

