/* LazyIITians OPPE student UI + shared admin styles */

:root {
  --navy: #0a1630;
  --gold: #f0c014;
  --bg: #cfd9ea;
  --bg-accent: rgba(30, 79, 215, 0.18);
  --panel: #f3f6fc;
  --panel-soft: #e6edf8;
  --panel-2: #dbe4f3;
  --text: #091428;
  --muted: #3d5270;
  --border: #b4c4db;
  --primary: #1e4fd7;
  --primary-soft: #d7e3ff;
  --accent: #f0c014;
  --accent-ink: #1a1608;
  --accent-soft: #fff1b0;
  --purple: #6b4cff;
  --green: #0f8a4b;
  --red: #d1243a;
  --orange: #d97706;
  --teal: #0b8f8a;
  --cyan: #1494b8;
  --sidebar: #0c1730;
  --sidebar-text: #eef3ff;
  --sidebar-muted: #93a4c4;
  --sidebar-border: rgba(255, 255, 255, 0.09);
  --sidebar-hover: rgba(255, 255, 255, 0.07);
  --shadow: 0 1px 2px rgba(12, 23, 48, 0.07), 0 12px 32px rgba(12, 23, 48, 0.1);
  --shadow-lg: 0 14px 40px rgba(12, 23, 48, 0.16);
  --glow: 0 0 0 1px rgba(30, 79, 215, 0.1), 0 10px 32px rgba(30, 79, 215, 0.14);
  --code-bg: #e2eaf6;
  --code-fg: #0c1730;
  --editor-bg: #f4f7fc;
  --editor-gutter: #e8eef8;
  --editor-border: #c5d3e8;
  --editor-toolbar: #eef3fb;
  --editor-toolbar-fg: #0c1730;
  --radius: 14px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --t-fast: 160ms;
  --t-med: 220ms;
  --font: "DM Sans", ui-sans-serif, system-ui, sans-serif;
  --display: "Plus Jakarta Sans", "DM Sans", ui-sans-serif, system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  color-scheme: light;
}

html[data-theme="dark"] {
  --navy: #040a14;
  --gold: #f6d338;
  --bg: #060e1a;
  --bg-accent: rgba(80, 160, 255, 0.16);
  --panel: #121c31;
  --panel-soft: #182640;
  --panel-2: #0c1526;
  --text: #f2f6ff;
  --muted: #9aabc8;
  --border: rgba(132, 176, 230, 0.2);
  --primary: #6bb4ff;
  --primary-soft: #153056;
  --accent: #f6d338;
  --accent-ink: #1a1608;
  --accent-soft: #3a3010;
  --purple: #b39bff;
  --green: #3ddc8a;
  --red: #ff6b7a;
  --orange: #f5b942;
  --teal: #3ee0c8;
  --cyan: #5ad4ea;
  --sidebar: #07101e;
  --sidebar-text: #eef3ff;
  --sidebar-muted: #8ea0c0;
  --sidebar-border: rgba(255, 255, 255, 0.08);
  --sidebar-hover: rgba(255, 255, 255, 0.055);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 18px 44px rgba(0, 0, 0, 0.42);
  --shadow-lg: 0 18px 52px rgba(0, 0, 0, 0.52);
  --glow: 0 0 0 1px rgba(107, 180, 255, 0.14), 0 12px 36px rgba(20, 80, 180, 0.2);
  --code-bg: #0c1526;
  --code-fg: #d7e4f8;
  --editor-bg: #0a1322;
  --editor-gutter: #08101c;
  --editor-border: #243044;
  --editor-toolbar: #121c32;
  --editor-toolbar-fg: #d7deea;
  --radius: 14px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --t-fast: 160ms;
  --t-med: 220ms;
  --font: "DM Sans", ui-sans-serif, system-ui, sans-serif;
  --display: "Plus Jakarta Sans", "DM Sans", ui-sans-serif, system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background:
    radial-gradient(900px 420px at 12% -8%, color-mix(in srgb, var(--primary) 22%, transparent), transparent 58%),
    radial-gradient(700px 360px at 92% 0%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 50%),
    linear-gradient(180deg, color-mix(in srgb, var(--primary) 8%, var(--bg)) 0%, var(--bg) 42%, color-mix(in srgb, var(--navy) 4%, var(--bg)) 100%) !important;
  color: var(--text);
}
html[data-theme="dark"] body {
  background:
    radial-gradient(900px 480px at 8% -12%, rgba(70, 140, 255, 0.22), transparent 55%),
    radial-gradient(640px 340px at 100% 0%, rgba(246, 211, 56, 0.08), transparent 46%),
    radial-gradient(500px 280px at 70% 100%, rgba(90, 212, 234, 0.07), transparent 50%),
    linear-gradient(180deg, #0a1528 0%, #07101c 55%, #060e18 100%) !important;
}
.li-icon {
  width: 1.1rem;
  height: 1.1rem;
  display: inline-block;
  flex: 0 0 auto;
  vertical-align: middle;
}

/* Hide legacy top nav on OPPE shell pages */
body.oppe-app,
body.oppe-auth {
  overflow-x: hidden;
}
body.oppe-app {
  height: 100vh;
  overflow: hidden;
}
body.oppe-app .top-nav,
body.oppe-auth .top-nav,
body.oppe-landing .top-nav { display: none !important; }
body.oppe-app main,
body.oppe-auth main {
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

a { color: var(--primary); }
.muted { color: var(--muted) !important; }
.pass { color: var(--green); }
.fail { color: var(--red); }
.flash {
  padding: .7rem .9rem;
  border-radius: 8px;
  margin-bottom: .85rem;
  background: var(--primary-soft);
  border: 1px solid var(--border);
}
.flash.error { background: #fee2e2; color: #991b1b; }
.flash.success { background: #dcfce7; color: #166534; }
html[data-theme="dark"] .flash.error { background: #3f1515; color: #fecaca; }
html[data-theme="dark"] .flash.success { background: #14301f; color: #bbf7d0; }

/* ---------- Shell / Sidebar ---------- */
.oppe-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width, 232px) minmax(0, 1fr);
  min-height: 100vh;
  height: 100vh;
  background: transparent;
  overflow: hidden;
}
.oppe-shell.sidebar-collapsed {
  --sidebar-width: 72px;
}
.lazy-sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: .95rem .75rem;
  background:
    radial-gradient(420px 220px at 0% 0%, rgba(240, 192, 20, 0.12), transparent 55%),
    linear-gradient(180deg, #121e3c 0%, #0c1730 48%, #0a1428 100%);
  color: var(--sidebar-text);
  border-right: 1px solid var(--sidebar-border);
  z-index: 40;
  overflow: hidden;
}
html[data-theme="dark"] .lazy-sidebar {
  background:
    radial-gradient(420px 220px at 0% 0%, rgba(246, 211, 56, 0.1), transparent 55%),
    linear-gradient(180deg, #0c1730 0%, #081222 100%);
}
.sidebar-top {
  display: flex;
  align-items: center;
  gap: .35rem;
  margin-bottom: .55rem;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: .55rem;
  flex: 1;
  min-width: 0;
  padding: .25rem .2rem;
  color: inherit !important;
  text-decoration: none;
  font-size: 1.02rem;
  letter-spacing: -.02em;
}
.brand-logo {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 auto;
  border: 2px solid color-mix(in srgb, var(--accent), transparent 35%);
  background: var(--navy);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent), transparent 78%);
}
.brand-text {
  font-family: var(--display);
  font-size: 1.12rem;
  font-weight: 750;
  letter-spacing: -.04em;
}
.brand-mark {
  display: none;
}
.brand-text { white-space: nowrap; overflow: hidden; }
.sidebar-collapse {
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 7px;
  border: 1px solid var(--sidebar-border);
  background: var(--sidebar-hover);
  color: var(--sidebar-text);
  cursor: pointer;
  flex: 0 0 auto;
}
.sidebar-user {
  display: flex;
  gap: .65rem;
  align-items: center;
  padding: .7rem .55rem;
  margin-bottom: .55rem;
  border-radius: 10px;
  background: var(--sidebar-hover);
  border: 1px solid var(--sidebar-border);
}
.user-avatar {
  flex: 0 0 auto;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, var(--primary), var(--purple));
  color: white;
  font-weight: 700;
}
.user-meta strong,
.user-meta .premium-badge,
.user-meta .view-profile { display: block; }
.user-meta strong { font-size: .9rem; }
.premium-badge {
  width: fit-content;
  margin-top: .18rem;
  padding: .1rem .4rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: .62rem;
  font-weight: 800;
}
.view-profile {
  margin-top: .2rem;
  color: var(--primary) !important;
  text-decoration: none;
  font-size: .72rem;
}
.nav-group {
  margin: .7rem 0 .2rem;
  padding: 0 .65rem;
  font-size: .64rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--sidebar-muted);
}
.sidebar-nav {
  display: grid;
  gap: .18rem;
  overflow: auto;
  padding-right: .15rem;
}
.sidebar-nav a,
.nav-disabled {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .58rem .65rem;
  border-radius: 9px;
  color: var(--sidebar-text) !important;
  text-decoration: none;
  font-size: .86rem;
  font-weight: 550;
}
.sidebar-nav a:hover {
  background: var(--sidebar-hover);
  transform: translateX(2px);
}
.sidebar-nav a.active {
  background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 80%, #fff));
  color: var(--accent-ink) !important;
  font-weight: 750;
  box-shadow: 0 6px 18px rgba(240, 192, 20, 0.28);
}
.sidebar-nav a,
.nav-disabled {
  transition: background .18s ease, transform .18s ease, box-shadow .18s ease;
}
.sidebar-nav a.active .nav-ico { color: var(--accent-ink); }
.nav-soon {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .58rem .65rem;
  border-radius: 9px;
  color: var(--sidebar-text) !important;
  font-size: .86rem;
  font-weight: 550;
  opacity: .92;
  cursor: default;
}
.nav-soon-badge {
  margin-left: auto;
  padding: .1rem .4rem;
  border-radius: 999px;
  background: var(--accent-soft, rgba(240, 192, 20, 0.2));
  color: var(--accent-ink, #3b2a00);
  font-size: .58rem;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.oppe-shell.sidebar-collapsed .nav-soon-badge { display: none; }
.nav-disabled {
  opacity: .55;
  cursor: not-allowed;
  color: var(--sidebar-muted) !important;
}
.nav-disabled em {
  margin-left: .35rem;
  font-style: normal;
  font-size: .62rem;
  font-weight: 700;
  color: var(--purple);
}
.nav-ico {
  width: 1.15rem;
  height: 1.15rem;
  color: var(--primary);
  flex: 0 0 auto;
}
.ico-gold { color: var(--gold) !important; }
.ico-blue { color: var(--primary) !important; }
.ico-teal { color: var(--teal) !important; }
.ico-purple { color: var(--purple) !important; }
.ico-cyan { color: #1aa3c7 !important; }
html[data-theme="dark"] .ico-cyan { color: #5ad0ea !important; }
.sidebar-nav a.active .nav-ico { color: var(--accent-ink) !important; }
.sidebar-footer { margin-top: auto; padding-top: .75rem; }
.streak-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .5rem;
  padding: .7rem .75rem;
  margin-bottom: .65rem;
  border-radius: 10px;
  background: var(--sidebar-hover);
  border: 1px solid var(--sidebar-border);
}
.streak-card strong,
.streak-card small { display: block; }
.streak-card small { color: var(--sidebar-muted); font-size: .68rem; margin-top: .15rem; }
.streak-ring {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 3px solid color-mix(in srgb, var(--accent), transparent 70%);
  border-top-color: var(--accent);
  font-size: .75rem;
  font-weight: 800;
  color: var(--accent);
}
.logout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  width: 100%;
  text-align: center;
  padding: .7rem .8rem !important;
  border-radius: 10px;
  background: linear-gradient(180deg, #2a63ea, var(--primary)) !important;
  color: white !important;
  text-decoration: none;
  font-weight: 700;
  font-size: .88rem;
  box-shadow: 0 8px 18px rgba(30, 79, 215, 0.28);
  transition: transform .18s ease, box-shadow .18s ease;
}
.logout-btn:hover { transform: translateY(-1px); }
.logout-ico { display: none; }
.logout-ico .li-icon { color: inherit; }
.sidebar-open {
  display: none;
  position: fixed;
  top: .75rem;
  left: .75rem;
  z-index: 50;
  width: 2.4rem;
  height: 2.4rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
}
.sidebar-open .li-icon { width: 1.15rem; height: 1.15rem; }
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(7, 13, 26, 0.45);
  z-index: 35;
}

/* Collapsed desktop sidebar */
.oppe-shell.sidebar-collapsed .brand-text,
.oppe-shell.sidebar-collapsed .user-meta,
.oppe-shell.sidebar-collapsed .nav-label,
.oppe-shell.sidebar-collapsed .nav-group,
.oppe-shell.sidebar-collapsed .streak-card > div,
.oppe-shell.sidebar-collapsed .premium-badge {
  display: none;
}
.oppe-shell.sidebar-collapsed .sidebar-user { justify-content: center; padding: .55rem; }
.oppe-shell.sidebar-collapsed .sidebar-nav a,
.oppe-shell.sidebar-collapsed .nav-disabled,
.oppe-shell.sidebar-collapsed .nav-soon {
  justify-content: center;
  padding: .65rem .4rem;
}
.oppe-shell.sidebar-collapsed .logout-btn .nav-label { display: none; }
.oppe-shell.sidebar-collapsed .logout-ico { display: inline; }
.oppe-shell.sidebar-collapsed .streak-card { justify-content: center; }
.oppe-shell.sidebar-collapsed .sidebar-collapse { transform: rotate(180deg); }
.oppe-shell.sidebar-collapsed .sidebar-brand { justify-content: center; }

/* ---------- Main ---------- */
.oppe-main {
  min-width: 0;
  min-height: 0;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: .85rem 1rem 1rem;
}
.practice-header,
.header-tools,
.section-heading,
.panel-title,
.problem-heading,
.history-title,
.editor-toolbar,
.editor-actions,
.filter-row,
.library-filters,
.timer-block,
.problem-heading-actions {
  display: flex;
  align-items: center;
}
.practice-header {
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: .55rem;
  flex: 0 0 auto;
}
.oppe-flash { flex: 0 0 auto; }
.practice-header h1 {
  margin: 0;
  font-size: 1.55rem;
  letter-spacing: -.03em;
}
.subtitle {
  margin: .2rem 0 0;
  color: var(--muted);
  font-size: .92rem;
}
.header-tools { gap: .45rem; flex-wrap: wrap; justify-content: flex-end; }
.mode-tabs { display: flex; gap: .3rem; flex-wrap: wrap; margin-right: .25rem; }
.mode-tabs a {
  padding: .38rem .7rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--muted) !important;
  text-decoration: none;
  font-size: .78rem;
  font-weight: 650;
}
.mode-tabs a.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white !important;
}
html[data-theme="dark"] .mode-tabs a.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink) !important;
}
.icon-button {
  width: 2.2rem;
  height: 2.2rem;
  padding: 0 !important;
  border-radius: 8px !important;
  border: 1px solid var(--border) !important;
  background: var(--panel) !important;
  color: var(--text) !important;
  cursor: pointer;
}
.icon-button.notify { position: relative; }
.icon-button.notify::after {
  content: "";
  position: absolute;
  top: .35rem;
  right: .4rem;
  width: .4rem;
  height: .4rem;
  border-radius: 50%;
  background: var(--red);
}
.icon-button:disabled { opacity: .55; cursor: default; }
.icon-button .li-icon { width: 1.05rem; height: 1.05rem; }
html[data-theme="dark"] .theme-icon-light { display: none; }
html[data-theme="light"] .theme-icon-dark,
html:not([data-theme]) .theme-icon-dark { display: none; }
html[data-theme="dark"] .theme-icon-dark { display: inline-flex; }
html[data-theme="light"] .theme-icon-light,
html:not([data-theme]) .theme-icon-light { display: inline-flex; }

/* ---------- Courses ---------- */
.section-heading { justify-content: space-between; gap: .75rem; margin-bottom: .55rem; }
.section-heading h2,
.panel-title h2 {
  margin: 0;
  font-size: .95rem;
  font-weight: 700;
}
.step {
  display: inline-grid;
  place-items: center;
  width: 1.45rem;
  height: 1.45rem;
  margin-right: .45rem;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: .72rem;
  font-weight: 800;
}
.manage-link {
  color: var(--primary) !important;
  text-decoration: none;
  font-size: .82rem;
  font-weight: 650;
}
.course-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: .65rem;
  margin-bottom: .65rem;
  max-height: 7.5rem;
  overflow: auto;
}
.course-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: .55rem;
  width: 100%;
  padding: .75rem !important;
  border-radius: var(--radius) !important;
  border: 1px solid var(--border) !important;
  background: var(--panel) !important;
  color: var(--text) !important;
  text-align: left;
  cursor: pointer;
  box-shadow: var(--shadow);
}
.course-card:hover { border-color: color-mix(in srgb, var(--primary), transparent 40%) !important; }
.course-card.active {
  border-color: var(--accent) !important;
  background: var(--accent-soft) !important;
  box-shadow: 0 0 0 1px var(--accent), var(--shadow);
}
.course-card .subject-badge {
  flex: 0 0 auto;
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: .7rem;
  font-weight: 800;
}
.course-card.active .subject-badge {
  background: var(--accent);
  color: var(--accent-ink);
}
.course-copy strong,
.course-copy small { display: block; }
.course-copy strong { font-size: .82rem; line-height: 1.25; }
.course-lang { margin-top: .2rem; color: var(--muted); font-size: .68rem; }
.course-stats { margin-top: .25rem; color: var(--muted); font-size: .68rem; font-weight: 600; }
.selected-check {
  display: none;
  position: absolute;
  top: -.35rem;
  right: -.3rem;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: .7rem;
  font-weight: 800;
  text-align: center;
  line-height: 1.15rem;
}
.course-card.active .selected-check { display: block; }

/* ---------- Workspace: LEFT library | CENTER solve | RIGHT results ---------- */
.course-section { flex: 0 0 auto; }
.main-workspace {
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.8fr) minmax(0, 0.9fr);
  gap: .75rem;
  align-items: stretch;
}
.library-panel,
.solve-panel,
.results-column {
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}
.library-panel,
.solve-panel {
  display: flex;
  flex-direction: column;
}
.results-column {
  display: grid;
  grid-template-rows: auto minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: .65rem;
}
.library-panel .panel-title,
.solve-panel .problem-heading,
.solve-panel .content-tabs,
.library-filters {
  flex: 0 0 auto;
}
.problem-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}
.pagination { flex: 0 0 auto; }

/* legacy alias kept for safety */
.workspace-grid { display: contents; }
.right-column { display: contents; }

.library-panel,
.solve-panel,
.timer-panel,
.results-panel,
.history-panel {
  background: var(--panel) !important;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .75rem;
  box-shadow: var(--shadow);
  color: var(--text);
}

.panel-title { display: flex; align-items: center; gap: .35rem; margin-bottom: .55rem; }
.library-filters { display: grid; gap: .45rem; margin-bottom: .45rem; }
.status-tabs,
.content-tabs {
  display: flex;
  gap: .15rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: .55rem;
}
.status-tabs button,
.content-tabs button {
  background: none !important;
  color: var(--muted) !important;
  border: 0 !important;
  border-bottom: 2px solid transparent !important;
  border-radius: 0 !important;
  padding: .45rem .55rem !important;
  font-size: .78rem;
  font-weight: 650;
  cursor: pointer;
}
.status-tabs button.active,
.content-tabs button.active {
  color: var(--text) !important;
  border-bottom-color: var(--primary) !important;
}
html[data-theme="dark"] .status-tabs button.active,
html[data-theme="dark"] .content-tabs button.active {
  border-bottom-color: var(--accent) !important;
}
.filter-row { gap: .4rem; flex-wrap: wrap; }
.filter-row select,
#problem-search {
  width: auto;
  min-width: 0;
  flex: 1;
  padding: .42rem .55rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  font-size: .78rem;
}
#problem-search { flex: 1.4; min-width: 120px; }

.problem-list { max-height: none; }
.problem-row {
  display: grid;
  grid-template-columns: 2.2rem minmax(0, 1fr) auto;
  gap: .55rem;
  align-items: center;
  padding: .55rem .2rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.problem-row-actions {
  display: flex;
  align-items: center;
  gap: .2rem;
}
.problem-row .q-reset {
  width: 2rem;
  height: 2rem;
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 8px;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.problem-row .q-reset:hover {
  color: #c82333;
  background: color-mix(in srgb, #dc3545 12%, transparent);
}
.problem-row:hover,
.problem-row.active { background: var(--panel-soft); }
.problem-number { color: var(--muted); font-size: .74rem; font-variant-numeric: tabular-nums; }
.problem-row h3 {
  margin: 0 0 .2rem;
  font-size: .84rem;
  font-weight: 650;
}
.problem-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .28rem;
  align-items: center;
  font-size: .68rem;
  color: var(--muted);
}
.tag {
  padding: .1rem .35rem;
  border-radius: 999px;
  background: var(--panel-soft);
  border: 1px solid var(--border);
}
.difficulty {
  display: inline-block;
  padding: .14rem .42rem !important;
  border-radius: 999px !important;
  font-size: .68rem !important;
  font-weight: 700;
  background: var(--panel-soft);
}
.difficulty.easy { color: var(--green); background: #dcfce7; }
.difficulty.medium { color: #9a6700; background: #fef3c7; }
.difficulty.hard { color: var(--red); background: #fee2e2; }
html[data-theme="dark"] .difficulty.easy { background: #14301f; }
html[data-theme="dark"] .difficulty.medium { background: #3a3010; color: var(--accent); }
html[data-theme="dark"] .difficulty.hard { background: #3f1515; }
.solve-button {
  padding: .35rem .55rem !important;
  border-radius: 8px !important;
  background: transparent !important;
  color: var(--primary) !important;
  border: 1px solid transparent !important;
  font-size: .74rem !important;
  font-weight: 700 !important;
  white-space: nowrap;
}
.problem-row:hover .solve-button,
.problem-row.active .solve-button {
  border-color: var(--primary) !important;
  background: var(--primary-soft) !important;
}
html[data-theme="dark"] .solve-button { color: var(--accent) !important; }
html[data-theme="dark"] .problem-row:hover .solve-button,
html[data-theme="dark"] .problem-row.active .solve-button {
  border-color: var(--accent) !important;
  background: var(--accent-soft) !important;
  color: var(--accent) !important;
}
.solved-mark { color: var(--green); font-weight: 800; }
.faq-badge {
  display: inline-block;
  margin-left: .25rem;
  padding: .08rem .35rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--orange);
  font-size: .62rem;
  font-weight: 800;
}
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: .45rem;
  margin-top: .65rem;
  color: var(--muted);
  font-size: .76rem;
}
.pagination button {
  padding: .28rem .5rem !important;
  background: var(--panel-soft) !important;
  color: var(--text) !important;
  border: 1px solid var(--border) !important;
  border-radius: 7px !important;
}

/* ---------- Solve (CENTER column) ---------- */
.problem-workspace {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}
#problem-empty[hidden],
#problem-workspace[hidden] {
  display: none !important;
}
.empty-state {
  flex: 0 0 auto;
  min-height: 0;
  display: block;
  text-align: left;
  color: var(--muted);
}
.problem-heading {
  justify-content: space-between;
  align-items: flex-start;
  gap: .75rem;
  margin-bottom: .45rem;
  flex: 0 0 auto;
}
.problem-heading > div:first-child {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .2rem;
  min-width: 0;
  flex: 1 1 auto;
}
.problem-heading h2 {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.3;
  display: block;
}
.back-link {
  display: block;
  margin: 0;
  color: var(--primary) !important;
  text-decoration: none;
  font-size: .74rem;
  font-weight: 650;
  line-height: 1.3;
}
.problem-heading .eyebrow {
  display: block;
  margin: 0;
  color: var(--primary);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: none;
  line-height: 1.3;
}
html[data-theme="dark"] .problem-heading .eyebrow { color: var(--accent); }
.eyebrow {
  color: var(--primary);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: none;
}
html[data-theme="dark"] .eyebrow { color: var(--accent); }
.problem-heading-actions {
  flex: 0 0 auto;
  gap: .4rem;
  padding-top: .15rem;
}
.content-tabs { flex: 0 0 auto; margin-bottom: .35rem; }
.solve-split {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: .65rem;
  align-items: stretch;
}
.solve-panel.is-dbms .solve-split,
.solve-panel.dbms-mode .solve-split {
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.15fr);
}
.statement-side,
.editor-side {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.statement-content {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  padding-right: .3rem;
  font-size: .84rem;
  line-height: 1.5;
}
.statement-content pre,
.test-card pre,
.example-block pre,
.public-test-card pre,
.result-card pre,
.code-block,
body.oppe-app pre:not(.CodeMirror-line):not(.CodeMirror-line-like) {
  background: var(--code-bg) !important;
  color: var(--code-fg) !important;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .55rem .65rem;
  font-family: var(--mono);
  font-size: .78rem;
  white-space: pre-wrap;
}
.example-block {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .55rem;
  margin: .45rem 0;
  background: var(--panel-soft);
}
.example-block h4 { margin: 0 0 .3rem; font-size: .8rem; }
.tab-placeholder {
  min-height: 80px;
  padding: 1rem;
  color: var(--muted);
  text-align: center;
}
.tab-disabled {
  opacity: .55 !important;
  cursor: not-allowed !important;
}
.tab-disabled em { font-style: normal; font-size: .65rem; color: var(--purple); }
.dbms-schema {
  flex: 0 1 auto;
  max-height: 34%;
  overflow: auto;
  margin: .45rem 0 0;
  padding: .55rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-soft);
  font-size: .78rem;
}
.schema-table { margin-bottom: .45rem; }
.schema-table ul { margin: .2rem 0 0 1rem; padding: 0; }
.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: .92rem; }
.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, #fff);
  box-shadow: 0 1px 2px #1720330a;
}
.db-table-card header {
  padding: .42rem .6rem;
  background: color-mix(in srgb, var(--primary) 14%, var(--panel-soft, #f4f6fa));
  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);
  vertical-align: middle;
  font-size: .74rem;
}
.db-table-card tr:last-child td { border-bottom: 0; }
.schema-col-name code { font-size: .72rem; }
.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;
  letter-spacing: .02em;
}
.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; }
.learning-panel { margin-top: .45rem; flex: 0 0 auto; }
.learning-actions { margin-bottom: .35rem; }

.editor-side .editor-toolbar { flex: 0 0 auto; }
.editor-frame {
  flex: 1 1 auto;
  min-height: 440px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.editor-toolbar {
  justify-content: space-between;
  background: var(--editor-toolbar);
  border: 1px solid var(--editor-border);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  color: var(--editor-toolbar-fg);
}
.editor-toolbar-left {
  display: flex;
  align-items: center;
  gap: .4rem;
}
.filename-tab {
  padding: .45rem .65rem;
  border-top: 2px solid var(--accent);
  font-family: var(--mono);
  font-size: .76rem;
}
.btn-reset-toolbar {
  padding: .28rem .6rem;
  border-radius: 6px;
  font-size: .72rem;
  font-weight: 700;
  cursor: pointer;
  background: #dc3545 !important;
  color: #fff !important;
  border: 1px solid #b02a37 !important;
  box-shadow: 0 2px 8px rgba(220, 53, 69, 0.35);
  transition: background .15s, transform .15s, box-shadow .15s;
}
.btn-reset-toolbar:hover {
  background: #c82333 !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(220, 53, 69, 0.45);
}
.editor-toolbar select {
  width: auto;
  margin: .3rem .4rem;
  padding: .25rem .35rem;
  background: color-mix(in srgb, var(--editor-bg) 70%, var(--panel));
  color: var(--editor-toolbar-fg);
  border-color: var(--editor-border) !important;
  border-radius: 6px;
  font-size: .74rem;
}
.CodeMirror {
  flex: 1 1 auto !important;
  height: 100% !important;
  min-height: 0;
  font-size: .84rem;
  font-family: var(--mono);
  border: 1px solid var(--editor-border);
  border-radius: 0 0 8px 8px;
  background: var(--editor-bg) !important;
}
.CodeMirror-gutters {
  background: var(--editor-gutter) !important;
  border-right: 1px solid var(--editor-border) !important;
}
.CodeMirror pre.CodeMirror-line,
.CodeMirror pre.CodeMirror-line-like {
  background: transparent !important;
  color: inherit !important;
  border: 0 !important;
  border-radius: 0 !important;
  padding: 0 4px 0 0 !important;
  margin: 0 !important;
  font-family: inherit !important;
  font-size: inherit !important;
  white-space: pre !important;
  word-wrap: normal !important;
  box-shadow: none !important;
}
.editor-frame > .CodeMirror { width: 100%; }
.kbd {
  margin-left: .35rem;
  padding: .08rem .32rem;
  border-radius: 4px;
  border: 1px solid currentColor;
  font-size: .62rem;
  font-weight: 650;
  opacity: .75;
}
.editor-actions {
  gap: .4rem;
  margin-top: .55rem;
  flex-wrap: wrap;
  flex: 0 0 auto;
}
.editor-actions button {
  flex: 0 1 auto;
  min-width: 0;
  padding: .5rem .7rem !important;
  border-radius: 8px !important;
  font-size: .78rem !important;
  font-weight: 700 !important;
  cursor: pointer;
}
.btn-run,
.btn-outline {
  background: color-mix(in srgb, var(--primary) 10%, transparent) !important;
  color: var(--primary) !important;
  border: 1px solid color-mix(in srgb, var(--primary) 55%, var(--border)) !important;
  box-shadow: 0 4px 12px rgba(30, 79, 215, 0.08);
}
.btn-run:hover,
.btn-outline:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 16px rgba(30, 79, 215, 0.16);
}
.btn-submit {
  background: linear-gradient(180deg, #ffd34a, var(--accent)) !important;
  color: var(--accent-ink) !important;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, #b8860b) !important;
  box-shadow: 0 8px 18px rgba(240, 192, 20, 0.28);
  flex: 1 !important;
}
.btn-submit:hover { transform: translateY(-1px); }
.btn-reset,
.ghost-button {
  background: transparent !important;
  color: var(--muted) !important;
  border: 1px solid transparent !important;
}
#custom-input-wrap { margin-top: .45rem; flex: 0 0 auto; }
#custom-input-wrap textarea {
  background: var(--panel-soft);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
}

/* ---------- Right column ---------- */
.timer-panel { flex: 0 0 auto; }
.results-panel,
.history-panel {
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.results-scroll,
.history-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}
.timer-block {
  justify-content: space-between;
  gap: .55rem;
  width: 100%;
}
.timer-ico { font-size: 1.05rem; }
.timer-block strong {
  display: block;
  font-variant-numeric: tabular-nums;
  font-size: 1rem;
}
.timer-block small { color: var(--muted); font-size: .68rem; }
.end-session {
  margin-left: auto;
  background: transparent !important;
  color: var(--red) !important;
  border: 0 !important;
  padding: .25rem .2rem !important;
  font-size: .76rem !important;
  font-weight: 700 !important;
}
.end-session:disabled { opacity: .55; cursor: not-allowed; }

.result-summary {
  padding: .5rem .6rem;
  border-radius: 8px;
  margin-bottom: .45rem;
  background: var(--panel-soft);
  border: 1px solid var(--border);
  font-weight: 700;
  font-size: .8rem;
}
.test-card {
  border: 1px solid var(--border);
  border-left: 3px solid var(--red);
  border-radius: 8px;
  padding: .5rem;
  margin-top: .4rem;
  font-size: .72rem;
  background: var(--panel);
}
.test-card.pass-card { border-left-color: var(--green); }
.test-card h4 {
  display: flex;
  justify-content: space-between;
  margin: 0 0 .3rem;
  font-size: .76rem;
}
.history-title { justify-content: space-between; }
.history-title a { font-size: .74rem; text-decoration: none; color: var(--primary) !important; }
.history-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: .25rem;
  padding: .5rem 0;
  border-bottom: 1px solid var(--border);
  font-size: .72rem;
  text-decoration: none;
  color: inherit;
}
.history-item small { color: var(--muted); }
.verdict { font-weight: 750; }
.verdict.accepted { color: var(--green); }
.verdict.wrong-answer { color: var(--orange); }
.verdict.runtime-error,
.verdict.time-limit-exceeded { color: var(--red); }
.loading { opacity: .6; pointer-events: none; }

/* Auth pages */
body.oppe-auth {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at top right, color-mix(in srgb, var(--primary), transparent 82%), transparent 40%),
    var(--bg);
}
body.oppe-auth .top-nav { display: none !important; }
body.oppe-auth main { max-width: none !important; margin: 0 !important; padding: 1rem !important; width: 100%; }
.auth-shell {
  width: min(420px, 100%);
  padding: 1.4rem 1.35rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: var(--shadow);
}
.auth-brand {
  display: flex;
  align-items: center;
  gap: .65rem;
  margin-bottom: 1rem;
  text-decoration: none;
  color: var(--text) !important;
  font-weight: 750;
}
.auth-brand .brand-logo {
  width: 2.6rem;
  height: 2.6rem;
}
.auth-shell h1 { margin: 0 0 .35rem; font-size: 1.35rem; }
.auth-shell .subtitle { margin: 0 0 1rem; }
.auth-student-mail-notice {
  margin: .55rem 0 1.15rem;
  font-size: clamp(1.35rem, 4.2vw, 1.85rem);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -.02em;
  color: var(--red, #c62828);
  text-align: center;
}
.password-field { position: relative; }
.password-field input { padding-right: 4.2rem; }
.password-toggle {
  position: absolute;
  right: .35rem;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent !important;
  color: var(--primary) !important;
  font-size: .75rem !important;
  font-weight: 700 !important;
  padding: .35rem .45rem !important;
  cursor: pointer;
}
.auth-actions { margin-top: 1rem; }
.auth-actions button {
  width: 100%;
  background: linear-gradient(180deg, #ffd34a, var(--accent)) !important;
  color: var(--accent-ink) !important;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, #b8860b) !important;
  border-radius: 10px !important;
  padding: .75rem !important;
  font-weight: 750 !important;
  box-shadow: 0 8px 18px rgba(240, 192, 20, 0.28);
}
.auth-actions button[disabled] { opacity: .7; cursor: wait; }
.auth-actions a.button {
  display: block;
  width: 100%;
  text-align: center;
  background: linear-gradient(180deg, #ffd34a, var(--accent)) !important;
  color: var(--accent-ink) !important;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, #b8860b) !important;
  border-radius: 10px !important;
  padding: .75rem !important;
  font-weight: 750 !important;
  box-shadow: 0 8px 18px rgba(240, 192, 20, 0.28);
}
.auth-links { margin-top: .85rem; text-align: center; font-size: .88rem; }
.auth-google { margin: 0 0 1rem; }
.auth-google-btn { display: flex; justify-content: center; min-height: 44px; width: 100%; }
.auth-google-btn > div { margin: 0 auto; }
.auth-google-error {
  margin: .7rem 0 0;
  color: #8a2020;
  font-size: .88rem;
  font-weight: 650;
}
html[data-theme="dark"] .auth-google-error { color: #ffb4b4; }
.auth-config-note { margin: 0 0 1rem; font-size: .88rem; }
.auth-divider {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin: .15rem 0 1rem;
  color: var(--muted, #687386);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border, #e4e8ef);
}

/* ---------- Mock extras ---------- */
.mock-legend { margin-top: .65rem; font-size: .7rem; }

/* ---------- Responsive ---------- */
/* Keep true 3-column workspace on desktop; only stack inside center at mid widths */
@media (max-width: 1280px) and (min-width: 901px) {
  .main-workspace {
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.7fr) minmax(0, 0.85fr);
  }
  .solve-split { grid-template-columns: 1fr; }
  .statement-side { max-height: 38%; }
  .editor-side { min-height: 0; }
  .editor-frame,
  .CodeMirror { min-height: 360px; }
}
@media (max-width: 900px) {
  .oppe-shell {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }
  body.oppe-app {
    height: auto;
    overflow: auto;
  }
  .sidebar-open { display: inline-grid; place-items: center; }
  .lazy-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: min(280px, 86vw);
    transform: translateX(-105%);
    transition: transform .2s ease;
    box-shadow: var(--shadow);
  }
  .lazy-sidebar.open { transform: translateX(0); }
  .sidebar-backdrop.open { display: block; }
  .sidebar-collapse { display: none; }
  .oppe-main {
    height: auto;
    overflow: visible;
    padding: 3.2rem .85rem 1.1rem;
  }
  .main-workspace {
    display: flex;
    flex-direction: column;
    height: auto;
    overflow: visible;
  }
  .library-panel,
  .solve-panel,
  .results-column {
    height: auto;
    overflow: visible;
  }
  .problem-list { max-height: 50vh; }
  .statement-content { max-height: none; }
  .solve-split { grid-template-columns: 1fr; }
  .editor-frame { min-height: 240px; }
  .CodeMirror { min-height: 240px; height: 260px !important; }
  .results-column {
    display: flex;
    flex-direction: column;
  }
  .results-scroll,
  .history-scroll { max-height: 40vh; }
  .course-strip {
    max-height: none;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }
  .practice-header { align-items: flex-start; flex-direction: column; }
}

/* ---------- Admin (preserved) ---------- */
.admin-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.admin-sidebar {
  position: sticky;
  top: 1rem;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 7rem);
  padding: 1rem .9rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: var(--shadow);
}
.admin-sidebar-heading { display: flex; align-items: center; gap: .7rem; padding: 0 .15rem 1rem; border-bottom: 1px solid var(--border); }
.admin-sidebar-heading strong, .admin-sidebar-heading small { display: block; }
.admin-sidebar-heading strong { font-family: var(--display); letter-spacing: -.03em; }
.admin-sidebar-heading small { max-width: 148px; margin-top: .15rem; overflow: hidden; color: var(--muted); font-size: .68rem; text-overflow: ellipsis; white-space: nowrap; }
.admin-brand-logo { width: 2.45rem; height: 2.45rem; border-radius: 10px; object-fit: contain; }
.admin-nav { display: grid; gap: .28rem; margin-top: .9rem; }
.admin-nav a {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .68rem .7rem;
  border-radius: 10px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 650;
  border: 1px solid transparent;
  transition: background var(--t-fast) ease, color var(--t-fast) ease, border-color var(--t-fast) ease, transform var(--t-fast) ease;
}
.admin-nav a .li-icon { width: 1.05rem; height: 1.05rem; flex-shrink: 0; }
.admin-nav a:hover { background: var(--sidebar-hover, var(--panel-soft)); color: var(--text); }
.admin-nav a.active {
  background: var(--accent-soft);
  color: var(--accent-ink);
  border-color: color-mix(in srgb, var(--accent) 35%, transparent);
  box-shadow: 0 6px 16px color-mix(in srgb, var(--accent) 18%, transparent);
}
.admin-nav a:focus-visible,
.admin-stat:focus-visible,
.admin-shortcut:focus-visible,
.course-coverage a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.admin-sidebar-footer { display: grid; gap: .45rem; margin-top: auto; padding-top: 1rem; border-top: 1px solid var(--border); }
.admin-sidebar-footer a { color: var(--muted); text-decoration: none; font-size: .84rem; padding: .2rem .15rem; }
.admin-sidebar-footer a:hover { color: var(--text); }
.admin-sidebar-footer button { width: 100%; }
.admin-main { min-width: 0; }
.admin-main .panel {
  padding: 1rem 1.05rem 1.05rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: var(--shadow);
}
.admin-page-header { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1.1rem; }
.admin-page-header h1 { margin: .15rem 0 .25rem; font-family: var(--display); letter-spacing: -.04em; }
.admin-primary-action { white-space: nowrap; }
.admin-filters { display: grid; grid-template-columns: 1.5fr repeat(3, .8fr) auto auto; gap: .6rem; align-items: end; margin-bottom: 1rem; }
.admin-table-wrap { overflow: auto; max-width: 100%; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td { padding: .78rem .7rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.admin-table th {
  color: var(--muted);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.admin-table tbody tr { transition: background var(--t-fast) ease; }
.admin-table tbody tr:hover { background: color-mix(in srgb, var(--primary) 6%, var(--panel)); }
.admin-table td { font-size: .9rem; }
.admin-table td:last-child { white-space: nowrap; color: var(--muted); font-variant-numeric: tabular-nums; }
.admin-overview .verdict {
  display: inline-flex;
  align-items: center;
  padding: .18rem .5rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel-soft);
  font-size: .75rem;
  font-weight: 750;
}
.admin-overview .verdict.accepted {
  color: var(--green);
  border-color: color-mix(in srgb, var(--green) 35%, var(--border));
  background: color-mix(in srgb, var(--green) 10%, var(--panel));
}
.admin-overview .verdict.wrong-answer {
  color: var(--orange);
  border-color: color-mix(in srgb, var(--orange) 35%, var(--border));
  background: color-mix(in srgb, var(--orange) 10%, var(--panel));
}
.admin-overview .verdict.runtime-error,
.admin-overview .verdict.time-limit-exceeded {
  color: var(--red);
  border-color: color-mix(in srgb, var(--red) 35%, var(--border));
  background: color-mix(in srgb, var(--red) 10%, var(--panel));
}
.table-subtext { display: block; color: var(--muted); font-size: .75rem; margin-top: .2rem; }
.actions-cell { white-space: nowrap; }
.actions-cell form { display: inline; }
.small-action { background: none !important; border: 0 !important; color: var(--primary) !important; padding: .2rem .35rem !important; cursor: pointer; font-weight: 650; text-decoration: none; }
.danger-action { color: var(--red) !important; }
.admin-empty { text-align: center; color: var(--muted); }
.admin-pagination { display: flex; gap: .75rem; justify-content: center; align-items: center; margin-top: 1rem; }
.admin-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.admin-section-title { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: .85rem; }
.admin-section-title h2 { margin: 0; font-family: var(--display); font-size: 1.05rem; letter-spacing: -.03em; }
.admin-section-title p { margin: .2rem 0 0; }
.repeatable-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.repeatable-card { border: 1px solid var(--border); border-radius: 10px; padding: .75rem; background: var(--panel-soft); }
.repeatable-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: .5rem; }
.remove-repeatable { background: none !important; border: 0 !important; color: var(--red) !important; cursor: pointer; }
.admin-form-actions { display: flex; gap: .65rem; flex-wrap: wrap; margin-top: 1rem; }
.admin-stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; margin-bottom: 1.1rem; }
.admin-stat {
  display: flex;
  flex-direction: column;
  gap: .2rem;
  min-height: 8.4rem;
  padding: .95rem 1rem .9rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--panel) 86%, #fff), var(--panel));
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
  transition: transform var(--t-med) var(--ease), box-shadow var(--t-med) ease, border-color var(--t-fast) ease;
}
.admin-stat:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--primary) 28%, var(--border));
  box-shadow: var(--shadow-lg);
}
.admin-stat-ico {
  display: grid;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  margin-bottom: .35rem;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--primary) 22%, var(--border));
  background: color-mix(in srgb, var(--primary) 10%, var(--panel));
  color: var(--primary);
}
.admin-stat:nth-child(1) .admin-stat-ico { color: var(--accent-ink); background: color-mix(in srgb, var(--accent) 16%, var(--panel)); border-color: color-mix(in srgb, var(--accent) 36%, var(--border)); }
html[data-theme="dark"] .admin-stat:nth-child(1) .admin-stat-ico { color: var(--accent); }
.admin-stat:nth-child(2) .admin-stat-ico { color: var(--purple); background: color-mix(in srgb, var(--purple) 12%, var(--panel)); border-color: color-mix(in srgb, var(--purple) 28%, var(--border)); }
.admin-stat:nth-child(3) .admin-stat-ico { color: var(--cyan); background: color-mix(in srgb, var(--cyan) 12%, var(--panel)); border-color: color-mix(in srgb, var(--cyan) 28%, var(--border)); }
.admin-stat-ico.is-ok { color: var(--green); background: color-mix(in srgb, var(--green) 12%, var(--panel)); border-color: color-mix(in srgb, var(--green) 28%, var(--border)); }
.admin-stat-ico .li-icon { width: 1.05rem; height: 1.05rem; }
.admin-stat > span:not(.admin-stat-ico) {
  color: var(--muted);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.admin-stat strong {
  font-family: var(--display);
  font-size: 1.7rem;
  letter-spacing: -.04em;
  line-height: 1.1;
  color: var(--text);
}
.admin-stat small { color: var(--muted); font-size: .78rem; }
.admin-dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); gap: 1rem; }
.course-coverage { display: grid; gap: .45rem; }
.course-coverage a {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: .7rem;
  padding: .65rem .7rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  background: var(--panel-soft);
  transition: transform var(--t-fast) ease, border-color var(--t-fast) ease, box-shadow var(--t-fast) ease;
}
.course-coverage a:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--primary) 30%, var(--border));
  box-shadow: var(--shadow);
}
.course-coverage .course-copy { display: grid; gap: .18rem; min-width: 0; }
.course-coverage .course-copy strong { font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.course-coverage .course-copy small { color: var(--muted); font-size: .75rem; }
.course-bar {
  display: block;
  height: 5px;
  margin-top: .15rem;
  border-radius: 99px;
  background: color-mix(in srgb, var(--border) 70%, transparent);
  overflow: hidden;
}
.course-bar > span {
  display: block;
  height: 100%;
  width: var(--pct, 0%);
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}
.admin-shortcut {
  display: flex;
  align-items: center;
  gap: .9rem;
  margin-top: 1rem;
  padding: .95rem 1.05rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
  transition: transform var(--t-med) var(--ease), box-shadow var(--t-med) ease, border-color var(--t-fast) ease;
}
.admin-shortcut:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--primary) 28%, var(--border));
  box-shadow: var(--shadow-lg);
}
.admin-shortcut strong { display: block; font-family: var(--display); font-size: 1.02rem; }
.admin-shortcut p { margin: .2rem 0 0; color: var(--muted); font-size: .86rem; }
.admin-shortcut-cta {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  margin-left: auto;
  font-size: .82rem;
  font-weight: 750;
  color: var(--primary);
  white-space: nowrap;
}
.admin-shortcut:hover .admin-shortcut-cta .li-icon { transform: translateX(3px); }
.admin-shortcut-cta .li-icon { width: .9rem; height: .9rem; transition: transform .2s ease; }
html[data-theme="dark"] .admin-stat,
html[data-theme="dark"] .admin-shortcut,
html[data-theme="dark"] .admin-main .panel {
  background: linear-gradient(180deg, rgba(255,255,255,.03), transparent 42%), var(--panel);
}
.checkbox-label { display: flex !important; align-items: center; gap: .45rem; font-weight: 550 !important; }
.ghost-button.button, .secondary { background: var(--panel-soft) !important; color: var(--text) !important; border: 1px solid var(--border) !important; }
.private-test { border-left: 3px solid var(--red); }
.public-test { border-left: 3px solid var(--green); }

@media (max-width: 1050px) {
  .admin-stat-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-dashboard-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar { position: static; min-height: auto; }
  .admin-nav { grid-template-columns: repeat(3, 1fr); overflow-x: auto; }
  .admin-nav a { justify-content: center; }
  .admin-nav a span { font-size: .78rem; }
  .admin-filters { grid-template-columns: 1fr 1fr; }
  .admin-filters input { grid-column: 1 / -1; }
  .repeatable-grid, .admin-form-grid { grid-template-columns: 1fr; }
  .admin-page-header { align-items: flex-start; flex-direction: column; }
  .admin-shortcut { flex-wrap: wrap; }
  .admin-shortcut-cta { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .admin-stat,
  .admin-shortcut,
  .course-coverage a,
  .admin-nav a {
    transition: none;
  }
  .admin-stat:hover,
  .admin-shortcut:hover,
  .course-coverage a:hover {
    transform: none;
  }
}

.nav-count {
  display: inline-grid;
  place-items: center;
  min-width: 1.2rem;
  height: 1.2rem;
  margin-left: .35rem;
  padding: 0 .3rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: .68rem;
  font-style: normal;
  font-weight: 800;
}
.visually-hidden,
.feedback-honeypot {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.feedback-root {
  position: fixed;
  inset: 0;
  z-index: 55;
  pointer-events: none;
}
.feedback-root .feedback-float,
.feedback-root .feedback-restore,
.feedback-root .feedback-dialog {
  pointer-events: auto;
}

.feedback-float {
  position: fixed;
  right: 1.15rem;
  bottom: 1.15rem;
  z-index: 55;
  display: flex;
  align-items: flex-start;
  gap: .35rem;
  max-width: min(22rem, calc(100vw - 2rem));
}
.feedback-float[hidden] { display: none !important; }

.feedback-fab {
  position: static;
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .7rem .9rem .7rem .7rem;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--border));
  border-radius: 999px;
  background: var(--panel);
  color: var(--text);
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  text-align: left;
  font: inherit;
}
.feedback-dismiss {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 1.65rem;
  height: 1.65rem;
  margin-top: .15rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--panel);
  color: var(--muted);
  box-shadow: var(--shadow);
  cursor: pointer;
  font: inherit;
}
.feedback-dismiss .li-icon { width: .75rem; height: .75rem; }
.feedback-dismiss:hover {
  color: var(--text);
  border-color: color-mix(in srgb, var(--red) 40%, var(--border));
  background: color-mix(in srgb, var(--red) 8%, var(--panel));
}
.feedback-restore {
  position: fixed;
  right: 1.15rem;
  bottom: 1.15rem;
  z-index: 55;
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--border));
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  font: inherit;
}
.feedback-restore[hidden] { display: none !important; }
.feedback-restore .li-icon { width: 1.15rem; height: 1.15rem; }
.feedback-restore:hover { transform: translateY(-1px); }
.feedback-restore:focus-visible,
.feedback-dismiss:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.feedback-fab:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
}
.feedback-fab:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.feedback-fab-ico {
  display: grid;
  place-items: center;
  width: 2.15rem;
  height: 2.15rem;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
}
.feedback-fab-ico .li-icon { width: 1.05rem; height: 1.05rem; }
.feedback-fab-copy {
  display: grid;
  gap: .08rem;
  min-width: 0;
}
.feedback-fab-copy strong {
  font-size: .82rem;
  font-weight: 750;
  letter-spacing: -.01em;
  line-height: 1.2;
}
.feedback-fab-copy small {
  color: var(--muted);
  font-size: .68rem;
  font-weight: 600;
  line-height: 1.3;
}
.feedback-dialog {
  width: min(26rem, calc(100vw - 1.5rem));
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--panel);
  color: var(--text);
  box-shadow: var(--shadow-lg);
}
.feedback-dialog::backdrop {
  background: rgba(9, 20, 40, .45);
}
.feedback-form { padding: 1.05rem 1.1rem 1.1rem; }
.feedback-head {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  margin-bottom: .85rem;
}
.feedback-head h2 {
  margin: 0 0 .25rem;
  font-family: var(--display), inherit;
  font-size: 1.12rem;
  letter-spacing: -.03em;
}
.feedback-head p {
  margin: 0;
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.45;
}
.feedback-close { margin-left: auto; flex-shrink: 0; }
.feedback-kinds {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .5rem;
  margin: 0 0 .85rem;
  padding: 0;
  border: 0;
}
.feedback-kind {
  margin: 0;
  cursor: pointer;
}
.feedback-kind input { position: absolute; opacity: 0; pointer-events: none; }
.feedback-kind span {
  display: grid;
  place-items: center;
  min-height: 2.35rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel-soft);
  font-weight: 700;
  font-size: .88rem;
}
.feedback-kind input:checked + span {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
  background: var(--accent-soft);
  color: var(--accent-ink);
}
.feedback-kind input:focus-visible + span {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.feedback-form label {
  margin: 0 0 .3rem;
  font-size: .82rem;
}
.feedback-form textarea,
.feedback-form input[type="text"] {
  margin-bottom: .75rem;
}
.feedback-form textarea { min-height: 6.5rem; resize: vertical; }
.feedback-status {
  margin: 0 0 .7rem;
  padding: .55rem .7rem;
  border-radius: 8px;
  font-size: .82rem;
  font-weight: 650;
}
.feedback-status.is-ok { background: #e5f7e9; color: #216b32; }
.feedback-status.is-err { background: #ffe8e8; color: #8a2020; }
html[data-theme="dark"] .feedback-status.is-ok { background: color-mix(in srgb, var(--green) 18%, var(--panel)); color: var(--green); }
html[data-theme="dark"] .feedback-status.is-err { background: color-mix(in srgb, var(--red) 18%, var(--panel)); color: var(--red); }
.feedback-actions { display: flex; justify-content: flex-end; }
.feedback-actions button[type="submit"] {
  min-width: 6.5rem;
  background: var(--accent) !important;
  color: var(--accent-ink) !important;
  border-radius: 10px;
  font-weight: 750;
}
@media (max-width: 640px) {
  .feedback-float,
  .feedback-restore {
    right: .75rem;
    bottom: .75rem;
  }
  .feedback-fab {
    padding: .65rem .7rem;
    border-radius: 16px;
  }
  .feedback-fab-copy small { display: none; }
}

