:root {
  --accent: #7A4E63;
  --accent-ink: #fff;
  --bg: #FBF8F4;
  --surface: #FFFFFF;
  --ink: #2A2326;
  --muted: #6F6468;
  --line: #E9E1DB;
  --soft: #F4EEE8;
  --ok: #2F7A4D;   --ok-bg: #E4F2E8;
  --warn: #8A5A00; --warn-bg: #FBF0D9;
  --risk: #A2342E; --risk-bg: #FBE5E2;
  --display: 'Fraunces', Georgia, serif;
  --radius: 16px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.5 Inter, system-ui, -apple-system, 'Segoe UI', sans-serif;
}
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.15; margin: 0; }
small { color: var(--muted); font-weight: 400; }
button { font: inherit; cursor: pointer; }

/* header */
.top { padding: 28px 0 20px; border-top: 5px solid var(--accent); }
.top h1 { font-size: clamp(2rem, 6vw, 2.8rem); color: var(--ink); }
.eyebrow { margin: 0 0 4px; font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); font-weight: 600; }
.tagline { margin: 6px 0 0; color: var(--muted); max-width: 40ch; }

/* cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.brief { display: grid; gap: 18px; }
@media (min-width: 820px) {
  .brief { grid-template-columns: 1fr 1fr; align-items: start; }
  .brief .primary { grid-column: 1 / -1; justify-self: start; min-width: 260px; }
}
.field { display: grid; gap: 8px; min-width: 0; }
.field > label, .label { font-weight: 600; font-size: .95rem; }
input[type=date], select {
  font: inherit; padding: 12px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); width: 100%; min-height: 48px;
}
input:focus-visible, select:focus-visible, button:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 2px; }

.seg { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--soft); border-radius: 12px; padding: 4px; gap: 4px; }
.seg button { border: 0; background: transparent; padding: 10px 6px; border-radius: 9px; color: var(--muted); font-weight: 500; min-height: 44px; }
.seg button[aria-checked=true] { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgb(0 0 0 / .08); }

.presets { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.preset { flex: none; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 12px 6px 6px; font-size: .85rem; min-height: 40px; }
.preset .dots { display: flex; }
.preset .dots i { width: 20px; height: 20px; border-radius: 50%; border: 2px solid #fff; margin-left: -6px; box-shadow: 0 0 0 1px rgb(0 0 0 / .08); }
.preset .dots i:first-child { margin-left: 0; }

.palette { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch { position: relative; width: 52px; height: 52px; border-radius: 50%; border: 0; box-shadow: inset 0 0 0 1px rgb(0 0 0 / .12); padding: 0; }
.swatch .x { position: absolute; top: -4px; right: -4px; width: 22px; height: 22px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 13px; line-height: 22px; text-align: center; }
.swatch.add { background: var(--soft); color: var(--muted); font-size: 24px; display: grid; place-items: center; overflow: hidden; }
.swatch.add input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--soft); border: 0; border-radius: 999px; padding: 6px 12px; font-size: .88rem; min-height: 36px; }

.toggle { display: flex; align-items: center; gap: 12px; font-weight: 500; cursor: pointer; align-self: end; min-height: 44px; }
.toggle input { position: absolute; opacity: 0; }
.switch { width: 46px; height: 28px; border-radius: 999px; background: var(--line); position: relative; transition: background .2s; flex: none; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgb(0 0 0 / .2); transition: transform .2s; }
.toggle input:checked + .switch { background: var(--accent); }
.toggle input:checked + .switch::after { transform: translateX(18px); }
.toggle input:focus-visible + .switch { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 2px; }

.primary { background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 12px; padding: 14px 22px; font-weight: 600; font-size: 1rem; min-height: 52px; }
.primary:active { transform: translateY(1px); }
.ghost { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 9px 14px; font-weight: 500; font-size: .9rem; color: var(--ink); min-height: 42px; }
.ghost:disabled, .primary:disabled { opacity: .55; cursor: progress; }

/* results */
#results { display: grid; gap: 16px; margin: 20px 0; }
#results:empty { display: none; }
.season h2 { font-size: 1.45rem; }
.season p { margin: 6px 0 0; color: var(--muted); }
.notes { margin: 10px 0 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.notes li { background: var(--warn-bg); color: var(--warn); border-radius: 10px; padding: 8px 12px; font-size: .9rem; }

.checks { display: grid; gap: 12px; }
@media (min-width: 820px) { .checks { grid-template-columns: 1fr 1fr; } }
.checks h3 { font-size: 1.05rem; margin-bottom: 10px; font-family: inherit; }
.cov { display: grid; grid-template-columns: 28px 1fr; gap: 4px 10px; align-items: start; padding: 8px 0; border-top: 1px solid var(--line); }
.cov:first-of-type { border-top: 0; }
.cov i { width: 28px; height: 28px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgb(0 0 0 / .12); }
.cov b { font-weight: 600; }
.cov span { color: var(--muted); font-size: .88rem; grid-column: 2; }

.badge { display: inline-block; font-size: .72rem; font-weight: 600; letter-spacing: .02em; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.badge.R, .badge.good { background: var(--ok-bg); color: var(--ok); }
.badge.U, .badge.thin { background: var(--warn-bg); color: var(--warn); }
.badge.X, .badge.none, .badge.unavailable, .badge.wrong-color { background: var(--risk-bg); color: var(--risk); }

.concepts { display: grid; gap: 16px; }
@media (min-width: 900px) { .concepts { grid-template-columns: repeat(3, 1fr); } }
.concept { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.concept .body { padding: 16px; display: grid; gap: 12px; }
.concept h3 { font-size: 1.3rem; }
.concept .blurb { margin: 2px 0 0; color: var(--muted); font-size: .9rem; }
.meter { display: flex; align-items: center; gap: 10px; font-size: .85rem; color: var(--muted); }
.meter .bar { flex: 1; height: 6px; background: var(--soft); border-radius: 99px; overflow: hidden; }
.meter .bar i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }

.visual { position: relative; aspect-ratio: 4 / 5; background: var(--soft); display: grid; place-items: center; overflow: hidden; }
.visual.wide { aspect-ratio: 4 / 3; }
.visual img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; }
.visual .tag { position: absolute; left: 10px; top: 10px; background: rgb(255 255 255 / .92); border-radius: 999px; padding: 4px 10px; font-size: .75rem; font-weight: 600; }
.mood { width: 78%; height: 78%; }
.visual .loading { position: absolute; inset: 0; display: grid; place-items: center; background: rgb(251 248 244 / .75); font-size: .9rem; color: var(--muted); }
.visual .loading::before { content: ''; width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: spin 0.9s linear infinite; margin-bottom: 44px; position: absolute; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .visual .loading::before { animation: none; } }

.items { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.items li { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; font-size: .92rem; }
.items .dots { display: flex; }
.items .dots i { width: 16px; height: 16px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgb(0 0 0 / .12); margin-left: -4px; }
.items .dots i:first-child { margin-left: 0; }
.items .shade { color: var(--muted); }
.role { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }

.backups { border-top: 1px dashed var(--line); padding-top: 10px; display: grid; gap: 8px; }
.backups p { margin: 0; font-size: .88rem; }
.backups .swap { color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }

.must { display: grid; gap: 8px; }
.must .row { display: grid; gap: 2px; padding: 8px 0; border-top: 1px solid var(--line); font-size: .92rem; }
.must .row:first-of-type { border-top: 0; }
.must .alt { color: var(--muted); font-size: .86rem; }

.error { color: var(--risk); font-size: .88rem; margin: 0; }
.fineprint { color: var(--muted); font-size: .8rem; margin: 24px auto 40px; max-width: 70ch; text-align: center; }

dialog#viewer { border: 0; padding: 0; background: transparent; max-width: min(96vw, 900px); }
dialog#viewer::backdrop { background: rgb(20 14 16 / .8); }
dialog#viewer img { display: block; max-width: 100%; max-height: 86vh; border-radius: 12px; }
dialog#viewer form { text-align: center; margin-top: 10px; }
dialog#viewer button { background: #fff; border: 0; border-radius: 999px; padding: 8px 20px; }

/* ---------- palette: named colors ---------- */
.palette { padding-bottom: 18px; }
.swatch .sw-name { position: absolute; top: 100%; left: 50%; transform: translateX(-50%); margin-top: 3px; font-size: .68rem; color: var(--muted); white-space: nowrap; max-width: 72px; overflow: hidden; text-overflow: ellipsis; }
.swatch.add { border: 1px dashed var(--muted); }
.color-panel { border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: grid; gap: 10px; background: var(--bg); }
.color-panel input[type=search] { font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; width: 100%; min-height: 44px; background: #fff; }
.named { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 6px; max-height: 232px; overflow-y: auto; }
.named-sw { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 6px 8px; font-size: .84rem; text-align: left; min-height: 40px; }
.named-sw i { width: 22px; height: 22px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 1px rgb(0 0 0 / .12); }
.named-sw[aria-pressed=true] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.named .empty { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: .88rem; }
.custom-color { display: flex; align-items: center; gap: 10px; font-size: .86rem; color: var(--muted); }
.custom-color input { width: 44px; height: 32px; border: 1px solid var(--line); border-radius: 8px; padding: 2px; background: #fff; }

/* ---------- must-have chips ---------- */
.chip { border: 1px solid transparent; }
.chip[aria-pressed=true] { background: var(--accent); color: var(--accent-ink); }
.chip:disabled { opacity: .45; cursor: not-allowed; }

/* ---------- concept card: header first ---------- */
.concept .head { padding: 16px 16px 12px; display: grid; gap: 10px; }
.concept .head .blurb { margin-top: -6px; }
.concept .body { padding-top: 14px; }
.swatches { display: flex; gap: 4px; flex-wrap: wrap; }
.swatches i { width: 22px; height: 22px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgb(0 0 0 / .12); }
.ghost.pick[aria-pressed=true] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

.piece-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.piece-tabs button { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 8px 18px; font-weight: 500; min-height: 42px; }
.piece-tabs button[aria-pressed=true] { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ---------- full look ---------- */
#look:empty { display: none; }
#look { margin: 4px 0 20px; }
.look { display: grid; gap: 16px; border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.look-head { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: end; }
.look-head h2 { font-size: 1.5rem; }
.look-head .eyebrow { margin-bottom: 2px; }
.lineup { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (max-width: 560px) { .lineup { grid-template-columns: 1fr 1fr; } }
.slot { margin: 0; border-radius: 12px; overflow: hidden; background: var(--soft); aspect-ratio: 4 / 5; position: relative; }
.slot img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; }
.slot figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 10px 8px; font-size: .78rem; color: #fff; background: linear-gradient(transparent, rgb(0 0 0 / .6)); }
.slot.empty { border: 1px dashed var(--muted); display: grid; place-items: center; color: var(--muted); font-weight: 500; padding: 10px; text-align: center; }
.scene { position: relative; border-radius: 12px; overflow: hidden; }
.scene:empty { display: none; }
.scene img { width: 100%; display: block; cursor: zoom-in; }
.scene .tag { position: absolute; left: 10px; top: 10px; background: rgb(255 255 255 / .92); border-radius: 999px; padding: 4px 10px; font-size: .75rem; font-weight: 600; }
.scene .loading { min-height: 220px; background: var(--soft); position: relative; display: grid; place-items: center; color: var(--muted); }
.order summary { cursor: pointer; font-weight: 600; min-height: 32px; }
.order ul { margin: 8px 0 0; padding-left: 18px; display: grid; gap: 4px; font-size: .9rem; }

/* ---------- brief & flow ---------- */
.brief-title { grid-column: 1 / -1; margin: 0; }
.label.sub { font-size: .8rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .08em; margin-top: 4px; }
.pal-editor { display: grid; gap: 10px; min-width: 0; }
.pal-note { margin: 2px 0 8px; color: var(--muted); font-size: .88rem; }
.link { background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline; font: inherit; cursor: pointer; }
.sub-h { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }

.stepper { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 4px; overflow-x: auto; margin: 20px -16px 0; padding: 10px 16px; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); scrollbar-width: none; }
.stepper[hidden] { display: none; }
.stepper button { flex: none; display: inline-flex; align-items: center; gap: 8px; border: 0; background: transparent; border-radius: 999px; padding: 6px 12px 6px 6px; color: var(--muted); font-weight: 500; min-height: 40px; }
.stepper .num { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--soft); font-size: .8rem; font-weight: 600; }
.stepper button.done .num { background: color-mix(in srgb, var(--accent) 18%, #fff); color: var(--accent); }
.stepper button[aria-current=step] { background: var(--ink); color: #fff; }
.stepper button[aria-current=step] .num { background: #fff; color: var(--ink); }
.stepper .sep { flex: none; width: 14px; height: 1px; background: var(--line); }

.step-foot { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; padding: 8px 0; color: var(--muted); font-size: .92rem; }

/* image ratios match what the image model returns, so name dots land in the right place */
.visual.r43, .slot.r43 { aspect-ratio: 4 / 3; }
.visual.r32, .slot.r32 { aspect-ratio: 3 / 2; }
.lineup { align-items: start; }

/* ---------- flower name dots ---------- */
.fl-layer { position: absolute; inset: 0; pointer-events: none; }
.fl-layer.off .fl-dot { display: none; }
.fl-dot { position: absolute; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%; border: 2px solid #fff; background: color-mix(in srgb, var(--accent) 85%, transparent); box-shadow: 0 1px 4px rgb(0 0 0 / .35); padding: 0; pointer-events: auto; cursor: pointer; }
.fl-dot::after { content: ''; position: absolute; inset: 5px; border-radius: 50%; background: #fff; }
.fl-dot.hl { transform: scale(1.35); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 35%, transparent), 0 1px 4px rgb(0 0 0 / .35); }
.fl-tip { position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%); background: #fff; color: var(--ink); border-radius: 10px; padding: 6px 10px; box-shadow: 0 4px 14px rgb(0 0 0 / .2); white-space: nowrap; display: none; text-align: left; font-size: .82rem; line-height: 1.3; z-index: 2; }
.fl-tip b { display: block; font-weight: 600; }
.fl-tip small { color: var(--muted); }
.fl-dot.left .fl-tip { left: auto; right: -6px; transform: none; }
.fl-dot.below .fl-tip { bottom: auto; top: calc(100% + 8px); }
.fl-dot:hover .fl-tip, .fl-dot:focus-visible .fl-tip, .fl-dot.open .fl-tip, .fl-dot.hl .fl-tip { display: block; }
.fl-dot:hover, .fl-dot.open { z-index: 3; }
.fl-loading { position: absolute; right: 10px; bottom: 10px; background: rgb(255 255 255 / .9); border-radius: 999px; padding: 4px 10px; font-size: .75rem; color: var(--muted); }
.fl-toggle { position: absolute; right: 10px; top: 10px; border: 0; background: rgb(255 255 255 / .92); border-radius: 999px; padding: 4px 10px; font-size: .75rem; font-weight: 600; color: var(--ink); min-height: 28px; }
.fl-toggle[aria-pressed=false] { opacity: .65; }
.items li[data-flower] { cursor: default; border-radius: 8px; }
.items li[data-flower]:hover, .items li[data-flower]:focus-visible { background: var(--soft); outline: none; }
.scene { position: relative; }

/* ---------- rule out & flower guide ---------- */
.chip.no[aria-pressed=true] { background: var(--ink); color: #fff; }
.flower-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.flower-tools select { flex: 1 1 200px; width: auto; }
.fl-more { display: block; margin-top: 4px; color: var(--accent); font-weight: 600; font-size: .78rem; cursor: pointer; }
.items li[data-flower-info] { cursor: pointer; }
.items li[data-flower-info] > span:nth-child(2)::after { content: ' ›'; color: var(--muted); }

dialog#flower-dialog { width: min(96vw, 980px); max-height: 90vh; border: 0; border-radius: 16px; padding: 0; background: var(--bg); color: var(--ink); display: none; flex-direction: column; }
dialog#flower-dialog[open] { display: flex; }
dialog#flower-dialog::backdrop { background: rgb(20 14 16 / .55); }
.fd-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); background: var(--surface); }
.fd-head h2 { font-size: 1.3rem; }
.fd-head form { margin: 0; }
#fd-body { overflow-y: auto; padding: 16px; }
.fd-intro { margin: 0 0 8px; color: var(--muted); font-size: .92rem; }
.fgroup { font-family: inherit; font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 18px 0 10px; }
.fgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.fcard { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; }
.fcard img, .fcard .nophoto { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--soft); display: block; }
.fcard .nophoto { display: grid; place-items: center; color: var(--muted); }
.fbody { padding: 12px; display: grid; gap: 6px; align-content: start; }
.fbody h3 { font-size: 1.1rem; }
.fbody p { margin: 0; font-size: .88rem; }
.fbody .fnote { color: var(--muted); font-size: .8rem; }
.fcolors { display: flex; flex-wrap: wrap; gap: 4px 10px; color: var(--muted); font-size: .76rem !important; }
.fcolors span { display: inline-flex; align-items: center; gap: 4px; }
.fcolors i { width: 12px; height: 12px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgb(0 0 0 / .12); }
.fbody .actions .ghost { padding: 6px 12px; min-height: 36px; font-size: .84rem; }
.fbody .ghost.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.fbody .ghost.on.no { background: var(--ink); border-color: var(--ink); }
.credit { font-size: .72rem; color: var(--muted); }
.fsingle { max-width: 520px; margin: 0 auto; }
.fsingle .fcard img { aspect-ratio: 3 / 2; }
.fd-more { text-align: center; margin: 12px 0 0; }
.fd-filter { margin: 0 0 6px; font-size: .88rem; color: var(--muted); display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.fd-sw { display: inline-block; width: 16px; height: 16px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgb(0 0 0 / .12); vertical-align: middle; }
.fav { color: var(--accent); }

/* ---------- Flowers step ---------- */
.fsection { display: grid; gap: 12px; }
.fsec-head { display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.fsec-head h3 { font-size: 1.2rem; }
.fcount { flex: none; font-weight: 600; font-size: .85rem; color: var(--muted); background: var(--soft); border-radius: 999px; padding: 4px 12px; }
.fcount.on { color: var(--accent-ink); background: var(--accent); }
.fout summary { cursor: pointer; color: var(--muted); font-size: .9rem; margin: 4px 0 10px; }
.fout .fcard { opacity: .75; }
.fbody .ghost:disabled { opacity: .45; cursor: not-allowed; }
.owner-badge { display: inline-block; margin: 0 0 6px; font-size: .72rem; font-weight: 600; letter-spacing: .04em; color: var(--accent-ink); background: var(--accent); border-radius: 999px; padding: 2px 10px; }
