/* Клиентский сайт «В Образе». Отдельный файл: стили операторской (app.css) не затрагиваются. */
:root {
  --bg: #F8F3EB;
  --surface: #FFFCF8;
  --sand: #E7D7C4;
  --sand-soft: #F1E6D8;
  --coffee: #785640;
  --coffee-dark: #5F4332;
  --text: #3C302A;
  --muted: #6E6056; /* немного темнее #75675D — контраст ≥ 4.5:1 на кремовом */
  --line: #DDCEBD;
  --error: #9A3B2E;
  --ok: #3F5E3F;
  --radius: 18px;
  --radius-sm: 12px;
  --wrap: 1200px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; animation: none !important; } }
body.site { margin: 0; background: var(--bg); color: var(--text); font: 17px/1.6 var(--sans); overflow-x: hidden; }
img { max-width: 100%; height: auto; display: block; }
[hidden] { display: none !important; }
a { color: var(--coffee); }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; color: var(--text); margin: 0 0 .5em; }
.wrap { width: min(var(--wrap), 100% - 2.5rem); margin-inline: auto; }
.narrow { max-width: 820px; }
.narrow-text { max-width: 640px; }
.muted { color: var(--muted); }
.center { text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* Ссылка «Перейти к содержимому» — только для управления с клавиатуры (Tab); при фокусе от мыши, касания или
   возврата во вкладку не показывается. */
.skip-link { position: absolute; left: -999px; top: .5rem; background: var(--coffee); color: #fff; padding: .5rem 1rem;
  border-radius: 999px; z-index: 50; text-decoration: none; }
.skip-link:focus-visible { left: 1rem; }
html.no-kbd .skip-link:focus-visible { left: -999px; }  /* site.js: пока не нажата Tab — не показывать */
:focus-visible { outline: 3px solid #B5824F; outline-offset: 3px; border-radius: 6px; }

/* Кнопки */
.s-btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 46px; padding: 0 1.4rem;
  border-radius: 999px; border: 1.5px solid transparent; font: 600 1rem/1.2 var(--sans); text-decoration: none; cursor: pointer;
  transition: background .2s ease, border-color .2s ease, color .2s ease; white-space: nowrap; }
.s-btn-primary { background: var(--coffee); color: #FFF8F0; }
.s-btn-primary:hover { background: var(--coffee-dark); }
.s-btn-outline { background: transparent; border-color: var(--coffee); color: var(--coffee); }
.s-btn-outline:hover { background: var(--sand-soft); }
.s-btn-ghost { background: var(--surface); border-color: var(--line); color: var(--text); }
.s-btn-ghost:hover { border-color: var(--coffee); }
.s-btn-lg { min-height: 54px; padding: 0 1.8rem; font-size: 1.05rem; }
.s-btn-block { width: 100%; }
/* На телефоне длинная надпись переносится внутри кнопки, а не выходит за её край */
@media (max-width: 640px) { .s-btn { max-width: 100%; white-space: normal; text-align: center; padding-block: .55rem; } }
.s-btn[disabled], .s-btn[aria-busy="true"] { opacity: .7; cursor: progress; }
.s-link { color: var(--coffee); font-weight: 600; text-underline-offset: 3px; }

/* Шапка */
.site-header { position: sticky; top: 0; z-index: 20; background: rgba(248, 243, 235, .94); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line); }
.header-row { display: flex; align-items: center; gap: 1.5rem; min-height: 76px; }
.site-brand { font: 600 1.6rem/1 var(--serif); color: var(--text); text-decoration: none; letter-spacing: .01em; white-space: nowrap; }
.site-nav { display: flex; gap: 1.4rem; margin-left: auto; }
.site-nav a { color: var(--text); text-decoration: none; font-size: .98rem; padding: .3rem 0; border-bottom: 2px solid transparent; }
.site-nav a:hover { border-color: var(--sand); }
.header-actions { display: flex; gap: .6rem; }
.header-actions .s-btn { min-height: 42px; padding: 0 1.1rem; font-size: .95rem; }
.mobile-menu { display: none; margin-left: auto; position: relative; }
.mobile-menu summary { list-style: none; display: inline-flex; align-items: center; gap: .5rem; cursor: pointer; padding: .55rem .9rem;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-weight: 600; }
.mobile-menu summary::-webkit-details-marker { display: none; }
.burger, .burger::before, .burger::after { display: block; width: 18px; height: 2px; background: var(--text); border-radius: 2px; position: relative; }
.burger::before, .burger::after { content: ""; position: absolute; left: 0; }
.burger::before { top: -6px; } .burger::after { top: 6px; }
.mobile-panel { position: absolute; right: 0; top: calc(100% + .5rem); width: min(86vw, 320px); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; display: flex; flex-direction: column; gap: .4rem;
  box-shadow: 0 18px 40px rgba(60, 48, 42, .14); }
.mobile-panel a:not(.s-btn) { color: var(--text); text-decoration: none; padding: .6rem .4rem; border-bottom: 1px solid var(--sand-soft); }
.mobile-panel .s-btn { margin-top: .4rem; }
@media (max-width: 1060px) { .site-nav { gap: 1rem; } .header-actions .s-btn-ghost { display: none; } }
@media (max-width: 900px) { .site-nav, .header-actions { display: none; } .mobile-menu { display: block; } .header-row { min-height: 64px; } }

/* Общие секции */
.site-main { min-height: 50vh; }
.section { padding: clamp(3rem, 7vw, 6rem) 0; }
.section-sand { background: var(--sand-soft); }
.section-title { font-size: clamp(1.8rem, 3.2vw, 2.6rem); }
.page-title { font-size: clamp(2rem, 4vw, 3rem); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.lead { font-size: 1.15rem; color: var(--muted); }

/* Первый экран */
.hero { padding: clamp(2.5rem, 6vw, 5.5rem) 0; }
.hero-grid { display: grid; grid-template-columns: 1fr 1.05fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
.hero h1 { font-size: clamp(2.4rem, 5.4vw, 4.4rem); letter-spacing: -.01em; }
.hero .lead { font-size: clamp(1.1rem, 1.6vw, 1.3rem); max-width: 34rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.6rem; }
.hero-figure { margin: 0; position: relative; background: var(--surface); border-radius: var(--radius); padding: clamp(.8rem, 2vw, 1.4rem);
  box-shadow: 0 24px 60px rgba(60, 48, 42, .12); border: 1px solid var(--line); }
.hero-figure img { width: 100%; max-height: 72vh; object-fit: contain; border-radius: 10px; }
.hero-placeholder { display: grid; place-items: center; gap: 1rem; text-align: center; }
.frame-art { width: min(70%, 320px); aspect-ratio: 4 / 5; border: 14px solid var(--sand); border-radius: 6px; background:
  linear-gradient(160deg, #EFE2D2 0%, #E2CDB5 60%, #D6BEA2 100%); box-shadow: inset 0 0 0 1px var(--line); }
.demo-badge { position: absolute; left: .8rem; top: .8rem; background: rgba(255, 252, 248, .95); color: var(--coffee); border: 1px solid var(--line);
  font: 600 .78rem/1 var(--sans); padding: .4rem .6rem; border-radius: 999px; }
@media (max-width: 860px) { .hero-grid { grid-template-columns: 1fr; } }

/* Что мы делаем / шаги */
.flow { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.2rem; }
.flow li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem; }
.flow h3 { font-size: 1.25rem; }
.flow p { margin: 0; color: var(--muted); }
.flow-num { display: inline-grid; place-items: center; width: 2.2rem; height: 2.2rem; border-radius: 50%; background: var(--sand);
  color: var(--coffee); font: 700 1rem var(--serif); margin-bottom: .8rem; }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0 0 2rem; display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.2rem; }
.steps li { counter-increment: s; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem 1.4rem 1.4rem 4.4rem; position: relative; }
.steps li::before { content: counter(s); position: absolute; left: 1.3rem; top: 1.3rem; width: 2.2rem; height: 2.2rem; border-radius: 50%;
  background: var(--coffee); color: #FFF8F0; display: grid; place-items: center; font: 700 1rem var(--serif); }
.steps h3 { font-size: 1.2rem; }
.steps p { margin: 0; color: var(--muted); }
@media (max-width: 960px) { .flow { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .flow, .steps { grid-template-columns: 1fr; } }

/* Карточки галерей: изображение целиком, без фиксированного кропа */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.4rem; align-items: start; }
.card { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.card-media { position: relative; display: block; background: var(--sand-soft); }
.card-media img { width: 100%; height: auto; }
.card-body { padding: 1.1rem 1.2rem 1.3rem; display: flex; flex-direction: column; gap: .5rem; }
.card-kicker { margin: 0; font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.card-title { font-size: 1.25rem; margin: 0; overflow-wrap: anywhere; }
.card-text { margin: 0 0 .4rem; color: var(--muted); font-size: .97rem; }
.card-caption { color: var(--muted); font-size: .95rem; }
.filters { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1.5rem 0 2rem; }
.chip { display: inline-flex; align-items: center; min-height: 40px; padding: 0 1rem; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); text-decoration: none; }
.chip:hover { border-color: var(--coffee); }
.chip.is-active { background: var(--coffee); border-color: var(--coffee); color: #FFF8F0; }
.empty { background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); padding: 2rem; text-align: center;
  display: grid; justify-items: center; gap: .8rem; }
.empty p { margin: 0; max-width: 34rem; }
.look-detail { display: grid; grid-template-columns: 1.2fr 1fr; gap: 3rem; align-items: start; }
.look-figure { margin: 0; position: relative; }
.look-figure img { border-radius: var(--radius); }
@media (max-width: 800px) { .look-detail { grid-template-columns: 1fr; gap: 1.5rem; } }

/* Просмотр крупнее */
.lightbox { border: 0; padding: 0; background: transparent; max-width: min(94vw, 1400px); max-height: 94vh; }
.lightbox::backdrop { background: rgba(40, 30, 24, .82); }
.lightbox img { max-width: min(94vw, 1400px); max-height: 86vh; width: auto; border-radius: 12px; margin: auto; }
.lightbox-title { color: #FFF8F0; text-align: center; margin: .6rem 0 0; }
.lightbox-close { position: fixed; right: 1rem; top: 1rem; width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--surface);
  font-size: 1.6rem; cursor: pointer; }

/* FAQ */
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: .7rem; }
.faq summary { cursor: pointer; padding: 1.1rem 1.3rem; font-weight: 600; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; float: right; color: var(--coffee); font-size: 1.3rem; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 0; padding: 0 1.3rem 1.2rem; color: var(--muted); }

/* Подвал */
.site-footer { background: #EFE3D4; border-top: 1px solid var(--line); padding: 3rem 0 2.5rem; margin-top: 2rem; }
.footer-grid { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 2rem; }
.footer-brand { font: 600 1.5rem var(--serif); margin: 0 0 .3rem; }
.footer-title { font-size: 1.1rem; font-family: var(--sans); font-weight: 700; }
.contact-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .35rem; overflow-wrap: anywhere; }
.doc-list { font-size: .88rem; }
.legal { font-size: .88rem; margin-top: 1rem; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }

/* Формы */
.order-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 2.5rem; align-items: start; }
.order-aside { position: sticky; top: 96px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem; }
.order-aside h2 { font-size: 1.3rem; }
.mini-steps { padding-left: 1.2rem; margin: 0; display: grid; gap: .6rem; color: var(--muted); font-size: .95rem; }
@media (max-width: 960px) { .order-layout { grid-template-columns: 1fr; } .order-aside { position: static; } }
.order-restored { margin-bottom: 1.2rem; }
.order-restored p { margin: 0; }
.order-restored-reset { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; }
.order-trust { list-style: none; padding: 0; margin: 0 0 1.1rem; display: grid; gap: .35rem; font-size: .95rem; }
.order-trust li { position: relative; padding-left: 1.5rem; }
.order-trust li::before { content: "✓"; position: absolute; left: 0; color: var(--ok); font-weight: 700; }
/* Телефон: единственная кнопка отправки закреплена внизу; пока открыта клавиатура — прячется, чтобы не закрывать поле. */
.order-sticky { display: none; }
@media (max-width: 960px) {
  .order-inline-submit { display: none; }
  .order-sticky { display: flex; align-items: center; gap: .75rem; position: fixed; inset: auto 0 0 0; z-index: 30;
    padding: .6rem 16px calc(.6rem + env(safe-area-inset-bottom)); background: var(--surface);
    border-top: 1px solid var(--line); box-shadow: 0 -6px 18px rgba(60, 40, 20, .08); }
  .order-sticky-sum { flex: 1; min-width: 0; margin: 0; font-size: .9rem; line-height: 1.3; color: var(--muted);
    overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .order-sticky-submit { flex: none; }
  .site.has-order-sticky { padding-bottom: 5rem; }
  .site.is-typing .order-sticky { display: none; }
}
.form-block { border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); padding: 1.4rem; margin: 0 0 1.4rem; min-width: 0; }
.form-block legend { font: 600 1.25rem var(--serif); padding: 0 .4rem; }
/* Узкий экран: длинный заголовок шага не переносится через рамку блока. */
@media (max-width: 480px) { .form-block legend { font-size: 1.05rem; } }
.field { display: flex; flex-direction: column; gap: .35rem; margin-bottom: 1rem; min-width: 0; }
.field label { font-weight: 600; }
.req { color: var(--coffee); }
.field input:not([type=radio]):not([type=checkbox]):not([type=file]), .field select, .field textarea {
  width: 100%; min-height: 48px; padding: .7rem .9rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff;
  font: 1rem/1.4 var(--sans); color: var(--text); }
.field textarea { min-height: 110px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--coffee); outline: 3px solid rgba(120, 86, 64, .25); outline-offset: 0; }
.has-error input, .has-error select, .has-error textarea { border-color: var(--error); }
.field-hint { margin: 0; font-size: .9rem; color: var(--muted); }
.field-error { margin: 0; font-size: .92rem; color: var(--error); font-weight: 600; }
.field .consent { display: flex; align-items: flex-start; gap: .65rem; font-weight: 400; font-size: .95rem; line-height: 1.45; cursor: pointer; }
.consent input { flex: none; width: 1.25rem; height: 1.25rem; margin: .1rem 0 0; accent-color: var(--coffee); }
.has-error .consent input { outline: 2px solid var(--error); outline-offset: 1px; }
.policy h2 { font-size: 1.25rem; margin: 1.8rem 0 .5rem; }
.policy p, .policy li { line-height: 1.6; }
.policy ul { padding-left: 1.2rem; }
.policy li + li { margin-top: .35rem; }
.doc-table { overflow-x: auto; margin: .8rem 0 1rem; }
.doc-table table { width: 100%; border-collapse: collapse; background: var(--surface); font-size: .95rem; }
.doc-table th, .doc-table td { border: 1px solid var(--line); padding: .5rem .7rem; text-align: left; vertical-align: top; line-height: 1.5; }
.doc-table th { background: var(--sand-soft); font-weight: 600; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
@media (max-width: 640px) { .field-row { grid-template-columns: 1fr; } }
.kind-switch { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: 1rem; }
.kind-option { display: inline-flex; align-items: center; gap: .5rem; padding: .6rem 1rem; border: 1px solid var(--line); border-radius: 999px;
  background: #fff; cursor: pointer; }
.kind-option:has(input:checked) { border-color: var(--coffee); background: var(--sand-soft); }
.kind-option input { accent-color: var(--coffee); width: 18px; height: 18px; }
.upload-drop { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem; padding: 1.2rem; border: 2px dashed var(--line); border-radius: var(--radius);
  background: #fff; cursor: pointer; position: relative; }
.upload-drop.is-over { border-color: var(--coffee); background: var(--sand-soft); }
.upload-drop input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.photo-list { list-style: none; padding: 0; margin: .8rem 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .8rem; }
.photo-list:empty { display: none; }
.photo-item { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .5rem; display: flex; flex-direction: column; gap: .4rem; min-width: 0; }
.photo-item img { width: 100%; aspect-ratio: 1; object-fit: contain; background: var(--sand-soft); border-radius: 8px; }
.photo-name { font-size: .82rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.photo-remove { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; min-height: 36px; cursor: pointer; font: 600 .85rem var(--sans); color: var(--error); }
.summary-box { background: var(--surface); border: 1px solid var(--coffee); border-radius: var(--radius); padding: 1.4rem; }
.summary-box h2 { font-size: 1.4rem; }
.summary-list { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1rem; margin: 0 0 1rem; }
.summary-list dt { color: var(--muted); }
.summary-list dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 480px) { .summary-list { grid-template-columns: 1fr; } .summary-list dd { margin-bottom: .4rem; } }
.s-note { border-radius: var(--radius-sm); padding: .9rem 1.1rem; margin: 0 0 1.2rem; background: var(--sand-soft); border: 1px solid var(--line); }
.s-note p { margin: .2rem 0; }
.s-note-error { background: #FBEDEA; border-color: #E7C2BA; color: var(--error); }
.s-note-success { background: #EDF3EA; border-color: #C9DAC2; color: var(--ok); }
.done-card, .auth-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(1.4rem, 3vw, 2.2rem); }
.auth-wrap { display: grid; place-items: center; }
.auth-box { width: min(460px, 100%); }
.auth-links { margin: .8rem 0 0; }
.auth-box form > .s-btn[type=submit] { margin-top: .9rem; }  /* кнопка отделена от последнего поля — не задеть пальцем поле пароля */

/* Кабинет */
.order-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .8rem; }
.order-link { display: grid; grid-template-columns: 88px minmax(0, 1fr) auto; gap: 1rem; align-items: center; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem 1.1rem; text-decoration: none; color: var(--text); }
.order-link:hover { border-color: var(--coffee); }
/* Миниатюра в пропорциях образа (4 : 5) и заполнена целиком — без полос по бокам. */
.order-thumb img, .thumb-empty { display: block; width: 88px; height: auto; aspect-ratio: 4 / 5; object-fit: cover; background: var(--sand-soft); border-radius: 10px; }
.thumb-empty { display: grid; place-items: center; font-size: .78rem; color: var(--muted); text-align: center; }
.order-thumb { align-self: start; }
.order-info { display: flex; flex-direction: column; min-width: 0; }
.order-info .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-pill { display: inline-block; padding: .35rem .8rem; border-radius: 1rem; background: var(--sand); color: var(--coffee-dark); font: 600 .85rem var(--sans); max-width: 100%; }
.status-cancelled { background: #F3DCD7; color: var(--error); }
.status-delivered, .status-paid { background: #DCE7D5; color: var(--ok); }
@media (max-width: 560px) { .order-link { grid-template-columns: 64px minmax(0, 1fr); } .order-link .status-pill { grid-column: 2; justify-self: start; }
  .order-thumb img, .thumb-empty { width: 64px; }
  .order-info .muted { white-space: normal; } /* дата, размер и цена — целиком, а не обрезаны многоточием */ }
.mat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: .8rem; }
.mat-grid.small { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); }
.mat-grid figure { margin: 0; }
.mat-grid img { border-radius: 10px; border: 1px solid var(--line); background: var(--sand-soft); }
.aside-look { border-radius: 10px; max-width: 160px; margin-top: .5rem; }
.timeline { list-style: none; padding: 0; margin: 0; border-left: 2px solid var(--sand); }
.timeline li { padding: 0 0 1rem 1.2rem; position: relative; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: .45rem; width: 12px; height: 12px; border-radius: 50%; background: var(--coffee); }
.timeline p { margin: .3rem 0 0; color: var(--muted); }
.tl-date { display: block; font-size: .85rem; color: var(--muted); }
.pay-details { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 1rem; white-space: normal; overflow-wrap: anywhere; }
.pay-qr { max-width: 220px; margin-top: 1rem; }

/* Первый экран: фиксированные пропорции блока, изображение любой ориентации вписано целиком */
.hero-frame { aspect-ratio: 4 / 5; width: 100%; max-height: 72vh; display: grid; place-items: center; background: var(--sand-soft);
  border-radius: 10px; overflow: hidden; }
.hero-frame img { width: 100%; height: 100%; max-height: none; object-fit: contain; border-radius: 0; }
.hero-empty .frame-art { width: 62%; }
/* Телефон и планшет: рамка в пропорциях изображений первого экрана и заполнена целиком — без полос по бокам;
   паспарту тоньше. Кадр другой ориентации обрезается по краям, а не уменьшается с полосами. */
@media (max-width: 860px) {
  .hero-figure { padding: .45rem; }
  .hero-frame { aspect-ratio: var(--hero-ratio, 4 / 5); max-height: 78svh; border-radius: 8px; }
  .hero-link.hero-frame .hero-slide { object-fit: cover; }
}

/* Блок «Образы» на главной: 4 колонки × 3 ряда на широком экране, меньше колонок на узком */
.home-looks { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { .home-looks { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 820px) { .home-looks { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .home-looks { grid-template-columns: minmax(0, 1fr); } }
.gallery-more { margin: 2rem 0 0; }

/* Счётчик непрочитанного у «Мои заказы» и в списке заказов кабинета */
.count-badge { display: inline-grid; place-items: center; min-width: 1.35rem; height: 1.35rem; padding: 0 .35rem; border-radius: 999px;
  background: #B4442F; color: #fff; font-size: .75rem; font-weight: 700; line-height: 1; }
/* На сайте клиента — просто красная точка «есть новое», без числа (число остаётся для экранного диктора) */
.site .count-badge, .site .tab-badge { width: .6rem; height: .6rem; min-width: 0; padding: 0; font-size: 0; vertical-align: middle;
  box-shadow: 0 0 0 2px rgba(255, 248, 240, .9); }
.flow-undo { margin-top: .8rem; }
.order-next { display: block; font-size: .9rem; }
.order-next.is-client { color: var(--coffee); font-weight: 600; }

/* Логотип перед «В Образе» в шапке сайта */
.site-brand { display: inline-flex; align-items: center; gap: .6rem; flex: none; }
.site-brand .brand-logo { display: block; height: 40px; width: auto; flex: none; }
@media (max-width: 900px) { .site-brand .brand-logo { height: 34px; } .site-brand { gap: .5rem; } }
@media (max-width: 360px) { .site-brand { font-size: 1.35rem; } .site-brand .brand-logo { height: 30px; } }

/* ===== Растительный фон: тонкие линейные ветви (static/clientsite/decor/*.svg) =====
   Рисунок — псевдоэлемент за содержимым секции: цвет задаёт фон, форму — SVG-маска, прозрачность
   применяется только к ветви. Ветви не перехватывают нажатия и обрезаются краями своей секции. */
:root {
  --leaf-olive: #7D886C;        /* линии листьев — приглушённый оливковый */
  --leaf-sand: #A9967E;         /* дополнительные ветви — песочно-коричневый */
  --leaf-opacity: .22;          /* основная ветвь первого экрана */
  --leaf-opacity-soft: .2;      /* дополнительные композиции */
  --leaf-opacity-page: .14;     /* внутренние страницы с галереями */
  --leaf-opacity-on-sand: .42;  /* песочная ветвь на песочном фоне секции нужна заметнее */
  --leaf-hero-h: min(108%, 900px);
  --leaf-hero-scale: 1.2;       /* верхняя ветвь первого экрана — на 20% крупнее прежней */
  --leaf-size: clamp(300px, 30vw, 460px);
}
.leafy { position: relative; isolation: isolate; overflow: clip; }
.leafy::before, .leafy::after { content: ""; position: absolute; z-index: -1; pointer-events: none;
  background-color: var(--leaf-olive); opacity: var(--leaf-opacity-soft);
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; -webkit-mask-position: center; mask-position: center;
  -webkit-mask-size: contain; mask-size: contain; }

/* Первый экран: крупная ветвь у левого края (зеркально), частично за краем страницы, в стороне от текста. */
.leafy-hero::before { -webkit-mask-image: url("decor/branch-long.421328bb92a3.svg"); mask-image: url("decor/branch-long.421328bb92a3.svg");
  height: calc(var(--leaf-hero-h) * var(--leaf-hero-scale)); max-height: 1080px; aspect-ratio: 372 / 1038;
  left: calc(min(0px, (var(--wrap) - 100vw) / 2) - 150px); top: 50%;
  transform: translateY(-50%) scaleX(-1) rotate(-12deg); opacity: var(--leaf-opacity); }
@media (min-width: 1500px) { .leafy-hero::before { left: calc((100vw - var(--wrap)) / 2 - 260px); } }

/* «Образы»: пологая песочная ветвь у левого края, рядом с галереей (под карточками не видна). */
.leafy-left::before { -webkit-mask-image: url("decor/branch-arc.38c24ff494f6.svg"); mask-image: url("decor/branch-arc.38c24ff494f6.svg");
  width: var(--leaf-size); aspect-ratio: 640 / 380; left: calc(var(--leaf-size) * -0.38); bottom: 8%;
  transform: rotate(-58deg); background-color: var(--leaf-sand); opacity: var(--leaf-opacity-on-sand); }

/* Перед подвалом: веточка у правого края, зеркально к первому экрану. */
.leafy-end::before { -webkit-mask-image: url("decor/branch-sprig.e9d3bcbd7c84.svg"); mask-image: url("decor/branch-sprig.e9d3bcbd7c84.svg");
  width: calc(var(--leaf-size) * .78); aspect-ratio: 360 / 520; right: calc(var(--leaf-size) * -0.12); bottom: -4%;
  transform: scaleX(-1) rotate(-6deg); }
.leafy-end::after { -webkit-mask-image: url("decor/branch-arc.38c24ff494f6.svg"); mask-image: url("decor/branch-arc.38c24ff494f6.svg");
  width: calc(var(--leaf-size) * .7); aspect-ratio: 640 / 380; left: calc(var(--leaf-size) * -0.3); top: 6%;
  transform: rotate(24deg); background-color: var(--leaf-sand); opacity: calc(var(--leaf-opacity-soft) * .8); }

/* Галереи и описание образа: лёгкая веточка в верхнем углу. Формы и кабинет — без декора (ясные поверхности). */
.leafy-page::before { -webkit-mask-image: url("decor/branch-sprig.e9d3bcbd7c84.svg"); mask-image: url("decor/branch-sprig.e9d3bcbd7c84.svg");
  width: calc(var(--leaf-size) * .62); aspect-ratio: 360 / 520; right: calc(var(--leaf-size) * -0.16); top: -2rem;
  transform: rotate(152deg); opacity: var(--leaf-opacity-page); }

/* Узкие экраны: одна лёгкая композиция у края (первый экран), меньше и прозрачнее. */
@media (max-width: 900px) {
  .leafy-hero::before { height: auto; max-height: none; width: min(38vw, 204px); top: -7rem; left: calc(min(38vw, 204px) * -0.62);
    transform: scaleX(-1) rotate(-34deg);
    opacity: calc(var(--leaf-opacity) * .7); }
  .leafy-left::before, .leafy-end::after, .leafy-page::before { display: none; }
  .leafy-end::before { width: 170px; opacity: calc(var(--leaf-opacity-soft) * .7); right: -60px; }
}
@media (max-width: 560px) { .leafy-end::before { display: none; } }
@media print { .leafy::before, .leafy::after { display: none; } }

/* «Назад в Мои заказы»: второстепенное действие сайта со стрелкой влево */
.s-btn-back { gap: .45rem; padding: 0 1.1rem 0 .9rem; min-height: 44px; font-size: .97rem; }
.s-btn-back .s-icon { flex: none; color: var(--coffee); transition: transform .15s ease; }
.s-btn-back:hover { background: var(--sand-soft); }
.s-btn-back:hover .s-icon { transform: translateX(-2px); }
.s-btn-back:active { background: var(--sand); }
.order-card .oc-back { margin: 0 0 1.1rem; }
@media (prefers-reduced-motion: reduce) { .s-btn-back .s-icon { transition: none; } }

/* Первый экран: смена кадров растворением (crossfade). Кадры лежат друг на друге внутри блока
   фиксированных пропорций — высота экрана, текст и кнопки не сдвигаются. Без JS виден первый кадр. */
.hero-link { position: relative; display: block; text-decoration: none; }
.hero-frame .hero-slide { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; opacity: 0;
  transition: opacity var(--hero-fade, 1100ms) cubic-bezier(.45, 0, .25, 1); }
.hero-frame .hero-slide.is-active { opacity: 1; }
.hero-link:focus-visible { outline: 3px solid #B5824F; outline-offset: 4px; }
@media (prefers-reduced-motion: reduce) { .hero-frame .hero-slide { transition: none; } }

/* Уведомления о событиях заказа (pulse.js) */
.pulse-toasts { position: fixed; right: 1rem; bottom: 1rem; z-index: 60; display: flex; flex-direction: column; gap: .4rem; max-width: min(360px, calc(100vw - 2rem)); }
.pulse-toast { display: block; margin: 0; padding: .7rem 1rem; border-radius: 14px; background: var(--coffee-dark, #4a352a); color: #FFF8F0;
  text-decoration: none; box-shadow: 0 8px 22px rgba(60, 40, 30, .22); font: 600 .92rem var(--sans); }
.phone-error { display: block; color: #a33; font-size: .85rem; margin-top: .25rem; }

/* ===== Единая карточка образа: галерея, главная, окно выбора ===== */
.card-grid:has(.card-look) { align-items: stretch; }
.card-look { height: 100%; }
.card-look .card-media { aspect-ratio: 4 / 5; overflow: hidden; }
.card-look .card-media img { width: 100%; height: 100%; object-fit: cover; display: block; } /* исходник и увеличенный просмотр — целиком */
.card-noimg { display: grid; place-items: center; width: 100%; height: 100%; color: var(--muted); font-size: .9rem; }
.card-look .card-body { flex: 1 1 auto; }
.card-look .card-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  line-height: 1.25; min-height: 2.5em; }
.card-look .card-text { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card-look .card-action { margin-top: auto; }
.card-pick { font: inherit; color: inherit; text-align: left; padding: 0; cursor: pointer; width: 100%; }
.card-pick .card-body { padding: .7rem .8rem .8rem; gap: .25rem; }
.card-pick .card-title { font-size: 1.02rem; font-weight: 600; }
.card-pick .card-kicker { font-size: .72rem; }
.card-pick:hover { border-color: var(--coffee); }
.card-pick:focus-visible { outline: 3px solid var(--coffee); outline-offset: 2px; }
.card-pick.is-selected { border: 2px solid var(--coffee); box-shadow: 0 0 0 3px rgba(124, 88, 66, .18); }
.card-check { position: absolute; top: .5rem; right: .5rem; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: var(--coffee); color: #FFF8F0; font-weight: 700; opacity: 0; transition: opacity .15s ease; }
.card-pick.is-selected .card-check { opacity: 1; }

/* ===== Окно выбора образа ===== */
html.modal-open { overflow: hidden; }
.look-picker { width: min(1040px, calc(100vw - 2rem)); max-height: calc(100dvh - 2rem); padding: 0; border: 0; border-radius: var(--radius);
  background: var(--surface); color: var(--text); box-shadow: 0 20px 60px rgba(40, 28, 20, .35); }
.look-picker[open] { display: flex; flex-direction: column; }
.look-picker::backdrop { background: rgba(40, 28, 20, .55); }
.picker-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.25rem .4rem; }
.picker-head h2 { margin: 0; font: 600 1.5rem var(--serif); }
.picker-close { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); font-size: 1.6rem;
  line-height: 1; cursor: pointer; color: var(--text); }
.picker-tools { padding: .3rem 1.25rem .6rem; border-bottom: 1px solid var(--line); }
.picker-search input { width: 100%; box-sizing: border-box; font: inherit; padding: .7rem .9rem; border: 1px solid var(--line); border-radius: 12px; }
.picker-cats { margin: .6rem 0 0; }
.picker-cats .chip { font: inherit; background: transparent; color: var(--text); cursor: pointer; }
.picker-cats .chip.is-active { background: var(--coffee); border-color: var(--coffee); color: #FFF8F0; }
.picker-body { flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain; padding: .8rem 1.25rem 1rem; }
.picker-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .9rem; }
.picker-state { margin: 0 0 .6rem; min-height: 1.2em; font-size: .9rem; }
.picker-empty { text-align: center; padding: 2rem 0; }
.picker-more { display: block; margin: 1rem auto 0; }
.picker-foot { display: flex; justify-content: flex-end; gap: .6rem; padding: .8rem 1.25rem; border-top: 1px solid var(--line); background: var(--sand-soft); }
@media (max-width: 640px) {
  .look-picker { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; margin: 0; }
  .picker-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
  .picker-foot .s-btn { flex: 1; }
}

/* ===== Форма заказа: шаги, выбранный образ, прогресс загрузки ===== */
.order-form .step-num { display: inline-grid; place-items: center; width: 28px; height: 28px; margin-right: .3rem; border-radius: 50%;
  background: var(--coffee); color: #FFF8F0; font: 700 .85rem var(--sans); vertical-align: middle; }
.look-selected { display: flex; align-items: center; gap: .9rem; margin: 0 0 .8rem; padding: .6rem; border: 1px solid var(--line); border-radius: 14px;
  background: var(--sand-soft); max-width: 460px; }
.look-selected img { width: 72px; height: 90px; object-fit: cover; border-radius: 10px; flex: none; }
.look-selected p { margin: 0; }
.look-selected-title { font-weight: 700; overflow-wrap: anywhere; }
.photo-item { position: relative; }
.photo-item::after { content: ""; position: absolute; left: .5rem; right: .5rem; bottom: .3rem; height: 4px; border-radius: 4px;
  background: linear-gradient(90deg, var(--coffee) var(--upload, 0%), transparent var(--upload, 0%)); opacity: 0; }
#order-form[data-sending="1"] .photo-item::after { opacity: 1; }
.upload-progress { margin: .4rem 0 .8rem; }
.upload-progress progress { width: 100%; height: 10px; accent-color: var(--coffee); }


/* Единый блок подключения уведомлений в мессенджерах. */
.messenger-actions { display: flex; align-items: stretch; gap: .6rem; margin-top: .8rem; }
.messenger-actions form { display: flex; min-width: 0; margin: 0; }
@media (max-width: 640px) {
  .messenger-actions form { flex: 1 1 0; }
  .messenger-actions .s-btn { width: 100%; padding: .55rem .5rem; font-size: .85rem; }
}
