/* LazyIITians OPPE student multi-page UX — calm study-room aesthetic */

.study-page .oppe-main {
  overflow: auto;
  height: 100vh;
  padding: 1rem 1.25rem 1.5rem;
}
.study-page.workspace-page .oppe-main {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding-bottom: .75rem;
}
.workspace-page .study-header {
  margin-bottom: .55rem;
}
.workspace-page .study-header h1 {
  font-size: 1.2rem;
}
.workspace-page .study-header .subtitle {
  font-size: .8rem;
}

.study-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex: 0 0 auto;
}
.study-header h1 {
  margin: 0;
  font-size: 1.72rem;
  font-weight: 750;
  letter-spacing: -.04em;
  color: var(--text);
  line-height: 1.15;
}
.study-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  margin-bottom: .35rem;
  font-size: .8rem;
  color: var(--muted);
}
.study-breadcrumb a {
  color: var(--primary) !important;
  text-decoration: none;
}

.study-section {
  margin-bottom: 2rem;
}
.study-section > h2 {
  margin: 0 0 .35rem;
  font-size: 1.05rem;
}
.study-section > .section-note {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: .9rem;
}

.continue-panel {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.35rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: var(--shadow);
}
.continue-panel h3 {
  margin: 0 0 .25rem;
  font-size: 1.05rem;
}
.continue-panel p {
  margin: 0;
  color: var(--muted);
  font-size: .88rem;
}
.continue-empty {
  padding: 1.25rem 1.35rem;
  border: 1px dashed var(--border);
  border-radius: 14px;
  background: var(--panel-soft);
  color: var(--muted);
}

.subject-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1rem;
  max-width: 1120px;
}
.subject-tile {
  display: flex;
  flex-direction: column;
  gap: .4rem;
  padding: 1.1rem 1.15rem 1.05rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  border-left: 3px solid var(--subject-accent, var(--primary));
  background: var(--panel);
  color: inherit !important;
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.subject-tile:hover {
  border-color: color-mix(in srgb, var(--primary), transparent 40%);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}
.subject-tile strong { font-size: .95rem; }
.subject-tile small { color: var(--muted); font-size: .78rem; }
.progress-bar {
  height: 6px;
  border-radius: 999px;
  background: var(--panel-soft);
  overflow: hidden;
  border: 1px solid var(--border);
}
.progress-bar > span {
  display: block;
  height: 100%;
  background: var(--accent);
}

.today-card {
  padding: 1rem 1.15rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: linear-gradient(135deg, var(--panel), var(--accent-soft));
  max-width: 420px;
}
.today-card strong { display: block; margin-bottom: .25rem; }
.today-card span { color: var(--muted); font-size: .88rem; }

.subject-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin: 1rem 0 1.5rem;
}
.subject-actions a {
  padding: .45rem .85rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--muted) !important;
  text-decoration: none;
  font-size: .82rem;
  font-weight: 650;
}
.subject-actions a.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff !important;
}
.subject-actions a.accent {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink) !important;
}

.topic-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
}
.topic-chip {
  padding: .35rem .7rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel-soft);
  color: var(--text) !important;
  text-decoration: none;
  font-size: .78rem;
}

.set-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem 1.25rem;
  margin-bottom: 1rem;
  color: var(--muted);
  font-size: .9rem;
}
.set-filters {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  margin-bottom: 1rem;
  align-items: center;
}
.set-filters input,
.set-filters select {
  width: auto;
  min-width: 120px;
  padding: .45rem .55rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
}
.status-pills {
  display: flex;
  gap: .3rem;
}
.status-pills a {
  padding: .35rem .7rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted) !important;
  text-decoration: none;
  font-size: .78rem;
  font-weight: 650;
  background: var(--panel);
}
.status-pills a.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink) !important;
}

.q-list {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
  overflow: visible;
  max-height: none;
}
.q-row {
  display: flex;
  align-items: stretch;
  gap: 0;
  padding: 0;
  border-bottom: 1px solid var(--border);
  color: inherit !important;
  text-decoration: none;
}
.q-row:last-child { border-bottom: 0; }
.q-row:hover { background: var(--panel-soft); }
.q-row-main {
  display: grid;
  grid-template-columns: 2.6rem minmax(0, 1fr) auto auto auto;
  gap: .7rem;
  align-items: center;
  flex: 1;
  min-width: 0;
  padding: .7rem .35rem .7rem 1rem;
  color: inherit !important;
  text-decoration: none;
}
.q-num {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-weight: 700;
  font-size: .82rem;
}
.q-row h3 {
  margin: 0;
  font-size: .92rem;
  font-weight: 650;
}
.q-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  margin-top: .25rem;
}
.q-meta .tag {
  padding: .1rem .4rem;
  border-radius: 6px;
  background: var(--panel-soft);
  border: 1px solid var(--border);
  font-size: .68rem;
  color: var(--muted);
}
.solved-pill {
  font-size: .72rem;
  font-weight: 700;
  color: var(--green);
}
.faq-mini {
  font-size: .68rem;
  font-weight: 700;
  color: var(--purple);
}

/* Workspace */
.workspace-layout {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: .75rem;
}
.q-nav {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
  overflow: auto;
  padding: .45rem;
  display: flex;
  flex-direction: column;
  gap: .3rem;
}
.q-nav a {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 8px;
  border: 1px solid transparent;
  text-decoration: none;
  color: var(--muted) !important;
  font-size: .72rem;
  font-weight: 700;
  background: var(--panel-soft);
}
.q-nav a.solved { color: var(--green) !important; }
.q-nav a.current {
  background: var(--accent);
  color: var(--accent-ink) !important;
  border-color: var(--accent);
}
.workspace-main {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
  padding: .75rem;
  overflow: hidden;
}
.workspace-top {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  align-items: flex-start;
  margin-bottom: .55rem;
  flex: 0 0 auto;
}
.workspace-top h2 {
  margin: .15rem 0 0;
  font-size: 1.15rem;
}
.workspace-split {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(240px, var(--q-share, 38%)) 10px minmax(280px, 1fr);
  gap: 0;
  --q-share: 38%;
}
.workspace-split.is-dbms {
  --q-share: 48%;
}
.split-resizer {
  cursor: col-resize;
  background: transparent;
  border: 0;
  padding: 0;
  position: relative;
  align-self: stretch;
}
.split-resizer::before {
  content: "";
  position: absolute;
  inset: 12% 4px;
  border-radius: 99px;
  background: var(--border);
  transition: background .15s ease;
}
.split-resizer:hover::before,
body.is-resizing .split-resizer::before {
  background: var(--primary);
}
body.is-resizing,
body.is-resizing * {
  cursor: col-resize !important;
  user-select: none !important;
}
.workspace-main > .content-tabs {
  flex: 0 0 auto;
}
.workspace-main > .content-tabs button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.solution-content pre {
  overflow-x: auto;
}
.statement-pane,
.editor-pane {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.statement-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding-right: .35rem;
  font-size: .9rem;
  line-height: 1.65;
}
.schema-box {
  margin-top: .75rem;
  padding: .75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel-soft);
  max-height: 40%;
  overflow: auto;
  flex-shrink: 0;
}
.schema-box button {
  margin-top: .5rem;
  background: transparent !important;
  color: var(--primary) !important;
  border: 1px solid var(--primary) !important;
  border-radius: 8px !important;
  padding: .35rem .6rem !important;
  font-size: .75rem !important;
}
.db-schema-wrap { margin: .85rem 0 1.1rem; }
.db-schema-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: .55rem;
}
.db-schema-head h3 { margin: 0; font-size: .95rem; }
.db-schema-tools { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.schema-view-btn,
.schema-expand-btn {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
  border-radius: 8px;
  padding: .28rem .55rem;
  font-size: .72rem;
  font-weight: 700;
  cursor: pointer;
}
.schema-view-btn.active {
  background: color-mix(in srgb, var(--primary) 14%, transparent);
}
.db-schema-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: .65rem;
}
.db-table-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--panel);
}
.db-table-card header {
  padding: .42rem .6rem;
  background: color-mix(in srgb, var(--primary) 14%, var(--panel-soft));
  font-weight: 750;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: .76rem;
}
.db-table-card table { width: 100%; margin: 0; border-collapse: collapse; }
.db-table-card td {
  padding: .28rem .5rem;
  border-bottom: 1px solid var(--border);
  font-size: .74rem;
}
.db-table-card tr:last-child td { border-bottom: 0; }
.schema-col-type { color: var(--muted); white-space: nowrap; }
.schema-col-keys { width: 1%; white-space: nowrap; text-align: right; }
.schema-key {
  display: inline-block;
  margin-left: .15rem;
  padding: .05rem .28rem;
  border-radius: 4px;
  font-size: .6rem;
  font-weight: 800;
}
.schema-key-pk { background: #efe3c4; color: #7a5a12; }
.schema-key-fk { background: #dce8fb; color: #1f4f9c; }
.schema-fk-ref {
  display: block;
  margin-top: .12rem;
  color: var(--muted);
  font-size: .62rem;
}
.schema-rels {
  margin: 0;
  padding: .35rem .6rem .5rem 1.15rem;
  color: var(--muted);
  font-size: .68rem;
}
.schema-lightbox-card .db-schema-head { display: flex; }
.schema-lightbox-card .db-schema-grid {
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
.db-er-host {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  min-height: 0;
  max-height: none;
  overflow: visible;
}
.schema-lightbox-card .db-er-host { max-height: none; min-height: 0; }
.cdb-shell {
  --cdb-accent: #ec4899;
  --cdb-edge: #64748b;
  --cdb-grid: #cbd5e1;
  --cdb-table-bg: #f8fafc;
  --cdb-table-border: #64748b;
}
[data-theme="dark"] .cdb-shell,
html.dark .cdb-shell,
body.dark .cdb-shell {
  --cdb-grid: #334155;
  --cdb-table-bg: #0f172a;
  --cdb-table-border: #475569;
}
.cdb-viewport {
  position: relative;
  height: min(58vh, 560px);
  min-height: 420px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: color-mix(in srgb, var(--panel) 92%, #94a3b8);
}
.schema-lightbox-card .cdb-viewport { height: min(72vh, 720px); min-height: 480px; }
.db-schema-image-panel {
  overflow: auto;
  max-height: min(60vh, 640px);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px;
  background: #fff;
}
.db-schema-image-panel img {
  display: block;
  max-width: 100%;
  height: auto;
}
.schema-lightbox-card .db-schema-image-panel {
  max-height: none;
  border: none;
  background: transparent;
}
.cdb-flow-mount,
.chartdb-mount,
.cdb-flow {
  width: 100%;
  height: 100%;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}
.cdb-flow .react-flow__node { cursor: grab; }
.cdb-flow .react-flow__node:active { cursor: grabbing; }
.cdb-table {
  position: relative;
  width: 224px;
  border: 2px solid var(--cdb-table-border);
  border-radius: 10px;
  background: var(--cdb-table-bg);
  box-shadow: 0 1px 2px rgb(15 23 42 / 6%), 0 8px 20px rgb(15 23 42 / 8%);
  overflow: hidden;
}
.cdb-table.is-selected { border-color: #db2777; box-shadow: 0 0 0 2px rgb(219 39 119 / 25%); }
.cdb-table-accent {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 6px;
}
.cdb-table-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px 10px 16px;
  border-bottom: 1px solid color-mix(in srgb, var(--cdb-table-border) 35%, transparent);
  background: color-mix(in srgb, var(--cdb-table-bg) 88%, white);
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}
.cdb-table-icon { font-size: 12px; line-height: 1; }
.cdb-table-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 12px;
}
.cdb-table-body { display: grid; }
.cdb-field {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 4px 12px 4px 16px;
  border-top: 1px solid color-mix(in srgb, var(--cdb-table-border) 22%, transparent);
  font-size: 11px;
  background: var(--cdb-table-bg);
}
.cdb-field:first-child { border-top: 0; }
.cdb-field.is-pk { background: color-mix(in srgb, #fef3c7 55%, var(--cdb-table-bg)); }
.cdb-field-keys { display: inline-flex; gap: 4px; min-width: 40px; align-items: center; }
.cdb-key-spacer { width: 20px; height: 16px; }
.cdb-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 16px;
  padding: 0 4px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .03em;
}
.cdb-key-pk { background: #fde68a; color: #92400e; }
.cdb-key-fk { background: #bfdbfe; color: #1e40af; }
.cdb-field-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  font-weight: 600;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
}
.cdb-field-type {
  color: #64748b;
  font-size: 10px;
  white-space: nowrap;
  font-family: "JetBrains Mono", ui-monospace, monospace;
}
.cdb-handle {
  width: 8px !important;
  height: 8px !important;
  border: 0 !important;
  background: transparent !important;
  opacity: 0;
}
.cdb-controls {
  box-shadow: 0 4px 14px rgb(15 23 42 / 12%) !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 8px !important;
  overflow: hidden;
}
.cdb-controls button {
  background: #fff !important;
  border-bottom: 1px solid #e2e8f0 !important;
  color: #64748b !important;
  width: 28px !important;
  height: 28px !important;
}
.cdb-controls button:hover { color: #0f172a !important; background: #f8fafc !important; }
.cdb-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 14px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
}
.cdb-legend-item { display: inline-flex; align-items: center; gap: 6px; }
/* Editor column: toolbar + flexible editor + pinned action bar (never clipped) */
.editor-pane .editor-toolbar {
  flex-shrink: 0;
}
.editor-pane .editor-frame {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}
.editor-pane .CodeMirror {
  height: 100% !important;
  min-height: 0 !important;
}
.editor-pane #custom-input-wrap {
  flex-shrink: 0;
  margin-top: .45rem;
}
.editor-pane .editor-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .4rem;
  margin-top: .55rem;
  flex: 0 0 auto;
  flex-shrink: 0;
}
/* Results live in the left Test Cases panel — no page-level result strip. */
.workspace-results { display: none !important; }
.tests-exec-summary {
  margin: 0 0 .55rem;
  padding: .5rem .6rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--panel-soft);
  font-size: .78rem;
  font-weight: 700;
}
.tests-exec-summary.is-error {
  border-color: color-mix(in srgb, var(--red) 45%, var(--border));
  color: var(--red);
}
.tests-exec-summary.is-ok {
  border-color: color-mix(in srgb, var(--green) 40%, var(--border));
}
.tests-exec-summary .summary-line {
  display: block;
  font-weight: 650;
  margin-top: .15rem;
}
.tests-exec-summary .summary-error-pre,
.public-test-card .result-extra pre {
  margin: .35rem 0 0;
  max-height: 18rem;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: .74rem;
  font-weight: 500;
  line-height: 1.35;
}
.public-test-card {
  border: 1px solid var(--border);
  border-left: 3px solid var(--border);
  border-radius: 10px;
  padding: .7rem .75rem;
  margin: .5rem 0;
  background: var(--panel);
  font-size: .8rem;
}
.public-test-card.is-pass { border-left-color: var(--green); }
.public-test-card.is-fail { border-left-color: var(--red); }
.public-test-card.is-service { border-left-color: #c9852c; }
.public-test-card h4 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .5rem;
  margin: 0 0 .35rem;
  font-size: .8rem;
}
.public-test-card .verdict-badge { font-size: .72rem; font-weight: 700; white-space: nowrap; }
.public-test-card .verdict-badge.pass { color: var(--green); }
.public-test-card .verdict-badge.fail { color: var(--red); }
.public-test-card .verdict-badge.service { color: #c9852c; }
.public-test-card .result-extra { margin-top: .4rem; }
.private-summary-card {
  border: 1px dashed var(--border);
  border-radius: 10px;
  padding: .7rem .75rem;
  margin: .65rem 0 0;
  background: var(--panel-soft);
  font-size: .8rem;
}
.private-summary-card h4 { margin: 0 0 .25rem; font-size: .8rem; }
.learning-box {
  margin-top: .75rem;
  padding: .75rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel-soft);
  flex-shrink: 0;
}
.solution-content {
  font-size: .88rem;
  line-height: 1.55;
}
.solution-content pre {
  overflow-x: auto;
  padding: .65rem .75rem;
  border-radius: 8px;
  background: var(--panel-soft);
  border: 1px solid var(--border);
}
.solution-content code {
  font-size: .82rem;
}
.content-tabs button[data-problem-tab="solution"]:disabled {
  opacity: .45;
  cursor: not-allowed;
}
#view-solution-button:disabled {
  opacity: .45;
  cursor: not-allowed;
}
.next-cta {
  display: inline-flex;
  margin-top: .55rem;
  padding: .45rem .8rem;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-ink) !important;
  text-decoration: none;
  font-weight: 700;
  font-size: .82rem;
}

.schema-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(7, 13, 26, .55);
  display: none;
  place-items: center;
  z-index: 80;
  padding: 1rem;
}
.schema-lightbox.open { display: grid; }
.schema-lightbox-card {
  width: min(820px, 100%);
  max-height: 85vh;
  overflow: auto;
  background: var(--panel);
  border-radius: 14px;
  border: 1px solid var(--border);
  padding: 1rem 1.15rem;
}
.schema-lightbox-card header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: .75rem;
}

.progress-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}
.stat-block {
  padding: 1rem 1.1rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--panel);
}
.stat-block strong {
  display: block;
  font-size: 1.6rem;
  letter-spacing: -.03em;
}
.stat-block span { color: var(--muted); font-size: .82rem; }

.pyq-filters {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  margin-bottom: 1rem;
}

.mock-intro-card {
  max-width: 640px;
  padding: 1.35rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel);
}
.mock-intro-card ul {
  margin: .75rem 0 1.1rem;
  padding-left: 1.1rem;
  color: var(--muted);
}

@media (max-width: 1100px) {
  .workspace-split { grid-template-columns: 1fr; }
  .split-resizer { display: none; }
  .statement-pane { max-height: 36%; }
  .editor-pane .editor-frame,
  .editor-pane .CodeMirror { min-height: 0; }
}
@media (max-width: 900px) {
  .workspace-layout { grid-template-columns: 1fr; }
  .q-nav {
    flex-direction: row;
    flex-wrap: wrap;
    max-height: 88px;
  }
  .q-nav a {
    width: 2.2rem;
    aspect-ratio: 1;
  }
  .continue-panel { flex-direction: column; align-items: flex-start; }
  .q-row-main {
    grid-template-columns: 2.5rem minmax(0, 1fr);
  }
  .q-row .difficulty,
  .q-row .status-pill,
  .q-row .q-open { grid-column: 2; }
  .product-grid,
  .mode-grid { grid-template-columns: 1fr; }
}

/* ---------- Foundation: product / subject / states ---------- */
.li-page {
  min-width: 0;
  flex: 1 1 auto;
  overflow: auto;
}
.product-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  gap: 1rem;
  margin-bottom: 1.35rem;
  max-width: 980px;
}
.product-card {
  display: flex;
  flex-direction: column;
  gap: .45rem;
  padding: 1.35rem 1.4rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit !important;
  min-height: 0;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.product-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--primary), transparent 40%);
  box-shadow: var(--shadow-lg);
}
.product-card.is-oppe { border-top: 3px solid var(--gold); }
.product-card.is-quiz { border-top: 3px solid var(--primary); }
.product-card.is-notes { border-top: 3px solid var(--teal, #0b8f8a); }
.product-card .card-kicker {
  display: flex;
  align-items: center;
  gap: .45rem;
  color: var(--primary);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.product-card h2,
.product-card h3 {
  margin: 0;
  font-size: 1.38rem;
  font-weight: 750;
  letter-spacing: -.03em;
}
.product-card p {
  margin: 0;
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.45;
}
.product-card .card-cta {
  margin-top: .55rem;
  font-size: .82rem;
  font-weight: 700;
  color: var(--primary);
}
.product-card.is-soon {
  opacity: 1;
  cursor: pointer;
}
.stat-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .75rem;
  margin-bottom: 1.5rem;
}
.stat-chip {
  padding: .85rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--panel);
  box-shadow: var(--shadow);
}
.stat-chip strong {
  display: block;
  font-size: 1.25rem;
  letter-spacing: -.03em;
}
.stat-chip span {
  color: var(--muted);
  font-size: .78rem;
}
.stat-row.is-secondary {
  max-width: 720px;
  margin-top: 1.75rem;
  margin-bottom: 0;
  opacity: .92;
}
.stat-row.is-secondary .stat-chip {
  padding: .65rem .8rem;
  box-shadow: none;
}
.stat-row.is-secondary strong { font-size: 1.05rem; }
.mode-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .85rem;
}
.mode-card {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  padding: 1.05rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit !important;
  transition: border-color .15s ease, transform .15s ease;
}
.mode-card:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--primary), transparent 45%);
}
.mode-card .mode-ico {
  color: var(--primary);
}
.mode-card h3 { margin: 0; font-size: 1rem; }
.mode-card p { margin: 0; color: var(--muted); font-size: .84rem; }
.mode-card.is-soon,
.subject-tile.is-soon,
.coming-soon-card {
  border-style: dashed;
  background: var(--panel-soft);
  box-shadow: none;
  cursor: default;
}
.subject-tile.is-soon:hover {
  transform: none;
  border-color: var(--border);
}
.mode-card.is-soon .badge-soon,
.subject-tile.is-soon .badge-soon {
  margin-bottom: .25rem;
}
.coming-soon-card {
  padding: 1.25rem 1.3rem;
  border-radius: var(--radius);
  border: 1px dashed var(--border);
  max-width: 640px;
}
.coming-soon-card h2 { margin: 0 0 .35rem; font-size: 1.15rem; }
.coming-soon-card p { margin: 0; color: var(--muted); }
.badge-soon {
  display: inline-block;
  width: fit-content;
  padding: .12rem .45rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: .65rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.subject-tile {
  border-left: 3px solid var(--subject-accent, var(--primary));
}
.subject-tile[data-subject="python"] { --subject-accent: #2f6fed; }
.subject-tile[data-subject="pdsa"] { --subject-accent: #0f8a8a; }
.subject-tile[data-subject="dbms"] { --subject-accent: #d97706; }
.subject-tile[data-subject="java"] { --subject-accent: #e8b931; }
.subject-tile[data-subject="system-commands"] { --subject-accent: #5d6d86; }
.subject-tile[data-subject="mlp"] { --subject-accent: #6d5cff; }
.empty-state {
  padding: 1.15rem 1.2rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: var(--panel-soft);
  color: var(--muted);
}
.error-state {
  padding: 1rem 1.1rem;
  border-radius: var(--radius);
  border: 1px solid color-mix(in srgb, var(--red), transparent 55%);
  background: color-mix(in srgb, var(--red), transparent 92%);
  color: var(--red);
}
.li-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.li-table th,
.li-table td {
  padding: .7rem .85rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-size: .88rem;
}
.li-table th {
  background: var(--panel-soft);
  font-size: .74rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
}
@media (max-width: 720px) {
  .stat-row { grid-template-columns: 1fr; }
  .product-grid { grid-template-columns: 1fr; }
  .filter-toolbar { flex-direction: column; align-items: stretch; }
  .filter-toolbar select,
  .filter-toolbar input { width: 100%; min-width: 0; }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
.mode-grid-primary { margin-bottom: .85rem; }
.mode-card.is-primary {
  min-height: 8.2rem;
  padding: 1.2rem 1.25rem;
}
.mode-card.is-primary h3 { font-size: 1.12rem; }
.mode-grid-secondary .mode-card {
  background: var(--panel-soft);
  box-shadow: none;
}
.mode-card.is-secondary:hover { background: var(--panel); }
.filter-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .45rem;
  margin: 0 0 .85rem;
  max-width: 100%;
}
.filter-toolbar select,
.filter-toolbar input[type="search"] {
  width: auto;
  min-width: 7.25rem;
  max-width: 100%;
  padding: .42rem .55rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  font-size: .8rem;
}
.filter-toolbar input[type="search"] {
  flex: 1 1 12rem;
  min-width: 10rem;
  max-width: none;
}
.filter-toolbar button {
  padding: .42rem .7rem !important;
  font-size: .78rem !important;
}
.empty-state h3 {
  margin: 0 0 .3rem;
  font-size: 1rem;
  color: var(--text);
}
.empty-state p { margin: 0; }
.verdict-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .45rem 1rem;
  padding: .85rem 1rem;
  margin-bottom: 1.15rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--panel);
  box-shadow: var(--shadow);
}
.verdict-banner strong { font-size: 1.15rem; }
.verdict-banner.is-ok {
  border-color: color-mix(in srgb, var(--green), transparent 45%);
  background: color-mix(in srgb, var(--green), transparent 92%);
}
.verdict-banner.is-fail {
  border-color: color-mix(in srgb, var(--red), transparent 50%);
  background: color-mix(in srgb, var(--red), transparent 93%);
}
.result-card {
  border: 1px solid var(--border);
  border-left: 3px solid var(--border);
  border-radius: 10px;
  padding: .75rem .85rem;
  margin: .55rem 0;
  background: var(--panel);
}
.result-card.is-pass { border-left-color: var(--green); }
.result-card.is-fail { border-left-color: var(--red); }
.result-card.is-private {
  border-left-color: var(--muted);
  border-style: dashed;
  background: var(--panel-soft);
}
.result-card h3 {
  display: flex;
  justify-content: space-between;
  gap: .5rem;
  margin: 0 0 .4rem;
  font-size: .88rem;
}
.editor-actions .li-icon {
  width: .95rem;
  height: .95rem;
  margin-right: .2rem;
}
.editor-actions button {
  display: inline-flex;
  align-items: center;
}
.tests-panel {
  background: transparent;
}
.q-list {
  max-height: none;
  overflow: visible;
}

/* SQL Playground */
.sql-playground-page .oppe-main {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.sql-playground-layout {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: .85rem;
  padding-bottom: 1rem;
}
.sql-playground-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: .75rem 1.25rem;
  padding: .85rem 1rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel-soft);
}
.sql-playground-db {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  min-width: 220px;
}
.sql-playground-db label {
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
}
.sql-playground-db select {
  padding: .55rem .75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: inherit;
  font: inherit;
}
.sql-playground-hint {
  flex: 1 1 280px;
  margin: 0;
  font-size: .85rem;
  line-height: 1.5;
}
.sql-playground-split {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(240px, 34%) minmax(320px, 1fr);
  gap: .85rem;
  min-height: 520px;
}
.sql-playground-schema-pane,
.sql-playground-editor-pane {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
  overflow: hidden;
}
.sql-playground-schema-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--border);
}
.sql-playground-schema-head h2 {
  margin: 0;
  font-size: .95rem;
}
.sql-playground-schema-panel {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  padding: .55rem;
  display: flex;
  flex-direction: column;
}
.schema-viewer-mount {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.schema-zoom-viewer {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: .45rem;
}
.schema-zoom-viewer.is-inline {
  min-height: 280px;
}
.schema-zoom-viewer.is-modal {
  min-height: min(72vh, 720px);
}
.schema-zoom-toolbar {
  display: flex;
  align-items: center;
  gap: .35rem;
  flex-wrap: wrap;
}
.schema-zoom-btn {
  min-width: 2rem;
  height: 2rem;
  padding: 0 .55rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--panel-soft);
  color: inherit;
  font: inherit;
  font-size: .9rem;
  font-weight: 700;
  cursor: pointer;
}
.schema-zoom-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.schema-zoom-level {
  min-width: 3.2rem;
  text-align: center;
  font-size: .78rem;
  font-weight: 600;
  color: var(--muted);
}
.schema-zoom-stage {
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 10px;
  background:
    linear-gradient(90deg, rgb(148 163 184 / 12%) 1px, transparent 1px),
    linear-gradient(rgb(148 163 184 / 12%) 1px, transparent 1px),
    var(--panel-soft);
  background-size: 20px 20px;
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.schema-zoom-stage.is-dragging {
  cursor: grabbing;
}
.schema-zoom-canvas {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 0 0;
  will-change: transform;
}
.schema-zoom-canvas img {
  display: block;
  max-width: none;
  width: auto;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 8px 24px rgb(15 23 42 / 12%);
  image-rendering: auto;
}
.schema-zoom-hint {
  margin: 0;
  font-size: .72rem;
  line-height: 1.4;
}
.schema-lightbox-card-wide {
  width: min(96vw, 1180px);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.schema-lightbox-viewer-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
body.schema-lightbox-open {
  overflow: hidden;
}
.sql-playground-editor {
  flex: 1 1 auto;
  min-height: 220px;
}
.sql-playground-editor .CodeMirror {
  height: 100% !important;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: .85rem;
}
.sql-playground-meta {
  margin-left: auto;
  font-size: .8rem;
}
.sql-suggest-toggle {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  margin-left: .75rem;
  font-size: .78rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}
.sql-suggest-toggle input {
  accent-color: var(--primary);
  cursor: pointer;
}
.sql-playground-editor-pane .editor-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .35rem;
}
.CodeMirror-hints {
  z-index: 10050 !important;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: 0 12px 28px rgb(15 23 42 / 14%);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: .82rem;
  max-height: 220px;
  overflow: auto;
}
.CodeMirror-hint {
  padding: .35rem .65rem;
  color: var(--text);
}
li.CodeMirror-hint-active {
  background: color-mix(in srgb, var(--primary) 14%, var(--panel));
  color: var(--text);
}
.CodeMirror-hint.hint-table { color: #2563eb; }
.CodeMirror-hint.hint-column { color: #059669; }
.CodeMirror-hint.hint-keyword { color: #9333ea; font-weight: 600; }
html[data-theme="dark"] .CodeMirror-hint.hint-table { color: #93c5fd; }
html[data-theme="dark"] .CodeMirror-hint.hint-column { color: #6ee7b7; }
html[data-theme="dark"] .CodeMirror-hint.hint-keyword { color: #d8b4fe; }
.sql-playground-results {
  flex: 0 1 42%;
  min-height: 140px;
  max-height: 320px;
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--border);
}
.sql-playground-results-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .55rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--panel-soft);
  font-size: .85rem;
}
.sql-playground-results-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: .75rem 1rem;
}
.sql-results-ok { color: var(--success, #059669); font-size: .8rem; }
.sql-results-error { color: var(--danger, #dc2626); font-size: .8rem; }
.sql-result-table-wrap { overflow: auto; }
.sql-result-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .82rem;
  font-family: "JetBrains Mono", ui-monospace, monospace;
}
.sql-result-table th,
.sql-result-table td {
  border: 1px solid var(--border);
  padding: .35rem .55rem;
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}
.sql-result-table th {
  background: var(--panel-soft);
  position: sticky;
  top: 0;
}
.sql-result-error {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--danger, #dc2626);
  font-size: .82rem;
  font-family: "JetBrains Mono", ui-monospace, monospace;
}
.sql-result-message {
  margin: 0;
  font-size: .88rem;
}
@media (max-width: 960px) {
  .sql-playground-split {
    grid-template-columns: 1fr;
    min-height: auto;
  }
  .sql-playground-schema-pane {
    max-height: 280px;
  }
  .sql-playground-results {
    max-height: 240px;
  }
}

