:root {
  color-scheme: light;
  --ink: #1c2130;
  --muted: #576174;
  --blue: #285bd1;
  --line: #e2e6ed;
  --surface: #fff;
  --text-small: 0.875rem;
  font-family:
    -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: #f6f7fa;
  color: var(--ink);
  line-height: 1.6;
  font-size: 1rem;
}
a {
  color: inherit;
  text-decoration: none;
}
button,
input,
textarea {
  font: inherit;
}
button,
a {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
}
:focus-visible {
  outline: 3px solid #546ee6;
  outline-offset: 4px;
}
[hidden] {
  display: none !important;
}
.frame {
  width: min(1120px, calc(100% - 80px));
  margin-inline: auto;
}
.skip {
  position: absolute;
  z-index: 9;
  left: 12px;
  top: -80px;
  background: white;
  padding: 10px 18px;
  border-radius: 9px;
}
.skip:focus {
  top: 4px;
}
.topbar {
  background: rgba(255, 255, 255, 0.86);
  border-bottom: 1px solid #e3e6ed;
  backdrop-filter: blur(18px);
}
.navwrap,
.brand,
.footer,
.footer > span,
.actions,
.button,
.text-link,
.card-top,
.section-title,
.metas,
.card-link,
.badge,
.stats,
.progress-tag,
.work-heading,
.editor-title,
.editor-limits,
.submit-actions,
.result-box,
.admin-heading,
.image-state {
  display: flex;
  align-items: center;
}
.navwrap {
  min-height: 66px;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 12px;
}
.brand {
  white-space: nowrap;
  gap: 10px;
  font-size: 19px;
  font-weight: 720;
  letter-spacing: -0.04em;
}
.brand-mark {
  position: relative;
  display: inline-block;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: linear-gradient(145deg, #7788fe 0%, #4966e0 48%, #4e43af 100%);
  box-shadow:
    inset 0 1px 2px #ffffff95,
    0 2px 5px #3c50a92c;
  flex: none;
}
.brand-mark::before,
.brand-mark::after {
  content: '';
  position: absolute;
  inset: 19%;
}
.brand-mark::before {
  background:
    repeating-linear-gradient(90deg, #dfeaff 0 8%, transparent 8% 23%) center / 64% 100% no-repeat,
    repeating-linear-gradient(0deg, #dfeaff 0 8%, transparent 8% 23%) center / 100% 64% no-repeat;
}
.brand-mark::after {
  inset: 29%;
  border: 1px solid #fff;
  border-radius: 22%;
  background: linear-gradient(145deg, #b5cfff, #637de4);
}
.home {
  padding-top: 29px;
}
.hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  border-radius: 30px;
  background:
    radial-gradient(ellipse at 92% 2%, #cad8fd 0%, transparent 46%),
    radial-gradient(ellipse at 83% 100%, #d9d6fa 0%, transparent 50%),
    linear-gradient(110deg, #fafcff 0%, #f3f6ff 44%, #e4eaff 73%, #d8e4fd 100%);
  border: 1px solid #dbe1f0;
  box-shadow:
    inset 0 1px 2px #ffffffd4,
    0 5px 22px #46518e07;
}
.hero-copy {
  width: 57%;
  position: relative;
  z-index: 2;
  padding: clamp(32px, 4.2vw, 61px) 0 clamp(35px, 4.1vw, 59px) clamp(28px, 4.7vw, 66px);
}
.stage-kicker,
.stats-prefix,
.source-bar,
.language {
  font-weight: 660;
  letter-spacing: 0.035em;
}
.hero h1 {
  max-width: 7em;
  word-break: keep-all;
  color: #4854b9;
  margin: 0 0 14px;
  font-size: clamp(40px, 4.35vw, 64px);
  letter-spacing: -0.065em;
  line-height: 1.13;
  font-weight: 750;
}
.hero h1::first-line {
  color: var(--ink);
}
.hero-copy > p {
  color: #505c70;
  max-width: 436px;
  margin: 0;
  font-size: 1rem;
  line-height: 1.85;
}
.actions {
  margin-top: 24px;
  gap: 22px;
  flex-wrap: wrap;
}
.button {
  display: inline-flex;
  justify-content: center;
  gap: 13px;
  min-height: 43px;
  padding: 10px 21px;
  border: 1px solid #305bd4;
  font-size: 1rem;
  font-weight: 630;
  border-radius: 24px;
  line-height: 1.4;
  transition:
    background 0.15s,
    transform 0.15s,
    box-shadow 0.15s;
}
.primary {
  background: linear-gradient(160deg, #4275e7, #305bd4 75%);
  color: #fff;
  box-shadow:
    inset 0 1px 1px #ffffff48,
    0 3px 7px #315ace2b;
}
.primary:hover {
  background: #244fc1;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px #315ace34;
}
.primary:disabled {
  opacity: 0.65;
  transform: none;
  cursor: wait;
}
.text-link,
.card-link,
.plain,
.work-page > .back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 16px;
  border: 1px solid #6c85bf;
  border-radius: 24px;
  background: #fff;
  color: var(--blue);
  font-weight: 610;
  line-height: 1.4;
  white-space: nowrap;
}
.text-link:hover,
.card-link:hover,
.plain:hover,
.work-page > .back:hover {
  border-color: var(--blue);
  background: #edf2ff;
}
.history a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.arrow {
  display: inline-block;
  width: 13px;
  height: 10px;
  position: relative;
  flex: none;
}
.arrow:before,
.arrow:after {
  content: '';
  position: absolute;
}
.arrow:before {
  width: 12px;
  height: 1.5px;
  background: currentColor;
  top: 4px;
  left: 0;
}
.arrow:after {
  width: 6.5px;
  height: 6.5px;
  border: solid currentColor;
  border-width: 1.5px 1.5px 0 0;
  right: 1px;
  top: 1px;
  transform: rotate(45deg);
}
.ai-art {
  position: absolute;
  inset: 0 0 0 auto;
  width: 52%;
  pointer-events: none;
}
.ai-art img {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
@media (prefers-reduced-motion: no-preference) {
  .ai-art::after {
    content: '';
    position: absolute;
    inset: 0;
    background: url('ai-chip-flow.webp') center / contain no-repeat;
  }
}
.stats {
  gap: 15px;
  background: #ffffffd9;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 15px 23px;
  margin: 16px 0 31px;
  box-shadow: 0 2px 8px #28315703;
}
.stat-icon {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  width: 39px;
  height: 39px;
  padding: 10px 9px;
  background: #eef2ff;
  border: 1px solid #e1e7ff;
  border-radius: 12px;
  flex: none;
}
.stat-icon i {
  width: 4px;
  height: 43%;
  border-radius: 3px;
  background: #7c90e7;
}
.stat-icon i:nth-child(2) {
  height: 71%;
  background: #657de1;
}
.stat-icon i:nth-child(3) {
  height: 100%;
  background: #5071d8;
}
.stats-prefix {
  color: #505c70;
  font-size: var(--text-small);
  display: block;
  line-height: 1.35;
  margin-bottom: 2px;
}
.stats p {
  margin: 0;
  color: #545d6e;
  font-size: 1rem;
  line-height: 1.55;
}
.stats strong {
  color: #2f4593;
  font-weight: 730;
  font-size: 18px;
  line-height: 1;
}
.stages {
  scroll-margin-top: 20px;
}
.section-title {
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 15px;
}
.section-title h2,
.panel h2 {
  margin: 0;
  font-size: 25px;
  font-weight: 720;
  letter-spacing: -0.045em;
  line-height: 1.4;
}
.progress-tag {
  font-size: var(--text-small);
  color: #646f81;
  gap: 9px;
}
.progress-tag strong {
  font-variant-numeric: tabular-nums;
  color: #414a5c;
}
.progress-bars {
  position: relative;
  width: 38px;
  height: 5px;
  background: linear-gradient(to right, #d8dde8 0 46%, transparent 46% 54%, #d8dde8 54%);
  border-radius: 8px;
}
.progress-bars.p1 {
  background: linear-gradient(to right, #657bd9 0 46%, transparent 46% 54%, #d8dde8 54%);
}
.progress-bars.p2 {
  background: linear-gradient(to right, #657bd9 0 46%, transparent 46% 54%, #657bd9 54%);
}
.cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.stage-card,
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 3px 10px #35416b06;
}
.stage-card {
  padding: 24px 25px 17px;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.card-top {
  justify-content: space-between;
  margin-bottom: 14px;
}
.tile {
  position: relative;
  display: inline-block;
  width: 46px;
  aspect-ratio: 1;
  border-radius: 14px;
  flex: none;
  box-shadow:
    inset 0 1px 2px #ffffff75,
    0 3px 8px #607ac824;
  overflow: hidden;
}
.tile-1 {
  background: linear-gradient(150deg, #92c6ff 1%, #628ee7 52%, #4b75cf 98%);
}
.tile-1 i,
.tile-1 b {
  position: absolute;
  width: 49%;
  height: 31%;
  border: 1.7px solid #fff;
  border-radius: 4px;
  background: #ffffff1a;
  transform: skewY(-8deg);
}
.tile-1 i {
  left: 20%;
  top: 30%;
  opacity: 0.7;
}
.tile-1 b {
  left: 34%;
  top: 43%;
  background: #c7e3ffa8;
}
.tile-2 {
  background: linear-gradient(140deg, #b3a3f1, #9082db 58%, #7766be);
}
.tile-2 i,
.tile-2 b,
.tile-2 u {
  position: absolute;
  width: 7px;
  height: 7px;
  background: #fff;
  border-radius: 3px;
  z-index: 1;
}
.tile-2 i {
  top: 27%;
  left: 23%;
}
.tile-2 b {
  top: 56%;
  left: 45%;
}
.tile-2 u {
  top: 24%;
  right: 19%;
}
.tile-2:before,
.tile-2:after {
  content: '';
  position: absolute;
  width: 2px;
  height: 38%;
  background: #f4f0fc;
  transform-origin: top center;
  top: 33%;
}
.tile-2:before {
  left: 28%;
  transform: rotate(-36deg);
}
.tile-2:after {
  left: 73%;
  transform: rotate(39deg);
  top: 31%;
}
.badge {
  font-size: var(--text-small);
  line-height: 1.5;
  letter-spacing: 0.02em;
  gap: 6px;
  border-radius: 999px;
  padding: 4px 10px;
  font-weight: 610;
}
.badge.ready {
  background: #edf2ff;
  color: #3757a7;
}
.badge.ok {
  background: #e6f6ef;
  color: #207153;
}
.badge.muted {
  background: #f0f1f5;
  color: #626b79;
}
.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.lock {
  position: relative;
  display: inline-block;
  width: 10px;
  height: 8px;
  border: 1.3px solid currentColor;
  border-radius: 2px;
  margin-top: 3px;
}
.lock:before {
  content: '';
  position: absolute;
  width: 5.5px;
  height: 5px;
  left: 50%;
  bottom: calc(100% - 1px);
  transform: translateX(-50%);
  border: 1.3px solid currentColor;
  border-bottom: 0;
  border-radius: 5px 5px 0 0;
}
.stage-kicker {
  font-size: var(--text-small);
  color: #596b99;
  letter-spacing: 0.065em;
}
.stage-kicker span {
  color: #a2aaba;
  margin-inline: 2px;
}
.stage-2 .stage-kicker {
  color: #75679c;
}
.stage-card h3 {
  margin: 5px 0 6px;
  color: #202535;
  font-size: 24px;
  line-height: 1.4;
  letter-spacing: -0.04em;
}
.stage-card > p {
  font-size: 1rem;
  color: var(--muted);
  margin: 0 0 18px;
  line-height: 1.75;
  flex: 1;
}
.card-bottom {
  border-top: 1px solid #eaecf2;
  padding-top: 13px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.metas {
  gap: 0;
  font-size: var(--text-small);
  color: #5b6679;
}
.editor-limits span + span:before {
  content: '·';
  margin: 0 7px;
  color: #a4acbc;
}
.card-link,
.locked-hint {
  font-size: var(--text-small);
}
.locked-hint {
  color: #586377;
}
.footer {
  justify-content: center;
  gap: 12px;
  min-height: 70px;
  margin-top: 25px;
  border-top: 1px solid var(--line);
  font-size: var(--text-small);
  color: #606b7d;
}
.footer > span {
  gap: 7px;
}
.brand-mark.small {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  filter: grayscale(0.7);
  opacity: 0.7;
}
.work-page {
  padding-block: 26px 5px;
}
.work-page > .back {
  font-size: var(--text-small);
}
.small-text {
  font-size: var(--text-small);
  color: #657085;
}
.work-heading {
  gap: 15px;
  margin: 21px 0;
}
.work-heading h1,
.center-card h1,
.admin-card h1 {
  letter-spacing: -0.055em;
  line-height: 1.25;
  font-size: clamp(28px, 3vw, 39px);
  margin: 4px 0 0;
}
.work-heading .tile {
  width: 52px;
  border-radius: 16px;
}
.work-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.89fr) minmax(0, 1.11fr);
  gap: 18px;
  align-items: start;
}
.panel {
  min-width: 0;
  padding: 25px;
}
.panel h2 {
  font-size: 21px;
}
.panel h3 {
  font-size: 1rem;
  margin: 22px 0 4px;
}
.statement p {
  margin: 8px 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.85;
}
.sample {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid #e1e6f1;
  border-radius: 12px;
  overflow: hidden;
  background: #f6f8fe;
  margin-top: 18px;
}
.sample > div {
  padding: 10px 13px;
}
.sample > div + div {
  border-left: 1px solid #e1e6f1;
}
.sample span,
.source-bar {
  font-size: var(--text-small);
  color: #596780;
}
.sample pre,
.diagnostic {
  margin: 7px 0 0;
  font-family: ui-monospace, Consolas, monospace;
  line-height: 1.55;
}
.statement .sample-note {
  font-size: var(--text-small);
}
.editor-title {
  justify-content: space-between;
}
.language {
  font-size: var(--text-small);
  color: #90e8c3;
  background: #163930;
  border: 1px solid #366b58;
  padding: 1px 7px;
  border-radius: 5px;
}
.editor-limits {
  flex-wrap: wrap;
  margin: 10px 0 14px;
  font-size: var(--text-small);
  color: #657086;
}
.source-wrap {
  --code-bg: #232631;
  --code-text: #edf0fa;
  --code-font: Consolas, "SFMono-Regular", "Liberation Mono", "Microsoft YaHei", monospace;
  color-scheme: dark;
  border-radius: 13px;
  overflow: hidden;
  border: 1px solid #363b4b;
  background: var(--code-bg);
}
.source-wrap:focus-within {
  border-color: #8daafb;
  box-shadow: 0 0 0 3px #6f90f01c;
}
.source-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 8px;
  padding: 9px 12px;
  border-bottom: 1px solid #393f50;
  background: #171a22;
  color: #b3bfd3;
  font-family: var(--code-font);
  font-weight: 500;
  letter-spacing: 0;
}
.source-file {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #e2e8f4;
}
.source-bar .over {
  color: #ff9d9d;
}
#source {
  display: block;
  width: 100%;
  min-height: 290px;
  border: 0;
  resize: vertical;
  background: transparent;
  color: var(--code-text);
  outline: none;
  padding: 14px 15px;
  font: 1rem/1.55 var(--code-font);
  tab-size: 4;
  white-space: pre;
  overflow: auto;
}
.cm-s-opc.CodeMirror {
  height: clamp(18rem, 48vh, 26rem);
  background: var(--code-bg);
  color: var(--code-text);
  font: 1rem/1.55 var(--code-font);
}
.cm-s-opc .CodeMirror-lines { padding: 10px 0 16px; }
.cm-s-opc pre.CodeMirror-line, .cm-s-opc pre.CodeMirror-line-like { padding-inline: 9px; }
.cm-s-opc .CodeMirror-gutters {
  background: #20232d;
  border-color: #353a48;
}
.cm-s-opc .CodeMirror-linenumber {
  color: #98a7b8;
  padding-inline: 5px 7px;
}
.cm-s-opc .CodeMirror-cursor { border-color: #fff; }
.cm-s-opc .CodeMirror-selected { background: #414d69; }
.cm-s-opc.CodeMirror-focused .CodeMirror-selected { background: #435b83; }
.cm-s-opc span.CodeMirror-matchingbracket { color: #fff; background: #405e65; }
.cm-s-opc .CodeMirror-scrollbar-filler, .cm-s-opc .CodeMirror-gutter-filler { background: var(--code-bg); }
.cm-s-opc .cm-meta { color: #93c7ff; }
.cm-s-opc .cm-keyword, .cm-s-opc .cm-operator { color: #ff95cb; }
.cm-s-opc .cm-type { color: #ffba80; }
.cm-s-opc .cm-builtin, .cm-s-opc .cm-def, .cm-s-opc .cm-function { color: #91e9b8; }
.cm-s-opc .cm-number, .cm-s-opc .cm-atom { color: #cfadff; }
.cm-s-opc .cm-string { color: #f4df92; }
.cm-s-opc .cm-comment { color: #a3afc6; }
.submit-actions {
  margin-top: 16px;
  gap: 17px;
  flex-wrap: wrap;
}
.plain {
  font-size: var(--text-small);
}
#result {
  scroll-margin-block-start: 5rem;
}
#result > :not([hidden]) {
  margin: 14px 0 0;
}
.judge-overlay {
  width: min(328px, calc(100% - 40px));
  margin: auto;
  padding: 24px 20px 26px;
  text-align: center;
  color: var(--ink);
  border: 1px solid #d1dbee;
  border-radius: 22px;
  background: #f9fbff;
  box-shadow: 0 16px 70px #0c1d4640;
}
.judge-overlay:not([open]) {
  display: none;
}
.judge-overlay::backdrop {
  background: rgb(15 27 51 / 64%);
  backdrop-filter: blur(5px);
}
html:has(.judge-overlay[open]) {
  overflow: hidden;
}
.judge-overlay h2 {
  margin: 12px 0 3px;
  font-size: 1.375rem;
  outline: none;
}
.judge-overlay p {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
}
.judge-steps {
  display: flex;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}
.judge-steps li {
  position: relative;
  flex: 1;
  display: grid;
  place-items: center;
}
.judge-steps li + li::before {
  content: '';
  position: absolute;
  top: calc(50% - 1px);
  right: 50%;
  width: 100%;
  height: 2px;
  background: #cbd6e4;
}
.judge-steps li.done::before { background: #40977f; }
.judge-steps span {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border: 1px solid #bfccdb;
  border-radius: 50%;
  background: #f9fbff;
  color: #526379;
  font: 600 1rem/1 system-ui, sans-serif;
}
.judge-steps .done span {
  color: #16644f;
  border-color: #75b79e;
  background: #e1f5eb;
}
.judge-steps .miss span { color: #8f3540; border-color: #d9a0a8; background: #fff1f2; }
.judge-overlay .miss::before { background: #c6818a; }
.judge-overlay :is(.done, .miss) span::after {
  position: absolute;
  right: -.35rem;
  bottom: -.2rem;
  display: grid;
  place-items: center;
  width: 1.1rem;
  height: 1.1rem;
  border: 2px solid #f9fbff;
  border-radius: 50%;
  background: #197459;
  color: white;
  font: 700 .8rem/1 system-ui, sans-serif;
  content: '✓';
}
.judge-overlay .miss span::after { background: #9e3949; content: '×'; }
.batch-checks {
  max-width: 325px;
  margin: 12px 0;
  gap: 4px;
}
.batch-checks li + li::before { display: none; }
.batch-checks span { width: 100%; border-radius: 8px; white-space: nowrap; }
.judge-board {
  position: relative;
  display: grid;
  place-items: center;
  width: 168px;
  height: 104px;
  margin: auto;
  background: radial-gradient(ellipse, #b6dafa80, transparent 68%);
}
.judge-board::before, .judge-board::after {
  content: '';
  position: absolute;
  width: 37px;
  height: 26px;
  border-block: 2px solid #a5c7e7;
  background: linear-gradient(#a5c7e7, #a5c7e7) center / 100% 2px no-repeat;
}
.judge-board::before { left: 2px; }
.judge-board::after { right: 2px; }
.judge-chip {
  display: grid;
  place-items: center;
  width: 88px;
  height: 88px;
  background:
    repeating-linear-gradient(90deg, #668bb0 0 3px, transparent 3px 8px) center / 51px 100% no-repeat,
    repeating-linear-gradient(0deg, #668bb0 0 3px, transparent 3px 8px) center / 100% 51px no-repeat;
}
.judge-chip b {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  width: 70px;
  height: 70px;
  border: 3px solid #536a92;
  border-radius: 12px;
  background: linear-gradient(145deg, #2e4879, #101d3a);
  color: #ebfaff;
  box-shadow: inset 0 0 0 2px #192947, inset 0 0 0 3px #7188aa;
  font: 700 19px/1 ui-monospace, Consolas, monospace;
  letter-spacing: .08em;
}
.judge-chip b::after {
  content: '';
  position: absolute;
  inset: 6px 5px auto;
  height: 2px;
  background: #8ae6ff;
  box-shadow: 0 -3px 8px #73dfff;
}
@media (prefers-reduced-motion: no-preference) {
  .judge-overlay :is(.done, .miss) span {
    animation: reveal-check .48s ease-out;
  }
  .judge-overlay[open] .judge-chip b::after {
    animation: cpu-scan 1.6s ease-in-out infinite alternate;
  }
  .judge-overlay[open] .judge-board::before, .judge-overlay[open] .judge-board::after {
    background-image: linear-gradient(90deg, #aaccea, #426cc8, #aaccea);
    background-size: 200% 2px;
    animation: cpu-signal 1.2s linear infinite;
  }
}
@keyframes reveal-check {
  0% { transform: scale(.85); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); }
}
@keyframes cpu-scan {
  to { transform: translateY(49px); }
}
@keyframes cpu-signal {
  from { background-position: 200% center; }
  to { background-position: 0% center; }
}
.notice,
.result-box {
  padding: 13px 16px;
  border: 1px solid transparent;
  border-radius: 13px;
  font-size: 1rem;
}
.notice {
  background: #f0f4ff;
  color: #40577a;
}
.warn,
.failure {
  background: #fff5ed;
  color: #824f33;
  border-color: #eddbcb;
}
.good,
.success {
  background: #edf8f2;
  color: #26664b;
  border-color: #cce8d8;
}
.result-box {
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.result-box strong {
  font-size: 19px;
}
.result-meta {
  margin-left: 12px;
  font-size: var(--text-small);
}
.result-box p {
  margin: 4px 0;
}
.diagnostic {
  padding: 8px 0;
  font-size: var(--text-small);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.history {
  margin: 18px 0 0;
}
.history .section-title {
  margin: 0 0 10px;
}
.empty-history {
  margin: 0;
  font-size: 1rem;
  color: var(--muted);
}
.table-scroll {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
  font-size: var(--text-small);
  font-variant-numeric: tabular-nums;
}
th,
td {
  text-align: left;
  border-top: 1px solid #e7eaf1;
  padding: 9px 8px;
}
th {
  font-size: var(--text-small);
  font-weight: 630;
  color: #647083;
}
td a {
  color: var(--blue);
}
.narrow {
  max-width: 530px;
}
.centered-page {
  padding: clamp(38px, 7vw, 90px) 0;
  min-height: calc(100vh - 164px);
}
.center-card,
.admin-card {
  padding: clamp(24px, 4vw, 40px);
}
.center-card {
  text-align: center;
}
.center-card > p,
.intro {
  color: var(--muted);
  font-size: 1rem;
  margin: 12px 0 22px;
}
.center-card .button,
.center-card .text-link {
  display: inline-flex;
}
.lock-tile,
.success-tile,
.admin-tile {
  display: inline-grid;
  place-items: center;
  width: 49px;
  height: 49px;
  border-radius: 16px;
  background: #eef1ff;
  color: #5567bc;
  margin-bottom: 12px;
}
.lock-tile .lock,
.admin-tile .lock {
  transform: scale(1.65);
}
.success-tile {
  background: #e5f6eb;
  color: #367f58;
  font-size: 27px;
  font-weight: 600;
}
.qr-frame {
  width: min(270px, 100%);
  padding: 12px;
  margin: 15px auto 24px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 15px;
}
.qr-frame img,
.image-state img,
#preview-image {
  display: block;
  max-width: 100%;
  height: auto;
}
.admin-heading {
  justify-content: space-between;
  gap: 10px;
}
.admin-heading .admin-tile {
  margin: 0 0 11px;
}
.admin-form {
  display: grid;
  gap: 8px;
}
.admin-form label,
.image-state strong {
  font-size: 1rem;
  font-weight: 650;
}
.admin-form input {
  min-width: 0;
  width: 100%;
  padding: 9px 12px;
  min-height: 43px;
  border: 1px solid #d6dce6;
  border-radius: 10px;
  background: #fafbfe;
  color: var(--ink);
}
.admin-form input[type='file'] {
  font-size: var(--text-small);
}
.admin-form input::file-selector-button {
  border: 0;
  border-radius: 5px;
  padding: 5px 9px;
  margin-right: 8px;
  color: #344e89;
  background: #e6edfb;
  cursor: pointer;
}
.admin-form .button {
  justify-self: start;
  margin-top: 9px;
}
.admin-form p {
  margin: 0;
}
.image-state {
  gap: 14px;
  background: #f6f8fc;
  border-radius: 12px;
  padding: 12px 14px;
  margin: 16px 0;
}
.image-state img {
  width: 82px;
  max-height: 100px;
  object-fit: contain;
  border-radius: 7px;
}
.image-state p {
  font-size: var(--text-small);
  color: #5b667c;
  margin: 4px 0 0;
}
#preview-image {
  max-height: 150px;
  border-radius: 7px;
}
@media (min-width: 1300px) {
  .hero-copy {
    padding-top: 52px;
    padding-bottom: 54px;
  }
}
@media (max-width: 900px) {
  .frame {
    width: calc(100% - 48px);
  }
  .hero-copy {
    padding-left: 31px;
    width: 59%;
  }
  .ai-art {
    width: 48%;
  }
  .stage-card {
    padding: 20px 20px 16px;
  }
  .work-grid {
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  }
  .panel {
    padding: 19px;
  }
  .narrow .panel {
    padding: 29px;
  }
}
@media (max-width: 680px) {
  .frame {
    width: calc(100% - 32px);
  }
  .navwrap {
    min-height: 56px;
    padding-block: 8px;
  }
  .brand {
    font-size: 17px;
    gap: 7px;
  }
  .brand-mark {
    width: 29px;
    height: 29px;
    border-radius: 9px;
  }
  .home {
    padding-top: 14px;
  }
  .hero {
    border-radius: 23px;
  }
  .hero-copy {
    width: 100%;
    padding: 26px 22px 22px;
  }
  .hero h1 {
    font-size: clamp(35px, 7.7vw, 48px);
    margin: 0 0 11px;
  }
  .hero-copy > p {
    max-width: 63%;
    line-height: 1.7;
  }
  .actions {
    gap: 14px;
    margin-top: 18px;
  }
  .actions .button {
    min-height: 44px;
    padding: 9px 15px;
  }
  .ai-art {
    inset: 12% -3% 24% auto;
    width: 48%;
  }
  .stats {
    padding: 12px 14px;
    margin: 11px 0 23px;
    gap: 10px;
  }
  .stat-icon {
    width: 33px;
    height: 33px;
    padding: 8px;
  }
  .section-title h2 {
    font-size: 21px;
  }
  .progress-tag {
    gap: 6px;
  }
  .cards,
  .work-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .stage-card {
    padding: 18px 19px 14px;
    border-radius: 18px;
  }
  .card-top {
    margin-bottom: 11px;
  }
  .tile {
    width: 40px;
    border-radius: 12px;
  }
  .stage-card h3 {
    font-size: 22px;
  }
  .stage-card > p {
    margin-bottom: 12px;
  }
  .footer {
    margin-top: 19px;
    min-height: 58px;
  }
  .work-page {
    padding-top: 17px;
  }
  .work-heading {
    margin: 14px 0;
  }
  .work-heading .tile {
    width: 44px;
  }
  .work-heading h1 {
    font-size: 28px;
  }
  .panel {
    border-radius: 16px;
  }
  .work-grid .statement {
    order: 0;
  }
  .editor-title h2,
  .panel h2 {
    font-size: 19px;
  }
  #source {
    min-height: 250px;
  }
  .narrow {
    max-width: 470px;
  }
  .narrow .panel {
    padding: 25px 19px;
  }
  .centered-page {
    padding-block: 34px;
  }
  .result-box .button {
    min-height: 44px;
    padding: 8px 14px;
  }
}
@media (max-width: 370px) {
  .frame {
    width: calc(100% - 22px);
  }
  .hero-copy {
    padding: 22px 16px;
  }
  .ai-art {
    inset: 14% -5% 28% auto;
    width: 47%;
  }
  .hero-copy > p {
    max-width: 64%;
  }
  .brand {
    font-size: 16px;
  }
  .progress-bars {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}

.reward-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 20px;
}
