:root,
.theme-hive {
  --sidebar-width: 286px;
  --primary-color: 160, 211, 223;
  --primary-color-300: 160, 211, 223;
  --primary-color-500: 67, 160, 180;
  --primary-color-700: 41, 105, 123;
  --bg-page: #f5f5f5;
  --bg-sidebar: #ffffff;
  --surface: #ffffff;
  --surface-2: #f4f5f6;
  --surface-3: #e2e4e5;
  --text: #24282f;
  --muted: #9da0a7;
  --muted-strong: #696c72;
  --line: #d9dbdf;
  --line-strong: #b4b7bb;
  --shadow: 0 2px 10px rgba(16, 20, 25, .10);
  --ok: #00c46b;
  --ok-dark: #0d7a34;
  --danger: #ff4d4d;
  --danger-dark: #a93232;
  --warning: #e0a700;
  --timeline-rail: rgba(180, 183, 187, .32);
  --scrollbar-size: 16px;
  --scrollbar-track: var(--bg-page);
  --scrollbar-thumb: #c9cdd4;
  --scrollbar-thumb-hover: #aeb4bf;
  --scrollbar-thumb-active: #8f98a6;
  --scrollbar-button: #9da0a7;
  --scrollbar-button-hover: #696c72;
  --scrollbar-arrow-up: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath fill='black' d='M6 0 12 8H0z'/%3E%3C/svg%3E");
  --scrollbar-arrow-down: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath fill='black' d='M6 8 12 0H0z'/%3E%3C/svg%3E");
}
html.dark,
body.dark {
  --bg-page: #24282f;
  --bg-sidebar: #20252b;
  --surface: #2f343c;
  --surface-2: #292e36;
  --surface-3: #4c5057;
  --text: #f5f5f5;
  --muted: #9da0a7;
  --muted-strong: #cbcdd1;
  --line: #3d424b;
  --line-strong: #5b616b;
  --shadow: 0 2px 12px rgba(0, 0, 0, .28);
  --timeline-rail: rgba(180, 183, 187, .22);
  --scrollbar-track: var(--bg-page);
  --scrollbar-thumb: #5b616b;
  --scrollbar-thumb-hover: #737b87;
  --scrollbar-thumb-active: #8d96a3;
  --scrollbar-button: #9da0a7;
  --scrollbar-button-hover: #cbcdd1;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
html {
  background: var(--bg-page);
  color-scheme: light;
  overflow-y: auto;
  scrollbar-gutter: stable;
  scrollbar-width: auto;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}
html.dark {
  color-scheme: dark;
}
body {
  margin: 0;
  font-family: Nexa, Inter, Poppins, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg-page);
  color: var(--text);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
html::-webkit-scrollbar,
body::-webkit-scrollbar {
  width: var(--scrollbar-size);
  height: var(--scrollbar-size);
}
html::-webkit-scrollbar-track,
body::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
}
html::-webkit-scrollbar-thumb,
body::-webkit-scrollbar-thumb {
  min-height: 72px;
  border-radius: 999px;
  background-color: var(--scrollbar-thumb);
  background-clip: content-box;
  border: 4px solid var(--scrollbar-track);
}
html::-webkit-scrollbar-thumb:hover,
body::-webkit-scrollbar-thumb:hover {
  background-color: var(--scrollbar-thumb-hover);
  border-width: 3px;
}
html::-webkit-scrollbar-thumb:active,
body::-webkit-scrollbar-thumb:active {
  background-color: var(--scrollbar-thumb-active);
  border-width: 3px;
}
html::-webkit-scrollbar-corner,
body::-webkit-scrollbar-corner {
  background: var(--scrollbar-track);
}
html::-webkit-scrollbar-button:single-button,
body::-webkit-scrollbar-button:single-button {
  width: var(--scrollbar-size);
  height: 16px;
  background: var(--scrollbar-track);
}
html::-webkit-scrollbar-button:single-button:vertical:decrement,
body::-webkit-scrollbar-button:single-button:vertical:decrement {
  background-color: var(--scrollbar-button);
  -webkit-mask: var(--scrollbar-arrow-up) center / 12px 8px no-repeat;
  mask: var(--scrollbar-arrow-up) center / 12px 8px no-repeat;
}
html::-webkit-scrollbar-button:single-button:vertical:increment,
body::-webkit-scrollbar-button:single-button:vertical:increment {
  background-color: var(--scrollbar-button);
  -webkit-mask: var(--scrollbar-arrow-down) center / 12px 8px no-repeat;
  mask: var(--scrollbar-arrow-down) center / 12px 8px no-repeat;
}
html::-webkit-scrollbar-button:single-button:hover,
body::-webkit-scrollbar-button:single-button:hover {
  background-color: var(--scrollbar-button-hover);
}
button, textarea, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .65; }
a { color: inherit; }
pre, code, textarea.code-editor, .mini-output, .raw-output, .codemirror-host { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; }

.app-shell { min-height: 100vh; }
.boot-loader { min-height: 100vh; display: grid; place-items: center; color: var(--muted); width: 100%; }
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card {
  width: min(100%, 520px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: clamp(28px, 6vw, 52px);
  box-shadow: var(--shadow);
}
.auth-card p { color: var(--muted-strong); line-height: 1.6; margin: 18px 0 24px; }
.auth-card .btn + .btn { margin-left: 8px; }

.sidebar {
  width: var(--sidebar-width);
  height: 100vh;
  height: 100dvh;
  max-height: 100vh;
  max-height: 100dvh;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 20;
  background: var(--bg-sidebar);
  border-right: 1px solid rgba(157,160,167,.18);
  display: flex;
  flex-direction: column;
  padding: 24px 10px;
  flex-shrink: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.brand {
  border: 0;
  background: transparent;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  padding: 0 10px 30px;
  width: max-content;
}
.brand-logo,
.brand-logo svg {
  display: block;
  width: 151px;
  height: 40px;
}
.nav { display: grid; gap: 8px; }
.nav-item {
  border: 0;
  background: transparent;
  color: var(--muted-strong);
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 56px;
  padding: 0 14px;
  border-radius: 8px;
  font-size: 19px;
  width: 100%;
  text-align: left;
}
.nav-item:hover { background: rgba(157,160,167,.10); color: var(--text); }
.nav-item.active { color: var(--text); background: rgba(157,160,167,.20); }
.nav-icon { width: 28px; text-align: center; color: var(--muted); font-size: 21px; }
.sidebar-bottom { margin-top: auto; border-top: 1px solid rgba(157,160,167,.18); padding-top: 18px; display: grid; gap: 12px; }
.theme-toggle { color: rgb(var(--primary-color-700)); }
body.dark .theme-toggle { color: rgb(var(--primary-color-300)); }
.user-picker { display: grid; gap: 8px; padding: 0 12px; color: var(--muted-strong); }
.account-profile { display: grid; gap: 7px; padding: 0 12px; min-width: 0; color: var(--muted-strong); }
.account-profile strong, .account-profile small { overflow-wrap: anywhere; }
.account-profile strong { color: var(--text); }
.account-profile .badge { justify-self: start; }
.account-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.user-select,
.form-control {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  border-radius: 8px;
  padding: 10px 12px;
  outline: none;
}
.user-select:focus,
.form-control:focus,
.code-editor:focus { border-color: rgb(var(--primary-color)); box-shadow: 0 0 0 3px rgba(var(--primary-color), .22); }

.main {
  min-width: 0;
  padding: 36px clamp(22px, 4vw, 64px) 80px;
  margin-left: var(--sidebar-width);
  width: calc(100% - var(--sidebar-width));
}
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 28px;
}
.kicker,
.section-eyebrow {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: 13px;
  font-weight: 900;
}
h1 { margin: 4px 0 0; font-size: 36px; line-height: 1.08; }
h2 { margin: 0 0 10px; font-size: 24px; }
h3 { margin: 0 0 8px; font-size: 19px; }
.page-head p,
.muted { color: var(--muted-strong); line-height: 1.5; }
.head-actions, .actions, .task-actions, .solve-actions, .accepted-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.btn,
.ghost-btn,
.back-link {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: 9px;
  padding: 10px 14px;
  box-shadow: 0 1px 0 rgba(0,0,0,.04);
  text-decoration: none;
}
.btn:hover, .ghost-btn:hover, .back-link:hover { border-color: rgb(var(--primary-color)); }
.btn.primary { border-color: rgb(var(--primary-color)); background: rgba(var(--primary-color), .22); }
.btn.danger, .ghost-btn.danger { border-color: rgba(255,77,77,.38); color: var(--danger); }
.ghost-btn { padding: 6px 10px; font-size: 13px; background: transparent; box-shadow: none; }
.back-link { background: transparent; box-shadow: none; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(10, 14, 20, .68);
}
.modal-card {
  width: min(100%, 540px);
  max-height: calc(100vh - 48px);
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 26px;
  box-shadow: 0 16px 55px rgba(0, 0, 0, .28);
}
.modal-card > p { color: var(--muted-strong); line-height: 1.5; }
.modal-card label, .admin-grid form { display: grid; gap: 7px; }
.modal-card .actions { justify-content: flex-end; margin-top: 22px; }
.modal-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.admin-card { width: min(100%, 880px); }
.admin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; margin-top: 24px; }
.admin-grid form { align-content: start; }
.invite-result { display: grid; gap: 8px; margin-top: 24px; padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.invite-result code { overflow-wrap: anywhere; user-select: all; }
.operation-message { margin-bottom: 0; }

.overview-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 26px; }
.stat-card { background: var(--surface); border: 1px solid rgba(157,160,167,.16); border-radius: 12px; padding: 18px; box-shadow: var(--shadow); display: grid; gap: 4px; }
.stat-card strong { font-size: 30px; }
.stat-card span { color: var(--muted-strong); }

.timeline {
  --rail-x: 24px;
  --rail-width: 4px;
  --content-x: 56px;
  --node-size: 30px;
  --node-center-y: calc(var(--node-size) / 2);
  --connector-height: 8px;
  --card-accent-width: 8px;
  --node-center-x: calc(-1 * var(--content-x) + var(--rail-x) + var(--rail-width) / 2);
  position: relative;
  margin-top: 16px;
  padding-left: var(--content-x);
  overflow: visible;
}
.timeline::before,
.timeline::after {
  content: "";
  position: absolute;
  left: var(--rail-x);
  top: var(--rail-top, 0);
  width: var(--rail-width);
  border-radius: 999px;
}
.timeline::before {
  height: var(--rail-height, 100%);
  background: var(--timeline-rail);
  z-index: 0;
}
.timeline::after {
  height: var(--timeline-progress-height, 0);
  background: var(--ok-dark);
  z-index: 1;
}
.challenge { --step-color: var(--surface-3); position: relative; z-index: 2; margin: 0 0 30px; overflow: visible; }
.challenge.state-passed { --step-color: var(--ok-dark); }
.challenge.state-in_progress { --step-color: rgb(var(--primary-color)); }
.challenge.state-failed { --step-color: var(--danger); }
.challenge.state-not_started { --step-color: var(--line-strong); }
.challenge-label { color: var(--muted); font-size: 19px; margin-bottom: 8px; }
.challenge-body { position: relative; overflow: visible; }
.timeline-node,
.timeline-connector {
  position: absolute;
  top: var(--node-center-y);
  background: var(--step-color);
}
.timeline-node {
  left: var(--node-center-x);
  width: var(--node-size);
  height: var(--node-size);
  transform: translate(-50%, -50%);
  border-radius: 999px;
  border: 0;
  z-index: 5;
}
.timeline-connector {
  left: calc(var(--node-center-x) + var(--node-size) / 2 - 1px);
  width: calc(-1 * var(--node-center-x) - var(--node-size) / 2 + var(--card-accent-width) + 1px);
  height: var(--connector-height);
  transform: translateY(-50%);
  border-radius: 999px;
  z-index: 4;
}
.challenge-card { position: relative; z-index: 3; background: var(--surface); border-radius: 10px; box-shadow: var(--shadow); border-left: 0; overflow: hidden; }
.challenge-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--card-accent-width); background: var(--step-color); border-radius: 10px 0 0 10px; z-index: 0; }
.challenge-card > * { position: relative; z-index: 1; }
.challenge-head { min-height: 104px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 20px 24px 20px calc(24px + var(--card-accent-width)); }
.challenge-title { border: 0; background: transparent; color: inherit; display: flex; align-items: center; gap: 16px; text-align: left; min-width: 0; }
.challenge-title strong { display: block; font-size: 25px; color: var(--muted-strong); }
.challenge-title small { display: block; color: var(--muted); margin-top: 4px; font-size: 14px; line-height: 1.4; }
.status-circle { width: 44px; height: 44px; border-radius: 999px; border: 3px solid var(--muted); display: inline-grid; place-items: center; font-weight: 900; color: var(--muted); flex-shrink: 0; }
.state-passed .status-circle { border-color: var(--ok); color: var(--ok); }
.state-in_progress .status-circle { border-color: rgb(var(--primary-color)); }
.state-failed .status-circle { border-color: var(--danger); }
.chevron {
  width: 46px;
  height: 46px;
  border-radius: 999px;
  border: 2px solid var(--line-strong);
  background: transparent;
  color: var(--text);
  display: grid;
  place-items: center;
  transition: border-color .16s ease, background .16s ease, box-shadow .16s ease;
  flex-shrink: 0;
}
.chevron:hover { border-color: rgb(var(--primary-color)); background: rgba(var(--primary-color), .10); }
.chevron:focus-visible { outline: none; box-shadow: 0 0 0 4px rgba(var(--primary-color), .28); }
.chevron span { width: 10px; height: 10px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translate(-1px, -2px); transition: transform .18s ease; }
.chevron[data-open="true"] span { transform: rotate(225deg) translate(-1px, -2px); }
.task-list { padding: 0 24px 24px; }
.task-list-head,
.task-row { display: grid; grid-template-columns: 20px minmax(220px, 1fr) 130px 160px; gap: 12px; align-items: center; }
.task-list-head { min-height: 38px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-size: 13px; font-weight: 900; border-top: 1px solid var(--line); }
.task-list-head span:nth-child(1) { grid-column: 2; }
.task-list-head span:nth-child(2) { grid-column: 3; }
.task-list-head span:nth-child(3) { grid-column: 4; }
.task-row { width: 100%; min-height: 64px; border: 0; border-top: 1px solid var(--line); background: transparent; color: var(--muted-strong); text-align: left; padding: 0; }
.task-row:hover { background: rgba(var(--primary-color), .08); border-radius: 8px; }
.task-main strong { display: block; color: var(--text); font-size: 17px; }
.task-main small { display: block; color: var(--muted); margin-top: 3px; line-height: 1.35; }
.task-dot { width: 14px; height: 14px; border-radius: 999px; border: 2px solid var(--muted); }
.task-row.state-passed .task-dot { border-color: var(--ok); background: var(--ok); }
.task-row.state-in_progress .task-dot { border-color: rgb(var(--primary-color)); background: rgb(var(--primary-color)); }
.task-row.state-failed .task-dot { border-color: var(--danger); background: var(--danger); }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 5px 9px; border-radius: 999px; border: 1px solid var(--line); font-size: 12px; font-weight: 900; color: var(--muted-strong); background: rgba(157,160,167,.08); width: fit-content; }
.badge.ok, .badge.state-passed { border-color: rgba(0,196,107,.42); color: var(--ok); background: rgba(0,196,107,.08); }
.badge.state-in_progress { border-color: rgba(var(--primary-color), .7); color: rgb(var(--primary-color-700)); background: rgba(var(--primary-color), .14); }
body.dark .badge.state-in_progress { color: rgb(var(--primary-color-300)); }
.badge.state-failed, .badge.danger { border-color: rgba(255,77,77,.38); color: var(--danger); background: rgba(255,77,77,.08); }
.badge.state-not_started, .badge.muted { color: var(--muted-strong); }
.badge.warn { border-color: rgba(224,167,0,.48); color: var(--warning); background: rgba(224,167,0,.08); }
.tag-row, .stacked-badges { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.task-hero { background: var(--surface); box-shadow: var(--shadow); border: 1px solid rgba(157,160,167,.16); border-left: 10px solid var(--surface-3); border-radius: 12px; padding: 24px 28px; display: flex; justify-content: space-between; align-items: flex-start; gap: 22px; margin-bottom: 24px; }
.task-hero.state-passed { border-left-color: var(--ok-dark); }
.task-hero.state-in_progress { border-left-color: rgb(var(--primary-color)); }
.task-hero.state-failed { border-left-color: var(--danger); }
.task-hero h1 { margin: 4px 0 8px; }
.task-hero p { color: var(--muted-strong); max-width: 820px; line-height: 1.55; }
.breadcrumb { display: flex; gap: 8px; color: var(--muted); font-size: 14px; }
.breadcrumb button, .task-link-line button { border: 0; background: transparent; color: inherit; padding: 0; text-decoration: underline; text-underline-offset: 2px; }
.task-overview-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 22px; align-items: start; }
.content-card, .community-card, .resource-card, .solution-card, .locked-card { background: var(--surface); border: 1px solid rgba(157,160,167,.16); border-radius: 12px; box-shadow: var(--shadow); padding: 22px; }
.side-stack { display: grid; gap: 18px; position: sticky; top: 24px; }
.statement-card { padding: 28px; }
.statement-text { white-space: pre-wrap; color: var(--muted-strong); line-height: 1.58; font-size: 16px; }
.signature-block { margin-top: 22px; }
.code, .mini-output, .raw-output { background: #101419; color: #fff; border-radius: 8px; padding: 14px; overflow: auto; font-size: 13px; line-height: 1.45; }
body:not(.dark) .code, body:not(.dark) .mini-output, body:not(.dark) .raw-output { background: #2f343c; }
.mini-output { max-height: 220px; white-space: pre-wrap; }

.solve-shell { min-height: 100vh; background: var(--bg-page); }
.solve-page { min-height: 100vh; display: grid; grid-template-rows: auto minmax(0, 1fr); }
.solve-topbar { min-height: 72px; padding: 12px 20px; display: flex; align-items: center; gap: 18px; border-bottom: 1px solid var(--line); background: var(--surface); position: sticky; top: 0; z-index: 5; }
.solve-title { flex: 1; min-width: 0; }
.solve-title strong { display: block; font-size: 20px; }
.solve-title span { color: var(--muted); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.solve-topbar .task-subnav { flex-shrink: 0; max-width: min(46vw, 520px); }
.solve-grid { --instructions-width: 42%; --output-height: 260px; --splitter-size: 10px; display: grid; grid-template-columns: minmax(320px, var(--instructions-width)) var(--splitter-size) minmax(420px, 1fr); grid-template-rows: minmax(0, 1fr); height: calc(100vh - 72px); min-height: 0; overflow: hidden; }
.instructions-pane, .editor-pane { min-width: 0; min-height: 0; background: var(--surface); }
.instructions-pane { overflow: auto; border-right: 0; padding: 0 0 24px; }
.editor-pane { display: grid; grid-template-rows: auto minmax(180px, 1fr) var(--splitter-size) minmax(140px, var(--output-height)); min-height: 0; overflow: hidden; }
.pane-head { min-height: 44px; padding: 10px 14px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 10px; color: var(--text); font-weight: 900; background: rgba(157,160,167,.06); }
.instructions-pane .statement-text { padding: 22px 26px; }
.instructions-pane .signature-block { padding: 0 26px; }
.code-editor { width: 100%; min-height: 100%; resize: none; border: 0; background: #101419; color: #fff; padding: 18px; line-height: 1.5; tab-size: 4; outline: none; font-size: 14px; }
body:not(.dark) .code-editor { background: #2f343c; }
.output-panel,
.output-pane { min-height: 0; overflow: auto; border-top: 0; background: var(--surface-2); }
.solve-splitter,
.splitter { position: relative; z-index: 10; background: var(--surface-2); border: 0; touch-action: none; transition: background .14s ease, box-shadow .14s ease; }
.solve-splitter::before,
.splitter::before { content: ""; position: absolute; border-radius: 999px; background: var(--line-strong); opacity: .72; transition: background .14s ease, opacity .14s ease, transform .14s ease; }
.solve-splitter::after,
.splitter::after { position: absolute; pointer-events: none; opacity: 0; background: #101419; color: #f5f5f5; border: 1px solid var(--line); border-radius: 6px; padding: 5px 8px; font-size: 12px; font-weight: 800; white-space: nowrap; transition: opacity .12s ease; }
.solve-splitter:hover,
.solve-splitter:focus-visible,
.splitter:hover,
.splitter:focus-visible { background: rgba(var(--primary-color), .10); outline: none; }
.solve-splitter:hover::before,
.solve-splitter:focus-visible::before,
.splitter:hover::before,
.splitter:focus-visible::before { background: rgb(var(--primary-color)); opacity: 1; }
.solve-splitter:hover::after,
.splitter:hover::after { opacity: 1; }
.splitter-columns { cursor: col-resize; border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
.splitter-columns::before { width: 4px; height: 56px; left: 50%; top: 50%; transform: translate(-50%, -50%); }
.splitter-columns::after { content: none; }
.splitter-columns:hover::before,
.splitter-columns:focus-visible::before { transform: translate(-50%, -50%) scaleY(1.08); }
.splitter-output { cursor: row-resize; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.splitter-output::before { width: 56px; height: 4px; left: 50%; top: 50%; transform: translate(-50%, -50%); }
.splitter-output::after { content: none; }
.splitter-output:hover::before,
.splitter-output:focus-visible::before { transform: translate(-50%, -50%) scaleX(1.08); }
body.is-resizing { user-select: none; }
body.is-resizing-columns,
body.is-resizing-columns * { cursor: col-resize !important; }
body.is-resizing-output,
body.is-resizing-output * { cursor: row-resize !important; }
.empty-output { color: var(--muted); padding: 20px; }
.test-output { padding: 16px; }
.verdict-line { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 12px; text-transform: capitalize; }
.verdict-line strong { color: var(--text); }
.verdict-line span { color: var(--muted); }
.test-events { display: grid; gap: 6px; }
.test-line { display: grid; grid-template-columns: 24px 1fr auto; gap: 10px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.test-line.pass span { color: var(--ok); }
.test-line.fail span { color: var(--danger); }
.test-line em { color: var(--muted); font-style: normal; font-size: 12px; }
.raw-output { margin-top: 12px; white-space: pre-wrap; max-height: 280px; }
.accepted-actions { margin-top: 14px; }
.publication-banner,
.publication-panel { border: 1px solid rgba(var(--primary-color), .35); border-radius: 12px; background: rgba(var(--primary-color), .08); padding: 18px; margin: 18px 0; }
.publication-banner { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.publication-panel { display: grid; gap: 14px; }
.publication-panel.compact { padding: 14px; }
.publication-panel label { display: grid; gap: 8px; color: var(--muted-strong); }
.publication-consent { display: flex !important; align-items: flex-start; gap: 10px; }
.publication-consent input { margin-top: 3px; }
.publication-panel button:disabled { cursor: not-allowed; opacity: .55; }

.community-card { padding: 0; overflow: hidden; }
.task-subnav { display: flex; gap: 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
.task-subnav-item { padding: 16px 18px; border: 0; background: transparent; color: var(--muted-strong); font-weight: 900; border-bottom: 3px solid transparent; white-space: nowrap; }
.task-subnav-item.active { color: var(--text); border-bottom-color: rgb(var(--primary-color)); }
.task-subnav.compact { border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.task-subnav.compact .task-subnav-item { padding: 8px 10px; font-size: 13px; border-bottom-width: 2px; }
.tab-body { padding: 24px; }
.task-section-heading { margin-bottom: 16px; }
.task-section-heading h2 { margin-top: 4px; }
.two-col-tab { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 22px; align-items: start; }
.card-list { display: grid; gap: 16px; }
.add-card { display: grid; gap: 12px; position: sticky; top: 24px; }
.resource-card h3, .solution-card h3 { margin: 0 0 6px; }
.resource-external-link { display: inline-flex; align-items: center; gap: 6px; }
.external-link-icon { font-size: .9em; line-height: 1; }
.resource-card p, .solution-card p { color: var(--muted-strong); line-height: 1.55; white-space: pre-wrap; }
.card-meta { color: var(--muted); font-size: 13px; display: flex; gap: 8px; flex-wrap: wrap; margin: 5px 0 10px; }
.vote-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.vote-btn { border: 1px solid var(--line); background: var(--surface); color: var(--muted-strong); padding: 7px 10px; border-radius: 999px; font-size: 12px; font-weight: 900; }
.vote-btn:hover { border-color: rgb(var(--primary-color)); color: var(--text); }
.vote-btn.active { border-color: rgb(var(--primary-color)); background: rgba(var(--primary-color), .14); color: var(--text); }
.solution-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 12px; }
.author { display: flex; align-items: center; gap: 10px; }
.avatar { width: 40px; height: 40px; border-radius: 999px; background: rgba(var(--primary-color), .22); display: grid; place-items: center; font-weight: 900; color: rgb(var(--primary-color-700)); }
body.dark .avatar { color: rgb(var(--primary-color-300)); }
.solution-code { margin: 12px 0 0; max-height: 520px; }
.solution-comments { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.solution-comments h4 { margin: 0 0 12px; }
.solution-comment-list { display: grid; gap: 10px; }
.solution-comment { padding: 12px; border-radius: 10px; background: rgba(157,160,167,.08); }
.solution-comment p { margin: 8px 0 0; }
.solution-comment .avatar.small { width: 30px; height: 30px; font-size: 12px; }
.solution-comment-form { display: grid; gap: 8px; margin-top: 12px; }
.solution-comment-form .btn { justify-self: start; }
.gallery-empty { display: grid; gap: 6px; }
.gallery-empty h3, .gallery-empty p { margin: 0; }
.locked-card { display: grid; justify-items: start; gap: 10px; }
.lock-mark { width: 54px; height: 54px; border-radius: 999px; display: grid; place-items: center; background: rgba(157,160,167,.14); }
.filter-row { margin-bottom: 16px; display: flex; gap: 8px; flex-wrap: wrap; }
.resource-index { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }
.task-link-line { margin-bottom: 8px; }
.empty { background: var(--surface); border: 1px dashed var(--line); border-radius: 12px; padding: 24px; color: var(--muted); }
.practice-card, .contribution-card { display: grid; gap: 14px; align-content: start; }
.practice-card .actions, .contribution-card .btn { margin-top: auto; }
.task-resources { display: grid; gap: 14px; margin-top: 28px; padding-top: 28px; border-top: 1px solid var(--line); }
.activity-section { display: grid; gap: 14px; margin-top: 28px; }
.activity-card { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 18px; align-items: center; }
.activity-card .actions { justify-content: flex-end; }

@media (max-width: 1100px) {
  :root, .theme-hive { --sidebar-width: 236px; }
  .task-list-head { display: none; }
  .task-row { grid-template-columns: 18px 1fr; gap: 12px; padding: 14px 0; }
  .task-row > span:nth-child(n+3) { grid-column: 2; }
  .task-overview-layout, .two-col-tab { grid-template-columns: 1fr; }
  .activity-card { grid-template-columns: 1fr; }
  .activity-card .actions { justify-content: flex-start; }
  .solve-topbar { flex-wrap: wrap; }
  .solve-topbar .task-subnav { order: 4; width: 100%; max-width: none; }
  .side-stack, .add-card { position: static; }
  .solve-grid { display: grid; grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); height: auto; min-height: calc(100vh - 72px); overflow: visible; }
  .splitter-columns { display: none; }
  .instructions-pane { max-height: none; border-right: 0; border-bottom: 1px solid var(--line); }
  .editor-pane { height: calc(100vh - 72px); min-height: 640px; }
}
@media (max-width: 760px) {
  :root, .theme-hive { --sidebar-width: 0px; }
  .app-shell { display: block; }
  .sidebar { width: 100%; height: auto; max-height: none; position: static; overflow: visible; }
  .main { margin-left: 0; width: 100%; padding: 22px 16px 56px; }
  .page-head, .task-hero, .solve-topbar { display: grid; }
  .publication-banner { align-items: flex-start; flex-direction: column; }
  .overview-grid { grid-template-columns: 1fr; }
  .timeline {
    --rail-x: 16px;
    --content-x: 46px;
    --node-size: 26px;
    --node-center-y: calc(var(--node-size) / 2);
    --connector-height: 7px;
    --card-accent-width: 7px;
  }
  .challenge-head { padding: 18px; }
  .challenge-title strong { font-size: 21px; }
  .solve-grid { min-height: auto; }
  .editor-pane { height: auto; min-height: 760px; grid-template-rows: auto minmax(420px, 1fr) minmax(220px, auto); }
  .splitter-output { display: none; }
  .admin-grid { grid-template-columns: 1fr; }
  .modal-backdrop { padding: 12px; }
  .modal-card { max-height: calc(100vh - 24px); padding: 20px; }
}

/* v3: richer statements and Go syntax highlighting */
.statement-text {
  white-space: normal;
  color: var(--muted-strong);
  line-height: 1.7;
  font-size: 17px;
}
.statement-rendered {
  display: grid;
  gap: 18px;
}
.statement-rendered h2,
.statement-rendered h3 {
  color: var(--text);
  letter-spacing: -.01em;
  margin: 10px 0 0;
}
.statement-rendered h2 {
  font-size: 30px;
  line-height: 1.15;
}
.statement-rendered h3 {
  font-size: 23px;
  line-height: 1.2;
}
.statement-rendered p {
  margin: 0;
  color: var(--muted-strong);
}
.statement-rendered ul,
.statement-rendered ol {
  margin: 0;
  padding-left: 26px;
  color: var(--muted-strong);
  display: grid;
  gap: 9px;
}
.statement-rendered ul { list-style: disc; }
.statement-rendered li::marker { color: var(--text); }
.statement-rendered :not(pre) > code,
.inline-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: .92em;
  color: var(--text);
  background: rgba(var(--primary-color), .10);
  border: 1px solid rgba(var(--primary-color), .22);
  border-radius: 5px;
  padding: .05rem .32rem;
}
body.dark .statement-rendered :not(pre) > code,
body.dark .inline-code {
  background: #252739;
  border-color: #363a59;
  color: #f0f1ff;
}
.statement-rendered a {
  color: rgb(var(--primary-color));
  text-decoration: underline;
  text-underline-offset: 3px;
}
.statement-rendered blockquote {
  margin: 0;
  border-left: 3px solid rgba(var(--primary-color), .45);
  padding-left: 16px;
  color: var(--muted);
}
.table-wrap,
.statement-rendered table {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
}
.statement-rendered table,
.statement-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: 15px;
}
.statement-rendered th,
.statement-rendered td,
.statement-table th,
.statement-table td {
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  padding: 12px 14px;
  text-align: left;
  vertical-align: top;
}
.statement-rendered tr:last-child td,
.statement-table tr:last-child td { border-bottom: 0; }
.statement-rendered th:last-child,
.statement-rendered td:last-child,
.statement-table th:last-child,
.statement-table td:last-child { border-right: 0; }
.statement-rendered th,
.statement-table th {
  color: var(--text);
  background: rgba(157,160,167,.12);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.statement-rendered td,
.statement-table td { color: var(--muted-strong); }
.statement-rendered pre,
.codeblock {
  border: 1px solid rgba(157,160,167,.18);
  background: #151820;
  color: #f5f7fa;
  border-radius: 8px;
  padding: 14px;
  overflow: auto;
  font-size: 14px;
  line-height: 1.62;
  tab-size: 4;
}
body:not(.dark) .statement-rendered pre,
body:not(.dark) .codeblock { background: #24282f; color: #f5f7fa; }
.statement-rendered pre code {
  color: inherit;
  background: transparent;
  border: 0;
  padding: 0;
  font-size: inherit;
}
.tok-keyword { color: #ff7b72; font-weight: 700; }
.tok-type { color: #d2a8ff; }
.tok-func { color: #79c0ff; }
.tok-string { color: #a5d6ff; }
.tok-number { color: #ffa657; }
.tok-comment { color: #8b949e; font-style: italic; }
.tok-op { color: #c9d1d9; }
.code-editor-wrap {
  position: relative;
  min-height: 0;
  height: 100%;
  background: #101419;
  overflow: hidden;
}
body:not(.dark) .code-editor-wrap { background: #24282f; }
.codemirror-host {
  position: absolute;
  inset: 0;
  display: none;
  min-width: 0;
  min-height: 0;
}
.code-editor-wrap.has-codemirror .codemirror-host {
  display: block;
}
.code-editor-wrap.has-codemirror .editor-highlight,
.code-editor-wrap.has-codemirror .code-editor {
  display: none;
}
.codemirror-host .cm-editor {
  height: 100%;
  border: 0;
}
.codemirror-host .cm-scroller {
  overflow: auto;
}
.codemirror-host .cm-focused {
  box-shadow: inset 0 0 0 3px rgba(var(--primary-color), .22);
}
.codemirror-host .cm-gutters {
  min-height: 100%;
}
.editor-highlight,
.code-editor {
  position: absolute;
  inset: 0;
  margin: 0;
  border: 0;
  width: 100%;
  height: 100%;
  padding: 18px;
  font-size: 14px;
  line-height: 1.55;
  tab-size: 4;
  white-space: pre;
  overflow: auto;
}
.editor-highlight {
  pointer-events: none;
  background: transparent;
  color: #f5f7fa;
}
.editor-highlight code { display: block; min-height: 100%; }
.code-editor {
  background: transparent;
  color: transparent;
  caret-color: #f5f7fa;
  resize: none;
  outline: none;
  -webkit-text-fill-color: transparent;
}
.code-editor::selection {
  background: rgba(var(--primary-color), .35);
  color: transparent;
}
.editor-actions {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}
.signature-block .codeblock {
  margin-top: 8px;
}
.output-panel .raw-output,
.output-pane .raw-output {
  border: 1px solid rgba(157,160,167,.16);
}
@media (max-width: 760px) {
  .statement-rendered h2 { font-size: 25px; }
  .statement-rendered h3 { font-size: 20px; }
  .statement-text { font-size: 16px; }
}
