:root {
  --ink: #191613;
  --walnut: #24201b;
  --ivory: #f6eee1;
  --parchment: #f1e7d8;
  --paper: #fffaf2;
  --brass: #dfba83;
  --brown: #34251c;
  --muted: #66574a;
  --line: #d1beaa;
  --display: Georgia, 'Times New Roman', serif;
  font: 16px/1.55 system-ui, sans-serif;
  background: var(--ink);
  color: var(--ivory);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
a, button, textarea, input { -webkit-tap-highlight-color: #b6916555; }
button, input, textarea { font: inherit; }
.masthead { border-bottom: 1px solid #494038; }
.masthead-inner, main, footer { width: min(1152px, calc(100% - 4rem)); margin-inline: auto; }
.masthead-inner, footer { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.masthead-inner { min-height: 68px; }
.brand { display: flex; align-items: center; gap: .65rem; font: 1.55rem/1 var(--display); letter-spacing: -.025em; }
.brand-mark { width: 34px; color: var(--brass); }
.eyebrow { font-size: .7rem; font-weight: 750; letter-spacing: .17em; text-transform: uppercase; }
.masthead-note { color: #d3bca3; }
.masthead-link { color: var(--brass); text-decoration: none; }
.masthead-link:hover { color: var(--ivory); }
.masthead-link:focus-visible, .market-link:focus-visible { outline-color: var(--brass); }

.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .9fr); align-items: center; gap: clamp(2rem, 6vw, 6rem); padding-block: clamp(2rem, 5vw, 4rem); }
.hero-copy { min-width: 0; }
.hero-kicker { display: flex; align-items: center; gap: .7rem; color: var(--brass); margin: 0 0 .9rem; }
.hero-kicker::before { content: ''; width: 1.8rem; border-top: 1px solid currentColor; }
h1, h2 { font-family: var(--display); font-weight: 400; }
h1 { margin: 0; font-size: clamp(3.4rem, 8vw, 7.3rem); line-height: .89; letter-spacing: -.068em; }
h1 em { color: var(--brass); }
.intro { max-width: 31rem; margin: 1.15rem 0 1.35rem; color: #d9ccbe; font-size: clamp(.99rem, 2vw, 1.1rem); }
.shop-example { margin: 0; padding: .45rem; border: 1px solid #625043; background: var(--walnut); }
.shop-example img { display: block; width: 100%; height: clamp(210px, 24vw, 320px); object-fit: cover; object-position: center 53%; }
.shop-example figcaption { display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: .6rem .45rem .12rem; }
.shop-example strong { display: block; font: 1.16rem/1.2 var(--display); }
.shop-example small { display: block; color: #d7c6b3; font-size: .74rem; margin-top: .12rem; }
.example-index { color: var(--brass); text-align: right; }

.studio { background: var(--parchment); color: var(--brown); border: 1px solid #bca488; border-radius: .2rem; overflow: clip; }
.studio-banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .35rem .8rem; padding: .8rem clamp(1rem, 3.4vw, 2.6rem); background: #34291f; color: var(--ivory); }
.studio-banner .eyebrow { color: #f2cc98; }
.studio-sequence { font-size: .8rem; color: #ead7c2; }
.studio-sequence b { color: var(--brass); margin-inline: .35rem; font-weight: 400; }
.workspace { display: grid; grid-template-columns: 1fr 1fr; }
.panel { min-width: 0; padding: clamp(1.15rem, 3.5vw, 2.65rem); }
.preview { background: #e9ddcc; border-left: 1px solid var(--line); }
.step { display: flex; align-items: center; gap: .55rem; margin: 0 0 .55rem; color: #72503b; }
.step span { display: inline-grid; place-items: center; min-width: 1.8rem; height: 1.4rem; border: 1px solid #b69a7c; border-radius: 2px; letter-spacing: .04em; }
h2 { margin: 0 0 .35rem; font-size: clamp(1.95rem, 3.4vw, 2.85rem); line-height: 1.05; letter-spacing: -.045em; }
.help, .review-note { color: var(--muted); font-size: .875rem; margin: .35rem 0; }
label { display: block; font-size: .91rem; font-weight: 700; margin: 1.1rem 0 .4rem; }
textarea { display: block; width: 100%; min-height: 105px; padding: .8rem; border: 1px solid #9a826d; border-radius: .25rem; background: var(--paper); color: var(--brown); resize: vertical; }
textarea::placeholder { color: #746455; }
.prompt-meta { display: flex; justify-content: space-between; gap: .7rem; align-items: baseline; }
#prompt-count { flex: none; color: var(--muted); font-size: .76rem; font-variant-numeric: tabular-nums; }
.examples, .actions, .reference-card { display: flex; align-items: center; flex-wrap: wrap; gap: .45rem; }
.examples { margin-top: .35rem; }
.chip, .button { display: inline-flex; align-items: center; justify-content: center; gap: .6rem; min-height: 44px; padding: .55rem .9rem; border: 1px solid transparent; border-radius: .25rem; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; transition: background-color 150ms, border-color 150ms; }
.chip { border-color: #a58c74; background: transparent; color: #4b3729; font-size: .8rem; padding-inline: .68rem; }
.chip:hover, .secondary:hover { background: #e1ceb8; border-color: #785b42; }
.chip:active, .secondary:active { background: #d7bfa4; }
.button { border-color: #3b291e; background: #3b291e; color: #fff2e2; }
.button:hover { background: #553828; }
.button:active { background: #261810; }
.hero-action { border-color: var(--brass); background: var(--brass); color: #291d13; }
.hero-action:hover { background: #f2d09d; }
.hero-action:active { background: #cc9f64; }
.button:disabled, .button[aria-disabled=true] { opacity: .7; cursor: wait; }
.secondary { border-color: #87694d; background: transparent; color: #493327; }
.generate { width: 100%; justify-content: space-between; margin-top: 1rem; min-height: 52px; padding-inline: 1rem; }
:focus-visible { outline: 2px solid #765039; outline-offset: 3px; }
.hero-action:focus-visible { outline-color: #f4d29e; }
#design-form { scroll-margin-top: 1rem; }
#design-form:target { box-shadow: inset 0 3px #af8359; }
.upload { margin-top: .85rem; padding-top: .05rem; border-top: 1px solid var(--line); }
.optional { margin-left: .35rem; color: var(--muted); font-size: .78rem; font-weight: 450; }
.file-control { position: relative; display: flex; align-items: center; gap: .65rem; min-height: 51px; padding: .5rem .7rem; background: #f9f0e3; border: 1px dashed #9d8268; border-radius: .25rem; font-size: .87rem; font-weight: 700; }
.file-control:hover { background: #ecdbc6; }
.file-control:active { background: #e1ccb3; border-color: #785b42; }
.file-control:focus-within { outline: 2px solid #765039; outline-offset: 3px; }
.file-control input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.file-icon { display: grid; place-items: center; width: 28px; height: 28px; background: #ebdac4; border-radius: 2px; }
.file-icon svg { width: 18px; height: 18px; }
.reference-card { margin-top: .6rem; padding: .35rem; border: 1px solid var(--line); }
.reference-card img { display: block; width: 42px; height: 42px; object-fit: cover; }
#reference-name { flex: 1 1 75px; min-width: 0; overflow-wrap: anywhere; font-size: .8rem; }
.generation-progress { margin-top: .7rem; padding: .55rem .7rem; border: 1px solid var(--line); border-radius: .25rem; }
.progress-heading { display: flex; justify-content: space-between; gap: .5rem; font-size: .86rem; }
.progress-heading label { margin: 0; }
#progress-percent { color: #69462e; font-variant-numeric: tabular-nums; font-weight: 700; }
#progress-bar { display: block; width: 100%; height: .7rem; margin-top: .4rem; accent-color: #765039; }
#progress-detail { margin-bottom: 0; font-size: .79rem; }
#progress-detail:empty { display: none; }
#status:empty { display: none; }
#studio-credits details { margin-top: .55rem; }
#studio-credits summary { cursor: pointer; min-height: 44px; align-content: center; font-size: .86rem; }
.credit-input { width: 100%; min-height: 44px; padding: .45rem .55rem; border: 1px solid #9a826d; border-radius: .25rem; background: var(--paper); color: var(--brown); }
#restore-credits { margin-top: .5rem; }
#credit-status:empty { display: none; }
#status[data-error] { color: #862f23; font-weight: 600; }

.artboard { position: relative; display: grid; place-items: center; min-height: clamp(240px, 31vw, 365px); margin-top: .95rem; padding: 1rem; background: var(--paper); border: 1px solid #bda589; color: #5d4d3d; text-align: center; }
.artboard::after { position: absolute; inset: 7px; border: 1px solid #e1d1bc; content: ''; pointer-events: none; }
.artboard img { display: block; max-width: 100%; max-height: 460px; object-fit: contain; }
.proof-options { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: .85rem; }
.proof-options [aria-pressed="true"] { background: #38291e; color: #fff3df; border-color: #38291e; }
.artboard[data-proof="leather"] { padding: 0; background: #4a2a1a; }
.artboard[data-proof="leather"]::after { border-color: #ebc49355; }
#leather-proof { display: block; width: min(100%, 460px); height: auto; }
.placeholder svg { width: 74px; color: #906e4e; }
.placeholder p { margin: .35rem 0 0; font: 1.16rem var(--display); }
.sample { margin: .25rem 0; width: min(100%, 265px); }
.sample img { width: auto; height: clamp(190px, 34vw, 308px); margin-inline: auto; mix-blend-mode: multiply; }
.sample figcaption { margin-top: .65rem; color: #67503b; }
.preview-help { margin-top: .7rem; }
.review-note { margin-top: .8rem; padding-top: .65rem; border-top: 1px solid var(--line); }
.handoff { padding-top: .75rem; margin-top: .75rem; border-top: 1px solid var(--line); }
.handoff h3 { margin: 0 0 .35rem; font: 1.45rem/1.15 var(--display); letter-spacing: -.025em; }
.actions { margin-top: .6rem; }
#artwork-reference strong { overflow-wrap: anywhere; font-family: ui-monospace, monospace; }
.stamp-size { display: grid; grid-template-columns: minmax(0, 1fr) minmax(6.5rem, .55fr); gap: .6rem; }
#stamp-request :is(input, select) { width: 100%; min-height: 44px; padding: .45rem .55rem; border: 1px solid #9a826d; border-radius: .25rem; background: var(--paper); color: var(--brown); }
#stamp-request textarea { min-height: 70px; }
#request-status:empty { display: none; }
.notice { padding: .55rem clamp(1rem, 3.4vw, 2.6rem); margin: 0; border-bottom: 1px solid var(--line); background: #e6d6bf; color: #554131; font-size: .84rem; }
.notice strong { margin-right: .35rem; }
footer { border-top: 1px solid #494038; margin-top: 1.8rem; padding-block: .9rem 1.3rem; color: #d3bca3; font-size: .78rem; }

.market-hero { padding-block: clamp(2.3rem, 6vw, 4.5rem); }
.market-hero h1 { overflow-wrap: anywhere; }
.market-banner-title { margin: 0; font: 750 .7rem/1.4 system-ui, sans-serif; letter-spacing: .17em; }
.market-link { color: var(--ivory); background: transparent; border-color: #9b7757; }
.market-link:hover { background: var(--walnut); border-color: var(--brass); }
.market-review-note { color: #d3bca3; }
.market-feedback:empty, #market-submit-status:empty, #market-review-status:empty, #market-shop-status:empty, #market-upload-status:empty { display: none; }
.market-gallery, .market-comparison, .market-tools { display: grid; gap: .9rem; }
.market-gallery { grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr)); }
.market-comparison, .market-tools { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.market-tools, .market-review { margin-top: 1.35rem; }
.market-tools > section { scroll-margin-top: 1rem; }
.market-tools > section:target { border-color: var(--brass); }
.market-tools form button { margin-top: .7rem; }
.market-tools input[type=file] { max-width: 100%; }
.market-card { overflow: hidden; border: 1px solid var(--line); border-radius: .25rem; background: var(--paper); }
.market-image { display: block; width: 100%; aspect-ratio: 1; object-fit: contain; background: #fff; }
.market-art-link { display: block; }
.market-art-link:focus-visible { outline-offset: -4px; }
.market-art-link:hover .market-image { opacity: .86; }
.market-search { margin-bottom: 1rem; }
.market-search label { margin-top: 0; }
.market-search input { flex: 1 1 15rem; }
.market-single { grid-template-columns: minmax(0, 36rem); justify-content: center; }
.market-card-details { padding: .9rem; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.market-card-details h3, .market-selection h3, #market-own-shop-name { margin: 0; font: 400 1.45rem/1.2 var(--display); }
.market-maker-link { color: #654330; font-size: .85rem; }
.market-votes { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; margin-top: .7rem; }
.market-score { min-width: 2rem; font-weight: 750; text-align: center; font-variant-numeric: tabular-nums; }
.market-votes [aria-pressed=true] { color: var(--paper); background: #4e3527; border-color: #4e3527; }
.market-submission, .market-selection { border-top: 1px solid var(--line); margin-top: 1rem; padding-top: .4rem; }
.market-submission summary { min-height: 44px; align-content: center; cursor: pointer; font-weight: 700; }
.market-consent { display: flex; align-items: flex-start; gap: .45rem; font-size: .84rem; font-weight: 500; }
.market-consent input { flex: none; margin-top: .25rem; accent-color: #5b3c2a; }
#market-review-load, #market-review-more, #market-shop-code { margin-top: .7rem; }
#market-review-queue:not(:empty) { margin-top: .75rem; max-height: 42rem; overflow-y: auto; padding: .25rem; }
.review-item { display: block; width: 100%; padding: 0; border: 0; background: transparent; color: var(--brown); cursor: pointer; text-align: left; overflow-wrap: anywhere; }
.review-item :is(strong, span), .owner-shop-link { display: block; margin: .4rem .75rem; }
.review-item:hover .market-image { opacity: .86; }
.review-item:focus-visible { outline-offset: -3px; }
.market-comparison { margin-block: .75rem; }
.market-comparison figure { margin: 0; min-width: 0; }
.market-comparison img { width: 100%; aspect-ratio: 1; object-fit: contain; display: block; background: #fff; border: 1px solid var(--line); }
.market-comparison figcaption { margin-top: .25rem; color: var(--muted); font-size: .8rem; }

@media (max-width: 740px) {
  .market-tools, .market-comparison { grid-template-columns: 1fr; }
  .masthead-inner, main, footer { width: calc(100% - 2rem); }
  .masthead-inner { min-height: 58px; }
  .hero { grid-template-columns: 1fr; gap: 1.15rem; padding-block: 1.5rem; }
  h1 { font-size: clamp(3.15rem, 11vw, 5rem); }
  .intro { margin-block: .85rem 1rem; }
  .shop-example { display: grid; grid-template-columns: minmax(75px, 34%) 1fr; align-items: center; gap: .65rem; }
  .shop-example img { height: 68px; }
  .shop-example figcaption { display: grid; justify-content: start; gap: .25rem; padding: 0; }
  .example-index { text-align: left; grid-row: 1; font-size: .62rem; }
  .workspace { grid-template-columns: 1fr; }
  .preview { border-left: 0; border-top: 1px solid var(--line); }
  #preview-title { scroll-margin-top: 1rem; }
}
@media (max-width: 390px) {
  .masthead-note { display: none; }
  .panel { padding-inline: 1rem; }
  .studio-sequence b { margin-inline: .15rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
