:root {
  color-scheme: light;
  font-family: "DM Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #281a30;
  background: #f8f5f1;
  --ink: #281a30;
  --muted: #63576b;
  --purple: #470058;
  --deep: #320c3e;
  --gold: #dbac34;
  --line: #e5dce7;
  --white: #fffefd;
  --radius: 18px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid #8953a1;
  outline-offset: 3px;
}
h1, h2, h3, p { margin: 0; }
.wrap { width: min(1120px, calc(100% - 64px)); margin-inline: auto; }
.skip { position: fixed; top: 8px; left: 8px; z-index: 5; transform: translateY(-150%); padding: 12px; background: white; }
.skip:focus { transform: translateY(0); }

.site-header { background: #fffdf9; border-bottom: 1px solid #ede5e5; }
.header-row, .footer-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.header-row { min-height: 70px; }
.wordmark { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--deep); font-weight: 800; font-size: 1.1rem; }
.brand-mark { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; color: #f4cc72; background: var(--purple); }
.header-link { color: var(--purple); text-decoration: none; font-size: .9rem; font-weight: 750; padding-block: 10px; white-space: nowrap; }
.header-link span, .footer-row a span { margin-left: .25rem; }
.header-link:hover, .footer-row a:hover { text-decoration: underline; }

.hero { margin-top: 30px; padding: 26px 28px 26px 42px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.22fr); align-items: center; gap: 30px; border-radius: 24px; background: radial-gradient(ellipse at right center, #60216a 0%, #40094e 46%, #2d1038 100%); color: white; }
.hero h1 { font-family: Georgia, "Instrument Serif", serif; font-size: clamp(2.38rem, 5.2vw, 4.45rem); letter-spacing: -.065em; line-height: 1.03; font-weight: 500; }
.hero em { color: #f6cc71; font-weight: inherit; }
.hero p { margin-top: 15px; color: #f2e7f3; max-width: 47ch; line-height: 1.52; font-size: 1rem; }
.presets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.preset { display: flex; flex-direction: column; padding: 0; overflow: hidden; text-align: left; color: #fff8ff; background: #2d1038; border: 1px solid #a981ae; border-radius: 14px; }
.preset:hover, .preset[aria-pressed="true"] { border-color: #f6cc71; }
.preset[aria-pressed="true"] .preset-caption { box-shadow: inset 0 -2px #f6cc71; }
.preset:focus-visible { outline-color: #f6cc71; }
.preset img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; background: #472242; }
.preset[data-preset="sweater"] img { object-position: center 26%; }
#couples-card img { object-position: center 12%; }
.preset-caption { display: block; flex: 1; width: 100%; padding: 10px 13px 12px; }
.preset strong, .preset small { display: block; }
.preset strong { font-size: .93rem; }
.preset small { font-size: .76rem; margin-top: 2px; color: #e4cde8; }

.workspace { padding: 32px 0 48px; display: grid; grid-template-columns: minmax(0, 1.43fr) minmax(0, 1fr); gap: 26px; align-items: start; }
.workbook, .prompt-panel { min-width: 0; scroll-margin-top: 16px; }
.section-intro { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.section-intro h2, .prompt-header h2 { font-family: Georgia, "Instrument Serif", serif; font-weight: 600; font-size: clamp(1.65rem, 2.5vw, 2.1rem); letter-spacing: -.045em; line-height: 1.13; }
.reset { font-size: .84rem; font-weight: 730; color: var(--purple); border: 0; background: transparent; padding: 10px 0 10px 8px; white-space: nowrap; }
.reset:hover { text-decoration: underline; }

#builder { display: grid; gap: 12px; }
fieldset { min-width: 0; position: relative; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); margin: 0; padding: 49px 19px 18px; }
legend { position: absolute; top: 16px; left: 19px; padding: 0; color: var(--deep); font-weight: 780; font-size: 1.02rem; }
.portrait-type { padding-top: 17px; }
.portrait-type legend { position: static; float: left; width: 100%; margin-bottom: 12px; }
.portrait-options { clear: both; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.portrait-option { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; cursor: pointer; }
.portrait-option:hover { border-color: #a26cab; }
.portrait-option:has(input:checked) { border-color: #8a5394; background: #f7eef8; color: var(--purple); }
.portrait-option input { flex: 0 0 1rem; width: 1rem; height: 1rem; min-height: 0; margin: 0; padding: 0; accent-color: var(--purple); }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
label { min-width: 0; font-size: .82rem; font-weight: 730; color: var(--ink); }
.optional { color: var(--muted); font-size: .73rem; font-weight: 500; margin-left: .25em; }
input, select, textarea { display: block; width: 100%; color: var(--ink); border: 1px solid #d9cddb; background: #fffdff; border-radius: 9px; margin-top: 6px; padding: 9px 10px; min-height: 43px; font-size: max(16px, .92rem); font-weight: 450; }
input::placeholder, textarea::placeholder { color: #746779; opacity: 1; }
select { padding-right: 22px; }
textarea { resize: vertical; line-height: 1.42; }
.wide, #mug-field { grid-column: 1 / -1; }
.team-colors { min-width: 0; }
.color-feedback { margin-top: 6px; color: var(--muted); font-size: .78rem; line-height: 1.4; }
.color-confirmation { display: inline-flex; align-items: center; gap: 7px; min-height: 32px; margin-top: 3px; cursor: pointer; }
.color-confirmation input, .band-choice input { width: 1rem; height: 1rem; min-height: 0; flex: 0 0 1rem; margin: 0; padding: 0; accent-color: var(--purple); cursor: pointer; }
.band-choice { display: flex; align-items: center; align-self: end; gap: 8px; min-height: 43px; padding-inline: 10px; border: 1px solid var(--line); border-radius: 9px; cursor: pointer; }
.band-choice:has(input:checked) { border-color: #8a5394; background: #f7eef8; }
.field-note { max-width: 62ch; color: var(--muted); font-size: .89rem; line-height: 1.5; }
.couple-pose-layout { display: grid; grid-template-columns: minmax(0, 1fr) clamp(112px, 30%, 160px); align-items: start; gap: 15px; }
.couple-pose-fields, .couple-partners { display: grid; gap: 12px; }
.pose-example { margin: 0; }
.pose-example img { display: block; width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--line); }
.pose-example figcaption { margin-top: 7px; color: var(--muted); font-size: .76rem; line-height: 1.35; }

.prompt-panel { position: sticky; top: 18px; border: 1px solid var(--line); background: var(--white); border-radius: var(--radius); overflow: hidden; box-shadow: 0 12px 40px #3d184010; }
.prompt-header { color: white; background: var(--deep); padding: 21px 21px 20px; }
.prompt-header p { font-size: .86rem; color: #efe4f0; margin-top: 7px; }
.prompt-preview { max-height: min(375px, 42vh); overflow: auto; overscroll-behavior: contain; padding: 0 21px; scrollbar-color: #ada0b0 #f9f4fa; overflow-wrap: anywhere; }
.prompt-preview:focus-visible { outline-offset: -3px; }
.prompt-preview section { padding: 16px 0; border-bottom: 1px solid #ede7ee; }
.prompt-preview section:last-child { border-bottom: 0; }
.prompt-preview h3 { color: var(--purple); font-size: .82rem; letter-spacing: .035em; margin-bottom: 5px; }
.prompt-preview p { color: #4b3e52; font-size: .87rem; line-height: 1.56; white-space: pre-wrap; }
.prompt-actions { padding: 16px 21px 18px; border-top: 1px solid var(--line); background: #fcf8fd; }
.copy, .open { display: flex; align-items: center; justify-content: center; gap: 7px; width: 100%; min-height: 43px; font-size: .88rem; font-weight: 780; text-decoration: none; border-radius: 9px; }
.copy { border: 1px solid #cd9a25; color: #321d00; background: #f2c968; }
.copy:hover { background: #f6d58b; }
.open { color: var(--purple); border: 1px solid #ded2e0; background: var(--white); margin-top: 8px; }
.open:hover { background: #f5edf8; }
.copy-status { color: #345436; font-weight: 750; font-size: .79rem; }
.copy-status:not(:empty) { margin-top: 9px; }
.photo-note { color: var(--muted); font-size: .78rem; margin-top: 10px; line-height: 1.45; }
.photo-note a { color: var(--purple); }
.clear { margin-top: 6px; min-height: 40px; padding-inline: 0; }
.clipboard-field { position: fixed; left: -10000px; top: 0; width: 1px; height: 1px; }
.site-footer { background: #fffdf9; border-top: 1px solid #ede5e5; color: var(--muted); font-size: .83rem; }
.footer-row { padding-block: 20px; }
.footer-row a { color: var(--purple); font-weight: 750; text-decoration: none; }

@media (max-width: 830px) {
  .wrap { width: calc(100% - 40px); }
  .hero { padding: 22px; gap: 18px; }
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .prompt-panel { position: static; }
  .prompt-preview { max-height: 380px; }
}
@media (max-width: 650px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 520px) {
  .wrap { width: calc(100% - 28px); }
  .header-row { min-height: 59px; }
  .hero { margin-top: 16px; padding: 17px; border-radius: 17px; }
  .hero p { font-size: .9rem; }
  .workspace { padding: 23px 0 32px; gap: 19px; }
  .presets { gap: 8px; }
  .preset-caption { padding: 8px; }
  .preset strong { font-size: .83rem; }
  .preset small { font-size: .69rem; }
  fieldset { padding-inline: 14px; }
  legend { left: 14px; }
  .fields { grid-template-columns: minmax(0, 1fr); }
  .couple-pose-layout { grid-template-columns: minmax(0, 1fr); }
  .pose-example { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 12px; align-items: center; }
  .pose-example figcaption { margin-top: 0; }
  .footer-row { flex-wrap: wrap; }
}
