/* Фотостудия AI TERRA — мини-приложение MAX.
   Светлая тёплая палитра, под телефон (от 320 px), системный шрифт как в MAX UI. */

:root {
  --bg: #FBF6F0;          /* тёплый молочный фон */
  --surface: #FFFFFF;
  --surface-2: #F4ECE3;   /* песочные подложки */
  --line: #EADFD3;
  --text: #2A211C;
  --text-2: #6F625A;
  --text-3: #9C8F86;
  --accent: #C0612F;      /* терракота — «TERRA» */
  --accent-press: #A65226;
  --accent-soft: #F7E5D8;
  --gold: #E6A23C;
  --ok: #3E8E5A;
  --bad: #C0443A;
  --radius: 16px;
  --radius-s: 12px;
  --shadow: 0 1px 2px rgba(80, 50, 30, .06), 0 6px 20px rgba(80, 50, 30, .07);
  --tabbar-h: 60px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.4 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }

.app { max-width: 520px; margin: 0 auto; min-height: 100vh; padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + 16px); }

/* ── Шапка ─────────────────────────────────────── */
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px;
  background: rgba(251, 246, 240, .92);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid rgba(234, 223, 211, .7);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand__logo { width: 32px; height: 32px; border-radius: 9px; }
.brand__text { display: flex; flex-direction: column; line-height: 1.1; }
.brand__name { font-weight: 700; font-size: 15px; letter-spacing: -.01em; }
.brand__sub { font-size: 11px; font-weight: 600; letter-spacing: .14em; color: var(--accent); }
.dev-badge { font-size: 10px; padding: 2px 6px; border-radius: 6px; background: #FFF0C2; color: #7A5A00; }
.energy-chip {
  display: inline-flex; align-items: center; gap: 2px;
  border: 0; border-radius: 999px; padding: 7px 12px;
  background: var(--surface); box-shadow: var(--shadow);
  font-weight: 700; font-size: 15px; cursor: pointer;
}
.bolt { color: var(--gold); }

main { padding: 12px 16px 0; }
.screen { animation: fade .18s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ── Главная ───────────────────────────────────── */
.gift {
  display: flex; gap: 12px; align-items: center;
  padding: 12px 14px; margin-bottom: 14px;
  border-radius: var(--radius); background: linear-gradient(135deg, #FFF3E3, #FBE3D2);
  border: 1px solid #F3D3BC;
}
.gift__icon { font-size: 26px; }
.gift__title { font-weight: 700; }
.gift__text { font-size: 13px; color: var(--text-2); }

.hero { padding: 6px 2px 4px; }
.hero__title { margin: 0 0 6px; font-size: 24px; line-height: 1.18; letter-spacing: -.02em; }
.hero__text { margin: 0; color: var(--text-2); }

.section-title { margin: 22px 2px 10px; font-size: 18px; letter-spacing: -.01em; }

.tpl-list { display: grid; gap: 14px; }
.tpl {
  display: block; width: 100%; text-align: left; padding: 0; border: 0; cursor: pointer;
  background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
}
.tpl:active { transform: scale(.99); }
.tpl__media { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 2px; background: var(--surface-2); }
.tpl__media img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; }
.tpl__price {
  position: absolute; right: 10px; top: 10px;
  padding: 4px 10px; border-radius: 999px; font-weight: 700; font-size: 13px;
  background: rgba(255, 255, 255, .92); box-shadow: var(--shadow);
}
.tpl__body { padding: 12px 14px 14px; }
.tpl__title { font-weight: 700; font-size: 17px; }
.tpl__sub { color: var(--text-2); font-size: 13px; margin-top: 2px; }
.tpl__meta { color: var(--text-3); font-size: 12px; margin-top: 6px; }

.sales {
  display: flex; align-items: center; margin: 18px 0 6px; padding: 14px 16px;
  border-radius: var(--radius); text-decoration: none; color: #fff;
  background: linear-gradient(135deg, #3A2A22, #5A3A2A);
  box-shadow: var(--shadow);
}
.sales__title { font-weight: 700; font-size: 16px; }
.sales__text { font-size: 13px; opacity: .8; margin-top: 2px; }

/* ── Экран шаблона ─────────────────────────────── */
.back {
  border: 0; background: none; padding: 4px 0 10px; color: var(--accent); font-weight: 600; cursor: pointer;
}
.examples { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.examples img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: var(--radius-s); background: var(--surface-2); }
.tpl-title { margin: 14px 0 4px; font-size: 22px; letter-spacing: -.02em; }
.tpl-desc { margin: 0; color: var(--text-2); }
.gender { margin: 14px 0 0; }
.gender__label { font-size: 13px; color: var(--text-2); margin: 0 2px 6px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 12px; background: var(--surface-2); }
.seg__btn { border: 0; background: none; padding: 10px 6px; border-radius: 9px; font-weight: 600; font-size: 15px; color: var(--text-2); cursor: pointer; }
.seg__btn.is-active { background: var(--surface); color: var(--accent); box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }
.examples img { transition: opacity .2s, box-shadow .2s; }
.examples.has-choice img { opacity: .45; }
.examples.has-choice img.is-chosen { opacity: 1; box-shadow: 0 0 0 3px var(--accent); }
.facts { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 16px; }
.fact { padding: 5px 10px; border-radius: 999px; background: var(--surface-2); font-size: 13px; color: var(--text-2); }

.upload {
  position: relative; display: block; cursor: pointer;
  border: 1.5px dashed #DCC7B5; border-radius: var(--radius); background: var(--surface);
  min-height: 150px; overflow: hidden;
}
.upload__empty { padding: 22px 16px; text-align: center; }
.upload__plus {
  width: 44px; height: 44px; margin: 0 auto 8px; border-radius: 50%;
  display: grid; place-items: center; font-size: 26px; line-height: 1;
  background: var(--accent-soft); color: var(--accent);
}
.upload__title { font-weight: 700; }
.upload__hint { font-size: 13px; color: var(--text-3); margin-top: 4px; }
.upload__preview { width: 100%; max-height: 360px; object-fit: contain; background: var(--surface-2); }
.upload__change {
  position: absolute; right: 10px; bottom: 10px; padding: 6px 12px; border-radius: 999px;
  background: rgba(42, 33, 28, .72); color: #fff; font-size: 13px; font-weight: 600;
}
.fine { font-size: 12px; color: var(--text-3); margin: 10px 2px 0; }

.cta-bar {
  position: sticky; bottom: calc(var(--tabbar-h) + var(--safe-b) + 8px);
  margin-top: 16px; padding-top: 8px;
}
.cta-note { margin-top: 8px; padding: 6px 10px; border-radius: 10px; background: rgba(251, 246, 240, .96); box-shadow: 0 1px 4px rgba(80, 50, 30, .08); font-size: 13px; color: var(--text-2); text-align: center; }

/* ── Кнопки ────────────────────────────────────── */
.btn {
  display: block; width: 100%; padding: 14px 16px; border-radius: 14px; border: 0; cursor: pointer;
  font-weight: 700; font-size: 16px; text-align: center; transition: background .15s, opacity .15s;
}
.btn--primary { background: var(--accent); color: #fff; box-shadow: 0 6px 16px rgba(192, 97, 47, .28); }
.btn--primary:active { background: var(--accent-press); }
.btn--primary:disabled { background: #D9C9BC; box-shadow: none; cursor: default; }
.btn--ghost { background: var(--surface); color: var(--text); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn--light { background: rgba(255, 255, 255, .7); color: var(--text-2); margin-top: 12px; }
.btn--light:disabled { opacity: .9; cursor: default; }
.btn--link { background: none; color: var(--accent); margin-top: 6px; }
.btn--on-dark { background: rgba(255, 255, 255, .12); color: #fff; box-shadow: none; }
.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }

/* ── Ожидание и результат ──────────────────────── */
.wait { text-align: center; padding-top: 12px; }
.wait__frame { position: relative; width: 62%; max-width: 260px; margin: 0 auto; border-radius: var(--radius); overflow: hidden; background: var(--surface-2); aspect-ratio: 3 / 4; }
.wait__img { width: 100%; height: 100%; object-fit: cover; filter: blur(14px) saturate(.7); transform: scale(1.1); opacity: .75; }
.wait__shine {
  position: absolute; inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .55) 50%, transparent 70%);
  background-size: 250% 100%; animation: shine 1.6s linear infinite;
}
@keyframes shine { from { background-position: 120% 0; } to { background-position: -120% 0; } }
.wait__title { margin: 18px 0 6px; font-size: 22px; }
.wait__text { margin: 0 auto; max-width: 320px; color: var(--text-2); }
.dots { display: flex; gap: 6px; justify-content: center; margin-top: 16px; }
.dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: dot 1s infinite ease-in-out; }
.dots i:nth-child(2) { animation-delay: .15s; } .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 0%, 100% { opacity: .25; transform: scale(.8); } 50% { opacity: 1; transform: none; } }

.result__img { width: 100%; border-radius: var(--radius); box-shadow: var(--shadow); background: var(--surface-2); aspect-ratio: 3 / 4; object-fit: cover; }
.result__title { margin: 16px 0 4px; font-size: 22px; text-align: center; }
.result__text { margin: 0; color: var(--text-2); text-align: center; }
.fail__icon { width: 64px; height: 64px; margin: 24px auto 0; border-radius: 50%; display: grid; place-items: center; font-size: 30px; background: var(--accent-soft); color: var(--accent); }
#resultFail .btn { margin-top: 18px; }

/* ── Пополнение ────────────────────────────────── */
.test-note { margin: 12px 0 0; padding: 8px 12px; border-radius: 10px; background: #FFF3C4; color: #7A5A00; font-size: 13px; font-weight: 600; }
.packs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.pack {
  position: relative; text-align: left; padding: 14px 12px 12px; border-radius: var(--radius); cursor: pointer;
  background: var(--surface); border: 2px solid transparent; box-shadow: var(--shadow);
}
.pack.is-active { border-color: var(--accent); background: #FFF9F4; }
.pack__energy { font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
.pack__frames { font-size: 13px; color: var(--text-2); margin-top: 2px; }
.pack__price { font-size: 17px; font-weight: 700; margin-top: 10px; }
.pack__per { font-size: 12px; color: var(--text-3); }
.pack__badge { position: absolute; top: -9px; right: 10px; padding: 2px 8px; border-radius: 999px; background: var(--ok); color: #fff; font-size: 11px; font-weight: 700; }
.consent { display: flex; gap: 10px; align-items: flex-start; margin: 16px 2px 0; font-size: 13px; color: var(--text-2); cursor: pointer; }
.consent input { width: 20px; height: 20px; margin: 0; flex: none; accent-color: var(--accent); }
.consent a, .links__item--a { color: var(--accent); }
.pay-wait, .pay-done { margin-top: 16px; padding: 18px 16px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); text-align: center; }
.pay-wait .dots { margin: 0 0 10px; }
.pay-wait__title, .pay-done__title { font-weight: 700; font-size: 17px; }
.pay-wait__text { font-size: 13px; color: var(--text-2); margin: 4px 0 12px; }
.pay-done__icon { font-size: 36px; }
.pay-done .btn { margin-top: 12px; }

/* ── Первое окно: согласие и «скоро откроемся» ─ */
.consent--gate { margin: 0 0 10px; text-align: left; }
.modal__fine { margin: 0 0 14px; font-size: 12px; color: var(--text-3); text-align: left; }
.modal__fine a, .consent--gate a, .fine a { color: var(--accent); }
.launch { margin-bottom: 14px; padding: 12px 14px; border-radius: var(--radius); background: #FFF3C4; color: #6B5000; font-size: 14px; }

/* ── Реферальная программа ─────────────────────── */
.invite-row { display: flex; align-items: center; gap: 12px; width: 100%; margin-top: 12px; padding: 12px 14px; border: 0; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); text-align: left; cursor: pointer; }
.invite-row__icon { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 20px; background: var(--accent-soft); }
.invite-row__text { flex: 1; min-width: 0; }
.invite-row__text b { display: block; font-size: 15px; }
.invite-row__text small { display: block; font-size: 12px; color: var(--text-2); line-height: 1.3; }
.invite-row__arrow { color: var(--text-3); font-size: 22px; }
.ref-link { margin-top: 14px; padding: 14px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.ref-link__label { font-size: 13px; color: var(--text-2); margin-bottom: 6px; }
.ref-link__url { padding: 10px 12px; border-radius: var(--radius-s); background: var(--surface-2); font-size: 13px; word-break: break-all; user-select: all; }
.ref-link .btn-row { margin-top: 12px; }
.ref-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.ref-stat { padding: 12px 6px; border-radius: var(--radius-s); background: var(--surface); box-shadow: var(--shadow); text-align: center; }
.ref-stat b { display: block; font-size: 22px; letter-spacing: -.02em; }
.ref-stat > span { font-size: 12px; color: var(--text-2); }
.ref-terms { margin: 0; padding-left: 20px; color: var(--text-2); font-size: 14px; }
.ref-terms li { margin: 6px 0; }
.ref-rules { display: inline-block; margin-top: 8px; color: var(--accent); font-size: 14px; }
.ref-banner { margin: 0 0 12px; padding: 10px 12px; border-radius: var(--radius-s); background: linear-gradient(135deg, #FFF3E3, #FBE3D2); border: 1px solid #F3D3BC; color: var(--text); font-size: 14px; text-align: left; }

/* ── Удаление аккаунта ─────────────────────────── */
.link-danger { justify-self: start; margin-top: 6px; padding: 0; border: 0; background: none; color: var(--bad); font: inherit; font-size: 13px; text-decoration: underline; cursor: pointer; }
.btn--danger { background: var(--bad); color: #fff; }
.btn--danger:disabled { opacity: .6; }
.modal__card.modal__card--left { text-align: left; }
.modal__card--left .modal__text, .modal__card--left .del-warn { text-align: left; }
.modal__card--left .modal__title { text-align: center; }
.del-list { margin: 0 0 12px; padding-left: 20px; color: var(--text-2); font-size: 14px; }
.del-list li { margin: 4px 0; }
.del-warn { margin: 0 0 12px; padding: 10px 12px; border-radius: var(--radius-s); background: #FDECEA; color: #8A2A22; font-size: 14px; }
.del-warn a { color: #8A2A22; font-weight: 600; }

/* ── Метки у шаблонов ──────────────────────────── */
.tpl__badge { position: absolute; left: 10px; top: 10px; padding: 4px 10px; border-radius: 999px; background: var(--accent); color: #fff; font-weight: 700; font-size: 12px; }
.tpl__media--one { grid-template-columns: 1fr; }
.tpl__media--one img { aspect-ratio: 4 / 3; }

/* ── Инструменты и реставрация ─────────────────── */
.tool-list { display: grid; gap: 10px; margin-top: 16px; }
.tool-card { display: flex; gap: 14px; align-items: center; width: 100%; text-align: left; padding: 14px; border: 0; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); cursor: pointer; }
.tool-card__icon { flex: none; width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-size: 22px; background: var(--accent-soft); }
.tool-card__title { font-weight: 700; font-size: 16px; }
.tool-card__sub { font-size: 13px; color: var(--text-2); }
.tool-card__price { margin-left: auto; font-weight: 700; white-space: nowrap; }
.ba { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 14px 0 4px; }
.ba figure { margin: 0; position: relative; }
.ba img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: var(--radius-s); background: var(--surface-2); }
.ba figcaption { position: absolute; left: 8px; bottom: 8px; padding: 2px 8px; border-radius: 999px; background: rgba(42, 33, 28, .7); color: #fff; font-size: 12px; font-weight: 600; }
.tf-slot { margin-top: 14px; }
.tf-block { margin-top: 14px; }
.tf-label { font-size: 13px; color: var(--text-2); margin: 0 2px 6px; }
.tf-text { width: 100%; min-height: 96px; padding: 12px; border: 1.5px solid var(--line); border-radius: var(--radius-s); background: var(--surface); font: inherit; color: var(--text); resize: vertical; }
.tf-text:focus { outline: none; border-color: var(--accent); }
.tf-count { text-align: right; font-size: 12px; color: var(--text-3); margin-top: 4px; }
.tf-count.is-over { color: var(--bad); font-weight: 700; }
.tf-opt { display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin-top: 8px; background: var(--surface); border-radius: var(--radius-s); cursor: pointer; }
.tf-opt input { width: 22px; height: 22px; margin: 0; accent-color: var(--accent); flex: none; }
.tf-opt b { display: block; font-size: 15px; }
.tf-opt small { color: var(--text-3); font-size: 12px; }
.tf-warn { margin-top: 8px; padding: 10px 12px; border-radius: var(--radius-s); background: #FFF3C4; color: #6B5000; font-size: 13px; }
.upload--small { min-height: 110px; }
.tf-moder { margin-top: 10px; padding: 10px 12px; border-radius: var(--radius-s); background: #FDECEA; color: #8A2A22; font-size: 14px; }

/* ── Документы в приложении ─────────────────────── */
.doclist { list-style: none; margin: 14px 0 0; padding: 0; background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.doclist li { border-bottom: 1px solid var(--line); }
.doclist li:last-child { border-bottom: 0; }
.doclist a { display: block; padding: 14px 16px; color: var(--text); text-decoration: none; font-weight: 600; }
.doclist a::after { content: '›'; float: right; color: var(--text-3); }

/* ── Публичная витрина (открыто не из MAX) ─────── */
.sc { max-width: 760px; margin: 0 auto; min-height: 100vh; }
.sc-max { padding: 8px 14px; border-radius: 999px; background: var(--accent); color: #fff; text-decoration: none; font-weight: 700; font-size: 14px; white-space: nowrap; }
.sc-main { padding: 12px 16px 0; }
.sc-hero { padding: 18px 2px 4px; }
.sc-hero h1 { margin: 0 0 8px; font-size: 28px; line-height: 1.15; letter-spacing: -.02em; }
.sc-hero p { margin: 0 0 16px; color: var(--text-2); font-size: 16px; }
.sc-hero .btn, .sc-cta { text-decoration: none; }
.sc-note { margin-top: 8px; font-size: 13px; color: var(--text-3); text-align: center; }
.sc-steps { margin: 0; padding: 0; list-style: none; counter-reset: s; display: grid; gap: 10px; }
.sc-steps li { counter-increment: s; position: relative; padding: 14px 14px 14px 56px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); color: var(--text-2); }
.sc-steps li b { color: var(--text); }
.sc-steps li::before { content: counter(s); position: absolute; left: 14px; top: 14px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 800; }
.sc-gallery { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sc-gallery img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: var(--radius-s); background: var(--surface-2); }
.sc-card { padding: 14px 16px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); }
.sc-price-lead { margin: 0 0 6px; }
.prices { width: 100%; border-collapse: collapse; }
.prices td { padding: 9px 4px; border-bottom: 1px solid var(--line); }
.prices tr:last-child td { border-bottom: 0; }
.prices td:last-child { text-align: right; }
.sc-small { margin: 8px 0 0; font-size: 13px; color: var(--text-3); }
.sc-list { margin: 0; padding-left: 20px; color: var(--text-2); }
.sc-list li { margin: 6px 0; }
.sc-cta { margin: 22px 0 8px; }
.sc-foot { margin-top: 18px; padding: 18px 16px 28px; border-top: 1px solid var(--line); font-size: 13px; color: var(--text-3); }
.sc-foot nav { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-bottom: 10px; }
.sc-foot a { color: var(--text-2); }

/* ── Скоро ─────────────────────────────────────── */
.soon { text-align: center; padding: 36px 8px; }
.soon__icon { font-size: 44px; }
.soon__title { font-size: 21px; margin: 10px 0 8px; }
.soon__text { color: var(--text-2); margin: 0 auto; max-width: 340px; }
.soon__list { text-align: left; color: var(--text-2); padding-left: 18px; margin: 0 auto; max-width: 360px; }
.soon__list li { margin: 8px 0; }
.soon__badge { display: inline-block; margin-top: 16px; padding: 5px 12px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 13px; }

/* ── Профиль ───────────────────────────────────── */
.me { display: flex; align-items: center; gap: 12px; margin: 4px 0 14px; }
.me__avatar { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 20px; background: var(--accent-soft); color: var(--accent); }
.me__name { font-weight: 700; font-size: 17px; }
.me__sub { font-size: 13px; color: var(--text-3); }

.balance { padding: 16px; border-radius: var(--radius); background: linear-gradient(135deg, #FFE9D6, #F6D3BA); box-shadow: var(--shadow); }
.balance__label { font-size: 13px; color: var(--text-2); }
.balance__value { font-size: 34px; font-weight: 800; letter-spacing: -.02em; }
.balance__hint { font-size: 13px; color: var(--text-2); }

.tabs2 { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin: 18px 0 12px; padding: 4px; border-radius: 12px; background: var(--surface-2); }
.tabs2__btn { border: 0; background: none; padding: 9px 6px; border-radius: 9px; font-weight: 600; font-size: 14px; color: var(--text-2); cursor: pointer; }
.tabs2__btn.is-active { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }

.works { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.work { position: relative; padding: 0; border: 0; cursor: pointer; border-radius: var(--radius-s); overflow: hidden; background: var(--surface-2); aspect-ratio: 3 / 4; }
.work img { width: 100%; height: 100%; object-fit: cover; }
.work__cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 8px 6px; font-size: 11px; color: #fff; text-align: left; background: linear-gradient(transparent, rgba(0, 0, 0, .55)); }
.work--pending { display: grid; place-items: center; color: var(--text-3); font-size: 13px; }
.empty { padding: 26px 12px; text-align: center; color: var(--text-3); background: var(--surface); border-radius: var(--radius); }

.history { list-style: none; margin: 0; padding: 0; background: var(--surface); border-radius: var(--radius); overflow: hidden; }
.history li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.history li:last-child { border-bottom: 0; }
.h__title { font-weight: 600; }
.h__sub { font-size: 12px; color: var(--text-3); }
.h__amt { font-weight: 700; white-space: nowrap; }
.h__amt--plus { color: var(--ok); }
.h__amt--minus { color: var(--text); }

.links { display: grid; gap: 6px; margin: 16px 2px 0; font-size: 13px; color: var(--text-3); }

/* ── Нижние вкладки ────────────────────────────── */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(4, 1fr);
  max-width: 520px; margin: 0 auto;
  height: calc(var(--tabbar-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: rgba(255, 255, 255, .96); border-top: 1px solid var(--line);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.tab { border: 0; background: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; color: var(--text-3); cursor: pointer; padding: 0 2px; }
.tab svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tab.is-active { color: var(--accent); font-weight: 600; }

/* ── Окна ──────────────────────────────────────── */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgba(42, 33, 28, .45); }
.modal__card { width: 100%; max-width: 380px; padding: 24px 20px 18px; border-radius: 20px; background: var(--surface); text-align: center; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
.modal__logo { margin: 0 auto 10px; border-radius: 16px; }
.modal__big { font-size: 48px; }
.modal__title { margin: 6px 0 8px; font-size: 20px; }
.modal__text { margin: 0 0 16px; color: var(--text-2); }
.modal__text--small { font-size: 13px; margin: 10px 0 0; color: var(--bad); }

.viewer { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; background: #16110E; }
.viewer img { flex: 1; min-height: 0; width: 100%; object-fit: contain; }
.viewer__bar { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 12px 16px calc(12px + var(--safe-b)); }

.toast {
  position: fixed; left: 16px; right: 16px; top: 12px; z-index: 70; margin: 0 auto; max-width: 488px;
  padding: 12px 14px; border-radius: 14px; background: #2A211C; color: #fff; font-size: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
}

@media (min-width: 640px) {
  .sc-gallery { grid-template-columns: repeat(3, 1fr); }
}
.sc-foot a, .sc-card a { overflow-wrap: anywhere; }
