:root {
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: #243b33;
  background: #f8f9f6;
  font-synthesis: none;
  --green: #176b55;
  --muted: #66766e;
  --line: #dfe5dd;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
main {
  max-width: 1060px;
  margin: auto;
  padding: 0 32px;
}
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 0 24px;
}
.identity {
  display: flex;
  align-items: center;
  gap: 10px;
}
h1 {
  font-size: 18px;
  letter-spacing: -0.5px;
  margin: 0;
  font-weight: 650;
}
a {
  color: var(--green);
  text-underline-offset: 4px;
}
header a {
  font-size: 13px;
  text-decoration: none;
}
.intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 10px 0 24px;
}
h2 {
  font-size: clamp(20px, 3vw, 28px);
  font-weight: 550;
  letter-spacing: -1px;
  margin: 0 0 8px;
}
p {
  line-height: 1.65;
}
.intro p {
  font-size: 14px;
  color: var(--muted);
  margin: 0;
}
.badge {
  white-space: nowrap;
  font-size: 11px;
  letter-spacing: 0.3px;
  background: #edf2eb;
  border: 1px solid var(--line);
  padding: 7px 10px;
  border-radius: 20px;
  color: #4b6859;
}
.map-wrap {
  position: relative;
  background: #f0f2eb;
  border: 1px solid #d7dfd3;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
}
canvas {
  display: block;
  width: 100%;
  aspect-ratio: 3/2;
  max-height: min(58vh, 590px);
  touch-action: manipulation;
  cursor: crosshair;
  outline: none;
}
canvas:focus-visible {
  box-shadow: inset 0 0 0 3px #176b55;
}
.map-scale {
  position: absolute;
  bottom: 12px;
  right: 16px;
  font:
    10px ui-monospace,
    monospace;
  color: #69766b;
  display: flex;
  align-items: center;
  gap: 7px;
  pointer-events: none;
}
.map-scale span {
  width: 40px;
  border: solid #69766b;
  border-width: 0 1px 1px;
  height: 5px;
}
.loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  background: #f0f2eb;
  padding: 24px;
  text-align: center;
  font-size: 14px;
}
.loading[hidden] {
  display: none;
}
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 15px 0 11px;
}
.status {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  font-weight: 550;
  min-width: 0;
}
.dot {
  width: 7px;
  height: 7px;
  background: #8e9c90;
  border-radius: 50%;
  flex-shrink: 0;
}
.dot.active {
  background: var(--green);
}
.controls {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
button {
  font: inherit;
  font-size: 12px;
  min-height: 38px;
  min-width: 64px;
  border: 1px solid #d4ddd2;
  background: #fff;
  color: #344f40;
  border-radius: 7px;
  padding: 8px 14px;
  cursor: pointer;
}
button:hover {
  background: #edf2eb;
}
button:disabled {
  opacity: 0.4;
  cursor: default;
}
button:focus-visible,
summary:focus-visible,
a:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 4px;
}
button[aria-pressed="true"] {
  background: #e1ece2;
}
.map-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 11px;
}
.legend {
  display: flex;
  gap: 16px;
}
.legend span {
  display: flex;
  align-items: center;
  gap: 6px;
}
.legend i {
  display: inline-block;
}
.robot-key {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
}
.path-key {
  width: 14px;
  height: 2px;
  background: var(--green);
}
.goal-key {
  width: 8px;
  height: 8px;
  border: 2px solid #c17536;
  border-radius: 50%;
}
output {
  font:
    11px ui-monospace,
    SFMono-Regular,
    monospace;
}
.notice {
  font-size: 12px;
  color: var(--muted);
  min-height: 20px;
  margin: 13px 0 24px;
}
.notice.error {
  color: #99521f;
}
details {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
summary {
  cursor: pointer;
  padding: 18px 0;
  font-weight: 550;
}
summary span {
  font-weight: 400;
  color: var(--muted);
  font-size: 12px;
  float: right;
}
.learning {
  max-width: 740px;
  color: #52685c;
  padding: 0 0 12px;
}
.learning p {
  margin: 0 0 16px;
}
.learning strong {
  font-weight: 600;
  color: #344f40;
}
.flow {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 18px;
  font:
    11px ui-monospace,
    monospace;
}
.flow span {
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 8px;
}
.flow b {
  font-weight: 400;
  color: #9aa89b;
}
footer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 20px 0 24px;
  color: #7e8b80;
  font-size: 10px;
}
@media (max-width: 600px) {
  main {
    padding: 0 18px;
  }
  header {
    padding: 20px 0;
  }
  h1 {
    font-size: 16px;
  }
  .intro {
    display: block;
    margin: 7px 0 20px;
  }
  h2 {
    font-size: 22px;
    letter-spacing: -0.7px;
  }
  .intro p {
    font-size: 13px;
    max-width: 310px;
  }
  .badge {
    display: inline-block;
    margin-top: 12px;
    padding: 4px 8px;
    font-size: 10px;
  }
  canvas {
    max-height: none;
  }
  .map-wrap {
    border-radius: 9px;
  }
  .toolbar {
    padding-top: 12px;
  }
  button {
    min-width: 62px;
    min-height: 44px;
    padding: 9px 12px;
  }
  .status {
    font-size: 12px;
  }
  .legend {
    gap: 12px;
  }
  output {
    font-size: 10px;
  }
  .map-meta {
    gap: 8px;
    flex-wrap: wrap;
  }
  .notice {
    font-size: 11px;
    margin-bottom: 20px;
  }
  .map-scale {
    bottom: 8px;
    right: 9px;
    font-size: 9px;
  }
  .map-scale span {
    width: 28px;
  }
  summary span {
    font-size: 10px;
  }
  footer {
    display: block;
    line-height: 1.8;
  }
  footer span {
    display: block;
  }
}
@media (max-height: 500px) and (orientation: landscape) {
  main {
    max-width: 950px;
    padding: 0 20px;
  }
  header {
    padding: 10px 0;
  }
  h1 {
    font-size: 15px;
  }
  .identity svg {
    width: 23px;
    height: 23px;
  }
  .intro {
    margin: 4px 0 10px;
  }
  .intro h2 {
    font-size: 18px;
    margin-bottom: 3px;
    letter-spacing: -0.5px;
  }
  .intro p {
    font-size: 11px;
    max-width: none;
  }
  .badge {
    margin: 0;
  }
  canvas {
    width: 100%;
    height: calc(100svh - 168px);
    min-height: 120px;
    max-height: none;
    aspect-ratio: auto;
  }
  .toolbar {
    padding: 8px 0 6px;
  }
  button {
    min-height: 34px;
    padding: 6px 12px;
  }
  .notice {
    margin: 8px 0 15px;
    font-size: 10px;
  }
  .map-meta {
    font-size: 10px;
  }
  .status {
    font-size: 11px;
  }
  footer {
    padding: 12px 0;
  }
  details {
    font-size: 12px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto;
  }
}
.learning code {
  font:
    11px ui-monospace,
    SFMono-Regular,
    monospace;
  color: #344f40;
}
.topic-table {
  margin: 0 0 18px;
}
.topic-table table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 11px;
  text-align: left;
}
.topic-table th,
.topic-table td {
  padding: 8px 5px 8px 0;
  border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
  vertical-align: top;
}
.topic-table th {
  font-weight: 550;
  color: #344f40;
}
.topic-table th:first-child {
  width: 24%;
}
.topic-table th:nth-child(2) {
  width: 48%;
}
.topic-table td {
  font-family: ui-monospace, monospace;
}
