/* Photo For Post Design — v4.0
   Media Solutions maroon on a neutral studio grey; results shown as a film contact sheet. */
:root {
  --canvas: #ECEAE7;
  --paper: #FFFFFF;
  --ink: #231F20;
  --muted: #6B6466;
  --line: #DCD7D4;
  --brand: #871622;
  --brand-deep: #5E0F18;
  --blush: #F7E8EA;
  --film: #1C191A;
  --film-edge: #E3A64B;
  --ok: #1F6B3A;
  --danger: #A31B1B;
  --r-sm: 6px;
  --r-md: 10px;
  --font-display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --font-body: "Public Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.55 var(--font-body); color: var(--ink); background: var(--canvas); }
img { max-width: 100%; display: block; }
a { color: var(--brand); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 700; line-height: 1.15; margin: 0; letter-spacing: -0.01em; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 55%, white); outline-offset: 2px; }
[hidden] { display: none !important; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: var(--r-sm);
  padding: 10px 18px; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-deep); }
.btn-primary:disabled { opacity: .6; cursor: progress; }
.btn-quiet { background: transparent; border-color: var(--line); color: var(--ink); padding: 7px 14px; font-size: 14px; }
.btn-quiet:hover { border-color: var(--brand); color: var(--brand); }
.btn-danger { background: transparent; border-color: #E8C4C4; color: var(--danger); padding: 7px 12px; font-size: 14px; }
.btn-block { width: 100%; }

/* ---------- alerts / toast ---------- */
.alert { margin: 0 0 12px; padding: 10px 14px; border-radius: var(--r-sm); font-size: 14px; }
.alert-error { background: #FBEDED; color: var(--danger); border-left: 3px solid var(--danger); }
.alert-ok { background: #EAF5EE; color: var(--ok); border-left: 3px solid var(--ok); }
.toast { position: fixed; z-index: 50; left: 50%; bottom: 24px; transform: translateX(-50%); max-width: min(640px, calc(100vw - 32px));
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: var(--r-md); box-shadow: 0 10px 30px rgba(0,0,0,.25); font-size: 14px; cursor: pointer; }
.toast[data-kind="error"] { border-left: 4px solid #F08A8A; }
.toast[data-kind="ok"] { border-left: 4px solid #7BC795; }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 20px; padding: 10px 24px; background: var(--paper); border-bottom: 1px solid var(--line); }
.topbar-logo img { height: 36px; width: auto; }
.topbar-app { font-family: var(--font-display); font-weight: 700; font-size: 17px; padding-left: 20px; border-left: 1px solid var(--line); }
.topbar-nav { display: flex; gap: 4px; margin-left: 12px; }
.topbar-nav a { color: var(--muted); text-decoration: none; padding: 6px 12px; border-radius: var(--r-sm); font-weight: 500; font-size: 14px; }
.topbar-nav a:hover { color: var(--ink); background: var(--canvas); }
.topbar-nav a[aria-current="page"] { color: var(--brand); background: var(--blush); }
.topbar-user { margin-left: auto; display: flex; gap: 14px; align-items: center; font-size: 14px; color: var(--muted); }
.topbar-user a { color: var(--ink); }

/* ---------- login ---------- */
.is-login { background: var(--paper); }
.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-panel { background: var(--brand); color: #fff; padding: clamp(32px, 6vw, 80px); display: flex; flex-direction: column; justify-content: flex-end; gap: 20px; }
.login-panel img { filter: brightness(0) invert(1); width: 150px; height: auto; margin-bottom: auto; }
.login-panel h1 { font-size: clamp(34px, 4.6vw, 60px); max-width: 12ch; letter-spacing: -0.02em; }
.login-lede { max-width: 46ch; font-size: 17px; opacity: .88; margin: 0; }
.login-form { align-self: center; justify-self: center; width: min(380px, 100% - 48px); display: flex; flex-direction: column; gap: 6px; padding: 40px 0; }
.login-form h2 { font-size: 26px; margin-bottom: 14px; }
.login-form label { font-weight: 600; font-size: 14px; margin-top: 8px; }
.login-form input { padding: 11px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: #fff; }
.login-form input:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px var(--blush); }
.login-form .btn { margin-top: 18px; padding: 12px; }
.hint { font-size: 13px; color: var(--muted); margin: 10px 0 0; }

/* ---------- studio layout ---------- */
.studio { max-width: 1320px; margin: 0 auto; padding: 24px; display: grid; grid-template-columns: minmax(280px, 340px) 1fr; gap: 20px; align-items: start; }
.panel { min-width: 0; background: var(--paper); border-radius: var(--r-md); padding: 22px; border: 1px solid var(--line); }
.panel-photos { position: sticky; top: 76px; }

.step-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 18px; }
.step-head > div { flex: 1; }
.step-head h2 { font-size: 21px; }
.step-head p { margin: 3px 0 0; color: var(--muted); font-size: 14px; }
.step-no { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--brand); color: #fff;
  font: 700 15px/1 var(--font-display); }

.empty { color: var(--muted); font-size: 14px; margin: 0; padding: 18px; border: 1px dashed var(--line); border-radius: var(--r-md); text-align: center; }
.is-loading::before { content: ""; display: inline-block; width: 14px; height: 14px; margin-right: 10px; vertical-align: -2px;
  border: 2px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.meta { font-size: 13px; color: var(--muted); margin: 10px 0 0; }

/* ---------- dropzone & sources ---------- */
.dropzone { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 26px 16px; border: 1.5px dashed #C9C1BE;
  border-radius: var(--r-md); background: #FAF9F8; cursor: pointer; text-align: center; transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.is-over { border-color: var(--brand); background: var(--blush); }
.dz-title { font-weight: 600; }
.dz-sub { font-size: 13px; color: var(--muted); }
.dz-progress { position: absolute; left: 12px; right: 12px; bottom: 10px; height: 4px; background: var(--line); border-radius: 4px; overflow: hidden; }
.dz-progress span { display: block; height: 100%; width: 0; background: var(--brand); transition: width .15s; }
.dropzone.is-busy { pointer-events: none; }

.source-grid { list-style: none; margin: 16px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.source { position: relative; aspect-ratio: 1; border-radius: var(--r-sm); overflow: hidden; background: var(--canvas); }
.source-img { all: unset; display: block; width: 100%; height: 100%; cursor: zoom-in; }
.source-img img { width: 100%; height: 100%; object-fit: cover; }
.source-remove { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgba(35,31,32,.75);
  color: #fff; font-size: 16px; line-height: 1; cursor: pointer; opacity: 0; transition: opacity .15s; }
.source:hover .source-remove, .source-remove:focus-visible { opacity: 1; }
@media (hover: none) { .source-remove { opacity: 1; } }
.scratch-card { margin-top: 18px; padding: 14px; border: 1px solid var(--line); border-radius: var(--r-md); background: #FAF9F8; }
.is-scratch .scratch-card { border-color: var(--brand); background: var(--blush); }
.scratch-note { margin: 10px 0 0; font-size: 13px; color: var(--brand-deep); }
.is-scratch .dropzone, .is-scratch .source-grid { opacity: .45; }
.set-actions { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.set-actions .reset-form { margin: 0; padding: 0; border: 0; }
.set-actions .hint { margin: 0; }
.saved-note { margin: 0; font-size: 13.5px; color: var(--ok); font-weight: 600; }
.saved-note a { font-weight: 500; }
.spot-no .is-saved { background: #2F6B45 !important; color: #fff !important; }
.spot-no .is-changed { background: #4A4345 !important; color: #EDE7E3 !important; }
.reset-form { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }

/* ---------- ideas ---------- */
.idea-columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; margin-bottom: 20px; }
.idea-col { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.idea-col legend { font-weight: 600; font-size: 13px; color: var(--muted); padding: 0; margin-bottom: 8px; }
.idea { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); cursor: pointer;
  font-size: 14px; line-height: 1.45; transition: border-color .12s, background .12s; }
.idea:hover { border-color: #BDB3B0; }
.idea input { accent-color: var(--brand); margin-top: 3px; flex: none; }
.idea:has(input:checked) { border-color: var(--brand); background: var(--blush); }

/* ---------- generate form ---------- */
.generate { border-top: 1px solid var(--line); padding-top: 18px; }
.generate[inert] { opacity: .45; }
.field-label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; padding: 0; }
.generate textarea { width: 100%; resize: vertical; min-height: 110px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-sm); line-height: 1.5; background: #fff; }
.generate textarea:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px var(--blush); }
.field-help { font-size: 13px; color: var(--muted); margin: 6px 0 18px; }
.format-row { display: flex; gap: 20px; flex-wrap: wrap; align-items: flex-end; }
.chips { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; flex: 1; min-width: 0; }
.chips legend { margin-bottom: 6px; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; cursor: pointer; }
.chip small { color: var(--muted); }
.chip input:checked + span { border-color: var(--brand); background: var(--blush); color: var(--brand-deep); }
.chip input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--brand) 55%, white); outline-offset: 2px; }
.ratio { display: inline-block; height: 14px; aspect-ratio: var(--r); border: 1.5px solid currentColor; border-radius: 2px; }
.size-select select { padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r-sm); background: #fff; }
.generate-bar { display: flex; justify-content: flex-end; align-items: center; gap: 16px; margin-top: 20px; }
.generate-status { margin: 0; font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.generate.is-busy .generate-status::before { content: ""; display: inline-block; width: 12px; height: 12px; margin-right: 8px; vertical-align: -1px;
  border: 2px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; }

/* ---------- results: the darkroom (full-width band below the studio) ---------- */
.darkroom { scroll-margin-top: 60px; background: var(--film); color: #EDE7E3; margin-top: 8px; padding: 44px 24px 64px; }
.darkroom-inner { max-width: 1320px; margin: 0 auto; }
.dr-head { display: flex; align-items: center; gap: 14px; margin-bottom: 28px; }
.dr-head > div { flex: 1; }
.dr-head h2 { font-size: 24px; }
.dr-head p { margin: 2px 0 0; color: #A69C98; font-size: 14px; }
.darkroom .step-no { background: var(--film-edge); color: var(--film); }

.dr-btn { display: inline-flex; align-items: center; justify-content: center; padding: 10px 18px; border-radius: var(--r-sm); border: 1px solid #4A4345;
  background: transparent; color: #EDE7E3; font-weight: 600; font-size: 14px; text-decoration: none; cursor: pointer; transition: border-color .15s, color .15s, background .15s; }
.dr-btn:hover { border-color: var(--film-edge); color: var(--film-edge); }
.dr-btn-primary { background: var(--film-edge); border-color: var(--film-edge); color: var(--film); }
.dr-btn-primary:hover { background: #F0B95F; color: var(--film); }
.dr-link { all: unset; cursor: pointer; color: #8F8582; font-size: 14px; padding: 10px 4px; }
.dr-link:hover { color: #F08A8A; }

.dr-empty { display: flex; align-items: center; gap: 22px; padding: 28px; border: 1px dashed #3E3739; border-radius: var(--r-md); }
.dr-empty-frame { flex: none; width: 64px; aspect-ratio: 4 / 5; border: 2px solid #4A4345; border-radius: 3px; }
.dr-empty p { margin: 0; color: #A69C98; max-width: 52ch; }

/* latest post */
.spotlight { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(300px, 1fr); gap: 40px; align-items: start; }
.spotlight .spot-img { position: sticky; top: 84px; }
.spot-img { all: unset; cursor: zoom-in; display: block; justify-self: center; aspect-ratio: var(--ar, 1); width: min(100%, calc(70vh * var(--ar, 1)));
  background: #0E0C0D; border-radius: 4px; overflow: hidden; box-shadow: 0 30px 60px -20px rgba(0,0,0,.7), 0 0 0 1px #2E2729; }
.spot-img img { width: 100%; height: 100%; object-fit: contain; }
.spot-img:focus-visible { outline: 3px solid var(--film-edge); outline-offset: 4px; }
.spot-no { display: flex; align-items: baseline; gap: 12px; margin: 0 0 14px; font: 700 15px/1 var(--font-display); color: var(--film-edge); }
.spot-no span { font: 500 12px/1 var(--font-body); color: var(--film); background: var(--film-edge); padding: 4px 8px; border-radius: 999px; }
.spot-prompt { margin: 0 0 22px; font: 500 clamp(18px, 1.7vw, 22px)/1.45 var(--font-display); color: #F5F0EC; max-width: 46ch; }
.spot-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 24px; margin: 0 0 26px; padding: 18px 0; border-top: 1px solid #332C2E; border-bottom: 1px solid #332C2E; }
.spot-meta dt { font-size: 12px; color: #8F8582; margin-bottom: 2px; }
.spot-meta dd { margin: 0; font-size: 15px; font-variant-numeric: tabular-nums; }
.spot-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* earlier posts */
.dr-sub { font: 600 14px/1 var(--font-body); color: #A69C98; margin: 52px 0 18px; padding-top: 28px; border-top: 1px solid #332C2E; }
.strip { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 28px 20px; align-items: start; }
.shot { min-width: 0; }
.shot-img { all: unset; cursor: zoom-in; position: relative; display: block; width: 100%; background: #0E0C0D; border-radius: 3px; overflow: hidden; box-shadow: 0 0 0 1px #2E2729; }
.shot-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.shot-img:hover img { transform: scale(1.03); }
.shot-img:focus-visible { outline: 3px solid var(--film-edge); outline-offset: 3px; }
.shot-no { position: absolute; left: 8px; top: 8px; font: 600 11px/1 var(--font-body); letter-spacing: .06em; color: var(--film); background: var(--film-edge); padding: 4px 6px; border-radius: 3px; }
.shot-prompt { margin: 10px 0 6px; font-size: 13px; line-height: 1.45; color: #CFC6C2; }
.shot-actions { display: flex; gap: 14px; font-size: 13px; }
.shot-actions a, .shot-actions button { all: unset; cursor: pointer; color: var(--film-edge); }
.shot-actions a:hover, .shot-actions button:hover { text-decoration: underline; }
.shot-actions button[data-remove] { color: #8F8582; margin-left: auto; }
.shot-actions button[data-remove]:hover { color: #F08A8A; }

/* ---------- studio brief: brand + occasion ---------- */
.brief { display: grid; grid-template-columns: minmax(200px, 260px) 1fr; gap: 18px 24px; padding: 16px; margin-bottom: 20px; background: #FAF9F8; border: 1px solid var(--line); border-radius: var(--r-md); }
/* searchable brand picker */
.combo { position: relative; }
.combo-input { width: 100%; padding: 9px 34px 9px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: #fff; }
.combo-input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--blush); }
.combo-clear { all: unset; cursor: pointer; position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; color: var(--muted); font-size: 16px; }
.combo-clear:hover { background: var(--canvas); color: var(--ink); }
.combo-list { position: absolute; z-index: 30; top: calc(100% + 4px); left: 0; width: max(100%, 340px); max-height: 340px; overflow-y: auto; margin: 0; padding: 4px; list-style: none;
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: 0 14px 34px rgba(35,31,32,.16); }
.combo-opt { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: var(--r-sm); cursor: pointer; }
.combo-opt.is-active, .combo-opt:hover { background: var(--blush); }
.combo-opt.is-current .combo-name { color: var(--brand); font-weight: 600; }
.combo-logo { flex: none; width: 44px; height: 28px; display: grid; place-items: center; background: #F4F2F0; border-radius: 4px; overflow: hidden; }
.combo-logo img { width: 100%; height: 100%; object-fit: contain; padding: 2px; }
.combo-name { flex: 1; min-width: 0; font-size: 14px; display: flex; flex-direction: column; }
.combo-name small { font-size: 12px; color: var(--muted); text-align: start; }
.combo-opt em { font-style: normal; font-size: 11px; color: var(--muted); }
.combo-empty, .combo-more { padding: 10px; font-size: 13px; color: var(--muted); }

/* brands page search */
.brand-search { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.brand-search input { flex: 1; max-width: 520px; padding: 11px 14px; border: 1px solid var(--line); border-radius: var(--r-sm); background: #fff; font-size: 15px; }
.brand-search input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--blush); }
#ownerFilter { padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: #fff; max-width: 260px; }
.brand-count { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.brand-item[hidden] { display: none; }
.brief-brand select { width: 100%; padding: 9px 10px; border: 1px solid var(--line); border-radius: var(--r-sm); background: #fff; }
.brief-manage { display: inline-block; margin-top: 6px; font-size: 13px; }
.occasions { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.occasions legend { margin-bottom: 6px; }
.occ input { position: absolute; opacity: 0; pointer-events: none; }
.occ span { display: inline-block; padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; cursor: pointer; background: #fff; }
.occ input:checked + span { border-color: var(--brand); background: var(--brand); color: #fff; }
.occ input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--brand) 55%, white); outline-offset: 2px; }
.brief-occ { display: flex; flex-direction: column; min-width: 0; }
.brief-occ select { width: 100%; padding: 9px 10px; border: 1px solid var(--line); border-radius: var(--r-sm); background: #fff; }
.brief-occ-desc { margin-top: 6px; font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.brief-note { grid-column: 1 / -1; margin: 0; font-size: 13px; color: var(--brand-deep); }
.linklike { all: unset; cursor: pointer; color: var(--brand); text-decoration: underline; font-weight: 600; }

/* ---------- generate options: image text + caption form ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.opt-row { margin-top: 20px; }
.opt { border: 0; margin: 0; padding: 0; min-width: 0; }
.seg-light { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; background: #fff; }
.seg-light label { position: relative; }
.seg-light input { position: absolute; opacity: 0; pointer-events: none; }
.seg-light span { display: block; padding: 8px 14px; font-size: 13px; font-weight: 500; cursor: pointer; border-right: 1px solid var(--line); }
.seg-light label:last-child span { border-right: 0; }
.seg-light input:checked + span { background: var(--brand); color: #fff; }
.seg-light input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--brand) 55%, white); outline-offset: -3px; }
.headline-field { margin-top: 10px; }
.headline-field input { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); }
.headline-field .field-help { margin: 6px 0 0; }

.cap-toggle { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.switch { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; }
.switch-ui { flex: none; width: 42px; height: 24px; border-radius: 999px; background: #CFC8C5; position: relative; transition: background .15s; }
.switch-ui::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + .switch-ui { background: var(--brand); }
.switch input:checked + .switch-ui::after { transform: translateX(18px); }
.switch input:focus-visible + .switch-ui { outline: 3px solid color-mix(in srgb, var(--brand) 55%, white); outline-offset: 2px; }
.switch strong { display: block; font-size: 14px; }
.switch small { display: block; font-size: 13px; color: var(--muted); }
.cap-form { border: 1px solid var(--line); border-radius: var(--r-md); background: #FAF9F8; padding: 16px; margin: 14px 0 0; min-width: 0; }
.cap-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.cap-grid > label, .cap-field { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 600; min-width: 0; }
.cap-grid input, .cap-grid select { padding: 9px 10px; border: 1px solid var(--line); border-radius: var(--r-sm); background: #fff; font-weight: 400; width: 100%; }
.cap-grid .span-2 { grid-column: 1 / -1; }
.cap-label { display: block; }
.cap-form .field-help { margin: 12px 0 0; }

/* ---------- darkroom tools: caption, logo, refine ---------- */
.caption, .logo-tools, .refine { margin-top: 26px; padding-top: 22px; border-top: 1px solid #332C2E; }
.caption h3, .logo-tools h3, .refine h3 { font: 600 14px/1 var(--font-body); color: #A69C98; margin: 0; }
.caption-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.caption-head .dr-link { padding: 0; color: var(--film-edge); }
.cap-block { position: relative; background: #252022; border-radius: var(--r-sm); padding: 14px 16px 14px; margin-bottom: 10px; }
.cap-block p { margin: 0 0 8px; font-size: 15px; line-height: 1.6; color: #F2ECE8; }
.cap-block[dir="rtl"] p { font-family: "Noto Kufi Arabic", "Segoe UI", Tahoma, sans-serif; font-size: 16px; line-height: 1.8; }
.copy { all: unset; cursor: pointer; font-size: 12px; font-weight: 600; color: var(--film-edge); }
.copy:hover { text-decoration: underline; }
.cap-title { font-weight: 700; font-size: 16.5px !important; color: #FFFFFF !important; margin-bottom: 10px !important; }
.cap-block[dir="rtl"] .cap-title { font-size: 17.5px !important; }
.cap-points { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 4px; font-size: 15px; color: #F2ECE8; }
.cap-block[dir="rtl"] .cap-points { font-family: "Noto Kufi Arabic", "Segoe UI", Tahoma, sans-serif; }
.cap-end { font-weight: 600; }
.cap-footer { font-size: 13.5px !important; color: #CFC6C2 !important; padding-top: 8px; border-top: 1px dashed #3E3739; }
.tag-head { margin: 14px 0 8px; font-size: 12px; color: #8F8582; }
.tag-head b { color: var(--film-edge); font-weight: 600; margin-inline-start: 4px; }
.tag-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tag { display: inline-flex; align-items: center; gap: 2px; background: #2E2729; border: 1px solid #3E3739; border-radius: 999px; padding: 3px 4px 3px 10px; font-size: 13px; color: #EDE7E3; }
.cap-block[dir="rtl"] .tag { padding: 3px 10px 3px 4px; font-family: "Noto Kufi Arabic", "Segoe UI", Tahoma, sans-serif; }
.tag button { all: unset; cursor: pointer; width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; color: #8F8582; font-size: 14px; }
.tag button:hover { background: #4A2A2E; color: #F08A8A; }
.tag button:focus-visible { outline: 2px solid var(--film-edge); }
.tag-add { display: flex; gap: 6px; margin: 10px 0 12px; }
.tag-add input { flex: 1; min-width: 0; padding: 7px 10px; background: #1C191A; color: #F2ECE8; border: 1px solid #4A4345; border-radius: var(--r-sm); font-size: 13px; }
.tag-add input:focus { outline: none; border-color: var(--film-edge); }
.tag-add button { all: unset; cursor: pointer; padding: 7px 12px; border: 1px solid #4A4345; border-radius: var(--r-sm); font-size: 13px; color: var(--film-edge); font-weight: 600; }
.tag-add button:hover { border-color: var(--film-edge); }
.cap-none { margin: 0; font-size: 13.5px; color: #A69C98; }
.cap-tags { margin: 4px 0 0; font-size: 13px; color: #CFC6C2; line-height: 1.7; word-spacing: 4px; }
.cap-wait { margin: 0; font-size: 14px; color: #A69C98; }
.cap-wait::before { content: ""; display: inline-block; width: 12px; height: 12px; margin-right: 10px; vertical-align: -1px; border: 2px solid #4A4345; border-top-color: var(--film-edge); border-radius: 50%; animation: spin .8s linear infinite; }
.cap-wait.is-error { color: #F0A0A0; }
.cap-wait.is-error::before { display: none; }

.logo-tools { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.logo-tools h3 { margin-right: auto; }
.seg { display: inline-flex; border: 1px solid #4A4345; border-radius: var(--r-sm); overflow: hidden; }
.seg-btn { all: unset; cursor: pointer; width: 40px; height: 34px; display: grid; place-items: center; font-size: 12px; font-weight: 600; color: #CFC6C2; border-right: 1px solid #4A4345; }
.seg-btn:last-child { border-right: 0; width: 46px; }
.seg-btn:hover { background: #2A2426; }
.seg-btn.is-on { background: var(--film-edge); color: var(--film); }
.seg-btn:focus-visible { outline: 2px solid var(--film-edge); outline-offset: -2px; }
.seg-btn:disabled { opacity: .5; cursor: progress; }
.corner { position: relative; width: 16px; height: 16px; border: 1.5px solid currentColor; border-radius: 2px; }
.corner::after { content: ""; position: absolute; width: 6px; height: 6px; background: currentColor; }
.corner-tl::after { top: 1px; left: 1px; } .corner-tr::after { top: 1px; right: 1px; }
.corner-bl::after { bottom: 1px; left: 1px; } .corner-br::after { bottom: 1px; right: 1px; }
.badge-tools { flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 4px; }
.badge-label { font-size: 13px; color: #A69C98; margin-right: auto; }
.badge-swatches { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sw { all: unset; cursor: pointer; position: relative; width: 30px; height: 30px; border-radius: 8px; background: var(--c, transparent);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.18); display: grid; place-items: center; }
.sw.is-on { box-shadow: 0 0 0 2px var(--film), 0 0 0 4px var(--film-edge); }
.sw:focus-visible, .sw-pick:focus-within { outline: 2px solid var(--film-edge); outline-offset: 3px; }
.sw.is-busy { opacity: .6; pointer-events: none; }
.sw-none { width: auto; padding: 0 10px; background: transparent; box-shadow: inset 0 0 0 1px #4A4345; font-size: 12px; font-weight: 600; color: #CFC6C2; }
.sw-pick { background: conic-gradient(#E3A64B, #871622, #1F6B3A, #2D5BB8, #E3A64B); }
.sw-pick.is-on { background: var(--c); }
.sw-pick input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; padding: 0; }
.sw-pick span { color: #fff; font-weight: 700; text-shadow: 0 1px 2px rgba(0,0,0,.6); pointer-events: none; }
.badge-alpha { display: flex; align-items: center; gap: 10px; font-size: 13px; color: #A69C98; }
.badge-alpha[hidden] { display: none; }
.badge-alpha input { width: 140px; accent-color: var(--film-edge); }
.badge-alpha output { min-width: 4ch; color: #EDE7E3; font-variant-numeric: tabular-nums; }
.seg-btn.is-busy { opacity: .6; pointer-events: none; }
.dr-select { padding: 8px 10px; background: #252022; color: #EDE7E3; border: 1px solid #4A4345; border-radius: var(--r-sm); }

.refine-title { font: 600 15px/1.2 var(--font-display) !important; color: #F5F0EC !important; margin: 0 0 8px !important; }
.refine-title label { cursor: pointer; }
.refine-intro { margin: 0 0 12px; font-size: 13.5px; line-height: 1.55; color: #CFC6C2; max-width: 52ch; }
.refine-intro strong { color: var(--film-edge); font-weight: 600; }
.refine-examples { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.refine-chip { all: unset; cursor: pointer; font-size: 12.5px; padding: 6px 11px; border-radius: 999px; border: 1px solid #4A4345; color: #CFC6C2; }
.refine-chip:hover { border-color: var(--film-edge); color: var(--film-edge); }
.refine-chip:focus-visible { outline: 2px solid var(--film-edge); outline-offset: 2px; }
.refine-row { display: flex; gap: 8px; }
.refine-row input { flex: 1; min-width: 0; padding: 10px 12px; background: #252022; color: #F2ECE8; border: 1px solid #4A4345; border-radius: var(--r-sm); }
.refine-row input::placeholder { color: #7F7573; }
.refine-row input:focus { outline: none; border-color: var(--film-edge); }
.refine-status { margin: 8px 0 0; font-size: 12.5px; color: #8F8582; font-variant-numeric: tabular-nums; }
.refine.is-busy .refine-status { color: var(--film-edge); }

.shot.is-focus .shot-img { box-shadow: 0 0 0 2px var(--film-edge); }
a.shot-img { cursor: pointer; }

/* ---------- website & social links ---------- */
.socials { display: flex; flex-direction: column; gap: 8px; font-weight: 400; }
.social-list { display: flex; flex-direction: column; gap: 8px; }
.social-row { display: grid; grid-template-columns: minmax(150px, 200px) minmax(0, 1fr) 36px; gap: 8px; align-items: center; }
.social-row select, .social-row input { width: 100%; padding: 9px 10px; border: 1px solid var(--line); border-radius: var(--r-sm); background: #fff; font-weight: 400; }
.social-remove { all: unset; cursor: pointer; width: 36px; height: 36px; display: grid; place-items: center; border-radius: var(--r-sm); color: var(--muted); font-size: 18px; }
.social-remove:hover { background: #FBEDED; color: var(--danger); }
.social-remove:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 55%, white); }
.social-add { all: unset; cursor: pointer; align-self: flex-start; font-size: 13px; font-weight: 600; color: var(--brand); padding: 6px 2px; }
.social-add:hover { text-decoration: underline; }
.field-block { margin-top: 18px; }
.field-block .field-label { margin-bottom: 8px; }

/* ---------- brand kits page ---------- */
.brand-logo-row { display: flex; gap: 18px; align-items: center; margin: 18px 0; min-width: 0; }
.brand-logo-row .grow { flex: 1; display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 600; }
.brand-logo-row .help { font-weight: 400; color: var(--muted); font-size: 12.5px; }
.logo-preview { position: relative; flex: none; width: 120px; height: 72px; display: grid; place-items: center; overflow: hidden; border-radius: var(--r-sm); padding: 8px;
  background-color: #fff; background-image: conic-gradient(#EEE 25%, #fff 0 50%, #EEE 0 75%, #fff 0); background-size: 14px 14px; border: 1px solid var(--line); }
.logo-preview.is-dark { background: #231F20; }
.logo-preview-lg { width: 180px; height: 110px; }
.logo-preview.is-new { box-shadow: 0 0 0 2px var(--brand); }
.logo-colors { margin-top: 4px; font-weight: 400; }
.color-field.is-filled input:not([type=color]) { border-color: var(--brand); box-shadow: 0 0 0 3px var(--blush); transition: box-shadow .3s; }
/* the logo always fits inside the box, whatever its size or shape */
.logo-preview img { position: absolute; inset: 8px; width: calc(100% - 16px); height: calc(100% - 16px); max-width: none; object-fit: contain; }
.logo-preview span { font-size: 12px; color: var(--muted); }
.color-field, .range-field { display: flex; gap: 8px; align-items: center; }
.color-field input[type=color] { width: 42px; height: 38px; padding: 2px; border: 1px solid var(--line); border-radius: var(--r-sm); background: #fff; flex: none; }
.color-field input:not([type=color]) { flex: 1; min-width: 0; font-family: inherit; text-transform: uppercase; }
.range-field input { flex: 1; accent-color: var(--brand); }
.range-field output { font-weight: 600; min-width: 3ch; font-variant-numeric: tabular-nums; }
.brand-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.brand-item { display: flex; align-items: center; gap: 18px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px 16px; }
.brand-text { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.brand-text strong { font-family: var(--font-display); font-size: 17px; }
.brand-text span[dir=rtl] { color: var(--muted); text-align: start; }
.swatches { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.swatches i { width: 16px; height: 16px; border-radius: 50%; border: 1px solid rgba(0,0,0,.15); }
.swatches small { color: var(--muted); margin-left: 4px; }

/* ---------- brand kit saved work ---------- */
.crumb { margin: 0 0 6px !important; font-size: 13px; }
.muted-ar { font-size: .6em; color: var(--muted); font-weight: 500; margin-inline-start: 8px; }
.work-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; align-items: start; }
.work-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.work-card[hidden] { display: none; }
.work-img { display: block; background: #F1EFED; }
.work-img img { width: 100%; height: 100%; object-fit: cover; }
.work-body { padding: 12px 14px 14px; }
.work-meta { margin: 0 0 6px; font-size: 12px; color: var(--muted); }
.work-prompt { margin: 0 0 10px; font-size: 13.5px; line-height: 1.45; }
.work-cap summary { font-size: 13px; font-weight: 600; color: var(--brand); cursor: pointer; margin-bottom: 8px; }
.work-cap-block { background: #FAF9F8; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 12px; margin-bottom: 8px; }
.work-cap-block p { margin: 0 0 6px; font-size: 13px; line-height: 1.6; }
.work-cap-block[dir=rtl] p { font-family: "Noto Kufi Arabic", "Segoe UI", Tahoma, sans-serif; }
.work-open { margin: 0 0 10px; }
.kit-note { margin: 0 0 12px; font-size: 12.5px; line-height: 1.5; color: #CFC6C2; background: #2A2426; border-left: 3px solid var(--film-edge); padding: 8px 10px; border-radius: 4px; }
.work-actions { display: flex; align-items: center; gap: 14px; font-size: 13.5px; }
.work-actions form { margin-left: auto; }
.linklike.danger { color: var(--danger); text-decoration: none; font-weight: 500; }
.work-by { margin: 8px 0 0; font-size: 11.5px; color: var(--muted); }

/* ---------- lightbox ---------- */
#lightbox { padding: 0; border: 0; background: transparent; max-width: 94vw; max-height: 92vh; overflow: visible; }
#lightbox::backdrop { background: rgba(20,17,18,.86); }
#lightbox img { max-width: 94vw; max-height: 92vh; border-radius: 4px; }
.lb-close { position: absolute; top: -14px; right: -14px; width: 34px; height: 34px; border-radius: 50%; border: 0; background: #fff; font-size: 20px; cursor: pointer; }

/* ---------- admin pages (reporting, users, models) ---------- */
.page { max-width: 1180px; margin: 0 auto; padding: 28px 24px 60px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 { font-size: 30px; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-bottom: 20px; }
.filters label, .form-grid label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 600; }
.filters input, .filters select, .form-grid input, .form-grid select, .inline-form input { padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r-sm); background: #fff; font-weight: 400; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; margin-bottom: 24px; }
.stat { background: var(--paper); padding: 16px 18px; }
.stat b { display: block; font: 700 28px/1.1 var(--font-display); font-variant-numeric: tabular-nums; }
.stat span { font-size: 13px; color: var(--muted); }
.table-wrap { overflow-x: auto; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-md); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid #EEEAE8; vertical-align: top; }
th { font-size: 13px; color: var(--muted); font-weight: 600; background: #FAF9F8; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr:last-child td { border-bottom: 0; }
.bar { display: inline-block; height: 8px; border-radius: 4px; background: var(--brand); vertical-align: middle; margin-left: 8px; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-md); padding: 22px; margin-bottom: 20px; }
.card h2 { font-size: 19px; margin-bottom: 14px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.form-grid .help { font-weight: 400; color: var(--muted); font-size: 12.5px; }
.inline-form { display: inline-flex; gap: 6px; }
.row-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.check { display: flex !important; flex-direction: row !important; align-items: center; gap: 8px; }
.test-list { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 8px; font-size: 14px; }
.test-list li { padding: 10px 12px; border-radius: var(--r-sm); background: #FAF9F8; border-left: 3px solid var(--line); }
.test-list li.ok { border-left-color: var(--ok); }
.test-list li.bad { border-left-color: var(--danger); }
details summary { cursor: pointer; color: var(--brand); font-size: 13px; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .studio { grid-template-columns: minmax(0, 1fr); padding: 14px; }
  .panel { padding: 16px; }
  .step-head { flex-wrap: wrap; }
  .darkroom { padding: 32px 14px 48px; }
  .spotlight { grid-template-columns: 1fr; gap: 24px; }
  .spotlight .spot-img { position: static; }
  .brief { grid-template-columns: 1fr; }
  .cap-grid { grid-template-columns: 1fr; }
  .social-row { grid-template-columns: minmax(0, 1fr) 36px; }
  .social-row input { grid-column: 1; }
  .social-row .social-remove { grid-row: 1 / span 2; grid-column: 2; }
  .brand-item { flex-wrap: wrap; }
  .refine-row { flex-direction: column; }
  .spot-img { width: 100%; }
  .strip { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 12px; }
  .dr-head { flex-wrap: wrap; }
  .panel-photos { position: static; }
  .login { grid-template-columns: 1fr; }
  .login-panel { min-height: 0; padding: 36px 24px; }
  .topbar { flex-wrap: wrap; gap: 10px; padding: 10px 14px; }
  .topbar-app { display: none; }
  .topbar-nav { order: 3; width: 100%; margin: 0; overflow-x: auto; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
