/* MyPhoto — сайт для телефона. Токены из design/design-system/tokens.json */
@font-face { font-family: Unbounded; src: url(../assets/fonts/Unbounded-Variable.woff2) format("woff2"); font-weight: 200 900; font-display: swap; }
@font-face { font-family: Nunito; src: url(../assets/fonts/Nunito-Variable.woff2) format("woff2"); font-weight: 200 1000; font-display: swap; }
@font-face { font-family: Caveat; src: url(../assets/fonts/Caveat-Variable.woff2) format("woff2"); font-weight: 400 700; font-display: swap; }

:root {
  --ivory: #FFF6E5; --ivory-deep: #F5E6C8; --paper: #FFFDF8; --ink: #161412; --ink-muted: #5E554B;
  --yellow: #FFC83D; --pink: #F6C4CF; --red: #D23420; --blue: #2B59E3; --green: #23774A; --blue-soft: #EEF2FF;
  --font-display: Unbounded, "Arial Black", sans-serif;
  --font-body: Nunito, "Segoe UI", Arial, sans-serif;
  --font-hand: Caveat, "Comic Sans MS", cursive;
  --stroke: 2.5px; --radius-sm: 8px; --radius-md: 14px; --radius-lg: 22px; --radius-pill: 999px;
  --shadow-sm: 2px 2px 0 var(--ink); --shadow-md: 4px 4px 0 var(--ink); --shadow-lg: 6px 6px 0 var(--ink);
  color-scheme: light;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--ivory); color: var(--ink); font: 500 16px/1.4 var(--font-body); }
body { min-height: 100dvh; overscroll-behavior-y: none; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: var(--blue); }
img { display: block; }
h1, h2 { margin: 0; font-family: var(--font-display); font-weight: 800; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.app { max-width: 480px; margin: 0 auto; min-height: 100dvh; }
.screen { min-height: 100dvh; display: flex; flex-direction: column; gap: 12px;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); }
.screen--deep { background: var(--ivory-deep); }
.spacer { flex: 1; }
.muted { color: var(--ink-muted); }
.caption { font-size: 13px; line-height: 18px; font-weight: 600; color: var(--ink-muted); }
.center { text-align: center; }
.row { display: flex; gap: 10px; align-items: center; }
.between { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }

/* Шапка главного экрана */
.top { display: flex; justify-content: space-between; align-items: center; }
.brand { display: flex; align-items: center; gap: 8px; }
.brand img { height: 30px; }
.slogan { font: 700 22px/1 var(--font-hand); color: var(--red); transform: rotate(-4deg); }
.lang { display: flex; border: var(--stroke) solid var(--ink); border-radius: var(--radius-pill); overflow: hidden; background: var(--paper); }
.lang button { border: 0; background: none; padding: 6px 10px; font-weight: 800; font-size: 13px; }
.lang button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

/* Шаги */
.steps { display: flex; align-items: center; gap: 12px; }
.steps__info { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.steps__label { font-size: 13px; font-weight: 800; color: var(--blue); }
.steps__bars { display: flex; gap: 4px; }
.steps__bars span { flex: 1; height: 6px; border-radius: var(--radius-pill); background: var(--ivory-deep); }
.screen--deep .steps__bars span { background: var(--paper); }
.steps__bars span.on { background: var(--blue); }
.round { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border: var(--stroke) solid var(--ink);
  border-radius: var(--radius-pill); background: var(--paper); padding: 0; font-size: 18px; font-weight: 800; }
.round img { width: 22px; height: 22px; }
.round[disabled] { opacity: .35; cursor: default; }

/* Кнопки */
.btn { min-height: 56px; padding: 0 20px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: var(--stroke) solid var(--ink); border-radius: var(--radius-md); background: var(--paper); color: var(--ink);
  font-weight: 800; font-size: 17px; line-height: 20px; text-decoration: none; transition: transform .08s, box-shadow .08s; }
.btn img { width: 22px; height: 22px; }
.btn--primary { background: var(--yellow); box-shadow: var(--shadow-md); }
.btn--pay { background: var(--yellow); box-shadow: var(--shadow-md); }
.btn--danger { background: var(--red); color: var(--paper); }
.btn--block { width: 100%; }
.btn--sm { min-height: 44px; font-size: 15px; padding: 0 14px; }
.btn:active:not([disabled]) { transform: translate(4px, 4px); box-shadow: none; }
.btn[disabled] { background: var(--ivory-deep); color: var(--ink-muted); box-shadow: none; border-style: dashed; cursor: not-allowed; }
.btns { display: flex; gap: 10px; }
.btns > .btn { flex: 1; }
.btns > .btn--grow { flex: 1.5; }
.btns > .btn--fit { flex: none; }
.btn { white-space: nowrap; }
.link { background: none; border: 0; color: var(--blue); font-weight: 800; text-decoration: underline; padding: 6px; }

/* Карточки */
.card { background: var(--paper); border: var(--stroke) solid var(--ink); border-radius: var(--radius-md); box-shadow: var(--shadow-md); padding: 12px; }
.card--lg { border-radius: var(--radius-lg); padding: 16px; }
.note { display: flex; gap: 10px; align-items: center; background: var(--paper); border: 2px solid var(--ink); border-radius: 12px;
  padding: 8px 12px; font-size: 14px; line-height: 1.3; }
.note img { width: 22px; height: 22px; flex: none; }
.note--pink { background: var(--pink); border-width: var(--stroke); padding: 12px 16px; }
.lock { display: flex; gap: 10px; align-items: center; font-size: 14px; color: var(--ink-muted); }
.lock svg, .lock img { flex: none; }

/* Главный */
.hero { display: flex; align-items: center; gap: 12px; }
.hero img { width: 92px; height: 92px; flex: none; object-fit: contain; }
.hero h1 { font-size: 26px; line-height: 1.05; }
.hero p { margin: 4px 0 0; font-size: 15px; color: var(--ink-muted); }
.examples { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.example { background: var(--paper); border: var(--stroke) solid var(--ink); border-radius: var(--radius-md); box-shadow: var(--shadow-md);
  padding: 10px; display: flex; flex-direction: column; gap: 2px; }
.example b { font-size: 15px; margin-top: 6px; }
.example span { font-size: 13px; color: var(--ink-muted); }
.ex-pic { height: 100px; border: 2px solid var(--ink); border-radius: 6px; overflow: hidden; background: var(--paper); }
.ex-pic img { width: 100%; height: 100%; object-fit: cover; }
.ex-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; padding: 3px; }
.ex-strips { border: 0; display: flex; justify-content: center; gap: 6px; background: none; }
.ex-strips > div { width: 34px; border: 2px solid var(--ink); border-radius: 4px; overflow: hidden; display: flex; flex-direction: column; gap: 2px; padding: 2px; background: var(--paper); }
.ex-strips > div img { flex: 1; min-height: 0; }
.ex-cal { display: flex; }
.ex-cal > img { width: 55%; }
.ex-cal > div { flex: 1; padding: 5px; display: flex; flex-direction: column; gap: 3px; }
.ex-cal b { font: 800 9px var(--font-display); color: var(--red); margin: 0; }
.ex-cal i { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.ex-cal i span { height: 7px; background: var(--ivory-deep); border-radius: 2px; }
.ex-cal i span:nth-child(7n), .ex-cal i span:nth-child(7n-1) { background: var(--pink); }
.pricebar { display: flex; align-items: center; justify-content: space-between; background: var(--paper); border: var(--stroke) solid var(--ink);
  border-radius: var(--radius-md); padding: 10px 14px; font-weight: 700; }
.pricebar b { font: 800 17px var(--font-display); background: var(--red); color: var(--paper); padding: 4px 10px; border-radius: var(--radius-pill); }

/* Пакеты */
.title { font-size: 26px; line-height: 1.15; }
.lead { margin: -4px 0 0; color: var(--ink-muted); font-size: 15px; line-height: 1.3; }
.packs { display: flex; flex-direction: column; gap: 10px; }
.pack { position: relative; display: flex; align-items: center; gap: 12px; text-align: left; width: 100%; min-height: 62px; padding: 8px 16px;
  background: var(--paper); border: var(--stroke) solid var(--ink); border-radius: var(--radius-md); box-shadow: var(--shadow-md); }
.pack[aria-pressed="true"] { background: var(--yellow); }
.pack__n { font: 800 24px var(--font-display); width: 42px; }
.pack__unit { flex: 1; display: flex; flex-direction: column; font-weight: 800; font-size: 16px; line-height: 1.2; }
.pack__unit small { font-weight: 600; font-size: 13px; color: var(--ink-muted); }
.pack[aria-pressed="true"] .pack__unit small { color: var(--ink); }
.pack__price { font: 700 17px var(--font-display); }
.pack__badge { position: absolute; top: -12px; right: 14px; background: var(--red); color: var(--paper); font-weight: 800; font-size: 13px;
  padding: 2px 10px; border: var(--stroke) solid var(--ink); border-radius: var(--radius-pill); transform: rotate(3deg); }
.finish { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.finish button { text-align: left; padding: 10px 14px; background: var(--paper); border: var(--stroke) solid var(--ink); border-radius: var(--radius-md);
  box-shadow: var(--shadow-md); display: flex; flex-direction: column; }
.finish button b { font-size: 16px; }
.finish button small { font-size: 13px; color: var(--ink-muted); }
.finish button[aria-pressed="true"] { background: var(--yellow); }
.finish button[aria-pressed="true"] small { color: var(--ink); }
.label { font-weight: 800; font-size: 15px; }
.label span { font-weight: 600; color: var(--ink-muted); }

/* Макет и фото */
.thumbs { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 6px; scrollbar-width: none; }
.thumbs::-webkit-scrollbar { display: none; }
.thumb { flex: none; width: 58px; height: 42px; padding: 0; border: 2px dashed var(--ink-muted); border-radius: 6px; background: none;
  font-weight: 800; color: var(--ink-muted); display: grid; place-items: center; overflow: hidden; position: relative; }
.thumb.filled { border: 2px solid var(--ink); }
.thumb canvas { width: 100%; height: 100%; display: block; }
.thumb.current { outline: 3px solid var(--blue); outline-offset: 1px; }
.thumb.current:not(.filled) { background: var(--yellow); color: var(--ink); border: 2px solid var(--ink); }
.sheetbox { background: var(--paper); border: var(--stroke) solid var(--ink); border-radius: var(--radius-md); box-shadow: var(--shadow-md); padding: 12px; }
.stage { position: relative; margin: 0 auto; touch-action: none; user-select: none; -webkit-user-select: none; }
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; border: 2px solid var(--ink); border-radius: 6px; background: #fff; }
.stage--editor canvas { border-width: var(--stroke); box-shadow: var(--shadow-lg); border-radius: 6px; }
.cellbtn { position: absolute; border: 0; background: transparent; padding: 0; }
.cellbtn--empty { border: 2px dashed var(--blue); border-radius: 4px; background: var(--blue-soft); color: var(--blue); font-weight: 800; font-size: 28px; }
.cellbtn--warn::after { content: "!"; position: absolute; right: 4px; top: 4px; width: 22px; height: 22px; border-radius: 50%; background: var(--red);
  color: var(--paper); font-size: 14px; line-height: 22px; text-align: center; border: 2px solid var(--ink); }
.layouts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.layout { height: 72px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; padding: 0 2px;
  background: var(--paper); border: var(--stroke) solid var(--ink); border-radius: 10px; font-weight: 700; font-size: 12px; line-height: 1.1; text-align: center; }
.layout[aria-pressed="true"] { background: var(--yellow); box-shadow: 3px 3px 0 var(--ink); font-weight: 800; }
.li { display: flex; gap: 2px; border: 2px solid var(--ink); border-radius: 3px; background: var(--ink); width: 30px; height: 20px; overflow: hidden; }
.li span { background: var(--pink); flex: 1; }
.li .col { display: flex; flex-direction: column; gap: 2px; background: var(--ink); }
.li--grid { display: grid; grid-template-columns: 1fr 1fr; }
.li--strips { width: auto; height: 26px; background: none; border: 0; gap: 3px; }
.li--strips > div { width: 10px; border: 2px solid var(--ink); border-radius: 2px; display: flex; flex-direction: column; gap: 2px; background: var(--ink); }
.li--strips > div span { flex: 1; }
.li--cal { background: var(--paper); }
.li--cal span:first-child { flex: 0 0 55%; }
.li--cal span:last-child { background: repeating-linear-gradient(var(--paper) 0 3px, var(--ivory-deep) 3px 5px); }
.calpick { display: flex; gap: 8px; align-items: center; }
.calpick select { flex: 1; min-height: 44px; border: var(--stroke) solid var(--ink); border-radius: var(--radius-md); background: var(--paper); font: 700 15px var(--font-body); padding: 0 10px; }

/* Редактор */
.sheetnav { display: flex; align-items: center; justify-content: space-between; }
.sheetnav h1 { font-size: 20px; }
.tools { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.tool { height: 62px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 0;
  background: var(--paper); border: var(--stroke) solid var(--ink); border-radius: 10px; font-weight: 700; font-size: 12px; }
.tool img { width: 22px; height: 22px; }
.tool[aria-pressed="true"] { background: var(--yellow); box-shadow: 3px 3px 0 var(--ink); font-weight: 800; }
.panel { background: var(--paper); border: var(--stroke) solid var(--ink); border-radius: var(--radius-md); padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.panel h3 { margin: 0; font-size: 16px; font-weight: 800; }
.panel p { margin: 0; font-size: 14px; color: var(--ink-muted); line-height: 1.3; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { padding: 6px 12px; border-radius: var(--radius-pill); border: 2px solid var(--ink); background: var(--paper); font-weight: 800; font-size: 13px; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.stickers { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.stickers button { height: 64px; background: var(--ivory); border: 2px solid var(--ivory-deep); border-radius: 10px; display: grid; place-items: center; padding: 4px; }
.stickers img { max-width: 100%; max-height: 50px; }
.frames { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.frames button { height: 64px; border-radius: 10px; border: 2px solid var(--ink-muted); background: var(--ivory); padding: 6px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-weight: 700; font-size: 12px; }
.frames button[aria-pressed="true"] { border: var(--stroke) solid var(--ink); background: var(--yellow); }
.frames i { width: 40px; height: 26px; display: block; background: var(--pink); }
.slider { display: flex; align-items: center; gap: 10px; font-weight: 800; }
input[type=range] { flex: 1; accent-color: var(--blue); height: 28px; }
.colors { display: flex; gap: 8px; }
.colors button { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--ink); padding: 0; }
.colors button[aria-pressed="true"] { outline: 3px solid var(--blue); outline-offset: 2px; }
.textinput { width: 100%; min-height: 48px; border: var(--stroke) solid var(--ink); border-radius: var(--radius-md); background: var(--ivory); font: 600 16px var(--font-body); padding: 10px 12px; resize: none; }
.del { position: absolute; width: 30px; height: 30px; border-radius: 50%; background: var(--red); color: var(--paper); border: 2px solid var(--ink);
  font-weight: 800; font-size: 16px; display: grid; place-items: center; padding: 0; transform: translate(-50%, -50%); z-index: 2; }
.warnline { color: var(--red); font-weight: 800; font-size: 13px; }

/* Итог */
.sumgrid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.sumthumb { aspect-ratio: 3 / 2; display: grid; place-items: center; }
.sumthumb canvas { max-width: 100%; max-height: 100%; border: 2px solid var(--ink); border-radius: 4px; display: block; background: #fff; }
.sumrows { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; font-size: 15px; }
.sumrows div { display: flex; justify-content: space-between; gap: 8px; }
.sumrows span:first-child { color: var(--ink-muted); }
.sumtotal { border-top: 2.5px dashed var(--ink); margin-top: 6px; padding-top: 10px; display: flex; justify-content: space-between; align-items: center; font-weight: 800; }
.sumtotal b { font: 800 24px var(--font-display); }
.paychips { display: flex; justify-content: center; gap: 8px; }
.paychips span { border: 2px solid var(--ink); border-radius: var(--radius-pill); padding: 3px 10px; font-weight: 800; font-size: 13px; background: var(--paper); }
.consent { font-size: 13px; color: var(--ink-muted); text-align: center; margin: 0; }

/* Статус */
.mascot { width: 120px; height: 130px; object-fit: contain; margin: 4px auto 0; }
.bigtitle { font-size: 26px; text-align: center; }
.ticketcard { align-self: center; background: var(--paper); border: var(--stroke) solid var(--ink); border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg); padding: 12px 28px; text-align: center; }
.ticketcard small { display: block; font-weight: 800; font-size: 13px; color: var(--ink-muted); }
.ticketcard b { font: 800 44px/1.1 var(--font-display); }
.ticketno { align-self: center; font: 800 40px/1 var(--font-display); background: var(--yellow); border: var(--stroke) solid var(--ink);
  border-radius: var(--radius-md); box-shadow: var(--shadow-md); padding: 8px 22px; }
.timeline { display: flex; flex-direction: column; gap: 12px; }
.tl { display: flex; align-items: center; gap: 12px; font-weight: 800; font-size: 16px; }
.tl i { width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--ink); flex: none; display: grid; place-items: center; background: var(--ivory); }
.tl i img { width: 18px; height: 18px; }
.tl.ok i { background: var(--green); }
.tl.now i { background: var(--blue); }
.tl.now { color: var(--blue); }
.tl.todo { color: var(--ink-muted); }
.tl small { margin-left: auto; font-weight: 600; font-size: 13px; color: var(--ink-muted); }
.bar { height: 14px; border: 2px solid var(--ink); border-radius: var(--radius-pill); background: var(--ivory-deep); overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--blue); transition: width .4s; }
.badge { align-self: center; display: inline-flex; gap: 6px; align-items: center; padding: 6px 14px; border: var(--stroke) solid var(--ink);
  border-radius: var(--radius-pill); font-weight: 800; font-size: 14px; }
.badge img { width: 16px; height: 16px; }
.badge--ok { background: var(--green); color: var(--paper); }
.stars { display: flex; gap: 10px; }
.stars button { width: 48px; height: 48px; border: var(--stroke) solid var(--ink); border-radius: 10px; background: var(--paper); padding: 0; display: grid; place-items: center; }
.stars button[aria-pressed="true"] { background: var(--yellow); box-shadow: 3px 3px 0 var(--ink); }
.stars svg { width: 26px; height: 26px; }

/* Ошибки */
.errcard { display: flex; flex-direction: column; gap: 12px; }
.errhead { display: flex; gap: 12px; align-items: center; }
.errhead b { display: block; font-size: 16px; }
.errhead span { font-size: 14px; color: var(--ink-muted); line-height: 1.3; }
.erricon { width: 44px; height: 44px; flex: none; border-radius: 50%; border: 2px solid var(--ink); background: var(--red); display: grid; place-items: center; }
.erricon img { width: 22px; height: 22px; filter: invert(1); }
.erricon--dark { background: var(--ink); }
.errthumb { width: 58px; height: 42px; border: 2px solid var(--ink); border-radius: 6px; object-fit: cover; filter: blur(1.5px); flex: none; }

/* Модалки */
.backdrop { position: fixed; inset: 0; background: rgba(22, 20, 18, .45); display: flex; align-items: flex-end; justify-content: center; z-index: 10; }
.sheet { width: 100%; max-width: 480px; background: var(--ivory); border-top: var(--stroke) solid var(--ink); border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 12px; max-height: 85dvh; overflow: auto; }
.sheet h2 { font-size: 18px; }
.library { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.library button { aspect-ratio: 1; padding: 0; border: 2px solid var(--ink); border-radius: 8px; overflow: hidden; background: var(--paper); }
.library img { width: 100%; height: 100%; object-fit: cover; }
.busy { position: fixed; inset: 0; background: rgba(255, 246, 229, .94); z-index: 20; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 24px; text-align: center; }
.busy img { width: 110px; }
.busy .bar { width: 80%; max-width: 320px; }
.toast { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); background: var(--ink); color: var(--paper); padding: 10px 16px;
  border-radius: var(--radius-md); font-weight: 700; font-size: 14px; z-index: 30; opacity: 0; pointer-events: none; transition: opacity .2s; max-width: 90vw; }
.toast.on { opacity: 1; }
.spin { width: 36px; height: 36px; border: 4px solid var(--ivory-deep); border-top-color: var(--blue); border-radius: 50%; animation: spin 1s linear infinite; margin: 0 auto; }
@keyframes spin { to { transform: rotate(360deg); } }
