/* Template gallery and design studio. Uses the tokens from style.css. */
.gallery-page h1 em,
.studio-page h1 em {
  font-style: normal;
  background: linear-gradient(transparent 62%, var(--accent) 62%);
}
.style-filter a {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  background: var(--white);
}
.style-filter a[aria-current] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--white);
}
.make-it-yours {
  display: grid;
  grid-template-columns: minmax(220px, 0.9fr) 3fr;
  gap: 22px;
  align-items: start;
  background: var(--soft);
  border-radius: 4px;
  padding: 20px 22px;
  margin-bottom: 22px;
}
.make-it-yours .fine {
  margin: 0;
}
.logo-control {
  display: flex;
  gap: 14px;
  align-items: center;
  padding-bottom: 4px;
}
.logo-control .secondary {
  white-space: nowrap;
  padding: 13px 18px;
}
.style-filter {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 26px;
}
.style-filter a {
  padding: 7px 13px;
  font-size: 12px;
}
/* The industry row sits just under the style row; on a phone it scrolls
   sideways instead of wrapping into a tall block of chips. */
.style-filter:has(+ .industry-filter) {
  margin-bottom: 10px;
}
@media (max-width: 640px) {
  .industry-filter {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .industry-filter a {
    flex: none;
  }
}
.template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 26px;
  margin-bottom: 22px;
}
/* Pieces are sized by shape (public/product-model.js shapeOf), never by product. */
.template-grid.shape-tall {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}
.template-card {
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
}
.template-thumb {
  border: 0;
  padding: 26px;
  background: var(--soft);
  display: grid;
  place-items: center;
  min-height: 230px;
}
.shape-tall .template-thumb {
  min-height: 420px;
}
.shape-sheet .template-thumb {
  min-height: 360px;
}
.thumb-art {
  width: 100%;
  display: grid;
  place-items: center;
  transition: transform 0.2s;
}
.template-thumb:hover .thumb-art {
  transform: translateY(-3px);
}
.thumb-art svg,
.page-art svg {
  display: block;
  max-width: 100%;
  max-height: 380px;
  height: auto;
  width: auto;
  box-shadow: 0 10px 24px color-mix(in srgb, var(--ink) 13.3%, transparent);
  background: #fff;
}
.shape-wide .thumb-art svg {
  width: 100%;
}
.template-info {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px 18px 20px;
  flex: 1;
  justify-content: space-between;
}
.template-info h2 {
  font-size: 18px;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}
.template-info p {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.55;
  margin: 0;
}
.template-info .button {
  min-height: 44px;
  padding: 12px 18px;
}
.swatches {
  display: flex;
  gap: 8px;
}
.swatches button {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--white);
  outline: 1px solid var(--line);
  background: conic-gradient(var(--b) 0 50%, var(--c) 50% 75%, var(--a) 75%);
  padding: 0;
}
.swatches button[aria-checked="true"] {
  outline: 2px solid var(--ink);
}
.swatches.large {
  flex-wrap: wrap;
  gap: 12px;
}
.swatches.large button {
  width: auto;
  height: auto;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 14px 5px 5px;
  background: var(--white);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
}
.swatches.large button::before {
  content: "";
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: conic-gradient(var(--b) 0 50%, var(--c) 50% 75%, var(--a) 75%);
  box-shadow: inset 0 0 0 1px #0001;
}
.studio-field .optional {
  font-weight: 400;
  color: var(--muted);
}
textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--ink) 11%, var(--line));
  border-radius: 3px;
  background: var(--white);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  line-height: 1.5;
  resize: vertical;
}
.studio-field.invalid input,
.studio-field.invalid textarea {
  border-color: var(--danger);
  background: #fff4f1;
}
.logo-panel {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 18px;
  align-items: start;
}
.logo-current {
  width: 96px;
  height: 96px;
  border: 1px dashed color-mix(in srgb, var(--ink) 21%, var(--line));
  border-radius: 4px;
  display: grid;
  place-items: center;
  background: repeating-conic-gradient(color-mix(in srgb, var(--line) 40%, var(--white)) 0 25%, #fff 0 50%) 0 0 / 14px 14px;
  overflow: hidden;
}
.logo-current img {
  max-width: 84%;
  max-height: 84%;
}
.logo-empty {
  font-size: 28px;
  color: var(--muted);
  font-family: var(--font-accent);
}
.logo-actions {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-top: 10px;
}
.logo-recent {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.logo-recent button {
  width: 48px;
  height: 48px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--white);
}
.logo-recent img {
  max-width: 100%;
  max-height: 100%;
}
#studio-status {
  margin: 22px 0 16px;
  min-height: 20px;
}
#studio-status .note {
  display: block;
  color: #8a5a00;
  background: #fff6e0;
  border-left: 3px solid #d9b45b;
  padding: 8px 10px;
  margin-bottom: 8px;
}
.guide-toggle {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}
.guide-toggle input {
  width: 16px;
  height: 16px;
  padding: 0;
  accent-color: var(--ink);
}
.studio-pages {
  padding: 26px 3% 6px;
  display: grid;
  gap: 24px;
  grid-template-columns: 1fr;
  justify-items: center;
}
/* Wide panels of a sheet product, such as a folder's pockets. */
.studio-pages.shape-sheet .studio-page.panel-wide svg {
  max-height: 150px;
}
.studio-page {
  margin: 0;
  width: 100%;
}
.studio-page .page-art {
  display: grid;
  place-items: center;
}
.studio-page .page-art svg {
  max-height: 520px;
}
.shape-wide .page-art svg {
  width: 100%;
}
.studio-page figcaption {
  text-align: center;
  font-size: 8px;
  letter-spacing: 2px;
  color: var(--muted);
  margin-top: 12px;
}
.studio-pages.preview-invalid {
  opacity: 0.45;
}
@media (max-width: 1000px) {
  .make-it-yours {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 720px) {
  .make-it-yours-fields {
    grid-template-columns: 1fr 1fr;
  }
  .template-grid,
  .template-grid.shape-tall {
    grid-template-columns: 1fr;
  }
  .logo-panel {
    grid-template-columns: 72px 1fr;
  }
  .logo-current {
    width: 72px;
    height: 72px;
  }
}
.studio-page .blank-label {
  display: none;
}
.studio-page.blank-back .blank-label {
  display: inline;
}
.studio-page.blank-back .page-art svg {
  opacity: 0.12;
  filter: grayscale(1);
}

.make-it-yours-fields {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px 16px;
}
.make-it-yours .logo-control {
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 16px;
}

/* ---------- canvas overlay (studio-canvas.js) ----------
   The page art is the engine's SVG; the overlay sits exactly on top of it and
   only draws the selection. Nothing here prints. */
.studio-page .page-art {
  position: relative;
}
.studio-page .page-art svg.studio-overlay {
  background: none;
  box-shadow: none;
  max-height: none;
  max-width: none;
}
.studio-overlay {
  position: absolute;
  overflow: visible;
  pointer-events: none;
}
.studio-page .page-art {
  cursor: default;
  outline: none;
}
.studio-page .page-art:focus-visible svg:first-child {
  outline: 3px solid var(--accent-strong);
  outline-offset: 4px;
}
.el-box {
  fill: none;
}
/* The selected element can be dragged, even with a finger. */
.drag-target {
  fill: transparent;
  pointer-events: all;
  touch-action: none;
  cursor: move;
}
.select-outline {
  fill: none;
  stroke: #e0245e;
}
.select-outline.has-issue,
.issue-box {
  fill: none;
  stroke: #c0392b;
  stroke-dasharray: none;
}
.issue-box {
  stroke-opacity: 0.85;
}
.handle {
  fill: #fff;
  stroke: #e0245e;
}
.caret {
  stroke: #e0245e;
  animation: caret-blink 1.06s steps(1) infinite;
}
.text-selection {
  fill: #e0245e;
  fill-opacity: 0.22;
}
@keyframes caret-blink {
  50% {
    opacity: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .caret {
    animation: none;
  }
}
/* Takes the typing; the caret is drawn on the design instead. 16 px so a
   phone doesn't zoom when it has focus. */
.studio-typing {
  position: fixed;
  width: 2px;
  white-space: pre;
  height: 20px;
  padding: 0;
  border: 0;
  opacity: 0;
  font-size: 16px;
  resize: none;
  overflow: hidden;
  z-index: -1;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.history {
  display: flex;
  gap: 4px;
  margin-left: auto;
}
.icon-button {
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--ink);
  font-size: 18px;
  border-radius: 3px;
}
.icon-button:disabled {
  opacity: 0.35;
  cursor: default;
}
.logo-tools {
  margin-top: 14px;
}
.logo-size {
  display: grid;
  grid-template-columns: auto 1fr 44px;
  align-items: center;
  gap: 10px;
  font-size: 12px;
}
.logo-size input {
  padding: 0;
  accent-color: var(--ink);
}
.logo-size output {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ---------- selection: toolbar, properties, layers (studio slice 5) ---------- */
.tool-color input,
.custom-color input {
  width: 32px;
  height: 32px;
  padding: 2px;
  border: 1px solid var(--line);
  background: var(--white);
}
.studio-properties {
  margin-top: 18px;
  padding: 18px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 3px;
}
.prop-heading {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}
.prop-heading h3 {
  margin: 0 0 10px;
  font-size: 15px;
}
.prop-grid {
  display: grid;
  gap: 12px;
}
.prop-grid label {
  font-size: 12px;
}
.prop-row {
  display: grid;
  gap: 6px;
}
.prop-label {
  font-size: 12px;
  font-weight: 600;
}
.with-unit,
.range-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.with-unit input {
  width: 90px;
}
.range-row input {
  flex: 1;
  padding: 0;
  accent-color: var(--ink);
}
.range-row output {
  width: 42px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.segmented {
  display: flex;
}
.segmented button {
  flex: 1;
  padding: 8px 6px;
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--ink);
  font-size: 12px;
}
.segmented button + button {
  border-left: 0;
}
.segmented button[aria-checked="true"] {
  background: var(--ink);
  color: var(--white);
}
.role-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.role-swatches button {
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid #0003;
  background: var(--swatch);
}
.role-swatches button[aria-checked="true"] {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}
.fit-note {
  padding: 10px 12px;
  background: var(--soft);
  border-radius: 3px;
  font-size: 12px;
}
.fit-note.problem {
  background: #fff4f1;
  color: var(--danger);
}
.prop-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 10px;
}
#studio-layers-list ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
#studio-layers-list li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid var(--line);
}
#studio-layers-list li.selected {
  background: var(--accent);
}
.layer-name {
  flex: 1;
  text-align: left;
  padding: 8px 4px;
  border: 0;
  background: none;
  color: var(--ink);
  font-size: 12px;
}
.hidden-layer {
  color: var(--muted);
  text-decoration: line-through;
}
.layers-side {
  margin: 12px 0 4px;
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
}
#studio-status button.note {
  text-align: left;
  cursor: pointer;
}
.link-button {
  border: 0;
  padding: 0;
  background: none;
  color: inherit;
  text-decoration: underline;
  font: inherit;
  cursor: pointer;
}
.other-text {
  margin-top: 18px;
}

.icon-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
  gap: 6px;
  margin-top: 10px;
  padding: 10px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 3px;
}
.icon-picker button {
  height: 40px;
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--ink);
}
/* Pages scroll when zoomed in; a finger pans them, two pinch. */
.studio-pages.zoomed {
  place-items: start;
}
.studio-pages.zoomed .page-art > svg:first-child {
  max-width: none;
  max-height: none;
  height: auto;
}
.studio-page .page-art {
  touch-action: pan-x pan-y;
}
.select-outline.secondary {
  stroke: #2f6f9f;
}
.side-handle {
  fill: #e0245e;
}
.rotate-stem {
  stroke: #e0245e;
}
.snap-guide {
  stroke: #e0245e;
  stroke-dasharray: none;
}
@media (prefers-reduced-motion: no-preference) {
  .snap-guide {
    animation: guide-in 0.12s ease-out;
  }
}
@keyframes guide-in {
  from {
    opacity: 0;
  }
}
.prop-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.prop-buttons button {
  padding: 6px 10px;
  font-size: 12px;
}
.segmented.wrap,
.segmented.order {
  flex-wrap: wrap;
}
.segmented.wrap button {
  flex: 1 0 30%;
  border-left: 1px solid var(--line);
}
.crop-sheet {
  border: 0;
  padding: 24px;
  border-radius: 4px;
  max-width: calc(100vw - 16px);
}
.crop-sheet::backdrop {
  background: color-mix(in srgb, var(--ink) 69.0%, transparent);
}
.crop-sheet h2 {
  margin: 0 0 4px;
  font-size: 18px;
}
.crop-frame {
  position: relative;
  overflow: hidden;
  margin: 14px 0;
  background: var(--soft);
  touch-action: none;
  cursor: grab;
  outline: 2px solid var(--ink);
}
.crop-frame img {
  position: absolute;
  max-width: none;
  user-select: none;
  pointer-events: none;
}
.crop-zoom {
  flex-direction: row;
  align-items: center;
  gap: 10px;
  font-size: 12px;
}
.crop-zoom input {
  flex: 1;
  padding: 0;
  accent-color: var(--ink);
}
.crop-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}
@media (max-width: 720px) {
  .crop-sheet {
    width: 100vw;
    height: 100vh;
    max-height: 100vh;
    margin: 0;
    border-radius: 0;
  }
}
.layer-move {
  width: 26px;
  border: 0;
  background: none;
  color: var(--ink);
}

/* ---------- fonts and colors (studio slice 7) ---------- */
.recent-colors {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 6px;
}
.recent-colors button {
  width: 24px;
  height: 24px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid #0003;
  background: var(--swatch);
}
.role-editor {
  margin-top: 14px;
}
.role-rows {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
}
.role-row {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}
.role-row input {
  width: 32px;
  height: 32px;
  padding: 2px;
  flex: none;
}

/* ---------- studio layout ----------
   The studio fills the window, without the shop's header and footer. On a
   desktop: the bar across the top, then the tool tabs, the panel and the
   stage. On a phone: the bar, the stage, the panel as a sheet, the tabs. */
body.studio-mode .site-header,
body.studio-mode .site-footer {
  display: none;
}
body.studio-mode {
  overflow: hidden;
}
.studio-app {
  height: 100vh;
  height: 100dvh;
  display: grid;
  grid-template-columns: 76px 340px minmax(0, 1fr);
  grid-template-rows: 60px minmax(0, 1fr);
  grid-template-areas:
    "bar bar bar"
    "tabs panel stage";
}
.studio-bar {
  grid-area: bar;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  background: var(--white);
  min-width: 0;
}
.studio-exit {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  flex: none;
  padding: 8px 14px 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
}
.studio-exit::before {
  content: "";
  width: 6px;
  height: 6px;
  border-left: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
}
.studio-exit:hover {
  border-color: var(--ink);
}
.studio-name {
  width: min(320px, 28vw);
  min-width: 0;
  padding: 7px 10px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  font-size: 15px;
  font-weight: 600;
}
.studio-name:hover,
.studio-name:focus {
  border-color: var(--line);
  background: var(--white);
}
.studio-save {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}
.studio-bar .history {
  margin-left: auto;
}
.studio-bar .button {
  min-height: 40px;
  padding: 9px 26px;
}
.studio-tabs {
  grid-area: tabs;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 8px;
  border-right: 1px solid var(--line);
  background: var(--white);
  overflow-y: auto;
}
.studio-tabs button {
  display: grid;
  justify-items: center;
  gap: 5px;
  padding: 10px 2px 8px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}
.studio-tabs svg {
  width: 22px;
  height: 22px;
}
.studio-tabs button:hover {
  color: var(--ink);
  background: var(--soft);
}
.studio-tabs button[aria-selected="true"] {
  color: var(--ink);
  background: color-mix(in srgb, var(--accent) 21%, var(--soft));
}
.studio-panel {
  grid-area: panel;
  position: relative;
  min-height: 0;
  overflow-y: auto;
  padding: 18px 20px 28px;
  border-right: 1px solid var(--line);
  background: var(--white);
}
.pane-title,
.pane-head h2 {
  font-size: 18px;
  margin: 0 0 16px;
}
.pane-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}
.pane-sub {
  font-size: 12px;
  font-weight: 600;
  margin: 22px 0 10px;
}
.studio-fields {
  display: grid;
  gap: 12px;
}
.studio-field > span {
  display: flex;
  align-items: center;
  gap: 6px;
}
.studio-field input,
.studio-field textarea {
  padding: 9px 11px;
  font-size: 14px;
}
.other-text {
  margin-top: 4px;
}
.studio-properties {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
}
.add-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.add-tile {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 14px 6px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
}
.add-tile svg {
  width: 24px;
  height: 24px;
}
.add-tile:hover {
  border-color: var(--ink);
}
.icon-picker {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
}
.icon-picker button {
  display: grid;
  place-items: center;
  height: 44px;
  padding: 0;
  border-radius: 8px;
}
.icon-picker button:hover {
  border-color: var(--ink);
}
.layout-list {
  display: grid;
  gap: 6px;
}
.layout-list button {
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--white);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  text-align: left;
}
.layout-list button:hover {
  border-color: var(--ink);
}
.layout-list button[aria-checked="true"] {
  border-color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--ink);
}
.studio-stage {
  grid-area: stage;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: color-mix(in srgb, var(--paper) 5%, var(--soft));
}
.studio-pages {
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: grid;
  place-items: center;
  padding: 24px;
}
.studio-pages .studio-page {
  width: auto;
}
.studio-pages .page-art > svg:first-child {
  max-width: none;
  max-height: none;
  box-shadow:
    0 1px 3px color-mix(in srgb, var(--ink) 12.2%, transparent),
    0 14px 34px color-mix(in srgb, var(--ink) 11.0%, transparent);
}
/* One side on the stage at a time (studio.js showSide). */
.studio-pages[data-show="0"] > .studio-page:not(:nth-child(1)),
.studio-pages[data-show="1"] > .studio-page:not(:nth-child(2)),
.studio-pages[data-show="2"] > .studio-page:not(:nth-child(3)),
.studio-pages[data-show="3"] > .studio-page:not(:nth-child(4)),
.studio-pages[data-show="4"] > .studio-page:not(:nth-child(5)),
.studio-pages[data-show="5"] > .studio-page:not(:nth-child(6)) {
  display: none;
}
.studio-pages .studio-page figcaption {
  display: none;
  font-size: 12px;
  letter-spacing: 0;
}
.studio-pages .studio-page.blank-back figcaption {
  display: block;
}
.stage-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 56px;
  padding: 8px 16px;
  border-top: 1px solid var(--line);
  background: var(--white);
}
.side-switch {
  display: flex;
  flex: none;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: var(--soft);
}
.side-switch button {
  padding: 6px 14px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 600;
}
.side-switch button[aria-selected="true"] {
  background: var(--white);
  color: var(--ink);
  box-shadow: 0 1px 2px color-mix(in srgb, var(--ink) 18.0%, transparent);
}
.side-switch button.blank::after {
  content: " · blank";
  font-weight: 400;
}
.side-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
#studio-status {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  min-height: 0;
  max-height: 64px;
  overflow-y: auto;
}
#studio-status .note {
  display: block;
  margin: 0;
  padding: 5px 11px;
  border: 1px solid #efc9a4;
  border-left: 1px solid #efc9a4;
  border-radius: 999px;
  background: #fff3e6;
  color: #7f3a10;
  font-size: 12px;
  line-height: 1.4;
}
.stage-tools {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-left: auto;
  flex: none;
}
#studio-zoom {
  width: auto;
  padding: 6px 8px;
  font-size: 12px;
}
.studio-review .proof-summary {
  margin: 0;
  font-size: 13px;
}
.review-order {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.review-samples {
  margin-bottom: 14px;
  padding: 12px;
  border-radius: 6px;
  background: #fbf2dc;
  font-size: 12px;
}
.review-samples p {
  margin: 0 0 8px;
  font-weight: 600;
}
.review-samples div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chip {
  padding: 4px 10px;
  border: 1px solid #e3c98c;
  border-radius: 999px;
  background: var(--white);
  color: var(--ink);
  font-size: 12px;
}
.review-pages {
  display: grid;
  gap: 12px;
  margin: 16px 0;
}

.review-pages figure {
  margin: 0;
}
.review-pages img {
  display: block;
  width: 100%;
  box-shadow: 0 1px 3px color-mix(in srgb, var(--ink) 14.9%, transparent), 0 6px 16px color-mix(in srgb, var(--ink) 7.8%, transparent);
}
.review-pages figcaption {
  margin-top: 6px;
  font-size: 11px;
  color: var(--muted-strong);
}
.studio-review .approve {
  margin: 0 0 16px;
}
.review-stale {
  font-size: 13px;
}
@media (max-width: 1200px) {
  .studio-app {
    grid-template-columns: 72px 300px minmax(0, 1fr);
  }
}
@media (max-width: 900px) {
  .studio-app {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 52px minmax(0, 1fr) auto auto;
    grid-template-areas:
      "bar"
      "stage"
      "panel"
      "tabs";
  }
  .studio-bar {
    gap: 8px;
    padding: 0 10px;
  }
  .studio-exit {
    padding: 10px 12px;
  }
  .exit-label,
  .studio-save {
    display: none;
  }
  .studio-name {
    flex: 1;
    width: auto;
    font-size: 14px;
  }
  .studio-bar .history {
    margin-left: 0;
  }
  .studio-bar .button {
    padding: 8px 16px;
  }
  .studio-tabs {
    flex-direction: row;
    gap: 2px;
    padding: 4px 6px calc(4px + env(safe-area-inset-bottom));
    border-right: 0;
    border-top: 1px solid var(--line);
    overflow-x: auto;
  }
  .studio-tabs button {
    flex: 1;
    min-width: 54px;
    padding: 7px 2px 5px;
    font-size: 10px;
  }
  .studio-panel {
    display: none;
    max-height: 46vh;
    max-height: 46dvh;
    padding: 14px 16px 18px;
    border-right: 0;
    border-top: 1px solid var(--line);
    border-radius: 14px 14px 0 0;
    box-shadow: 0 -8px 24px color-mix(in srgb, var(--ink) 10.2%, transparent);
  }
  .studio-app.sheet-open .studio-panel {
    display: block;
  }
  .pane-title,
  .pane-head h2 {
    font-size: 16px;
    margin-bottom: 12px;
  }
  .studio-pages {
    padding: 14px;
  }
  .stage-bar {
    min-height: 44px;
    padding: 6px 10px;
    gap: 8px;
  }
  #studio-zoom {
    display: none;
  }
}
.stage-tools .guide-toggle {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 7px;
  margin: 0;
  font-size: 12px;
  line-height: 1;
}
.stage-tools .guide-toggle input {
  margin: 0;
}
@media (max-width: 900px) {
  /* With the sheet closed, no tab reads as open. */
  .studio-app:not(.sheet-open) .studio-tabs button[aria-selected="true"] {
    background: none;
    color: var(--muted);
  }
}
.bar-note {
  padding: 3px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 21%, var(--soft));
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.bleed-band {
  fill: #ffffff;
  fill-opacity: 0.62;
}
.bleed-label {
  fill: #b3264f;
  font-family: var(--font-body);
  font-weight: 700;
  letter-spacing: 0.08em;
}
.guide-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
  padding: 10px 16px;
  border-top: 1px solid var(--line);
  background: var(--white);
  font-size: 12px;
  line-height: 1.4;
}
.guide-legend[hidden] {
  display: none;
}
.guide-legend p {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
  max-width: 420px;
}
.guide-legend strong {
  font-weight: 600;
}
.guide-key {
  flex: none;
  width: 22px;
  height: 14px;
  margin-top: 1px;
  border-radius: 2px;
}
.key-bleed {
  background: repeating-linear-gradient(135deg, #f3d6de 0 3px, #fff 3px 6px);
  border: 1px solid #e7b5c3;
}
.key-trim {
  border: 1.5px dashed #e0245e;
}
.key-safe {
  border: 1.5px dotted #1f7a8c;
}
.key-keep {
  background: #1f7a8c1f;
  border: 1px dashed #1f7a8c;
}
.key-die {
  border: 1.5px dashed #e0245e;
  border-radius: 50%;
  width: 14px;
  margin-left: 4px;
  margin-right: 4px;
}
@media (max-width: 900px) {
  .guide-legend {
    max-height: 30vh;
    overflow-y: auto;
    padding: 8px 12px;
    font-size: 11px;
  }
}
/* ---------- review: its own window over the studio ---------- */
.review-dialog {
  width: min(1120px, 94vw);
  max-height: 92vh;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: var(--white);
  color: var(--ink);
  box-shadow: 0 24px 80px color-mix(in srgb, var(--shade) 30.2%, transparent);
}
.review-dialog::backdrop {
  background: color-mix(in srgb, var(--shade) 54.9%, transparent);
}
.review-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
}
.review-head h2 {
  margin: 0;
  font-size: 22px;
}
.review-close {
  font-size: 22px;
  line-height: 1;
}
.review-body {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr);
  max-height: calc(92vh - 70px);
}
.review-body .review-pages {
  margin: 0;
  padding: 28px;
  overflow-y: auto;
  background: color-mix(in srgb, var(--paper) 5%, var(--soft));
  align-content: start;
  gap: 22px;
}
.review-pages.shape-tall,
.review-pages.shape-sheet {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
.review-body .review-pages img {
  margin: 0 auto;
  max-height: 64vh;
  width: auto;
  max-width: 100%;
}
.review-pages figcaption {
  text-align: center;
}
.review-side {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px;
  overflow-y: auto;
}
.review-side .review-samples,
.review-side .approve {
  margin: 0;
}
.review-side .review-order {
  padding: 14px 0;
}
.review-product {
  margin: 0 0 4px;
  font-weight: 600;
  font-size: 14px;
}
.review-stale {
  padding: 28px 24px;
}
.review-stale p {
  margin: 0 0 16px;
}
@media (max-width: 900px) {
  .review-dialog {
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    border-radius: 0;
  }
  .review-body {
    grid-template-columns: 1fr;
    max-height: none;
    height: calc(100dvh - 62px);
    overflow-y: auto;
  }
  .review-body .review-pages {
    overflow: visible;
    padding: 16px;
  }
  .review-body .review-pages img {
    max-height: 48vh;
  }
  .review-side {
    overflow: visible;
    padding: 18px 16px 28px;
  }
}
/* Wide pieces stack; both sides fit in the window. */
.review-body .review-pages.shape-wide img {
  max-height: calc((92vh - 190px) / 2);
}
@media (max-width: 900px) {
  .review-body .review-pages.shape-wide img {
    max-height: 30vh;
  }
}
