:root {
  --forest: #114431;
  --gold: #B8954A;
  --ink: #1A1A1A;
  --muted: #7A7A7A;
  --line: #E4E1DA;
  --bg: #F4F2EE;
  --serif: Georgia, "Times New Roman", serif;
  --sans: Calibri, Carlito, "Segoe UI", Arial, sans-serif;
  --ui: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--ui); }
button { font: inherit; cursor: pointer; border-radius: 6px; border: 1px solid var(--line); background: #fff; padding: 8px 14px; }
button.primary { background: var(--forest); border-color: var(--forest); color: #fff; font-weight: 600; }
button.primary:disabled { opacity: .6; cursor: progress; }
button.ghost { background: transparent; }
button:hover { filter: brightness(.96); }

.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
  padding: 12px 24px; background: #fff; border-bottom: 1px solid var(--line); }
.brand { height: 30px; }
.collection { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center; flex: 1; min-width: 300px; cursor: text; }
.collection .field-label { grid-row: 1 / 3; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--ink); }
.name-box { display: flex; align-items: center; gap: 8px; background: #fff; border: 1.5px solid #CFC9BD; border-radius: 8px; padding: 4px 12px; max-width: 420px; transition: .15s; }
.name-box:hover { border-color: var(--gold); }
.name-box:focus-within { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(184,149,74,.18); }
.pencil { color: var(--gold); font-size: 18px; }
.collection input { font: 24px var(--serif); color: var(--forest); letter-spacing: .1em; text-transform: uppercase;
  border: none; padding: 2px 0; width: 100%; outline: none; background: transparent; }
.collection input::placeholder { text-transform: none; letter-spacing: 0; font: italic 17px var(--serif); color: #A8A49B; }
.field-hint { font-size: 11px; color: var(--muted); padding-left: 2px; }
.collection.empty .name-box { border-color: var(--gold); animation: nudge 1.6s ease-in-out infinite; }
@keyframes nudge { 0%, 100% { box-shadow: 0 0 0 0 rgba(184,149,74,.0); } 50% { box-shadow: 0 0 0 5px rgba(184,149,74,.25); } }
.actions { display: flex; gap: 8px; }

main { max-width: 1280px; margin: 0 auto; padding: 16px 24px 80px; }
.hint { color: var(--muted); font-size: 14px; line-height: 1.5; margin: 4px 0 20px; }

.slide-card { margin-bottom: 28px; }
.slide-bar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13px; color: var(--muted);
  position: sticky; top: var(--topbar-h, 64px); z-index: 6; background: var(--bg); padding: 8px 0 6px; }
.slide-bar b { color: var(--ink); margin-right: auto; }
.slide-bar button, .slide-bar select { padding: 4px 10px; font-size: 12px; border-radius: 6px; border: 1px solid var(--line); background: #fff; font-family: inherit; }
.slide-bar select { cursor: pointer; }
.slide-bar .toggle { color: var(--muted); }
.slide-bar .toggle.on { background: #F6F1E6; border-color: var(--gold); color: #7B6330; font-weight: 600; }

/* ---- the slide: 13.333 x 7.5 in; children are positioned in % of it, text in cqw ---- */
.stage { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #fff; container-type: inline-size;
  box-shadow: 0 1px 3px rgba(0,0,0,.08), 0 8px 24px rgba(0,0,0,.06); overflow: hidden; }
.stage > * { position: absolute; }

.drop { display: flex; align-items: center; justify-content: center; text-align: center; cursor: pointer;
  color: #A8A49B; font: 600 1.05cqw var(--ui); border: 2px dashed #D9D5CC; background: #FAF9F7; transition: .15s; }
.drop:hover, .drop.over { border-color: var(--gold); color: var(--gold); background: #FBF7EE; }
.drop.filled { border: 2px solid transparent; background: transparent; }
.drop.filled:hover { border-color: var(--gold); }
.drop img { width: 100%; height: 100%; display: block; pointer-events: none; }
.drop.life img { object-fit: cover; }
.drop.prod img { object-fit: contain; }
.drop .x { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; padding: 0; border-radius: 50%;
  font-size: 13px; line-height: 20px; display: none; background: rgba(255,255,255,.9); }
.drop:hover .x { display: block; }

.t { border: 1px dashed transparent; background: transparent; outline: none; padding: 0; margin: 0; resize: none;
  font-family: var(--sans); color: var(--ink); width: 100%; }
.t:hover { border-color: #D9D5CC; }
.t:focus { border-color: var(--gold); background: #FFFDF8; }
.t::placeholder { color: #BDB8AE; }

.title { color: #fff; font-family: "Segoe UI", "Open Sans", Arial, sans-serif; white-space: nowrap; line-height: 1.33;
  letter-spacing: calc(1.5 * .10417cqw); text-shadow: 0 .1cqw .5cqw rgba(0,0,0,.35); pointer-events: none; }
.title-name { font-weight: 700; pointer-events: auto; cursor: text; }
.title-name.placeholder { opacity: .55; font-style: italic; }
.caps { font: 700 calc(6.5 * .10417cqw) var(--sans); color: var(--gold); letter-spacing: calc(2.5 * .10417cqw); text-transform: uppercase; white-space: nowrap; }
.setname { font: italic 700 calc(13 * .10417cqw) Arial, sans-serif; }
.composition { font: calc(11 * .10417cqw) / 1.17 Arial, sans-serif; overflow: hidden; }

.panel { background: #E8E2D8 url("panel-texture.jpg") center / cover; }
.card { background: #fff; border: calc(3 * .10417cqw) solid #E8E2D8; border-radius: 1.2cqw; pointer-events: none; }
.card-label { text-align: center; font-size: calc(6 * .10417cqw); }
.card-empty { text-align: center; color: #BDB8AE; font: .9cqw var(--ui); pointer-events: none; }
.add-swatch { padding: 0; font: 600 .8cqw var(--ui); border-radius: 1cqw; border: 1px dashed var(--gold); color: #7B6330; background: rgba(255,255,255,.85); }

.caprow { display: flex; gap: .3cqw; justify-content: center; }
.cap { font-size: calc(7.5 * .10417cqw); text-align: center; min-width: 0; }
.cap.code { flex: 0 0 22%; }
.cap { text-transform: uppercase; }
.cap.pname { flex: 1 1 auto; }
.cap.dims { flex: 0 0 30%; }

.swatch { border-radius: 50%; overflow: hidden; }
.swatch.drop { font-size: 1.2cqw; }
.swatch img { object-fit: cover; }
.swlabel { font-size: calc(6 * .10417cqw); color: var(--muted); text-align: center; }
.logo { pointer-events: none; }

.drop small { font-weight: 400; font-size: .7cqw; display: block; margin-top: .3cqw; }
.drop.busy { flex-direction: column; gap: .5cqw; border-style: solid; border-color: var(--gold); color: var(--gold); cursor: progress; padding: .4cqw; }
.drop.busy .msg { font-size: .75cqw; }
.spinner { width: 2cqw; height: 2cqw; border: .25cqw solid #EADFC6; border-top-color: var(--gold); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.add-row { display: flex; gap: 12px; }
.add-slide { flex: 1; padding: 18px; border: 2px dashed #D9D5CC; background: transparent; color: var(--muted); font-weight: 600; }
.add-slide:hover { border-color: var(--gold); color: var(--gold); }

.download { position: relative; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; background: #fff; border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0,0,0,.12); padding: 6px; min-width: 300px; display: flex; flex-direction: column; }
.menu[hidden] { display: none; }
.menu button { border: none; text-align: left; padding: 10px 12px; border-radius: 6px; background: transparent; }
.menu button:hover { background: #F6F1E6; filter: none; }
.menu button small { display: block; color: var(--muted); font-size: 12px; }
.menu button.all { border-top: 1px solid var(--line); border-radius: 0 0 6px 6px; margin-top: 4px; }

.modal { position: fixed; inset: 0; background: rgba(20,20,20,.45); display: grid; place-items: center; z-index: 40; padding: 16px; }
.modal[hidden] { display: none; }
.modal-card { background: #fff; border-radius: 10px; padding: 24px 28px; width: min(460px, 100%); box-shadow: 0 20px 60px rgba(0,0,0,.2); }
.modal-card p { margin: 0 0 20px; line-height: 1.5; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; }
button.danger { background: #A3362B; border-color: #A3362B; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 50; max-width: min(640px, calc(100% - 32px));
  padding: 12px 18px; border-radius: 8px; background: #1F2A24; color: #fff; box-shadow: 0 10px 30px rgba(0,0,0,.2); font-size: 14px; cursor: pointer; }
.toast[hidden] { display: none; }
.toast.error { background: #8E2C22; }
.toast.ok { background: var(--forest); }
.toast a { color: #F3D58E; }

.file-warning { background: #8E2C22; color: #fff; padding: 10px 24px; font-size: 14px; }
.file-warning[hidden] { display: none; }

/* lifestyle spot: generate / upload + versions */
.life-empty { display: flex; flex-direction: column; align-items: center; gap: 1cqw; font: 600 1cqw var(--ui); color: #A8A49B; }
.life-empty button { font: 600 1.25cqw var(--ui); padding: .8cqw 1.8cqw; border-radius: 3cqw; min-width: 22cqw; }
.life-empty button.gen { background: var(--forest); border-color: var(--forest); color: #fff; }
.life-empty button.up { background: #fff; color: var(--ink); }
.life-bar { position: absolute; left: .8cqw; bottom: .8cqw; display: none; gap: .4cqw; align-items: center; }
.drop.life:hover .life-bar { display: flex; }
.life-bar button { font: 600 .95cqw var(--ui); padding: .35cqw .9cqw; border-radius: 2cqw; background: rgba(255,255,255,.92); border: none; }
.life-bar button.nav { padding: .35cqw .7cqw; }
.life-bar .ver { font: 600 .95cqw var(--ui); color: #fff; text-shadow: 0 0 4px rgba(0,0,0,.6); padding: 0 .2cqw; }
.drop.life .x { width: 26px; height: 26px; }

.gen-card { width: min(760px, 100%); }
.gen-card h3 { margin: 0 0 6px; font: 22px var(--serif); color: var(--forest); }
.gen-card .muted { color: var(--muted); font-size: 13px; margin: 0 0 16px; line-height: 1.5; }
.gen-row { display: flex; gap: 18px; flex-wrap: wrap; }
.gen-ref { position: relative; flex: 1 1 280px; aspect-ratio: 3 / 2; border-radius: 8px; font: 600 14px var(--ui); padding: 12px; overflow: hidden; }
.gen-ref.filled { padding: 0; }
.gen-ref img { object-fit: cover; }
.gen-ref small { font-weight: 400; font-size: 12px; }
.gen-fields { flex: 1 1 280px; display: flex; flex-direction: column; gap: 12px; }
.gen-fields label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; }
.gen-fields label[hidden] { display: none; }
.gen-fields small { font-weight: 400; color: var(--muted); }
.gen-fields input, .gen-fields select { font: 14px var(--ui); padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; }
.gen-error { color: #A3362B; font-size: 13px; min-height: 1em; margin: 10px 0 0; }

/* products keep balanced proportions: the picture is placed inside its box like on the slide */
.drop.prod.filled { overflow: visible; }
.drop.prod img.placed { position: absolute; object-fit: fill; width: auto; height: auto; }
