/* Animated Map Chart */
.mc-wrap { max-width: 1240px; }

.mc-setup { padding: 22px; }
.mc-h2 { margin: 0 0 6px; font-size: 1.15rem; }
.mc-help { margin: 0 0 14px; color: var(--muted); font-size: .9rem; line-height: 1.55; }
.mc-textarea {
  width: 100%; min-height: 200px; resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .86rem; line-height: 1.6; white-space: pre; overflow-x: auto;
}
.mc-restored { margin: 10px 0 0; font-size: .85rem; color: var(--accent-2); }
.mc-setup-row { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; align-items: center; }
.mc-filebtn { cursor: pointer; }

.mc-samples-block { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 16px; }
.mc-samples-lbl { margin: 0 0 10px; font-size: .88rem; color: var(--muted); }
.mc-samples { display: flex; flex-wrap: wrap; gap: 8px; }
.mc-chip {
  font: inherit; font-size: .84rem; padding: 7px 13px;
  border-radius: 999px; border: 1px solid var(--line);
  background: var(--bg-soft); color: var(--text); cursor: pointer;
  transition: border-color .16s, background .16s, transform .16s;
}
.mc-chip:hover {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, var(--bg-soft));
  transform: translateY(-1px);
}
.mc-samples-note { margin: 11px 0 0; font-size: .78rem; color: var(--muted-2); line-height: 1.5; }

.mc-status { margin-top: 12px; font-size: .9rem; color: var(--muted); }
.mc-status.error { color: var(--danger); }
.mc-status.ok { color: var(--good); }
.mc-status.warn { color: var(--warn); }
.mc-status.loading { color: var(--accent-2); }

.mc-editor {
  display: grid; grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px; align-items: start;
}
.mc-preview-card { padding: 18px; }
.mc-controls { padding: 18px; display: flex; flex-direction: column; gap: 13px; }

/* Intrinsic size keeps the element hugging the frame at every aspect ratio. */
.mc-canvas {
  display: block; max-width: 100%; max-height: 60vh;
  width: auto; height: auto; margin: 0 auto;
  border-radius: var(--radius-sm); box-shadow: var(--shadow-md);
}
.mc-bar { display: flex; align-items: center; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.mc-spacer { flex: 1; }
.mc-duration { font-size: .85rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.mc-result { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 16px; }
.mc-result video {
  display: block; width: 100%; max-height: 56vh;
  border-radius: var(--radius-sm); background: #0b0e1c;
}
.mc-result-row { display: flex; align-items: center; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.mc-meta { font-size: .84rem; color: var(--muted); }

.mc-datainfo { margin: 0; font-size: .85rem; color: var(--accent-2); line-height: 1.5; }
.mc-unmatched {
  margin: 0; font-size: .8rem; line-height: 1.5; color: var(--warn);
  padding: 9px 11px; border-radius: 10px;
  background: color-mix(in srgb, var(--warn) 10%, var(--card));
  border: 1px solid color-mix(in srgb, var(--warn) 32%, var(--line));
}
.mc-small { font-size: .82rem; padding: 8px 12px; align-self: flex-start; }
.mc-two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mc-val { color: var(--muted); font-weight: 400; font-size: .8rem; }
.mc-check { display: flex; align-items: center; gap: 8px; font-size: .88rem; color: var(--text); cursor: pointer; }
.mc-check input { accent-color: var(--accent); }
.mc-controls input[type=range] { width: 100%; accent-color: var(--accent); }

@media (max-width: 900px) {
  .mc-editor { grid-template-columns: minmax(0, 1fr); }
  .mc-canvas { max-height: 46vh; }
  .mc-bar .btn { flex: 1 1 auto; }
  .mc-spacer { display: none; }
}

/* base.css scopes its input styling to `.field input/textarea`, and this one sits outside a
   .field — without this it renders as a raw browser default: grey box, 2px inset border,
   square corners. Same values as the shared rule. */
.mc-textarea {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 12px 13px;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.mc-textarea::placeholder { color: var(--muted-2); }
.mc-textarea:hover { border-color: var(--muted-2); }
.mc-textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }


/* ── colour-scale chips ─────────────────────── */
.mc-ramps {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
  gap: 6px;
}
.mc-ramp {
  display: flex; flex-direction: column; align-items: stretch; gap: 5px;
  padding: 6px 5px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-soft);
  color: var(--muted);
  font: inherit; font-size: .7rem;
  cursor: pointer;
  transition: border-color .15s, color .15s, transform .15s;
}
.mc-ramp:hover { border-color: var(--muted-2); color: var(--text); transform: translateY(-1px); }
.mc-ramp.is-on {
  border-color: var(--accent); color: var(--text);
  box-shadow: 0 0 0 1px var(--accent) inset;
}
.mc-ramp-sw { display: block; height: 16px; border-radius: 5px; }
.mc-ramp small { text-align: center; line-height: 1; }

.mc-reset {
  float: right;
  border: 0; background: none; color: var(--accent);
  font: inherit; font-size: .74rem; cursor: pointer; padding: 0;
  text-decoration: underline;
}
.mc-hint { margin: 6px 0 0; font-size: .78rem; color: var(--muted-2); }
.mc-canvas { touch-action: none; }

@media (max-width: 900px) {
  /* The map leads on a phone — it is the thing being made. */
  .mc-editor { display: flex; flex-direction: column; }
  .mc-preview-card { order: 1; }
  .mc-controls { order: 2; }
  .mc-ramps { grid-template-columns: repeat(auto-fill, minmax(68px, 1fr)); }
}
@media (max-width: 560px) {
  .mc-two { grid-template-columns: minmax(0, 1fr); }
  .mc-setup, .mc-controls, .mc-preview-card { padding: 14px; }
  .mc-canvas { max-height: 42vh; }
}


/* ── stage + zoom bar docked to the preview ─── */
/* Width is set in JS from the canvas's rendered size, so the bars line up with the map
   instead of spanning a much wider card. */
.mc-stage { max-width: 100%; margin: 0 auto; }
.mc-zoombar {
  display: flex; align-items: center; gap: 9px;
  margin-top: 12px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-soft);
}
.mc-zoom-ico { font-size: .8rem; opacity: .7; flex: none; }
.mc-zoombar input[type=range] { flex: 1; min-width: 0; accent-color: var(--accent); }
.mc-zoomval {
  flex: none; min-width: 42px; text-align: right;
  font-size: .8rem; color: var(--text); font-variant-numeric: tabular-nums;
}
.mc-zoom-hint { flex: none; font-size: .74rem; color: var(--muted-2); }
.mc-canvas { cursor: grab; }
.mc-canvas:active { cursor: grabbing; }

@media (min-width: 901px) {
  /* Keep the map on screen while the settings column scrolls. */
  .mc-preview-card { position: sticky; top: 74px; z-index: 2; }
  .mc-canvas { max-height: 56vh; }
}
@media (max-width: 900px) {
  /* Not sticky on a phone — a pinned map leaves the options stranded behind it. */
  .mc-zoom-hint { display: none; }
  .mc-canvas { max-height: 40vh; }
}
@media (max-width: 560px) {
  .mc-zoombar { padding: 7px 10px; gap: 7px; }
  .mc-bar .btn { flex: 1 1 auto; }
}
