@import url('./assets/base.css');
:root {
  --ink: #203d39;
  --muted: #5c706b;
  --paper: #f4f6ef;
  --panel: #fff;
  --accent: #12675f;
  --line: #d8e0d7;
  --soft: #e5eee6;
}
.intro {
  display: grid;
  grid-template-columns: 1fr 310px;
  align-items: end;
  gap: 48px;
  padding: 68px 0 55px;
}
.intro h1 {
  font-size: clamp(38px, 4.6vw, 68px);
  line-height: 1.06;
  letter-spacing: -3px;
  margin: 12px 0 23px;
  font-weight: 600;
}
.intro h1 span {
  color: #73867b;
}
.lede {
  max-width: 630px;
  font-size: 17px;
  line-height: 1.75;
}
.intro-note {
  border-left: 1px solid var(--line);
  padding: 15px 0 15px 32px;
}
.intro-note p {
  font-size: 19px;
  line-height: 1.5;
}
.intro-note a {
  font-size: 14px;
  font-weight: 650;
}
.work-layout {
  display: grid;
  grid-template-columns: 215px minmax(350px, 1fr) 235px;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
}
.panel {
  padding: 24px 20px;
}
.controls {
  background: #f9faf6;
  border-right: 1px solid var(--line);
}
.results {
  border-left: 1px solid var(--line);
}
.tool-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}
.tool-grid button {
  text-align: left;
  font-size: 12px;
  padding: 9px 10px;
}
.tool-grid [aria-pressed='true'] {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.controls label {
  margin-top: 20px;
}
.controls > label:first-child {
  margin-top: 0;
}
.controls .primary {
  width: 100%;
  margin-top: 24px;
}
.controls .text-button {
  width: 100%;
  margin-top: 8px;
}
fieldset {
  padding: 0;
  border: 0;
  margin: 22px 0 0;
}
legend {
  margin-bottom: 9px;
}
.map-column {
  padding: 22px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: #edf1e9;
}
.map-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}
.map-header h3 {
  margin: 0;
  font-size: 16px;
}
.map-header span {
  font-size: 11px;
  color: var(--muted);
}
.map-scroll {
  overflow: auto;
  padding: 4px;
  margin: -4px;
}
#map {
  display: grid;
  gap: 2px;
  min-width: 320px;
  width: 100%;
  background: #dce5da;
  padding: 4px;
  border-radius: 8px;
}
.grid-row {
  display: grid;
  grid-template-columns: repeat(var(--columns), 1fr);
  gap: 2px;
}
.cell {
  border: 0;
  aspect-ratio: 1;
  padding: 0;
  min-width: 0;
  border-radius: 3px;
  background: #f9fbf5;
  font: 600 10px system-ui;
  color: #184b42;
  position: relative;
}
.cell.wall {
  background: #52665e;
}
.cell.rough {
  background: repeating-linear-gradient(135deg, #dccba6, #dccba6 3px, #ebdfc4 3px, #ebdfc4 6px);
}
.cell.buffer {
  background: #b8c6b9;
}
.cell.route {
  background: #a1d4be;
}
.cell.start {
  background: #12675f;
  color: white;
}
.cell.goal {
  background: #b48d33;
  color: white;
}
.cell.robot {
  box-shadow: inset 0 0 0 3px #12372f;
  background: #fff;
  color: #12372f;
}
.legend {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 10px;
  color: var(--muted);
  margin: 18px 0;
}
.legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.swatch {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  display: inline-block;
}
.swatch.start {
  background: #12675f;
}
.swatch.goal {
  background: #b48d33;
}
.swatch.wall {
  background: #52665e;
}
.swatch.rough {
  background: #dccba6;
}
.swatch.buffer {
  background: #b8c6b9;
}
.swatch.route {
  background: #a1d4be;
}
.playback {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid #d3dece;
  padding-top: 20px;
  margin-top: auto;
}
.playback > div {
  display: flex;
  gap: 6px;
}
.playback button {
  font-size: 12px;
  padding: 9px 10px;
}
#progress {
  font-size: 11px;
  text-align: right;
}
#status {
  font-size: 13px;
  line-height: 1.55;
  min-height: 60px;
}
.metrics {
  margin: 10px 0 28px;
}
.metrics div {
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}
.metrics dt {
  font-size: 11px;
  color: var(--muted);
}
.metrics dd {
  font-size: 28px;
  margin: 5px 0 0;
  letter-spacing: -1px;
}
.results h3 {
  font-size: 13px;
}
.results ol {
  padding-left: 20px;
  font-size: 12px;
  line-height: 1.75;
}
.results li {
  margin-bottom: 7px;
}
.results button {
  width: 100%;
  font-size: 11px;
}
details {
  margin-top: 20px;
  font-size: 12px;
}
details label {
  margin-top: 15px;
}
input[type='file'] {
  font-size: 10px;
  max-width: 100%;
  margin: 10px 0;
}
.notes {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1fr 1fr;
  gap: 32px;
  margin: 64px 0;
}
.notes h2 {
  font-size: 30px;
  letter-spacing: -1px;
}
.notes h3 {
  font-size: 16px;
}
.notes p {
  font-size: 13px;
  line-height: 1.8;
  color: var(--muted);
}
.note-number {
  font-size: 11px;
  color: var(--accent);
  border-bottom: 1px solid var(--line);
  display: block;
  padding-bottom: 15px;
}
@media (max-width: 1150px) {
  .work-layout {
    grid-template-columns: 190px 1fr;
  }
  .results {
    grid-column: 1/-1;
    border-left: 0;
    border-top: 1px solid var(--line);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 28px;
  }
  .metrics {
    grid-row: 2/6;
    grid-column: 2;
  }
  .notes {
    grid-template-columns: 1fr 1fr;
  }
  .intro {
    grid-template-columns: 1fr 250px;
  }
  .map-column {
    padding: 18px;
  }
}
@media (max-width: 700px) {
  .intro {
    grid-template-columns: 1fr;
    padding: 36px 0;
    gap: 20px;
  }
  .intro h1 {
    letter-spacing: -1.7px;
  }
  .intro-note {
    display: none;
  }
  .work-layout {
    grid-template-columns: 1fr;
  }
  .controls {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .tool-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .map-column {
    padding: 14px;
  }
  .results {
    display: block;
  }
  .metrics {
    display: flex;
    gap: 24px;
  }
  .metrics div {
    flex: 1;
  }
  .metrics dd {
    font-size: 23px;
  }
  .notes {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .playback {
    flex-wrap: wrap;
  }
  .section-head {
    align-items: start;
  }
  .local-badge {
    font-size: 10px;
  }
  .cell {
    font-size: 8px;
  }
}

.language-control {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
}
.language-control select {
  width: auto;
  max-width: 9rem;
  margin: 0;
  padding: 0.4rem;
  font: inherit;
}
.topbar nav {
  flex-wrap: wrap;
}
