.maker-page {
  --studio-ink: #26382f;
  --studio-paper: #f5f1e7;
  --studio-mat: #e9e9dc;
  --studio-line: #c9cbb9;
  background: var(--studio-paper);
}
.maker-page .topline,
.maker-page .header-cta { display: none; }
.maker-page > header {
  min-height: 59px;
  padding-block: 8px;
}
.maker {
  width: min(100% - 50px, 1280px);
  min-width: 0;
  margin: 24px auto;
  display: grid;
  grid-template-columns: minmax(255px, .65fr) minmax(0, 1.8fr);
  grid-template-rows: auto minmax(0, 1fr);
  gap: 16px 28px;
  color: var(--studio-ink);
}
.maker-title {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 5px 16px;
}
.maker-title h1 {
  font-size: clamp(32px, 4.5vw, 56px);
  line-height: 1.04;
  letter-spacing: -.06em;
  margin: 0;
}
.maker-quota {
  padding: 5px 9px;
  border: 1px solid var(--studio-line);
  border-radius: 4px;
  margin: 0;
  font: 12px/1.2 var(--mono, monospace);
}
.maker-controls {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 13px;
  padding: 18px;
  border: 1px solid var(--studio-line);
  border-radius: 12px;
  background: #fffaf0;
}
.maker-upload-group { min-width: 0; }
.maker-upload {
  position: relative;
  display: grid;
  align-items: center;
  justify-items: center;
  gap: 9px;
  min-height: 156px;
  margin: 0;
  padding: 15px;
  border: 2px dashed #8a9684;
  border-radius: 9px;
  background: #e9eadb;
  text-align: center;
  cursor: pointer;
}
.maker-upload[data-drag],
.maker-upload[data-state="ready"] { background: #dce4cc; border-color: var(--studio-ink); }
.maker-upload[data-state="ready"] { border-style: solid; }
.maker-upload[data-state="error"] { border-color: #963e24; }
.maker-upload[data-state="preparing"] { border-color: #966247; }
@media (hover: hover) {
  .maker-upload:hover { background: #dce4cc; border-color: var(--studio-ink); }
}
.maker-upload:focus-within { outline: 2px solid #9b421e; outline-offset: 3px; }
.maker-upload input {
  position: absolute;
  inset: 0;
  opacity: 0;
  z-index: 1;
  padding: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}
.maker-upload-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  color: #e2efd9;
  background: var(--studio-ink);
}
.maker-upload img {
  width: 58px;
  height: 58px;
  object-fit: contain;
  border-radius: 5px;
  background: #fffaf0;
}
.maker-upload-text { min-width: 0; }
.maker-upload-text strong {
  display: block;
  font-size: 16px;
  overflow-wrap: anywhere;
}
.maker-upload-text small { display: block; margin-top: 4px; font-size: 11px; }
.maker-sample {
  display: inline-block;
  min-height: 31px;
  margin-top: 3px;
  padding: 0;
  background: none;
  border: 0;
  color: #364739;
  font-size: 12px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.maker-reference-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 0 16px; }
.maker-reference-actions a { align-content: center; }
.maker-reference-actions [hidden] { display: none; }
.maker-options { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.maker-options label { display: grid; gap: 4px; min-width: 0; margin: 0; font-size: 12px; font-weight: 700; }
.maker-options select {
  width: 100%;
  min-width: 0;
  min-height: 41px;
  margin: 0;
  padding: 5px 6px;
  border: 1px solid #aeb49f;
  border-radius: 5px;
  color: var(--studio-ink);
  background: #fffaf0;
  font-size: 13px;
}
.maker-generate, .maker-download {
  display: inline-flex;
  justify-content: space-between;
  align-items: center;
  gap: 9px;
  padding: 9px 13px;
  min-height: 42px;
  border: 1px solid var(--studio-ink);
  border-radius: 6px;
  font-size: 14px;
  font-weight: 700;
  background: #eb8b60;
  color: #242a22;
  text-decoration: none;
}
.maker-generate:hover, .maker-download:hover { background: #f09d77; }
.maker-generate:disabled { opacity: .57; cursor: not-allowed; }
.maker-disclosure { margin: 0; font-size: 11px; line-height: 1.38; }
.maker-result {
  display: grid;
  grid-template-rows: minmax(180px, 1fr) 48px;
  border: 1px solid var(--studio-line);
  border-radius: 12px;
  overflow: hidden;
  min-width: 0;
  height: clamp(360px, calc(100svh - 184px), 675px);
  background: #fffaf0;
}
.maker-preview {
  display: grid;
  place-items: center;
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  padding: 12px;
  background: radial-gradient(#b6bda8 1px, transparent 1px) 0 0 / 16px 16px, var(--studio-mat);
}
.maker-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  min-height: 0;
  min-width: 0;
  border-radius: 4px;
}
.maker-preview:not([aria-busy="true"]):has(#maker-output[src$="/signal-scout-four-views.webp"])::before {
  --registration-ink: #9f4e34;
  --registration-rule: #6d846e;
  position: absolute;
  z-index: 1;
  inset: 8px;
  pointer-events: none;
  content: "";
  background:
    linear-gradient(var(--registration-ink) 0 0) top left / 24px 2px,
    linear-gradient(var(--registration-ink) 0 0) top left / 2px 18px,
    linear-gradient(var(--registration-ink) 0 0) top right / 24px 2px,
    linear-gradient(var(--registration-ink) 0 0) top right / 2px 18px,
    linear-gradient(var(--registration-ink) 0 0) bottom left / 24px 2px,
    linear-gradient(var(--registration-ink) 0 0) bottom left / 2px 18px,
    linear-gradient(var(--registration-ink) 0 0) bottom right / 24px 2px,
    linear-gradient(var(--registration-ink) 0 0) bottom right / 2px 18px,
    repeating-linear-gradient(90deg,var(--registration-rule) 0 2px,transparent 2px 10px)
      top center / 61px 3px,
    repeating-linear-gradient(90deg,var(--registration-rule) 0 2px,transparent 2px 10px)
      bottom center / 61px 3px;
  background-repeat: no-repeat;
}
@media (prefers-reduced-motion: no-preference) {
  .maker-preview[data-example-register="aligning"]::before {
    animation: studio-example-register 560ms cubic-bezier(.3,.1,.32,1) both;
  }
  @keyframes studio-example-register {
    from { inset: 34px 40px; }
    to { inset: 8px; }
  }
}
.maker-skeleton {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: radial-gradient(#aeb7a0 1px, transparent 1px) 0 0 / 16px 16px, var(--studio-mat);
}
/* The drafting grid occupies the existing result well only while a request is awaited. */
.maker-draft-plate {
  width: min(82%, 420px);
  aspect-ratio: 3 / 2;
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  grid-template-rows: repeat(2,minmax(0,1fr));
  gap: 8px;
  padding: clamp(10px, 2vw, 18px);
  border: 1px solid #89937d;
  border-top: 4px solid #b05032;
  border-radius: 6px;
  background: #fff9ea;
  box-shadow: 6px 6px #c7d2b9;
}
.maker-draft-plate span {
  min-width: 0;
  border: 1px solid #a5b09a;
  border-radius: 3px;
  background: linear-gradient(transparent 49%, #88967e 49% 51%, transparent 51%), #e5eadb;
  animation: maker-draft 1.2s ease-in-out 2 alternate;
}
.maker-draft-plate span:nth-child(2n) { animation-delay: .12s; }
@keyframes maker-draft {
  from { opacity: .6; transform: translateY(2px); }
  to { opacity: 1; transform: translateY(0); }
}
.maker-result-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px 11px;
  padding: 4px 8px 4px 12px;
  min-width: 0;
}
.maker-result-bar p { margin: 0; font-size: 12px; line-height: 1.25; }
.maker-result-bar p[data-error] { color: #832e1a; }
.maker-download {
  min-height: 36px;
  gap: 5px;
  flex-shrink: 0;
  background: var(--studio-ink);
  color: #fffaf0;
  font-size: 12px;
  padding: 4px 9px;
}
.maker-download:hover { color: #fffaf0; background: #3d5848; }
@media (max-width: 765px) {
  .maker { width: calc(100% - 24px); margin: 12px auto; gap: 8px; grid-template-columns: 1fr; grid-template-rows: auto auto minmax(0, 1fr); }
  .maker-title { gap: 6px 8px; }
  .maker-title h1 { font-size: clamp(26px, 7.6vw, 37px); }
  .maker-quota { font-size: 10px; padding: 4px 6px; }
  .maker-controls { gap: 7px; padding: 8px; }
  .maker-upload { min-height: 67px; padding: 7px 10px; grid-template-columns: 43px minmax(0, 1fr); justify-items: start; text-align: left; }
  .maker-upload img { width: 40px; height: 43px; }
  .maker-sample { min-height: 26px; margin: 1px 0 0; }
  .maker-options select { min-height: 38px; }
  .maker-generate { min-height: 40px; }
  .maker-preview { padding: 6px; }
  .maker-result { height: clamp(180px, calc(100svh - 389px), 485px); grid-template-rows: minmax(0, 1fr) 47px; }
}
@media (max-height: 780px) and (min-width: 766px) {
  .maker { margin-block: 12px; gap: 11px 20px; }
  .maker-upload { min-height: 112px; padding: 9px; }
}

@media (max-width: 765px) {
  .maker {
    height: max(520px, calc(100svh - 96px));
    grid-template-rows: auto auto minmax(155px, 1fr);
  }
  .maker-result { height: auto; min-height: 0; }
}

.maker-allowance { display: flex; gap: 7px; align-items: center; flex-wrap: wrap; }
.maker-buy { border: 1px solid #aab19f; border-radius: 4px; padding: 3px 8px; background: #fffaf0; color: #26382f; font: 12px/1.2 var(--mono, monospace); }
.maker-buy:hover { border-color: #26382f; }
.credit-dialog { color:#26382f; background:#fffaf0; width:min(560px,calc(100% - 24px)); max-height:92svh; border:1px solid #8a9684; border-radius:12px; padding:20px; }
.credit-dialog::backdrop { background:#202b22aa; }
.credit-header { display:flex; justify-content:space-between; align-items:center; margin-bottom:10px; gap:12px; }
.credit-header h2 { font-size:clamp(23px,5vw,31px); margin:0; }
.credit-close { min-height:34px; min-width:34px; background:#e9eadb; border:1px solid #aab19f; border-radius:4px; color:#26382f; font-size:20px; }
.credit-packs { display:grid; gap:8px; margin-block:14px; }
.credit-packs > div { display:grid; grid-template-columns: minmax(56px,1fr) minmax(75px,1fr) auto; align-items:center; gap:4px 10px; padding:10px; border:1px solid #d2d4c6; border-radius:6px; font-size:13px; }
.credit-packs button { border-radius:4px; border:1px solid #26382f; color:#fffaf0; background:#26382f; padding:6px 10px; font-weight:bold; }
.credit-packs button:disabled { color:#26382f; background:#e9eadb; opacity:1; cursor:default; }
.credit-status { margin:0; font-size:13px; }
@media(max-width:765px) { .maker-buy { font-size:10px; padding:4px 6px; } }

.maker-rights {
  display: grid;
  gap: 3px;
  font-size: 12px;
  line-height: 1.4;
}
.maker-rights label {
  display: grid;
  grid-template-columns: 18px 1fr;
  align-items: start;
  gap: 8px;
  cursor: pointer;
}
.maker-rights input {
  appearance: auto;
  accent-color: var(--studio-ink);
  width: 16px;
  height: 16px;
  margin: 0;
}
.maker-rights a { justify-self: start; margin-inline-start: 26px; text-decoration: underline; }
.maker-reference-status { margin: 2px 0 0; font-size: 12px; }
.maker-reference-status:empty { margin: 0; }
.maker-reference-status[data-error] { color: #8f331e; }
.maker-result-bar { min-height: 46px; }
@media (max-width: 765px) {
  .maker { height: auto; grid-template-rows: auto auto auto; }
  .maker-result { min-height: clamp(200px, 40svh, 510px); }
}

.maker-submit-actions { display: grid; height: 44px; }
.maker-submit-actions > * { grid-area: 1 / 1; min-height: 0; height: 100%; line-height: 1.2; }
.maker [hidden] { display: none; }
.maker[data-waiting] .maker-generate { visibility: hidden; }
.maker:not([data-ready]) .maker-buy { visibility: hidden; }
.maker-cancel {
  display: inline-flex;
  justify-content: space-between;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  padding: 9px 13px;
  border: 1px solid #80442e;
  border-radius: 6px;
  background: #fcf1de;
  color: #693b2b;
  font-size: 14px;
  font-weight: 700;
}
.maker-controls :is(button, a, select, input):focus-visible,
.maker-result :is(a, [tabindex]):focus-visible,
.maker-buy:focus-visible,
.studio-reference-guide a:focus-visible {
  outline: 3px solid #963e24;
  outline-offset: 3px;
}
.maker-options select[aria-invalid="true"] { border-color: #963e24; }
.maker-options label:focus-within select { border-color: var(--studio-ink); }
.maker-rights label:has(input:checked) span { font-weight: 700; }
.maker-controls :is(button:not(:disabled),a,select:not(:disabled)):active,
.maker-download:active { box-shadow: inset 0 -2px #a2553a; }
.maker-result { grid-template-rows: minmax(0, 1fr) 68px; }
.maker-result-bar p { min-width: 0; }
.studio-reference-guide[data-studio-accent]::before {
  display: block;
  width: 52px;
  height: 4px;
  margin-bottom: 12px;
  border-radius: 3px;
  background: #b05032;
  content: "";
  transform-origin: left;
}
.studio-reference-guide[data-seen]::before { animation: maker-guide-mark .42s ease-out; }
@keyframes maker-guide-mark {
  from { transform: scaleX(.48); }
  to { transform: scaleX(1); }
}
@media (max-width: 765px) {
  .maker-result { grid-template-rows: 68px minmax(0, 1fr); }
  .maker-result-bar { grid-row: 1; }
  .maker-preview { grid-row: 2; }
}
@media (max-width: 380px) {
  .maker-result { grid-template-rows: 78px minmax(0, 1fr); }
  .maker-result-bar { gap: 6px; padding-inline: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .maker-draft-plate span, .studio-reference-guide[data-seen]::before { animation: none; }
}

/* Native radios provide keyboard navigation. The visible cards carry focus and selection. */
.maker-format-picker, .maker-style-picker {
  min-inline-size: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.maker-format-picker legend, .maker-style-picker legend {
  margin-bottom: 4px;
  padding: 0;
  color: var(--studio-ink);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
}
.maker-format-options, .maker-style-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
}
.maker-style-options { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.maker-format-options label, .maker-style-options label {
  position: relative;
  display: grid;
  min-width: 0;
  justify-items: center;
  border: 1px solid #adb39f;
  border-radius: 5px;
  background: #fcf6e9;
  cursor: pointer;
}
.maker-format-options label {
  min-height: 41px;
  align-items: center;
}
.maker-style-options label {
  gap: 3px;
  align-content: start;
  padding: 3px 3px 4px;
  color: var(--studio-ink);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.14;
  text-align: center;
}
.maker-format-options input, .maker-style-options input, .maker-radio-name {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  margin: 0;
  clip-path: inset(50%);
}
.maker-format-icon {
  display: block;
  width: 23px;
  aspect-ratio: 3 / 2;
  border: 2px solid #455c4a;
  border-radius: 2px;
  box-shadow: inset 0 0 0 2px #fcf6e9;
}
.maker-format-portrait { width: 15px; aspect-ratio: 2 / 3; }
.maker-format-options label:has(:checked), .maker-style-options label:has(:checked) {
  border-color: #47694e;
  background: #e1ead5;
  box-shadow: inset 0 -2px #587b5d;
}
.maker-format-options label:has(:checked) .maker-format-icon { background: #668971; }
.maker-format-options label:has(:focus-visible), .maker-style-options label:has(:focus-visible) {
  outline: 3px solid #963e24;
  outline-offset: 2px;
}
.maker-format-options label:not(:has(:disabled)):is(:active,[data-choice-pressed]),
.maker-style-options label:not(:has(:disabled)):is(:active,[data-choice-pressed]) {
  box-shadow: inset 0 0 0 2px #a2553a;
}
@media (hover: hover) {
  .maker-format-options label:not(:has(:disabled)):hover,
  .maker-style-options label:not(:has(:disabled)):hover { border-color: var(--studio-ink); }
}
@media (prefers-reduced-motion: no-preference) {
  .maker-format-options label, .maker-style-options label {
    transition: transform 160ms ease-out;
  }
  .maker-format-options label:has(:focus-visible),
  .maker-style-options label:has(:focus-visible) { transform: translateY(-3px); }
  @media (hover: hover) {
    .maker-format-options label:not(:has(:disabled)):hover,
    .maker-style-options label:not(:has(:disabled)):hover { transform: translateY(-3px); }
  }
  .maker-format-options label:not(:has(:disabled)):is(:active,[data-choice-pressed]),
  .maker-style-options label:not(:has(:disabled)):is(:active,[data-choice-pressed]) {
    transform: translateY(2px);
    transition-duration: 85ms;
  }
}
.maker-format-picker[disabled] label, .maker-style-picker[disabled] label { cursor: default; }
.maker-format-picker[aria-invalid="true"] label, .maker-style-picker[aria-invalid="true"] label { border-color:#963e24; }
.maker-style-art {
  position: relative;
  width: 100%;
  height: 23px;
  overflow: hidden;
  border-radius: 3px;
  background: var(--study-paper);
}
.maker-style-art::before, .maker-style-art::after {
  position: absolute;
  left: 50%;
  content: "";
}
.maker-style-art::before {
  top: 2px;
  width: 7px;
  height: 8px;
  margin-left: -3.5px;
  border-radius: 45% 45% 42% 42%;
  background: var(--study-face);
}
.maker-style-art::after {
  top: 10px;
  width: 26px;
  height: 15px;
  margin-left: -13px;
  clip-path: polygon(27% 0%, 73% 0%, 91% 31%, 100% 100%, 0% 100%, 9% 31%);
  background: var(--study-coat);
}
.maker-style-reference {
  --study-paper: #efe0b7;
  --study-face: #9e603c;
  --study-coat: linear-gradient(112deg, #6d846b 12%, #487361 49%, #a77454 51%, #4f7661 55%);
}
.maker-style-detailed {
  --study-paper: repeating-linear-gradient(0deg, #e8ebd9 0 5px, #d5dac5 5px 6px);
  --study-face: #566249;
  --study-coat: repeating-linear-gradient(0deg, transparent 0 3px, #bbc2a7 3px 4px),
                 linear-gradient(88deg, #596752 0 43%, #d1c2a4 43% 47%, #596752 47% 73%, #cfc2a5 73% 77%, #596752 77%);
}
.maker-style-poster {
  --study-paper: linear-gradient(135deg, #f1b861 0 47%, #aa6147 47%);
  --study-face: #253f40;
  --study-coat: linear-gradient(145deg, #253f40 0 61%, #fff0cf 61% 74%, #253f40 74%);
}
.maker-style-art.maker-style-production {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: center;
  gap: 3px;
  padding: 0 5px;
  background: #213a32;
}
.maker-style-art.maker-style-production::before,
.maker-style-art.maker-style-production::after { display: none; }
.maker-style-production i {
  position: relative;
  height: 8px;
  margin: 5px 0 0;
  border-radius: 45% 45% 1px 1px;
  background: #adc39f;
}
.maker-style-production i::before {
  position: absolute;
  top: -5px;
  left: 50%;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #d7bc83;
  content: "";
  transform: translateX(-50%);
}
.maker-premium-badge {
  padding: 0 3px;
  border-radius: 2px;
  color: #633815;
  background: #f5dfab;
  font-size: 9px;
}
.maker-style-picker[data-premium-unavailable] .maker-style-production-card:not(:has(:checked)) {
  border-style: dashed;
}
.maker-premium-help {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 8px;
  padding: 4px 7px;
  border-left: 2px solid #667c62;
  color: #294239;
  background: #e4ead8;
  font-size: 11px;
  line-height: 1.4;
}
.maker-premium-help p { margin: 0; }
.maker-premium-help[hidden], .maker-premium-help button[hidden] { display: none; }
.maker-premium-help button {
  min-height: 32px;
  padding: 2px 7px;
  border: 1px solid #657a64;
  border-radius: 3px;
  color: #253b30;
  background: #fdf8eb;
  font-size: inherit;
  font-weight: 700;
}
.studio-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 24px;
  margin: 28px 0 0;
  padding: 16px max(4%, calc((100% - 1060px) / 2));
  border-top: 1px solid #c2cbb7;
  color: #263a31;
  background: #e8eddd;
}
.studio-footer .wordmark { color: inherit; }
.studio-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0 16px;
  font-size: 13px;
}
.studio-footer nav a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.studio-footer a:focus-visible { outline: 2px solid #963e24; outline-offset: 3px; }
@media (max-width: 765px) {
  .maker-controls { gap: 6px; }
  .maker-format-options label { min-height: 38px; }
  .maker-style-art { height: 21px; }
}
@media (max-width: 380px) {
  .maker-controls { gap: 5px; }
  .maker-upload { min-height: 61px; }
  .maker-reference-actions { gap: 0 7px; }
  .maker-reference-actions .maker-sample { font-size: 11px; }
  .maker-style-options label { font-size: 10px; }
}
