:root {
  color-scheme: dark;
  --bg: #07111f;
  --surface: #0c192a;
  --surface-raised: #102238;
  --border: #22364c;
  --border-strong: #395269;
  --text: #f2f7fb;
  --muted: #9fb0c1;
  --muted-strong: #c3d0db;
  --cyan: #50d8d0;
  --cyan-bright: #83f4ec;
  --cyan-dark: #133c42;
  --amber: #ffca68;
  --amber-dark: #3d321d;
  --red: #ff8a83;
  --red-dark: #3d2026;
  --green: #75ddad;
  --green-dark: #17382f;
  --focus: #b8fff9;
  --shadow: 0 24px 70px rgb(0 0 0 / 28%);
  font-family:
    Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

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

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

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 8%, rgb(49 123 142 / 18%), transparent 27rem),
    radial-gradient(circle at 88% 34%, rgb(40 90 123 / 14%), transparent 25rem), var(--bg);
  line-height: 1.5;
}

body::before {
  position: fixed;
  z-index: -1;
  inset: 0;
  background-image:
    linear-gradient(rgb(115 174 190 / 4%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(115 174 190 / 4%) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(to bottom, black, transparent 72%);
  content: "";
  pointer-events: none;
}

button,
input,
select {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.65rem 0.9rem;
  border-radius: 0.45rem;
  color: #031215;
  background: var(--focus);
  font-weight: 750;
  transform: translateY(-180%);
  transition: transform 150ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

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

.site-header {
  border-bottom: 1px solid rgb(77 107 134 / 35%);
  background: rgb(7 17 31 / 82%);
  backdrop-filter: blur(14px);
}

.header-inner,
.page-shell,
.site-footer {
  width: min(1180px, calc(100% - 2rem));
  margin-inline: auto;
}

.header-inner {
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text);
  font-size: 0.94rem;
  font-weight: 720;
  letter-spacing: 0.01em;
  text-decoration: none;
}

.brand-mark {
  display: flex;
  width: 34px;
  height: 34px;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  padding: 8px;
  border: 1px solid #346272;
  border-radius: 0.55rem;
  background: linear-gradient(145deg, #143344, #0b242f);
  box-shadow: inset 0 0 18px rgb(80 216 208 / 9%);
}

.brand-mark span {
  width: 4px;
  border-radius: 1px;
  background: var(--cyan);
}

.brand-mark span:nth-child(1) {
  height: 7px;
}

.brand-mark span:nth-child(2) {
  height: 15px;
}

.brand-mark span:nth-child(3) {
  height: 10px;
}

.environment-badge,
.field-count,
.result-status,
.decision-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  white-space: nowrap;
}

.environment-badge {
  gap: 0.45rem;
  padding: 0.36rem 0.65rem;
  border: 1px solid #275149;
  border-radius: 999px;
  color: #b8ead9;
  background: #102d29;
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgb(117 221 173 / 10%);
}

.page-shell {
  padding-block: clamp(3rem, 7vw, 5.75rem) 4.25rem;
}

.hero {
  max-width: 780px;
}

.eyebrow,
.step-label {
  margin: 0;
  color: var(--cyan);
  font-size: 0.73rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.eyebrow span {
  display: inline-block;
  padding: 0.18rem 0.38rem;
  border: 1px solid #2b6667;
  border-radius: 0.25rem;
  background: #103033;
  letter-spacing: 0.09em;
}

h1,
h2,
h3,
p {
  text-wrap: pretty;
}

h1 {
  max-width: 720px;
  margin: 0.85rem 0 1rem;
  font-size: clamp(2.25rem, 5.5vw, 4.5rem);
  font-weight: 760;
  letter-spacing: -0.052em;
  line-height: 1.02;
}

.hero-copy {
  max-width: 690px;
  margin: 0;
  color: var(--muted-strong);
  font-size: clamp(1rem, 2vw, 1.16rem);
  line-height: 1.7;
}

.education-notice {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  margin: 2.2rem 0 1.25rem;
  padding: 1rem 1.1rem;
  border: 1px solid #594a29;
  border-radius: 0.75rem;
  color: #ffdda0;
  background: linear-gradient(100deg, rgb(61 50 29 / 90%), rgb(42 36 25 / 74%));
}

.education-notice svg {
  flex: 0 0 auto;
  margin-top: 0.12rem;
}

.education-notice h2 {
  margin: 0 0 0.15rem;
  color: #ffe6b9;
  font-size: 0.9rem;
}

.education-notice p {
  margin: 0;
  color: #d8c39d;
  font-size: 0.82rem;
  line-height: 1.6;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(340px, 0.9fr);
  gap: 1.25rem;
  align-items: stretch;
}

.panel {
  min-width: 0;
  padding: clamp(1.25rem, 3.2vw, 2rem);
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: linear-gradient(145deg, rgb(16 34 56 / 96%), rgb(10 25 43 / 96%));
  box-shadow: var(--shadow);
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.65rem;
}

.panel-heading h2 {
  margin: 0.28rem 0 0;
  font-size: clamp(1.2rem, 3vw, 1.5rem);
  letter-spacing: -0.025em;
}

.field-count,
.result-status {
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  color: var(--muted-strong);
  background: #0c1c2d;
  font-size: 0.71rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.2rem 1rem;
}

.field-wide {
  grid-column: 1 / -1;
}

.field label {
  display: block;
  margin-bottom: 0.45rem;
  color: #dce7ef;
  font-size: 0.84rem;
  font-weight: 680;
}

.field input,
.field select {
  width: 100%;
  min-height: 47px;
  border: 1px solid #31495f;
  border-radius: 0.55rem;
  color: var(--text);
  background: #081725;
  transition:
    border-color 140ms ease,
    box-shadow 140ms ease,
    background 140ms ease;
}

.field input {
  padding: 0.72rem 3.2rem 0.72rem 0.8rem;
}

.field select {
  padding: 0.72rem 2.5rem 0.72rem 0.8rem;
}

.field input:hover,
.field select:hover {
  border-color: #4a687f;
}

.field input:focus,
.field select:focus {
  border-color: var(--cyan);
  background: #0b1b2a;
  box-shadow: 0 0 0 3px rgb(80 216 208 / 12%);
  outline: none;
}

.field input[aria-invalid="true"],
.field select[aria-invalid="true"] {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgb(255 138 131 / 10%);
}

.input-with-unit {
  position: relative;
}

.input-with-unit > span {
  position: absolute;
  top: 50%;
  right: 0.8rem;
  color: #7690a5;
  font-size: 0.72rem;
  font-weight: 750;
  pointer-events: none;
  transform: translateY(-50%);
}

.field-hint {
  margin: 0.35rem 0 0;
  color: #8297aa;
  font-size: 0.7rem;
  line-height: 1.4;
}

.field-error {
  margin: 0.38rem 0 0;
  color: #ffb1ab;
  font-size: 0.72rem;
  font-weight: 650;
  line-height: 1.45;
}

.primary-button {
  display: flex;
  width: 100%;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  margin-top: 1.7rem;
  padding: 0.8rem 1rem;
  border: 0;
  border-radius: 0.6rem;
  color: #041719;
  background: linear-gradient(135deg, #80f1e9, #42c6c3);
  box-shadow: 0 10px 28px rgb(40 193 190 / 16%);
  font-weight: 800;
  transition:
    transform 140ms ease,
    box-shadow 140ms ease,
    filter 140ms ease;
}

.primary-button:hover:not(:disabled) {
  box-shadow: 0 13px 34px rgb(40 193 190 / 26%);
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.primary-button:active:not(:disabled) {
  transform: translateY(0);
}

.primary-button:disabled {
  cursor: wait;
  filter: saturate(0.65);
  opacity: 0.72;
}

.button-loader {
  display: none;
  width: 17px;
  height: 17px;
  border: 2px solid rgb(4 23 25 / 30%);
  border-top-color: #041719;
  border-radius: 50%;
  animation: spin 750ms linear infinite;
}

.primary-button.is-loading .button-loader {
  display: block;
}

.primary-button.is-loading svg {
  display: none;
}

@keyframes spin {
  to {
    transform: rotate(1turn);
  }
}

.error-summary {
  margin-bottom: 1.3rem;
  padding: 0.9rem 1rem;
  border: 1px solid #713d43;
  border-radius: 0.6rem;
  color: #ffd2cf;
  background: var(--red-dark);
}

.error-title {
  margin: 0;
  font-size: 0.86rem;
  font-weight: 780;
}

.error-summary ul {
  margin: 0.35rem 0 0;
  padding-left: 1.15rem;
  color: #e9b7b4;
  font-size: 0.78rem;
}

.error-summary li + li {
  margin-top: 0.25rem;
}

.error-summary a {
  border-radius: 0.15rem;
  color: inherit;
  text-decoration-color: rgb(255 210 207 / 62%);
  text-underline-offset: 0.16em;
}

.error-summary a:hover {
  color: #fff0ee;
  text-decoration-color: currentcolor;
}

.result-panel {
  display: flex;
  min-height: 590px;
  flex-direction: column;
}

.result-status-idle {
  color: #9aabba;
}

.result-status-positive {
  border-color: #704348;
  color: #ffb4ae;
  background: #2e1d22;
}

.result-status-negative {
  border-color: #2d594c;
  color: #a7e4cb;
  background: #142c26;
}

.result-status-stale {
  border-color: #68542d;
  color: #f4d395;
  background: #31291b;
}

.result-status-outside {
  border-color: #735c30;
  color: #ffe0a6;
  background: #362c1d;
}

.result-panel.is-stale .result-content {
  opacity: 0.58;
}

.result-empty {
  display: grid;
  flex: 1;
  place-content: center;
  padding: 2rem 1rem 4rem;
  text-align: center;
}

.empty-visual {
  display: flex;
  width: 160px;
  height: 96px;
  align-items: flex-end;
  justify-content: center;
  gap: 9px;
  margin: 0 auto 1.5rem;
  padding: 18px;
  border: 1px solid #253e54;
  border-radius: 0.8rem;
  background: linear-gradient(180deg, rgb(19 44 66 / 70%), rgb(9 28 46 / 30%));
  box-shadow: inset 0 0 30px rgb(71 183 185 / 4%);
}

.empty-visual span {
  width: 18px;
  border: 1px solid #31556a;
  border-radius: 3px 3px 1px 1px;
  background: linear-gradient(180deg, #245466, #153343);
}

.empty-visual span:nth-child(1) {
  height: 29%;
}

.empty-visual span:nth-child(2) {
  height: 52%;
}

.empty-visual span:nth-child(3) {
  height: 39%;
}

.empty-visual span:nth-child(4) {
  height: 70%;
}

.result-empty h3 {
  margin: 0;
  color: #d5e0e8;
  font-size: 1rem;
}

.result-empty p {
  max-width: 300px;
  margin: 0.45rem auto 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.result-content {
  animation: reveal 260ms ease both;
  transition: opacity 160ms ease;
}

.domain-notice {
  margin-bottom: 1rem;
  padding: 0.9rem 1rem;
  border: 1px solid #735c30;
  border-radius: 0.68rem;
  background: linear-gradient(110deg, #382e1e, #2b251b);
}

.domain-notice h3 {
  margin: 0;
  color: #ffe0a6;
  font-size: 0.9rem;
}

.domain-notice p {
  margin: 0.3rem 0 0;
  color: #d9c49b;
  font-size: 0.76rem;
  line-height: 1.55;
}

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.score-block {
  padding: 1.25rem;
  border: 1px solid #2d475c;
  border-radius: 0.75rem;
  background: linear-gradient(140deg, #102b3c, #0a202f);
}

.score-label {
  margin: 0 0 0.3rem;
  color: #9bb0c0;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.score-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.8rem;
}

.score-value {
  color: var(--cyan-bright);
  font-size: clamp(2.55rem, 7vw, 4rem);
  font-variant-numeric: tabular-nums;
  font-weight: 760;
  letter-spacing: -0.06em;
  line-height: 1;
}

.score-value.is-unavailable {
  color: #ffe0a6;
  font-size: clamp(1.6rem, 4.5vw, 2.35rem);
  letter-spacing: -0.035em;
  line-height: 1.1;
}

.decision-pill {
  padding: 0.38rem 0.62rem;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.decision-pill.is-positive {
  border-color: #804c51;
  color: #ffc2bd;
  background: #3b2026;
}

.decision-pill.is-negative {
  border-color: #326050;
  color: #b6efd8;
  background: #17352c;
}

.decision-pill.is-outside {
  border-color: #735c30;
  color: #ffe0a6;
  background: #362c1d;
}

.score-raw {
  min-height: 1.25rem;
  margin: 0.45rem 0 0;
  color: #91a8b9;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 0.7rem;
  font-variant-numeric: tabular-nums;
}

.risk-scale-wrap {
  margin: 1.4rem 0 1.25rem;
}

.progress-row {
  display: grid;
  grid-template-columns: 3.5rem 1fr;
  gap: 0.65rem;
  align-items: center;
  color: #9cb0bf;
  font-size: 0.67rem;
  font-weight: 700;
}

.progress-row + .progress-row {
  margin-top: 0.55rem;
}

.progress-row progress {
  width: 100%;
  height: 10px;
  overflow: hidden;
  border: 1px solid #385068;
  border-radius: 999px;
  appearance: none;
  background: #081522;
}

.progress-row progress::-webkit-progress-bar {
  border-radius: 999px;
  background: #081522;
}

.progress-row progress::-webkit-progress-value {
  border-radius: 999px;
  background: var(--cyan);
  transition: width 500ms cubic-bezier(0.2, 0.85, 0.25, 1);
}

.progress-row progress::-moz-progress-bar {
  border-radius: 999px;
  background: var(--cyan);
}

.progress-row .risk-meter.is-positive::-webkit-progress-value {
  background: linear-gradient(90deg, #ffca68, #ff817a);
}

.progress-row .risk-meter.is-positive::-moz-progress-bar {
  background: #ff8a83;
}

.progress-row .threshold-meter::-webkit-progress-value {
  background: #8ca5b8;
}

.progress-row .threshold-meter::-moz-progress-bar {
  background: #8ca5b8;
}

.scale-labels {
  display: flex;
  justify-content: space-between;
  margin: 0.35rem 0 0 4.15rem;
  color: #728b9f;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.64rem;
}

.metric-list {
  margin: 0;
  border-top: 1px solid var(--border);
}

.metric-list > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border);
}

.metric-list dt {
  color: var(--muted);
  font-size: 0.78rem;
}

.metric-list dd {
  margin: 0;
  color: #e2ebf2;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.79rem;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  text-align: right;
}

.warnings-box {
  margin-top: 1.15rem;
  padding: 0.85rem 0.95rem;
  border: 1px solid #5a4928;
  border-radius: 0.6rem;
  background: var(--amber-dark);
}

.warnings-box h3 {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  color: #ffdfa2;
  font-size: 0.78rem;
}

.warnings-box ul {
  margin: 0.45rem 0 0;
  padding-left: 1.15rem;
  color: #d7c094;
  font-size: 0.73rem;
}

.warnings-box li + li {
  margin-top: 0.3rem;
}

.threshold-explanation {
  margin: 1.1rem 0 0;
  color: #879cad;
  font-size: 0.72rem;
  line-height: 1.6;
}

.site-footer {
  padding-block: 0 2rem;
  color: #71889b;
  font-size: 0.7rem;
  letter-spacing: 0.025em;
  text-align: center;
}

.noscript-message {
  position: fixed;
  z-index: 90;
  right: 1rem;
  bottom: 1rem;
  left: 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--red);
  border-radius: 0.5rem;
  color: #ffe2df;
  background: #3c1e23;
  text-align: center;
}

[hidden] {
  display: none !important;
}

@media (max-width: 850px) {
  .workspace-grid {
    grid-template-columns: 1fr;
  }

  .result-panel {
    min-height: 500px;
  }
}

@media (max-width: 560px) {
  .header-inner,
  .page-shell,
  .site-footer {
    width: min(100% - 1.1rem, 1180px);
  }

  .header-inner {
    min-height: 64px;
  }

  .brand > span:last-child {
    max-width: 180px;
    font-size: 0.79rem;
    line-height: 1.25;
  }

  .environment-badge {
    padding: 0.32rem 0.5rem;
    font-size: 0.62rem;
  }

  .page-shell {
    padding-block: 2.5rem 3rem;
  }

  h1 {
    font-size: clamp(2.15rem, 12vw, 3rem);
  }

  .education-notice {
    padding: 0.9rem;
  }

  .panel {
    padding: 1.1rem;
    border-radius: 0.8rem;
  }

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

  .field-wide {
    grid-column: auto;
  }

  .panel-heading {
    margin-bottom: 1.35rem;
  }

  .result-panel {
    min-height: 465px;
  }

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

@media (prefers-contrast: more) {
  :root {
    --border: #59748b;
    --muted: #c2d0da;
  }

  .field input,
  .field select {
    border-color: #6d879b;
  }
}
