/* ---------- studio (konfigurátor) ---------- */
body.studio { background: var(--bg); }
.studio-grid { max-width: 1320px; margin: 22px auto 0; padding: 0 16px 40px; display: grid; grid-template-columns: 430px 1fr; gap: 20px; align-items: start; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 28px; padding: 26px; box-shadow: var(--shadow); min-height: calc(100vh - 140px); display: flex; flex-direction: column; }
.panel h1 { font-size: 26px; }
.panel .lead { color: var(--muted); margin: 10px 0 22px; }
.view { position: sticky; top: 96px; height: calc(100vh - 118px); min-height: 520px; border-radius: 28px; overflow: hidden; background: radial-gradient(110% 80% at 50% 22%, #FAFAF9 0%, #EBEBE9 75%); /* neutrální studio jako AI fotka */ border: 1px solid var(--line); box-shadow: var(--shadow); }
.view .viewer { position: absolute; inset: 0; }
.view-tools { position: absolute; right: 16px; bottom: 16px; display: flex; gap: 6px; padding: 6px; background: rgba(255,255,255,.88); backdrop-filter: blur(10px); border: 1px solid var(--line); border-radius: 999px; }
.view-tools button { height: 36px; padding: 0 14px; border: 0; background: transparent; border-radius: 999px; cursor: pointer; font-weight: 700; font-size: 13.5px; display: inline-flex; align-items: center; gap: 6px; transition: background .25s; }
.view-tools button:hover { background: rgba(22,23,27,.06); }
.view-tools button.on { background: var(--ink); color: #fff; }
.view-tools svg { width: 16px; height: 16px; }
.view-empty { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; color: var(--muted); padding: 30px; transition: opacity .6s var(--ease); }
.view-empty .ghost { width: 120px; height: 160px; margin: 0 auto 18px; opacity: .5; }
.view-badge { position: absolute; left: 16px; top: 16px; display: flex; align-items: center; gap: 10px; padding: 6px 14px 6px 6px; background: rgba(255,255,255,.9); border: 1px solid var(--line); border-radius: 999px; font-size: 13px; font-weight: 700; }
.view-badge img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; }

/* nahrávání */
.drop { position: relative; display: grid; justify-items: center; gap: 12px; padding: 38px 20px; border-radius: 22px; border: 2px dashed var(--line-2); background: var(--bg); text-align: center; cursor: pointer; transition: border-color .3s, background .3s, transform .3s var(--ease); }
.drop:hover, .drop.drag { border-color: var(--accent); background: var(--accent-soft); }
.drop.drag { transform: scale(1.01); }
.drop-ico { width: 64px; height: 64px; border-radius: 20px; background: #fff; display: grid; place-items: center; color: var(--accent); box-shadow: var(--shadow); }
.drop-ico svg { width: 30px; height: 30px; }
.drop b { font-size: 17px; }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.upload-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.tips { margin: 24px 0 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.tips li { display: flex; gap: 12px; align-items: flex-start; font-size: 14.5px; }
.tips li i { flex: none; width: 26px; height: 26px; border-radius: 8px; background: var(--mint); color: var(--ok); display: grid; place-items: center; }
.tips li i svg { width: 15px; height: 15px; }
.privacy { margin-top: auto; padding-top: 22px; display: flex; gap: 10px; font-size: 13px; color: var(--muted); }
.privacy svg { flex: none; width: 18px; height: 18px; color: var(--ok); }
.err { margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: #FCE5E1; color: #8A2418; font-weight: 600; font-size: 14px; }

/* generování */
.gen { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(245,242,236,.55); backdrop-filter: blur(2px); transition: opacity .6s var(--ease); }
.gen-photo { position: relative; width: min(340px, 70%); aspect-ratio: 3/4; border-radius: 24px; overflow: hidden; box-shadow: var(--shadow-lg); background: #ECE8E1; }
.gen-photo img { width: 100%; height: 100%; object-fit: contain; filter: saturate(.9); } /* celá fotka i u vysokých / širokých snímků */
.gen-photo .scan-line { animation-duration: 2.2s; }
.gen-face { position: absolute; border: 2px solid var(--accent); border-radius: 12px; box-shadow: 0 0 0 9999px rgba(22,23,27,.28); opacity: 0; transition: opacity .6s var(--ease); }
.gen-face.show { opacity: 1; }
.gen-grid { position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.18) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.18) 1px, transparent 1px); background-size: 22px 22px; opacity: 0; transition: opacity .8s var(--ease); }
.gen-grid.show { opacity: 1; }
.progress { height: 8px; border-radius: 99px; background: var(--bg-2); overflow: hidden; margin: 22px 0; }
.progress i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: inherit; transition: width .5s var(--ease); }
.gen-steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.gen-steps li { display: flex; align-items: center; gap: 12px; font-weight: 600; color: var(--muted); transition: color .4s; }
.gen-steps li .st { flex: none; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line-2); display: grid; place-items: center; transition: all .4s var(--ease); }
.gen-steps li .st svg { width: 14px; height: 14px; opacity: 0; color: #fff; stroke-width: 2.6; }
.gen-steps li.active { color: var(--ink); }
.gen-steps li.active .st { border-color: var(--accent); border-top-color: transparent; animation: spin .9s linear infinite; }
.gen-steps li.done { color: var(--ink); }
.gen-steps li.done .st { background: var(--ok); border-color: var(--ok); animation: none; }
.gen-steps li.done .st svg { opacity: 1; }
@keyframes spin { to { transform: rotate(360deg); } }

/* AI figurka */
.ai-mode [data-ai-hide] { display: none !important; }
/* hotový 3D model z Tripo: díly a barvy se neupravují, jen velikost */
.glb-mode #tabs, .glb-mode .tab-pane { display: none !important; }
.ai-mode .tabs { grid-template-columns: repeat(3, 1fr); }
.ai-box { display: grid; grid-template-columns: 120px 1fr; gap: 16px; align-items: center; margin: 16px 0 6px; padding: 14px; border-radius: 20px; background: var(--bg); border: 1px solid var(--line); animation: fadein .6s var(--ease); }
.ai-box img { width: 120px; height: 160px; object-fit: contain; border-radius: 14px; background: #fff; }
.ai-box.has-hero { grid-template-columns: 1fr; }
.ai-box.has-hero img { width: 100%; height: auto; max-height: 520px; object-fit: contain; cursor: zoom-in; }
.ai-box b { display: block; margin-bottom: 4px; }
.ai-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 12px; }
.gen-photo img.ai-reveal { animation: reveal 1s var(--ease); background: #fff; object-fit: contain; }
@keyframes reveal { from { opacity: 0; transform: scale(1.03); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
.gen-queue { margin-top: 14px; font-size: 13.5px; color: var(--muted); }

/* editor */
.ed-top { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.ed-top h1 { flex: 1; }
.notes { display: grid; gap: 6px; margin: 12px 0 4px; }
.notes div { font-size: 13.5px; padding: 9px 12px; border-radius: 10px; background: var(--sky); color: #23407A; font-weight: 600; }
.tabs { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); padding: 5px; margin: 18px 0 18px; border-radius: 999px; background: var(--bg); }
.tabs button { position: relative; z-index: 1; height: 38px; border: 0; background: none; border-radius: 999px; cursor: pointer; font-weight: 700; font-size: 14px; color: var(--muted); transition: color .35s; }
.tabs button.active { color: var(--ink); }
.tabs .pill { position: absolute; top: 5px; bottom: 5px; left: 5px; border-radius: 999px; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.08); transition: transform .45s var(--ease), width .45s var(--ease); }
.tab-pane { display: none; animation: fadein .45s var(--ease); }
.tab-pane.active { display: grid; gap: 22px; }
@keyframes fadein { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.ctl-label { display: flex; justify-content: space-between; align-items: baseline; font-weight: 800; font-size: 14px; margin-bottom: 10px; }
.ctl-label span { font-weight: 600; color: var(--muted); font-size: 13px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips button { height: 38px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--line-2); background: #fff; cursor: pointer; font-weight: 700; font-size: 13.5px; transition: all .3s var(--ease); }
.chips button:hover { border-color: rgba(22,23,27,.4); }
.chips button.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatches button, .swatches label { position: relative; width: 32px; height: 32px; border-radius: 50%; border: 0; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(0,0,0,.14); transition: transform .3s var(--ease); }
.swatches button:hover { transform: scale(1.1); }
.swatches button.active::after { content: ''; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--ink); }
.swatches label { display: grid; place-items: center; background: conic-gradient(#f55, #fd5, #5d8, #5bf, #a6f, #f55); }
.swatches label::before { content: '+'; width: 22px; height: 22px; border-radius: 50%; background: #fff; display: grid; place-items: center; font-weight: 800; font-size: 15px; line-height: 1; }
.swatches label input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.toggle-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 16px; border-radius: 16px; background: var(--bg); }
.toggle-row b { font-size: 14.5px; }
.switch { position: relative; width: 48px; height: 28px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; cursor: pointer; z-index: 1; }
.switch i { position: absolute; inset: 0; border-radius: 99px; background: var(--line-2); transition: background .3s; }
.switch i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .35s var(--ease); }
.switch input:checked + i { background: var(--accent); }
.switch input:checked + i::after { transform: translateX(20px); }
.order-box { margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line); display: grid; gap: 14px; }
.sizes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.sizes button { padding: 12px 8px; border-radius: 16px; border: 1.5px solid var(--line-2); background: #fff; cursor: pointer; text-align: center; transition: all .3s var(--ease); }
.sizes button b { display: block; font-size: 14px; }
.sizes button span { display: block; font-size: 12.5px; color: var(--muted); }
.sizes button em { display: block; font-style: normal; font-weight: 800; margin-top: 4px; }
.sizes button.active { border-color: var(--ink); box-shadow: 0 0 0 4px rgba(22,23,27,.06); }
.name-row { display: grid; gap: 6px; }
.panel-sticky { position: sticky; bottom: 0; margin: 0 -26px -26px; padding: 16px 26px 20px; background: linear-gradient(rgba(255,255,255,0), #fff 22%); border-radius: 0 0 28px 28px; }

@media (max-width: 980px) {
  .studio-grid { grid-template-columns: 1fr; gap: 14px; margin-top: 14px; }
  .view { position: relative; top: 0; height: 56vh; min-height: 380px; order: -1; }
  .panel { min-height: 0; padding: 22px 18px; }
  .panel-sticky { margin: 0 -18px -22px; padding: 14px 18px 18px; }
  .gen-photo { width: min(240px, 60%); }
}

/* ruční úprava figurky – vedlejší, sbalená volba (hlavní je figurka podle fotky) */
.customize { margin: 14px 0 4px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); transition: background .3s var(--ease); }
.customize > summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; cursor: pointer; border-radius: 18px; }
.customize > summary::-webkit-details-marker { display: none; }
.customize > summary > span { display: flex; flex-direction: column; gap: 2px; }
.customize > summary b { font-size: 14px; }
.customize > summary svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .35s var(--ease); }
.customize > summary:hover { background: var(--bg); }
.customize[open] > summary svg { transform: rotate(180deg); }
.customize[open] { background: var(--bg); }
.customize > #manual-box { padding: 4px 14px 14px; animation: fadein .45s var(--ease); }
/* ---------- produktová galerie AI figurky (samec-35, 2026-10-05) ---------- */
.pgallery { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 14px; padding: 18px; background: #fff; }
.pg-main { position: relative; flex: 1; min-height: 0; border-radius: 22px; overflow: hidden; background: #F0F0EF; /* = pozadí AI obrázku, ať nejsou vidět jeho okraje */ }
.pg-main > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; opacity: 0; transition: opacity .45s var(--ease); will-change: opacity; }
.pg-main > img.on { opacity: 1; }
.pg-main { transition: background .45s var(--ease); }
.pg-main:fullscreen { border-radius: 0; }
.pg-fs { position: absolute; right: 14px; top: 14px; width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255,255,255,.92); display: grid; place-items: center; cursor: pointer; transition: transform .2s var(--ease); }
.pg-fs:hover { transform: scale(1.06); }
.pg-fs svg { width: 18px; height: 18px; fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pg-thumbs { justify-content: center; }
.pg-thumbs img { transition: background .3s; }
@keyframes pg-in { from { opacity: 0; transform: scale(.985); } to { opacity: 1; transform: none; } }
.pg-badge { position: absolute; left: 14px; top: 14px; display: flex; align-items: center; gap: 10px; padding: 6px 14px 6px 6px; background: rgba(255,255,255,.92); border: 1px solid var(--line); border-radius: 999px; font-size: 13px; font-weight: 700; }
.pg-badge img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.pg-badge:has(img[hidden]) { padding-left: 14px; }
.pg-thumbs { display: flex; gap: 10px; }
.pg-thumbs:empty { display: none; }
.pg-thumbs button { flex: 1; max-width: 120px; border: 2px solid transparent; background: #F2F1EE; border-radius: 16px; padding: 4px 4px 6px; cursor: pointer; display: grid; gap: 4px; justify-items: center; transition: border-color .25s, transform .25s var(--ease); }
.pg-thumbs button:hover { transform: translateY(-2px); }
.pg-thumbs button.on { border-color: var(--ink); }
.pg-thumbs img { width: 100%; aspect-ratio: 1; object-fit: contain; border-radius: 12px; background: #F0F0EF; }
.pg-thumbs span { font-size: 12px; font-weight: 700; color: var(--ink-2); }
.pg-3d { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 16px; background: var(--mint, #D6EEE2); color: #145A3B; }
.pg-3d > span:last-child { display: grid; gap: 2px; font-size: 14px; }
.pg-3d .muted { color: #2F6B50; }
.pg-3d-ico { flex: none; width: 38px; height: 38px; border-radius: 12px; background: #fff; display: grid; place-items: center; }
.pg-3d-ico svg { width: 20px; height: 20px; fill: none; stroke: #145A3B; stroke-width: 1.8; stroke-linejoin: round; }
.pg-switch { position: absolute; right: 16px; top: 16px; z-index: 3; display: flex; gap: 4px; padding: 5px; background: rgba(255,255,255,.92); border: 1px solid var(--line); border-radius: 999px; }
.pg-switch button { height: 32px; padding: 0 14px; border: 0; background: transparent; border-radius: 999px; font-weight: 700; font-size: 13px; cursor: pointer; }
.pg-switch button.on { background: var(--ink); color: #fff; }
.pg-facts { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 8px; font-size: 14px; color: var(--ink-2); }
.pg-facts li { display: flex; gap: 10px; align-items: center; }
.pg-facts svg { flex: none; width: 18px; height: 18px; fill: none; stroke: var(--ok, #1E9E62); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
/* v galerii je AI obrázek velký vpravo → malý náhled v panelu je zbytečný */
.panel.ai-mode .ai-box.has-hero img { display: none; }
@media (max-width: 980px) {
  .view:has(.pgallery:not([hidden])) { height: auto; min-height: 0; }
  .pgallery { position: relative; inset: auto; padding: 12px; }
  .pg-main { aspect-ratio: 4 / 5; flex: none; }
  .pg-thumbs button { max-width: none; }
}