:root {
  --ink: #050b45;
  --muted: #5d657c;
  --paper: #fff8ec;
  --surface: #ffffff;
  --line: #e5ddcf;
  --navy: #050b45;
  --navy-2: #101a66;
  --gold: #ffd51f;
  --orange: #f6a400;
  --red: #b42318;
  --green: #18794e;
  --green-wash: #e7f6ee;
  --yellow-wash: #fff4bd;
  --red-wash: #fde8e7;
  --focus: #f6a400;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  color: var(--ink);
  background: var(--paper);
  font-family: Aptos, "Avenir Next", Avenir, sans-serif;
  line-height: 1.45;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--paper);
}

a {
  color: var(--navy-2);
  text-underline-offset: 3px;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.site-header__inner {
  display: flex;
  width: min(1120px, 100%);
  min-height: 64px;
  margin: 0 auto;
  padding: 10px 20px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  color: var(--navy);
  font-size: 1.12rem;
  font-weight: 850;
  text-decoration: none;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 0.94rem;
  font-weight: 650;
}

.site-nav a {
  color: var(--navy);
  text-decoration: none;
}

.page {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 34px 20px 64px;
}

.page--narrow {
  width: min(720px, 100%);
}

.page--wide {
  width: min(1320px, 100%);
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.15;
}

h1 {
  max-width: 820px;
  font-size: clamp(2rem, 5vw, 3.8rem);
  letter-spacing: -0.04em;
}

h2 {
  font-size: clamp(1.35rem, 2vw, 1.8rem);
  letter-spacing: -0.02em;
}

h3 {
  font-size: 1.08rem;
}

p {
  margin: 0;
}

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(260px, 0.75fr);
  gap: 36px;
  padding: 26px 0 38px;
  border-bottom: 1px solid var(--line);
}

.intro__copy {
  display: grid;
  align-content: start;
  gap: 18px;
}

.intro__copy > p {
  max-width: 720px;
  color: var(--muted);
  font-size: 1.08rem;
}

.prize-box {
  align-self: start;
  padding: 22px;
  border: 2px solid var(--navy);
  border-radius: 8px;
  background: var(--gold);
}

.prize-box strong,
.prize-box span {
  display: block;
}

.prize-box strong {
  margin-bottom: 8px;
  font-size: 1.35rem;
}

.prize-box span {
  color: rgba(5, 11, 69, 0.78);
}

.status-bar {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(240px, 1.2fr) minmax(160px, 0.7fr);
  margin: 24px 0 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
}

.status-bar > div {
  min-width: 0;
  padding: 18px 20px;
  border-right: 1px solid var(--line);
}

.status-bar > div:last-child {
  border-right: 0;
}

.label {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 0.83rem;
  font-weight: 700;
}

.value {
  display: block;
  font-size: 1.12rem;
  font-weight: 800;
}

.countdown {
  font-variant-numeric: tabular-nums;
}

.section {
  display: grid;
  gap: 18px;
  padding: 34px 0;
  border-bottom: 1px solid var(--line);
}

.section__heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
}

.section__heading p,
.muted {
  color: var(--muted);
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border: 1px solid var(--line);
  background: var(--surface);
}

.step {
  padding: 20px;
  border-right: 1px solid var(--line);
}

.step:last-child {
  border-right: 0;
}

.step strong {
  display: block;
  margin-bottom: 7px;
}

.step p {
  color: var(--muted);
}

.proof {
  padding: 20px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--navy);
  background: var(--surface);
}

.proof dl {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 9px 18px;
  margin: 0;
}

.proof dt {
  color: var(--muted);
}

.proof dd {
  min-width: 0;
  margin: 0;
}

code,
.mono {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.9em;
  overflow-wrap: anywhere;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.button,
button.button {
  display: inline-flex;
  min-height: 42px;
  padding: 9px 16px;
  border: 1px solid var(--navy);
  border-radius: 7px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--navy);
  color: #fff;
  font-weight: 750;
  text-decoration: none;
}

.button:hover {
  background: var(--navy-2);
}

.button--secondary {
  background: var(--surface);
  color: var(--navy);
}

.button--warning {
  border-color: #8a4b00;
  background: var(--orange);
  color: var(--ink);
}

.button--danger {
  border-color: var(--red);
  background: var(--red);
}

.button--large {
  min-height: 54px;
  padding: 12px 22px;
  font-size: 1.08rem;
}

.winner {
  padding: 26px;
  border: 3px solid var(--navy);
  background: var(--gold);
}

.winner h2 {
  margin-bottom: 12px;
}

.winner__name {
  display: block;
  margin-bottom: 6px;
  font-size: clamp(1.8rem, 5vw, 3rem);
  font-weight: 900;
  letter-spacing: -0.035em;
}

.entry-list {
  max-height: 420px;
  margin: 0;
  padding: 0;
  overflow: auto;
  border: 1px solid var(--line);
  background: var(--surface);
  list-style: none;
}

.entry-list li {
  display: flex;
  min-height: 38px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.entry-list li:last-child {
  border-bottom: 0;
}

.entry-list li.is-mine {
  background: var(--yellow-wash);
  font-weight: 800;
}

.tag {
  display: inline-block;
  padding: 2px 7px;
  border: 1px solid currentColor;
  border-radius: 5px;
  font-size: 0.78rem;
  font-weight: 750;
}

.tag--ok {
  color: var(--green);
  background: var(--green-wash);
}

.tag--warning {
  color: #754400;
  background: var(--yellow-wash);
}

.tag--error {
  color: var(--red);
  background: var(--red-wash);
}

.form {
  display: grid;
  gap: 18px;
  padding: 24px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.form-row {
  display: grid;
  gap: 7px;
}

.form-row label,
.form-row > span:first-child {
  font-weight: 750;
}

.form-row input,
.form-row select,
.form-row textarea,
.search-input {
  width: 100%;
  min-height: 44px;
  padding: 9px 11px;
  border: 1px solid #aaa69d;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
}

.form-row textarea {
  min-height: 90px;
  resize: vertical;
}

.check-row {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.check-row input {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
}

.form-help {
  color: var(--muted);
  font-size: 0.9rem;
}

.notice {
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--navy);
  background: var(--surface);
}

.notice--success {
  border-left-color: var(--green);
  background: var(--green-wash);
}

.notice--warning {
  border-left-color: var(--orange);
  background: var(--yellow-wash);
}

.notice--error {
  border-left-color: var(--red);
  background: var(--red-wash);
}

.progress {
  display: flex;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.progress li {
  flex: 1;
  padding: 8px 10px;
  border-bottom: 3px solid var(--line);
  color: var(--muted);
  font-size: 0.88rem;
  text-align: center;
}

.progress li.is-active {
  border-color: var(--navy);
  color: var(--navy);
  font-weight: 800;
}

.receipt {
  display: grid;
  gap: 16px;
  padding: 24px;
  border: 2px solid var(--navy);
  background: var(--surface);
}

.receipt__id {
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: clamp(1.35rem, 5vw, 2rem);
  font-weight: 850;
}

.login-shell {
  width: min(460px, 100%);
  margin: 48px auto;
}

.dashboard-header {
  display: flex;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.72fr) minmax(0, 1.28fr);
  gap: 24px;
  padding-top: 24px;
}

.panel {
  padding: 20px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.panel + .panel {
  margin-top: 18px;
}

.panel h2,
.panel h3 {
  margin-bottom: 15px;
}

dialog {
  width: min(520px, calc(100% - 32px));
  padding: 0;
  border: 2px solid var(--navy);
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface);
}

dialog::backdrop {
  background: rgba(5, 11, 69, 0.48);
}

.issue-buttons {
  display: grid;
  gap: 10px;
}

.issue-buttons .button {
  min-height: 64px;
  justify-content: flex-start;
  font-size: 1.08rem;
}

.issue-buttons .button strong,
.issue-buttons .button span {
  display: block;
}

.issue-buttons .button span {
  font-size: 0.84rem;
  font-weight: 500;
  opacity: 0.82;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  font-size: 0.91rem;
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

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

.compact-actions {
  display: flex;
  gap: 6px;
}

.compact-actions button {
  min-height: 32px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  color: var(--navy);
}

.definition-list {
  display: grid;
  grid-template-columns: minmax(140px, 0.45fr) minmax(0, 1fr);
  gap: 9px 20px;
  margin: 0;
}

.definition-list dt {
  color: var(--muted);
}

.definition-list dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.legal {
  display: grid;
  gap: 28px;
}

.legal section {
  display: grid;
  gap: 10px;
}

.legal ul,
.legal ol {
  margin: 0;
  padding-left: 22px;
}

.legal li + li {
  margin-top: 7px;
}

.footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.footer__inner {
  display: flex;
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 22px 20px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: var(--muted);
  font-size: 0.88rem;
}

.footer__links {
  display: flex;
  gap: 15px;
}

.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    rotate: 360deg;
  }
}

@media (prefers-reduced-motion: reduce) {
  .spinner {
    animation: none;
  }
}

@media (max-width: 780px) {
  .site-header__inner,
  .footer__inner,
  .dashboard-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-nav {
    flex-wrap: wrap;
  }

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

  .status-bar,
  .steps {
    grid-template-columns: 1fr;
  }

  .status-bar > div,
  .step {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .status-bar > div:last-child,
  .step:last-child {
    border-bottom: 0;
  }

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

  .proof dl,
  .definition-list {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .proof dd,
  .definition-list dd {
    margin-bottom: 10px;
  }

  .page {
    padding-top: 22px;
  }
}
