@charset "UTF-8";

:root {
  color-scheme: light;
  --paper: #f8f5ee;
  --surface: #fffdf8;
  --ink: #24454d;
  --muted: #5c7173;
  --teal: #287e79;
  --teal-dark: #216c68;
  --mint: #eaf4ee;
  --orange: #f4b268;
  --peach: #fff0dd;
  --blue: #6086a6;
  --pale-blue: #edf2f7;
  --line: #dce5dd;
  --shadow: 0 10px 30px rgb(36 69 77 / 6%);
  font-family: ui-rounded, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: var(--paper); }
button, input, select, textarea { font: inherit; font-size: 16px; }
button, input, select, textarea, a { -webkit-tap-highlight-color: transparent; }
button {
  min-height: 46px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  background: var(--surface);
  font-weight: 600;
  line-height: 1.4;
  cursor: pointer;
  touch-action: manipulation;
  transition: background .16s ease, border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
button:active { transform: translateY(1px); }
button:disabled { cursor: not-allowed; opacity: .45; transform: none; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 4px;
}
a { color: var(--teal-dark); text-underline-offset: 3px; }
img { display: block; max-width: 100%; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { font-weight: 700; line-height: 1.35; }
h1 { font-size: clamp(28px, 4.8vw, 44px); letter-spacing: -.035em; }
h2 { font-size: 21px; }
h3 { font-size: 18px; }
p { margin-bottom: 14px; }
[hidden] { display: none !important; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 1152px;
  margin: 0 auto;
  padding: 17px 26px;
}
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); font-size: 18px; font-weight: 750; text-decoration: none; }
.brand img { width: 38px; height: 43px; object-fit: contain; }
.brand small { display: block; font-size: 12px; letter-spacing: .1em; color: var(--muted); font-weight: 500; }
.parent-link { background: transparent; padding: 9px 13px; white-space: nowrap; font-size: 16px; font-weight: 550; }
#app, .app { width: min(100%, 1152px); margin: 0 auto; padding: 5px 26px 42px; }
.home-hero { display: grid; grid-template-columns: .9fr 1.1fr; gap: 24px; align-items: center; margin: 10px 0 30px; }
.hero-copy { padding: 14px 0 14px 4px; }
.eyebrow { display: inline-block; color: var(--teal); font-size: 13px; font-weight: 700; letter-spacing: .12em; margin-bottom: 13px; }
.hero-copy h1 { margin-bottom: 18px; }
.hero-copy p { max-width: 410px; margin-bottom: 16px; font-size: 17px; line-height: 1.8; color: var(--muted); }
.hero-art { min-width: 0; }
.hero-art img { width: 100%; aspect-ratio: 800 / 420; object-fit: contain; }
.activity-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 17px; }
.activity-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 17px;
  min-width: 0;
  padding: 21px;
  text-align: left;
  border-radius: 24px;
  box-shadow: var(--shadow);
}
.activity-card:nth-child(2) .card-art { background: var(--mint); }
.activity-card:nth-child(3) .card-art { background: var(--pale-blue); }
.activity-card:nth-child(4) .card-art { background: var(--peach); }
.card-art { display: grid; place-items: center; width: 72px; height: 72px; background: var(--peach); border-radius: 22px; font-size: 35px; }
.card-art img { width: 56px; height: 58px; object-fit: contain; }
.card-copy { min-width: 0; }
.card-copy h2 { margin-bottom: 7px; font-size: 20px; }
.card-copy p { font-size: 14px; color: var(--muted); line-height: 1.65; font-weight: 400; margin: 0; }
.card-copy .badge { margin-bottom: 9px; }
.card-arrow { position: absolute; top: 20px; right: 18px; font-size: 22px; color: var(--muted); }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: 99px; color: var(--teal-dark); background: var(--mint); font-size: 12px; font-weight: 600; }
.bottom-note { color: var(--muted); font-size: 14px; line-height: 1.75; max-width: 780px; margin: 26px auto 0; padding: 18px 4px 0; text-align: center; }
.bottom-note p:last-child { margin-bottom: 0; }
.bottom-note > img { width: 56px; height: 64px; object-fit: contain; flex-shrink: 0; margin: 0 auto 10px; }

.screen-head { position: relative; display: flex; flex-wrap: wrap; align-items: center; column-gap: 15px; row-gap: 8px; margin: 8px 0 20px; }
.screen-head h1 { font-size: clamp(25px, 4.2vw, 33px); margin: 0; }
.screen-head .subtitle { flex-basis: 100%; margin: 0; color: var(--muted); font-size: 15px; }
.back-btn { min-width: 48px; padding: 9px 13px; }
.taskbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 21px; margin-bottom: 20px; border-radius: 20px; background: var(--mint); }
.task-copy { min-width: 0; margin: 0; font-size: 17px; line-height: 1.65; }
.taskbar > img { width: 52px; height: 56px; flex-shrink: 0; object-fit: contain; }
.task-copy p { margin: 0; }
.task-copy small { display: block; font-size: 14px; color: var(--muted); margin-top: 5px; }
.listen { flex-shrink: 0; min-width: 94px; background: rgb(255 253 248 / 88%); }
.play-layout { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 26px; align-items: start; max-width: 930px; margin: 0 auto; }
.studio { min-width: 0; width: 100%; }
.build-board {
  position: relative;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  aspect-ratio: 1;
  overflow: hidden;
  border: 2px solid #d5dfd7;
  border-radius: 14px;
  background-color: #fffdf8;
  background-image: linear-gradient(to right, #e6eae1 1px, transparent 1px), linear-gradient(to bottom, #e6eae1 1px, transparent 1px);
  background-size: 12.5% 12.5%;
  box-shadow: 0 5px 0 #e1e5da, var(--shadow);
  isolation: isolate;
}
.board-cells { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); grid-template-rows: repeat(8, minmax(0, 1fr)); z-index: 4; }
.board-cell { display: block; min-height: 0; min-width: 0; width: 100%; height: 100%; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.board-cell:active { transform: none; background: rgb(40 126 121 / 12%); }
.board-cell:focus-visible { outline-offset: -3px; outline-width: 3px; z-index: 5; }
.piece { position: absolute; z-index: 2; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-around; gap: 2px; padding: 3px; border: 2px solid rgb(36 69 77 / 12%); border-radius: 7px; background: var(--piece-color, var(--teal)); box-shadow: inset 0 3px 0 rgb(255 255 255 / 23%), inset 0 -4px 0 rgb(36 69 77 / 13%); pointer-events: none; }
.stud { position: absolute; transform: translate(-50%, -50%); display: block; flex-shrink: 0; width: 15px; height: 15px; border-radius: 50%; border: 1px solid rgb(36 69 77 / 13%); background: rgb(255 255 255 / 12%); box-shadow: inset 0 2px 0 rgb(255 255 255 / 22%), 0 2px 0 rgb(36 69 77 / 10%); }
.vehicle-guide { position: absolute; z-index: 1; border: 2px dashed #6ca69f; border-radius: 9px 9px 0 0; background: rgb(40 126 121 / 7%); pointer-events: none; }
.vehicle { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 3; display: grid; align-items: end; justify-items: center; pointer-events: none; transform-origin: center bottom; }
.vehicle img { width: 100%; height: 100%; object-fit: fill; object-position: center bottom; }
.vehicle-tall img { position: absolute; left: 0; bottom: 0; width: 100%; height: 66.6667%; object-fit: fill; object-position: center bottom; }
.cargo { position: absolute; top: 0; left: 22%; width: 56%; height: 34%; border-radius: 5px; background: var(--orange); border: 2px solid #d69766; box-shadow: inset 0 4px 0 rgb(255 255 255 / 23%); }
.cargo::after { content: ""; position: absolute; top: 0; bottom: 0; left: 44%; width: 12%; background: #f8dcae; }
.success-drive { animation: drive-into-town 1.8s ease-in-out 1 both; }
@keyframes drive-into-town { 0% { transform: translateY(0) scale(1); opacity: 1; } 65% { transform: translateY(-35%) scale(.55); opacity: 1; } 100% { transform: translateY(-58%) scale(.3); opacity: 0; } }
.floor-label { max-width: 480px; margin: 10px auto 0; color: var(--muted); font-size: 13px; text-align: center; }
.toolbox { display: flex; flex-direction: column; gap: 19px; min-width: 0; padding: 20px; border-radius: 22px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.toolgroup { min-width: 0; }
.toolgroup > label, .toolgroup > .label { display: block; margin-bottom: 10px; color: var(--muted); font-size: 14px; font-weight: 650; }
.pieces { display: flex; flex-wrap: wrap; gap: 8px; }
.piece-choice { flex: 1 1 66px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 9px; min-height: 77px; padding: 12px 9px; border-radius: 13px; font-size: 16px; background: var(--paper); }
.piece-choice[aria-pressed="true"], .piece-choice.selected, .piece-choice.active { border-color: var(--teal); background: var(--mint); box-shadow: 0 0 0 2px rgb(40 126 121 / 12%); }
.mini-brick { position: relative; display: block; width: calc(var(--preview-w, 2) * 12px); height: calc(var(--preview-h, 1) * 12px); min-width: 12px; border-radius: 4px; background: var(--piece-color, var(--teal)); box-shadow: inset 0 -3px 0 rgb(36 69 77 / 14%); }
.mini-brick::before, .mini-brick::after { content: ""; position: absolute; top: -4px; width: 10px; height: 6px; border-radius: 3px 3px 0 0; background: inherit; }
.mini-brick::before { left: 2px; width: 8px; }
.mini-brick::after { right: 2px; width: 8px; }
.colors { display: flex; flex-wrap: wrap; gap: 10px; }
.color-choice { display: grid; place-items: center; min-width: 45px; width: 45px; min-height: 45px; height: 45px; padding: 0; border: 3px solid var(--surface); border-radius: 50%; box-shadow: 0 0 0 1px var(--line); background: var(--swatch, var(--teal)); color: white; }
.color-choice[aria-pressed="true"], .color-choice.selected, .color-choice.active { box-shadow: 0 0 0 3px var(--ink); }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; }
.toolbar button { flex: 1 1 auto; padding: 10px 11px; }
.primary { color: #fffdf8; border-color: var(--teal); background: var(--teal); box-shadow: 0 3px 0 #1e6561; }
.primary:active { transform: translateY(2px); box-shadow: 0 1px 0 #1e6561; }
.secondary { color: var(--ink); border-color: #ddcbae; background: var(--peach); }
.ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--muted); }
.toolbox > .primary { width: 100%; min-height: 51px; }
.status { min-height: 52px; padding: 13px 16px; margin: 18px 0 0; border-radius: 15px; background: var(--peach); color: var(--ink); line-height: 1.65; }
.status:empty { display: none; }
.status-success { background: var(--mint); color: var(--teal-dark); }
.navrow { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; max-width: 930px; margin: 23px auto 0; }
.toolbox .navrow { width: 100%; margin-top: 5px; }
.selection-label { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
.board-cell.bump-cell { animation: gentle-cell-hint .55s ease-out 1; }
@keyframes gentle-cell-hint { 0%, 35% { background: rgb(244 178 104 / 48%); } 100% { background: transparent; } }

.route-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 26px; align-items: start; max-width: 930px; margin: 0 auto; }
.route-board { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-template-rows: repeat(4, minmax(0, 1fr)); gap: 8px; aspect-ratio: 1; width: 100%; max-width: 480px; margin: 0 auto; padding: 10px; background: #e1e9dd; border-radius: 23px; }
.route-cell { position: relative; display: grid; place-items: center; min-width: 0; min-height: 0; border: 0; border-radius: 13px; background: #fffdf8; color: var(--muted); text-align: center; font-size: 16px; }
.route-cell.start, .route-cell.is-start { background: var(--peach); }
.route-cell.target, .route-cell.is-goal { background: #d7eee1; }
.stone { display: grid; place-items: center; width: 65%; height: 58%; border-radius: 43% 46% 30% 35%; background: #a7b3ad; color: var(--ink); font-size: 22px; box-shadow: inset -5px -5px 0 rgb(36 69 77 / 9%); }
.goal { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; width: 80%; height: 80%; border-radius: 14px; font-size: clamp(25px, 4vw, 43px); color: var(--teal); }
.goal small { font-size: 12px; line-height: 1.4; }
.goal img { width: 80%; height: 80%; object-fit: contain; }
.runner { position: absolute; width: 25%; height: 25%; z-index: 2; display: grid; place-items: center; pointer-events: none; transition: left .2s ease, top .2s ease; }
.runner img { width: 70%; height: 83%; object-fit: contain; filter: drop-shadow(0 3px 0 rgb(36 69 77 / 8%)); }
.start-label { align-self: end; margin-bottom: 8px; color: #8e633f; font-size: 13px; line-height: 1.4; }
.route-tools { display: flex; flex-direction: column; gap: 17px; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); }
.route-tools h2, .route-tools h3 { margin-bottom: 0; }
.route-tools > label, .route-tools > .label { color: var(--muted); font-size: 14px; }
.direction-buttons { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.direction-button { padding: 7px 0; min-height: 57px; border-radius: 14px; background: var(--mint); color: var(--teal-dark); font-size: 29px; line-height: 1.3; }
.command-list { display: flex; flex-wrap: wrap; align-content: flex-start; gap: 7px; min-height: 104px; margin: 0; padding: 11px; list-style: none; border: 1px dashed #c9d8d0; border-radius: 15px; background: #f8faf5; }
.command-token { display: grid; place-items: center; min-width: 40px; height: 40px; padding: 0 8px; border-radius: 10px; background: #e6eee8; color: var(--ink); font-size: 24px; line-height: 1; }
.command-token.executing, .executing { color: white; background: var(--teal); box-shadow: 0 0 0 2px var(--teal-dark); }
.empty-route { align-self: center; width: 100%; color: var(--muted); font-size: 14px; font-weight: 400; text-align: center; }
.route-legend { display: flex; justify-content: center; flex-wrap: wrap; gap: 15px; margin: 13px auto 0; color: var(--muted); font-size: 14px; }
.route-legend span { display: inline-flex; gap: 6px; align-items: center; }

.parent-panel { max-width: 880px; margin: 0 auto; }
.parent-intro { padding: 21px 24px; margin: 17px 0 24px; border-radius: 20px; background: var(--mint); }
.parent-intro p { margin-bottom: 10px; }
.parent-intro p:last-child { margin-bottom: 0; }
.activity-observation { padding: 23px; margin-bottom: 18px; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); box-shadow: var(--shadow); }
.activity-observation h2 { margin-bottom: 17px; }
.activity-observation .badge { margin-left: 8px; vertical-align: middle; }
.activity-observation > .field { margin-top: 16px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field.full, .field-wide { grid-column: 1 / -1; }
.field label, label.field { color: var(--ink); font-size: 15px; font-weight: 600; }
input, select, textarea { width: 100%; min-width: 0; min-height: 46px; padding: 11px 12px; color: var(--ink); border: 1px solid #cbd8cf; border-radius: 11px; background: white; line-height: 1.5; }
textarea { min-height: 99px; resize: vertical; }
input[type="checkbox"], input[type="radio"] { width: 19px; height: 19px; min-height: 19px; margin-right: 7px; accent-color: var(--teal); }
.record-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 22px 0; }
.visit-list { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 18px; margin: 11px 0 20px; list-style: none; border-radius: 17px; background: var(--pale-blue); }
.visit-list li, .visit-list span { padding: 6px 11px; background: var(--pale-blue); border-radius: 10px; font-size: 14px; }
.visit-list > .label { padding: 0; font-size: 14px; color: var(--muted); }
.visit-list > p { margin: 0; }
.visit-list > small { font-size: 13px; color: var(--muted); }
.insight { padding: 20px 23px; margin: 18px 0; border-radius: 19px; background: var(--peach); }
.insight h2, .insight h3 { margin-bottom: 11px; }
.insight p:last-child, .insight ul:last-child { margin-bottom: 0; }
.insight ul { margin-top: 0; padding-left: 22px; }
.insight li + li { margin-top: 9px; }
.saved-note { color: var(--muted); font-size: 14px; line-height: 1.7; margin: 11px 0 18px; }
.history-item { padding: 16px 19px; margin: 10px 0; border-radius: 15px; background: var(--surface); border: 1px solid var(--line); }
.history-item summary { cursor: pointer; min-height: 28px; font-weight: 600; }
.history-item pre { font: inherit; font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.history-item > p:first-of-type { margin-top: 16px; }
#report-fallback { min-height: 230px; margin-bottom: 20px; background: #fffdf8; font-size: 16px; }
.danger { color: #9d5140; }
.confirm-dialog { width: min(440px, calc(100% - 32px)); padding: 26px; color: var(--ink); border: 0; border-radius: 24px; background: var(--surface); box-shadow: 0 20px 70px rgb(36 69 77 / 23%); }
.confirm-dialog::backdrop { background: rgb(24 48 52 / 36%); backdrop-filter: blur(3px); }
.confirm-dialog h2 { margin-bottom: 12px; }
.confirm-dialog p { color: var(--muted); }
.dialog-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; margin-top: 22px; }

@media (hover: hover) and (pointer: fine) {
  button:not(:disabled):hover { border-color: #8db1a3; }
  .primary:not(:disabled):hover { background: var(--teal-dark); }
  .activity-card:hover { transform: translateY(-4px); box-shadow: 0 14px 30px rgb(36 69 77 / 10%); }
  .board-cell:hover { background: rgb(40 126 121 / 9%); }
  .direction-button:hover { background: #daeee3; }
}

@media (max-width: 850px) {
  .activity-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-hero { gap: 16px; grid-template-columns: 1fr 1fr; }
  .play-layout, .route-wrap { grid-template-columns: minmax(0, 1fr) 248px; gap: 18px; }
  .toolbox, .route-tools { padding: 16px; }
  .piece-choice { flex-basis: 56px; }
}

@media (max-width: 680px) {
  .site-header { padding: 13px 16px; }
  #app, .app { padding: 2px 16px 32px; }
  .brand { font-size: 16px; gap: 8px; }
  .brand img { width: 34px; height: 39px; }
  .parent-link { padding: 8px 10px; font-size: 16px; }
  .home-hero { grid-template-columns: 1fr; gap: 1px; margin: 4px 0 23px; }
  .hero-copy { padding: 12px 2px 0; }
  .hero-copy h1 { margin-bottom: 12px; font-size: 34px; }
  .hero-copy p { max-width: 100%; font-size: 16px; line-height: 1.7; margin-bottom: 8px; }
  .eyebrow { margin-bottom: 10px; font-size: 12px; }
  .hero-art img { max-height: 218px; }
  .activity-grid { gap: 12px; }
  .activity-card { gap: 13px; padding: 16px; border-radius: 21px; }
  .card-art { width: 60px; height: 60px; border-radius: 18px; font-size: 31px; }
  .card-art img { width: 49px; height: 51px; }
  .card-copy h2 { font-size: 18px; margin-bottom: 5px; }
  .card-copy p { font-size: 13px; }
  .bottom-note { margin-top: 17px; padding-top: 11px; font-size: 13px; }
  .screen-head { margin: 8px 0 16px; gap: 11px; }
  .screen-head h1 { font-size: 26px; }
  .screen-head .subtitle { font-size: 14px; }
  .taskbar { align-items: flex-start; padding: 15px; margin-bottom: 17px; gap: 10px; border-radius: 17px; }
  .task-copy { font-size: 16px; }
  .listen { min-width: 80px; padding: 10px; font-size: 16px; }
  .play-layout, .route-wrap { grid-template-columns: 1fr; gap: 19px; }
  .studio { max-width: 480px; margin: 0 auto; }
  .toolbox { display: grid; grid-template-columns: 1fr; gap: 16px; padding: 17px; }
  .pieces { gap: 9px; }
  .piece-choice { flex-basis: 64px; min-height: 72px; }
  .colors { gap: 12px; }
  .toolbar button { min-height: 47px; }
  .toolbox > .primary { min-height: 51px; }
  .route-tools { padding: 17px; gap: 15px; }
  .route-board { gap: 7px; padding: 9px; border-radius: 19px; }
  .direction-button { min-height: 59px; font-size: 31px; }
  .command-list { min-height: 72px; }
  .command-token { min-width: 42px; height: 42px; }
  .navrow { align-items: stretch; gap: 9px; margin-top: 18px; }
  .navrow button { flex: 1 1 135px; }
  .status { margin-top: 15px; font-size: 15px; }
  .parent-intro { padding: 17px; margin-top: 13px; }
  .activity-observation { padding: 18px; border-radius: 19px; }
  .form-grid { grid-template-columns: 1fr; gap: 14px; }
  .field.full, .field-wide { grid-column: auto; }
  .record-actions button { flex: 1 1 138px; }
  .insight { padding: 18px; }
  .saved-note { font-size: 13px; }
  .confirm-dialog { padding: 23px; }

  /* Keep the tools and board within one short, natural touch workflow. */
  .play-layout:not(.route-wrap) { max-width: 480px; grid-template-columns: minmax(0, 1fr) 108px; gap: 10px 12px; }
  .play-layout:not(.route-wrap) > .toolbox { display: contents; }
  .play-layout:not(.route-wrap) > .studio { order: 4; grid-column: 1 / -1; }
  .play-layout:not(.route-wrap) > .toolbox > .toolgroup:first-child { order: 1; grid-column: 1 / -1; }
  .play-layout:not(.route-wrap) > .toolbox > .toolgroup:nth-child(2) { order: 2; grid-column: 1; align-self: center; }
  .play-layout:not(.route-wrap) .toolgroup > .label { margin-bottom: 7px; font-size: 13px; }
  .play-layout:not(.route-wrap) .pieces { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
  .play-layout:not(.route-wrap) .piece-choice { min-height: 70px; padding: 8px 4px; gap: 7px; }
  .play-layout:not(.route-wrap) .piece-choice .mini-brick { width: calc(var(--preview-w, 2) * 10px); height: calc(var(--preview-h, 1) * 10px); max-height: none; }
  .play-layout:not(.route-wrap) .colors { gap: 6px; }
  .play-layout:not(.route-wrap) .color-choice { width: 44px; min-width: 44px; height: 44px; min-height: 44px; }
  .play-layout:not(.route-wrap) > .toolbox > .toolbar { order: 2; grid-column: 2; display: grid; grid-template-columns: 1fr; gap: 6px; }
  .play-layout:not(.route-wrap) > .toolbox > .toolbar button { min-height: 44px; padding: 8px 6px; }
  .play-layout:not(.route-wrap) > .toolbox > .selection-label { order: 3; grid-column: 1 / -1; margin: 0 0 1px; font-size: 13px; }
  .play-layout:not(.route-wrap) > .toolbox > .primary { order: 5; grid-column: 1 / -1; margin-top: 2px; }
  .play-layout:not(.route-wrap) > .toolbox > .ghost { order: 6; grid-column: 1 / -1; min-height: 44px; }
  .play-layout:not(.route-wrap) > .toolbox > .navrow { order: 7; grid-column: 1 / -1; margin: 0; }
  .play-layout:not(.route-wrap) .status { margin-top: 12px; }

  .route-wrap { max-width: 480px; grid-template-columns: 1fr; gap: 11px; }
  .route-wrap > .studio, .route-wrap > .route-tools { display: contents; }
  .route-wrap .route-board { order: 1; }
  .route-wrap .route-legend { order: 2; margin: 0; font-size: 13px; }
  .route-wrap .direction-buttons { order: 3; }
  .route-wrap .command-list { order: 4; min-height: 66px; padding: 10px; }
  .route-wrap .route-tools > .label { display: none; }
  .route-wrap .route-tools > .toolbar:has([data-action="run-route"]) { order: 5; }
  .route-wrap .status { order: 6; margin: 0; }
  .route-wrap .route-tools > .toolbar:has([data-action="reset-route"]) { order: 7; }
  .route-wrap .route-tools > [data-action="toggle-stone"] { order: 8; }
  .route-wrap .route-tools > [data-action="route-hint"] { order: 9; }
  .route-wrap .route-tools > .navrow { order: 10; margin: 0; }
}

@media (min-width: 430px) and (max-width: 680px) {
  .play-layout:not(.route-wrap) { grid-template-columns: minmax(0, 1fr) 165px; }
  .play-layout:not(.route-wrap) > .toolbox > .toolbar { grid-template-columns: repeat(2, minmax(0, 1fr)); align-self: end; }
}

@media (max-width: 360px) {
  .site-header { padding-left: 12px; padding-right: 12px; }
  #app, .app { padding-left: 12px; padding-right: 12px; }
  .brand { font-size: 15px; }
  .brand img { width: 30px; }
  .parent-link { padding-left: 8px; padding-right: 8px; }
  .hero-copy h1 { font-size: 30px; }
  .activity-card { padding: 14px; }
  .card-copy h2 { font-size: 17px; }
  .taskbar { flex-wrap: wrap; }
  .listen { margin-left: auto; }
  .screen-head h1 { font-size: 23px; }
  .stud { width: 11px; height: 11px; }
  .play-layout:not(.route-wrap) { grid-template-columns: minmax(0, 1fr) 93px; column-gap: 8px; }
  .play-layout:not(.route-wrap) .colors { gap: 4px; }
}

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