:root {
  color-scheme: light;
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  color: #14264a;
  background: #f4f7fc;
  --navy: #08215d;
  --blue: #0646aa;
  --muted: #405876;
  --line: #d5e3f5;
}

*, *::before, *::after { box-sizing: border-box; }

body { margin: 0; }

[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.shell {
  width: min(100% - 3rem, 69rem);
  margin-inline: auto;
}

.site-header {
  min-height: 5.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: var(--muted);
  font-size: .875rem;
  font-weight: 600;
}

.site-header img {
  display: block;
  width: clamp(7.75rem, 20vw, 10rem);
  height: auto;
}

.header-actions { display: flex; flex-wrap: wrap; justify-content: end; align-items: center; gap: .65rem 1rem; }

main { padding-block: clamp(1rem, 5vw, 3.25rem) 3rem; }

.entry {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 1.5rem;
  box-shadow: 0 20px 52px -28px #08215d3d;
}

.intro, .access { padding: clamp(1.75rem, 5.4vw, 4.25rem); }

.intro {
  display: flex;
  flex-direction: column;
  justify-content: center;
  isolation: isolate;
  position: relative;
  min-height: 29rem;
  color: #fff;
  background: radial-gradient(ellipse at 100% 0%, #1c4e9d, transparent 68%), var(--navy);
}

.sparkle {
  position: absolute;
  z-index: -1;
  top: -.09em;
  right: .1em;
  font-size: clamp(6rem, 19vw, 14rem);
  line-height: 1;
  color: #efb36f2c;
  pointer-events: none;
}

.eyebrow {
  margin: 0 0 1.125rem;
  color: #ffc889;
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2.6rem, 5.45vw, 4.8rem);
  line-height: .99;
  letter-spacing: -.059em;
  font-weight: 760;
}

.intro p:last-child {
  margin: 1.6rem 0 0;
  max-width: 35ch;
  color: #e2ecfd;
  font-size: clamp(1rem, 1.7vw, 1.125rem);
  line-height: 1.65;
}

.access {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.access h2 { margin: 0 0 1.25rem; font-size: 1.6rem; letter-spacing: -.03em; }

.event-window {
  padding: 1rem 1.125rem;
  margin-top: 1.5rem;
  border: 1px solid var(--line);
  border-radius: .8rem;
  background: #f4f8ff;
}

.event-window h3 { margin: 0; font-size: .93rem; font-weight: 700; }
.event-window dl { margin: .75rem 0; }

.event-window dl div {
  display: grid;
  grid-template-columns: minmax(3.2rem, .6fr) minmax(0, 1.5fr);
  align-items: start;
  gap: .5rem;
  padding-block: .3rem;
  font-size: .94rem;
}

.event-window dt { color: var(--muted); }
.event-window dd { margin: 0; font-weight: 650; font-variant-numeric: tabular-nums; }
.event-window p { color: var(--muted); margin: 0; font-size: .8rem; }

.primary, .secondary {
  border-radius: .7rem;
  padding: .66rem 1rem;
  min-height: 2.8rem;
  font: inherit;
  font-weight: 680;
  cursor: pointer;
  border: 1px solid transparent;
}

.primary {
  color: #fff;
  background: var(--blue);
}

.primary:hover:not(:disabled) { background: #083785; }
.secondary { color: var(--blue); background: #fff; border-color: #cad9eb; }
.secondary:hover:not(:disabled) { background: #eef5ff; }
button:disabled, fieldset:disabled button { opacity: .52; cursor: default; }
.access-note { color: var(--muted); margin: 0 0 1rem; font-size: .9rem; line-height: 1.5; }

fieldset { min-inline-size: 0; padding: 0; margin: 0; border: 0; }
.fields label { display: block; font-size: .91rem; font-weight: 650; }
input:not([type=checkbox]) {
  width: 100%;
  min-width: 0;
  min-height: 2.8rem;
  border-radius: .65rem;
  border: 1px solid #9dafc9;
  padding: .53rem .72rem;
  font: inherit;
  color: inherit;
  background: #fff;
}
.fields input { margin-top: .32rem; }
#login-form fieldset > input { margin-bottom: .75rem; }
#login-form fieldset > button { display: block; width: 100%; margin-top: .25rem; }
.message { color: var(--muted); margin: .65rem 0 0; font-size: .9rem; line-height: 1.5; }
.message:empty { display: none; }
.message.error, .prize-reason { color: #803a12; }
#retry { margin-top: .6rem; }

.workspace { display: grid; gap: 1rem; }
.workspace-header {
  padding: clamp(1.5rem, 5vw, 2.7rem);
  border-radius: 1.5rem;
  color: #fff;
  background: radial-gradient(ellipse at 100% 0%, #1c4e9d, transparent 68%), var(--navy);
}
.workspace-header h1 { font-size: clamp(2.05rem, 6vw, 3.6rem); }
.workspace-header p:last-child { color: #e2ecfd; margin: .8rem 0 0; line-height: 1.5; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 1rem; padding: clamp(1rem, 4vw, 1.5rem); }
.search-row { display: flex; align-items: end; gap: .65rem; }
.search-row input { flex: 1; }
.search-row button { flex: none; }
.result-heading { display: flex; align-items: end; justify-content: space-between; flex-wrap: wrap; gap: .8rem 1rem; }
.result-heading h2, .result-heading p, .panel h3 { margin: 0; }
.result-heading h2 { overflow-wrap: anywhere; }
.result-heading p { color: var(--muted); margin-top: .3rem; font-size: .9rem; }
#balance-overview { margin-top: 1.2rem; }
.metrics { margin: 1.1rem 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .55rem; }
.metrics > div { background: #f3f7fe; border: 1px solid var(--line); padding: .65rem .75rem; border-radius: .65rem; }
.metrics .balance { background: #e8f1ff; border-color: #c2d7f4; color: var(--navy); }
.metrics dt { font-size: .78rem; color: var(--muted); }
.metrics dd { margin: .2rem 0 0; font-size: clamp(.9rem, 2.5vw, 1.35rem); font-weight: 750; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.global-metrics { margin: .65rem 0 .4rem; }
.balance-note, .lab-balance-caption { margin: .35rem 0 .8rem; color: var(--muted); font-size: .85rem; }
.eligible-alert { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .55rem 1rem; margin: 1rem 0; padding: .7rem .9rem; border: 1px solid #9bcfb1; border-radius: .65rem; background: #edf8ef; color: #185537; }
.eligible-alert strong, .eligible-alert span { display: block; }
.eligible-alert span { margin-top: .2rem; font-size: .87rem; }
.eligible-button { color: #185537; border-color: #9bcfb1; }
.eligible-button:hover:not(:disabled) { background: #d9f2e0; }
.laboratories-title { padding-block: 1rem .65rem; }
.laboratory-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 17.5rem), 1fr)); gap: .6rem; }
.laboratory-card { display: grid; grid-template-rows: 1fr auto auto; gap: .6rem; min-width: 0; padding: .7rem .8rem; border: 1px solid var(--line); border-radius: .65rem; background: #fff; }
.laboratory-card.eligible, .prize.eligible { border-color: #9bcfb1; background: #f0faf3; }
.laboratory-card-title { display: flex; align-items: start; justify-content: space-between; flex-wrap: wrap; gap: .3rem .65rem; }
.laboratory-card h4 { margin: 0; font-size: .91rem; overflow-wrap: anywhere; }
.eligible-label { border-radius: .35rem; padding: .18rem .38rem; background: #d5f0de; color: #155435; font-weight: 700; font-size: .72rem; }
.laboratory-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .45rem; margin: 0; }
.laboratory-metrics dt { color: var(--muted); font-size: .7rem; }
.laboratory-metrics dd { margin: .12rem 0 0; font-weight: 700; font-size: .86rem; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.laboratory-action { justify-self: start; min-height: 2.25rem; padding: .33rem .55rem; font-size: .78rem; }
.lab-results { margin-top: 1.5rem; border-top: 1px solid var(--line); padding-top: 1rem; }
.lab-results h3 { scroll-margin-top: 1rem; }
.notes { padding: .7rem .9rem; border: 1px solid var(--line); border-radius: .65rem; margin-bottom: 1.25rem; }
summary { width: fit-content; color: var(--blue); cursor: pointer; }
.notes ul, dialog ul { margin: .65rem 0 .15rem; padding-left: 1.2rem; line-height: 1.6; }
.notes li { overflow-wrap: anywhere; }
.prize-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); gap: .7rem; margin-top: .75rem; }
.prize { padding: .85rem; border: 1px solid var(--line); border-radius: .75rem; }
.prize:has(input:checked) { background: #f3f8ff; border-color: #5794e6; }
.prize label { display: grid; grid-template-columns: auto 1fr; gap: .6rem; align-items: start; cursor: pointer; }
.prize input { width: 1.15rem; height: 1.15rem; margin: .15rem 0 0; accent-color: var(--blue); }
.prize label:has(input:disabled) { cursor: default; }
.prize strong { overflow-wrap: anywhere; }
.prize small, .prize details { font-size: .86rem; line-height: 1.4; color: var(--muted); }
.prize small { display: block; margin-top: .25rem; }
.prize details { margin: .55rem 0 0 1.75rem; }
.prize details p { margin: .4rem 0 0; }
.prize .prize-reason { margin-left: 1.75rem; }
.button-row { display: flex; align-items: center; justify-content: end; flex-wrap: wrap; gap: .65rem; margin-top: 1.1rem; }
.button-row > span { margin-right: auto; color: var(--muted); font-size: .92rem; }
.receipt { color: #164f44; background: #eaf7f4; border-color: #bfdfd5; }
dialog { width: min(34rem, calc(100% - 1.5rem)); color: inherit; border: 1px solid var(--line); border-radius: 1rem; padding: 1.4rem; }
dialog h2, dialog p { margin-top: 0; }
dialog p:last-child { margin-bottom: 0; }
dialog::backdrop { background: #08215d8c; }

:focus-visible { outline: 3px solid #864300; outline-offset: 3px; }

@media (max-width: 49rem) {
  .entry { grid-template-columns: minmax(0, 1fr); }
  .intro { min-height: auto; padding-block: 2.65rem; }
  h1 { font-size: clamp(2.6rem, 9vw, 4.2rem); }
  .intro p:last-child { margin-top: 1rem; }
}

@media (max-width: 25rem) {
  .shell { width: calc(100% - 1.5rem); }
  .site-header { min-height: 4.3rem; }
  .site-header span { font-size: .74rem; }
  .intro, .access { padding-inline: 1.25rem; }
  .search-row { display: grid; }
  .metrics { gap: .3rem; }
  .metrics > div { padding: .45rem .4rem; }
}
