:root {
  --mini-top: 0px;
  --mini-right: 0px;
  --mini-bottom: 0px;
  --mini-left: 0px;
  --safe-bottom: max(env(safe-area-inset-bottom, 0px), var(--mini-bottom));
  --safe-right: max(env(safe-area-inset-right, 0px), var(--mini-right));
  --safe-left: max(env(safe-area-inset-left, 0px), var(--mini-left));
}
body { background-color: #fcfaff; }
main {
  padding-top: calc(12px + max(env(safe-area-inset-top, 0px), var(--mini-top)));
  padding-right: calc(14px + var(--safe-right));
  padding-bottom: calc(32px + var(--safe-bottom));
  padding-left: calc(14px + var(--safe-left));
}
.visuallyHidden {
  position: absolute;
  width: 1px;
  height: 1px;
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}
.flowerWorkshop #intro, .flowerWorkshop #themes, .flowerWorkshop #editProfile,
.flowerWorkshop #recommendation { display: none; }
.flowerWorkshop { padding-bottom: var(--atelier-height, 64px); }
.flowerWorkshop h1 { margin: 4px 0 10px; font-size: clamp(24px, 7vw, 36px); }
.flowerWorkshop .scene { padding: 0; overflow: hidden; }
.flowerWorkshop .sceneLabel { display: none; }
.flowerWorkshop .hint { margin: 0; padding: 6px 12px; font-size: .79rem; }
.atelier {
  position: fixed;
  z-index: 20;
  bottom: 0;
  left: var(--safe-left);
  right: var(--safe-right);
  width: min(100% - var(--safe-left) - var(--safe-right), 580px);
  margin-inline: auto;
  padding: 6px 3px calc(5px + var(--safe-bottom));
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  justify-items: stretch;
  align-items: center;
  background: #fcfaff;
  border: 1px solid #e6dbf1;
  border-bottom: 0;
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -7px 30px #44305a1d;
}
.atelier[hidden], .atelier [hidden] { display: none !important; }
.atelier .atelierBar, .atelier .atelierQuick, .atelierBar > details { display: contents; }
.atelier summary, .atelierQuick button, .atelierEdit .atelierActions button {
  position: relative;
  min-height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 11px;
  color: #49365f;
  cursor: pointer;
}
.atelier svg { display: block; width: 23px; height: 23px; }
.atelier summary { grid-row: 3; list-style: none; }
.atelierQuick button { grid-row: 3; }
.atelier summary::-webkit-details-marker { display: none; }
.atelier summary:focus-visible, .atelier button:focus-visible, .assetStrip:focus-visible {
  outline: 2px solid #74529b;
  outline-offset: -2px;
}
.atelier details[open] > summary, .atelier button[aria-pressed="true"] { background: #eae0f8; color: #543478; }
.atelier[data-tool="brush"] #brushDrawer summary { color: #794aa3; box-shadow: inset 0 -2px #c5a5e1; }
.atelierQuick button:disabled { opacity: .35; cursor: default; }
.atelier h2 { margin: 0 0 5px; font: 600 14px/1.3 system-ui, sans-serif; color: #49365f; }
.atelierTray, .atelierEdit {
  grid-column: 1 / -1;
  grid-row: 1;
  min-width: 0;
  margin: 0 3px 4px;
  padding: 9px;
  max-height: min(42dvh, 300px);
  overflow: auto;
  border-radius: 14px;
  border: 1px solid #e6dbf1;
  background: #fff;
}
.assetStrip {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-snap-type: x proximity;
  padding: 2px 3px 7px;
  scrollbar-color: #cbb6e3 #f8f2fc;
  scrollbar-width: thin;
}
.assetStrip button {
  flex: 0 0 78px;
  scroll-snap-align: start;
  display: grid;
  grid-template-rows: 56px minmax(22px, auto);
  justify-items: center;
  align-items: center;
  min-height: 44px;
  font-size: .69rem;
  line-height: 1.12;
  padding: 5px 3px;
  background: radial-gradient(ellipse at 30% 15%, #fff, #f3eaf8 80%);
  color: #49365f;
  overflow-wrap: anywhere;
}
.assetStrip img { display: block; width: 64px; height: 56px; object-fit: contain; }
.assetStrip small { display: block; font-size: .61rem; }
.atelierContext {
  grid-column: 1 / -1;
  grid-row: 2;
  min-width: 0;
  padding-inline: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  color: #64566f;
  font-size: .72rem;
}
.atelierContext button {
  min-height: 40px;
  color: #543478;
  background: #f0e7f9;
  padding: 4px 8px;
  border-radius: 10px;
  font-size: .75rem;
  overflow-wrap: anywhere;
}
.atelierContext span { flex: none; }
.atelierActions { display: flex; gap: 5px; align-items: center; margin: 4px 0; }
.atelierActions button { flex: 1; min-height: 44px; padding: 4px 8px; font-size: .75rem; }
.atelierInspectorHeader { display: flex; align-items: center; justify-content: space-between; }
.atelierInspectorHeader button { min-width: 44px; min-height: 44px; padding: 0; font-size: 1.25rem; }
.atelierSliders { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.atelierSliders input, #lightStrength { width: 100%; min-height: 34px; margin: 0; accent-color: #74529b; }
.atelierEdit label, .atelierTray label { color: #322445; font-size: .76rem; }
.atelier select { min-height: 42px; max-width: 100%; color: #322445; background: #fcfaff; border: 1px solid #e0d6ed; border-radius: 8px; }
.atelier #flowerMotion { min-height: 44px; padding: 5px 11px; }
.atelier #tools :is(.brushes, .materials) {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  padding: 2px 3px 5px;
}
.atelier #tools :is(.brushes, .materials) button {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 5px 8px;
  scroll-snap-align: start;
  font-size: .72rem;
}
.atelier #tools .label, .atelier #tools .sampleRow p, .atelier #tools #animate,
.atelier #tools #undo, .atelier #tools #viewWorld { display: none; }
.atelier #tools { padding: 0; margin: 0; border: 0; box-shadow: none; background: transparent; }
.atelier #tools .sampleRow { margin: 3px 0; padding: 4px; }
.atelier #tools .sampleRow canvas { width: 61px; height: 48px; }
.atelier .assetStrip button[disabled] { opacity: .62; }
.flowerWorkshop #editor, .flowerWorkshop #respond { margin-top: 10px; }
.brushThumbnail { display: none; }
.atelier #brushes button {
  display: grid;
  width: 83px;
  min-height: 71px;
  justify-items: center;
  align-content: center;
  gap: 2px;
  padding: 3px;
  line-height: 1.12;
  background: #f3ebfa;
}
.atelier #brushes button[aria-pressed="true"] { background: #e8d8f6; }
.atelier #brushes b { display: none; }
.atelier .brushThumbnail { display: block; width: 57px; height: 41px; }
.atelier #tools {
  display: grid;
  grid-template-columns: 53px minmax(0, 1fr) auto;
  gap: 1px 8px;
  align-items: center;
}
.atelier #tools :is(#brushes, #materials) { grid-column: 1 / -1; min-width: 0; }
.atelier #tools #brushes { grid-row: 1; }
.atelier #tools #materials { grid-row: 2; }
.atelier #tools .sampleRow {
  grid-column: 1;
  grid-row: 3 / 5;
  margin: 0;
  padding: 2px;
  height: 45px;
}
.atelier #tools .sampleRow canvas { width: 47px; height: 40px; }
.atelier #tools :is(.sampleRow strong, #count, #toolFeedback) {
  position: absolute;
  width: 1px;
  height: 1px;
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}
.atelier #tools label[for="size"] { grid-column: 2; grid-row: 3; margin: 0; }
.atelier #tools #size { grid-column: 2; grid-row: 4; width: 100%; margin: 0; }
.atelier #tools .row { grid-column: 3; grid-row: 3 / 5; margin: 0; }
.atelier #tools #spark { min-height: 44px; margin: 0; padding: 5px 8px; font-size: .75rem; }

/* MOM 0.4.9.5: compact navigation as the catalog grows. */
.atelierCatalogSearch { box-sizing:border-box; width:100%; min-height:36px; border:1px solid #e0d6ed; border-radius:9px; padding:6px 9px; background:#fcfaff; color:#322445; font:inherit; font-size:.8rem; }
.atelierCatalogCount { display:block; font-size:.68rem; color:#64566f; margin:2px 3px 4px; }
.assetStrip button[hidden] { display:none !important; }
