:root {
  color-scheme: light;
  --paper: #f7f6f2;
  --ink: #292833;
  --muted: #85838b;
  --line: #e6e3df;
  --accent: #64516e;
  --accent-light: #f0ebf1;
  font:
    14px/1.5 -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input {
  font: inherit;
}
button,
a,
summary,
.import-label {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: default;
  opacity: 0.4;
}
button,
a {
  touch-action: manipulation;
}
button:focus-visible,
a:focus-visible,
summary:focus-visible,
input:focus-visible,
canvas:focus-visible {
  outline: 3px solid #9980ac;
  outline-offset: 4px;
}
[hidden] {
  display: none !important;
}
.topbar {
  height: 80px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 30px;
  background: #fcfbf8;
  border-bottom: 1px solid var(--line);
  position: relative;
  z-index: 2;
}
.brand {
  color: var(--ink);
  text-decoration: none;
  font-size: 12px;
  font-weight: 760;
  letter-spacing: 2px;
  display: flex;
  align-items: center;
  gap: 11px;
}
.brand-symbol {
  font-size: 33px;
  font-weight: 400;
  color: var(--accent);
}
.breadcrumb {
  color: #99969b;
  margin-left: 25px;
  font-size: 12px;
}
.breadcrumb span {
  padding: 0 13px;
  color: #c8c4ca;
}
.breadcrumb strong {
  font-weight: 500;
  color: #4e4b55;
}
.history {
  display: flex;
  gap: 3px;
  margin-left: auto;
  margin-right: 14px;
}
.icon-button {
  border: 0;
  background: transparent;
  font-size: 24px;
  color: #625a67;
  width: 36px;
  height: 40px;
}
.button {
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px 16px;
  font-weight: 550;
  font-size: 12px;
  min-height: 40px;
  transition: background 0.15s;
}
.button span {
  margin-left: 13px;
}
.button-light {
  background: transparent;
  border-color: #ddd8df;
  color: #5d5264;
}
.button-light:hover:not(:disabled) {
  background: #f0ecf1;
}
.button-primary {
  color: #fff;
  background: var(--accent);
  box-shadow: 0 2px 3px #44334915;
}
.button-primary:hover:not(:disabled) {
  background: #4e3d57;
}
.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  height: calc(100dvh - 80px);
  min-height: 620px;
}
.stage {
  background: #eeede7;
  position: relative;
  min-width: 0;
  overflow: hidden;
}
.stage canvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}
.stage-heading {
  position: absolute;
  top: 30px;
  left: 36px;
  pointer-events: none;
  z-index: 1;
}
.eyebrow {
  color: #8b858b;
  font-size: 10px;
  letter-spacing: 2px;
  font-weight: 650;
}
h1 {
  font-size: 34px;
  font-weight: 480;
  letter-spacing: -1.2px;
  margin: 4px 0 0;
}
.stage-heading p {
  color: #8a8588;
  margin: 5px 0;
  font-size: 12px;
}
.view-controls {
  position: absolute;
  top: 50%;
  left: 24px;
  transform: translateY(-50%);
  flex-direction: column;
  display: flex;
  gap: 3px;
  padding: 5px;
  border: 1px solid #fff9;
  border-radius: 11px;
  box-shadow: 0 6px 28px #332e3610;
  background: #fff9;
  backdrop-filter: blur(16px);
}
.view-controls button {
  background: transparent;
  color: #777079;
  font-size: 11px;
  border: 0;
  padding: 8px 13px;
  border-radius: 7px;
  min-height: 35px;
}
.view-controls button[aria-pressed="true"] {
  color: #5a4663;
  background: #fff;
  box-shadow: 0 1px 5px #392d4411;
}
.stage-footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 47px;
  padding: 0 25px;
  border-top: 1px solid #ddd9d84d;
  color: #8b858b;
  font-size: 10px;
}
.stage-footer > span:first-child {
  color: #65646a;
  display: flex;
  align-items: center;
  gap: 8px;
}
.live-dot {
  width: 5px;
  height: 5px;
  background: #839783;
  border-radius: 50%;
}
.stage-footer button {
  border: 0;
  background: transparent;
  font-size: 22px;
  color: #6d6471;
  padding: 4px 9px;
}
.loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  background: #eeede7ee;
  z-index: 3;
  color: #82768a;
}
.loading strong {
  color: #4c4253;
  font-size: 15px;
  font-weight: 500;
}
.loading > span:last-child {
  font-size: 12px;
}
.loading-ring {
  width: 34px;
  height: 34px;
  border: 2px solid #d4cad8;
  border-top-color: #766280;
  border-radius: 50%;
  animation: spin 1.2s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.inspector {
  background: #fcfbf8;
  padding: 27px 25px 22px;
  overflow-y: auto;
  border-left: 1px solid #e3dfdb;
  display: flex;
  flex-direction: column;
}
.inspector-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 23px;
}
.text-button {
  border: 0;
  padding: 0;
  background: transparent;
  font-size: 11px;
  color: #97889d;
}
.tabs {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #fdfcf9;
  padding-top: 12px;
  display: flex;
  border-bottom: 1px solid var(--line);
  margin-bottom: 27px;
}
.tabs button {
  flex: 1;
  padding: 0 0 13px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: #9a939b;
  font-size: 12px;
}
.tabs button[aria-selected="true"] {
  border-bottom-color: var(--accent);
  color: var(--accent);
  font-weight: 650;
}
h2 {
  font-size: 16px;
  line-height: 1.45;
  font-weight: 550;
  margin: 0 0 9px;
  letter-spacing: -0.3px;
}
.help {
  font-size: 12px;
  color: #95909a;
  line-height: 1.7;
  margin: 0 0 22px;
}
.character-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.style-grid,
.category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin: 0 0 18px;
}
.category-grid {
  grid-template-columns: repeat(2, 1fr);
  margin-bottom: 16px;
}
.style-grid button,
.category-grid button {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: #77707d;
  padding: 8px 5px;
  font-size: 11px;
}
.style-grid button[aria-pressed="true"],
.category-grid button[aria-pressed="true"] {
  border-color: #9b87a5;
  color: var(--accent);
  background: var(--accent-light);
}
.wardrobe-heading {
  display: flex;
  justify-content: space-between;
  color: #77707d;
  font-size: 11px;
  margin-bottom: 8px;
}
.wardrobe-heading output {
  color: #a29aa3;
}
.wardrobe-grid,
.accessory-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 7px;
  min-height: 30px;
}
.physics-panel {
  border-top: 1px solid var(--line);
  margin-top: 20px;
  padding-top: 18px;
}
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #68606d;
  font-size: 12px;
  margin-bottom: 16px;
}
.toggle-row input {
  accent-color: var(--accent);
  width: 18px;
  height: 18px;
}
#wind {
  width: 100%;
  accent-color: var(--accent);
}
.physics-actions {
  display: flex;
  gap: 6px;
  margin-top: 12px;
}
.physics-actions .button {
  flex: 1;
  padding: 8px 6px;
  font-size: 10px;
}
.physics-info {
  display: block;
  color: #9b949d;
  font-size: 10px;
  margin-top: 10px;
}
.character-card {
  padding: 0;
  background: #f3f0eb;
  border: 1px solid #e5e0dc;
  border-radius: 10px;
  overflow: hidden;
  text-align: left;
  position: relative;
  min-height: 155px;
}
.character-card[aria-pressed="true"] {
  border: 2px solid #8a7593;
}
.character-card[aria-pressed="true"]::after {
  content: "✓";
  position: absolute;
  right: 9px;
  top: 9px;
  background: #705d7b;
  color: white;
  border-radius: 50%;
  width: 17px;
  height: 17px;
  font-size: 11px;
  text-align: center;
  line-height: 17px;
}
.character-card img {
  width: 100%;
  aspect-ratio: 1.05;
  object-fit: cover;
  display: block;
}
.character-card strong,
.character-card small {
  display: block;
  padding: 0 12px;
}
.character-card strong {
  font-size: 12px;
  font-weight: 550;
  margin-top: 9px;
  color: #514856;
}
.character-card small {
  font-size: 10px;
  color: #999099;
  padding-bottom: 10px;
}
.section-divider {
  height: 1px;
  background: var(--line);
  margin: 25px 0;
}
.field-label {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 550;
  color: #68606d;
  margin-bottom: 12px;
}
.field-label span {
  color: #a19aa3;
  font-size: 10px;
  font-weight: 400;
}
.color-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.swatches {
  display: flex;
  gap: 12px;
}
.swatches button {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--swatch);
  border: 3px solid #fcfbf8;
  outline: 1px solid transparent;
  padding: 0;
}
.swatches button[aria-pressed="true"] {
  outline-color: #82728c;
}
input[type="color"] {
  width: 31px;
  height: 31px;
  padding: 3px;
  border: 1px solid #ddd5de;
  border-radius: 7px;
  background: transparent;
  cursor: pointer;
}
.source-note {
  margin-top: 30px;
  padding: 17px 0;
  display: flex;
  gap: 12px;
  border-top: 1px solid var(--line);
}
.source-note > span {
  font-size: 25px;
  line-height: 1;
  color: #a497a7;
}
.source-note strong {
  font-size: 10px;
  color: #7e7484;
  font-weight: 550;
}
.source-note p {
  font-size: 10px;
  line-height: 1.7;
  color: #a099a4;
  margin: 5px 0 0;
}
.garment-card {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 18px;
}
.garment-icon {
  width: 43px;
  height: 46px;
  background: #efebe5;
  border-radius: 9px;
  color: #8e8278;
  font-size: 29px;
  text-align: center;
}
.garment-card strong {
  display: block;
  font-size: 12px;
  font-weight: 550;
}
.garment-card div > span {
  display: block;
  font-size: 10px;
  color: #a29aa3;
}
.fitted {
  color: #7a8f7c;
  background: #edf1e9;
  padding: 3px 7px;
  border-radius: 4px;
  font-size: 9px;
  margin-left: auto;
}
.motion-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-bottom: 21px;
}
.motion-list button {
  display: flex;
  gap: 15px;
  padding: 15px 12px;
  align-items: center;
  text-align: left;
  border: 1px solid #e6e0e7;
  border-radius: 9px;
  background: transparent;
  color: #736b78;
}
.motion-list button[aria-pressed="true"] {
  border-color: #9b87a5;
  background: #f2edf3;
}
.motion-list button > span:first-child {
  color: #b3a9b8;
  font-size: 11px;
}
.motion-list button > span:last-child {
  margin-left: auto;
}
.motion-list strong {
  font-size: 12px;
  font-weight: 550;
}
.motion-list small {
  font-size: 10px;
  display: block;
  color: #a59ba8;
  margin-top: 3px;
}
.motion-note {
  font-size: 10px;
  line-height: 1.7;
  color: #a09aa3;
}
.full-width {
  width: 100%;
}
.inspector-footer {
  margin-top: auto;
  padding-top: 25px;
}
.import-label {
  display: inline-block;
  font-size: 11px;
  color: #84718f;
  cursor: pointer;
  padding: 7px 0;
}
.inspector-footer details {
  border-top: 1px solid var(--line);
  padding-top: 16px;
  margin-top: 15px;
  font-size: 10px;
  color: #99919e;
}
.inspector-footer summary {
  cursor: pointer;
  font-size: 11px;
  color: #7e7488;
}
.inspector-footer a {
  color: #84718f;
  display: block;
  margin-top: 10px;
}
.inspector-footer p {
  line-height: 1.7;
}
#model-info {
  padding: 12px 0;
  white-space: pre-line;
  line-height: 1.8;
}
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  padding: 12px 22px;
  border-radius: 9px;
  color: #fff;
  background: #51405e;
  box-shadow: 0 6px 30px #38244426;
  font-size: 12px;
}
.error {
  position: absolute;
  bottom: 125px;
  left: 20px;
  right: 20px;
  color: #823e4d;
  border: 1px solid #d7a2ac;
  background: #fff2f4;
  padding: 15px;
  border-radius: 8px;
  font-size: 12px;
  z-index: 4;
}
#save-recipe-mobile {
  display: none;
}
@media (min-width: 1500px) {
  .workspace {
    grid-template-columns: minmax(0, 1fr) 380px;
  }
  .inspector {
    padding: 32px;
  }
}
@media (max-width: 1000px) {
  .breadcrumb {
    display: none;
  }
  .topbar {
    padding: 0 18px;
    gap: 10px;
  }
  .workspace {
    grid-template-columns: minmax(0, 1fr) 300px;
  }
  .inspector {
    padding: 25px 20px;
  }
  .stage-footer > span:nth-child(2) {
    display: none;
  }
}
@media (max-width: 700px) {
  .topbar {
    height: 65px;
    gap: 7px;
    padding: 0 12px;
  }
  .brand {
    font-size: 9px;
    letter-spacing: 1px;
    gap: 5px;
  }
  .brand-symbol {
    font-size: 27px;
  }
  .history {
    gap: 0;
    margin-right: 0;
  }
  .icon-button {
    width: 40px;
    min-height: 44px;
  }
  .topbar .button {
    font-size: 10px;
    padding: 8px 10px;
  }
  #save-recipe-mobile {
    display: inline-block;
    margin-bottom: 14px;
    min-height: 44px;
  }
  #save-recipe {
    display: none;
  }
  .workspace {
    display: block;
    height: auto;
    min-height: 0;
  }
  .stage {
    height: 64dvh;
    min-height: 410px;
  }
  .stage-heading {
    top: 20px;
    left: 22px;
  }
  .stage-heading h1 {
    font-size: 26px;
  }
  .stage-heading p {
    font-size: 10px;
  }
  .eyebrow {
    font-size: 8px;
    letter-spacing: 1.5px;
  }
  .view-controls {
    left: 12px;
    top: 60%;
  }
  .view-controls button {
    padding: 7px 10px;
  }
  .stage-footer {
    height: 38px;
    padding: 0 20px;
  }
  .inspector {
    overflow: visible;
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 25px 24px max(25px, env(safe-area-inset-bottom));
  }
  .character-grid {
    max-width: 400px;
  }
  .character-card img {
    aspect-ratio: 1.2;
  }
  .tabs button {
    min-height: 35px;
  }
  .swatches button {
    width: 34px;
    height: 34px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .loading-ring {
    animation: none;
  }
  * {
    transition: none !important;
  }
}

.garment-icon svg {
  width: 25px;
  height: 25px;
}

.wardrobe-card {
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  overflow: hidden;
  background: #eeede7;
  color: var(--ink);
  text-align: left;
  min-width: 0;
}
.wardrobe-card img {
  width: 100%;
  height: 124px;
  object-fit: contain;
  display: block;
}
.wardrobe-card strong {
  display: block;
  padding: 9px;
  font-size: 11px;
  font-weight: 550;
  min-height: 42px;
}
.wardrobe-card[aria-pressed="true"] {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
.wardrobe-grid {
  margin-bottom: 22px;
}
.accessory-grid button {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  padding: 8px;
  font-size: 11px;
}
.style-grid button {
  overflow: hidden;
  padding: 0 0 9px;
  min-height: 38px;
}
.style-grid img {
  width: 100%;
  height: 118px;
  object-fit: contain;
  display: block;
  margin-bottom: 8px;
}
#characters {
  grid-template-columns: repeat(3, 1fr);
  margin-top: 12px;
}
#characters .character-card strong {
  padding: 10px 5px;
  text-align: center;
}
#characters[hidden] {
  display: none;
}
#characters .character-card {
  min-height: 42px;
}
#characters .character-card[aria-pressed="true"]::after {
  display: none;
}
#characters .character-card strong {
  margin: 0;
}

/* Authored clip selection and concrete interaction previews. */
.clip-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin: 18px 0;
}
.clip-grid button {
  min-height: 42px;
  border: 1px solid #d7d7cd;
  border-radius: 8px;
  background: #fff;
  color: #303b36;
  font: inherit;
  cursor: pointer;
}
.clip-grid button[aria-pressed="true"] {
  background: #344d43;
  color: white;
  border-color: #344d43;
}
.clip-grid button:disabled {
  opacity: 0.35;
  cursor: default;
}
#playback-speed {
  width: 100%;
  padding: 10px;
  border: 1px solid #d7d7cd;
  border-radius: 8px;
  margin-bottom: 12px;
  background: white;
  font: inherit;
}
.action-list {
  display: grid;
  gap: 10px;
  margin: 20px 0;
}
.action-list button {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 12px;
  text-align: left;
  border: 1px solid #d7d7cd;
  border-radius: 12px;
  background: white;
  font: inherit;
  cursor: pointer;
}
.action-list button > span {
  font-size: 28px;
  width: 36px;
  text-align: center;
  color: #61786b;
}
.action-list button[aria-pressed="true"] {
  border-color: #344d43;
  background: #e8eee8;
}
.action-status {
  display: flex;
  justify-content: space-between;
  margin: 20px 0 8px;
}
#action-scrub,
#target-height {
  width: 100%;
  accent-color: #3b5b49;
  margin: 12px 0 20px;
}
.action-owner {
  padding: 14px 0;
  color: #4b6154;
  font-size: 13px;
}
#contact-info {
  display: block;
  padding: 10px 0;
  font: 12px/1.6 monospace;
}
.tabs {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
@media (max-width: 700px) {
  .clip-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

#physical-controls input[type="range"] {
  width: 100%;
  accent-color: #3b5b49;
  margin: 10px 0 22px;
}

.shape-controls {
  margin: 24px 0;
  display: grid;
  gap: 7px;
}
.shape-controls label {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
}
.shape-controls output {
  color: #76716e;
  font-variant-numeric: tabular-nums;
}
.shape-controls input {
  width: 100%;
  margin: 0 0 9px;
  accent-color: #667b6a;
}
.hair-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0 20px;
}
.hair-grid button {
  min-height: 70px;
  overflow: hidden;
  border: 1px solid #dedbd6;
  border-radius: 10px;
  background: #faf9f6;
  font: inherit;
  font-size: 11px;
  padding: 6px;
  cursor: pointer;
}
.hair-grid button[aria-pressed="true"] {
  border: 2px solid #52685a;
  background: #ebf0e9;
}
.hair-grid img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 6px;
  display: block;
  margin-bottom: 5px;
}
#fabric-type {
  width: 100%;
  padding: 10px;
  margin-bottom: 16px;
  border: 1px solid #dedbd6;
  border-radius: 8px;
  background: #faf9f6;
  color: inherit;
  font: inherit;
}
