/* AI Custom Lab × Инвест-ёлка. Графит, тёплый белый, жёлтый акцент. Общий для гостя и оператора. */
:root {
  --bg: #161617; --panel: #1f1f21; --panel2: #29292c; --line: #37373b;
  --text: #f5f0e6; --muted: #a8a49b; --yellow: #ffdd2d; --ink: #1c1c1e; --red: #ff6b5a;
  --r: 16px; --head: "Unbounded", "Inter Tight", system-ui, sans-serif; --body: "Inter Tight", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--body); -webkit-font-smoothing: antialiased; }
body { min-height: 100dvh; }
button, input { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
.app { max-width: 560px; margin: 0 auto; padding: 0 16px 28px; min-height: 100dvh; display: flex; flex-direction: column; }

.top { display: flex; align-items: center; justify-content: space-between; padding: 14px 0 10px; gap: 12px; }
.brand { display: flex; align-items: baseline; gap: 6px; font-size: 12px; letter-spacing: .02em; white-space: nowrap; min-width: 0; }
.brand b { font-family: var(--head); font-weight: 800; font-size: 12px; letter-spacing: .03em; }
.brand span { color: var(--muted); }
.meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.demo { font-size: 10px; font-weight: 800; letter-spacing: .12em; color: var(--ink); background: var(--yellow); border-radius: 4px; padding: 3px 6px; }

.progress { margin: 2px 0 16px; }
.segs { display: flex; gap: 4px; }
.segs i { flex: 1; height: 4px; border-radius: 2px; background: var(--line); transition: background .3s; }
.segs i.on { background: var(--yellow); }
.plabel { margin-top: 8px; font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; }
.plabel b { color: var(--text); font-weight: 600; }

.view { flex: 1; display: flex; flex-direction: column; animation: in .28s ease both; }
@keyframes in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
h1, h2 { font-family: var(--head); font-weight: 800; letter-spacing: -.01em; margin: 0 0 8px; }
h1 { font-size: clamp(30px, 9vw, 42px); line-height: 1.02; }
h1 em { font-style: normal; color: var(--yellow); }
h2 { font-size: clamp(24px, 7vw, 30px); line-height: 1.08; }
.hint { color: var(--muted); font-size: 15px; line-height: 1.45; margin: 0 0 18px; }
.err { color: var(--red); font-size: 14px; min-height: 20px; margin: 8px 0 0; }

.hero { position: relative; margin: 0 -16px 22px; height: 230px; overflow: hidden; }
.hero img { width: 100%; height: 100%; object-fit: cover; object-position: 30% 50%; }
.hero.collage { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 3px; height: 260px; }
.hero.collage img { width: 100%; height: 100%; object-fit: cover; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(22,22,23,0) 40%, var(--bg) 100%); }

.field { width: 100%; background: var(--panel); border: 1.5px solid var(--line); border-radius: 12px; padding: 15px 16px; font-size: 20px; letter-spacing: .06em; outline: none; transition: border-color .2s; }
.field:focus { border-color: var(--yellow); }
.toggle { display: flex; align-items: center; gap: 12px; margin: 2px 0 12px; font-size: 17px; font-weight: 600; cursor: pointer; }
.toggle input { width: 24px; height: 24px; accent-color: var(--yellow); margin: 0; flex: none; }
#tf[hidden] { display: none; }
.field.text { letter-spacing: 0; font-size: 22px; font-weight: 700; }
.count { text-align: right; font-size: 12px; color: var(--muted); margin-top: 6px; }

.push { margin-top: auto; padding-top: 22px; display: grid; gap: 10px; }
.btn { border: 0; border-radius: 14px; padding: 17px 18px; font-size: 16px; font-weight: 700; cursor: pointer; transition: transform .12s, opacity .2s, background .2s; }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .35; cursor: default; }
.btn.main { background: var(--yellow); color: var(--ink); }
.btn.ghost { background: transparent; color: var(--text); border: 1.5px solid var(--line); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.card { position: relative; background: var(--panel); border: 2px solid transparent; border-radius: var(--r); padding: 0; overflow: hidden; text-align: left; cursor: pointer;
  transition: border-color .2s, transform .2s, box-shadow .2s; }
.card .pic { aspect-ratio: 245 / 206; background: var(--panel2); overflow: hidden; }
.card .pic img, .card .pic canvas { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s; }
.card .cap { padding: 10px 11px 12px; }
.card .note { position: absolute; top: 8px; left: 8px; padding: 3px 7px; border-radius: 6px; background: rgba(20,20,22,.72); color: #fff; font: 600 10.5px/1.2 var(--body, sans-serif); font-style: normal; letter-spacing: .02em; pointer-events: none; }
.card b { display: block; font-family: var(--head); font-weight: 800; font-size: 15px; line-height: 1.15; }
.card small { display: block; color: var(--muted); font-size: 12.5px; line-height: 1.3; margin-top: 4px; }
.card[aria-pressed="true"] { border-color: var(--yellow); box-shadow: 0 0 0 4px rgba(255,221,45,.14); }
.card[aria-pressed="true"] .pic img, .card[aria-pressed="true"] .pic canvas { transform: scale(1.04); }
.card[aria-pressed="true"]::after { content: "✓"; position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; border-radius: 50%; background: var(--yellow); color: var(--ink);
  font-weight: 900; font-size: 15px; display: grid; place-items: center; animation: pop .25s ease both; }
@keyframes pop { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
.card.wide { display: grid; grid-template-columns: 44% 1fr; align-items: center; }
.card.wide .cap { padding: 14px; }
.card.wide b { font-size: 15px; hyphens: auto; overflow-wrap: anywhere; }
.card.wide { grid-template-columns: 40% 1fr; }
.stack { display: grid; gap: 12px; }
.combo { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.combo b { color: var(--yellow); font-weight: 700; }

.preview { border-radius: 12px; overflow: hidden; margin-top: 14px; background: var(--panel); }
.preview canvas { width: 100%; display: block; }

.loading { flex: 1; display: grid; place-items: center; text-align: center; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: min(320px, 80vw); margin: 0 auto 22px; }
.tiles i { aspect-ratio: 245 / 206; border-radius: 10px; background: linear-gradient(110deg, var(--panel) 30%, var(--panel2) 50%, var(--panel) 70%); background-size: 250% 100%;
  animation: shine 1.4s linear infinite; }
.tiles i:nth-child(2) { animation-delay: .15s; } .tiles i:nth-child(3) { animation-delay: .3s; } .tiles i:nth-child(4) { animation-delay: .45s; }
@keyframes shine { from { background-position: 120% 0; } to { background-position: -120% 0; } }

.desk { padding: 26px 8px 34px; margin: 0 -16px; background: radial-gradient(120% 90% at 50% 10%, #3a3936 0%, #232325 60%, var(--bg) 100%); }
.mat { position: relative; width: 100%; aspect-ratio: 235 / 196; border-radius: 3% / 3.6%; overflow: hidden; background: #fff;
  transform: perspective(1400px) rotateX(9deg); box-shadow: 0 24px 40px rgba(0,0,0,.5), 0 2px 0 rgba(0,0,0,.4); }
.mat canvas { position: absolute; width: calc(245 / 235 * 100%); height: auto; left: calc(-5 / 235 * 100%); top: calc(-5 / 196 * 100%); }
.mat::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 2px rgba(0,0,0,.18), inset 0 0 0 3px rgba(255,255,255,.08); pointer-events: none; }
.tools { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.chip { border: 1.5px solid var(--line); background: var(--panel); border-radius: 999px; padding: 9px 14px; font-size: 14px; font-weight: 600; cursor: pointer; }

.status { text-align: center; padding-top: 8px; }
.ono { font-family: var(--head); font-weight: 800; font-size: 64px; color: var(--yellow); line-height: 1; margin: 8px 0 6px; }
.slabel { font-size: 20px; font-weight: 700; margin: 14px 0 4px; }
.keep { font-size: 16px; font-weight: 700; color: var(--yellow); margin: 6px 0 0; }
.notify-on { text-align: center; margin: 0; }
.timeline { display: flex; justify-content: space-between; margin: 22px 0 6px; position: relative; }
.timeline::before { content: ""; position: absolute; left: 6%; right: 6%; top: 7px; height: 2px; background: var(--line); }
.timeline div { position: relative; flex: 1; font-size: 11.5px; color: var(--muted); }
.timeline div i { display: block; width: 16px; height: 16px; border-radius: 50%; background: var(--line); margin: 0 auto 6px; }
.timeline div.on { color: var(--text); } .timeline div.on i { background: var(--yellow); }
.foot { font-size: 11.5px; color: #6f6c66; text-align: center; margin-top: 18px; line-height: 1.4; }
.ph-tag { position: absolute; left: 8px; bottom: 8px; font-size: 10px; letter-spacing: .08em; background: rgba(0,0,0,.55); color: #fff; border-radius: 4px; padding: 2px 5px; }
@media (min-width: 720px) { .app { padding-top: 10px; } }
@media (max-width: 400px) { .brand span { display: none; } }
/* загрузка картинки: блик по карточке и коврику */
.busy { background: linear-gradient(110deg, var(--panel) 30%, var(--panel2) 50%, var(--panel) 70%) !important; background-size: 250% 100% !important; animation: shine 1.3s linear infinite; }
.mat.busy { background: linear-gradient(110deg, #e9e4d9 30%, #f7f3ea 50%, #e9e4d9 70%) !important; background-size: 250% 100% !important; }
