:root {
  --navy: #2c3e50;
   --softgray: #e9ecef;  
  --teal: #1abc9c;
  --gold: #f1c40f;
     --slate: #556366;   
  --coral: #e74c3c;
  --white: #ffffff;
  --gray-100: #f7fafc;
  --gray-200: #edf2f7;
  --gray-300: #e2e8f0;
  --max-width: 1120px;
  --container-pad: 16px;
  --radius: 10px;
  --shadow-sm: 0 6px 18px rgba(0, 0, 0, 0.06);
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.06);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial;
  color: var(--navy);
  background: linear-gradient(135deg, #ecf0f1 0%, #d6dbdf 100%);
  padding: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Responsive container */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 18px;
}

li {
  line-height: 2; 
}

/* Page header */
.header-left{
  justify-self: start;
}

.page-header {
    text-align: center;
    color: var(--navy);
    padding: 1rem;
    position: relative;
}

.header-grid{
  display: grid;
  grid-template-columns: 1fr auto 1fr; 
  align-items: center;
  gap: 12px;
  padding: 8px 0;
}
.page-title{
  margin: 0;
  justify-self: center;   /* ensures exact centering of the title cell */
  font-size: 2rem;
  font-weight: 700;
  font-family: 'Montserrat', sans-serif;
}
.header-actions{
  justify-self: end;
}

/* mobile: stack nicely */
@media (max-width: 767px){
  .header-grid{
    grid-template-columns: 1fr; /* stack everything */
    grid-auto-flow: row;
    text-align: left;
  }
  .page-title{ justify-self: start; }
  .header-actions{ justify-self: start; width:100%; margin-top:8px; }
  
}
.cols {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* center the title inside the middle column */
.page-title{
  margin: 0;
  justify-self: center;   /* ensures exact centering of the title cell */
  font-size: 2rem;
  font-weight: 700;
  font-family: 'Montserrat', sans-serif;
}

/* position actions at the end of the right column */
.header-actions{
  justify-self: end;
}

/* mobile: stack nicely */
@media (max-width: 767px){
  .header-grid{
    grid-template-columns: 1fr; /* stack everything */
    grid-auto-flow: row;
    text-align: left;
  }
  .page-title{ justify-self: start; }
  .header-actions{ justify-self: start; width:100%; margin-top:8px; }
  .quiz-btn{ width:100%; max-width:420px; }
}





/* Experiment area */
.experiment-area {
  background: var(--gray-100);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 24px;
}



.sim-area {
  background: var(--softgray);
  border-radius: 8px;
  padding: 12px;
  position: relative;
  overflow: hidden;
  height: 400px;
}


/* Controls */
.controls {
  background: white;
  border-radius: 8px;
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.control-group {
  margin-bottom: 18px;
}

.label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  color: var(--slate);
  font-weight: 600;
}

.range-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.range {
  flex: 1;
}

.value {
  display: inline-block;
  padding: 6px 8px;
  border-radius: 6px;
  background: rgba(26, 188, 156, 0.12);
  color: var(--teal);
  min-width: 64px;
  text-align: center;
  font-weight: 700;
}

.value.coral {
  background: rgba(231, 76, 60, 0.12);
  color: var(--coral);
}

/* Button styles */
.teal-btn {
  background-color: rgba(26, 188, 156, 0.8);
  color: white;
}

.teal-btn:hover {
    background-color: rgba(26, 188, 156, 0.7);
    transform: translateY(-2px);
}

.gold-btn {
  background-color: rgba(241, 196, 15, 1);
  color: var(--navy); opacity:0.9;
}

.gold-btn:hover {
  background-color: rgba(241, 196, 15, 0.5);
  transform: translateY(-2px);
}

.coral-btn {
  background-color: rgba(231, 76, 60, 0.8);
  color: white;
}

.coral-btn:hover {
  background-color: rgba(231, 76, 60, 0.7);
  transform: translateY(-2px);
}

.navy-btn {
  background-color: rgba(44, 62, 80, 0.8);
  color: white;
}

.navy-btn:hover {
    background-color: rgba(44, 62, 80, 0.7);
    transform: translateY(-2px);
}
.button-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 24px;
}

.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-weight: 500;
    text-decoration: none;
    text-align: center;
    transition: all 0.2s;
    cursor: pointer;
    border: 1px solid transparent;
    width: auto;
    font-size: 16px;
    font-weight: 600;
    padding: 12px 24px;
}




.btn.small {
  padding: 6px 10px;
  font-size: 13px;
}

.btn.soft {
  background: var(--softgray);
  color: var(--slate);
}

/* Panels */
.panel {
  margin-top: 24px;
  background: white;
  border-radius: 8px;
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.panel h3 {
  margin: 0 0 12px 0;
  font-size: 18px;
}

.panel .panel-body {
  color: var(--navy);
}

.panel ol,
.panel ul {
  margin: 8px 0 0 20px;
}

/* Results table */
.table-wrap {
  overflow-x: auto;
}

.results-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border: 1px solid var(--softgray);
}

.results-table th,
.results-table td {
  border: 1px solid var(--softgray);
  padding: 8px;
  text-align: left;
}

.results-table thead tr {
  background: var(--softgray);
}

.results-table th {
  font-weight: 700;
}

/* Formula / worksheet */
.formula {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.formula-pill {
  padding: 6px 10px;
  border-radius: 6px;
  font-weight: 700;
}

.formula-pill.teal {
  background: rgba(26, 188, 156, 0.12);
  color: var(--teal);
}

.formula-pill.gold {
  background: rgba(241, 196, 15, 0.12);
  color: var(--navy);
}

.formula-pill.coral {
  background: rgba(231, 76, 60, 0.12);
  color: var(--coral);
}

/* Range input styling for modern browsers */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  background: transparent;
}

input[type="range"]:focus {
  outline: none;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  background: linear-gradient(90deg, #d0d0d0, #bdbdbd);
  border-radius: 6px;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--navy);
  margin-top: -6px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

input[type="range"]::-moz-range-track {
  height: 6px;
  background: linear-gradient(90deg, #d0d0d0, #bdbdbd);
  border-radius: 6px;
}

input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--navy);
  border: none;
}

/* Accessibility focus states */
a:focus,
button:focus,
input:focus {
  outline: 3px solid rgba(26, 188, 156, 0.18);
  outline-offset: 2px;
}

/* Small utilities */
.text-center {
  text-align: center;
}

.mt-4 {
  margin-top: 16px;
}

.mb-4 {
  margin-bottom: 16px;
}

.p-4 {
  padding: 16px;
}

/* Responsive */
@media (min-width: 768px) {
  body {
    padding: 24px;
  }

  .container {
    padding: 0;
  }

  .mobile-button {
    display: none;
  }

  .nav-links {
    display: flex;
  }

  .mobile-menu {
    display: none;
  }

  .cols {
    flex-direction: row;
  }

  .sim-area {
    flex: 3;
    margin-right: 24px;
  }

  .controls {
    flex: 1;
  }

  .page-title {
    font-size: 32px;
  }

  .quiz-btn {
    top: 28px;
  }
}

@media (max-width: 767px) {
  .nav-links {
    display: none;
  }

  .mobile-button {
    display: block;
  }

  .mobile-menu {
    display: flex;
  }

  

  .container {
    padding: 0 12px;
  }
}

/* Tiny print adjustments */
@media print {
  .quiz-btn,
  .mobile-button,
  .mobile-menu {
    display: none;
  }

  body {
    padding: 0;
  }
}

/* ---------- data table styles (from your snippet) ---------- */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
  background: white;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.data-table th,
.data-table td {
  padding: 12px;
  text-align: center;
  border-bottom: 1px solid #e2e8f0;
}

.data-table th {
  background: #4a5568;
  color: white;
  font-weight: 600;
}

.data-table tr:hover {
  background: #f7fafc;
}

/* row for incomplete trial sets */
tr.incomplete {
  opacity: 0.9;
  background-color: #fff5f5;
}

tr.incomplete td {
  border-bottom: 2px dashed #e53e3e;
}

/* status badges (if you want to use them elsewhere) */
.status {
  text-align: center;
  padding: 10px;
  border-radius: 5px;
  margin: 10px 0;
  font-weight: 600;
}

.status.ready {
  background: #c6f6d5;
  color: #22543d;
}
.status.running {
  background: #fed7d7;
  color: #742a2a;
}


.validation-icon {
  font-size: 18px;
  display: inline-block;
  width: 28px;
  height: 28px;
  text-align: center;
  line-height: 28px;
  border-radius: 50%;
  vertical-align: middle;
  margin-left: 6px;
}

.validation-icon.correct {
  color: #48bb78;
  background-color: #f0fff4;
}

.validation-icon.incorrect {
  color: #e53e3e;
  background-color: #fff5f5;
}

/* table inputs */
.table-input {
  width: 100%;
  max-width: 120px;
  padding: 8px;
  border-radius: 6px;
  border: 1px solid var(--gray-300);
  background: white;
  font: inherit;
  color: var(--navy);
  text-align: center;
}

.table-input:focus {
  outline: 3px solid rgba(26, 188, 156, 0.18);
  outline-offset: 2px;
}

/* small action button */
.row-delete {
  background: none;
  border: 0;
  cursor: pointer;
  color: #e53e3e;
  font-size: 16px;
}
/* ===============================
   Speed of Sound apparatus (SOS)
   =============================== */

.sos-stage{
  position: relative;
  height: 100%;
  width: 100%;
  overflow: hidden;
  user-select: none;
}

/* Timer sits behind the kit */
.sos-timer{
  position: absolute;
  left: 50%;
  top: 45%;
  transform: translate(-50%, -50%);
  width: 230px;
  border-radius: 16px;
  background: rgba(255,255,255,0.92);
  border: 2px solid rgba(44,62,80,0.18);
  box-shadow: var(--shadow-sm);
  padding: 12px;
  z-index: 1;
}

.sos-timer-brand{
  font-size: 12px;
  font-weight: 800;
  color: var(--slate);
  letter-spacing: 0.2px;
  margin-bottom: 8px;
}

.sos-screen-wrap{
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.sos-screen{
  flex: 1;
  font-size: 36px;
  font-weight: 900;
  color: var(--navy);
  background: rgba(26,188,156,0.10);
  border: 2px solid rgba(26,188,156,0.18);
  border-radius: 12px;
  padding: 10px 12px;
  text-align: right;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.sos-units{
  font-size: 14px;
  font-weight: 900;
  color: var(--slate);
}

.sos-ports{
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 10px;
}

.sos-port{
  width: 18px;
  height: 12px;
  border-radius: 8px;
  background: rgba(44,62,80,0.12);
  border: 2px solid rgba(44,62,80,0.22);
}

/* Wires overlay */
.sos-wires{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 4;
}
.sos-wire{
  fill: none;
  stroke: rgba(44,62,80,0.45);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Kit pieces */
.sos-kit{
  position: absolute;
  top: 60%;
  transform: translateY(-50%);
  z-index: 3; /* in front of timer */
  display: grid;
  justify-items: center;
  gap: 10px;
}
.sos-label{
  font-size: 12px;
  font-weight: 900;
  color: var(--slate);
}

.sos-speaker{
  left: 10px;
  width: 10%;
  z-index: 5;
}

.sos-speaker-body{
    width: 0; 
  height: 0;

  position: relative;   /* IMPORTANT */

  border-top:4em solid transparent;
  border-bottom:4em solid transparent; 
  border-right:5em solid var(--slate);
}
.sos-play{
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(50%, -50%);
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 2px solid rgba(44,62,80,0.25);
  background: rgba(255,255,255,0.85);
  box-shadow: var(--shadow-xs);
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
}


.sos-play:hover{
  box-shadow: 0 4px 12px rgba(0,0,0,0.12) scale(1.1);
}

.sos-play:active{
  transform: translate(50%, -50%) scale(0.96);
}


/* triangle icon */
.sos-play-tri{
  width: 0;
  height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-left: 13px solid var(--teal);
  margin-left: 2px; /* optical centring */
}

/* make focus obvious */
.sos-play:focus{
  outline: 3px solid rgba(26,188,156,0.18);
  outline-offset: 2px;
}
/* simple triangle cone */
.sos-speaker-cone{
   position: absolute;   /* IMPORTANT */
  top: 50%;             /* move to middle */
  left: 0;
  transform: translateY(-50%);  /* true vertical centring */

  
  width:5.8em;
  height:2.5em;
  background:var(--slate);
  border-radius:3px 1.5em 1.5em 3px;
}

.sos-pulse-btn{
  width: 130px;
  padding: 10px 14px;
  font-size: 14px;
}
/* Mic container (positioned by JS with left: ...px) */
.sos-mic{
  position: absolute;
  width: 6em;              /* wide enough to contain plate */
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  cursor: grab;
  z-index:6;
}
.sos-mic:active{ cursor: grabbing; }

/* The actual drawn microphone */
.sos-mic-shape{
  position: relative;
  width: 6em;
  height: 9.2em;            /* includes body + stand + plate */
  display: grid;
  justify-items: center;
}

/* Main body */
.sos-mic-body{
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 1.8em;          /* move body down/up by tweaking this */
  width: 2em;
  height: 6em;
  background: var(--slate);
  border-radius: 1em;
}


/* Curved stand (U shape) */
.sos-mic-stand{
  position: absolute;
  bottom: 0.9em;            /* sits above the plate */
  left: 50%;
  transform: translateX(-50%);
  width: 3em;
  height: 3em;
  border: 0.25em solid var(--slate);
  border-top: 0.25em solid var(--slate);  /* same colour (no highlight) */
  border-radius: 0 0 1.5em 1.5em;
  background: transparent;
}

/* Base plate */
.sos-mic-plate{
  position: absolute;
  bottom: 0.2em;
  left: 50%;
  transform: translateX(-50%);
  width: 3.6em;
  height: 0.5em;
  background: var(--slate);
  border-radius: 0.25em;
}


/* Readouts */
.sos-readouts{
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 1px;
  z-index: 5;
  display: grid;
  gap: 8px;
}
.sos-pill{
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  width: fit-content;
  background: rgba(255,255,255,0.90);
  border: 1px solid var(--softgray);
  border-radius: 10px;
  padding: 10px 12px;
  box-shadow: var(--shadow-xs);
}
.sos-pill span{ font-size: 12px; font-weight: 800; color: var(--slate); }
.sos-pill b{ font-size: 16px; font-weight: 900; color: var(--navy); }
.sos-note{ font-size: 13px; color: var(--slate); }

/* Wave ring */
.sos-wave{
  position: absolute;
  left: 0;
  top: 54%;
  width: 10px;
  height: 10px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 2px solid rgba(241,196,15,0.7);
  opacity: 0;
  pointer-events: none;
  z-index: 2;
}

.v-entry{
  display:flex;
  align-items:center;
  gap:8px;
}
.v-input{
  width:90px;
  padding:8px 10px;
  border:1px solid var(--softgray);
  border-radius:8px;
  font-weight:700;
  color:var(--navy);
  font-family:inherit;
}
.sos-led{
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(26,188,156,0.25);
  box-shadow: 0 0 0 rgba(26,188,156,0);
  opacity: 0.25;
}

/* speaker LED: top-right corner of speaker body */
#speakerLed{
  top: 10px;
  right: 10px;
}

/* mic LED: on base plate area */
.sos-led-mic{
  bottom: 0.35em;
  left: 50%;
  transform: translateX(-50%);
}

/* ON state */
.sos-led.on{
  opacity: 1;
  background: #e74c3c;
  box-shadow: 0 0 14px rgba(26,188,156,0.6);
}
