#mars {
  --navy: #142633;
  --rust: #b34820;
  --food: #96600b;
  --water: #096879;
  --oxygen: #5654a1;
  --border: #d6d6d0;
  --pale: #f1f0eb;
  max-width: 1240px;
  margin: auto;
  padding: 28px 40px 42px;
  color: var(--navy);
  line-height: 1.5;
}
#mars * {
  box-sizing: border-box;
}
#mars h1,
#mars h2,
#mars h3,
#mars h4 {
  color: var(--navy);
  font-family: var(--sans);
  letter-spacing: -.04em;
  font-weight: 600;
}
#mars h1 {
  font-size: 2.15rem;
  line-height: 1.05;
  margin: 5px 0 9px;
}
#mars h1 span {
  display: inline;
  margin-left: 12px;
  font: italic 1.85rem var(--serif);
  color: var(--rust);
  letter-spacing: -.03em;
}
#mars h2 {
  font-size: 1.4rem;
  line-height: 1.25;
  margin-bottom: 12px;
}
#mars h3 {
  font-size: 1.05rem;
}
#mars h4 {
  font-size: 1rem;
}
#mars p {
  margin-bottom: 12px;
}
#mars button,
#mars select,
#mars input {
  font: inherit;
}
#mars button {
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 8px 15px;
  cursor: pointer;
  background: white;
  color: var(--navy);
  font-size: .875rem;
  font-weight: 600;
  transition: background .18s,border-color .18s;
}
#mars button:hover:not(:disabled) {
  border-color: var(--rust);
  background: #f7eee7;
}
#mars button:disabled {
  opacity: .45;
  cursor: not-allowed;
}
#mars :is(button,input,select,a,summary):focus-visible {
  outline: 3px solid #c6511c;
  outline-offset: 4px;
}
#mars button.primary {
  background: var(--rust);
  border-color: var(--rust);
  color: white;
}
#mars button.primary:hover:not(:disabled) {
  background: #943719;
}
#mars button.secondary {
  background: var(--navy);
  border-color: var(--navy);
  color: white;
}
#mars button.quiet {
  background: transparent;
  border-color: transparent;
  padding-inline: 7px;
  text-decoration: underline;
  text-underline-offset: 4px;
  font-weight: 400;
}
#mars .app-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
#mars .kicker {
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .13em;
  color: #596570;
  margin: 0 0 5px;
  font-weight: 600;
}
#mars .tagline {
  font-size: .875rem;
  color: #54616a;
  margin-bottom: 0;
}
#mars .model-link {
  font-size: .875rem;
  text-decoration: underline;
  text-underline-offset: 5px;
  white-space: nowrap;
}
#mars .mode-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 22px;
  margin-bottom: 17px;
  gap: 14px;
}
#mars .mode-switch {
  display: flex;
}
#mars .mode-switch button {
  border: 0;
  background: transparent;
}
#mars .progress {
  color: #53616b;
}
#mars .mission-strip {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
}
#mars .mission {
  display: flex;
  align-items: center;
  text-align: left;
}
#mars .mission.selected {
  border: 1px solid var(--navy);
  background: var(--navy);
  color: white;
}
#mars .mission.selected:hover {
  background: #243d4c;
}
#mars .mission small {
  display: block;
  font-weight: 400;
  opacity: .8;
}
#mars .brief {
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}
#mars .brief p:last-child {
  margin: 0;
  max-width: 650px;
}
#mars .mission-rules {
  flex-shrink: 0;
  color: #5b666d;
}
#mars .mission-rules b {
  font-variant-numeric: tabular-nums;
}
#mars .play-layout {
  display: grid;
  grid-template-columns: minmax(0,1.45fr) minmax(0,1fr);
  gap: 28px;
  padding: 24px 0;
}
#mars .packing>h2 {
  font-size: 1rem;
  letter-spacing: 0;
}
#mars .cargo {
  margin-bottom: 10px;
}
#mars .cargo>div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}
#mars .cargo span {
  font-size: .875rem;
}
#mars .cargo strong {
  font-size: 1.2rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
#mars .cargo small {
  font-size: .875rem;
}
#mars meter {
  display: block;
  width: 100%;
  height: 12px;
  margin: 8px 0 4px;
  border-radius: 3px;
}
#mars meter::-webkit-meter-bar {
  background: #e0e2df;
  border: 0;
}
#mars meter::-webkit-meter-optimum-value {
  background: var(--navy);
}
#mars .cargo>p {
  font-size: .8125rem;
  text-align: right;
  margin: 0;
}
#mars .check-row {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
}
#mars .check {
  padding: 5px 8px;
  border: 1px solid;
  border-radius: 4px;
}
#mars .check b {
  font-weight: 600;
}
#mars .check.pass {
  color: #255941;
  background: #edf4ee;
  border-color: #cfddd1;
}
#mars .check.fail {
  color: #873713;
  background: #fff0e7;
  border-color: #e9c6b1;
}
#mars .supply-grid {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 10px;
}
#mars .supply {
  border: 1px solid var(--border);
  border-top: 3px solid var(--resource);
  border-radius: 6px;
  padding: 14px 12px 10px;
  background: white;
  min-width: 0;
}
#mars .food {
  --resource: var(--food);
}
#mars .water {
  --resource: var(--water);
}
#mars .oxygen {
  --resource: var(--oxygen);
}
#mars .supply-top {
  display: flex;
  gap: 9px;
  align-items: center;
  margin-bottom: 10px;
}
#mars .supply-top h3 {
  font-size: 1rem;
  letter-spacing: 0;
}
#mars .resource-symbol {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--resource);
}
#mars .unit {
  margin-left: auto;
  font-size: .75rem;
  color: #647079;
}
#mars .field label {
  display: block;
  font-weight: 500;
  line-height: 1.4;
  margin-bottom: 5px;
  color: #4d5c65;
}
#mars input,
#mars select {
  border: 1px solid #a6afb3;
  border-radius: 4px;
  background: white;
  width: 100%;
  min-height: 44px;
  padding: 8px 10px;
  color: var(--navy);
}
#mars input[aria-invalid=true] {
  border: 2px solid #a3381a;
}
#mars .supply input {
  font-size: 1.55rem;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
  padding: 6px;
}
#mars .supply label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
#mars .field-error {
  font-size: .8125rem;
  color: #a3381a;
  display: block;
  line-height: 1.3;
  margin-top: 3px;
}
#mars .field-error:empty {
  display: none;
}
#mars .steps {
  display: grid;
  grid-template-columns: repeat(2,1fr);
  gap: 5px;
  margin-top: 10px;
}
#mars .steps button {
  padding: 4px;
  font-weight: 500;
  min-height: 35px;
  font-size: .875rem;
}
#mars .projection {
  border-top: 1px solid #e6e7e3;
  margin: 12px 0 0;
  padding-top: 9px;
  color: #55636c;
}
#mars .projection strong {
  color: var(--navy);
  font-weight: 500;
}
#mars .pack-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}
#mars .pack-actions>.primary {
  flex: 1;
}
#mars .minor-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  gap: 8px;
}
#mars .hint {
  padding: 14px 16px;
  background: #f6eadc;
  border-left: 3px solid var(--rust);
  margin-top: 12px;
  font-size: .875rem;
}
#mars .hint p {
  margin: 4px 0 0;
}
#mars .mission-board {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  align-self: start;
  background: white;
}
#mars .outpost {
  position: relative;
  background: #182b3d;
  overflow: hidden;
}
#mars .outpost img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 60%;
  display: block;
}
#mars .board-caption {
  position: absolute;
  bottom: 9px;
  left: 15px;
  background: #142633e8;
  color: #fff;
  padding: 3px 7px;
  font-size: .625rem;
  letter-spacing: .15em;
}
#mars .board-body {
  padding: 20px 23px;
}
#mars .board-body h2 {
  font-size: 1.6rem;
  line-height: 1.18;
  letter-spacing: -.04em;
}
#mars .board-body p {
  font-size: .875rem;
}
#mars .board-body .gate {
  letter-spacing: .08em;
  font-weight: 700;
  color: var(--rust);
  margin-bottom: 10px;
}
#mars .endpoint {
  border-top: 1px solid #e0e3e4;
  padding-top: 12px;
  color: #475660;
}
#mars .scope {
  font-size: .75rem!important;
  color: #5a6670;
  line-height: 1.5;
  margin-bottom: 0;
}
#mars .patch {
  border: 1px solid #9cbaaa;
  background: #ebf4eb;
  padding: 12px 16px;
  color: #285941;
  margin-bottom: 14px;
  font-weight: 600;
  border-radius: 5px;
  animation: patch-in .2s ease-out;
}
#mars .patch small {
  display: block;
  font-size: .8125rem;
  margin-left: 18px;
}
#mars .debrief-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 12px 0 16px;
}
#mars details {
  border-top: 1px solid var(--border);
}
#mars summary {
  cursor: pointer;
  min-height: 60px;
  padding: 17px 0;
  font-size: 1rem;
  font-weight: 600;
}
#mars summary span {
  font-size: .875rem;
  font-weight: 400;
  color: #596570;
  margin-left: 18px;
}
#mars .detail-body {
  padding: 0 0 26px;
}
#mars .detail-body h3 {
  margin-top: 24px;
  margin-bottom: 12px;
  font-size: 1.15rem;
}
#mars .detail-body p,
#mars .detail-body li {
  font-size: .9375rem;
  max-width: 950px;
}
#mars .detail-body li {
  margin-bottom: 10px;
}
#mars .detail-body a {
  color: #964019;
  text-decoration: underline;
}
#mars .table-wrap {
  overflow-x: auto;
  margin: 15px 0;
  max-width: 100%;
}
#mars table {
  border-collapse: collapse;
  min-width: 100%;
  font-size: .8125rem;
  text-align: left;
  font-variant-numeric: tabular-nums;
}
#mars caption {
  text-align: left;
  color: #596570;
  margin-bottom: 10px;
}
#mars th,
#mars td {
  padding: 10px 13px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
#mars th {
  font-weight: 600;
}
#mars thead {
  background: #e9ecec;
}
#mars td {
  white-space: nowrap;
}
#mars .charts {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 18px;
  margin-top: 25px;
}
#mars .chart {
  background: white;
  border: 1px solid var(--border);
  padding: 12px;
  border-radius: 6px;
}
#mars .chart figcaption {
  display: flex;
  justify-content: space-between;
  font-size: .875rem;
  font-weight: 600;
}
#mars .chart figcaption span {
  font-weight: 400;
  color: #626e77;
}
#mars .chart svg {
  width: 100%;
  height: auto;
  overflow: visible;
}
#mars .chart text {
  font: 12px Arial;
  fill: #4e5c65;
}
#mars .chart p {
  font-size: .75rem;
  margin: 0;
}
#mars .axis {
  stroke: #adb6bb;
  stroke-width: 1;
  fill: none;
}
#mars .floor {
  stroke: #917a62;
  stroke-dasharray: 2 4;
}
#mars .stock-line {
  fill: none;
  stroke: var(--resource);
  stroke-width: 2.5;
}
#mars .baseline-line {
  fill: none;
  stroke: #68747e;
  stroke-width: 2;
  stroke-dasharray: 5 4;
}
#mars .event-line {
  stroke: #dbd5cc;
  stroke-dasharray: 3 4;
}
#mars .legend {
  font-size: .8125rem!important;
  margin-top: 14px;
}
#mars .corrections {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  background: #edf0ed;
  padding: 18px;
  margin: 20px 0;
}
#mars .corrections h4 {
  margin-bottom: 10px;
}
#mars .corrections p {
  font-size: .875rem;
  margin: 8px 0;
}
#mars .equations {
  background: #e9edee;
  border-radius: 4px;
  padding: 16px;
  font-variant-numeric: tabular-nums;
}
#mars .equations p {
  margin: 0 0 7px;
  font-size: .875rem;
}
#mars .assumptions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  font-size: .875rem;
  max-width: 730px;
}
#mars dt,
#mars dd {
  margin: 0;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
}
#mars dd {
  text-align: right;
}
#mars .session-footer {
  border-top: 1px solid var(--border);
  padding-top: 18px;
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  font-size: .8125rem;
  color: #596570;
}
#mars .session-footer p {
  max-width: 670px;
  margin: 0;
}
#mars .session-footer small {
  font-size: .75rem;
}
#mars .fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 15px 0;
}
#mars .sandbox-controls {
  margin: 20px 0;
}
#mars .sandbox-controls summary {
  font-size: .875rem;
  min-height: 44px;
  padding-block: 12px;
}
#mars .capacity {
  font-size: .8125rem;
  color: #50616b;
  margin-top: 10px;
}
#mars .apply-preview {
  background: #f0eee5;
  padding: 16px;
  margin-top: 20px;
  font-size: .875rem;
}
#mars .apply-preview p {
  margin: 10px 0;
}
#mars .apply-preview button {
  margin: 8px 6px 0 0;
  text-align: left;
}
#mars .crew-control {
  display: flex;
  gap: 15px;
  align-items: center;
  margin-bottom: 17px;
}
#mars .crew-control .field {
  max-width: 115px;
}
#mars .crew-control p {
  font-size: .8125rem;
  max-width: 240px;
  margin: 0;
}
#mars .fail-text {
  color: #a3381a!important;
}
#mars .status.invalid {
  padding: 16px;
  background: #fff0e7;
  border-left: 3px solid #a3381a;
  margin-bottom: 15px;
}
#mars .status.invalid p {
  margin: 5px 0 0;
}
#mars progress {
  accent-color: var(--rust);
  width: 100%;
  height: 10px;
  margin: 12px 0;
}
#mars .run-stocks {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}
#mars .run-stocks strong {
  display: block;
  font-weight: 500;
}
.sr-only {
  position: absolute!important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
@keyframes patch-in {
  from {
    transform: translateY(5px);
    opacity: .5;
  }
  to {
    transform: none;
    opacity: 1;
  }
}
@media(max-width:1000px) {
  #mars {
    padding-inline: 24px;
  }
  #mars .play-layout {
    gap: 20px;
    grid-template-columns: minmax(0,1.3fr) minmax(0,1fr);
  }
  #mars h1 span {
    display: block;
    margin: 6px 0 0;
  }
  #mars .supply {
    padding: 12px 8px;
  }
  #mars .supply input {
    font-size: 1.3rem;
  }
}
@media(max-width:760px) {
  #mars {
    padding: 22px 18px 32px;
  }
  #mars .app-top {
    align-items: flex-start;
  }
  #mars h1 {
    font-size: 1.75rem;
  }
  #mars h1 span {
    font-size: 1.4rem;
  }
  #mars .model-link {
    font-size: .75rem;
    max-width: 95px;
    white-space: normal;
    text-align: right;
  }
  #mars .tagline {
    font-size: .8125rem;
    max-width: 265px;
  }
  #mars .mode-line {
    margin-bottom: 12px;
  }
  #mars .progress {
    text-align: right;
  }
  #mars .mission {
    line-height: 1.3;
  }
  #mars .mission-num {
    font-size: .875rem;
  }
  #mars .brief {
    display: block;
  }
  #mars .brief h2 {
    font-size: 1.3rem;
    margin-bottom: 6px;
  }
  #mars .mission-rules span {
    display: flex;
    gap: 4px;
    align-items: baseline;
  }
  #mars .mission-rules b {
    font-weight: 600;
  }
  #mars .play-layout {
    display: flex;
    flex-direction: column;
    padding-top: 17px;
    gap: 20px;
  }
  #mars .packing>h2 {
    margin-bottom: 10px;
  }
  #mars .check-row {
    margin-bottom: 12px;
  }
  #mars .supply-grid {
    grid-template-columns: 1fr;
    gap: 9px;
  }
  #mars .supply {
    display: grid;
    grid-template-columns: 88px minmax(0,1fr);
    gap: 7px 14px;
    align-items: center;
    padding: 12px;
    border-top-width: 1px;
    border-left: 3px solid var(--resource);
  }
  #mars .supply-top {
    margin: 0;
  }
  #mars .supply-top .unit {
    display: none;
  }
  #mars .supply-top h3 {
    font-size: .9375rem;
  }
  #mars .supply .field {
    min-width: 0;
  }
  #mars .supply input {
    font-size: 1.2rem;
    padding: 5px 8px;
  }
  #mars .steps {
    grid-column: 1/-1;
    grid-template-columns: repeat(2,1fr);
    margin: 0;
  }
  #mars .steps button {
    min-height: 40px;
  }
  #mars .projection {
    margin: 0;
    padding-top: 7px;
    font-size: .8125rem;
    gap: 5px;
    flex-wrap: wrap;
  }
  #mars .projection br {
    display: none;
  }
  #mars .projection strong:first-child {
    margin-right: 10px;
  }
  #mars .outpost {
    height: 180px;
  }
  #mars .board-body {
    padding: 20px;
  }
  #mars .board-body h2 {
    font-size: 1.45rem;
  }
  #mars .charts {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  #mars .corrections {
    grid-template-columns: 1fr;
  }
  #mars summary span {
    display: block;
    font-size: .8125rem;
    margin-left: 18px;
  }
  #mars .session-footer {
    gap: 8px;
  }
  #mars .assumptions {
    grid-template-columns: 1.2fr 1fr;
    gap: 0 12px;
  }
  #mars .fields {
    gap: 12px 10px;
  }
  #mars .field label {
    font-size: .75rem;
  }
  .site-header .nav-links a:not(.contact) {
    display: none;
  }
  .site-header .nav-links {
    gap: 0;
  }
}
@media(prefers-reduced-motion:reduce) {
  #mars *,
  #mars *::before,
  #mars *::after {
    animation: none!important;
    transition: none!important;
    scroll-behavior: auto!important;
  }
}
@media(max-width:350px) {
  #mars {
    padding-inline: 12px;
  }
  #mars .check {
    font-size: .65rem;
  }
  #mars .pack-actions {
    flex-wrap: wrap;
  }
  #mars .mission {
    font-size: .6875rem;
  }
  #mars .fields {
    grid-template-columns: 1fr;
  }
}
#mars .event-markers {
  font-size: .8125rem;
  padding-left: 18px;
}
#mars .run-stocks small {
  font-size: .75rem;
}
#mars #replay summary {
  font-size: .875rem;
  min-height: 44px;
  padding: 10px 0;
}
@media(max-width:760px) {
  .site-header .nav {
    flex-direction: row;
    align-items: center;
    gap: 10px;
  }
  .site-header .nav-links {
    margin: 0;
  }
  #mars .app-top {
    gap: 8px;
  }
}
@media(max-width:760px) {
  .site-header .nav {
    display: flex;
    flex-wrap: nowrap;
    padding-block: 8px;
    min-height: 64px;
  }
  .site-header .nav-links {
    width: auto;
    display: flex;
  }
  .site-header .nav-links .contact {
    padding: 5px 9px;
  }
  #mars .brief {
    padding-block: 12px;
  }
  #mars .check b {
    display: none;
  }
  #mars .check {
    font-size: .75rem;
  }
  #mars .supply-top {
    gap: 6px;
  }
}
/* Review: one run action, clearer mission rules and stock targets. */
#mars .brief .mission-objective {
  margin-top: 8px;
}
#mars .mission-rules {
  padding-top: 8px;
}
#mars .reserve-note {
  font-size: .875rem;
  line-height: 1.6;
  margin: 0;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  max-width: none;
}
#mars .packing-help,
#mars .run-help,
#mars .scenario-help {
  font-size: .875rem;
  color: #53616b;
  line-height: 1.5;
}
#mars .packing-help {
  margin: -4px 0 16px;
}
#mars .run-help {
  margin: 8px 0;
}
#mars .projection {
  display: block;
  font-size: .875rem;
  line-height: 1.45;
}
#mars .projection p {
  margin: 0 0 10px;
}
#mars .projection p:last-child {
  margin-bottom: 0;
}
#mars .projection strong {
  display: block;
  font-variant-numeric: tabular-nums;
  font-size: .9375rem;
  margin-right: 0;
}
#mars .check-row {
  flex-wrap: wrap;
}
#mars .check {
  font-size: .875rem;
}
#mars .check b {
  display: inline;
}
#mars .field label {
  font-size: .875rem;
}
#mars .board-body p,
#mars .detail-body p,
#mars .detail-body li {
  font-size: 1rem;
}
#mars .board-body .scope {
  font-size: .875rem!important;
}
#mars .board-body .gate {
  font-size: .75rem;
}
#mars .outpost {
  height: 160px;
}
@media(max-width:1000px) {
  #mars .brief {
    flex-direction: column;
    gap: 10px;
  }
  #mars .brief p:last-child {
    max-width: 720px;
  }
  #mars .mission-rules {
    padding-top: 0;
  }
  #mars .mission-rules span {
    display: flex;
    align-items: baseline;
    gap: 5px;
  }
  #mars .mission-rules b {
    font-size: 1rem;
  }
}
@media(max-width:760px) {
  #mars .brief p {
    font-size: 1rem;
  }
  #mars .mission-rules {
    flex-wrap: wrap;
    margin-top: 10px;
  }
  #mars .mission-rules span {
    font-size: .875rem;
  }
  #mars .projection {
    display: block;
    grid-column: 1/-1;
  }
  #mars .projection p {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    margin: 0 0 5px;
  }
  #mars .projection strong {
    font-size: .875rem;
    text-align: right;
  }
  #mars .check-row {
    gap: 5px;
    flex-wrap: wrap;
  }
  #mars .check {
    padding: 4px 6px;
  }
  #mars .pack-actions {
    flex-wrap: wrap;
  }
  #mars .pack-actions>.primary {
    min-width: 180px;
  }
}
/* Completed stress tests become a game result screen. */
#mars .result-board {
  --result-dark: #123f35;
  --result-color: #17684e;
  --result-accent: #8af1b9;
  border: 2px solid var(--result-color);
}
#mars .result-failure {
  --result-dark: #571e28;
  --result-color: #a52d3d;
  --result-accent: #ffb2ab;
}
#mars .result-hero {
  padding: 26px 24px 28px;
  background: var(--result-dark);
  color: white;
  text-align: center;
  scroll-margin-top: 100px;
  animation: result-reveal .28s ease-out;
}
#mars .result-emblem {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  margin: 0 auto 16px;
  border: 3px solid var(--result-accent);
  border-radius: 50%;
  color: var(--result-accent);
  font-family: Arial,sans-serif;
  font-size: 3rem;
  line-height: 1;
  font-weight: 700;
}
#mars .result-failure .result-emblem {
  border-radius: 16px;
}
#mars .result-hero .result-eyebrow {
  font-size: .875rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--result-accent);
  margin: 0 0 9px;
}
#mars .result-hero h2 {
  font-size: clamp(2.25rem,3.6vw,3.25rem);
  line-height: 1.02;
  letter-spacing: -.04em;
  font-weight: 750;
  color: white;
  text-transform: uppercase;
  margin: 0 0 16px;
  scroll-margin-top: 100px;
}
#mars .result-hero h2:focus-visible {
  outline: 2px solid var(--result-accent);
  outline-offset: 6px;
}
#mars .result-hero .result-reason {
  font-size: 1rem;
  line-height: 1.55;
  color: #fff;
  margin: 0 auto;
  max-width: 35ch;
}
#mars .result-checks {
  list-style: none;
  margin: 0;
  padding: 0;
}
#mars .result-checks li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 5px 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
  font-size: .875rem;
}
#mars .result-checks li>span>span {
  display: inline-block;
  width: 18px;
  font-weight: 700;
}
#mars .result-checks strong {
  font-size: .875rem;
  font-weight: 700;
}
#mars .result-checks .met {
  color: #225740;
}
#mars .result-checks .unmet {
  color: #97283a;
}
#mars .result-board .debrief-actions {
  margin: 18px 0;
  gap: 10px;
}
#mars .result-board .debrief-actions .primary {
  width: 100%;
  background: var(--result-color);
  border-color: var(--result-color);
  font-size: 1rem;
}
#mars .result-board .debrief-actions .primary:hover {
  background: var(--result-dark);
  border-color: var(--result-dark);
}
#mars .result-board .debrief-actions .quiet {
  font-size: .875rem;
}
@keyframes result-reveal {
  from {
    opacity: .5;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@media(max-width:760px) {
  #mars .mission-board {
    width: 100%;
  }
  #mars .result-hero {
    padding: 24px 20px;
  }
  #mars .result-hero h2 {
    font-size: 2.5rem;
  }
}
/* Supply charts lead with the decision, then show its trajectory. */
#mars .stock-charts {
  margin: 28px 0 32px;
}
#mars .chart-section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
#mars .chart-section-heading h3 {
  margin: 0;
  font-size: 1.35rem;
}
#mars .chart-section-heading>span {
  font-size: .875rem;
  font-weight: 600;
  color: #4c5a65;
}
#mars .stock-charts .chart-explainer {
  font-size: .9375rem;
  max-width: 850px;
  margin: 10px 0 16px;
  line-height: 1.55;
}
#mars .chart-key {
  display: flex;
  gap: 10px 22px;
  flex-wrap: wrap;
  font-size: .875rem;
  margin: 0 0 16px;
  color: #465560;
}
#mars .chart-key>span {
  display: flex;
  gap: 8px;
  align-items: center;
}
#mars .chart-key i {
  display: inline-block;
  width: 24px;
  flex-shrink: 0;
}
#mars .key-stock {
  border-top: 3px solid #354c61;
}
#mars .key-reserve {
  border-top: 2px dashed #996109;
}
#mars .key-disruption {
  height: 14px;
  background: #e4ebf0;
  border: 1px solid #bac9d3;
}
#mars .resource-charts {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 14px;
}
#mars .resource-chart {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 10px;
  margin: 0;
  padding: 14px;
  background: #fff;
  border: 1px solid #cbd3d7;
  border-top: 3px solid var(--resource);
  border-radius: 7px;
  --state: #246144;
  --state-bg: #edf5ef;
}
#mars .resource-chart.is-short {
  --state: #98530a;
  --state-bg: #fff3de;
}
#mars .resource-chart.is-empty {
  --state: #9d2d3d;
  --state-bg: #fff0f1;
}
#mars .chart-resource {
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 10px;
}
#mars .chart-status {
  display: inline-block;
  border-radius: 4px;
  padding: 3px 6px;
  font-size: .875rem;
  font-weight: 600;
  color: var(--state);
  background: var(--state-bg);
}
#mars .chart-number {
  font-size: 1.4rem;
  line-height: 1.18;
  letter-spacing: -.03em;
  display: block;
  font-variant-numeric: tabular-nums;
  color: var(--state);
}
#mars .resource-chart .chart-result-detail {
  font-size: .875rem;
  line-height: 1.4;
  margin: 6px 0 8px;
  font-weight: 600;
  color: var(--state);
}
#mars .resource-chart .chart-quantity {
  font-size: .8125rem;
  color: #53616b;
  margin: 0 0 8px;
  line-height: 1.4;
}
#mars .resource-chart .chart-action {
  font-size: .875rem;
  line-height: 1.4;
  margin: 0;
  padding-top: 8px;
  border-top: 1px solid #dce1e3;
}
#mars .chart-visual {
  min-width: 0;
  width: 100%;
  margin-top: auto;
}
#mars .stock-plot {
  display: block;
  width: 100%;
  max-width: 320px;
  margin-inline: auto;
  height: auto;
  overflow: visible;
}
#mars .stock-plot text {
  font-family: Arial,sans-serif;
  font-size: 15px;
  fill: #4a5c67;
  font-variant-numeric: tabular-nums;
}
#mars .stock-plot .axis-title {
  font-size: 15px;
  fill: #344b5b;
  font-weight: 600;
}
#mars .chart-grid {
  stroke: #d8e0e4;
  stroke-width: 1;
}
#mars .disruption-band {
  fill: #e4ebf0;
}
#mars .unmet-band {
  fill: #a83244;
  opacity: .09;
}
#mars .reserve-rule {
  stroke: #996109;
  stroke-width: 1.6;
  stroke-dasharray: 6 5;
}
#mars .stock-plot .reserve-label {
  fill: #815008;
  font-weight: 600;
  paint-order: stroke;
  stroke: white;
  stroke-width: 4px;
  stroke-linejoin: round;
}
#mars .supply-line {
  fill: none;
  stroke: var(--resource);
  stroke-width: 3;
  stroke-linejoin: round;
}
#mars .finish-point {
  fill: var(--resource);
  stroke: #fff;
  stroke-width: 1.5;
}
#mars .shortage-point {
  stroke: #9d2d3d;
  stroke-width: 2.5;
  fill: none;
}
#mars .resource-chart .chart-comparison {
  margin: 2px 0 0;
  font-size: .8125rem;
  line-height: 1.4;
  color: #53616b;
}
#mars .resource-chart .chart-empty-note {
  color: #9d2d3d;
  font-size: .875rem;
  line-height: 1.45;
  margin: 0 0 6px;
}
#mars .stock-charts .chart-footnote {
  font-size: .875rem;
  line-height: 1.55;
  color: #53616b;
  margin: 14px 0 0;
  max-width: none;
}
@media(max-width:760px) {
  #mars .resource-charts {
    grid-template-columns: 1fr;
  }
  #mars .resource-chart {
    padding: 14px;
  }
  #mars .chart-key {
    gap: 10px 16px;
  }
}
#mars .chart-number,
#mars .chart-result-detail,
#mars .chart-quantity {
  overflow-wrap: anywhere;
}
/* A compact, shared briefing sits above the game modes. */
#mars .simulation-intro {
  display: grid;
  grid-template-columns: minmax(0,1fr) minmax(0,.9fr);
  align-items: end;
  gap: 24px 48px;
  padding-bottom: 20px;
}
#mars .simulation-intro .kicker {
  font-size: .875rem;
  letter-spacing: .06em;
  margin-bottom: 9px;
}
#mars .simulation-intro h1 {
  font-size: clamp(2rem,3.4vw,2.65rem);
  line-height: 1.1;
  letter-spacing: -.04em;
  margin: 0;
}
#mars .simulation-intro h1 span {
  display: block;
  font-size: 1.125rem;
  line-height: 1.4;
  letter-spacing: 0;
  font-weight: 400;
  color: #5b666d;
  margin: 6px 0 0;
}
#mars .intro-copy {
  font-size: 1rem;
  line-height: 1.6;
  color: #4d5c65;
  max-width: 47ch;
  margin: 0;
}
#mars .simulation-guide {
  border-top: 2px solid var(--rust);
  padding-top: 14px;
}
#mars .challenge-setup {
  font-size: .875rem;
  line-height: 1.6;
  margin: 0 0 17px;
  color: #4d5c65;
}
#mars .challenge-setup strong {
  font-weight: 600;
  color: var(--navy);
  margin-right: 10px;
}
#mars .guide-columns {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 24px;
}
#mars .guide-columns>section {
  min-width: 0;
}
#mars .guide-columns>section+section {
  border-left: 1px solid var(--border);
  padding-left: 24px;
}
#mars .guide-columns h2 {
  font-size: 1rem;
  line-height: 1.4;
  letter-spacing: 0;
  font-weight: 600;
  margin: 0 0 6px;
}
#mars .guide-columns p {
  font-size: 1rem;
  line-height: 1.55;
  color: #4d5c65;
  margin: 0;
}
#mars .intro-details {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  column-gap: 24px;
  margin-top: 14px;
  border-bottom: 1px solid var(--border);
}
#mars .intro-details>details {
  border-top: 0;
  min-width: 0;
}
#mars .intro-details>details[open] {
  grid-column: 1/-1;
}
#mars .intro-details>details>summary {
  font-size: .875rem;
  line-height: 1.5;
  min-height: 44px;
  padding: 11px 0;
  color: #81401f;
  font-weight: 500;
}
#mars .project-story {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 24px;
  padding: 12px 0;
}
#mars .project-story h2 {
  font-size: 1rem;
  letter-spacing: 0;
  margin: 0 0 8px;
}
#mars .project-story p {
  font-size: 1rem;
  line-height: 1.6;
  color: #4d5c65;
  margin: 0;
}
#mars .project-boundary {
  font-size: .875rem;
  color: #596570;
  line-height: 1.6;
  padding: 12px 0;
  margin: 0;
  border-top: 1px solid var(--border);
}
#mars .mode-line {
  margin: 20px 0 14px;
}
#mars .mode-switch {
  background: transparent;
  padding: 0;
  border: 0;
  border-radius: 0;
  gap: 4px;
}
#mars .mode-switch button {
  font-size: 1rem;
  border-radius: 0;
  border-bottom: 2px solid transparent;
  padding: 7px 14px;
  min-height: 44px;
  color: #596570;
}
#mars .mode-switch .selected {
  background: transparent;
  box-shadow: none;
  border-bottom-color: var(--rust);
  color: var(--navy);
}
#mars .mode-switch button:hover {
  background: #eeeee8;
}
#mars .progress {
  font-size: .875rem;
  line-height: 1.4;
}
#mars .mission-strip {
  gap: 10px;
}
#mars .mission {
  min-height: 58px;
  padding: 10px 12px;
  gap: 10px;
  border-radius: 4px;
  font-size: .9375rem;
  line-height: 1.35;
}
#mars .mission-num {
  font: 500 .875rem/1.4 var(--sans,Arial,sans-serif);
  opacity: .8;
}
#mars .mission small {
  font-size: .875rem;
  margin-top: 2px;
}
#mars .brief {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  align-items: start;
  gap: 18px 28px;
  padding: 18px 20px;
  margin-top: 14px;
  border: 0;
  border-left: 3px solid var(--rust);
  background: #fff;
}
#mars .brief-heading {
  min-width: 0;
}
#mars .brief .kicker {
  font-size: .75rem;
  margin: 0 0 5px;
}
#mars .brief h2 {
  font-size: 1.375rem;
  line-height: 1.25;
  margin: 0 0 8px;
}
#mars .brief p:not(.kicker) {
  font-size: 1rem;
  line-height: 1.5;
  max-width: 65ch;
  margin: 0;
}
#mars .brief .mission-objective {
  font-weight: 500;
  color: var(--navy);
  margin-top: 8px!important;
}
#mars .mission-rules {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 18px;
  padding: 0;
  margin: 0;
  font-size: .875rem;
}
#mars .mission-rules span {
  display: block;
  font-size: .875rem;
  line-height: 1.4;
  color: #596570;
}
#mars .mission-rules b {
  display: block;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 3px;
}
#mars .brief .mission-rules>.quiet {
  grid-column: 1/-1;
}
@media(max-width:1000px) {
  #mars .simulation-intro {
    gap: 24px;
  }
  #mars .guide-columns {
    gap: 18px;
  }
  #mars .guide-columns>section+section {
    padding-left: 18px;
  }
  #mars .brief {
    grid-template-columns: 1fr;
  }
  #mars .mission-rules {
    width: max-content;
    max-width: 100%;
    gap: 28px;
  }
}
@media(max-width:760px) {
  #mars .simulation-intro {
    grid-template-columns: 1fr;
    gap: 10px;
    padding-bottom: 16px;
  }
  #mars .intro-copy {
    max-width: 60ch;
  }
  #mars .guide-columns {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  #mars .guide-columns>section+section {
    border-left: 0;
    padding-left: 0;
  }
  #mars .guide-columns h2 {
    margin-bottom: 3px;
  }
  #mars .challenge-setup strong {
    display: block;
    margin: 0 0 2px;
  }
  #mars .project-story {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  #mars .intro-details {
    gap: 0 14px;
    margin-top: 10px;
  }
  #mars .intro-details>details>summary {
    font-size: .875rem;
  }
  #mars .mode-line {
    margin-top: 16px;
    gap: 8px;
  }
  #mars .mode-switch {
    gap: 0;
  }
  #mars .mode-switch button {
    padding-inline: 10px;
    font-size: .9375rem;
  }
  #mars .progress {
    font-size: .8125rem;
    max-width: 105px;
  }
  #mars .mission-strip {
    gap: 6px;
  }
  #mars .mission {
    gap: 6px;
    min-height: 54px;
    padding: 9px 7px;
    font-size: .875rem;
    align-items: center;
  }
  #mars .mission small {
    display: none;
  }
  #mars .brief {
    padding: 14px;
    margin-top: 12px;
    gap: 14px;
  }
  #mars .mission-rules {
    gap: 24px;
  }
  #mars .mission-rules b {
    font-size: 1.125rem;
  }
}
@media(max-width:380px) {
  #mars .mission {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }
  #mars .mission-rules {
    width: 100%;
    gap: 12px;
  }
  #mars .intro-details {
    grid-template-columns: 1fr;
  }
  #mars .intro-details>details>summary {
    padding-block: 9px;
  }
}
/* Keep the explanation hierarchy and reading rhythm consistent. */
#mars #analysis>.detail-body {
  padding: 4px 0 28px;
}
#mars #analysis .analysis-overview {
  max-width: 78ch;
}
#mars #analysis .analysis-overview h3,
#mars #analysis .chart-section-heading h3 {
  font-size: 1.25rem;
  line-height: 1.3;
  margin: 0 0 10px;
}
#mars #analysis .analysis-overview p,
#mars #analysis>.detail-body>p {
  font-size: 1rem;
  line-height: 1.6;
  margin: 0 0 12px;
}
#mars #analysis .analysis-overview .analysis-endpoint {
  color: #53616b;
  margin-bottom: 0;
}
#mars #analysis .stock-charts {
  margin: 24px 0 28px;
}
#mars #analysis .chart-section-heading h3 {
  margin: 0;
}
#mars #analysis .chart-explainer {
  font-size: 1rem;
  line-height: 1.6;
  margin: 10px 0 16px;
}
#mars #analysis .corrections {
  gap: 20px;
  margin: 24px 0;
  padding: 18px;
}
#mars #analysis .corrections h4 {
  font-size: 1rem;
  line-height: 1.4;
  margin: 0 0 10px;
}
#mars #analysis .corrections p {
  font-size: 1rem;
  line-height: 1.6;
  margin: 8px 0;
}
#mars #analysis .equations {
  margin: 20px 0 16px;
}
#mars #analysis .equations p {
  font-size: 1rem;
  line-height: 1.6;
  margin: 0 0 8px;
}
#mars #analysis .equations p:last-child {
  margin-bottom: 0;
}
#mars #analysis .table-wrap {
  margin: 16px 0;
}

@media(max-width:380px) {
  .site-header .nav { flex-wrap: wrap; }
}
