/* Gorilla Design Studio — standalone page, main-site design language. */
@import url('https://fonts.googleapis.com/css2?family=Capriola&display=swap');

:root {
  --acct1: #ffe66a; /* gorilla yellow */
  --acct2: #074751; /* gorilla teal */
  --bkgd2: #fffcee; /* cream */
  --alert: #db162f;
  --btn-radius: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Capriola', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bkgd2);
  color: var(--acct2);
}

.studio-header {
  padding: 1rem 1.25rem 0.5rem;
  max-width: 1100px;
  margin: 0 auto;
}

.studio-home {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--acct2);
  text-decoration: none;
  font-size: 0.95rem;
}
.studio-home:hover { text-decoration: underline; }

.studio-header h1 {
  margin: 0.35rem 0 0.1rem;
  font-size: clamp(1.6rem, 4vw, 2.3rem);
}

.studio-tag { margin: 0; opacity: 0.85; }

.studio-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, 1fr);
  gap: 1.25rem;
  max-width: 1100px;
  margin: 1rem auto 3rem;
  padding: 0 1.25rem;
}

@media (max-width: 780px) {
  .studio-layout { grid-template-columns: 1fr; }
}

.studio-stage-wrap { min-width: 0; }

.studio-stage {
  width: 100%;
  aspect-ratio: 7 / 8; /* STAGE 1400x1600 */
  background: var(--acct1); /* gorilla yellow — black AND white garments both read */
  border-radius: 16px;
  box-shadow: 0 10px 24px rgba(7, 71, 81, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* Wide screens: the stage matches the control panel's height exactly (owner mockup).
   The hint is pulled out of flow so it hangs below without adding to the row height;
   the canvas aspect-fits inside whatever box results, letterboxed on the yellow. */
@media (min-width: 781px) {
  .studio-layout { align-items: stretch; }
  .studio-stage-wrap {
    position: relative;
    display: flex;
    flex-direction: column;
  }
  .studio-stage {
    flex: 1;
    aspect-ratio: auto;
    min-height: 0;
  }
  .studio-hint {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 0.5rem;
  }
}

#stage { touch-action: none; display: block; }

.studio-hint {
  text-align: center;
  font-size: 0.85rem;
  opacity: 0.7;
  margin: 0.5rem 0 0;
}

.studio-controls {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.control-group {
  background: #fff;
  border-radius: 16px;
  padding: 0.9rem 1rem 1rem;
  box-shadow: 0 6px 16px rgba(7, 71, 81, 0.08);
}

.control-group > label {
  display: block;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.75;
  margin-bottom: 0.5rem;
}

.control-group select {
  width: 100%;
  padding: 0.55rem 0.6rem;
  border-radius: 10px;
  border: 2px solid var(--acct2);
  background: var(--acct1);
  color: var(--acct2);
  font: inherit;
}

.side-toggle {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.6rem;
}

.side-toggle button {
  flex: 1;
  padding: 0.5rem;
  font: inherit;
  border-radius: 10px;
  border: 2px solid var(--acct2);
  background: #fff;
  color: var(--acct2);
  cursor: pointer;
}

.side-toggle button[aria-selected='true'] {
  background: var(--acct2);
  color: var(--bkgd2);
}

.btn {
  display: block;
  width: 100%;
  padding: 0.65rem 0.8rem;
  font: inherit;
  border-radius: var(--btn-radius);
  border: none;
  background: var(--acct2);
  color: var(--bkgd2);
  cursor: pointer;
}

.btn:hover:not(:disabled) { filter: brightness(1.12); }
.btn:disabled { opacity: 0.45; cursor: default; }

.btn.subtle {
  background: #fff;
  color: var(--acct2);
  border: 2px solid var(--acct2);
  font-size: 0.9rem;
  padding: 0.5rem 0.6rem;
}
.btn.subtle[data-active='true'] { background: var(--acct1); }

.btn.primary {
  background: var(--acct1);
  color: var(--acct2);
  border: 2px solid var(--acct2);
  font-weight: 700;
}

.btn-row {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 0.45rem;
}
.btn-row .btn { width: auto; flex: 1; }

.slider-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.55rem;
}
.slider-label {
  flex: 0 0 4.2rem;
  font-size: 0.85rem;
  opacity: 0.8;
}
.slider-row input[type='range'] {
  flex: 1;
  min-width: 0;
  accent-color: var(--acct2);
}
.slider-row input[type='range']:disabled { opacity: 0.4; }
.btn.mini {
  flex: 0 0 auto;
  width: auto;
  padding: 0.25rem 0.55rem;
  font-size: 0.8rem;
}

/* Prints list — mirrors the quoter's chips (red-✕ circle = .piece-remove there). */
.print-list {
  list-style: none;
  margin: 0 0 0.6rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.print-empty {
  font-size: 0.85rem;
  opacity: 0.65;
  padding: 0.2rem 0;
}

.print-chip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border: 2px solid transparent;
  border-radius: 10px;
  padding: 0.15rem 0.3rem 0.15rem 0.15rem;
}

.print-chip[data-selected='true'] {
  background: var(--acct1);
  border-color: var(--acct2);
}

.print-chip-name {
  flex: 1;
  min-width: 0;
  text-align: left;
  font: inherit;
  font-size: 0.9rem;
  color: var(--acct2);
  background: transparent;
  border: none;
  padding: 0.35rem 0.4rem;
  border-radius: 8px;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.print-chip-name:hover { text-decoration: underline; }

.print-chip-remove {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid var(--alert);
  background: transparent;
  color: var(--alert);
  font-weight: 800;
  font-size: 15px;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.print-chip-remove:hover,
.print-chip-remove:focus-visible {
  background: rgba(219, 22, 47, 0.1);
}

.size-readout { margin-top: 0.35rem; font-size: 0.95rem; }
.size-readout.error { color: var(--alert); }

.studio-actions .btn { margin-bottom: 0.5rem; }

.studio-status { min-height: 1.2em; font-size: 0.9rem; }
.studio-status.error { color: var(--alert); }

.studio-fineprint {
  font-size: 0.78rem;
  opacity: 0.65;
  margin: 0.5rem 0 0;
}
