/* ---------- Fat Build: the studio ----------
   A workspace: a dark toolbar across the top, a dotted canvas with the product in the middle and
   small floating cards around it, and an accordion of settings on the right. Below 981px the
   canvas is pinned under the site menu and the settings stack beneath it. */

.page-build .page-header {
  padding-bottom: 28px;
}

.builder {
  padding: 0 0 72px;
}

.container--studio {
  max-width: 1360px;
  padding: 16px;
  border-radius: 40px;
  background: #d3e9d9;
}

/* ================= The window ================= */

.studio {
  position: relative;
  z-index: 41; /* above the site's ambient cursor glow (z-index 40) */
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  grid-template-rows: auto minmax(0, 1fr);
  height: clamp(640px, calc(100vh - 140px), 800px);
  overflow: hidden;
  border-radius: 28px;
  background-color: #edf0ea;
  background-image: radial-gradient(rgba(6, 35, 29, 0.16) 1px, transparent 1.5px);
  background-size: 14px 14px;
  box-shadow: 0 40px 80px -50px rgba(6, 35, 29, 0.6), 0 0 0 1px rgba(6, 35, 29, 0.06);
}

/* ================= Toolbar ================= */

.studio-bar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 14px 10px 12px;
  background: var(--teal-darkest);
  color: var(--cream);
}

.studio-brand {
  display: block;
  flex-shrink: 0;
}

.studio-brand img {
  display: block;
  border-radius: 10px;
}

.studio-name {
  display: flex;
  align-items: center;
  flex: 0 1 270px;
  gap: 4px;
  min-width: 0;
}

.studio-back {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--cream);
  cursor: pointer;
  transition: background 0.2s ease, opacity 0.2s ease;
}

.studio-back svg {
  width: 18px;
  height: 18px;
}

.studio-back:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.12);
}

.studio-back:disabled {
  opacity: 0.3;
  cursor: default;
}

.studio-name input {
  flex: 1;
  min-width: 0;
  padding: 7px 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--cream);
  transition: background 0.2s ease;
}

.studio-name input::placeholder {
  color: rgba(255, 253, 238, 0.55);
}

.studio-name input:hover {
  background: rgba(255, 255, 255, 0.08);
}

.studio-name input:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 0 2px var(--lime);
}

.studio-tabs {
  display: flex;
  gap: 4px;
  margin: 0 auto;
  padding: 4px;
  list-style: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.studio-tabs .step {
  width: auto;
  padding: 8px 20px;
  border-radius: 999px;
  background: transparent;
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(255, 253, 238, 0.72);
}

.studio-tabs .step b {
  display: none;
}

.studio-tabs .step:hover {
  color: var(--cream);
}

.studio-tabs .step.is-done {
  color: var(--cream);
}

.studio-tabs .step.is-current {
  background: #ffffff;
  font-weight: 700;
  color: var(--teal-darkest);
}

.studio-tabs .step:focus-visible {
  outline: 3px solid var(--lime);
  outline-offset: 2px;
}

.studio-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.studio-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--cream);
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.studio-icon svg {
  width: 18px;
  height: 18px;
}

.studio-icon:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.studio-icon:disabled {
  opacity: 0.5;
  cursor: progress;
}

.studio-send {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border: 0;
  border-radius: 999px;
  background: var(--lime);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--teal-darkest);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.studio-send svg {
  width: 16px;
  height: 16px;
}

.studio-send:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px -10px rgba(227, 239, 38, 0.8);
}

.studio-back:focus-visible,
.studio-icon:focus-visible,
.studio-send:focus-visible {
  outline: 3px solid var(--cream);
  outline-offset: 2px;
}

/* ================= Canvas ================= */

.studio-stage {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.studio .stage-view {
  position: absolute;
  inset: 0;
  min-height: 0;
  padding: 76px 156px 100px;
}

.studio .stage-floor {
  left: 24%;
  right: 24%;
  bottom: 88px;
  height: 38px;
  background: radial-gradient(ellipse at center, rgba(6, 35, 29, 0.2), rgba(6, 35, 29, 0) 70%);
}

/* the product on a light canvas: a soft drop shadow, not a dark glow */
.studio .device {
  box-shadow: 0 36px 60px -30px rgba(6, 35, 29, 0.55), 0 0 0 1px rgba(6, 35, 29, 0.14);
}

.studio .device[data-type="mobile"] {
  box-shadow: 0 40px 60px -28px rgba(6, 35, 29, 0.6), 0 0 0 1.5px #5a6a65 inset, 0 0 0 3px #0a110f inset;
}

/* chips along the top */
.studio-hud {
  position: absolute;
  top: 16px;
  left: 16px;
  right: 16px;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  pointer-events: none;
}

.studio-hud .hud-tag {
  color: var(--ink-soft);
}

.studio .hud-chips {
  flex: 0 1 auto;
}

.studio .hud-chips span {
  padding: 6px 13px;
  border: 1px solid rgba(6, 35, 29, 0.08);
  background: #ffffff;
  box-shadow: 0 6px 14px -10px rgba(6, 35, 29, 0.5);
  color: var(--teal-darkest);
}

.studio .hud-chips span.has-dot::before {
  box-shadow: 0 0 0 1.5px rgba(6, 35, 29, 0.25);
}

/* cards on the left */
.studio-tools {
  position: absolute;
  top: 62px;
  left: 16px;
  z-index: 3;
  display: grid;
  gap: 12px;
  width: 112px;
}

.tool {
  padding: 10px;
  border: 1px solid rgba(6, 35, 29, 0.06);
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 10px 22px -14px rgba(6, 35, 29, 0.45);
}

.tool-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 0 0 8px;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.tool-label b {
  font-weight: 700;
  color: var(--teal-darkest);
}

.tool-dots,
.tool-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.tool-btns {
  gap: 6px;
}

.tool-dot {
  width: 100%;
  aspect-ratio: 1;
  padding: 0;
  border: 1.5px solid rgba(6, 35, 29, 0.2);
  border-radius: 10px;
  background: var(--c);
  cursor: pointer;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.tool-dot:hover {
  transform: scale(1.06);
}

.tool-dot.is-on {
  box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px var(--teal-darkest);
}

.tool-btn {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: var(--mint);
  color: var(--teal-darkest);
  cursor: pointer;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.tool-btn svg {
  width: 18px;
  height: 18px;
}

.tool-btn:hover {
  background: #cdeeb2;
}

.tool-btn.is-on {
  background: var(--lime);
  box-shadow: 2px 2px 0 var(--teal-darkest);
}

.tool-zoom {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 4px;
}

.tool-zoom button {
  height: 28px;
  min-width: 28px;
  padding: 0 6px;
  border: 0;
  border-radius: 8px;
  background: var(--mint);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--teal-darkest);
  cursor: pointer;
}

.tool-zoom button:hover {
  background: #cdeeb2;
}

.tool-dot:focus-visible,
.tool-btn:focus-visible,
.tool-zoom button:focus-visible,
.studio-surprise:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 2px;
}

/* the surprise button, bottom left */
.studio-surprise {
  position: absolute;
  left: 16px;
  bottom: 16px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 18px 8px 8px;
  border: 1px solid rgba(6, 35, 29, 0.06);
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 10px 22px -14px rgba(6, 35, 29, 0.45);
  font: inherit;
  text-align: left;
  color: var(--teal-darkest);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.studio-surprise:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 26px -14px rgba(6, 35, 29, 0.5);
}

.surprise-tile {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--lime);
}

.surprise-tile svg {
  width: 20px;
  height: 20px;
}

.surprise-text {
  display: grid;
}

.surprise-text strong {
  font-size: 0.88rem;
}

.surprise-text small {
  font-size: 0.72rem;
  color: var(--ink-soft);
}

/* scores, bottom centre */
.studio .stats {
  position: absolute;
  bottom: 16px;
  left: 50%;
  z-index: 3;
  width: min(440px, calc(100% - 340px));
  padding: 10px 16px 12px;
  border: 1px solid rgba(6, 35, 29, 0.06);
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 10px 22px -14px rgba(6, 35, 29, 0.45);
  transform: translateX(-50%);
}

.studio .stat span {
  margin-bottom: 5px;
  color: var(--ink-soft);
}

.studio .stat-track {
  background: rgba(6, 35, 29, 0.1);
}

.studio .stat-fill {
  background: var(--teal);
}

/* messages ("Link copied") */
.studio-toast {
  position: absolute;
  bottom: 92px;
  left: 50%;
  z-index: 6;
  max-width: calc(100% - 32px);
  margin: 0;
  padding: 9px 16px;
  border-radius: 999px;
  background: var(--teal-darkest);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--cream);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 10px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.studio-toast.is-on {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ================= Panel ================= */

.studio-panel {
  position: relative;
  min-height: 0;
  padding: 14px 16px 16px 0;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(6, 35, 29, 0.25) transparent;
}

.acc {
  margin: 0 0 12px;
  padding: 0; /* the site gives every <section> large vertical padding */
  overflow: hidden;
  border: 1px solid rgba(6, 35, 29, 0.06);
  border-radius: 20px;
  background: #ffffff;
  box-shadow: 0 12px 26px -16px rgba(6, 35, 29, 0.45);
}

.acc-head {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border: 0;
  background: transparent;
  font: inherit;
  text-align: left;
  color: var(--teal-darkest);
  cursor: pointer;
}

.acc-head:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: -3px;
  border-radius: 20px;
}

.acc-tile {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--mint);
  color: var(--teal);
  transition: background 0.25s ease, color 0.25s ease;
}

.acc-tile svg {
  width: 22px;
  height: 22px;
}

.acc.is-open .acc-tile {
  background: var(--lime);
  color: var(--teal-darkest);
}

.acc-text {
  display: grid;
  flex: 1;
  min-width: 0;
}

.acc-text strong {
  font-family: var(--font-display);
  font-size: 1rem;
}

.acc-text small {
  overflow: hidden;
  font-size: 0.8rem;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--ink-soft);
}

.acc-chev svg {
  display: block;
  width: 18px;
  height: 18px;
  transition: transform 0.25s ease;
}

.acc.is-open .acc-chev svg {
  transform: rotate(180deg);
}

.acc .pane {
  padding: 2px 16px 18px;
}

.acc .pane h2 {
  margin: 0 0 12px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.acc .pane-label:first-of-type {
  margin-top: 4px;
}

.acc .opt {
  padding: 12px 12px 14px;
}

.acc .opts--tight .opt {
  padding: 10px;
}

.acc .opts--tight .opt span {
  display: none;
}

.studio-panel .panel-nav {
  margin-top: 0;
  padding: 4px 2px 0;
  border-top: 0;
}

.studio-panel .panel-back {
  background: #ffffff;
}

/* ================= Tablets and phones: the canvas is pinned, the settings stack below ================= */

@media (max-width: 1180px) {
  .studio {
    grid-template-columns: minmax(0, 1fr) 340px;
  }

  .studio .stage-view {
    padding-left: 140px;
    padding-right: 140px;
  }

  .studio-tabs .step {
    padding: 8px 14px;
  }
}

@media (max-width: 980px) {
  .container--studio {
    padding: 10px;
    border-radius: 28px;
  }

  .studio {
    display: block;
    height: auto;
    overflow: visible;
    border-radius: 0;
    background: none;
    box-shadow: none;
  }

  .studio-bar {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas:
      "brand name actions"
      "tabs tabs tabs";
    gap: 10px 12px;
    padding: 10px;
    border-radius: 20px;
  }

  .studio-brand {
    grid-area: brand;
  }

  .studio-name {
    grid-area: name;
  }

  .studio-actions {
    grid-area: actions;
  }

  .studio-tabs {
    grid-area: tabs;
    width: 100%;
    margin: 0;
  }

  .studio-tabs li {
    flex: 1;
  }

  .studio-tabs .step {
    width: 100%;
    padding: 8px 4px;
  }

  /* the pinned canvas */
  .studio-stage {
    position: sticky;
    top: var(--nav-h, 64px);
    z-index: 41;
    height: auto;
    margin: 10px 0 12px;
    border-radius: 20px;
    background-color: #edf0ea;
    background-image: radial-gradient(rgba(6, 35, 29, 0.16) 1px, transparent 1.5px);
    background-size: 14px 14px;
    box-shadow: 0 18px 30px -18px rgba(6, 35, 29, 0.6), 0 0 0 1px rgba(6, 35, 29, 0.06);
  }

  .studio .stage-view {
    position: relative;
    inset: auto;
    padding: 6px 0 8px;
    perspective: none;
  }

  .studio .stage-floor,
  .studio-hud,
  .studio-tools,
  .studio .stats {
    display: none;
  }

  .studio-surprise {
    left: 8px;
    bottom: 8px;
    padding: 5px;
    border-radius: 14px;
  }

  .surprise-text {
    display: none;
  }

  .surprise-tile {
    width: 34px;
    height: 34px;
  }

  .studio-toast {
    bottom: 12px;
    font-size: 0.8rem;
  }

  .studio-panel {
    padding: 0;
    overflow: visible;
  }

  /* The toolbar tabs already choose the step, so the dropdown headings would only repeat them:
     show just the options for the step that is open. */
  .acc:not(.is-open),
  .acc-head {
    display: none;
  }

  .acc .pane {
    padding: 18px 16px 18px;
  }

  .studio-panel input,
  .studio-panel textarea {
    scroll-margin-top: 360px;
  }
}

@media (max-width: 560px) {
  .page-build .page-header {
    padding-bottom: 20px;
  }

  .container--studio {
    padding: 8px;
    border-radius: 22px;
  }

  .studio-bar {
    padding: 8px;
    gap: 8px 8px;
  }

  .studio-brand img {
    width: 32px;
    height: 32px;
  }

  .studio-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
  }

  .studio-send {
    padding: 9px 12px;
  }

  .studio-send span {
    display: none;
  }

  /* build.css hides step labels at this width (it showed numbers); here the labels are the point */
  .studio-tabs .step span {
    display: inline;
  }

  .studio-tabs .step {
    font-size: 0.78rem;
  }

  .acc .pane {
    padding: 16px 12px 16px;
  }
}
