/* LOOKSI Man, прототип. Палитра из согласованного оформления: белый, графит, золото, серебро, синий, «стекло». */
:root {
  --bg: #ffffff;
  --panel: #f3f4f6;
  --ink: #1e2227;
  --muted: #5f6873;
  --line: #dfe2e6;
  --gold: #c6a355;
  --gold-text: #7d5f17;
  --on-gold: #16191d;
  /* фон золотых кнопок: темнее --gold, чтобы белый текст читался (контраст 4,6:1) */
  --gold-btn: #94701a;
  --blue: #1d4f91;
  --blue-soft: #e4ecf7;
  --glass: rgba(255, 255, 255, .72);
  --glass-line: rgba(30, 34, 39, .1);
  --ph1: #dfe3e8;
  --ph2: #aab2bc;
  --stage: #e9ebee;
  --frame: #0c0e10;
  --display: "Jost", "Futura", "Century Gothic", "Helvetica Neue", sans-serif;
  --body: "Inter", "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #16191d;
  --panel: #20242a;
  --ink: #f4f5f6;
  --muted: #a3abb5;
  --line: #323840;
  --gold: #d6b56c;
  --gold-text: #d6b56c;
  --blue: #86b4ee;
  --blue-soft: #1c2a3d;
  --glass: rgba(32, 36, 42, .62);
  --glass-line: rgba(255, 255, 255, .14);
  --ph1: #3c444e;
  --ph2: #23282e;
  --stage: #0b0d0f;
  --frame: #000000;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--stage); color: var(--ink); font-family: var(--body); font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: var(--blue); }
h1, h2, h3, h4 { font-family: var(--display); font-weight: 500; margin: 0; text-wrap: balance; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* сцена: пояснение слева, телефон справа */
.stage { min-height: 100%; display: flex; align-items: center; justify-content: center; gap: 56px; padding: 24px; }
.about { max-width: 340px; display: flex; flex-direction: column; gap: 16px; }
.about h1 { font-size: 44px; line-height: 1; letter-spacing: .04em; }
.about h1 b { font-weight: 500; color: var(--gold-text); }
.about ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; color: var(--muted); }
.about li::marker { color: var(--gold-text); }
.tag { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--gold-text); font-weight: 500; }
.fine { font-size: 13px; color: var(--muted); }
.device { flex: none; width: 390px; height: min(820px, calc(100vh - 48px)); border-radius: 46px; padding: 10px; background: var(--frame); box-shadow: 0 30px 60px rgba(12, 14, 16, .28); }
.app { position: relative; height: 100%; border-radius: 36px; overflow: hidden; background: var(--bg); display: flex; flex-direction: column; }
#view { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 18px 16px 104px; display: flex; flex-direction: column; gap: 16px; outline: none; scrollbar-width: none; }
#view::-webkit-scrollbar { display: none; }
#view > * { flex-shrink: 0; }
#view.bare { padding: 0; }

/* шапка экрана */
.top { display: flex; align-items: center; gap: 10px; min-height: 32px; }
.top h2 { font-size: 24px; line-height: 1.1; flex: 1; min-width: 0; }
.mark { font-family: var(--display); font-weight: 600; font-size: 15px; letter-spacing: .22em; flex: 1; }
.mark b { font-weight: 500; color: var(--gold-text); }
.icon-btn { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); display: grid; place-items: center; flex: none; font-size: 20px; line-height: 1; padding: 0; text-decoration: none; color: var(--ink); }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.sub { color: var(--muted); font-size: 14px; }
.h-big { font-size: 30px; line-height: 1.08; }
.between { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.between h3 { font-size: 18px; }
.link { background: none; border: 0; padding: 0; color: var(--blue); font-weight: 500; font-size: 14px; text-decoration: none; }
.badge { align-self: flex-start; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; padding: 3px 9px; border-radius: 999px; border: 1px dashed var(--muted); color: var(--muted); }

/* кнопки */
.btn { display: block; width: 100%; border: 0; border-radius: 999px; padding: 14px; text-align: center; font-weight: 600; font-size: 15px; text-decoration: none; }
.btn.gold { background: var(--gold-btn); color: #ffffff; }
.btn.line { background: transparent; border: 1px solid var(--line); color: var(--ink); }
.btn:active { transform: translateY(1px); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; margin-inline: -16px; padding-inline: 16px; scrollbar-width: none; }
.chips.scroll::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1px solid var(--line); background: var(--bg); color: var(--muted); border-radius: 999px; padding: 7px 13px; font-size: 13px; }
.chip[aria-pressed="true"] { border-color: var(--blue); background: var(--blue-soft); color: var(--blue); font-weight: 600; }
.chip .fit { color: var(--gold-text); margin-left: 4px; }
.occ { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.chip.pic { display: inline-flex; align-items: center; gap: 7px; padding: 3px 12px 3px 3px; color: var(--ink); }
.chip.pic img { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; flex: none; }
.occ .chip { border-radius: 12px; padding: 11px 6px; text-align: center; background: var(--panel); }
.occ .chip[aria-pressed="true"] { background: var(--blue-soft); }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; padding: 3px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); }
.seg button { border: 0; border-radius: 9px; padding: 8px 4px; background: transparent; color: var(--muted); font-size: 13px; }
.seg button[aria-pressed="true"] { background: var(--blue); color: var(--bg); font-weight: 600; }

/* фото и схема лица */
.photo { position: relative; overflow: hidden; border-radius: 14px; background: linear-gradient(165deg, var(--ph1), var(--ph2)); }
.photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; }
.glass { background: var(--glass); border: 1px solid var(--glass-line); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.lbl { position: absolute; top: 10px; padding: 4px 10px; border-radius: 999px; font-size: 12px; }
.lbl.l { left: 10px; }
.lbl.r { right: 10px; }

/* шторка «до и после» */
.ba { height: 260px; touch-action: pan-y; user-select: none; cursor: ew-resize; --pos: 50%; container-type: size; }
.ba .after, .ba .before { position: absolute; inset: 0; }
.ba img { pointer-events: none; -webkit-user-drag: none; }
/* загруженное фото: обычно глаза на 40% высоты снимка */
.ba img { object-position: 50% 37%; }
/* у готовых снимков лица стоят по-разному и разного размера. Каждый снимок ставим так,
   чтобы середина между глазами была на 42% высоты и по центру, а лица были одного размера.
   --fx/--fy — где глаза на снимке (доля ширины/высоты), --ar — высота/ширина, --zoom — увеличение.
   Края зажаты, чтобы снимок всегда закрывал рамку при любой её ширине. */
.ba img[src$="app/before.jpg"], .ba img[src$="app/after.jpg"] {
  inset: auto; height: auto; max-width: none; object-fit: fill;
  width: calc(var(--zoom) * 100cqw);
  left: clamp(calc(100cqw - var(--zoom) * 100cqw), calc(50cqw - var(--fx) * var(--zoom) * 100cqw), 0px);
  top: clamp(calc(100cqh - var(--ar) * var(--zoom) * 100cqw), calc(42cqh - var(--fy) * var(--ar) * var(--zoom) * 100cqw), 0px); }
.ba img[src$="app/before.jpg"] { --fx: .533; --fy: .454; --ar: 1.333; --zoom: 1; }
.ba img[src$="app/after.jpg"] { --fx: .39; --fy: .267; --ar: 1.25; --zoom: 1.3; }
.ba .before { clip-path: inset(0 calc(100% - var(--pos)) 0 0); background: linear-gradient(165deg, var(--ph1), var(--ph2)); }
.ba .after { background: linear-gradient(165deg, #b7c4d6, #5d7391); }
:root[data-theme="dark"] .ba .after { background: linear-gradient(165deg, #34475f, #1a2535); }
.ba .handle { position: absolute; top: 0; bottom: 0; left: var(--pos); width: 2px; background: #ffffff; transform: translateX(-1px); }
.ba .handle::after { content: "‹ ›"; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 38px; height: 38px; border-radius: 50%; background: #ffffff; color: #16191d; display: grid; place-items: center; font-size: 14px; font-weight: 600; box-shadow: 0 4px 12px rgba(0, 0, 0, .25); }

/* карточки и списки */
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.tile { display: flex; flex-direction: column; gap: 2px; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); text-decoration: none; color: var(--ink); text-align: left; }
.tile b { font-weight: 600; font-size: 14px; }
.tile span { color: var(--muted); font-size: 12px; }
.trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.kit { display: flex; flex-direction: column; gap: 5px; border: 0; background: none; padding: 0; text-align: center; text-decoration: none; color: var(--ink); }
.kit .photo { aspect-ratio: 3 / 4; border-radius: 12px; }
.kit span { font-size: 12px; color: var(--muted); }
.kit b { font-size: 13px; font-weight: 600; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.item { display: flex; flex-direction: column; gap: 4px; }
.item .sw { aspect-ratio: 3 / 4; border-radius: 12px; border: 1px solid var(--line); position: relative; overflow: hidden; background: var(--panel); }
.item .sw img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.item b { font-size: 14px; font-weight: 600; }
.item span { font-size: 12px; color: var(--muted); }
.list { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); background: var(--panel); width: 100%; border-inline: 0; border-top: 0; text-align: left; text-decoration: none; color: var(--ink); }
.row:last-child { border-bottom: 0; }
.row .dot { width: 44px; height: 44px; border-radius: 10px; flex: none; border: 1px solid var(--line); overflow: hidden; background: var(--panel); }
.row .dot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.row .grow { flex: 1; min-width: 0; }
.row small { display: block; color: var(--muted); font-size: 12px; }
.row .val { color: var(--muted); font-size: 13px; text-align: right; }
.row .have { color: var(--blue); font-size: 12px; font-weight: 500; }
.row .need { color: var(--gold-text); font-size: 12px; font-weight: 500; }
.row.col { flex-direction: column; align-items: stretch; }
.stat { border: 1px solid var(--gold); border-radius: 14px; padding: 14px; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.stat b { font-family: var(--display); font-weight: 500; font-size: 26px; color: var(--gold-text); }
.stat span { color: var(--muted); }
.kv { display: grid; grid-template-columns: 78px minmax(0, 1fr); gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--line); background: var(--panel); font-size: 14px; }
.kv:last-child { border-bottom: 0; }
.kv span:first-child { color: var(--muted); }

/* вердикт и переписка */
.verdict { border: 1px solid var(--line); background: var(--panel); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 6px; }
.verdict h4 { font-size: 18px; }
.verdict div { display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: 8px; font-size: 14px; }
.verdict .y { color: var(--blue); font-weight: 600; }
.verdict .n { color: var(--gold-text); font-weight: 600; }
.ask { align-self: flex-end; max-width: 85%; background: var(--blue); color: var(--bg); border-radius: 14px 14px 4px 14px; padding: 9px 13px; font-size: 14px; }
.composer { display: flex; gap: 8px; }
.composer input { flex: 1; min-width: 0; font: inherit; color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 11px 13px; }
.composer button { border: 0; border-radius: 999px; padding: 0 16px; background: var(--ink); color: var(--bg); font-weight: 600; }

/* профиль и шпаргалка */
.who { display: flex; gap: 12px; align-items: center; }
.ava { width: 52px; height: 52px; border-radius: 50%; border: 2px solid var(--gold); flex: none; }
.who b { font-family: var(--display); font-weight: 500; font-size: 20px; display: block; }
.sizes { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.4fr) minmax(0, 1fr); gap: 8px; }
.sizes div { border: 1px solid var(--line); background: var(--panel); border-radius: 12px; padding: 10px 4px; text-align: center; }
.sizes b { display: block; font-family: var(--display); font-weight: 500; font-size: 22px; line-height: 1.15; white-space: nowrap; letter-spacing: -.01em; }
.sizes span { color: var(--muted); font-size: 11px; }
.colors { display: flex; gap: 8px; align-items: center; }
.colors i { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line); }
.colors span { margin-left: auto; color: var(--muted); font-size: 13px; }
.card-big { border: 1px solid var(--gold); border-radius: 18px; padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.card-big h3 { font-size: 24px; }
.card-big .sizes b { font-size: 26px; }
@media (max-width: 359px) {
  .sizes { gap: 6px; }
  .sizes div { padding-inline: 2px; }
  .card-big .sizes b { font-size: 22px; }
}
.plan { border: 1px solid var(--line); border-radius: 14px; padding: 14px; background: var(--panel); text-align: left; display: flex; flex-direction: column; gap: 4px; width: 100%; }
.plan[aria-pressed="true"] { border-color: var(--blue); box-shadow: inset 0 0 0 1px var(--blue); }
.plan b { font-family: var(--display); font-weight: 500; font-size: 19px; }
.plan span { color: var(--muted); font-size: 13px; }
.plan .price { color: var(--gold-text); font-weight: 600; font-size: 13px; }

/* результат на весь экран */
.full { position: absolute; inset: 0; border-radius: 0; }
.over { position: absolute; top: 16px; left: 16px; right: 16px; display: flex; justify-content: space-between; }
.over .lbl { position: static; text-decoration: none; color: var(--ink); border: 1px solid var(--glass-line); }
.result-sheet { position: absolute; left: 10px; right: 10px; bottom: 10px; border-radius: 22px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.result-sheet h3 { font-size: 21px; }
.note { font-size: 12px; color: var(--muted); }

/* нижнее меню */
.tabbar { position: absolute; left: 10px; right: 10px; bottom: 10px; display: grid; grid-template-columns: repeat(5, 1fr); align-items: center; padding: 8px 4px; border-radius: 22px; background: var(--glass); border: 1px solid var(--glass-line); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); z-index: 5; }
.tabbar a { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 10px; color: var(--muted); text-decoration: none; white-space: nowrap; }
.tabbar svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.tabbar a.on { color: var(--blue); font-weight: 600; }
.tabbar .plus { width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--gold); color: var(--on-gold); display: grid; place-items: center; justify-self: center; padding: 0; }
.tabbar[hidden] { display: none; }

/* шторки и сообщения */
.scrim { position: absolute; inset: 0; background: rgba(12, 14, 16, .5); z-index: 10; }
.sheet { position: absolute; left: 10px; right: 10px; bottom: 10px; z-index: 11; border-radius: 24px; padding: 18px 16px 16px; background: var(--bg); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 12px; max-height: 80%; overflow-y: auto; }
.sheet h3 { font-size: 22px; }
.sheet .opt { display: flex; flex-direction: column; gap: 1px; padding: 12px 2px; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; width: 100%; }
.sheet .opt:last-of-type { border-bottom: 0; }
.sheet .opt b { font-weight: 600; font-size: 16px; }
.sheet .opt span { color: var(--muted); font-size: 13px; }
.sheet a.opt { color: var(--ink); text-decoration: none; }
.who a.sub { display: block; text-decoration: none; }
.kit[aria-pressed="true"] .photo { box-shadow: 0 0 0 2px var(--gold); }
.kit[aria-pressed="true"] b { color: var(--gold-text); }
.verdict .link { margin-top: 4px; }
.note .link { font-size: 12px; }
.progress { height: 6px; border-radius: 3px; background: var(--panel); overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: var(--gold); animation: fill 1.5s ease-in-out forwards; }
.copy { display: flex; gap: 8px; align-items: center; padding: 10px 12px; border: 1px dashed var(--line); border-radius: 12px; font-size: 13px; color: var(--muted); word-break: break-all; user-select: all; }
.toast { position: absolute; left: 50%; bottom: 96px; transform: translateX(-50%); z-index: 20; background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-size: 13px; font-weight: 500; white-space: nowrap; max-width: 90%; overflow: hidden; text-overflow: ellipsis; }
[hidden] { display: none !important; }
@keyframes fill { to { width: 100%; } }
@media (prefers-reduced-motion: reduce) { .progress i { animation-duration: .01s; } }

@media (max-width: 860px) {
  .about { display: none; }
}
@media (max-width: 520px) {
  .stage { padding: 0; display: block; height: 100%; }
  .device { width: 100%; height: 100dvh; border-radius: 0; padding: 0; box-shadow: none; }
  .app { border-radius: 0; }
  #view { padding-top: calc(18px + env(safe-area-inset-top, 0px)); }
  .tabbar, .sheet, .result-sheet { bottom: calc(10px + env(safe-area-inset-bottom, 0px)); }
}
