/* 11 — Brand Studio tool pages: banner maker, email signature, business card (on Sand). */
.studio__tool { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: clamp(20px, 3vw, 44px); align-items: start; }
.studio__controls { gap: 18px; min-width: 0; color: var(--navy); }
.studio__side { position: sticky; top: calc(var(--bar) + 16px); display: grid; gap: 18px; min-width: 0; align-content: start; }
.studio__preview, .studio__actions { display: grid; gap: 12px; min-width: 0; align-content: start; }
.studio__actions { gap: 10px; }
.studio__preview > .seg { justify-self: start; }

.studio__controls .seg { flex-wrap: wrap; border-radius: var(--r-m); }
.field > span output { font-weight: 300; letter-spacing: 0; text-transform: none; margin-left: 6px; font-variant-numeric: tabular-nums; }

/* presets */
.studio__presets { display: flex; flex-wrap: wrap; gap: 8px; }
.studio__preset { display: grid; gap: 1px; text-align: left; border: 1px solid var(--navy-15); background: var(--white); color: var(--navy); border-radius: var(--r-s); padding: 8px 12px; font-size: var(--fs-small); font-weight: 500; transition: background .15s, color .15s, border-color .15s; }
.studio__preset i { font-style: normal; font-weight: 300; font-size: var(--fs-micro); opacity: .75; font-variant-numeric: tabular-nums; }
.studio__preset:hover { border-color: var(--navy-45); }
.studio__preset[aria-pressed="true"] { background: var(--navy); color: var(--sand); border-color: var(--navy); }
.studio__preset[data-custom] { align-content: center; }
.studio__custom { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.studio__custom[hidden] { display: none; }
.studio__hint { grid-column: 1 / -1; opacity: .75; }

/* banner maker: logo, text and image controls */
.studio__controls .seg button:disabled { opacity: .4; cursor: not-allowed; }
.studio__text { min-height: 0; resize: none; }
.studio__textnote { margin-top: -8px; }
.studio__imgrow { align-items: center; gap: 10px; }
.studio__upload { position: relative; cursor: pointer; }
.studio__upload:focus-within { outline: 2px solid var(--blue); outline-offset: 3px; }
.studio__file { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.studio__file::file-selector-button { cursor: pointer; }
.studio__imgrow .tag-soon { opacity: .7; }
.studio__photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.studio__photo { padding: 0; border: 2px solid transparent; border-radius: var(--r-s); background: var(--sand-soft); overflow: hidden; aspect-ratio: 4 / 3; transition: border-color .15s; }
.studio__photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.studio__photo:hover { border-color: var(--navy-45); }
.studio__photo[aria-pressed="true"] { border-color: var(--navy); }
.field > .studio__msg { margin-top: 0; }

/* previews */
.studio__stage { padding: clamp(16px, 2.4vw, 32px); min-height: 120px; }
.studio__stage > div { max-width: 100%; }
#studio-canvas { display: block; max-width: 100%; box-shadow: 0 1px 2px rgba(22, 62, 84, .18); }
.studio__meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-weight: 500; }
.studio__meta .muted { font-weight: 300; }
.studio__sigview { width: min(100%, 600px); }
.studio__sigview svg, .studio__cardfig svg { display: block; width: 100%; height: auto; box-shadow: 0 1px 2px rgba(22, 62, 84, .18); }
.studio__mail { background: var(--white); border-radius: var(--r-m); padding: 22px; overflow-x: auto; min-height: 120px; }
.studio__msg { min-height: 0; margin-top: -10px; font-weight: 500; }
.studio__msg:empty { display: none; }
.studio__msg.is-warn { padding-left: 12px; border-left: 3px solid var(--navy); }
.studio__cards { display: flex; gap: clamp(12px, 2.4vw, 28px); justify-content: center; width: 100%; }
.studio__cardfig { display: grid; gap: 8px; flex: 0 1 260px; min-width: 0; text-align: center; }
.studio__cardfig figcaption { opacity: .75; }
.studio__ph { min-height: 160px; }

/* back link and related chapter */
.studio__foot { display: flex; justify-content: space-between; gap: 16px; margin-top: clamp(32px, 5vw, 64px); padding-top: 8px; border-top: 1px solid var(--navy-15); font-size: var(--fs-small); font-weight: 500; }
.studio__foot a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; }
.studio__foot a:hover { text-decoration: underline; }

@media (max-width: 900px) {
  /* preview first and stuck under the top bar, then the controls, then the buttons */
  .studio__tool { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .studio__side { display: contents; }
  .studio__preview { order: 1; position: sticky; top: var(--bar); z-index: 5; background: var(--sand); padding: 8px 0; margin-top: -8px; }
  .studio__controls { order: 2; }
  .studio__actions { order: 3; }
  .studio__stage { padding: 12px; min-height: 0; }
  .studio__mail { padding: 12px; min-height: 0; max-height: 28vh; }
  .studio__cardfig { flex-basis: calc(26vh * 0.647); }
  .studio__cardfig figcaption { display: none; }
  .studio__sigview { width: min(100%, 360px); }
}
@media (max-width: 640px) {
  .studio__custom { grid-template-columns: 1fr; }
}
