/* Kaal Design System — classic, compact card workspace.
   Facebook-style blue primary on neutral surfaces, WhatsApp-style green for success.
   Restrained accent color, small cards, crisp 1px borders, no gradients. */

:root {
  --bg: #18191a;
  --bg2: #1f2021;
  --bg3: #242526;
  --panel: #242526;
  --fg: #e4e6eb;
  --fg2: #ced0d4;
  --mut: #b0b3b8;
  --line: #3e4042;
  --line2: #4e5155;
  --brand: #2d88ff;
  --brand-dark: #1877f2;
  --brand-ink: #ffffff;
  --brand-bg: rgba(45, 136, 255, 0.14);
  --accent: #2d88ff;
  --ok: #31a24c;
  --ok-bg: rgba(49, 162, 76, 0.14);
  --ok-line: rgba(49, 162, 76, 0.36);
  --bad: #f02849;
  --bad-bg: rgba(240, 40, 73, 0.14);
  --bad-line: rgba(240, 40, 73, 0.36);
  --warn: #f7b928;
  --warn-bg: rgba(247, 185, 40, 0.14);
  --warn-line: rgba(247, 185, 40, 0.36);
  --amber: #f7b928;
  --c-indigo: #2d88ff;
  --c-indigo-bg: rgba(45, 136, 255, 0.14);
  --c-teal: #25d366;
  --c-teal-bg: rgba(37, 211, 102, 0.12);
  --c-orange: #f7b928;
  --c-orange-bg: rgba(247, 185, 40, 0.14);
  --c-violet: #8ab4f8;
  --c-violet-bg: rgba(138, 180, 248, 0.14);
  --c-blue: #2d88ff;
  --c-blue-bg: rgba(45, 136, 255, 0.14);
  --c-rose: #f02849;
  --c-rose-bg: rgba(240, 40, 73, 0.14);
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.25);
  --shadow-lift: 0 6px 18px -8px rgba(0, 0, 0, 0.5);
  --font-display: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --page-max: 1840px;
  --gutter: clamp(18px, 2.4vw, 48px);
  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 12px;
}

/* Light mode — default for students, toggled via data-theme="light" on <html> */
:root[data-theme="light"] {
  --bg: #f0f2f5;
  --bg2: #f7f8fa;
  --bg3: #e4e6eb;
  --panel: #ffffff;
  --fg: #1c1e21;
  --fg2: #3c4043;
  --mut: #65676b;
  --line: #e4e6eb;
  --line2: #ccd0d5;
  --brand: #1877f2;
  --brand-dark: #166fe5;
  --brand-bg: #e7f0fe;
  --accent: #1877f2;
  --brand-ink: #ffffff;
  --ok: #1b8755;
  --ok-bg: #e7f7ef;
  --ok-line: #b7e4c9;
  --bad: #fa383e;
  --bad-bg: #fdecec;
  --bad-line: #f5c2c4;
  --warn: #b76e00;
  --warn-bg: #fff6e5;
  --warn-line: #ffe0a3;
  --amber: #f7b928;
  --c-indigo: #1877f2;
  --c-indigo-bg: #e7f0fe;
  --c-teal: #128c7e;
  --c-teal-bg: #e6f4f1;
  --c-orange: #b76e00;
  --c-orange-bg: #fff6e5;
  --c-violet: #5b6b7f;
  --c-violet-bg: #eef1f4;
  --c-blue: #1877f2;
  --c-blue-bg: #e7f0fe;
  --c-rose: #fa383e;
  --c-rose-bg: #fdecec;
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-lift: 0 8px 20px -12px rgba(0, 0, 0, 0.22);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

html {
  color-scheme: light;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  background: var(--bg);
  color: var(--fg);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--brand);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  line-height: 1.25;
  color: var(--fg);
  font-weight: 650;
}

button {
  font: inherit;
}

/* Focus states for accessibility */
:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
}

/* ---------- Lucide SVG Icons ---------- */
.icon {
  display: inline-block;
  vertical-align: -0.16em;
  stroke: currentColor;
  flex-shrink: 0;
  line-height: 1;
}

.icon-filled {
  fill: currentColor;
}

.btn .icon {
  vertical-align: -0.14em;
}

/* ---------- Topbar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 0 var(--gutter);
  height: 58px;
  display: flex;
  align-items: center;
  gap: 26px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--fg);
  text-decoration: none;
  flex-shrink: 0;
}

.brand:hover {
  text-decoration: none;
}

.brand img {
  width: 27px;
  height: 27px;
  display: block;
}

.brand b {
  font-family: var(--font-display);
  font-size: 19px;
  letter-spacing: .2px;
  font-weight: 600;
  text-transform: uppercase;
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.nav::-webkit-scrollbar {
  display: none;
}

.nav a {
  color: var(--mut);
  font-size: 13.5px;
  font-weight: 500;
  padding: 6px 12px;
  display: flex;
  align-items: center;
  gap: 7px;
  border-radius: var(--radius);
  white-space: nowrap;
  transition: color .12s ease, background-color .12s ease;
}

.nav a:hover {
  color: var(--fg);
  text-decoration: none;
  background: var(--bg3);
}

.nav a.active {
  color: var(--brand);
  background: var(--brand-bg);
  font-weight: 600;
}

.nav a .icon {
  flex-shrink: 0;
}

.topbar .spacer {
  flex: 1;
}

.userbox {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--mut);
  flex-shrink: 0;
}

.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg3);
  border: 1px solid var(--line2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--fg2);
  user-select: none;
}

.userbox .who {
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--fg2);
  font-weight: 500;
}

.linkbtn {
  background: none;
  border: 0;
  color: var(--mut);
  cursor: pointer;
  font-size: 13px;
  padding: 4px 6px;
  border-radius: 4px;
  transition: color .12s, background-color .12s;
}

.linkbtn:hover {
  color: var(--fg);
  background: var(--bg3);
}

.badge-admin {
  background: var(--warn-bg);
  border: 1px solid var(--warn-line);
  color: var(--warn);
  font-size: 11.5px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
}

.badge-admin:hover {
  text-decoration: none;
  background: rgba(210, 153, 34, 0.2);
}

/* ---------- Layout & Pagehead ---------- */
.wrap {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 30px var(--gutter) 72px;
}

.pagehead {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px;
}

.pagehead h1 {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 600;
  letter-spacing: 0;
}

.pagehead .sub {
  color: var(--mut);
  font-size: 14px;
  margin-top: 4px;
}

.section {
  margin-top: 32px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 12px;
}

.section-head h2 {
  font-size: 16px;
  letter-spacing: -0.2px;
  font-weight: 650;
}

.section-head .count {
  color: var(--mut);
  font-size: 13px;
  font-weight: 500;
}

.section-head a.view-all {
  font-size: 13px;
  font-weight: 600;
  color: var(--brand);
}

/* ---------- Filter Bar & Search ---------- */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.search-wrap {
  flex: 1 1 240px;
  position: relative;
  min-width: 200px;
}

.search-wrap input {
  width: 100%;
  padding: 8px 12px 8px 32px;
  border: 1px solid var(--line2);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  background: var(--bg);
}

.search-wrap .search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--mut);
  pointer-events: none;
  font-size: 13px;
}

.filter-select {
  padding: 8px 12px;
  border: 1px solid var(--line2);
  border-radius: var(--radius-sm);
  background: var(--bg);
  font-size: 13.5px;
  color: var(--fg2);
  cursor: pointer;
  min-width: 140px;
}

.btn-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border: 1px solid var(--line2);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--fg2);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.btn-toggle.active {
  background: var(--brand-bg);
  border-color: var(--brand);
  color: var(--brand);
  font-weight: 600;
}

/* ---------- Tab Switcher ---------- */
.tab-bar {
  display: flex;
  gap: 6px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 20px;
}

.tab-btn {
  padding: 8px 14px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--mut);
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  margin-bottom: -1px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tab-btn:hover {
  color: var(--fg);
}

.tab-btn.active {
  color: var(--fg);
  border-bottom-color: var(--brand);
  font-weight: 600;
}

.tab-count {
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--bg3);
  color: var(--mut);
  font-weight: 600;
}

.tab-btn.active .tab-count {
  background: var(--brand-bg);
  color: var(--brand);
}

/* ---------- Stats Grid ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.stat {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  background: var(--bg);
  transition: border-color .12s;
}

.stat:hover {
  border-color: var(--line2);
}

.stat .k {
  font-size: 11.5px;
  color: var(--mut);
  text-transform: uppercase;
  letter-spacing: .5px;
  font-weight: 650;
}

.stat .v {
  font-size: 24px;
  font-weight: 700;
  margin-top: 4px;
  letter-spacing: -0.4px;
  font-variant-numeric: tabular-nums;
}

.stat .v small {
  font-size: 13px;
  color: var(--mut);
  font-weight: 500;
  letter-spacing: 0;
}

/* ---------- Cards & Grids ---------- */
.grid3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
}

.card.pad {
  padding: 18px 20px;
}

.card.link {
  cursor: pointer;
  transition: border-color .12s ease;
}

.card.link:hover {
  border-color: var(--line2);
}

.course-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  transition: border-color .12s ease;
}

.course-card:hover {
  border-color: var(--line2);
}

.course-card .ct {
  font-size: 15.5px;
  font-weight: 650;
  letter-spacing: -0.2px;
  color: var(--fg);
}

.course-card .cd {
  font-size: 13px;
  color: var(--mut);
  line-height: 1.5;
  min-height: 38px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--mut);
}

.progress {
  height: 6px;
  background: var(--bg3);
  border-radius: 999px;
  overflow: hidden;
}

.progress>i {
  display: block;
  height: 100%;
  background: var(--brand);
  border-radius: 999px;
  transition: width .3s ease;
}

.progress-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--mut);
  font-variant-numeric: tabular-nums;
}

.progress-row .progress {
  flex: 1;
}


/* ---------- Material Bookmark ---------- */
.bookmark-btn {
  background: none;
  border: 0;
  font-size: 17px;
  cursor: pointer;
  color: var(--line2);
  padding: 4px;
  line-height: 1;
  transition: color .12s;
}

.bookmark-btn.active,
.bookmark-btn:hover {
  color: var(--amber);
}

/* ---------- Practice Hub ---------- */
.eyebrow {
  color: var(--brand);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.practice-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}

.practice-stat {
  min-width: 0;
  display: flex;
  gap: 11px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
}

.practice-stat-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  flex: 0 0 30px;
  border-radius: 6px;
  color: var(--brand);
  background: var(--brand-bg);
}

.practice-stat-label,
.practice-stat-detail {
  color: var(--mut);
  font-size: 11.5px;
}

.practice-stat-label {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.practice-stat-value {
  margin-top: 1px;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}

.practice-toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}

.practice-toolbar .search-wrap {
  flex: 1;
}

.practice-filter-group {
  display: flex;
  gap: 5px;
}

.practice-filter-group .btn-toggle {
  padding: 7px 10px;
}

.practice-layout {
  display: grid;
  grid-template-columns: minmax(235px, .68fr) minmax(0, 1.8fr);
  gap: 14px;
  align-items: start;
}

.track-panel,
.problem-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  overflow: hidden;
}

.panel-heading {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--mut);
}

.panel-heading .count {
  min-width: 22px;
  padding: 1px 7px;
  border-radius: 99px;
  background: var(--bg3);
  color: var(--fg2);
  font-size: 11px;
  text-align: center;
}

.track-list {
  padding: 7px;
}

.track-card {
  appearance: none;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--fg);
  cursor: pointer;
  text-align: left;
}

.track-card:hover {
  background: var(--bg2);
}

.track-card.active {
  border-color: rgba(232, 134, 60, .4);
  background: var(--brand-bg);
}

.track-icon {
  color: var(--brand);
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  flex: 0 0 28px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--bg);
}

.track-body {
  min-width: 0;
  flex: 1;
}

.track-title {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 650;
}

.track-meta {
  display: block;
  margin: 2px 0 6px;
  color: var(--mut);
  font-size: 11.5px;
}

.track-progress {
  display: block;
  height: 3px;
  overflow: hidden;
  border-radius: 99px;
  background: var(--bg3);
}

.track-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--brand);
}

.track-arrow {
  color: var(--mut);
}

.problem-heading {
  min-height: 110px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.problem-heading h2 {
  margin-top: 2px;
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 600;
}

.problem-heading p {
  margin: 4px 0 0;
  color: var(--mut);
  font-size: 12.5px;
}

.track-completion {
  min-width: 142px;
  color: var(--mut);
  font-size: 11.5px;
  font-weight: 600;
  text-align: right;
}

.track-completion .progress {
  margin-bottom: 5px;
  height: 6px;
}

.problem-list {
  padding: 0 12px 12px;
}

.list-caption {
  padding: 12px 4px 8px;
  color: var(--mut);
  font-size: 12px;
  font-weight: 600;
}

.problem-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  min-height: 66px;
  padding: 10px 8px;
  border-top: 1px solid var(--line);
  cursor: pointer;
  transition: background-color .12s;
}

.problem-row:hover {
  background: var(--bg2);
}

.problem-number {
  color: var(--mut);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.problem-main {
  min-width: 0;
}

.problem-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--fg);
  font-size: 13.5px;
  font-weight: 650;
}

.problem-meta {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 5px;
  color: var(--mut);
  font-size: 11.5px;
}

.problem-meta>span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.problem-state {
  font-weight: 600;
}

.problem-state.solved {
  color: var(--ok);
}

.problem-state.started {
  color: var(--warn);
}

.problem-state.todo {
  color: var(--mut);
}

.result-release-note {
  display: flex;
  align-items: center;
  gap: 18px;
  max-width: 760px;
  margin: 0 0 28px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--brand);
  border-radius: var(--radius);
  background: var(--bg2);
}

.result-release-note img {
  width: 92px;
  height: 68px;
  object-fit: cover;
  object-position: center;
  border-radius: 5px;
}

.result-release-note b {
  font-size: 14px;
  color: var(--fg);
}

.result-release-note p {
  margin: 3px 0 0;
  color: var(--mut);
  font-size: 12.5px;
  line-height: 1.45;
}

/* ---------- Exams ---------- */
.datebox {
  width: 52px;
  flex: 0 0 52px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 6px 0;
  background: var(--bg2);
}

.datebox .m {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--bad);
  font-weight: 700;
}

.datebox .d {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.tbl tr.past td {
  opacity: .65;
}

.state-locked {
  color: var(--mut);
  font-size: 12.5px;
  font-weight: 600;
}

.state-closed {
  color: var(--bad);
  font-size: 12.5px;
  font-weight: 600;
}

.state-done {
  color: var(--ok);
  font-size: 12.5px;
  font-weight: 600;
}

/* ---------- Tags & Chips ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--bg3);
  color: var(--fg2);
  line-height: 1.4;
  white-space: nowrap;
}

.tag.easy,
.tag.ok {
  background: var(--ok-bg);
  color: var(--ok);
  border: 1px solid var(--ok-line);
}

.tag.medium,
.tag.warn {
  background: var(--warn-bg);
  color: var(--warn);
  border: 1px solid var(--warn-line);
}

.tag.hard,
.tag.bad {
  background: var(--bad-bg);
  color: var(--bad);
  border: 1px solid var(--bad-line);
}

.tag.blue {
  background: var(--brand-bg);
  color: var(--brand);
  border: 1px solid rgba(232, 134, 60, 0.32);
}

.tag.line {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--mut);
  font-weight: 500;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: 6px;
  border: 1px solid var(--line2);
  background: var(--bg);
  color: var(--fg);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color .1s, border-color .1s;
}

.btn:hover {
  background: var(--bg2);
  text-decoration: none;
  border-color: #94a3b8;
}

.btn.primary {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--brand-ink);
}

.btn.primary:hover {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
  color: var(--brand-ink);
}

.btn.ghost {
  border-color: var(--line);
  color: var(--fg2);
  background: transparent;
}

.btn.ghost:hover {
  background: var(--bg2);
  border-color: var(--line2);
}

.btn.sm {
  padding: 5px 10px;
  font-size: 12.5px;
  border-radius: 5px;
}

.btn:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.btn-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

/* ---------- Tables ---------- */
.tbl-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
}

.tbl {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.tbl th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--mut);
  font-weight: 650;
  padding: 10px 14px;
  background: var(--bg2);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.tbl td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  vertical-align: middle;
}

.tbl tr:last-child td {
  border-bottom: 0;
}

.tbl tr:hover td {
  background: var(--bg2);
}

.tbl .num {
  font-variant-numeric: tabular-nums;
}

.tbl .right {
  text-align: right;
}

/* ---------- Forms ---------- */
.field {
  margin-bottom: 14px;
}

.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 5px;
  color: var(--fg2);
}

.field .hint {
  font-size: 12px;
  color: var(--mut);
  margin-top: 4px;
}

input,
select,
textarea {
  width: 100%;
  font: inherit;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--line2);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 13.5px;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(232, 134, 60, 0.35);
  border-color: var(--brand);
}

textarea {
  resize: vertical;
}

/* ---------- Auth Gate ---------- */
.auth {
  max-width: 400px;
  margin: 9vh auto;
  padding: 0 20px;
}

.auth .card {
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.auth h1 {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: 0;
}

.auth .sub {
  color: var(--mut);
  margin: 6px 0 22px;
  font-size: 13.5px;
}

.auth .btn {
  width: 100%;
  padding: 10px;
  margin-top: 8px;
}

/* ---------- Course Shell (Reader) ---------- */
.course-shell {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
}

.sidebar {
  border-right: 1px solid var(--line);
  background: var(--bg2);
  height: calc(100vh - 56px);
  position: sticky;
  top: 56px;
  overflow-y: auto;
}

.side-head {
  padding: 16px 18px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}

.side-head .back {
  font-size: 12.5px;
  color: var(--mut);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.side-head .back:hover {
  color: var(--brand);
  text-decoration: none;
}

.side-head h2 {
  font-size: 16px;
  margin-top: 8px;
  letter-spacing: -0.2px;
}

.side-progress {
  margin-top: 12px;
}

.side-progress .row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--mut);
  margin-bottom: 6px;
}

.side-body {
  padding: 10px 10px 24px;
}

.sect {
  margin-top: 14px;
}

.sect-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .7px;
  color: var(--mut);
  font-weight: 700;
  padding: 0 10px 6px;
}

.topic-link {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 13.5px;
  color: var(--fg2);
  cursor: pointer;
  border: 1px solid transparent;
  transition: background .1s;
}

.topic-link:hover {
  background: var(--bg3);
}

.topic-link.active {
  background: var(--brand-bg);
  color: var(--brand);
  border-color: rgba(232, 134, 60, 0.35);
  font-weight: 600;
}

.topic-link .ico {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  border-radius: 50%;
  border: 1.5px solid var(--line2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: transparent;
}

.topic-link.done .ico {
  background: var(--ok);
  border-color: var(--ok);
  color: #fff;
}

.topic-link .ql {
  margin-left: auto;
  font-size: 11px;
  color: var(--mut);
}

/* ---------- Course Content (Reading measure) ---------- */
.content {
  padding: 30px var(--gutter) 80px;
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
}

.crumbs {
  font-size: 12.5px;
  color: var(--mut);
  margin-bottom: 12px;
}

.crumbs a {
  color: var(--mut);
}

.crumbs a:hover {
  color: var(--brand);
}

.topic-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.topic-head h1 {
  font-family: var(--font-display);
  font-size: 29px;
  font-weight: 600;
  letter-spacing: 0;
}

.topic-head .tags {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  margin: 22px 0 20px;
}

.tab {
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--mut);
  cursor: pointer;
  border: 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  background: none;
}

.tab:hover {
  color: var(--fg);
}

.tab.active {
  color: var(--fg);
  border-bottom-color: var(--brand);
  font-weight: 600;
}

.tab .c {
  color: var(--mut);
  font-size: 12px;
  margin-left: 4px;
}

/* ---------- Markdown & Rich Content ---------- */
.md {
  font-size: 15px;
  line-height: 1.72;
  color: var(--fg2);
  max-width: 72ch;
}

.md h1 {
  font-size: 22px;
  color: var(--fg);
  margin: 0 0 14px;
  letter-spacing: -0.3px;
}

.md h2 {
  font-size: 18px;
  color: var(--fg);
  margin: 26px 0 10px;
  letter-spacing: -0.2px;
}

.md h3 {
  font-size: 15.5px;
  color: var(--fg);
  margin: 20px 0 8px;
}

.md p {
  margin: 0 0 14px;
}

.md ul,
.md ol {
  margin: 0 0 16px;
  padding-left: 24px;
}

.md li {
  margin: 5px 0;
}

.md code {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 13px;
  background: var(--bg3);
  border-radius: 4px;
  padding: 2px 5px;
  color: var(--bad);
}

.md pre {
  background: #010409;
  color: #e2e8f0;
  border-radius: 8px;
  padding: 16px 18px;
  overflow: auto;
  margin: 0 0 18px;
  border: 1px solid var(--line);
}

.md pre code {
  background: none;
  color: inherit;
  padding: 0;
  font-size: 13px;
  line-height: 1.6;
}

.md hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 26px 0;
}

.md blockquote {
  margin: 0 0 16px;
  padding: 8px 16px;
  border-left: 3px solid var(--line2);
  color: var(--mut);
  background: var(--bg2);
}

.md strong {
  color: var(--fg);
}

/* Rich readings (WYSIWYG) */
.md-rich img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 14px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.md-rich iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  border: 0;
  border-radius: 8px;
  margin: 14px 0;
  background: #000;
}

.md-rich video {
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 14px 0;
  background: #000;
}

.md-rich figure {
  margin: 16px 0;
}

.md-rich figcaption {
  font-size: 12px;
  color: var(--mut);
  margin-top: 6px;
}

.md-rich table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0;
  font-size: 13.5px;
}

.md-rich th,
.md-rich td {
  border: 1px solid var(--line);
  padding: 8px 12px;
  text-align: left;
  vertical-align: top;
}

.md-rich th {
  background: var(--bg2);
  color: var(--fg);
  font-weight: 600;
}

/* ---------- Quiz Styles ---------- */
.question {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 14px;
  background: var(--bg);
}

.question .qp {
  font-size: 15px;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 12px;
  line-height: 1.5;
}

.question .qn {
  color: var(--mut);
  font-weight: 600;
  margin-right: 6px;
}

.opts {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.opt {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
  font-size: 13.5px;
  color: var(--fg2);
  background: var(--bg);
  transition: background .1s, border-color .1s;
}

.opt:hover {
  background: var(--bg2);
  border-color: var(--line2);
}

.opt input {
  width: auto;
  margin: 3px 0 0;
  accent-color: var(--brand);
}

.opt.sel {
  border-color: var(--brand);
  background: var(--brand-bg);
}

.opt.correct {
  border-color: var(--ok);
  background: var(--ok-bg);
  color: var(--ok);
}

.opt.wrong {
  border-color: var(--bad);
  background: var(--bad-bg);
  color: var(--bad);
}

.opt.disabled {
  cursor: default;
}

.explain {
  margin-top: 10px;
  font-size: 13px;
  color: var(--fg2);
  background: var(--bg2);
  border-left: 3px solid var(--line2);
  padding: 8px 12px;
  border-radius: 0 6px 6px 0;
}

.explain.ok {
  border-left-color: var(--ok);
  background: var(--ok-bg);
}

.explain.bad {
  border-left-color: var(--bad);
  background: var(--bad-bg);
}

.banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 18px;
  border-radius: var(--radius);
  margin-bottom: 18px;
  border: 1px solid var(--line);
  background: var(--bg2);
  flex-wrap: wrap;
}

.banner.ok {
  background: var(--ok-bg);
  border-color: var(--ok-line);
  color: var(--ok);
}

.banner.bad {
  background: var(--bad-bg);
  border-color: var(--bad-line);
  color: var(--bad);
}

.banner .score {
  font-size: 22px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.quiz-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  flex-wrap: wrap;
}

/* ---------- Coding Practice Workbench (LeetCode-Style) ---------- */
.course-shell.focus {
  grid-template-columns: minmax(0, 1fr);
  height: calc(100vh - 56px);
}

.course-shell.focus .sidebar {
  display: none;
}

.course-shell.focus .content {
  max-width: none;
  height: 100%;
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.course-shell.focus .crumbs,
.course-shell.focus .topic-head {
  display: none;
}

.course-shell.focus .tabs {
  flex: 0 0 auto;
  margin: 0;
  padding-top: 4px;
}

.course-shell.focus #practicePane {
  flex: 1 1 auto;
  min-height: 0;
  padding: 10px 0 14px;
}

.course-shell.focus #practicePane.hidden {
  display: none !important;
}

/* CodeMirror — Kaal warm editor theme */
.CodeMirror {
  font-family: "Cascadia Code", ui-monospace, 'JetBrains Mono', 'Fira Code', Menlo, Consolas, monospace !important;
  font-size: 13.5px !important;
  line-height: 1.65 !important;
  height: 100% !important;
  direction: ltr;
}

.cm-s-kaal.CodeMirror {
  background-color: #14110d !important;
  color: #e9e2d8 !important;
}

.cm-s-kaal .CodeMirror-gutters {
  background-color: #14110d !important;
  border-right: 1px solid #241d16 !important;
  padding-right: 2px;
}

.cm-s-kaal .CodeMirror-linenumber {
  color: #6d6255 !important;
  padding: 0 8px 0 12px !important;
  font-size: 12px !important;
}

.cm-s-kaal .CodeMirror-activeline-background {
  background: rgba(255, 236, 214, 0.035) !important;
}

.cm-s-kaal .CodeMirror-cursor {
  border-left: 2px solid #f0914a !important;
}

.cm-s-kaal .CodeMirror-selected,
.cm-s-kaal.CodeMirror-focused .CodeMirror-selected {
  background: rgba(232, 134, 60, 0.26) !important;
}

.cm-s-kaal .CodeMirror-matchingbracket {
  background-color: rgba(232, 134, 60, 0.16) !important;
  border-bottom: 1px solid #e8863c !important;
  color: #fff4e8 !important;
}

/* Syntax tokens — warm, low-glare, high legibility */
.cm-s-kaal .cm-keyword {
  color: #e58e6a !important;
  font-weight: 600;
}

.cm-s-kaal .cm-def {
  color: #e3c78a !important;
  font-weight: 600;
}

.cm-s-kaal .cm-variable {
  color: #d9d2c7 !important;
}

.cm-s-kaal .cm-variable-2 {
  color: #d9d2c7 !important;
}

.cm-s-kaal .cm-variable-3,
.cm-s-kaal .cm-type {
  color: #8fc7b8 !important;
}

.cm-s-kaal .cm-builtin {
  color: #cbb896 !important;
}

.cm-s-kaal .cm-property {
  color: #cbb896 !important;
}

.cm-s-kaal .cm-operator {
  color: #b8aea2 !important;
}

.cm-s-kaal .cm-string {
  color: #a3c68f !important;
}

.cm-s-kaal .cm-string-2 {
  color: #a3c68f !important;
}

.cm-s-kaal .cm-number {
  color: #d8b45f !important;
}

.cm-s-kaal .cm-comment {
  color: #6f7a68 !important;
  font-style: italic;
}

.cm-s-kaal .cm-atom {
  color: #d2a15a !important;
}

.cm-s-kaal .cm-bracket {
  color: #e8c07a !important;
}

/* Fold Gutter */
.CodeMirror-foldgutter {
  width: 14px;
}

.CodeMirror-foldgutter-open,
.CodeMirror-foldgutter-folded {
  cursor: pointer;
  color: #71717a;
  transition: color 0.15s ease;
  line-height: 1;
}

.CodeMirror-foldgutter-open:hover,
.CodeMirror-foldgutter-folded:hover {
  color: #ffffff;
}

.CodeMirror-foldgutter-open:after {
  content: "▾";
  font-size: 13px;
}

.CodeMirror-foldgutter-folded:after {
  content: "▸";
  font-size: 13px;
}

.CodeMirror-foldmarker {
  color: #ffd700;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  padding: 0 4px;
  font-family: inherit;
  font-size: 11px;
  cursor: pointer;
}

/* Problem Statement Pane */
.wb-statement {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.wb-stmt-tabs {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 6px 12px 0;
  background: var(--bg2);
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
}

.wb-stmt-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 550;
  color: var(--mut);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.wb-stmt-tab:hover {
  color: var(--fg);
}

.wb-stmt-tab.active {
  color: var(--brand);
  border-bottom-color: var(--brand);
}

.wb-stmt-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 18px 20px 22px;
  scrollbar-gutter: stable;
}

/* Submissions History Tab in Statement */
.lc-subs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.lc-subs-table th {
  text-align: left;
  padding: 8px 10px;
  color: var(--mut);
  border-bottom: 1px solid var(--line);
  font-weight: 600;
  font-size: 11.5px;
}

.lc-subs-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  color: var(--fg);
}

/* LeetCode Editor & Console Area */
.wb-editor {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #14110d;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  position: relative;
}

.wb-editor.fullscreen {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  border-radius: 0;
  border: 0;
}

.wb-toolbar {
  flex: 0 0 42px;
  height: 42px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  border-bottom: 1px solid #2b231b;
  background: #1a1510;
}

.wb-toolbar .spacer {
  flex: 1 1 auto;
}

.wb-file-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-right: 4px;
  padding-right: 12px;
  border-right: 1px solid #2f261d;
  color: #d8cfc4;
  font: 600 12px/1 "Cascadia Code", ui-monospace, Consolas, monospace;
}

.wb-file-chip .icon {
  color: var(--brand);
}

.wb-stage-tag {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--mut);
  border: 1px solid #2f261d;
  border-radius: 999px;
  padding: 2px 7px;
}

.wb-lang-select {
  background: #14110d;
  color: #efe7dc;
  border: 1px solid #3a2f24;
  border-radius: 5px;
  padding: 4px 8px;
  width: auto;
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  outline: none;
}

.wb-lang-select:focus {
  border-color: var(--brand);
}

.wb-btn-icon {
  background: none;
  border: none;
  color: #8a7d6e;
  cursor: pointer;
  padding: 5px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.wb-btn-icon:hover {
  color: #fff4e8;
  background: rgba(232, 134, 60, 0.12);
}

.wb-editor-body {
  flex: 1 1 auto;
  min-height: 120px;
  position: relative;
  overflow: hidden;
}

#wbEditorWrap {
  width: 100%;
  height: 100%;
}

.wb-statusbar {
  flex: 0 0 27px;
  height: 27px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 12px;
  background: #100d0a;
  border-top: 1px solid #241d16;
  color: #8a7d6e;
  font: 11.5px/1 "Cascadia Code", ui-monospace, Consolas, monospace;
  white-space: nowrap;
  overflow: hidden;
}

.wb-statusbar .spacer {
  flex: 1 1 auto;
}

.wb-statusbar b {
  color: #cabfb1;
  font-weight: 600;
}

.wb-statusbar .ok {
  color: var(--ok);
}

/* LeetCode Console Drawer (Docked / Collapsible) */
.wb-console-panel {
  flex: 0 0 var(--console-h);
  height: var(--console-h);
  display: flex;
  flex-direction: column;
  background: #14110d;
  border-top: 1px solid #2b231b;
  min-height: 38px;
}

.wb-console-panel.collapsed {
  flex-basis: 44px;
  height: 44px;
  max-height: 44px;
}

.wb-console-panel.collapsed .wb-console-header {
  display: none;
}

.wb-console-panel.collapsed .wb-bottom-bar {
  flex: 0 0 44px;
  height: 44px;
}

.wb-console-panel.collapsed .wb-console-content {
  display: none !important;
}

/* Console Header Tabs */
.wb-console-header {
  height: 38px;
  flex: 0 0 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  background: #1a1510;
  border-bottom: 1px solid #2b231b;
}

.wb-console-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
}

.wb-con-tab {
  background: none;
  border: none;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 550;
  color: #8a7d6e;
  cursor: pointer;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.wb-con-tab:hover {
  color: #f1e8dc;
  background: rgba(232, 134, 60, 0.08);
}

.wb-con-tab.active {
  color: #fff4e8;
  background: rgba(232, 134, 60, 0.16);
}

.wb-con-toggle {
  background: none;
  border: none;
  color: #8a7d6e;
  cursor: pointer;
  font-size: 11.5px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 6px;
  border-radius: 4px;
}

.wb-con-toggle:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
}

/* Console Content */
.wb-console-content {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 12px 14px;
  min-height: 0;
}

.wb-tc-pills {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.wb-tc-pill {
  background: #221c16;
  border: 1px solid #3a2f24;
  color: #a99c8c;
  padding: 4px 10px;
  border-radius: 5px;
  font-size: 11.5px;
  font-weight: 550;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.wb-tc-pill:hover {
  color: #fff4e8;
  border-color: #5a4938;
}

.wb-tc-pill.active {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--brand-ink);
}

.wb-tc-pill.pass {
  color: #22c55e;
}

.wb-tc-pill.pass.active {
  background: #15803d;
  border-color: #22c55e;
  color: #fff;
}

.wb-tc-pill.fail {
  color: #ef4444;
}

.wb-tc-pill.fail.active {
  background: #b91c1c;
  border-color: #ef4444;
  color: #fff;
}

.wb-tc-field {
  margin-bottom: 10px;
}

.wb-tc-field:last-child {
  margin-bottom: 0;
}

.wb-tc-field-lbl {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: #71717a;
  margin-bottom: 4px;
}

.wb-tc-field-box {
  background: #100d0a;
  border: 1px solid #2b231b;
  border-radius: 5px;
  padding: 6px 10px;
  font-family: "Cascadia Code", ui-monospace, 'JetBrains Mono', Consolas, monospace;
  font-size: 12px;
  color: #e9e2d8;
  white-space: pre-wrap;
  word-break: break-all;
}

/* Result Status Banner */
.wb-res-status {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.wb-res-title {
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}

.wb-res-title.accepted {
  color: var(--ok);
}

.wb-res-title.wrong {
  color: var(--bad);
}

.wb-res-title.error {
  color: var(--brand);
}

.wb-res-meta {
  font-size: 12px;
  color: #8a7d6e;
}

/* Bottom Action Bar */
.wb-bottom-bar {
  flex: 0 0 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 12px;
  overflow-x: auto;
  scrollbar-width: none;
  background: #1a1510;
  border-top: 1px solid #2b231b;
}

.wb-bottom-bar::-webkit-scrollbar {
  display: none;
}

.wb-bottom-bar>div {
  flex: 0 0 auto;
}

.wb-run-btn {
  background: #2a2219;
  color: #f1e8dc;
  border: 1px solid #453729;
  border-radius: 5px;
  padding: 5px 12px;
  font-size: 12.5px;
  font-weight: 550;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.wb-run-btn:hover:not(:disabled) {
  background: #382c20;
  color: #fff4e8;
}

.wb-submit-btn {
  background: var(--brand);
  color: var(--brand-ink);
  border: 1px solid var(--brand);
  border-radius: 5px;
  padding: 5px 16px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.wb-submit-btn:hover:not(:disabled) {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
}

.wb-run-btn:disabled,
.wb-submit-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.wc-running {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  color: #a3a3a3;
  padding: 8px 4px;
}

.wc-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #ef4444;
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 12.5px;
}

/* ---------- Exam Shell (/exam/enter) ---------- */
.exam-shell {
  background: var(--bg);
  min-height: 100vh;
}

.exam-wrap {
  max-width: 1720px;
  margin: 0 auto;
  padding: 26px var(--gutter) 60px;
}

.exam-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.exam-head h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 23px;
  font-weight: 600;
}

.exam-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--mut);
}

.exam-status .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
}

.timer {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: .5px;
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg2);
}

.timer.warn {
  color: var(--warn);
  border-color: var(--warn);
}

.timer.crit {
  color: var(--bad);
  border-color: var(--bad);
}

.exam-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 18px;
  align-items: start;
}

.q-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--bg);
  padding: 22px;
}

.q-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--mut);
  font-size: 12px;
  margin-bottom: 12px;
}

.q-prompt {
  font-size: 15.5px;
  line-height: 1.6;
  margin-bottom: 18px;
  white-space: pre-wrap;
  color: var(--fg);
}

.q-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.q-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 11px 12px;
  cursor: pointer;
  background: var(--bg2);
}

.q-option:hover {
  border-color: var(--line2);
}

.q-option.sel {
  border-color: var(--brand);
  background: var(--brand-bg);
}

.q-option input {
  margin-top: 2px;
}

.q-text {
  width: 100%;
  min-height: 160px;
  resize: vertical;
}

.q-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.palette {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--bg);
  padding: 16px;
  position: sticky;
  top: 16px;
}

.palette h3 {
  margin: 0 0 10px;
  font-size: 12px;
  color: var(--mut);
  text-transform: uppercase;
  letter-spacing: .06em;
}

.pal-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}

.pal-btn {
  border: 1px solid var(--line);
  background: var(--bg2);
  border-radius: 6px;
  padding: 7px 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--fg);
  cursor: pointer;
}

.pal-btn.answered {
  background: var(--ok-bg);
  border-color: var(--ok);
  color: var(--ok);
}

.pal-btn.marked {
  background: var(--warn-bg);
  border-color: var(--warn);
  color: var(--warn);
}

.pal-btn.current {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
}

.pal-legend {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 14px;
  font-size: 11.5px;
  color: var(--mut);
}

.pal-legend span {
  display: flex;
  align-items: center;
  gap: 7px;
}

.sw {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  border: 1px solid var(--line);
  display: inline-block;
}

.sw.a {
  background: var(--ok-bg);
  border-color: var(--ok);
}

.sw.m {
  background: var(--warn-bg);
  border-color: var(--warn);
}

.integ {
  font-size: 11px;
  color: var(--mut);
  text-align: center;
  margin-top: 14px;
  line-height: 1.5;
}

.finish-card {
  max-width: 540px;
  margin: 10vh auto 0;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--bg);
  padding: 36px 28px;
}

.finish-card h1 {
  margin: 0 0 8px;
  font-size: 22px;
}

.finish-card .big {
  font-size: 40px;
  font-weight: 700;
  margin: 14px 0 4px;
  font-variant-numeric: tabular-nums;
}

/* ---------- Modals ---------- */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 6vh 1rem;
  z-index: 60;
  overflow: auto;
}

.modal.hidden {
  display: none !important;
}

.modal-card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 560px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
}

.modal-card.wide {
  max-width: 720px;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--line);
}

.modal-head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 650;
}

.modal-head .x {
  background: none;
  color: var(--mut);
  font-size: 1.25rem;
  border: 0;
  padding: 0 .4rem;
  cursor: pointer;
  border-radius: 4px;
  line-height: 1;
}

.modal-head .x:hover {
  color: var(--fg);
  background: var(--bg3);
}

.modal-body {
  padding: 1.25rem;
  max-height: calc(100vh - 210px);
  overflow-y: auto;
}

.modal-body label {
  display: block;
  color: var(--fg2);
  font-size: 12.5px;
  font-weight: 600;
  margin: .8rem 0 .3rem;
}

.modal-body label:first-child {
  margin-top: 0;
}

.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: .6rem;
  padding: .85rem 1.25rem;
  border-top: 1px solid var(--line);
  background: var(--bg2);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.checklist {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: .5rem 0;
}

.checklist label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0;
  color: var(--fg);
  font-size: 13.5px;
  font-weight: 450;
  cursor: pointer;
}

.checklist input {
  width: auto;
  margin-top: 3px;
  accent-color: var(--brand);
}

.rules-box {
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--fg2);
  white-space: pre-wrap;
}

/* ---------- Common Utility & Empty States ---------- */
.empty {
  text-align: center;
  color: var(--mut);
  padding: 44px 20px;
  font-size: 13.5px;
  border: 1px dashed var(--line2);
  border-radius: var(--radius);
  background: var(--bg2);
}

.empty b {
  color: var(--fg);
}

.empty .empty-title {
  font-size: 15px;
  font-weight: 650;
  color: var(--fg);
  margin-bottom: 6px;
}

.empty .empty-sub {
  font-size: 13px;
  color: var(--mut);
  margin-bottom: 14px;
  max-width: 440px;
  margin-left: auto;
  margin-right: auto;
}

/* Infinite-list sentinel: last cell below a table or grid, swapped for a spinner while paging. */
.list-sentinel {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 18px 12px;
  color: var(--mut);
  font-size: 12.5px;
  grid-column: 1 / -1;
  min-height: 20px;
}

.list-sentinel.ended {
  padding: 12px;
  font-size: 12px;
  color: var(--mut);
  opacity: .8;
}

.list-sentinel .retry {
  color: var(--brand);
  cursor: pointer;
  text-decoration: underline;
  background: 0;
  border: 0;
  font: inherit;
  padding: 0;
}

.sentinel-btn {
  background: 0;
  border: 1px solid var(--line2);
  border-radius: var(--radius-sm);
  color: var(--fg2);
  padding: 8px 16px;
  font: inherit;
  cursor: pointer;
}

.notice {
  font-size: 13px;
  color: var(--fg2);
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  line-height: 1.5;
}

.notice b {
  color: var(--fg);
}

.muted {
  color: var(--mut);
}

.small {
  font-size: 12px;
}

.right {
  text-align: right;
}

.hidden {
  display: none !important;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12.5px;
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--fg);
  color: var(--bg);
  padding: 9px 16px;
  border-radius: 6px;
  font-size: 13px;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  pointer-events: none;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--line2);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: inline-block;
  vertical-align: middle;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- Responsive Breakpoints ---------- */
@media (max-width: 980px) {
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid3 {
    grid-template-columns: repeat(2, 1fr);
  }

  .dashboard-band {
    grid-template-columns: 1fr;
  }

  .course-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .content {
    padding: 22px 20px 60px;
  }

  .exam-grid {
    grid-template-columns: 1fr;
  }

  .palette {
    position: static;
    order: -1;
  }
}

@media (max-width: 680px) {

  .grid3,
  .stats {
    grid-template-columns: 1fr;
  }

  .topbar-inner {
    gap: 14px;
    padding: 0 14px;
  }

  .nav a {
    padding: 8px 10px;
    font-size: 13px;
  }

  .userbox .who {
    display: none;
  }

  .wrap {
    padding: 20px 14px 48px;
  }

  .pagehead h1 {
    font-size: 21px;
  }

  .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .practice-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .practice-toolbar {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .practice-toolbar .search-wrap {
    flex-basis: 100%;
  }

  .practice-layout {
    grid-template-columns: 1fr;
  }

  .track-list {
    display: flex;
    overflow-x: auto;
    gap: 6px;
  }

  .track-card {
    min-width: 220px;
  }

  .problem-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .track-completion {
    width: 100%;
    text-align: left;
  }

  .result-release-note {
    align-items: flex-start;
  }

  .filter-select {
    width: 100%;
  }
}

@media (max-width: 1100px) {
  .course-shell.focus {
    height: auto;
  }

  .course-shell.focus .content {
    height: auto;
    display: block;
    padding: 18px 20px 60px;
  }

  .course-shell.focus .tabs {
    margin-bottom: 4px;
  }

  .course-shell.focus #practicePane {
    padding: 12px 0 0;
  }
}

/* ==========================================================================
   Practice Workbench v2
   Split panes with real drag handles, statement chrome, and problem drawer.
   ========================================================================== */

.lc-workbench {
  --stmt-w: 46%;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 0;
  height: 100%;
  min-height: 0;
  width: 100%;
}

.lc-workbench .wb-statement {
  flex: 0 0 var(--stmt-w, 46%);
  width: var(--stmt-w, 46%);
  min-width: 0;
  max-width: none;
  resize: none;
}

.lc-workbench .wb-editor {
  flex: 1 1 0;
  min-width: 0;
}

/* Drag handles */
.wb-split {
  position: relative;
  flex: 0 0 12px;
  z-index: 6;
  touch-action: none;
  outline: none;
}

.wb-split::before {
  content: "";
  position: absolute;
  border-radius: 3px;
  background: var(--line2);
  opacity: 0.55;
  transition: background .15s ease, opacity .15s ease;
}

.wb-split-v {
  cursor: col-resize;
}

.wb-split-v::before {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 2px;
  height: 46px;
}

.wb-split-v:hover::before,
.wb-split-v.active::before,
.wb-split-v:focus-visible::before {
  height: 100%;
  background: var(--brand);
  opacity: 1;
}

.wb-split-h {
  flex: 0 0 9px;
  height: 9px;
  cursor: row-resize;
  background: #252526;
  border-top: 1px solid #2d2d2d;
  border-bottom: 1px solid #2d2d2d;
}

.wb-split-h::before {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 46px;
  height: 2px;
}

.wb-split-h:hover::before,
.wb-split-h.active::before,
.wb-split-h:focus-visible::before {
  width: 96px;
  background: #3b82f6;
  opacity: 1;
}

body.wb-dragging-v,
body.wb-dragging-v * {
  cursor: col-resize !important;
  user-select: none !important;
}

body.wb-dragging-h,
body.wb-dragging-h * {
  cursor: row-resize !important;
  user-select: none !important;
}

/* Statement top bar */
.wb-stmt-topbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 10px;
  background: var(--bg2);
  border-bottom: 1px solid var(--line);
}

.wb-prob-nav {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.lc-prob-btn,
.lc-nav-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
  color: var(--fg2);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background .12s ease, color .12s ease, border-color .12s ease;
}

.lc-prob-btn:hover,
.lc-nav-arrow:hover {
  background: var(--bg3);
  border-color: var(--line2);
  color: var(--fg);
}

.lc-nav-arrow {
  width: 30px;
  padding: 0;
}

.lc-nav-arrow:disabled {
  opacity: .4;
  cursor: not-allowed;
}

.lc-prob-count {
  min-width: 48px;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--mut);
  font-variant-numeric: tabular-nums;
}

.wb-stmt-topbar .wb-stmt-tabs {
  padding: 0;
  background: transparent;
  border-bottom: 0;
  flex: 0 0 auto;
}

.wb-stmt-topbar .wb-stmt-tab {
  padding: 6px 9px;
  font-size: 12px;
  border-radius: 6px;
  border-bottom: 2px solid transparent;
}

.wb-stmt-topbar .wb-stmt-tab.active {
  background: var(--brand-bg);
  border-bottom-color: transparent;
  color: var(--brand);
}

/* Problem drawer (popover) */
.wb-prob-drawer {
  position: absolute;
  z-index: 40;
  top: 50px;
  left: 10px;
  right: 10px;
  max-height: calc(100% - 62px);
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border: 1px solid var(--line2);
  border-radius: 10px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, .55);
  overflow: hidden;
  animation: wbDrawerIn .12s ease-out;
}

@keyframes wbDrawerIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.wb-prob-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px 8px;
}

.wb-prob-drawer-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 700;
  color: var(--fg);
}

.wb-prob-solved {
  font-size: 11px;
  font-weight: 600;
  color: var(--mut);
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 1px 8px;
}

.wb-drawer-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 6px;
  background: none;
  color: var(--mut);
  cursor: pointer;
}

.wb-drawer-close:hover {
  background: var(--bg2);
  color: var(--fg);
}

.wb-prob-progress {
  height: 3px;
  margin: 0 12px 9px;
  background: var(--bg3);
  border-radius: 2px;
  overflow: hidden;
}

.wb-prob-progress i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--ok);
  border-radius: 2px;
  transition: width .25s ease;
}

.wb-prob-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  margin: 0 12px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--bg2);
  color: var(--mut);
}

.wb-prob-search-wrap:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-bg);
}

.wb-prob-search-wrap>.icon {
  position: absolute;
  left: 9px;
  pointer-events: none;
}

.wb-prob-search-wrap input {
  flex: 1 1 auto;
  min-width: 0;
  height: 34px;
  padding: 0 30px 0 30px;
  border: none;
  outline: none;
  background: transparent;
  color: var(--fg);
  font-size: 12.5px;
}

.wb-prob-search-wrap input::placeholder {
  color: var(--mut);
}

.wb-prob-clear {
  position: absolute;
  right: 5px;
  display: none;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 5px;
  background: none;
  color: var(--mut);
  cursor: pointer;
}

.wb-prob-clear:hover {
  color: var(--fg);
  background: var(--bg3);
}

.wb-prob-search-wrap.has-value .wb-prob-clear {
  display: inline-flex;
}

.wb-prob-items {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 0 6px 6px;
  scrollbar-gutter: stable;
}

.wb-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 8px 9px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: none;
  color: var(--fg);
  text-align: left;
  cursor: pointer;
  transition: background .12s ease, border-color .12s ease;
}

.wb-item:hover {
  background: var(--bg2);
}

.wb-item:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: -2px;
}

.wb-item.active {
  background: var(--brand-bg);
  border-color: rgba(56, 139, 253, .35);
}

.wb-item-state {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  color: var(--mut);
}

.wb-item.solved .wb-item-state {
  color: var(--ok);
}

.wb-item-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.wb-item-t {
  font-size: 13px;
  font-weight: 550;
  color: var(--fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wb-item-idx {
  display: inline-block;
  min-width: 22px;
  margin-right: 4px;
  color: var(--mut);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.wb-item-m {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--mut);
}

.wb-done {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 650;
  color: var(--ok);
}

.wb-item-chev {
  display: inline-flex;
  color: var(--mut);
  opacity: 0;
  transition: opacity .12s ease, transform .12s ease;
}

.wb-item:hover .wb-item-chev,
.wb-item.active .wb-item-chev {
  opacity: 1;
}

.wb-item:hover .wb-item-chev {
  transform: translateX(1px);
}

.wb-prob-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 34px 12px;
  color: var(--mut);
  text-align: center;
}

.wb-prob-empty .icon {
  opacity: .6;
}

.wb-prob-empty-t {
  font-size: 13px;
  font-weight: 600;
  color: var(--fg2);
}

.wb-prob-empty-s {
  font-size: 11.5px;
}

.wb-prob-drawer-foot {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 12px;
  border-top: 1px solid var(--line);
  background: var(--bg2);
  font-size: 11px;
  color: var(--mut);
}

.wb-prob-hint kbd {
  font-family: inherit;
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
  padding: 2px 5px;
  border: 1px solid var(--line2);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: var(--bg);
  color: var(--fg2);
}

/* Statement body */
.lc-head {
  margin-bottom: 4px;
}

.lc-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.lc-title-row h2 {
  font-size: 19px;
  font-weight: 650;
  letter-spacing: -.2px;
  color: var(--fg);
  margin: 0;
}

.lc-solved-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border: 1px solid var(--ok-line);
  border-radius: 999px;
  background: var(--ok-bg);
  color: var(--ok);
  font-size: 11px;
  font-weight: 650;
}

.lc-tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.lc-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg2);
  color: var(--fg2);
  font-size: 11px;
  font-weight: 600;
}

.lc-prompt {
  margin-top: 14px;
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--fg);
}

.lc-prompt p {
  margin: 0 0 10px;
}

.lc-prompt p:last-child {
  margin-bottom: 0;
}

.lc-prompt ul,
.lc-prompt ol {
  margin: 0 0 10px;
  padding-left: 20px;
}

.lc-prompt li {
  margin-bottom: 3px;
}

.lc-prompt code {
  font-family: ui-monospace, 'JetBrains Mono', Consolas, monospace;
  font-size: 12px;
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--bg2);
}

.lc-prompt pre {
  margin: 10px 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg2);
  overflow-x: auto;
  font-size: 12px;
  line-height: 1.55;
}

.lc-prompt pre code {
  padding: 0;
  border: 0;
  background: none;
}

.lc-prompt img,
.md-img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 12px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg2);
}

.md-img {
  max-height: 420px;
  object-fit: contain;
}

.lc-samples {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}

.lc-example-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg2);
  overflow: hidden;
}

.lc-example-head {
  padding: 6px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--bg3);
  color: var(--mut);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.lc-example-inner {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  font-size: 12.5px;
  color: var(--fg2);
}

.lc-example-inner strong {
  margin-right: 6px;
  color: var(--mut);
  font-size: 11.5px;
  font-weight: 600;
}

.lc-example-inner code {
  font-family: ui-monospace, 'JetBrains Mono', Consolas, monospace;
  font-size: 12px;
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--bg);
  color: var(--fg);
  white-space: pre-wrap;
  word-break: break-word;
}

.lc-constraints-box {
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg2);
}

.lc-constraints-title {
  margin-bottom: 6px;
  color: var(--fg);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .02em;
}

.lc-constraints-box ul {
  margin: 0;
  padding-left: 18px;
  color: var(--fg2);
  font-size: 12.5px;
  line-height: 1.7;
}

.lc-constraints-box code {
  font-family: ui-monospace, 'JetBrains Mono', Consolas, monospace;
  font-size: 11.5px;
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--bg);
}

.wb-foot-note {
  margin-top: 16px;
  padding-top: 10px;
  border-top: 1px dashed var(--line2);
  font-size: 11.5px;
  color: var(--mut);
}

/* Editor toolbar + console sizing */
.wb-prob-search-wrap input:focus {
  outline: none;
  border-color: transparent;
}

.lc-auto-tag {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border: 1px solid #3d3d3d;
  border-radius: 999px;
  color: #9ca3af;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.wb-editor {
  --console-h: 260px;
}

.wb-run-btn,
.wb-submit-btn {
  flex: 0 0 auto;
  white-space: nowrap;
}

@media (max-width: 1100px) {
  .lc-workbench {
    flex-direction: column;
    height: auto;
    gap: 0;
  }

  .lc-workbench .wb-statement {
    flex: 0 0 auto;
    width: 100%;
    max-height: 440px;
  }

  .lc-workbench .wb-editor {
    flex: 0 0 auto;
    height: 620px;
  }

  .wb-split-v {
    display: none;
  }

  .wb-split-h {
    display: none;
  }
}

@media (max-width: 680px) {
  .lc-workbench .wb-statement {
    max-height: 380px;
  }

  .lc-workbench .wb-editor {
    height: 560px;
  }

  .wb-stmt-body {
    padding: 14px 14px 18px;
  }

  .lc-prob-count {
    min-width: 40px;
  }

  .lc-prob-btn {
    padding: 0 8px;
  }

  .lc-prob-btn span.wb-btn-label {
    display: none;
  }
}

/* ==========================================================================
   Dashboard v2 — student overview
   ========================================================================== */

.dash-eyebrow {
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--brand);
}

/* Stat cards */
.dash-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.dash-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 16px 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--bg);
  transition: border-color .12s ease;
}

.dash-stat:hover {
  border-color: var(--line2);
}

.dash-stat-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.dash-stat-k {
  padding-top: 4px;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--mut);
}

.dash-stat-ic {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--bg2);
  color: var(--brand);
}

.dash-stat-ic:empty {
  display: none;
}

.dash-stat-v {
  margin-top: 8px;
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: 0;
  color: var(--fg);
  font-variant-numeric: tabular-nums lining-nums;
}

.dash-stat-v small {
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--mut);
}

.dash-stat-sub {
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--mut);
}

/* Two-column focus band */
.dash-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  gap: 16px;
  margin-top: 16px;
}

@media (max-width: 1080px) {
  .dash-grid {
    grid-template-columns: 1fr;
  }
}

.dash-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--bg);
}

.dash-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--bg2);
}

.dash-panel-title {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--mut);
}

.dash-panel-title .icon {
  color: var(--brand);
}

.dash-panel-head .view-all {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.dash-panel-body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  padding: 16px;
}

.dash-panel-body>.empty {
  margin: auto 0;
}

/* Continue learning */
.dash-continue {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 8px;
}

.dash-kicker {
  font-size: 11.5px;
  font-weight: 550;
  color: var(--mut);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dash-continue-title {
  margin: 0;
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -.2px;
  color: var(--fg);
}

.dash-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 2px;
}

.dash-progress-bar {
  flex: 1 1 auto;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--bg3);
}

.dash-progress-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--brand);
}

.dash-progress-val {
  min-width: 38px;
  text-align: right;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--mut);
  font-variant-numeric: tabular-nums;
}

.dash-continue-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 10px;
}

.dash-hint {
  font-size: 11.5px;
  color: var(--mut);
}

/* Next assessment */
.dash-exam {
  display: flex;
  gap: 14px;
}

.dash-date {
  align-self: flex-start;
  width: 54px;
  flex: 0 0 54px;
}

.dash-date .m {
  color: var(--brand);
}

.dash-exam-main {
  min-width: 0;
  flex: 1 1 auto;
}

.dash-exam-title {
  font-size: 15px;
  font-weight: 650;
  color: var(--fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dash-exam-meta {
  margin-top: 2px;
  font-size: 12px;
  color: var(--mut);
}

.dash-exam-when {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 7px;
  font-size: 11.5px;
  color: var(--mut);
}

.dash-exam-when .icon {
  flex: 0 0 auto;
  opacity: .8;
}

.dash-exam-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.dash-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border: 1px solid var(--line2);
  border-radius: 999px;
  background: var(--bg2);
  color: var(--fg2);
  font-size: 10.5px;
  font-weight: 650;
  white-space: nowrap;
}

.dash-chip.ok {
  color: var(--ok);
  background: var(--ok-bg);
  border-color: var(--ok-line);
}

.dash-chip.warn {
  color: var(--warn);
  background: var(--warn-bg);
  border-color: var(--warn-line);
}

.dash-chip.bad {
  color: var(--bad);
  background: var(--bad-bg);
  border-color: var(--bad-line);
}

/* Course rows */
.dash-courses {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 560px), 1fr));
  gap: 10px;
}

.dash-course {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 200px auto;
  align-items: center;
  gap: 16px;
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--bg);
  transition: border-color .12s ease;
}

.dash-course:hover {
  border-color: var(--line2);
}

.dash-course-ic {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg2);
  color: var(--brand);
}

.dash-course-main {
  min-width: 0;
}

.dash-course-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.dash-course h3 {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -.2px;
  color: var(--fg);
}

.dash-course-desc {
  margin: 2px 0 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12.5px;
  color: var(--mut);
}

.dash-course-topics {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 5px;
  font-size: 11.5px;
  color: var(--mut);
}

.dash-course-prog {
  min-width: 0;
}

.dash-course-prog .dash-progress {
  margin-top: 0;
}

.dash-course-prog-k {
  display: block;
  margin-top: 5px;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--mut);
}

/* Assignment list */
.dash-assign-list {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--bg);
}

.dash-assign {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto 16px;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
  color: inherit;
  text-decoration: none;
  transition: background-color .12s ease;
}

.dash-assign:last-child {
  border-bottom: 0;
}

.dash-assign:hover {
  background: var(--bg2);
  text-decoration: none;
}

.dash-assign-ic {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--bg3);
  color: var(--mut);
}

.dash-assign.solved .dash-assign-ic {
  color: var(--ok);
  background: var(--ok-bg);
}

.dash-assign-main {
  min-width: 0;
}

.dash-assign-title {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--fg);
}

.dash-assign-meta {
  display: block;
  margin-top: 1px;
  font-size: 11.5px;
  color: var(--mut);
}

.dash-assign-pill {
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg2);
  color: var(--mut);
  font-size: 10.5px;
  font-weight: 650;
  white-space: nowrap;
}

.dash-assign-pill.ok {
  color: var(--ok);
  background: var(--ok-bg);
  border-color: var(--ok-line);
}

.dash-assign-chev {
  display: inline-flex;
  color: var(--mut);
  transition: color .12s ease, transform .12s ease;
}

.dash-assign:hover .dash-assign-chev {
  color: var(--brand);
  transform: translateX(1px);
}

@media (max-width: 980px) {
  .dash-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .dash-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .dash-course {
    grid-template-columns: 38px minmax(0, 1fr) auto;
  }

  .dash-course-prog {
    grid-column: 2;
    grid-row: 2;
  }

  .dash-course>.btn {
    grid-column: 3;
    grid-row: 1 / 3;
    align-self: center;
  }
}

@media (max-width: 680px) {
  .dash-stat {
    padding: 12px 13px;
  }

  .dash-stat-v {
    font-size: 24px;
  }

  .dash-course {
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 10px 12px;
    padding: 14px;
  }

  .dash-course-ic {
    width: 34px;
    height: 34px;
  }

  .dash-course-prog {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .dash-course>.btn {
    grid-column: 1 / -1;
    grid-row: 3;
    justify-self: start;
  }

  .dash-assign {
    grid-template-columns: 26px minmax(0, 1fr) 16px;
    padding: 10px 13px;
  }

  .dash-assign-pill {
    display: none;
  }
}

@media (max-width: 430px) {
  .dash-stats {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   Colorful card refresh
   ============================================================ */

h1,
h2,
h3,
h4 {
  letter-spacing: -0.02em;
  font-weight: 750;
}

/* Topbar */
.topbar {
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  height: 62px;
}

.brand b {
  text-transform: none;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -.03em;
}

.nav a {
  color: var(--mut);
  border-radius: 10px;
  font-weight: 600;
}

.nav a:hover {
  background: var(--bg2);
  color: var(--fg);
}

.nav a.active {
  background: var(--brand-bg);
  color: var(--brand);
}

.avatar {
  background: var(--brand);
  color: #fff;
  border: 0;
  font-weight: 700;
}

.badge-admin {
  background: var(--c-violet-bg);
  border-color: transparent;
  color: var(--c-violet);
}

.badge-admin:hover {
  background: var(--c-violet-bg);
}

/* Surfaces */
.card,
.course-card,
.stat,
.dash-stat,
.dash-panel,
.practice-stat {
  background: var(--panel);
  border-color: var(--line);
  box-shadow: var(--shadow-card);
}

.card.link:hover,
.course-card:hover,
.dash-stat:hover {
  border-color: var(--brand);
  box-shadow: var(--shadow-lift);
}

.btn {
  border-radius: 10px;
  font-weight: 600;
}

.btn.primary {
  box-shadow: 0 10px 20px -14px rgba(79, 70, 229, .8);
}

.progress>i {
  background: var(--brand);
}

/* Forms */
input,
select,
textarea {
  border-radius: 10px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand) !important;
  outline: none;
  box-shadow: 0 0 0 3px var(--brand-bg);
}

/* Dashboard stats: one accent per card */
.dash-stat {
  position: relative;
  overflow: hidden;
  padding: 18px;
}

.dash-stat::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--c-indigo);
}

.dash-stat:nth-child(2)::before {
  background: var(--c-teal);
}

.dash-stat:nth-child(3)::before {
  background: var(--c-orange);
}

.dash-stat:nth-child(4)::before {
  background: var(--c-violet);
}

.dash-stat-v {
  font-size: 30px;
  font-weight: 800;
}

.dash-stat-ic {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--c-indigo);
  background: var(--c-indigo-bg);
  font-size: 15px;
}

.dash-stat:nth-child(2) .dash-stat-ic {
  color: var(--c-teal);
  background: var(--c-teal-bg);
}

.dash-stat:nth-child(3) .dash-stat-ic {
  color: var(--c-orange);
  background: var(--c-orange-bg);
}

.dash-stat:nth-child(4) .dash-stat-ic {
  color: var(--c-violet);
  background: var(--c-violet-bg);
}

.dash-eyebrow {
  color: var(--brand);
  letter-spacing: .09em;
}

.dash-panel {
  border-radius: var(--radius-lg);
}

.dash-panel-head {
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
}

/* Quick actions */
.quick-block {
  margin-top: 28px;
}

.quick-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.quick-head h2 {
  font-size: 16.5px;
}

.quick-rule {
  width: 46px;
  height: 3px;
  border-radius: 3px;
  background: var(--brand);
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.quick-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 132px;
  padding: 20px;
  border-radius: 18px;
  color: #fff;
  text-decoration: none;
  box-shadow: var(--shadow-card);
  transition: transform .16s ease, box-shadow .16s ease;
}

.quick-card:hover {
  text-decoration: none;
  color: #fff;
  transform: translateY(-3px);
  box-shadow: var(--shadow-lift);
}

.quick-card .q-ic {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, .2);
}

.quick-card .q-t {
  margin-top: auto;
  font-size: 16px;
  font-weight: 750;
  letter-spacing: -.01em;
}

.quick-card .q-s {
  font-size: 12px;
  opacity: .86;
  font-weight: 500;
}

.q-indigo {
  background: #4f46e5;
}

.q-teal {
  background: #0d9488;
}

.q-orange {
  background: #ea580c;
}

.q-violet {
  background: #7c3aed;
}

/* Login */
.auth {
  max-width: 940px;
  margin: 7vh auto;
  padding: 0 20px;
}

.auth-card {
  display: grid;
  grid-template-columns: 1.02fr .98fr;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 40px 70px -50px rgba(16, 24, 40, .6);
}

.auth-hero {
  background: #4f46e5;
  color: #fff;
  padding: 36px 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.auth-brand img {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: #fff;
  padding: 4px;
}

.auth-brand b {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -.02em;
}

.auth-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  opacity: .8;
  margin-top: 12px;
}

.auth-hero h1 {
  color: #fff;
  font-size: 34px;
  line-height: 1.12;
  letter-spacing: -.03em;
  font-weight: 800;
}

.auth-points {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 11px;
  font-size: 13.5px;
  font-weight: 500;
}

.auth-points li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  opacity: .94;
}

.auth-points .icon {
  margin-top: 1px;
  opacity: .9;
  flex-shrink: 0;
}

.auth-demo {
  margin-top: auto;
  display: inline-flex;
  align-self: flex-start;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .14);
  font-size: 12.5px;
  font-weight: 600;
}

.auth-form {
  padding: 36px 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.auth-form h2 {
  font-size: 22px;
  font-weight: 800;
}

.auth-sub {
  color: var(--mut);
  font-size: 13.5px;
  margin: 6px 0 20px;
  line-height: 1.5;
}

.auth-form .btn {
  margin-top: 10px;
  padding: 11px;
}

.auth-alt {
  margin-top: 18px;
  font-size: 12px;
  color: var(--mut);
}

.auth-alt b {
  color: var(--fg2);
}

.section-head h2 {
  font-size: 17px;
}

@media (max-width: 820px) {
  .quick-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .auth-card {
    grid-template-columns: 1fr;
  }

  .auth-hero {
    padding: 26px 24px;
  }

  .auth-hero h1 {
    font-size: 28px;
  }

  .auth-form {
    padding: 28px 24px;
  }
}

@media (max-width: 520px) {
  .quick-grid {
    grid-template-columns: 1fr;
  }

  .auth-demo {
    display: none;
  }
}

/* ============================================================
   Classic polish — compact cards, restrained color
   ============================================================ */

.topbar-inner {
  height: 56px;
}

.brand b {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -.01em;
}

.nav a {
  border-radius: 8px;
  font-size: 13px;
}

.avatar {
  background: var(--brand);
  color: #fff;
}

.badge-admin {
  background: var(--brand-bg);
  border-color: transparent;
  color: var(--brand);
}

.badge-admin:hover {
  background: var(--brand-bg);
}

.btn {
  border-radius: 8px;
}

.btn.primary {
  box-shadow: none;
}

/* compact stats */
.dash-stat {
  padding: 14px 16px;
}

.dash-stat::before {
  display: none;
}

.dash-stat-v {
  font-size: 23px;
  font-weight: 700;
  letter-spacing: -.01em;
}

.dash-stat-k {
  font-size: 10.5px;
  letter-spacing: .04em;
}

.dash-stat-sub {
  font-size: 11px;
}

.dash-stat-ic {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  font-size: 14px;
}

/* stats double as navigation */
a.dash-stat {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

a.dash-stat:hover,
a.dash-stat:focus {
  color: inherit;
  text-decoration: none;
}

a.dash-stat:hover .dash-stat-k {
  color: var(--brand);
}

a.dash-stat:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.dash-stat-k {
  transition: color .12s ease;
}

.dash-panel {
  border-radius: 10px;
}

.dash-panel-head {
  padding: 13px 16px;
}

.dash-grid {
  gap: 14px;
  margin-top: 14px;
}

.section {
  margin-top: 26px;
}

/* compact quick-action cards */
.quick-block {
  margin-top: 22px;
}

.quick-head {
  margin-bottom: 11px;
}

.quick-head h2 {
  font-size: 15.5px;
}

.quick-rule {
  width: 34px;
  height: 2px;
  background: var(--brand);
}

.quick-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.quick-card {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 11px;
  min-height: 0;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--fg);
  box-shadow: none;
}

.quick-card:hover {
  color: var(--fg);
  border-color: var(--line2);
  box-shadow: var(--shadow-card);
  transform: none;
  text-decoration: none;
}

.quick-card .q-ic {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  background: var(--brand-bg);
  color: var(--brand);
}

.quick-card .q-ic.green {
  background: var(--c-teal-bg);
  color: var(--c-teal);
}

.quick-card .q-ic.amber {
  background: var(--c-orange-bg);
  color: var(--c-orange);
}

.quick-card .q-ic.slate {
  background: var(--c-violet-bg);
  color: var(--c-violet);
}

.quick-card .q-body {
  min-width: 0;
}

.quick-card .q-t {
  display: block;
  margin: 0;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--fg);
}

.quick-card .q-s {
  display: block;
  margin-top: 1px;
  font-size: 11.5px;
  color: var(--mut);
  opacity: 1;
  font-weight: 400;
}

/* classic single-card sign-in */
.auth {
  max-width: 420px;
  margin: 7vh auto;
  padding: 0 20px;
}

.auth-card {
  display: block;
  padding: 28px 26px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 8px 24px -18px rgba(0, 0, 0, 0.28);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 16px;
}

.auth-brand img {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: none;
  padding: 0;
}

.auth-brand b {
  font-size: 19px;
  font-weight: 700;
  color: var(--fg);
}

.auth-card h1,
.auth-form h2 {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -.01em;
}

.auth-sub {
  color: var(--mut);
  font-size: 13px;
  margin: 5px 0 18px;
  line-height: 1.45;
}

.auth-form {
  padding: 0;
  display: block;
}

.auth-form .btn,
.auth-card .btn {
  margin-top: 8px;
  padding: 10px;
  width: 100%;
}

.auth-alt {
  margin-top: 16px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
  font-size: 11.5px;
  color: var(--mut);
  line-height: 1.7;
}

.auth-alt b {
  color: var(--fg2);
  font-weight: 600;
}

@media (max-width: 1100px) {
  .quick-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .quick-grid {
    grid-template-columns: 1fr;
  }

  .auth-card {
    padding: 24px 20px;
  }
}