:root {
  --ink: #17231f;
  --ink-soft: #42514b;
  --muted: #6f7d77;
  --paper: #f7f4eb;
  --paper-deep: #ede8da;
  --panel: rgba(255, 255, 255, 0.91);
  --panel-solid: #ffffff;
  --line: rgba(23, 35, 31, 0.13);
  --line-strong: rgba(23, 35, 31, 0.24);
  --forest: #214f45;
  --forest-dark: #153c34;
  --teal: #2f7b70;
  --teal-light: #d8ece7;
  --blue: #377893;
  --blue-light: #dcecf2;
  --gold: #d99a3d;
  --gold-light: #faecd3;
  --coral: #d7654d;
  --coral-light: #f7ded7;
  --danger: #a73e32;
  --success: #2e7357;
  --shadow: 0 18px 48px rgba(30, 41, 36, 0.11);
  --shadow-small: 0 8px 22px rgba(30, 41, 36, 0.08);
  --radius-large: 24px;
  --radius: 18px;
  --radius-small: 12px;
  --max-width: 1480px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 4%, rgba(47, 123, 112, 0.13), transparent 27rem),
    radial-gradient(circle at 92% 1%, rgba(217, 154, 61, 0.14), transparent 24rem),
    linear-gradient(180deg, #f7f4eb 0%, #f0ede4 62%, #e9e6dc 100%);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  line-height: 1.5;
  min-height: 100vh;
}

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

button,
select,
input[type="range"],
.toggle {
  cursor: pointer;
}

button:focus-visible,
select:focus-visible,
input:focus-visible,
textarea:focus-visible,
.map-frame:focus-visible {
  outline: 3px solid rgba(55, 120, 147, 0.42);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 1000;
  padding: 10px 14px;
  color: white;
  background: var(--forest-dark);
  border-radius: 10px;
  transform: translateY(-150%);
  transition: transform 160ms ease;
}

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

.site-header {
  width: min(var(--max-width), calc(100% - 36px));
  margin: 24px auto 18px;
  padding: 30px 34px;
  color: #f9fbf9;
  background:
    linear-gradient(120deg, rgba(22, 61, 52, 0.98), rgba(31, 75, 68, 0.95)),
    linear-gradient(45deg, #153c34, #295f53);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 28px;
  box-shadow: 0 22px 60px rgba(25, 54, 47, 0.22);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  overflow: hidden;
  position: relative;
}

.site-header::before,
.site-header::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
}

.site-header::before {
  width: 320px;
  height: 320px;
  right: -190px;
  top: -200px;
}

.site-header::after {
  width: 230px;
  height: 230px;
  left: 45%;
  bottom: -205px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 24px;
  position: relative;
  z-index: 1;
}

.brand-mark {
  width: 76px;
  height: 76px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  display: grid;
  place-items: center;
  position: relative;
  flex: 0 0 auto;
  overflow: hidden;
}

.brand-wave {
  position: absolute;
  width: 54px;
  height: 13px;
  border: 3px solid #f3c878;
  border-color: #f3c878 transparent transparent transparent;
  border-radius: 50%;
  transform: rotate(-8deg);
}

.brand-wave-one {
  top: 23px;
}

.brand-wave-two {
  top: 34px;
  width: 43px;
  border-color: #95cfbf transparent transparent transparent;
}

.brand-wave-three {
  top: 45px;
  width: 31px;
  border-color: #d7e8e2 transparent transparent transparent;
}

.eyebrow,
.section-kicker {
  margin: 0 0 6px;
  color: var(--teal);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.site-header .eyebrow {
  color: #a9d9cd;
}

.site-header h1 {
  margin: 0;
  font-size: clamp(1.9rem, 3vw, 3.2rem);
  line-height: 1.04;
  letter-spacing: -0.04em;
}

.header-copy {
  max-width: 820px;
  margin: 10px 0 0;
  color: rgba(249, 251, 249, 0.76);
  font-size: clamp(0.94rem, 1.3vw, 1.08rem);
}

.header-status {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #eaf4f0;
  font-size: 0.84rem;
  font-weight: 700;
  position: relative;
  z-index: 1;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #82d3b4;
  box-shadow: 0 0 0 5px rgba(130, 211, 180, 0.12);
}

main {
  width: min(var(--max-width), calc(100% - 36px));
  margin: 0 auto;
  display: grid;
  gap: 18px;
}

.panel {
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: var(--radius-large);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.mission-card {
  padding: 24px 28px;
  display: grid;
  grid-template-columns: minmax(320px, 1fr) 1.25fr;
  gap: 24px;
  align-items: center;
}

.mission-card h2 {
  margin: 0;
  max-width: 720px;
  font-size: clamp(1.35rem, 2.1vw, 2rem);
  line-height: 1.2;
  letter-spacing: -0.025em;
}

.mission-steps {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.mission-steps li {
  min-height: 84px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(247, 244, 235, 0.72);
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.mission-steps li > span {
  width: 27px;
  height: 27px;
  border-radius: 9px;
  color: white;
  background: var(--forest);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  font-size: 0.77rem;
  font-weight: 800;
}

.mission-steps strong {
  display: block;
  font-size: 0.9rem;
}

.mission-steps small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.35;
}

.control-panel,
.seismogram-section,
.hazard-section,
.ngss-section {
  padding: 26px 28px;
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
}

.panel-heading.compact {
  margin-bottom: 12px;
}

.panel-heading h2 {
  margin: 0;
  font-size: clamp(1.35rem, 1.8vw, 1.75rem);
  letter-spacing: -0.025em;
}

.model-note {
  max-width: 470px;
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.83rem;
  text-align: right;
}

.controls-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr 1fr auto;
  gap: 16px;
  align-items: end;
}

.control-field {
  display: grid;
  gap: 8px;
}

.control-field > span {
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.035em;
}

.control-field output {
  float: right;
  color: var(--forest);
  font-weight: 900;
}

select,
textarea {
  width: 100%;
  color: var(--ink);
  background: #fbfaf6;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  transition:
    border-color 150ms ease,
    box-shadow 150ms ease,
    background 150ms ease;
}

select {
  min-height: 45px;
  padding: 0 39px 0 13px;
}

textarea {
  min-height: 91px;
  padding: 12px 13px;
  resize: vertical;
}

select:hover,
textarea:hover,
select:focus,
textarea:focus {
  border-color: rgba(47, 123, 112, 0.52);
  background: white;
  box-shadow: 0 0 0 4px rgba(47, 123, 112, 0.08);
}

input[type="range"] {
  width: 100%;
  accent-color: var(--teal);
}

.button-group {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
}

.button {
  min-height: 44px;
  padding: 0 17px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-weight: 800;
  font-size: 0.84rem;
  transition:
    transform 140ms ease,
    box-shadow 140ms ease,
    background 140ms ease,
    border-color 140ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:active {
  transform: translateY(0);
}

.button-primary {
  color: white;
  background: var(--forest);
  box-shadow: 0 8px 20px rgba(33, 79, 69, 0.18);
}

.button-primary:hover {
  background: var(--forest-dark);
  box-shadow: 0 10px 24px rgba(33, 79, 69, 0.25);
}

.button-secondary {
  color: var(--forest-dark);
  background: var(--teal-light);
  border-color: rgba(47, 123, 112, 0.22);
}

.button-secondary:hover {
  background: #cae4dd;
  border-color: rgba(47, 123, 112, 0.36);
}

.button[disabled] {
  cursor: not-allowed;
  opacity: 0.48;
  transform: none;
  box-shadow: none;
}

.event-readout {
  margin-top: 20px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background:
    linear-gradient(90deg, rgba(216, 236, 231, 0.4), rgba(247, 244, 235, 0.54));
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.event-readout div {
  padding-right: 14px;
  border-right: 1px solid var(--line);
}

.event-readout div:last-child {
  border-right: 0;
  padding-right: 0;
}

.event-readout span,
.event-readout strong {
  display: block;
}

.event-readout span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.event-readout strong {
  margin-top: 4px;
  font-size: 0.92rem;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 315px;
  gap: 18px;
  align-items: stretch;
}

.map-panel {
  padding: 24px;
  min-width: 0;
}

.map-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.toggle {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--ink-soft);
  font-size: 0.8rem;
  font-weight: 700;
  user-select: none;
}

.toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.toggle-track {
  width: 38px;
  height: 21px;
  border-radius: 999px;
  background: #c8cfcb;
  position: relative;
  transition: background 160ms ease;
}

.toggle-track::after {
  content: "";
  position: absolute;
  width: 15px;
  height: 15px;
  left: 3px;
  top: 3px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.18);
  transition: transform 160ms ease;
}

.toggle input:checked + .toggle-track {
  background: var(--teal);
}

.toggle input:checked + .toggle-track::after {
  transform: translateX(17px);
}

.text-button {
  padding: 0;
  border: 0;
  color: var(--teal);
  background: transparent;
  font-weight: 800;
  font-size: 0.8rem;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.text-button:hover {
  color: var(--forest-dark);
}

.instruction-line {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.84rem;
}

.map-frame {
  overflow: hidden;
  border: 1px solid rgba(23, 35, 31, 0.16);
  border-radius: 22px;
  background: #d9d5c5;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.45);
  position: relative;
}

#mapSvg {
  display: block;
  width: 100%;
  min-height: 410px;
  touch-action: none;
  cursor: crosshair;
}

.zone-line {
  stroke: rgba(47, 70, 61, 0.18);
  stroke-width: 1;
  stroke-dasharray: 5 7;
}

.zone-label {
  fill: rgba(38, 55, 48, 0.48);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 2px;
}

.river-line {
  fill: none;
  stroke: #7bb2c4;
  stroke-width: 7;
  stroke-linecap: round;
  opacity: 0.55;
}

.fault-line {
  fill: none;
  stroke: #9d5548;
  stroke-width: 5;
  stroke-dasharray: 14 8 4 8;
  stroke-linecap: round;
  opacity: 0.78;
}

.fault-label {
  fill: #7f443a;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 1.4px;
}

.community circle {
  fill: rgba(255, 255, 255, 0.75);
  stroke: rgba(23, 35, 31, 0.2);
}

.community path {
  fill: var(--forest);
}

.community text {
  fill: #27352f;
  font-size: 13px;
  font-weight: 800;
  paint-order: stroke;
  stroke: rgba(247, 244, 235, 0.88);
  stroke-width: 4px;
  stroke-linejoin: round;
}

.station {
  filter: url(#softShadow);
}

.station-ring {
  fill: rgba(255, 255, 255, 0.88);
  stroke-width: 4;
}

.station-a .station-ring {
  stroke: #2f7b70;
}

.station-b .station-ring {
  stroke: #377893;
}

.station-c .station-ring {
  stroke: #d99a3d;
}

.station-core {
  fill: #152f29;
}

.station path {
  fill: none;
  stroke: #152f29;
  stroke-width: 3;
  stroke-linecap: round;
}

.station text {
  fill: #1a2e27;
  font-size: 14px;
  font-weight: 900;
  paint-order: stroke;
  stroke: rgba(247, 244, 235, 0.92);
  stroke-width: 5px;
  stroke-linejoin: round;
}

.arrival-light {
  fill: none;
  stroke: #ffffff;
  stroke-width: 3;
  opacity: 0;
}

.station.p-arrival .arrival-light {
  animation: station-pulse 620ms ease-out 1;
  stroke: #2e90a7;
}

.station.s-arrival .arrival-light {
  animation: station-pulse 760ms ease-out 1;
  stroke: #dc754f;
}

@keyframes station-pulse {
  0% {
    r: 19;
    opacity: 0.85;
  }
  100% {
    r: 40;
    opacity: 0;
  }
}

.history-layer {
  display: none;
}

.history-layer.visible {
  display: block;
}

.history-event {
  stroke: rgba(255, 255, 255, 0.8);
  stroke-width: 1.2;
  opacity: 0.78;
}

.history-event.low {
  fill: #e3aa55;
}

.history-event.medium {
  fill: #d66f4f;
}

.history-event.high {
  fill: #a63f36;
}

.distance-circle {
  fill: none;
  stroke-width: 4;
  stroke-dasharray: 11 7;
  opacity: 0.82;
  vector-effect: non-scaling-stroke;
}

.distance-circle-a {
  stroke: #2f7b70;
}

.distance-circle-b {
  stroke: #377893;
}

.distance-circle-c {
  stroke: #d99a3d;
}

.estimate-marker {
  cursor: grab;
  outline: none;
}

.estimate-marker:active,
.estimate-marker.dragging {
  cursor: grabbing;
}

.estimate-marker .estimate-core {
  fill: rgba(255, 255, 255, 0.94);
  stroke: #1e3440;
  stroke-width: 3;
  filter: url(#softShadow);
}

.estimate-marker .estimate-pulse {
  fill: rgba(49, 117, 139, 0.12);
  stroke: rgba(30, 52, 64, 0.5);
  stroke-width: 2;
  pointer-events: none;
}

.estimate-marker.awaiting-placement .estimate-pulse {
  animation: estimate-ready-pulse 1.35s ease-in-out infinite;
}

.estimate-marker path {
  stroke: #1e3440;
  stroke-width: 3;
  stroke-linecap: round;
  pointer-events: none;
}

.estimate-marker text {
  pointer-events: none;
}

@keyframes estimate-ready-pulse {
  0%, 100% {
    r: 22;
    opacity: 0.7;
  }
  50% {
    r: 31;
    opacity: 0.18;
  }
}

.estimate-marker text,
.epicenter-marker text {
  fill: #1b2b25;
  font-size: 13px;
  font-weight: 900;
  paint-order: stroke;
  stroke: rgba(247, 244, 235, 0.95);
  stroke-width: 5px;
  stroke-linejoin: round;
}

.epicenter-glow {
  fill: rgba(215, 101, 77, 0.24);
  stroke: rgba(215, 101, 77, 0.42);
  stroke-width: 2;
  filter: url(#glow);
  animation: epicenter-breathe 1.8s ease-in-out infinite;
}

.epicenter-core {
  fill: #d7654d;
  stroke: white;
  stroke-width: 3;
}

.epicenter-marker path {
  stroke: white;
  stroke-width: 3;
  stroke-linecap: round;
}

@keyframes epicenter-breathe {
  0%,
  100% {
    r: 19;
    opacity: 0.65;
  }
  50% {
    r: 27;
    opacity: 0.25;
  }
}

.scale-bar rect {
  fill: rgba(255, 255, 255, 0.72);
  stroke: rgba(23, 35, 31, 0.12);
}

.scale-bar line {
  stroke: #20332c;
  stroke-width: 2;
}

.scale-bar text {
  fill: #26382f;
  font-size: 11px;
  font-weight: 800;
}

.map-legend {
  position: absolute;
  left: 14px;
  bottom: 13px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  max-width: calc(100% - 190px);
  padding: 8px 10px;
  border: 1px solid rgba(23, 35, 31, 0.1);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.76);
  backdrop-filter: blur(5px);
}

.map-legend span {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #394740;
  font-size: 0.66rem;
  font-weight: 800;
}

.map-legend i {
  display: inline-block;
}

.legend-station {
  width: 10px;
  height: 10px;
  border: 3px solid var(--teal);
  border-radius: 50%;
  background: white;
}

.legend-community {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--forest);
}

.legend-fault {
  width: 18px;
  border-top: 3px dashed #9d5548;
}

.legend-history {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--coral);
}

.map-feedback {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(247, 244, 235, 0.65);
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
}

.map-feedback.success {
  border-color: rgba(46, 115, 87, 0.28);
  background: rgba(216, 236, 231, 0.56);
}

.map-feedback.warning {
  border-color: rgba(217, 154, 61, 0.38);
  background: rgba(250, 236, 211, 0.58);
}

.feedback-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: white;
  background: var(--forest);
  font-size: 1.2rem;
  font-weight: 900;
}

.map-feedback strong {
  display: block;
  font-size: 0.9rem;
}

.map-feedback p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.76rem;
}

.field-notes-panel {
  padding: 24px;
  display: flex;
  flex-direction: column;
}

.science-note {
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 13px;
}

.note-number {
  width: 31px;
  height: 31px;
  border: 1px solid rgba(47, 123, 112, 0.22);
  border-radius: 10px;
  color: var(--teal);
  background: var(--teal-light);
  display: grid;
  place-items: center;
  font-size: 0.7rem;
  font-weight: 900;
}

.science-note h3 {
  margin: 0;
  font-size: 0.88rem;
}

.science-note p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.76rem;
}

.formula-card {
  margin-top: 17px;
  padding: 17px;
  border-radius: 15px;
  color: white;
  background:
    linear-gradient(145deg, #254e46, #183c34);
  box-shadow: var(--shadow-small);
}

.formula-card p,
.formula-card strong,
.formula-card small {
  display: block;
}

.formula-card p {
  margin: 0 0 7px;
  color: #a9d9cd;
  font-size: 0.69rem;
  font-weight: 900;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.formula-card strong {
  font-size: 0.91rem;
  line-height: 1.35;
}

.formula-card small {
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.66);
  font-size: 0.68rem;
  line-height: 1.45;
}

.progress-card {
  margin-top: auto;
  padding-top: 20px;
}

.progress-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.progress-heading strong {
  color: var(--forest);
}

.progress-track {
  height: 9px;
  margin-top: 8px;
  border-radius: 999px;
  background: #dde1dc;
  overflow: hidden;
}

.progress-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), #6ab9a4);
  transition: width 260ms ease;
}

.seismogram-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 15px;
}

.station-card {
  min-width: 0;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(248, 247, 242, 0.75);
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.station-card:hover {
  border-color: rgba(47, 123, 112, 0.25);
  box-shadow: var(--shadow-small);
  transform: translateY(-1px);
}

.station-card-header {
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.station-card-header > div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.station-card-header h3 {
  margin: 0;
  font-size: 0.92rem;
}

.station-card-header p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.7rem;
}

.station-chip {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  color: white;
  display: grid;
  place-items: center;
  font-weight: 900;
}

.station-chip-a {
  background: var(--teal);
}

.station-chip-b {
  background: var(--blue);
}

.station-chip-c {
  background: var(--gold);
}

.record-status {
  padding: 6px 8px;
  border-radius: 999px;
  color: var(--muted);
  background: #e7e9e5;
  font-size: 0.65rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.record-status.recording {
  color: #724618;
  background: var(--gold-light);
}

.record-status.ready {
  color: var(--success);
  background: var(--teal-light);
}

.seismogram-wrap {
  height: 174px;
  border: 1px solid rgba(22, 43, 35, 0.22);
  border-radius: 13px;
  background:
    linear-gradient(rgba(72, 100, 90, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(72, 100, 90, 0.07) 1px, transparent 1px),
    #fdfcf8;
  background-size: 22px 22px;
  overflow: hidden;
  position: relative;
}

.seismogram-wrap canvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: crosshair;
  touch-action: none;
}

.canvas-placeholder {
  position: absolute;
  inset: 0;
  padding: 20px;
  color: var(--muted);
  background: rgba(253, 252, 248, 0.84);
  display: grid;
  place-items: center;
  text-align: center;
  font-size: 0.76rem;
  font-weight: 700;
}


.wave-pick-help {
  margin: 8px 2px 0;
  color: var(--ink-soft);
  font-size: 0.7rem;
  font-weight: 750;
  line-height: 1.4;
}

.pick-controls {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 7px;
}

.pick-button,
.clear-picks,
.zone-choice {
  min-height: 34px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink-soft);
  background: white;
  font-size: 0.7rem;
  font-weight: 800;
  transition:
    border-color 140ms ease,
    background 140ms ease,
    color 140ms ease;
}

.pick-button:hover,
.clear-picks:hover,
.zone-choice:hover {
  border-color: rgba(47, 123, 112, 0.38);
  background: #f1f7f5;
}

.pick-button.active[data-pick="p"] {
  color: white;
  background: var(--blue);
  border-color: var(--blue);
}

.pick-button.active[data-pick="s"] {
  color: white;
  background: var(--coral);
  border-color: var(--coral);
}

.station-data {
  margin: 12px 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
}

.station-data div {
  min-width: 0;
  padding: 9px 7px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.7);
  text-align: center;
}

.station-data dt {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.61rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.station-data dd {
  margin: 3px 0 0;
  font-size: 0.76rem;
  font-weight: 900;
}

.apply-circle {
  width: 100%;
}

.hazard-layout {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 16px;
}

.data-controls-card,
.zone-chart-card,
.recommendation-builder {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(248, 247, 242, 0.72);
}

.data-controls-card {
  padding: 19px;
  display: grid;
  gap: 17px;
}

.data-controls-card h3,
.zone-chart-card h3,
.recommendation-builder h3 {
  margin: 0;
  font-size: 1rem;
}

.data-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}

.data-summary div {
  padding: 10px 7px;
  border-radius: 11px;
  background: white;
  border: 1px solid var(--line);
  text-align: center;
}

.data-summary span,
.data-summary strong {
  display: block;
}

.data-summary span {
  color: var(--muted);
  font-size: 0.61rem;
  font-weight: 800;
}

.data-summary strong {
  margin-top: 3px;
  color: var(--forest);
  font-size: 0.86rem;
}

.pattern-prompt {
  padding: 13px;
  border-left: 4px solid var(--gold);
  border-radius: 0 12px 12px 0;
  background: var(--gold-light);
}

.pattern-prompt strong {
  font-size: 0.75rem;
}

.pattern-prompt p {
  margin: 4px 0 0;
  color: #66533a;
  font-size: 0.73rem;
}

.zone-chart-card {
  padding: 19px;
}

.chart-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
}

.chart-heading p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.72rem;
}

.chart-key {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.67rem;
  font-weight: 700;
}

.chart-key i {
  width: 11px;
  height: 11px;
  border-radius: 3px;
  background: var(--teal);
}

.zone-chart {
  margin-top: 24px;
  display: grid;
  gap: 17px;
}

.bar-row {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr) 26px;
  gap: 10px;
  align-items: center;
  color: var(--ink-soft);
  font-size: 0.72rem;
  font-weight: 800;
}

.bar-track {
  height: 18px;
  border-radius: 999px;
  background:
    repeating-linear-gradient(
      90deg,
      #e9ece7 0,
      #e9ece7 calc(20% - 1px),
      #d8ddd8 20%
    );
  overflow: hidden;
}

.bar-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), #6db4a2);
  transition: width 350ms ease;
}

.zone-select-row {
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.zone-choice.selected {
  color: white;
  background: var(--forest);
  border-color: var(--forest);
}

.inline-feedback {
  margin-top: 12px;
  padding: 11px 12px;
  border-radius: 11px;
  font-size: 0.73rem;
  font-weight: 700;
}

.inline-feedback.neutral {
  color: var(--muted);
  background: #eceeea;
}

.inline-feedback.success {
  color: #215d45;
  background: var(--teal-light);
}

.inline-feedback.warning {
  color: #77501e;
  background: var(--gold-light);
}

.recommendation-builder {
  margin-top: 16px;
  padding: 21px;
}

.recommendation-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.decision-badge {
  padding: 7px 10px;
  color: #735020;
  background: var(--gold-light);
  border: 1px solid rgba(217, 154, 61, 0.25);
  border-radius: 999px;
  font-size: 0.66rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.recommendation-grid {
  margin-top: 17px;
  display: grid;
  grid-template-columns: 1fr 1.2fr 1.4fr;
  gap: 14px;
  align-items: start;
}

.evidence-field small {
  color: var(--muted);
  font-size: 0.66rem;
  text-align: right;
}

.recommendation-actions {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.recommendation-feedback {
  flex: 1;
  min-height: 44px;
  padding: 12px 13px;
  border-radius: 12px;
  color: var(--muted);
  background: #eceeea;
  font-size: 0.76rem;
  font-weight: 700;
}

.recommendation-feedback.success {
  color: #215d45;
  background: var(--teal-light);
}

.recommendation-feedback.warning {
  color: #77501e;
  background: var(--gold-light);
}

.community-info-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
}

.community-info-grid article {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.65);
}

.community-info-grid h4 {
  margin: 0;
  font-size: 0.78rem;
}

.community-info-grid p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.66rem;
}

.ngss-section {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 20px;
  border-color: rgba(55, 120, 147, 0.2);
  background:
    linear-gradient(135deg, rgba(220, 236, 242, 0.75), rgba(255, 255, 255, 0.9));
}

.ngss-badge {
  width: 72px;
  height: 72px;
  border-radius: 22px;
  color: white;
  background: var(--blue);
  display: grid;
  place-items: center;
  font-weight: 950;
  letter-spacing: 0.08em;
  box-shadow: 0 12px 26px rgba(55, 120, 147, 0.2);
}

.ngss-main h2 {
  margin: 0;
  font-size: clamp(1.25rem, 1.8vw, 1.7rem);
}

.performance-expectation {
  max-width: 1050px;
  margin: 8px 0 0;
  color: var(--ink-soft);
  font-size: 0.91rem;
}

.ngss-dimensions {
  margin-top: 17px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.ngss-dimensions article {
  padding: 14px;
  border: 1px solid rgba(55, 120, 147, 0.18);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.6);
}

.ngss-dimensions span,
.ngss-dimensions strong {
  display: block;
}

.ngss-dimensions span {
  color: var(--blue);
  font-size: 0.65rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.ngss-dimensions strong {
  margin-top: 4px;
  font-size: 0.83rem;
}

.ngss-dimensions p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.7rem;
}

.site-footer {
  width: min(var(--max-width), calc(100% - 36px));
  margin: 20px auto 34px;
  padding: 0 8px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  color: var(--muted);
  font-size: 0.7rem;
}

.site-footer p {
  margin: 0;
}

@media (max-width: 1180px) {
  .mission-card {
    grid-template-columns: 1fr;
  }

  .controls-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .button-group {
    grid-column: 1 / -1;
  }

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

  .field-notes-panel {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 13px;
  }

  .field-notes-panel .panel-heading {
    grid-column: 1 / -1;
  }

  .science-note {
    border: 1px solid var(--line);
    border-radius: 13px;
    padding: 13px;
  }

  .formula-card,
  .progress-card {
    margin-top: 0;
  }

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

  .station-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 0.7fr);
    gap: 12px 18px;
  }

  .station-card-header {
    grid-column: 1 / -1;
  }

  .seismogram-wrap {
    grid-row: span 3;
    height: 215px;
  }

  .pick-controls,
  .station-data,
  .apply-circle {
    grid-column: 2;
  }

  .hazard-layout {
    grid-template-columns: 310px minmax(0, 1fr);
  }
}

@media (max-width: 880px) {
  .site-header {
    padding: 25px;
    align-items: flex-start;
    flex-direction: column;
  }

  .brand-mark {
    width: 62px;
    height: 62px;
    border-radius: 18px;
  }

  .mission-steps {
    grid-template-columns: repeat(2, 1fr);
  }

  .event-readout {
    grid-template-columns: repeat(2, 1fr);
  }

  .event-readout div:nth-child(2) {
    border-right: 0;
  }

  .field-notes-panel {
    grid-template-columns: 1fr 1fr;
  }

  .hazard-layout,
  .recommendation-grid {
    grid-template-columns: 1fr;
  }

  .data-controls-card {
    grid-template-columns: 1fr 1fr;
  }

  .data-controls-card h3,
  .data-summary,
  .pattern-prompt {
    grid-column: 1 / -1;
  }

  .ngss-dimensions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .site-header,
  main,
  .site-footer {
    width: min(100% - 20px, var(--max-width));
  }

  .site-header {
    margin-top: 10px;
    border-radius: 20px;
  }

  .brand-lockup {
    align-items: flex-start;
    gap: 14px;
  }

  .brand-mark {
    display: none;
  }

  .panel,
  .map-frame {
    border-radius: 17px;
  }

  .mission-card,
  .control-panel,
  .map-panel,
  .field-notes-panel,
  .seismogram-section,
  .hazard-section,
  .ngss-section {
    padding: 18px;
  }

  .mission-steps,
  .controls-grid,
  .field-notes-panel,
  .data-controls-card,
  .community-info-grid {
    grid-template-columns: 1fr;
  }

  .panel-heading,
  .map-actions,
  .recommendation-heading,
  .recommendation-actions,
  .site-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .model-note {
    max-width: none;
    text-align: left;
  }

  .controls-grid {
    display: grid;
  }

  .event-readout {
    grid-template-columns: 1fr;
  }

  .event-readout div,
  .event-readout div:nth-child(2) {
    padding: 0 0 10px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .event-readout div:last-child {
    padding-bottom: 0;
    border-bottom: 0;
  }

  #mapSvg {
    min-height: 330px;
  }

  .map-legend {
    position: static;
    max-width: none;
    border-width: 1px 0 0;
    border-radius: 0;
  }

  .map-feedback {
    grid-template-columns: auto 1fr;
  }

  .map-feedback .button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .station-card {
    display: block;
  }

  .seismogram-wrap {
    height: 190px;
  }

  .pick-controls {
    grid-template-columns: 1fr 1fr;
  }

  .clear-picks {
    grid-column: 1 / -1;
  }

  .station-data {
    grid-template-columns: repeat(2, 1fr);
  }

  .zone-select-row {
    grid-template-columns: 1fr;
  }

  .recommendation-actions .button {
    width: 100%;
  }

  .ngss-section {
    grid-template-columns: 1fr;
  }

  .ngss-badge {
    width: 58px;
    height: 58px;
    border-radius: 17px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}


/* Guided investigation additions */
.guided-mode-control {
  min-height: 66px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.62);
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.guided-mode-control input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.guided-mode-copy {
  min-width: 0;
  margin-right: auto;
}

.guided-mode-copy strong,
.guided-mode-copy small {
  display: block;
}

.guided-mode-copy strong {
  font-size: 0.78rem;
}

.guided-mode-copy small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.66rem;
  line-height: 1.35;
}

.guided-switch {
  width: 44px;
  height: 24px;
  padding: 3px;
  border-radius: 999px;
  background: #cdd4d0;
  flex: 0 0 auto;
  transition: background 160ms ease;
}

.guided-switch::after {
  content: "";
  display: block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  transition: transform 160ms ease;
}

.guided-mode-control input:checked + .guided-switch {
  background: var(--teal);
}

.guided-mode-control input:checked + .guided-switch::after {
  transform: translateX(20px);
}

.student-guide {
  padding: 24px;
}

.student-guide-heading {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
}

.student-guide-heading h2 {
  margin: 2px 0 6px;
  font-size: clamp(1.2rem, 2vw, 1.65rem);
}

.student-guide-heading p:not(.section-kicker) {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.tutorial-content {
  margin-top: 19px;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
  gap: 18px;
}

.student-steps {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 9px;
}

.student-steps li {
  min-width: 0;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(248, 247, 242, 0.78);
  display: flex;
  align-items: flex-start;
  gap: 9px;
}

.student-steps li > span {
  width: 25px;
  height: 25px;
  border-radius: 8px;
  color: white;
  background: var(--forest);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  font-size: 0.7rem;
  font-weight: 900;
}

.student-steps strong,
.student-steps small {
  display: block;
}

.student-steps strong {
  font-size: 0.75rem;
  line-height: 1.25;
}

.student-steps small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.65rem;
  line-height: 1.4;
}

.worked-example {
  padding: 16px;
  border-radius: 16px;
  color: white;
  background: linear-gradient(145deg, #2c5a50, #183c34);
  box-shadow: var(--shadow-small);
}

.worked-example-label {
  margin-bottom: 9px;
  color: #a9d9cd;
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.worked-equations {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px 12px;
}

.worked-equations p {
  margin: 0;
  font-size: 0.73rem;
  line-height: 1.4;
}

.worked-note {
  margin: 12px 0 0;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.74);
  font-size: 0.68rem;
  line-height: 1.45;
}

.live-step {
  margin-top: 17px;
  padding: 13px 16px;
  border: 1px solid rgba(47, 123, 112, 0.2);
  border-radius: 14px;
  background: var(--teal-light);
  display: flex;
  align-items: center;
  gap: 14px;
}

.live-step > span {
  padding: 6px 9px;
  border-radius: 999px;
  color: white;
  background: var(--teal);
  flex: 0 0 auto;
  font-size: 0.64rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.live-step strong,
.live-step p {
  display: block;
}

.live-step strong {
  font-size: 0.84rem;
}

.live-step p {
  margin: 2px 0 0;
  color: var(--ink-soft);
  font-size: 0.72rem;
}

.pick-controls {
  grid-template-columns: 1fr 1fr 1.15fr auto;
}

.check-picks,
.show-setup,
.check-calculation {
  min-height: 34px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink-soft);
  background: white;
  font-size: 0.68rem;
  font-weight: 800;
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease;
}

.check-picks:hover,
.show-setup:hover,
.check-calculation:hover:not(:disabled) {
  border-color: rgba(47, 123, 112, 0.38);
  background: #f1f7f5;
}

.check-picks:disabled,
.show-setup:disabled,
.check-calculation:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.calculation-workbench {
  margin: 12px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.66);
}

.calculation-heading {
  margin-bottom: 9px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.calculation-heading strong {
  font-size: 0.77rem;
}

.mini-status {
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 800;
  text-align: right;
}

.mini-status.success {
  color: var(--success);
}

.mini-status.warning {
  color: var(--danger);
}

.calculation-row {
  margin-top: 7px;
  display: grid;
  grid-template-columns: 25px minmax(110px, 0.7fr) minmax(0, 1.3fr);
  gap: 8px;
  align-items: center;
}

.calculation-number {
  width: 25px;
  height: 25px;
  border-radius: 8px;
  color: white;
  background: var(--forest);
  display: grid;
  place-items: center;
  font-size: 0.67rem;
  font-weight: 900;
}

.calculation-row label span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.6rem;
  font-weight: 800;
}

.calculation-row input {
  width: 100%;
  min-height: 35px;
  padding: 0 8px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  color: var(--ink);
  background: white;
  font: inherit;
  font-size: 0.74rem;
  font-weight: 800;
}

.calculation-row input:disabled {
  color: var(--muted);
  background: #eceeea;
}

.calculation-row p {
  margin: 0;
  padding: 8px 9px;
  border-radius: 9px;
  color: var(--ink-soft);
  background: var(--paper-deep);
  font-size: 0.66rem;
  font-weight: 800;
  line-height: 1.35;
}

.calculation-actions {
  margin-top: 9px;
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 7px;
}

.check-calculation {
  color: white;
  background: var(--forest);
  border-color: var(--forest);
}

.calculation-feedback {
  margin-top: 8px;
  padding: 8px 9px;
  border-radius: 9px;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1.4;
}

.calculation-feedback.neutral {
  color: var(--muted);
  background: #eceeea;
}

.calculation-feedback.success {
  color: var(--success);
  background: var(--teal-light);
}

.calculation-feedback.warning {
  color: var(--danger);
  background: var(--coral-light);
}

.epicenter-marker.is-hidden {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.epicenter-marker.is-visible {
  display: inline !important;
  visibility: visible !important;
}

@media (max-width: 1180px) {
  .tutorial-content {
    grid-template-columns: 1fr;
  }

  .student-steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .student-guide-heading {
    display: block;
  }

  .student-guide-heading .button {
    width: 100%;
    margin-top: 14px;
  }

  .student-steps {
    grid-template-columns: 1fr;
  }

  .worked-equations {
    grid-template-columns: 1fr;
  }

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

  .pick-controls {
    grid-template-columns: 1fr 1fr;
  }

  .calculation-row {
    grid-template-columns: 25px 1fr;
  }

  .calculation-row p {
    grid-column: 2;
  }
}

.legend-estimate {
  position: relative;
  width: 14px;
  height: 14px;
  border: 2px solid #1e3440;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
}

.legend-estimate::before,
.legend-estimate::after {
  content: "";
  position: absolute;
  background: #1e3440;
}

.legend-estimate::before {
  width: 8px;
  height: 2px;
  left: 1px;
  top: 4px;
}

.legend-estimate::after {
  width: 2px;
  height: 8px;
  left: 4px;
  top: 1px;
}
