/* Layout dimensions inherited from the Graphoria regional map. */
.workspace{height:100svh;min-height:0}.sidebar{overflow-y:auto}.map-scroll{height:100%}.meadow-art{isolation:isolate}.meadow-art>img{pointer-events:none}.meadow-art svg{position:absolute;inset:0;width:100%;height:100%;touch-action:none}svg text{font:bold 26px Georgia,serif;fill:#263a2d;paint-order:stroke;stroke:#ffffe5;stroke-width:6px;stroke-linejoin:round}.scene-heading,.scene-caption{position:absolute;z-index:1;background:#f3f5ebed;border:1px solid var(--graphoria-border);border-radius:8px;color:var(--graphoria-ink);pointer-events:none}.scene-heading{top:2%;left:50%;transform:translateX(-50%);padding:.65rem 1rem;text-align:center;min-width:300px}.scene-heading strong{display:block;letter-spacing:.08em}.scene-heading span{font-size:.85rem}.scene-caption{bottom:1%;left:50%;transform:translateX(-50%);margin:0;padding:.4rem .8rem;white-space:nowrap;font-size:.8rem}h1{font-size:2.4rem}button,select,input{font:inherit}button,select{width:100%;min-height:44px;padding:.55rem .65rem;border:1px solid var(--graphoria-border);border-radius:6px;cursor:pointer}button{margin:.2rem 0}label{display:block;font-size:.93rem;margin-top:.65rem}input[type=range]{width:100%;accent-color:var(--graphoria-river);min-height:32px}input[type=number]{width:100%;padding:.5rem;border:1px solid var(--graphoria-border);border-radius:4px;background:#fffef7;color:var(--graphoria-ink)}input[type=radio],input[type=checkbox]{accent-color:var(--graphoria-river);width:18px;height:18px;vertical-align:middle}fieldset{border:1px solid var(--graphoria-border);border-radius:6px;padding:.45rem .7rem;margin:.8rem 0}.feedback{padding:.75rem;border-left:4px solid var(--graphoria-river);border-radius:4px;font-size:.93rem}details{border-top:1px solid var(--graphoria-border);padding:.65rem 0}summary{cursor:pointer;min-height:44px}dialog{max-width:620px;max-height:85svh;overflow:auto;background:var(--graphoria-panel);color:var(--graphoria-ink);border:2px solid var(--graphoria-river);border-radius:12px;padding:1.5rem}dialog::backdrop{background:#172b27aa}[hidden]{display:none!important}.skip{position:absolute;top:-100px;left:1rem;z-index:9;background:white;padding:.7rem}.skip:focus{top:0}:focus-visible{outline:3px solid var(--graphoria-river);outline-offset:3px}
@media(max-width:1199px){.workspace{height:auto;min-height:100svh}.sidebar{overflow:visible}.map-scroll{height:auto;max-height:75svh}.scene-heading{min-width:260px}nav{grid-template-columns:repeat(3,minmax(0,1fr))}}@media(max-width:600px){nav{grid-template-columns:1fr}.scene-heading{left:450px}.scene-caption{left:450px}.sidebar h1{font-size:2.2rem}}
/* Fit the complete activity to the central panel: no regional-map panning. */
.map-scroll{display:flex;align-items:center;overflow:hidden}
.map-art.meadow-art{width:100%;min-width:0;flex:0 0 100%;min-height:0;aspect-ratio:3/2}
.meadow-art>img{width:100%;height:auto;display:block}
@media(max-width:1199px){.map-scroll{max-height:none}.map-art.meadow-art{width:100%;min-width:0}}
@media(max-width:600px){.scene-heading{left:50%;min-width:0;width:85%;padding:.3rem;font-size:.7rem}.scene-heading span{font-size:.65rem}.scene-caption{left:50%;max-width:94%;white-space:normal;text-align:center;font-size:.65rem;padding:.2rem}}
/* Fill the desktop centre panel vertically, keeping field geometry proportional. */
@media(min-width:1200px){
 .map-art.meadow-art{height:100%;aspect-ratio:auto}
 .meadow-art>img{height:100%;object-fit:fill}
}

/* Independent interactive layers; outer Atlas dimensions stay unchanged. */
#goat{cursor:grab;touch-action:none}#field:has(#goat:active){cursor:grabbing}#goat:focus-visible{outline:none}#goat:focus-visible>rect{stroke:#123e5b;stroke-width:4;stroke-dasharray:8 5;rx:12}#rope-line,#post,#reveal,#grid,#prediction,#meadow-surface{pointer-events:none}

#grazed{pointer-events:none}

#prediction{opacity:1;transition:opacity .5s ease;pointer-events:none}#prediction.faded{opacity:.28}
@media(prefers-reduced-motion:reduce){#prediction{transition:none}}

/* Atlas backdrop standard: fill the existing central panel edge to edge.
   The backdrop is independent of the proportional interactive field. */
body.atlas-location .map-panel{position:relative;isolation:isolate;overflow:hidden;border-radius:12px}
body.atlas-location .map-panel>.meadow-landscape{position:absolute;inset:0;width:100%;height:100%;max-width:none;object-fit:fill;pointer-events:none;z-index:0}
body.atlas-location .map-panel>.map-scroll{position:relative;z-index:1;background:transparent}
body.atlas-location .map-art.meadow-art{background:transparent}

#field[data-mode="predict"],#field[data-mode="predict"] #goat{cursor:crosshair}#field[data-mode="tether"] #goat{cursor:crosshair}

/* Paged introduction, matching Königsberger Brücke. */
.meadow-story {
  box-sizing: border-box;
  width: min(36rem, calc(100vw - 2rem));
  max-height: calc(100dvh - 2rem);
  overflow: auto;
  padding: 1.4rem 1.6rem;
  border: 2px solid #78917e;
  border-radius: 14px;
  background: #f3f5eb;
  color: #343e35;
  box-shadow: 0 20px 80px #102c3260;
  font: 1.08rem/1.65 Georgia, serif;
}

.meadow-story::backdrop {
  background: #102c326b;
}

.story-topline,
.story-footer,
.story-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
}

.story-topline .eyebrow {
  margin: 0;
}

.story-topline button {
  flex: none;
}

.meadow-story button {
  min-height: 44px;
  padding: .55rem .8rem;
  border: 1px solid #78917e;
  border-radius: 7px;
  background: #fafbf4;
  color: #244a45;
  font: .94rem/1.3 system-ui, sans-serif;
  cursor: pointer;
}

.meadow-story button:disabled {
  opacity: .45;
  cursor: default;
}

.story-panel {
  min-height: 295px;
}

.story-panel h2 {
  margin: 1rem 0;
  font-size: 1.75rem;
}

.story-panel ul {
  padding-left: 1.3rem;
}

.story-panel li {
  margin: .4rem 0;
}

.story-reminder {
  padding: .6rem .8rem;
  border-left: 3px solid #315f59;
  background: #e5ebdd;
}

.story-footer {
  padding-top: .8rem;
  border-top: 1px solid #a4b39c;
}

#story-progress {
  margin: 0;
  font: .85rem/1.4 system-ui, sans-serif;
}

.meadow-story #story-begin{background:#315f59;color:white}

.map-panel{position:relative}
#meadow-info{position:absolute;top:1rem;right:1rem;z-index:5;width:44px;height:44px;min-height:44px;padding:0;border:1px solid #78917e;border-radius:50%;background:#f3f5eb;color:#244a45;font:bold 1.4rem Georgia,serif;box-shadow:0 2px 10px #102c3240}
.meadow-story button{width:auto;flex-shrink:0}
.meadow-story .story-panel h2:focus{outline:none}
@media(max-width:600px){.meadow-story{padding:1rem}.meadow-story .story-panel{min-height:0}.meadow-story .story-panel h2{font-size:1.5rem}.story-footer{flex-wrap:wrap}.story-actions{flex-wrap:wrap}}

/* Keep the breathing room before the final introduction reminder. */
.story-page-gap{height:8rem}

/* Controls sit below the field: tether settings left, interaction modes right. */
body.atlas-location .map-panel{display:flex;flex-direction:column}
body.atlas-location .map-panel>.map-scroll{flex:1 1 0;min-height:0;height:auto}
.meadow-bottom-controls{position:relative;z-index:2;flex:none;display:grid;grid-template-columns:minmax(0,1.65fr) minmax(0,1fr);gap:.75rem;padding:.75rem;align-items:stretch}
.meadow-tether-panel,.meadow-mode-panel{min-width:0;background:#f3f5ebed;border:1px solid var(--graphoria-border);border-radius:9px;padding:.65rem .8rem;color:var(--graphoria-ink)}
.meadow-tether-panel h2{font-size:1rem;margin:0 0 .4rem}
.meadow-tether-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.3rem .8rem}
.meadow-control{min-width:0}
.meadow-control label{font-size:.85rem;margin:0;line-height:1.4}
.meadow-control select{box-sizing:border-box;font-size:.85rem;padding:.3rem;min-height:36px;max-width:100%}
.meadow-control input[type=range]{box-sizing:border-box;display:block;margin:0;min-height:32px;width:100%}
.meadow-mode-panel{display:flex;align-items:center}
.meadow-mode-panel fieldset{min-width:0;width:100%;margin:0;padding:0;border:0}
.meadow-mode-panel legend{font-size:.9rem;line-height:1.4;padding:0;margin-bottom:.3rem}
.meadow-mode-panel label{font-size:.9rem;line-height:1.4;margin:0;min-height:32px;display:flex;align-items:center;gap:.4rem;cursor:pointer}
.meadow-mode-panel input{flex:none;margin:0}
@media(max-width:1199px){body.atlas-location .map-panel>.map-scroll{flex:none;height:auto}.meadow-bottom-controls{grid-template-columns:minmax(0,1.65fr) minmax(0,1fr)}}
@media(max-width:650px){.meadow-bottom-controls{grid-template-columns:1fr;padding:.5rem;gap:.5rem}.meadow-mode-panel label{min-height:44px}.meadow-control select{min-height:44px}}

/* Keep the grid switch with the interaction modes. */
.meadow-mode-panel{flex-direction:column;align-items:stretch;justify-content:center}
.meadow-mode-panel>.checkline{margin-top:.3rem;padding-top:.3rem;border-top:1px solid var(--graphoria-border)}

/* Guidance stays separate from Clover's current position. */
#feedback ul{margin:0;padding-left:1.15rem}
#feedback li+li{margin-top:.55rem}
.clover-position p{margin:0}
.clover-position p+p{margin-top:.5rem}

/* Distinguish reset and collapse the unused hint space. */
body.atlas-location .atlas-right #reset{background:#f5e7e2!important;color:#823e32!important;border-color:#a86554!important}
body.atlas-location .atlas-right #reset:hover{background:#ecd4cc!important}
#hint-text:empty{display:none}
.meadow-arrival-art {
  display: block;
  width: 100%;
  height: 100%;
}

.meadow-goatherd {
  display: block;
  width: 100%;
  height: auto;
  max-height: 24rem;
  margin: 1rem auto 0;
  object-fit: contain;
}

@media (min-width: 1200px) {
  body[data-place="tethered-meadow"] .audit-arrival-controls {
    display: flex;
    flex-direction: column;
  }
  body[data-place="tethered-meadow"] .audit-arrival-controls > :not(.meadow-goatherd) {
    flex-shrink: 0;
  }
  .meadow-goatherd {
    flex: 1 1 0;
    min-height: 0;
    max-height: none;
  }
}
