:root {
  color-scheme: light;
  --bg: #f7faf8;
  --surface: #ffffff;
  --surface-2: #edf4ef;
  --line: #cddbd2;
  --line-strong: #9fb3a6;
  --text: #17211a;
  --muted: #5d6d62;
  --strong: #0e1711;
  --accent: #15803d;
  --accent-strong: #126c35;
  --accent-soft: #dff1e5;
  --blue: #1f5f8b;
  --amber: #8a5a00;
  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --font-code: "Cascadia Mono", "D2Coding", "Consolas", "Apple SD Gothic Neo", "Malgun Gothic", monospace;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101512;
  --surface: #171d19;
  --surface-2: #1f2a23;
  --line: #334238;
  --line-strong: #526458;
  --text: #e7eee9;
  --muted: #a9b8ae;
  --strong: #f6fbf7;
  --accent: #4ade80;
  --accent-strong: #86efac;
  --accent-soft: #20382a;
  --blue: #7db9df;
  --amber: #e3b45e;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.55;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
}

.site-shell {
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.site-header {
  position: sticky;
  z-index: 10;
  top: 0;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  min-height: 64px;
  padding: 0 32px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}

.brand-mark,
.header-actions,
.main-nav,
.hero-actions,
.site-footer,
.panel-bar {
  display: flex;
  align-items: center;
}

.brand-mark {
  gap: 10px;
  font-weight: 800;
}

.brand-glyph {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-family: var(--font-code);
  font-weight: 800;
}

.brand-name {
  color: var(--strong);
  font-size: 18px;
}

.main-nav {
  justify-content: center;
  gap: 4px;
}

.main-nav a,
.login-link {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  border-radius: 6px;
  padding: 0 12px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
}

.main-nav a:hover,
.login-link:hover {
  background: var(--surface-2);
  color: var(--strong);
}

.header-actions {
  justify-content: flex-end;
  gap: 8px;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--strong);
  cursor: pointer;
}

.icon-button:hover {
  border-color: var(--line-strong);
  background: var(--surface-2);
}

.hero-section {
  position: relative;
  min-height: min(690px, calc(100dvh - 180px));
  overflow: hidden;
  display: grid;
  align-items: center;
  border-bottom: 1px solid var(--line);
}

.hero-code {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(12, minmax(42px, 1fr));
  grid-auto-rows: minmax(42px, 1fr);
  width: min(920px, 82vw);
  height: min(560px, 62dvh);
  margin: auto 4vw auto auto;
  border: 1px solid var(--line);
  background: var(--surface);
  opacity: 0.34;
}

.code-cell {
  display: grid;
  place-items: center;
  min-width: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--font-code);
  font-size: 1.35rem;
}

.code-cell:nth-child(12n) {
  border-right: 0;
}

.code-cell:nth-last-child(-n + 12) {
  border-bottom: 0;
}

.code-cell.active {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.hero-content {
  position: relative;
  width: min(1120px, calc(100% - 48px));
  min-width: 0;
  margin: 0 auto;
  padding: 72px 0 96px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent-strong);
  font-family: var(--font-code);
  font-size: 13px;
  font-weight: 800;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  color: var(--strong);
  font-size: 5.75rem;
  line-height: 1;
  letter-spacing: 0;
}

.hero-copy {
  max-width: 640px;
  margin: 24px 0 0;
  color: var(--text);
  font-size: 1.35rem;
  line-height: 1.45;
  font-weight: 650;
}

.hero-actions {
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 32px;
}

.button {
  min-width: 0;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--strong);
  padding: 0 18px;
  font-weight: 750;
}

.button:hover {
  border-color: var(--accent);
  background: var(--surface-2);
}

.button.primary {
  border-color: var(--accent-strong);
  background: var(--accent);
  color: #ffffff;
}

:root[data-theme="dark"] .button.primary {
  color: #06210f;
}

.access-note {
  max-width: 560px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 14px;
  overflow-wrap: break-word;
}

.quick-paths,
.difference-section {
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
  padding: 72px 0;
}

.section-heading {
  max-width: 720px;
  margin-bottom: 24px;
}

.section-heading h2 {
  margin: 0;
  color: var(--strong);
  font-size: 2.25rem;
  line-height: 1.12;
  letter-spacing: 0;
}

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

.path-card {
  min-height: 224px;
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 22px;
}

.path-card:hover {
  border-color: var(--accent);
  background: var(--surface-2);
}

.path-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-family: var(--font-code);
  font-weight: 800;
}

.path-card strong {
  color: var(--strong);
  font-size: 20px;
}

.path-card span:last-child {
  color: var(--muted);
}

.difference-section {
  border-top: 1px solid var(--line);
}

.difference-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.82fr) minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
}

.code-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
}

.panel-bar {
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  border-bottom: 1px solid var(--line);
  padding: 0 14px;
  color: var(--muted);
  font-family: var(--font-code);
  font-size: 13px;
}

.code-panel pre {
  margin: 0;
  min-height: 248px;
  display: grid;
  align-items: center;
  padding: 24px;
  overflow: auto;
  color: var(--strong);
  font-family: var(--font-code);
  font-size: 2.25rem;
  line-height: 1.35;
}

.feature-list {
  display: grid;
  gap: 12px;
}

.feature-list article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 20px;
}

.feature-list h3 {
  margin: 0 0 8px;
  color: var(--strong);
  font-size: 20px;
  line-height: 1.3;
  letter-spacing: 0;
}

.feature-list p {
  margin: 0;
  color: var(--muted);
}

.spec-main {
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
}

.spec-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 340px);
  gap: 28px;
  align-items: end;
  padding: 88px 0 56px;
  border-bottom: 1px solid var(--line);
}

.spec-hero.compact {
  grid-template-columns: minmax(0, 1fr) auto;
  padding-bottom: 42px;
}

.spec-hero h1 {
  margin: 0;
  color: var(--strong);
  font-size: 4rem;
  line-height: 1.02;
  letter-spacing: 0;
}

.spec-copy {
  max-width: 720px;
  margin: 22px 0 0;
  color: var(--text);
  font-size: 1.2rem;
  line-height: 1.55;
  font-weight: 650;
}

.spec-summary {
  display: grid;
  gap: 10px;
}

.spec-summary span {
  min-height: 44px;
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--strong);
  padding: 0 14px;
  font-weight: 750;
}

.spec-home {
  padding: 56px 0 76px;
}

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

.spec-card {
  min-height: 206px;
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 22px;
}

.spec-card:hover {
  border-color: var(--accent);
  background: var(--surface-2);
}

.spec-card span {
  color: var(--accent-strong);
  font-family: var(--font-code);
  font-size: 13px;
  font-weight: 800;
}

.spec-card strong {
  color: var(--strong);
  font-size: 22px;
}

.spec-card p {
  margin: 0;
  color: var(--muted);
}

.spec-home-link {
  align-self: end;
}

.spec-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
  padding: 32px 0 76px;
}

.spec-toc {
  position: sticky;
  top: 88px;
  display: grid;
  gap: 18px;
  max-height: calc(100dvh - 112px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 14px;
}

.spec-toc-group {
  display: grid;
  gap: 4px;
}

.spec-toc-group + .spec-toc-group {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.spec-toc strong {
  margin-bottom: 6px;
  color: var(--strong);
}

.spec-toc a {
  min-height: 34px;
  display: flex;
  align-items: center;
  border-radius: 6px;
  color: var(--muted);
  padding: 0 9px;
  font-size: 14px;
  font-weight: 650;
}

.spec-toc a.section-link {
  min-height: 32px;
  padding-left: 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.spec-toc a:hover {
  background: var(--surface-2);
  color: var(--strong);
}

.spec-toc a.active {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.spec-content {
  display: grid;
  gap: 14px;
}

.spec-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 26px;
}

.spec-section h2 {
  margin: 0;
  color: var(--strong);
  font-size: 1.65rem;
  line-height: 1.18;
  letter-spacing: 0;
}

.spec-section p:not(.eyebrow) {
  margin: 14px 0 0;
  color: var(--muted);
}

.rule-grid {
  display: grid;
  grid-template-columns: minmax(88px, auto) minmax(0, 1fr);
  gap: 0;
  margin-top: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.rule-grid span,
.rule-grid strong {
  min-height: 44px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 0 14px;
}

.rule-grid span:nth-last-child(-n + 2),
.rule-grid strong:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.rule-grid span {
  border-right: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--muted);
  font-weight: 700;
}

.rule-grid strong {
  color: var(--strong);
}

.spec-section .code-panel {
  margin-top: 20px;
}

.spec-section .code-panel pre {
  min-height: 160px;
}

.spec-page-nav {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.spec-page-nav .button {
  min-height: 48px;
  width: 100%;
  padding: 0 14px;
  text-align: center;
}

.spec-nav-spacer {
  min-height: 48px;
}

.site-footer {
  justify-content: space-between;
  gap: 20px;
  min-height: 88px;
  border-top: 1px solid var(--line);
  padding: 0 32px;
  color: var(--muted);
}

.site-footer div,
.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
}

.site-footer strong {
  color: var(--strong);
}

.site-footer a {
  color: var(--muted);
}

.site-footer a:hover {
  color: var(--accent-strong);
}

.judge-main {
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
}

.judge-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 28px;
  align-items: start;
  padding: 88px 0 56px;
  border-bottom: 1px solid var(--line);
}

.judge-hero.compact {
  grid-template-columns: minmax(0, 1fr) auto;
}

.judge-hero h1,
.problem-title-row h1 {
  margin: 0;
  color: var(--strong);
  font-size: 4rem;
  line-height: 1.02;
  letter-spacing: 0;
}

.judge-copy,
.problem-summary {
  max-width: 720px;
  margin: 22px 0 0;
  color: var(--text);
  font-size: 1.2rem;
  line-height: 1.55;
  font-weight: 650;
}

.daily-panel,
.problem-description,
.problem-workbench,
.shared-editor-surface,
.problem-leaderboard,
.submission-result {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.daily-panel {
  display: grid;
  grid-template-columns: minmax(92px, auto) minmax(0, 1fr) auto;
  gap: 12px 18px;
  align-items: center;
  padding: 24px;
}

.daily-panel > span {
  color: var(--accent-strong);
  font-family: var(--font-code);
  font-size: 13px;
  font-weight: 800;
}

.daily-panel strong {
  color: var(--strong);
  font-size: 1.65rem;
  line-height: 1.2;
}

.daily-panel p {
  grid-column: 2 / 3;
  margin: 0;
  color: var(--muted);
}

.daily-actions,
.shared-editor-actions,
.problem-leaderboard-head,
.metric-tabs {
  display: flex;
  align-items: center;
}

.daily-actions {
  grid-row: 1 / span 3;
  grid-column: 3 / 4;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}

.judge-section {
  padding: 56px 0 76px;
  border-bottom: 1px solid var(--line);
}

.archive-controls {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) minmax(180px, 0.8fr);
  gap: 10px;
  margin-bottom: 14px;
}

.archive-controls label,
.shared-editor-io label {
  display: grid;
  grid-template-rows: max-content minmax(0, 1fr);
  gap: 6px;
  min-width: 0;
}

.archive-controls span,
.difficulty-range-control span,
.shared-editor-io label > span,
.sample-pair span,
.shared-editor-debug article > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.archive-controls input,
.archive-controls select {
  min-width: 0;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  padding: 0 12px;
}

.archive-controls input:focus,
.archive-controls select:focus,
.shared-editor-io textarea:focus {
  border-color: var(--accent);
  outline: none;
}

.archive-table {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.archive-head,
.archive-row {
  display: grid;
  grid-template-columns: 110px minmax(180px, 1fr) 80px 82px 96px;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
}

.archive-head {
  background: var(--surface-2);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.archive-row {
  color: var(--text);
}

.archive-row:hover {
  background: var(--surface-2);
}

.archive-row strong {
  color: var(--strong);
}

.archive-empty {
  min-height: 88px;
  display: grid;
  place-items: center;
  color: var(--muted);
}

.problem-main {
  width: min(1480px, calc(100% - 32px));
}

.problem-shell {
  display: grid;
  grid-template-columns: minmax(360px, 0.82fr) minmax(560px, 1.18fr);
  gap: 18px;
  align-items: start;
  padding: 24px 0 40px;
}

.problem-description,
.problem-workbench {
  padding: 22px;
}

.problem-title-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
}

.problem-title-row h1 {
  font-size: 2.75rem;
}

.spoiler-row {
  display: grid;
  grid-template-columns: max-content;
  gap: 8px;
  align-items: center;
  margin-top: 18px;
}

.difficulty-range-control {
  display: grid;
  align-content: center;
  grid-column: 1 / -1;
  grid-template-columns: 92px minmax(0, 1fr) 56px;
  align-items: center;
  gap: 12px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 6px 12px;
}

.difficulty-range-title {
  color: var(--strong);
  font-weight: 750;
}

.difficulty-range-control strong {
  justify-self: end;
  color: var(--accent-strong);
  font-family: var(--font-code);
  font-size: 13px;
}

.difficulty-range-slider {
  position: relative;
  width: 100%;
  min-width: 0;
  height: 34px;
}

.difficulty-range-track {
  position: absolute;
  left: 0;
  right: 0;
  top: 8px;
  height: 4px;
  border-radius: 999px;
  background:
    linear-gradient(
      to right,
      var(--line) 0 var(--range-left, 0%),
      var(--accent) var(--range-left, 0%) calc(100% - var(--range-right, 0%)),
      var(--line) calc(100% - var(--range-right, 0%)) 100%
    );
}

.difficulty-range-slider input[type="range"] {
  position: absolute;
  z-index: 2;
  top: 8px;
  left: 0;
  width: 100%;
  height: 4px;
  margin: 0;
  border: 0;
  background: transparent;
  padding: 0;
  pointer-events: none;
  appearance: none;
}

.difficulty-range-slider input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  background: transparent;
}

.difficulty-range-slider input[type="range"]::-webkit-slider-thumb {
  width: 16px;
  height: 16px;
  margin-top: -6px;
  border: 2px solid var(--surface);
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
  pointer-events: auto;
  transform: translateY(-18px);
  appearance: none;
}

.difficulty-range-slider input[type="range"]::-moz-range-track {
  height: 4px;
  background: transparent;
}

.difficulty-range-slider input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border: 2px solid var(--surface);
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
  pointer-events: auto;
  transform: translateY(-18px);
}

.difficulty-range-slider input[type="range"]:focus-visible::-webkit-slider-thumb {
  outline: 2px solid color-mix(in srgb, var(--accent) 35%, transparent);
  outline-offset: 3px;
}

.difficulty-range-scale {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 1px;
  display: flex;
  justify-content: space-between;
  padding: 0 1px;
  color: var(--muted);
  font-family: var(--font-code);
  font-size: 10px;
  line-height: 1;
  pointer-events: none;
}

.spoiler-row button,
.shared-editor-actions button {
  min-height: 36px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  color: var(--strong);
  padding: 0 12px;
  cursor: pointer;
  font-weight: 750;
}

.spoiler-row button:hover,
.shared-editor-actions button:hover {
  border-color: var(--accent);
  background: var(--surface-2);
}

.spoiler-row button[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.problem-block {
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.problem-block h2,
.problem-leaderboard h2 {
  margin: 0 0 12px;
  color: var(--strong);
  font-size: 1.35rem;
  line-height: 1.2;
}

.problem-block p {
  margin: 10px 0 0;
  color: var(--text);
}

.problem-block .katex-display,
.problem-summary .katex-display {
  overflow-x: auto;
  overflow-y: hidden;
  padding: 4px 0;
}

.plain-list {
  display: grid;
  gap: 6px;
  margin: 12px 0 0;
  padding-left: 20px;
  color: var(--text);
}

.resource-limit-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.resource-limit-grid article {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  padding: 12px;
}

.resource-limit-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.resource-limit-grid strong {
  display: block;
  margin-top: 6px;
  color: var(--strong);
  font-size: 1.05rem;
  line-height: 1.2;
}

.sample-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.sample-title-row {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.sample-title-row strong {
  color: var(--strong);
}

.sample-pair pre {
  min-height: 86px;
  margin: 6px 0 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--strong);
  padding: 10px;
  font-family: var(--font-code);
  font-size: 13px;
}

.button:disabled {
  cursor: default;
  opacity: 0.55;
}

.problem-workbench {
  display: grid;
  gap: 14px;
}

.shared-editor-surface {
  overflow: hidden;
}

.shared-editor-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 58px;
  border-bottom: 1px solid var(--line);
  padding: 10px 14px;
}

.shared-editor-toolbar strong,
.shared-editor-debug strong {
  color: var(--strong);
}

.shared-editor-toolbar span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
}

.shared-editor-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.shared-editor-actions .primary {
  border-color: var(--accent-strong);
  background: var(--accent);
  color: #ffffff;
}

:root[data-theme="dark"] .shared-editor-actions .primary {
  color: #06210f;
}

.shared-editor-workarea {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.32fr);
  gap: 14px;
  padding: 14px;
}

.shared-editor-grid-shell {
  display: grid;
  grid-template-rows: 30px minmax(0, 1fr);
  min-width: 0;
}

.shared-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-family: var(--font-code);
  font-size: 12px;
}

.shared-editor-canvas-wrap {
  position: relative;
  min-width: 0;
  height: clamp(360px, 52vh, 620px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
  overscroll-behavior: contain;
}

.shared-editor-canvas-wrap.input-focus,
.shared-editor-canvas-wrap:focus-within {
  border-color: var(--accent);
}

.shared-editor-canvas-space {
  position: relative;
  min-width: 100%;
  min-height: 100%;
}

.shared-editor-canvas {
  display: block;
  position: absolute;
  left: 0;
  top: 0;
  min-height: 0;
  outline: none;
  background: var(--surface-2);
  cursor: crosshair;
}

.shared-editor-ime {
  position: fixed;
  z-index: 10;
  width: 24px;
  height: 24px;
  min-width: 1px;
  min-height: 1px;
  padding: 0;
  border: 0;
  border-radius: 0;
  outline: 0;
  opacity: 0;
  transform: scale(0.0001);
  transform-origin: 2px 2px;
  background: transparent;
  color: transparent;
  caret-color: transparent;
  font-family: var(--font-ui);
  resize: none;
  overflow: hidden;
  pointer-events: none;
}

.shared-editor-io {
  display: grid;
  grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  min-width: 0;
}

.shared-editor-io textarea {
  width: 100%;
  min-width: 0;
  height: 100%;
  min-height: 150px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--strong);
  padding: 12px;
  font-family: var(--font-code);
  font-size: 14px;
  line-height: 1.5;
}

.shared-editor-debug {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line);
}

.shared-editor-debug article {
  min-width: 0;
  border-right: 1px solid var(--line);
  padding: 12px;
}

.shared-editor-debug article:last-child {
  border-right: 0;
}

.shared-editor-debug strong {
  display: block;
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.submission-result {
  display: grid;
  gap: 4px;
  padding: 14px;
  color: var(--muted);
}

.submission-result.accepted {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.submission-result.failed {
  border-color: var(--amber);
  color: var(--amber);
}

.submission-result strong {
  color: var(--strong);
}

.submission-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.submission-share-error {
  color: var(--amber);
}

.share-verifier {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-top: 1px solid var(--line);
}

.share-verifier.standalone {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.share-verifier h2 {
  margin: 0;
  font-size: 15px;
}

.share-verifier p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.share-verifier-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: stretch;
}

.share-verifier-form textarea {
  min-height: 74px;
  resize: vertical;
  font-family: var(--font-code);
  font-size: 12px;
}

.share-verifier-result {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 13px;
}

.share-verifier-result strong {
  color: var(--strong);
}

.share-verifier-result dl {
  display: grid;
  gap: 5px;
  margin: 0;
}

.share-verifier-result dl div {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 8px;
}

.share-verifier-result dt {
  color: var(--muted);
}

.share-verifier-result dd {
  margin: 0;
  color: var(--strong);
  overflow-wrap: anywhere;
}

.verify-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.verify-entry h2 {
  margin: 0;
  font-size: 20px;
}

.verify-entry p:not(.eyebrow) {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.problem-leaderboard {
  padding: 16px;
}

.problem-leaderboard-head {
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.problem-leaderboard-head p {
  margin: -6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.metric-tabs {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.metric-tabs button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--muted);
  padding: 0 10px;
  cursor: pointer;
}

.metric-tabs button.active,
.metric-tabs button:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.histogram-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.performance-picker {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
}

.performance-picker select {
  min-width: 0;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  padding: 0 10px;
}

.histogram-card,
.leaderboard-locked {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.histogram-card {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.histogram-card header {
  display: grid;
  gap: 2px;
}

.histogram-card header span,
.histogram-card header small,
.histogram-summary,
.histogram-own,
.histogram-scale {
  color: var(--muted);
  font-size: 12px;
}

.histogram-card header small {
  color: var(--blue);
  font-weight: 800;
}

.histogram-card header strong {
  color: var(--strong);
  font-size: 1.05rem;
}

.histogram-bars {
  position: relative;
  height: 132px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
  padding: 10px;
}

.histogram-plot {
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--bucket-count), minmax(0, 1fr));
  align-items: end;
  gap: 3px;
  width: 100%;
  height: 100%;
}

.histogram-bar {
  min-width: 0;
  height: calc(var(--bar) * 1%);
  border: 1px solid var(--accent-strong);
  border-radius: 3px 3px 0 0;
  background: var(--accent-soft);
}

.histogram-bar.empty {
  border-color: transparent;
  background: transparent;
}

.histogram-marker {
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(var(--marker) * 1%);
  width: 2px;
  background: var(--amber);
  transform: translateX(-1px);
}

.histogram-marker.best {
  width: 3px;
  background: var(--blue);
  transform: translateX(-1.5px);
}

.histogram-marker.selected {
  background: var(--amber);
}

.histogram-marker::before {
  content: "";
  position: absolute;
  top: -4px;
  left: 50%;
  width: 8px;
  height: 8px;
  border: 2px solid var(--amber);
  border-radius: 50%;
  background: var(--surface);
  transform: translateX(-50%);
}

.histogram-marker.best::before {
  border-color: var(--blue);
}

.histogram-scale {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-family: var(--font-code);
}

.histogram-summary,
.histogram-own {
  margin: 0;
}

.histogram-own {
  color: var(--amber);
  font-weight: 800;
}

.histogram-ranks {
  display: grid;
  gap: 6px;
  margin: 2px 0 0;
  padding: 0;
  list-style: none;
}

.histogram-ranks li {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 30px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.histogram-ranks li:first-child {
  border-top: 0;
}

.histogram-ranks span {
  color: var(--accent-strong);
  font-family: var(--font-code);
  font-weight: 800;
}

.histogram-ranks strong {
  overflow: hidden;
  color: var(--strong);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.histogram-ranks em {
  color: var(--muted);
  font-style: normal;
  font-family: var(--font-code);
}

.leaderboard-locked {
  display: grid;
  gap: 6px;
  min-height: 132px;
  align-content: center;
  padding: 20px;
}

.leaderboard-locked strong {
  color: var(--strong);
  font-size: 1.1rem;
}

.leaderboard-locked p {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
}

.leaderboard-list,
.global-board {
  display: grid;
  gap: 10px;
}

.leaderboard-entry,
.global-board article {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) minmax(0, 1.5fr);
  gap: 12px;
  align-items: center;
  min-height: 56px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 0 14px;
}

.leaderboard-entry span,
.global-board span {
  color: var(--accent-strong);
  font-family: var(--font-code);
  font-weight: 800;
}

.leaderboard-entry strong,
.global-board strong {
  color: var(--strong);
}

.leaderboard-entry p,
.global-board p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.editor-page {
  width: calc(100% - 32px);
  max-width: 2560px;
  margin: 0 auto;
}

.editor-hero {
  padding: 34px 0 18px;
}

.editor-hero h1 {
  margin: 0;
  color: var(--strong);
  font-size: 2.85rem;
  line-height: 1.05;
  letter-spacing: 0;
}

.editor-shell {
  display: grid;
  grid-template-columns: clamp(260px, 16vw, 360px) minmax(620px, 1fr) clamp(320px, 19vw, 440px);
  gap: 14px;
  align-items: stretch;
  min-height: calc(100dvh - 180px);
  padding-bottom: 34px;
}

.editor-sidebar,
.editor-debug-panel,
.editor-workbench {
  min-width: 0;
}

.editor-sidebar,
.editor-debug-panel {
  display: grid;
  grid-template-rows: minmax(220px, 1fr) auto;
  align-content: stretch;
  gap: 12px;
}

.editor-debug-panel {
  grid-template-rows: auto auto auto minmax(0, 1fr);
}

.editor-panel {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 14px;
}

.editor-panel.compact {
  display: grid;
  gap: 8px;
}

.editor-panel.trace {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
  max-height: none;
  overflow: hidden;
}

.editor-panel-title-row,
.editor-run-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.editor-explorer {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
}

.editor-explorer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 40px;
  border-bottom: 1px solid var(--line);
  padding: 0 10px 0 14px;
}

.editor-explorer-head span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.editor-explorer-actions {
  display: flex;
  gap: 4px;
}

.editor-tree-root {
  padding: 8px 0 12px;
}

.editor-tree-folder {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  min-height: 30px;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 0 12px;
  text-align: left;
  cursor: pointer;
}

.editor-tree-folder strong {
  color: var(--strong);
  font-size: 12px;
  letter-spacing: 0.04em;
}

.editor-panel-title {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.editor-panel-title-row .editor-panel-title {
  margin-bottom: 0;
}

.editor-icon-button,
.editor-file-more,
.editor-file-open {
  cursor: pointer;
}

.editor-icon-button {
  width: 28px;
  height: 28px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: var(--surface-2);
  color: var(--strong);
  font-weight: 850;
}

.editor-icon-button:hover,
.editor-file-row:hover {
  border-color: var(--accent);
  background: var(--surface-2);
}

.editor-file-list {
  display: grid;
  gap: 1px;
}

.editor-file-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  gap: 4px;
  align-items: center;
  min-height: 46px;
  border: 1px solid transparent;
  border-left: 3px solid transparent;
  background: transparent;
  padding: 0 8px 0 18px;
}

.editor-file-row.active {
  border-color: var(--line);
  border-left-color: var(--accent);
  background: color-mix(in srgb, var(--accent-soft) 72%, transparent);
}

.editor-file-row.renaming {
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 8px;
  padding-right: 10px;
}

.editor-file-open {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-width: 0;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  text-align: left;
}

.editor-file-icon {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-family: var(--font-code);
  font-size: 11px;
  font-weight: 900;
}

.editor-file-text {
  min-width: 0;
}

.editor-file-open strong {
  display: block;
  overflow: hidden;
  color: var(--strong);
  font-size: 13px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.editor-file-open small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-family: var(--font-code);
  font-size: 11px;
  line-height: 1.25;
}

.editor-file-more {
  width: 26px;
  height: 26px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  opacity: 0;
  transition: opacity 120ms ease;
}

.editor-file-row:hover .editor-file-more,
.editor-file-row:focus-within .editor-file-more {
  opacity: 1;
}

.editor-file-more:hover,
.editor-file-more:focus-visible {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--strong);
  outline: none;
}

.editor-file-rename-input {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  color: var(--strong);
  padding: 4px 7px;
  font: 13px var(--font-code);
}

.editor-file-rename-input:focus {
  border-color: var(--accent);
  outline: 2px solid color-mix(in srgb, var(--accent) 20%, transparent);
}

.editor-delete-confirm {
  margin: 10px;
  border: 1px solid var(--amber);
  border-radius: 7px;
  background: color-mix(in srgb, var(--surface) 86%, var(--amber));
  padding: 10px;
}

.editor-delete-confirm span {
  display: block;
  color: var(--strong);
  font-size: 13px;
  line-height: 1.35;
}

.editor-delete-confirm div {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 9px;
}

.editor-delete-confirm button,
.editor-context-menu button {
  cursor: pointer;
}

.editor-delete-confirm button {
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  color: var(--strong);
  padding: 0 9px;
  font-size: 12px;
  font-weight: 750;
}

.editor-delete-confirm [data-action="delete"] {
  border-color: var(--amber);
  color: var(--amber);
}

.editor-context-menu {
  position: fixed;
  z-index: 100;
  min-width: 168px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--surface);
  box-shadow: 0 16px 42px rgba(14, 23, 17, 0.16);
  padding: 6px;
}

.editor-context-menu button {
  display: block;
  width: 100%;
  min-height: 32px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--text);
  padding: 0 10px;
  text-align: left;
  font-size: 13px;
}

.editor-context-menu button:hover,
.editor-context-menu button:focus-visible {
  background: var(--accent-soft);
  color: var(--strong);
  outline: none;
}

.editor-shortcut-row {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}

.editor-shortcut-row kbd {
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-2);
  color: var(--strong);
  padding: 2px 6px;
  font-family: var(--font-code);
  font-size: 11px;
}

.editor-workbench .shared-editor-surface {
  min-height: 100%;
}

.editor-workbench .shared-editor-workarea {
  grid-template-columns: minmax(0, 1fr) clamp(260px, 24%, 420px);
}

.editor-workbench .shared-editor-canvas-wrap {
  min-height: 520px;
  height: max(520px, calc(100dvh - 330px));
}

@media (min-width: 1800px) {
  .editor-page {
    width: calc(100% - 48px);
    max-width: none;
  }

  .editor-shell {
    grid-template-columns: clamp(300px, 15vw, 420px) minmax(900px, 1fr) clamp(360px, 18vw, 520px);
    gap: 18px;
  }

  .editor-workbench .shared-editor-workarea {
    grid-template-columns: minmax(0, 1fr) clamp(340px, 22%, 520px);
  }
}

.editor-run-controls {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  justify-content: stretch;
  margin-top: 4px;
}

.editor-run-controls .button {
  width: 100%;
}

.editor-number-field {
  display: grid;
  gap: 6px;
  margin-top: 12px;
}

.editor-number-field span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.editor-number-field input {
  min-height: 38px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--strong);
  padding: 0 10px;
  font-family: var(--font-code);
}

.editor-number-field input:focus {
  border-color: var(--accent);
  outline: none;
}

.editor-stat-grid {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 8px 10px;
  align-items: center;
}

.editor-stat-grid span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.editor-stat-grid strong,
.editor-debug-text {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--strong);
  font-family: var(--font-code);
  font-size: 13px;
}

.editor-debug-text {
  line-height: 1.55;
}

.editor-trace-list {
  display: grid;
  align-content: start;
  gap: 6px;
  min-height: 0;
  height: 100%;
  overflow: auto;
  padding-right: 2px;
  color: var(--muted);
  font-size: 13px;
  overscroll-behavior: contain;
}

.editor-trace-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
  padding: 8px;
}

.editor-trace-row.current {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent-soft) 78%, var(--surface));
}

.editor-trace-row span {
  color: var(--muted);
  font-family: var(--font-code);
  font-size: 12px;
}

.editor-trace-row strong {
  min-width: 0;
  color: var(--strong);
  font-size: 13px;
}

@media (max-width: 820px) {
  .site-header {
    grid-template-columns: 1fr auto;
    gap: 12px;
    min-height: 60px;
    padding: 0 18px;
  }

  .main-nav {
    order: 3;
    grid-column: 1 / -1;
    justify-content: flex-start;
    padding-bottom: 10px;
    overflow-x: auto;
  }

  .login-link {
    display: none;
  }

  .hero-section {
    min-height: 560px;
    align-items: start;
  }

  .hero-code {
    inset: auto 0 0;
    width: calc(100% - 28px);
    height: 210px;
    margin: 0 auto 24px;
    grid-template-columns: repeat(8, minmax(34px, 1fr));
    opacity: 0.46;
  }

  .hero-content {
    width: min(100% - 36px, 560px);
    padding: 40px 0 240px;
  }

  .hero-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
  }

  .button {
    width: 100%;
    padding: 0 12px;
    white-space: nowrap;
  }

  .button.primary {
    grid-column: 1 / -1;
  }

  .share-verifier-form {
    grid-template-columns: 1fr;
  }

  .verify-entry {
    grid-template-columns: 1fr;
  }

  .quick-paths,
  .difference-section,
  .spec-main,
  .judge-main,
  .problem-main,
  .editor-page {
    width: min(100% - 36px, 560px);
  }

  .quick-paths,
  .difference-section {
    padding: 56px 0;
  }

  .path-grid,
  .difference-layout {
    grid-template-columns: 1fr;
  }

  .path-card {
    min-height: 184px;
  }

  .site-footer {
    display: grid;
    align-items: center;
    padding: 24px 18px;
  }

  .spec-hero {
    grid-template-columns: 1fr;
    gap: 22px;
    padding: 52px 0 36px;
  }

  h1 {
    font-size: 4.25rem;
  }

  .section-heading h2 {
    font-size: 2rem;
  }

  .spec-hero h1 {
    font-size: 3.25rem;
  }

  .spec-section h2 {
    font-size: 1.5rem;
  }

  .spec-hero.compact {
    grid-template-columns: 1fr;
  }

  .spec-summary {
    grid-template-columns: 1fr;
  }

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

  .spec-card {
    min-height: 168px;
  }

  .spec-home-link {
    width: 100%;
  }

  .spec-layout {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 24px 0 56px;
  }

  .spec-toc {
    position: static;
  }

  .spec-section {
    padding: 22px;
  }

  .spec-page-nav {
    grid-template-columns: 1fr;
  }

  .spec-nav-spacer {
    display: none;
  }

  .judge-hero,
  .judge-hero.compact {
    grid-template-columns: 1fr;
    gap: 22px;
    padding: 52px 0 36px;
  }

  .judge-hero h1 {
    font-size: 3.25rem;
  }

  .archive-controls,
  .problem-shell,
  .editor-shell,
  .daily-panel,
  .resource-limit-grid,
  .shared-editor-workarea,
  .sample-pair {
    grid-template-columns: 1fr;
  }

  .difficulty-range-control {
    grid-template-columns: 1fr;
    gap: 6px;
    overflow: hidden;
  }

  .difficulty-range-control strong {
    justify-self: start;
  }

  .difficulty-range-slider {
    width: calc(100% - 14px);
    margin: 0 7px;
  }

  .daily-panel p,
  .daily-actions {
    grid-column: auto;
    grid-row: auto;
  }

  .daily-actions {
    justify-content: stretch;
  }

  .archive-head {
    display: none;
  }

  .archive-row {
    grid-template-columns: 1fr;
    gap: 6px;
    align-items: start;
    padding: 14px;
  }

  .problem-title-row,
  .spoiler-row {
    grid-template-columns: 1fr;
  }

  .problem-title-row h1 {
    font-size: 2.2rem;
  }

  .shared-editor-toolbar,
  .problem-leaderboard-head {
    display: grid;
  }

  .shared-editor-actions,
  .metric-tabs {
    justify-content: stretch;
  }

  .shared-editor-actions button,
  .metric-tabs button {
    flex: 1 1 120px;
  }

  .shared-editor-canvas-wrap {
    height: 360px;
  }

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

  .shared-editor-debug {
    grid-template-columns: 1fr;
  }

  .shared-editor-debug article {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .shared-editor-debug article:last-child {
    border-bottom: 0;
  }

  .editor-hero {
    padding: 28px 0 16px;
  }

  .editor-hero h1 {
    font-size: 2.4rem;
  }

  .editor-workbench .shared-editor-canvas-wrap {
    height: 420px;
  }

  .editor-file-row {
    grid-template-columns: 1fr;
    min-height: auto;
    padding: 8px 10px;
  }

  .editor-file-more {
    opacity: 1;
  }

  .leaderboard-entry,
  .global-board article {
    grid-template-columns: 56px minmax(0, 1fr);
    padding: 12px 14px;
  }

  .leaderboard-entry p,
  .global-board p {
    grid-column: 1 / -1;
  }
}

@media (max-width: 440px) {
  .brand-name {
    display: none;
  }

  h1 {
    font-size: 3.4rem;
  }

  .section-heading h2 {
    font-size: 1.8rem;
  }

  .spec-hero h1 {
    font-size: 2.75rem;
  }

  .judge-hero h1 {
    font-size: 2.75rem;
  }

  .spec-section h2 {
    font-size: 1.35rem;
  }

  .hero-copy {
    font-size: 1.05rem;
  }

  .code-panel pre {
    font-size: 1.5rem;
  }
}
