/* Brand system shared with meetmrsketch.com (see MEET MR SKETCH - Website/
   index.html — this is the same :root palette/fonts, not a reinterpretation).
   Layered on top of the existing kid-facing UX rules from PLATFORM-DESIGN.md
   §B2 (storybook pacing, tiny-hand target sizes) — brand identity unifies
   the look; target sizing/density still fits who's actually tapping. */
@import url('https://fonts.googleapis.com/css2?family=Jost:wght@400;500;600;900&family=DM+Mono:wght@400;500&display=swap');

:root {
  --draft-orange: #2D7A52; /* site's var name; it's the forest-green accent */
  --blue: #5AA0CC;
  --blue-deep: #3A6EA8;
  --blue-light: #DBECF9;
  --blue-mid: #CFE2F3;
  --blue-dark: #326C90;
  --dark: #4C4540;
  --dark-deep: #2D3E52;
  --parchment: #F2F4F0;
  --parchment-deep: #EDE8DF;
  --sand: #D8E4F0;
  --warm-gray: #C8BBAA;
  --taupe: #6B7A8D;
  --white: #FFFFFF;
  --surface: #FFFFFF; /* card/door background — decoupled from --white so
                          dark mode can flip it without touching on-accent
                          button text, which stays white in both themes */
  --tile-bg: #2D3E52; /* sprite-holding tiles (.thumb/.candidate) — fixed
                          dark navy regardless of theme; scanned art is
                          drawn against this and shouldn't flip with it */
  --header-bg: rgba(245, 240, 232, 0.7);
  /* Phase 9 typography correction: matches the annotation sheets'
     own lettering — a black-weight Jost for headers, DM Mono carrying
     the majority of body text (subheaders are bold DM Mono, which falls
     out for free since they already use font-weight:700 on top of
     whatever --font-ui resolves to). */
  --font-display: 'Jost', 'Segoe UI', Arial, sans-serif;
  --font-display-weight: 900;
  --font-ui: 'DM Mono', 'Courier New', monospace;
  --font-mono: 'DM Mono', 'Courier New', monospace;

  /* app-local aliases so the rest of this file (and every view built
     against it) doesn't need renaming — same values, brand names */
  --paper: var(--parchment);
  --ink: var(--dark-deep);
  --ink-soft: var(--taupe);
  --blueprint: var(--blue-deep);
  --blueprint-soft: var(--blue-light);
  --accent: var(--draft-orange);
  --good: var(--draft-orange);
  /* Phase 9 correction: an asymmetric-radius "wobble" read as a rendering
     accident, not hand-drawn — actual hand-drafted work (architectural
     drafts, technical illustration) has crisp ruled corners, not soft
     rounded ones. Tightened both radii and dropped the asymmetry; the
     corner registration marks (.marks) carry the "drafted" identity now,
     not the corner radius. */
  --radius: 10px;
  --radius-hand: 6px;

  /* design handoff (2026-08-08): drifting blueprint background + flatten
     press feedback + corner registration marks — see the handoff doc for
     full rationale. Token additions only, nothing above renamed. */
  --press-in: 80ms ease-out;
  --press-out: 140ms ease-in;
  --drift-grid-speed: 14s;
  --drift-paper-speed: 22s;
  --drift-grid-color: rgba(58, 110, 168, 0.05);
  --drift-paper-color: rgba(76, 69, 64, 0.035);
  --drift-paper-color-2: rgba(76, 69, 64, 0.02);
  --drift-paper-blend: multiply;
  --mark-size: 16px;
  --mark-weight: 2px;
  --mark-inset: 8px;
}

:root[data-theme="dark"] {
  --draft-orange: #4FAE7C;
  --blue: #7CB8E0;
  --blue-deep: #5A8FC7;
  --blue-light: #1C2A3A;
  --blue-mid: #24374A;
  --blue-dark: #8FC4EA;
  --dark: #E4E2DC;
  --dark-deep: #F2F0EA;
  --parchment: #1A2129;
  --parchment-deep: #141920;
  --sand: #2A3B4D;
  --warm-gray: #4A423A;
  --taupe: #93A3B5;
  --surface: #212B35;
  --header-bg: rgba(20, 25, 32, 0.75);
  --drift-grid-color: rgba(124, 184, 224, 0.07);
  --drift-paper-color: rgba(228, 226, 220, 0.035);
  --drift-paper-color-2: rgba(228, 226, 220, 0.018);
  --drift-paper-blend: screen;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  font-family: var(--font-ui);
  color: var(--ink);
  position: relative;
  overflow-x: hidden;
  transition: background-color 0.25s ease, color 0.25s ease;
}

/* Drifting blueprint: two texture layers, opposite directions, different
   speeds — the grid drifts down-right, a paper-grain layer drifts
   up-left underneath it. Animates background-position, not transform,
   so there's no foreground repaint. */
body::before,
body::after {
  content: "";
  position: fixed;
  inset: -40px;
  pointer-events: none;
  z-index: 0;
}
body::before {
  background-image:
    linear-gradient(var(--drift-grid-color) 1px, transparent 1px),
    linear-gradient(90deg, var(--drift-grid-color) 1px, transparent 1px);
  background-size: 28px 28px;
  animation: dyo-drift-down var(--drift-grid-speed) linear infinite;
}
body::after {
  background-image:
    radial-gradient(var(--drift-paper-color) 1.5px, transparent 1.6px),
    radial-gradient(var(--drift-paper-color-2) 1px, transparent 1.2px);
  background-size: 68px 68px, 41px 41px;
  background-position: 0 0, 20px 30px;
  animation: dyo-drift-up var(--drift-paper-speed) linear infinite;
  mix-blend-mode: var(--drift-paper-blend);
}
@keyframes dyo-drift-down { from { background-position: 0 0; } to { background-position: 28px 280px; } }
@keyframes dyo-drift-up { from { background-position: 0 0, 20px 30px; } to { background-position: -34px -280px, -14px -250px; } }

#app-shell {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.chrome-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--sand);
  background: var(--header-bg, rgba(245, 240, 232, 0.7));
}

.chrome-header .back {
  border: none;
  background: var(--blueprint-soft);
  color: var(--blueprint);
  font-size: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--press-out);
}
.chrome-header .back:active { transform: scale(0.86); transition: transform var(--press-in); }

.chrome-header h1 {
  font-family: var(--font-display);
  font-weight: var(--font-display-weight);
  font-size: 22px;
  margin: 0;
  color: var(--dark-deep);
  flex: 1;
}

#outlet {
  flex: 1;
  padding: 8px 20px 40px;
}

/* three doors */
.doors {
  display: grid;
  gap: 18px;
  margin-top: 24px;
}

.door {
  display: flex;
  align-items: center;
  gap: 18px;
  border: 1.5px solid var(--blue);
  border-radius: var(--radius-hand);
  background: var(--surface);
  padding: 22px 24px;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: var(--font-display-weight);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  min-height: 88px;
  transition: box-shadow 0.2s, transform var(--press-out);
}
.door:hover { box-shadow: 0 8px 28px rgba(90,160,204,0.16); transform: translateY(-1px); }
.door:active { transform: scaleY(0.86) scaleX(1.03); transition: transform var(--press-in); }

.door .icon {
  flex: none;
}
.door .icon .icon-medallion { width: 52px; height: 52px; }
.door .icon .icon-medallion svg { width: 26px; height: 26px; }

.door .sub {
  display: block;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 400;
  color: var(--ink-soft);
  margin-top: 2px;
}

/* generic building blocks */
.big-btn {
  display: inline-block;
  border: none;
  border-radius: 10px;
  background: var(--blueprint);
  color: var(--white);
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 600;
  padding: 14px 28px;
  cursor: pointer;
  min-height: 48px;
  transition: background 0.2s, transform var(--press-out);
}
.big-btn:hover { transform: translateY(-1px); }
.big-btn:active { transform: scaleY(0.86) scaleX(1.03); transition: transform var(--press-in); }

.big-btn.secondary {
  background: var(--blueprint-soft);
  color: var(--blue-dark);
}

.big-btn.accent {
  background: var(--accent);
}
.big-btn.accent:hover { background: #236040; }

.card {
  position: relative;
  border-radius: var(--radius-hand);
  background: var(--surface);
  border: 1.5px solid var(--blue);
  padding: 16px;
  transform: rotate(var(--tilt, 0deg)); /* no-op unless .tinker-tilt sets --tilt */
}

/* only genuinely clickable cards (rendered as <button class="card">, not
   the many plain <div class="card"> containers that just hold content
   like sliders — squishing those on every inner tap would feel broken)
   get the press language. */
button.card {
  cursor: pointer;
  transition: transform var(--press-out);
}
button.card:active { transform: rotate(var(--tilt, 0deg)) scaleY(0.86) scaleX(1.03); transition: transform var(--press-in); }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.thumb {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 14px;
  background: var(--tile-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.thumb img { max-width: 90%; max-height: 90%; }

.progress-msg {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: var(--font-display-weight);
  text-align: center;
  margin: 60px 0 16px;
  color: var(--dark-deep);
}

.progress-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--blueprint); display: inline-block; margin: 0 3px;
  animation: pulse 1.1s infinite ease-in-out;
}
.progress-dot:nth-child(2) { animation-delay: .15s; }
.progress-dot:nth-child(3) { animation-delay: .3s; }
@keyframes pulse { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

.not-found { text-align: center; margin-top: 80px; }

.slot-row {
  display: flex;
  align-items: center;
  gap: 16px;
  border-radius: var(--radius-hand);
  background: var(--surface);
  border: 1.5px solid var(--blue);
  padding: 14px;
  margin-bottom: 14px;
}
.slot-row .thumb { width: 64px; height: 64px; flex: none; }
.slot-row .label { flex: 1; font-weight: 600; }

.candidate-strip { display: flex; gap: 10px; overflow-x: auto; padding: 4px 0; }
.candidate {
  flex: none; width: 72px; height: 72px; border-radius: 14px;
  background: var(--tile-bg); border: 3px solid transparent; cursor: pointer;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  position: relative;
  transform: rotate(var(--tilt, 0deg));
  transition: transform var(--press-out);
}
.candidate:active { transform: rotate(var(--tilt, 0deg)) scaleY(0.86) scaleX(1.03); transition: transform var(--press-in); }
.candidate.selected { border-color: var(--good); }
.candidate img { max-width: 90%; max-height: 90%; }

/* pill: small mono-labeled tags (status, eyebrows) — matches the site's
   .nav-status / .eyebrow treatment */
.pill {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--blue-dark);
  background: var(--blue-light);
  border: 1px solid var(--blue);
  border-radius: 20px;
  padding: 4px 14px;
  display: inline-block;
}

/* Phase 9 icon system (app/shell/icons.js) — replaces emoji everywhere.
   Plain icons inherit the surrounding text color (buttons/badges already
   set their own); medallions get their own circular badge in the blue/
   black style, a placeholder for the user's own hand-drawn icon set. */
.icon-medallion {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--dark-deep);
  background: var(--white);
  color: var(--dark-deep);
  flex: none;
}
:root[data-theme="dark"] .icon-medallion {
  background: var(--surface);
  border-color: var(--parchment);
  color: var(--parchment);
}
.icon-medallion svg { width: 20px; height: 20px; }
.icon-medallion.icon-medallion-sm { width: 30px; height: 30px; }
.icon-medallion.icon-medallion-sm svg { width: 15px; height: 15px; }

.door .icon-medallion, .big-btn .icon-medallion { border-color: currentColor; color: currentColor; background: transparent; }

/* admin: dense data tables — a different register from the kid-facing
   card grids on purpose, this is Matthew's own inspector view */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: var(--surface);
  border-radius: 12px;
  overflow: hidden;
}
.data-table th {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--taupe);
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1.5px solid var(--blue-light);
  background: var(--blue-light);
}
.data-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--blue-light);
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }

/* design handoff (2026-08-08) motifs — corner registration marks, small
   DM Mono margin annotations, and controlled-variance tilt on repeated
   list items. Applied to the level editor + equip screen for now (the
   two screens the handoff actually comped); everything above this
   comment (tokens, drift background, press-flatten) is already global. */

/* Corner registration marks — echoes the ArUco brackets already printed
   on every physical sheet, drawn as background layers so it needs no
   extra markup per card. Two pseudo-elements, two corners each. */
.marks { position: relative; }
/* corner registration marks are now .card's default look — the "drafted"
   identity lives here since the corner-radius wobble it used to compete
   with turned out to just read as a rendering accident, not hand-drawn.
   .marks stays around for non-.card elements (equip candidate tiles). */
.marks::before,
.marks::after,
.card::before,
.card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-repeat: no-repeat;
  z-index: 1;
}
.marks::before,
.card::before {
  /* top-left + bottom-right */
  background-image:
    linear-gradient(var(--blue-deep), var(--blue-deep)), linear-gradient(var(--blue-deep), var(--blue-deep)),
    linear-gradient(var(--blue-deep), var(--blue-deep)), linear-gradient(var(--blue-deep), var(--blue-deep));
  background-size:
    var(--mark-size) var(--mark-weight), var(--mark-weight) var(--mark-size),
    var(--mark-size) var(--mark-weight), var(--mark-weight) var(--mark-size);
  background-position:
    var(--mark-inset) var(--mark-inset), var(--mark-inset) var(--mark-inset),
    calc(100% - var(--mark-inset) - var(--mark-size)) calc(100% - var(--mark-inset)), calc(100% - var(--mark-inset)) calc(100% - var(--mark-inset) - var(--mark-size));
}
.marks::after,
.card::after {
  /* top-right + bottom-left */
  background-image:
    linear-gradient(var(--blue-deep), var(--blue-deep)), linear-gradient(var(--blue-deep), var(--blue-deep)),
    linear-gradient(var(--blue-deep), var(--blue-deep)), linear-gradient(var(--blue-deep), var(--blue-deep));
  background-size:
    var(--mark-size) var(--mark-weight), var(--mark-weight) var(--mark-size),
    var(--mark-size) var(--mark-weight), var(--mark-weight) var(--mark-size);
  background-position:
    calc(100% - var(--mark-inset) - var(--mark-size)) var(--mark-inset), calc(100% - var(--mark-inset) - var(--mark-weight)) var(--mark-inset),
    var(--mark-inset) calc(100% - var(--mark-inset) - var(--mark-weight)), var(--mark-inset) calc(100% - var(--mark-inset) - var(--mark-size));
}
/* small variant for tight spaces (equip-screen candidate tiles) — a
   positive inset, not negative: the tile it's applied to has
   overflow:hidden (to crop the sprite image inside), so marks hanging
   outside the box would just get clipped away. */
.marks-sm { --mark-size: 9px; --mark-inset: 3px; }
/* opt-out for the rare card that hosts live content the marks would sit
   awkwardly over (the game iframe wrapper) */
.card.no-marks::before, .card.no-marks::after { display: none; }

/* small DM Mono metadata note, e.g. "seq/03", "×12 in library" */
.meta-note {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--taupe);
  letter-spacing: 0.02em;
}

/* .tinker-tilt previously assigned an alternating per-position --tilt
   rotation here (2026-08 polish pass: removed at Matthew's explicit call —
   read as unintentionally skewed against the grid background, not as
   "hand-placed"). .card/button.card/.candidate still consume --tilt via
   rotate(var(--tilt, 0deg)), so leaving the class in markup is harmless —
   it just resolves to dead-level since nothing sets --tilt anymore. */

/* range slider thumb — round targets scale uniformly instead of the
   rectangular squish. */
/* Bigger track + thumb than any browser default — a slider that's easy to
   grab with a finger, not just a mouse pointer. */
input[type="range"] {
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 36px;
  background: transparent;
  margin: 6px 0;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 8px;
  border-radius: 4px;
  background: var(--blueprint-soft);
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 28px;
  height: 28px;
  margin-top: -10px; /* centers the 28px thumb on the 8px track */
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--white);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  transition: transform var(--press-out);
}
input[type="range"]:active::-webkit-slider-thumb { transform: scale(0.85); transition: transform var(--press-in); }
input[type="range"]::-moz-range-track {
  height: 8px;
  border-radius: 4px;
  background: var(--blueprint-soft);
}
input[type="range"]::-moz-range-thumb {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--white);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  transition: transform var(--press-out);
}
input[type="range"]:active::-moz-range-thumb { transform: scale(0.85); transition: transform var(--press-in); }

/* Manual "turn off the scrolling background" toggle (Settings) —
   independent of prefers-reduced-motion, which already covers this for
   anyone with that OS setting on. */
.bg-motion-off body::before, .bg-motion-off body::after { animation: none; }

@media (prefers-reduced-motion: reduce) {
  body::before, body::after { animation: none; }
  .door:active,
  .big-btn:active {
    transform: none;
  }
  /* button.card/.candidate use --tilt outside of :active too, so "no
     press feedback" means holding at the resting tilt (0deg unless
     .tinker-tilt set one), not snapping to dead level */
  button.card:active,
  .candidate:active {
    transform: rotate(var(--tilt, 0deg));
  }
  input[type="range"]:active::-webkit-slider-thumb,
  input[type="range"]:active::-moz-range-thumb {
    transform: none;
  }
}

@media (max-width: 480px) {
  .door { font-size: 20px; padding: 18px; }
  .chrome-header { padding: 14px 14px; }
  #outlet { padding: 8px 14px 32px; }
}

.hidden { display: none !important; }

/* CSS-only fullscreen fallback for browsers with no Fullscreen API on
   arbitrary elements (iPhone Safari — iPad's desktop-class Safari has the
   real API and never needs this). The iframe's own page mirrors this via
   a postMessage'd class so its internal layout also reacts (games/*/style.css). */
#game-frame-wrap.fake-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  border-radius: 0;
  border: none;
}
#game-frame-wrap.fake-fullscreen #game-frame {
  width: 100vw !important;
  height: 100vh !important;
}

/* Theater mode — a CSS-only "dim the rest of the page and enlarge the
   game" that doesn't depend on the Fullscreen API at all (unlike the
   fake-fullscreen block above, which exists specifically because that API
   is unreliable across devices). This is the primary big-screen
   affordance now; true fullscreen stays available as a secondary,
   opportunistic upgrade next to it. */
.theater-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 16, 0.92);
  z-index: 998;
}
.theater-backdrop.hidden { display: none; }

#game-frame-wrap.theater-active {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(94vw, 720px);
  height: min(90vh, 960px);
  z-index: 999;
  border-radius: 0;
}
#game-frame-wrap.theater-active #game-frame {
  width: 100% !important;
  height: 100% !important;
}

/* ---------- Asset Tool Editor ------------------------------------------- */
.editor-shell {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}


.editor-canvas-wrap {
  position: relative;
  line-height: 0;
  touch-action: none;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1.5px solid var(--blue);
  background:
    linear-gradient(45deg, #d8d8d8 25%, transparent 25%, transparent 75%, #d8d8d8 75%) 0 0/16px 16px,
    linear-gradient(45deg, #d8d8d8 25%, #fff 25%, #fff 75%, #d8d8d8 75%) 8px 8px/16px 16px;
  /* dragging to paint/select was triggering a browser text/page selection
     drag-highlight around the canvas — kill selection entirely here, same
     technique the games already use on their own play surfaces */
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

#editor-canvas { display: block; max-width: 100%; user-select: none; -webkit-user-select: none; }

.crop-overlay {
  position: absolute;
  border: 2px dashed var(--accent);
  background: rgba(90, 160, 204, 0.12);
}

.crop-handle {
  position: absolute;
  width: 26px;
  height: 26px;
  margin: -13px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--white);
  touch-action: none;
  cursor: grab;
}

.crop-handle[data-handle="tl"] { top: 0; left: 0; }
.crop-handle[data-handle="tr"] { top: 0; left: 100%; }
.crop-handle[data-handle="bl"] { top: 100%; left: 0; }
.crop-handle[data-handle="br"] { top: 100%; left: 100%; }

/* #transform-overlay reuses .crop-overlay/.crop-handle's exact styling —
   data-thandle instead of data-handle only so editor.js's own selectors
   can tell the two overlays' handles apart. */
.crop-handle[data-thandle="tl"] { top: 0; left: 0; }
.crop-handle[data-thandle="tr"] { top: 0; left: 100%; }
.crop-handle[data-thandle="bl"] { top: 100%; left: 0; }
.crop-handle[data-thandle="br"] { top: 100%; left: 100%; }

.brush-preview {
  position: absolute;
  border: 2px solid var(--accent);
  border-radius: 50%;
  background: rgba(90, 160, 204, 0.2);
  pointer-events: none;
}

.editor-tabs {
  display: flex;
  gap: 6px;
  width: 100%;
  max-width: 560px;
}
.editor-tabs .big-btn { flex: 1; padding: 8px; font-size: 13px; }

.editor-brush-modes { display: flex; gap: 6px; }

.editor-slider-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-soft);
  margin-bottom: 4px;
}

.editor-actions {
  display: flex;
  gap: 10px;
  width: 100%;
  max-width: 560px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.editor-history-row {
  display: flex;
  gap: 6px;
  width: 100%;
  max-width: 560px;
  justify-content: flex-start;
}
.editor-history-row .big-btn { padding: 6px 14px; font-size: 12px; }

.editor-offset-row {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid var(--sand);
}

.color-swatch {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--blue);
  cursor: pointer;
  flex: none;
  touch-action: none;
  transition: transform var(--press-out);
}
.color-swatch:active:not(:disabled) { transform: scale(0.86); transition: transform var(--press-in); }
.color-swatch:disabled { opacity: 0.4; cursor: default; }

.color-wheel-popover {
  position: fixed;
  z-index: 50;
  padding: 10px;
  background: var(--surface);
  border: 1.5px solid var(--blue);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}
.color-wheel-popover canvas {
  display: block;
  touch-action: none;
  border-radius: 50%;
}
.color-wheel-marker {
  position: absolute;
  width: 14px;
  height: 14px;
  margin: -7px;
  border-radius: 50%;
  border: 2px solid var(--white);
  box-shadow: 0 0 0 1.5px var(--dark-deep);
  pointer-events: none;
}

#tool-panel, .editor-shell > .editor-canvas-wrap, .editor-actions {
  width: 100%;
  max-width: 560px;
}
