:root {
  --bg: #fff6ef;
  --card: rgba(255,255,255,.82);
  --card-strong: rgba(255,255,255,.94);
  --text: #503529;
  --muted: #866c62;
  --line: rgba(192, 121, 161, 0.18);
  --primary: linear-gradient(135deg, #d8923e, #ffbd74 55%, #e9a5a7);
  --primary-soft: #da974e;
  --shadow: 0 16px 44px rgba(140, 91, 55, 0.15);
  --radius-xl: 26px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: manipulation;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(255, 223, 189, .85), transparent 32%),
    radial-gradient(circle at top right, rgba(243, 203, 174, .65), transparent 28%),
    linear-gradient(180deg, #fffaf4, #fff0e5 60%, #fff8f0 100%);
  color: var(--text);
}
body { position: fixed; inset: 0; user-select: none; }
button, input, label { font: inherit; }
button { border: 0; cursor: pointer; }
.orientation-lock {
  position: fixed; inset: 0; display: none; place-items: center;
  background: rgba(255,245,250,.98); z-index: 150; padding: 20px;
}
.orientation-card {
  width: min(320px, 92vw); background: white; border-radius: 28px; padding: 26px 22px;
  text-align: center; box-shadow: var(--shadow);
}
.phone-emoji { font-size: 42px; margin-bottom: 8px; }
@media (orientation: landscape) { .orientation-lock { display: grid; } }
.app-shell {
  width: min(100vw, 540px);
  height: 100dvh;
  margin: 0 auto;
  padding: calc(14px + var(--safe-top)) 14px calc(14px + var(--safe-bottom));
  display: grid;
  grid-template-rows: auto auto auto 1fr auto;
  gap: 10px;
}
.app-shell.photos-view { grid-template-rows: auto auto minmax(0,1fr) auto; }
.app-shell.photos-view .hero-card { display: none; }
.app-shell.preview-view {grid-template-rows:auto auto minmax(0,1fr);}
.app-shell.preview-view .hero-card,.app-shell.preview-view .footer-note{display:none;}
.topbar, .hero-card, .tabs, .content-frame, .footer-note { min-width: 0; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
}
.brand { display:flex; align-items:center; gap:12px; }
.brand img { width: 56px; height: 56px; object-fit: cover; border-radius: 14px; outline: 2px solid #f5d2a9; box-shadow: 0 8px 20px rgba(146,96,51,.25); }
.eyebrow { margin:0 0 2px; color: var(--muted); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.brand h1 { margin:0; font-size: 23px; line-height: 1.06; white-space: nowrap; letter-spacing: -.06em; }
.hero-card {
  background: var(--card); backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,.55);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  padding: 16px;
  display:grid; gap:10px;
}
.hero-kicker { margin:0 0 6px; font-weight:700; color:#bc7941; font-size:12px; }
.hero-card h2 { margin:0; font-size:18px; line-height:1.25; }
.hero-copy { margin:6px 0 0; font-size:12px; color: var(--muted); line-height:1.45; }
.hero-pill-wrap { display:flex; gap:8px; flex-wrap:wrap; }
.hero-pill {
  display:inline-flex; align-items:center; min-height:34px; padding:0 12px; border-radius:999px;
  background: rgba(235, 171, 103, .22); color:#9c6739; font-weight:700; font-size:12px;
}
.hero-pill.alt { background: rgba(148, 188, 194, .18); color:#47797f; }
.tabs {
  display:grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
}
.tab {
  min-height: 42px; border-radius: 999px; background: rgba(255,255,255,.58);
  color: var(--muted); font-weight: 700; box-shadow: inset 0 0 0 1px var(--line);
}
.tab.active { background: white; color: #b97d45; box-shadow: 0 8px 18px rgba(171,117,70,.18); }
.content-frame {
  background: rgba(255,255,255,.62); backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,.62); border-radius: 30px;
  box-shadow: var(--shadow); padding: 12px; position: relative; overflow: hidden;
}
.panel { position: absolute; inset: 12px; display: none; grid-template-rows: auto auto 1fr auto; gap: 10px; }
.panel.active { display: grid; }
.panel-head { display:flex; align-items:flex-start; justify-content:space-between; gap: 10px; }
.panel-head.compact { margin-bottom: 4px; }
.panel-head h3 { margin:0; font-size:18px; }
.panel-head p { margin:4px 0 0; color: var(--muted); font-size:12px; line-height:1.4; }
.upload-chip, .status-chip {
  display:inline-flex; align-items:center; justify-content:center; min-height: 38px; padding: 0 14px;
  border-radius: 999px; background: rgba(255,255,255,.92); box-shadow: inset 0 0 0 1px var(--line); color:#c84b8e; font-weight:700; font-size:12px;
}
.custom-strip {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; min-height: 66px;
}
.custom-item, .empty-custom {
  border-radius: 16px; background: rgba(255,255,255,.84); box-shadow: inset 0 0 0 1px var(--line);
  position: relative; overflow:hidden; min-height: 66px;
}
.empty-custom { display:grid; place-items:center; color:var(--muted); font-size:12px; }
.custom-item img { width:100%; height:100%; object-fit:cover; }
.photo-grid {
  display:grid; grid-template-columns: repeat(5, 1fr); gap: 8px; align-content: start;
}
.photo-card, .work-card {
  position: relative; overflow: hidden; border-radius: 18px; background: var(--card-strong); box-shadow: inset 0 0 0 1px rgba(255,255,255,.6);
}
.photo-card { aspect-ratio: 4 / 5; }
.photo-card img, .work-card img { width:100%; height:100%; object-fit:cover; display:block; }
.photo-card .badge, .custom-item .badge {
  position:absolute; top:6px; left:6px; width:24px; height:24px; border-radius:999px;
  display:grid; place-items:center; font-size:11px; font-weight:800; color:white; background:rgba(83,45,71,.72); backdrop-filter: blur(8px);
}
.photo-card .label {
  position:absolute; left:6px; right:6px; bottom:6px; padding:5px 7px; border-radius: 999px; font-size: 10px; line-height: 1;
  background: rgba(255,255,255,.82); color:#6f5365; white-space: nowrap; overflow:hidden; text-overflow:ellipsis;
}
.photo-card.selected, .custom-item.selected {
  box-shadow: 0 0 0 3px rgba(255,100,172,.38), 0 12px 24px rgba(255, 118, 178, .22);
}
.photo-card.selected::after, .custom-item.selected::after {
  content: "✓"; position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; border-radius: 999px;
  display:grid; place-items:center; background:#ff63aa; color:white; font-weight:800; font-size: 12px; box-shadow: 0 6px 14px rgba(255,99,170,.3);
}
.preview-stage {
  position:relative; min-height:0; border-radius: 24px; overflow:hidden; background:linear-gradient(180deg, #ffe6f1, #fff9fc);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.7);
}
#posterCanvas { width:100%; height:100%; object-fit:contain; display:block; }
.preview-overlay {
  position:absolute; inset:0; display:grid; place-items:center; padding:24px; text-align:center; color:#8f6c80; font-size:14px; background: linear-gradient(180deg, rgba(255,255,255,.15), rgba(255,255,255,.38));
}
.action-row { display:grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; }
.primary-btn, .ghost-btn {
  min-height: 44px; border-radius: 16px; font-weight: 800; font-size: 13px;
}
.primary-btn { background: var(--primary); color:white; box-shadow: 0 16px 30px rgba(255,110,175,.28); }
.ghost-btn { background: rgba(255,255,255,.88); color:#6f5366; box-shadow: inset 0 0 0 1px var(--line); }
.ghost-btn.small { min-height: 38px; padding: 0 14px; border-radius: 999px; }
.works-grid {
  display:grid; grid-template-columns: repeat(2, 1fr); gap: 10px; align-content:start;
}
.work-card { aspect-ratio: 2 / 3; }
.work-card .work-actions {
  position:absolute; left:8px; right:8px; bottom:8px; display:grid; grid-template-columns: 1fr 1fr; gap: 6px;
}
.work-card button {
  min-height: 34px; border-radius: 12px; background: rgba(255,255,255,.9); color:#6b5162; font-size:11px; font-weight:700;
}
.footer-note { display:flex; gap:8px; flex-wrap:wrap; justify-content:center; }
.feature-pill {
  min-height:32px; padding:0 12px; display:inline-flex; align-items:center; justify-content:center; border-radius:999px;
  background: rgba(255,255,255,.7); color:#8a6a7b; font-size:11px; font-weight:700; box-shadow: inset 0 0 0 1px rgba(255,255,255,.65);
}
.toast {
  position: fixed; left: 50%; bottom: calc(24px + var(--safe-bottom)); transform: translateX(-50%);
  background: rgba(72,54,66,.9); color:white; padding:12px 16px; border-radius: 999px; font-size:12px; z-index: 40;
  box-shadow: 0 10px 24px rgba(0,0,0,.18);
}
@media (max-width: 380px) {
  .brand h1 { font-size: 20px; }
  .hero-card h2 { font-size: 16px; }
  .photo-grid { gap:6px; }
}

/* Personal device library, non-scrolling phone layout */
.gallery-toolbar {display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:24px;color:var(--muted);font-size:11px;font-weight:700;}
.gallery-toolbar>div {display:flex;align-items:center;gap:5px;}
.gallery-toolbar.right {justify-content:flex-end;}
.tiny-btn, .filter-btn {font:inherit;font-size:11px;border-radius:12px;padding:5px 8px;min-height:26px;background:#fff;color:#a44e80;border:1px solid #f7dbe9;white-space:nowrap;}
.filter-btn.active {background:#ffe1ed;border-color:#f7a8c8;color:#ca4e88;}
.tiny-btn.danger {color:#c63d65;background:#fff6f8;}
.photo-card .remove-photo, .custom-item .remove-photo {position:absolute;right:3px;bottom:3px;border-radius:99px;background:rgba(255,255,255,.97);color:#d14f79;width:25px;height:25px;border:1px solid #ffe0e8;font-weight:900;z-index:2;}
.custom-item.selected::after{right:6px;top:6px}
.custom-item .badge{z-index:1}
.works-grid {grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:1fr;min-height:0;}
.work-card {aspect-ratio:auto;min-height:0;height:100%;}
.work-card img {object-fit:contain;background:#faeefa;}
.work-card .work-actions {grid-template-columns:repeat(2,1fr);}
.work-card .work-actions button {padding:6px 2px;min-height:30px;}
.work-card .fav-toggle{position:absolute;top:8px;right:8px;width:32px;height:32px;border-radius:50%;background:#fff8;color:#d84c7a;z-index:2;}
.work-card .fav-toggle.active{background:#ff68ae;color:white;}
#photosPanel {grid-template-rows:auto auto auto auto minmax(0,1fr) auto;gap:8px;}
#worksPanel {grid-template-rows:auto auto 1fr auto;}
#previewPanel {grid-template-rows:auto 1fr auto;}
.action-row {grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;}
.action-row button {font-size:11px;min-height:40px;padding:0 4px;}
.generate-spotlight{display:block;width:100%;min-height:58px;font-weight:900;font-size:17px;letter-spacing:.02em;color:white;background:linear-gradient(115deg,#bc276c 0%,#f1568b 50%,#ef9e46 100%);border:2px solid #ffe2a0;border-radius:18px;box-shadow:0 7px 0 #9e3364,0 14px 26px rgba(184,49,114,.32);text-shadow:0 1px 1px #803659;cursor:pointer;}
.generate-spotlight:active{transform:translateY(3px);box-shadow:0 4px 0 #9e3364,0 8px 15px rgba(184,49,114,.2)}
.generate-spotlight:disabled{opacity:.6;cursor:wait;}
#generateBtn{grid-column:1/-1;min-height:58px;font-size:16px;}
.preview-stage{isolation:isolate;}
.expand-preview-btn{position:absolute;top:10px;right:10px;z-index:3;background:rgba(61,42,57,.85);color:#fff;border-radius:999px;min-height:40px;padding:0 13px;font-size:13px;font-weight:800;box-shadow:0 4px 14px #0003;}
#posterCanvas{cursor:zoom-in;}
.full-preview[hidden]{display:none!important;}
.full-preview{position:fixed;inset:0;width:100vw;height:100dvh;z-index:90;display:flex;align-items:center;justify-content:center;background:#161119;overflow:hidden;padding:calc(env(safe-area-inset-top,0px) + 52px) 0 calc(env(safe-area-inset-bottom,0px) + 72px);}
.full-preview img{display:block;max-width:100vw;max-height:100%;width:auto;height:auto;object-fit:contain;user-select:none;}
.full-close{position:absolute;top:calc(env(safe-area-inset-top,0px) + 8px);right:14px;min-height:40px;background:#fff;color:#382536;border-radius:999px;padding:0 18px;font-weight:800;z-index:2;}
.full-preview-actions{position:absolute;bottom:calc(env(safe-area-inset-bottom,0px) + 12px);left:12px;right:12px;display:grid;grid-template-columns:1fr 1fr;gap:12px;}
.full-preview-actions button{min-height:50px;border-radius:14px;background:#fbe5d5;color:#5b2b45;font-weight:900;font-size:16px;}
.custom-strip {min-height:52px;max-height:74px;}
.photo-grid {grid-template-columns:repeat(var(--photo-columns,3),minmax(0,1fr));grid-template-rows:repeat(var(--photo-rows,2),minmax(0,1fr));min-height:0;overflow:hidden;gap:10px;}
.photo-card{max-height:100%;min-height:0;aspect-ratio:auto;border-radius:16px;}
.photo-card img {object-position:center 35%;}
.photo-card .badge {top:8px;left:8px;width:29px;height:29px;font-size:13px;}
.photo-card.selected::after {top:8px;right:8px;width:30px;height:30px;font-size:15px;}
.photo-card .label {font-size:12px;font-weight:800;bottom:7px;left:7px;right:7px;padding:7px 4px;text-align:center;}
.photo-card:focus-visible {outline:3px solid #ae4e7a;outline-offset:3px;}
.preset-toolbar .tiny-btn {min-width:42px;min-height:38px;font-size:24px;font-weight:700;line-height:1;padding:0 7px;}
.preset-toolbar .tiny-btn:disabled {opacity:.33;cursor:default;}
.preset-toolbar strong {color:#a35475;white-space:nowrap;}
.works-grid{overflow:hidden;}
@media(max-height:750px){
 .app-shell {gap:6px;padding-top:calc(5px + var(--safe-top));padding-bottom:calc(5px + var(--safe-bottom));}
 .hero-card {padding:8px 12px;gap:5px;}
 .hero-card .hero-copy{display:none}
 .hero-card h2 {font-size:13px;}
 .hero-kicker{font-size:10px;margin-bottom:2px;}
 .hero-pill {min-height:22px;font-size:10px;}
 .topbar .brand img{height:37px;width:37px;}
 .brand h1 {font-size:22px;}
 .eyebrow {font-size:9px;}
 .tab{min-height:35px;}
 .footer-note{display:none}
 .content-frame {border-radius:20px;padding:8px;}
 .panel{inset:8px;gap:5px;}
 .panel-head h3{font-size:14px;}
 .panel-head p{font-size:10px;}
 .upload-chip{font-size:10px;padding:0 8px;min-height:31px;}
 .custom-strip{min-height:40px;max-height:56px;}
 .photo-grid{gap:5px;}
 .photo-card .label{font-size:10px;padding:4px 2px;}
 .preset-toolbar .tiny-btn {min-height:36px;min-width:38px;}
}
@media(max-height:580px){ .hero-card{display:none;} .brand h1{font-size:20px} .app-shell{grid-template-rows:auto auto 1fr auto;} }
@media(min-width:541px) and (orientation:portrait){.app-shell{width:min(100vw,500px)}}

.preview-overlay[hidden]{display:none!important}
.ghost-btn:disabled,.primary-btn:disabled {opacity:.5;cursor:wait}

/* Supplied 2026 carousel photograph is the brand identity. */
.brand { min-width: 0; }
.brand > div { min-width: 0; }
.brand-logo { flex: 0 0 auto; }
.hero-card { border: 1px solid rgba(225,175,116,.3); }
.hero-pill { box-shadow: inset 0 0 0 1px rgba(217,164,112,.15); }
@media (max-width: 365px) { .brand h1 { font-size: 19px; } .brand img { width: 49px; height: 49px; } .eyebrow { font-size: 9px; letter-spacing: .02em; } }
