:root {
    --bg: var(--tg-theme-bg-color, #ffffff);
    --text: var(--tg-theme-text-color, #1c1c1e);
    --hint: var(--tg-theme-hint-color, #8e8e93);
    --card: var(--tg-theme-secondary-bg-color, #f2f2f7);
    --accent: var(--tg-theme-button-color, #e05a7d);
    --accent-text: var(--tg-theme-button-text-color, #ffffff);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    padding: 16px;
    -webkit-tap-highlight-color: transparent;
}

.app-header h1 { font-size: 24px; margin-bottom: 20px; }

.categories {
    display: flex; gap: 8px; overflow-x: auto;
    padding-bottom: 12px; margin-bottom: 16px;
}
.category-chip {
    flex-shrink: 0; padding: 8px 16px; background: var(--card);
    border: none; border-radius: 20px; color: var(--text);
    font-size: 14px; cursor: pointer; transition: all 0.15s;
}
.category-chip.active { background: var(--accent); color: var(--accent-text); }

.templates { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.template-card {
    background: var(--card); border-radius: 16px; overflow: hidden;
    cursor: pointer; transition: transform 0.15s;
}
.template-card:active { transform: scale(0.97); }
.template-preview {
    width: 100%; height: 120px;
    background: linear-gradient(135deg, #f093a7, #e05a7d);
    display: flex; align-items: center; justify-content: center; font-size: 40px;
}
.template-info { padding: 12px; }
.template-title { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.template-desc { font-size: 12px; color: var(--hint); line-height: 1.4; }

.status { text-align: center; color: var(--hint); padding: 20px; font-size: 14px; }

.back-btn {
    background: none; border: none; color: var(--accent);
    font-size: 16px; cursor: pointer; padding: 0; margin-bottom: 12px;
}
.price-badge {
    display: inline-block; margin-top: 8px; padding: 6px 14px;
    background: var(--accent); color: var(--accent-text);
    border-radius: 20px; font-size: 14px; font-weight: 600;
}

.card-form { margin-top: 20px; display: flex; flex-direction: column; gap: 16px; }
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-field label { font-size: 14px; font-weight: 500; color: var(--text); }
.form-field input,
.form-field textarea {
    padding: 12px; border: 1px solid var(--hint); border-radius: 12px;
    background: var(--bg); color: var(--text); font-size: 16px;
    font-family: inherit; resize: vertical;
}
.form-field input:focus, .form-field textarea:focus {
    outline: none; border-color: var(--accent);
}

.photo-input {
    padding: 10px; border: 1px dashed var(--hint); border-radius: 12px;
    background: var(--card); font-size: 14px;
}
.photo-previews { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.photo-thumb {
    width: 72px; height: 72px; border-radius: 10px; overflow: hidden;
    background: var(--card);
}
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; }

.submit-btn {
    margin-top: 8px; padding: 16px; background: var(--accent);
    color: var(--accent-text); border: none; border-radius: 14px;
    font-size: 16px; font-weight: 600; cursor: pointer;
}

.preview-card {
    position: relative; background: linear-gradient(135deg, #fce4ec, #f8bbd0);
    border-radius: 20px; padding: 32px 24px; overflow: hidden; margin-bottom: 16px;
}
.watermark {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%) rotate(-30deg);
    font-size: 32px; font-weight: 800; color: rgba(0, 0, 0, 0.12);
    letter-spacing: 4px; pointer-events: none; white-space: nowrap;
}
.preview-content { position: relative; text-align: center; color: #4a2530; }
.preview-emoji { font-size: 48px; margin-bottom: 12px; }
.preview-title { font-size: 20px; margin-bottom: 16px; }
.preview-line { font-size: 15px; line-height: 1.6; margin-bottom: 8px; text-align: left; }
.preview-photo {
    width: 100%; border-radius: 12px; margin-bottom: 12px; display: block;
}

.watermark-note {
    font-size: 13px; color: var(--hint); background: var(--card);
    padding: 12px; border-radius: 12px; margin-bottom: 20px; line-height: 1.5;
}
.pay-block { display: flex; flex-direction: column; gap: 12px; }
.pay-price { font-size: 18px; text-align: center; }

.success-screen { text-align: center; padding: 40px 16px; }
.success-emoji { font-size: 64px; margin-bottom: 16px; }
.success-text { color: var(--hint); font-size: 15px; line-height: 1.5; margin: 12px 0 24px; }
.link-box {
    background: var(--card); padding: 14px; border-radius: 12px;
    font-size: 13px; word-break: break-all; margin-bottom: 16px;
    border: 1px dashed var(--hint);
}

/* Страница открытия открытки получателем */
.card-view { min-height: 100dvh; display: block; }
.sealed { text-align: center; padding: 40px 20px; }
.sealed-envelope { font-size: 90px; margin-bottom: 20px; animation: float 3s ease-in-out infinite; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
.sealed-title { font-size: 26px; line-height: 1.3; margin-bottom: 12px; }
.sealed-hint { color: var(--hint); font-size: 15px; margin-bottom: 28px; }
.open-btn {
    padding: 16px 40px; background: var(--accent); color: var(--accent-text);
    border: none; border-radius: 30px; font-size: 18px; font-weight: 600;
    cursor: pointer; box-shadow: 0 6px 20px rgba(224, 90, 125, 0.4);
}
.card-opened {
    text-align: center; padding: 40px 24px;
    background: linear-gradient(135deg, #fce4ec, #f8bbd0);
    border-radius: 24px; color: #4a2530; width: 100%; animation: reveal 0.6s ease;
}
@keyframes reveal { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: scale(1); } }
.card-opened-emoji { font-size: 64px; margin-bottom: 20px; }
.card-opened .preview-photo { max-width: 320px; margin: 0 auto 16px; }
.card-line { font-size: 18px; line-height: 1.6; margin-bottom: 12px; }
.responses { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }
.response-btn { width: 100%; box-shadow: none; }
.media-preview { width: 100%; border-radius: 12px; margin-top: 8px; display: block; }
.voice-controls { display: flex; align-items: center; gap: 12px; }
.voice-btn {
    padding: 10px 18px; background: var(--accent); color: var(--accent-text);
    border: none; border-radius: 12px; font-size: 15px; cursor: pointer;
}
.rec-status { font-size: 13px; color: var(--accent); }
.audio-row { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.audio-row audio { flex: 1; }
.profile-btn {
    background: var(--card); border: none; border-radius: 20px;
    padding: 8px 16px; color: var(--text); font-size: 14px;
    cursor: pointer; margin-bottom: 16px;
}
.balance-card {
    background: linear-gradient(135deg, #e05a7d, #b8456a);
    border-radius: 18px; padding: 24px; color: #fff; margin-bottom: 20px;
}
.balance-label { font-size: 13px; opacity: 0.85; margin-bottom: 6px; }
.balance-value { font-size: 32px; font-weight: 700; }
.section-title { font-size: 16px; font-weight: 600; margin-bottom: 12px; }
.topup-box, .ref-box, .withdraw-box {
    background: var(--card); border-radius: 16px; padding: 16px; margin-bottom: 16px;
}
.topup-buttons { display: flex; gap: 8px; margin-bottom: 12px; }
.chip-btn {
    flex: 1; padding: 12px; background: var(--bg); border: 1px solid var(--hint);
    border-radius: 12px; color: var(--text); font-size: 15px; cursor: pointer;
}
.topup-custom { display: flex; gap: 8px; }
.topup-custom input, .withdraw-box input {
    flex: 1; padding: 12px; border: 1px solid var(--hint); border-radius: 12px;
    background: var(--bg); color: var(--text); font-size: 15px; margin-bottom: 8px;
}
.submit-btn.compact { margin-top: 0; padding: 12px 20px; }
.ref-text { font-size: 14px; color: var(--hint); line-height: 1.5; margin-bottom: 12px; }
.wd-row {
    display: flex; justify-content: space-between; padding: 12px;
    background: var(--card); border-radius: 12px; margin-bottom: 8px; font-size: 14px;
}
.app-footer {
    display: flex; flex-wrap: wrap; gap: 14px; justify-content: center;
    padding: 24px 12px 16px; margin-top: 32px;
    border-top: 1px solid var(--card);
}
.app-footer a {
    color: var(--hint); font-size: 13px; text-decoration: none;
}
.app-footer a:hover { color: var(--accent); }
.submit-btn.secondary {
    background: var(--card); color: var(--text);
    border: 1px solid var(--hint);
}
.link-collapse { margin-top: 24px; }
.link-toggle {
    background: none; border: none; color: var(--hint);
    font-size: 13px; cursor: pointer; text-decoration: underline;
    padding: 8px;
}
.hidden { display: none; }
.screen-title { font-size: 20px; margin: 8px 0 18px; text-align: center; }
.recipients-screen { grid-column: 1 / -1; }
.recipients-grid {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px;
}
.recipient-tile {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 8px; padding: 22px 12px; background: var(--card); border: none;
    border-radius: 18px; cursor: pointer; color: var(--text);
    transition: transform 0.15s;
}
.recipient-tile:active { transform: scale(0.96); }
.recipient-tile img {
    width: 64px; height: 64px; object-fit: cover; border-radius: 50%;
}
.recipient-emoji { font-size: 40px; line-height: 1; }
.recipient-title { font-size: 15px; font-weight: 600; text-align: center; }
.skip-btn {
    display: block; width: 100%; margin: 24px auto 0;
    background: var(--card);
    border: 2px solid var(--accent);
    color: var(--accent);
    font-size: 16px; font-weight: 700;
    cursor: pointer; padding: 16px 18px;
    border-radius: 16px;
    transition: transform 0.15s;
}
.skip-btn:active { transform: scale(0.97); }
.back-chip { background: var(--accent) !important; color: var(--accent-text) !important; }
.template-preview img { width: 100%; height: 100%; object-fit: cover; }
.header-actions { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.form-hint { font-size: 13px; color: var(--hint); margin-top: 6px; }

.tp-cover {
    width: 100%; height: 200px; border-radius: 18px; overflow: hidden;
    margin-bottom: 20px; background: linear-gradient(135deg, #f093a7, #e05a7d);
}
.tp-cover img { width: 100%; height: 100%; object-fit: cover; }
.tp-cover-emoji { display: flex; align-items: center; justify-content: center; font-size: 72px; }
.tp-title { font-size: 24px; margin-bottom: 8px; }
.tp-desc { color: var(--hint); font-size: 15px; line-height: 1.5; margin-bottom: 20px; }
.tp-features { background: var(--card); border-radius: 14px; padding: 16px; margin-bottom: 16px; }
.tp-features-title { font-size: 14px; font-weight: 600; margin-bottom: 10px; }
.tp-features ul { margin: 0; padding-left: 20px; }
.tp-features li { font-size: 14px; margin-bottom: 6px; }
.tp-note {
    font-size: 13px; color: var(--hint); background: var(--card);
    padding: 12px; border-radius: 12px; margin-bottom: 20px; line-height: 1.5;
}

.checkout-box { background: var(--card); border-radius: 18px; padding: 20px; margin-top: 20px; }
.checkout-emoji { font-size: 48px; text-align: center; margin-bottom: 12px; }
.checkout-text { text-align: center; color: var(--hint); margin-bottom: 20px; }
.checkout-row {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 17px; padding-bottom: 14px; border-bottom: 1px solid var(--bg); margin-bottom: 14px;
}
.checkout-includes { font-size: 13px; color: var(--hint); line-height: 1.5; margin-bottom: 16px; }
.promo-row input {
    width: 100%; padding: 12px; border: 1px solid var(--hint); border-radius: 12px;
    background: var(--bg); color: var(--text); font-size: 15px; margin-bottom: 12px;
}
.checkout-hint { font-size: 12px; color: var(--hint); text-align: center; margin-top: 10px; }

.idea-box { background: var(--card); border-radius: 18px; padding: 20px; margin-top: 12px; }
.idea-intro { font-size: 15px; color: var(--hint); line-height: 1.5; margin-bottom: 16px; }
.idea-textarea {
    width: 100%; padding: 14px; border: 1px solid var(--hint); border-radius: 12px;
    background: var(--bg); color: var(--text); font-size: 15px;
    font-family: inherit; resize: vertical; margin-bottom: 12px;
}
.idea-row {
    background: var(--card); border-radius: 12px; padding: 14px; margin-bottom: 10px;
}
.idea-row-text { font-size: 14px; line-height: 1.5; margin-bottom: 6px; }
.idea-row-status { font-size: 12px; color: var(--hint); }
.bot-link-screen { text-align: center; padding: 40px 20px; }
.bot-link-emoji { font-size: 64px; margin-bottom: 16px; }
.bot-link-title { font-size: 22px; margin-bottom: 12px; }
.bot-link-text {
    color: var(--hint); font-size: 15px; line-height: 1.6;
    margin-bottom: 28px; max-width: 340px; margin-left: auto; margin-right: auto;
}
.bot-link-hint { font-size: 12px; color: var(--hint); margin-top: 14px; }
.tpl-host {
    margin-bottom: 16px;
    /* Запрет «таскать» открытку вбок: разрешаем только вертикальную прокрутку */
    touch-action: pan-y;
    overflow-x: hidden;
    overscroll-behavior-x: contain;
}
.card-view {
    display: block; padding: 0; min-height: 100dvh;
    touch-action: pan-y;
    overflow-x: hidden;
    overscroll-behavior-x: contain;
}
.card-extra { margin-top: 16px; }
.edit-hint {
    background: var(--card); border-radius: 14px; padding: 14px;
    font-size: 13px; line-height: 1.6; color: var(--hint); margin-bottom: 16px;
}
.extra-media-title { font-size: 15px; font-weight: 600; margin: 24px 0 10px; }

/* Подсказки редактируемых слотов */
.wt-tip {
    display: block; font-size: 11px; color: var(--accent);
    margin-bottom: 4px; font-weight: 600; letter-spacing: 0.3px;
}
.wt-editable {
    outline: 2px dashed rgba(255, 107, 157, 0.6); outline-offset: 5px;
    border-radius: 6px; cursor: text; min-height: 20px; transition: outline-color 0.2s;
}
.wt-editable.wt-focus {
    outline: 2px solid #ff6b9d; background: rgba(255, 255, 255, 0.85);
}
.wt-photo-editable { cursor: pointer; position: relative; }
.wt-photo-badge {
    position: absolute; left: 50%; bottom: 6px; transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.65); color: #fff; font-size: 10px;
    padding: 4px 8px; border-radius: 10px; white-space: nowrap; z-index: 3;
}
.wt-fallback { text-align: center; padding: 30px; color: var(--hint); }
/* Табы экранов */
.screen-tabs {
    display: flex; gap: 6px; overflow-x: auto; margin-bottom: 12px; padding-bottom: 4px;
}
.screen-tab {
    flex-shrink: 0; padding: 8px 14px; background: var(--card); border: none;
    border-radius: 14px; font-size: 13px; color: var(--hint); cursor: pointer;
}
.screen-tab.active { background: var(--accent); color: var(--accent-text); }

/* Витрина */
.tp-preview-badge {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    background: var(--accent); color: var(--accent-text);
    font-size: 15px; font-weight: 800; letter-spacing: 0.5px;
    text-transform: uppercase;
    padding: 12px 16px; border-radius: 14px;
    margin-bottom: 16px; text-align: center;
    box-shadow: 0 4px 14px rgba(224, 90, 125, 0.35);
}
.tp-preview-badge small {
    display: block; font-size: 11px; font-weight: 600;
    letter-spacing: 0; text-transform: none; opacity: 0.9; margin-top: 2px;
}
.tp-demo-note {
    background: rgba(224, 90, 125, 0.1); border-radius: 12px; padding: 12px;
    font-size: 13px; line-height: 1.5; margin-bottom: 14px;
}
.wt-demo-slot {
    outline: 2px dashed rgba(255, 107, 157, 0.75); outline-offset: 4px;
    border-radius: 6px; background: rgba(255, 255, 255, 0.5);
}
.wt-demo-badge {
    display: inline-block; background: #ff6b9d; color: #fff; font-size: 10px;
    padding: 3px 8px; border-radius: 8px; margin-bottom: 5px; font-weight: 700;
}

/* Панель редактора */
.editor-panel {
    background: var(--card); border-radius: 18px; padding: 18px; margin: 18px 0;
}
.editor-title { font-size: 17px; font-weight: 700; margin-bottom: 4px; }
.editor-sub { font-size: 13px; color: var(--hint); margin-bottom: 16px; }
.editor-group { margin-bottom: 20px; }
.editor-group-title {
    font-size: 13px; font-weight: 700; color: var(--accent);
    text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 10px;
}
.field-hint { font-size: 12px; color: var(--hint); line-height: 1.5; margin-top: 6px; }
.music-state { font-size: 13px; color: var(--accent); margin-top: 6px; }

.photo-pick {
    display: flex; align-items: center; gap: 12px; padding: 10px;
    background: var(--bg); border: 1px dashed var(--hint); border-radius: 12px; cursor: pointer;
}
.photo-pick-thumb {
    width: 52px; height: 52px; border-radius: 10px; flex-shrink: 0;
    background-size: cover; background-position: center; background-color: var(--card);
}
.photo-pick-thumb.empty::after {
    content: "📷"; display: flex; width: 100%; height: 100%;
    align-items: center; justify-content: center; font-size: 22px; opacity: 0.5;
}
.photo-pick-text { font-size: 14px; color: var(--accent); }

/* Подсветка слота в шаблоне */
.wt-slot { transition: box-shadow 0.25s, outline-color 0.25s; }
.wt-slot.wt-active {
    outline: 3px solid #ff6b9d; outline-offset: 4px; border-radius: 8px;
    box-shadow: 0 0 0 6px rgba(255, 107, 157, 0.2);
}
.wt-photo-badge {
    position: absolute; left: 50%; bottom: 6px; transform: translateX(-50%);
    background: rgba(0,0,0,0.68); color: #fff; font-size: 10px;
    padding: 4px 8px; border-radius: 10px; white-space: nowrap; z-index: 3;
}

/* Простой вид, если оформление не загрузилось */
.simple-card { text-align: center; padding: 24px; }
.simple-photo { width: 100%; border-radius: 14px; margin-bottom: 12px; }
.simple-text { font-size: 16px; line-height: 1.6; margin-bottom: 10px; }
/* Музыка */
.music-tabs { display: flex; gap: 6px; margin-bottom: 10px; }
.music-tab {
    flex: 1; padding: 8px; background: var(--bg); border: 1px solid var(--hint);
    border-radius: 10px; font-size: 13px; color: var(--hint); cursor: pointer;
}
.music-tab.active { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.music-list { max-height: 260px; overflow-y: auto; }
.music-row {
    display: flex; align-items: center; gap: 10px; padding: 10px;
    background: var(--bg); border-radius: 12px; margin-bottom: 8px;
}
.music-row.selected { outline: 2px solid var(--accent); }
.music-play {
    width: 36px; height: 36px; flex-shrink: 0; border: none; border-radius: 50%;
    background: var(--accent); color: #fff; font-size: 14px; cursor: pointer;
}
.music-info { flex: 1; min-width: 0; }
.music-title { font-size: 14px; font-weight: 600; }
.music-author { font-size: 12px; color: var(--hint); }
.music-choose {
    padding: 7px 12px; border: 1px solid var(--accent); background: none;
    color: var(--accent); border-radius: 10px; font-size: 13px; cursor: pointer;
}
.music-pane.hidden { display: none; }

/* Ответ текстом */
.wt-reply { margin-top: 20px; text-align: center; }
.wt-reply-label { font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.wt-reply-input {
    width: 100%; padding: 12px; border-radius: 12px; border: 1px solid #ffb3c6;
    font-size: 15px; font-family: inherit; resize: vertical; margin-bottom: 10px;
}
.wt-reply-btn {
    padding: 12px 26px; border: none; border-radius: 24px; cursor: pointer;
    background: linear-gradient(135deg, #ff6b9d, #ff8fb1); color: #fff;
    font-size: 15px; font-weight: 700;
}
.wt-reply-status { font-size: 13px; color: #8a8a9e; margin-top: 8px; }
.wt-reply-done {
    margin-top: 20px; padding: 14px; background: rgba(255,107,157,0.12);
    border-radius: 14px; font-size: 15px;
}
.field-hint a { color: var(--accent); text-decoration: underline; }

/* --- Мои открытки --- */
.mc-open-btn { margin-top: 10px; }
.mc-list { padding: 4px 0 24px; }
.mc-card { background: var(--card); border-radius: 14px; padding: 14px 16px; margin-bottom: 10px; }
.mc-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.mc-title { font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mc-badge { font-size: 12px; padding: 3px 9px; border-radius: 20px; white-space: nowrap; flex: none; }
.mc-active { background: #e4f7e8; color: #1c8a3b; }
.mc-mod { background: #fff3d6; color: #a06b00; }
.mc-rej { background: #fde4e4; color: #b02020; }
.mc-draft { background: #eceef2; color: #6b7280; }
.mc-date { font-size: 12px; color: var(--hint); margin-top: 3px; }
.mc-share { margin-top: 10px; }
/* ===== Красивый блок пересылки открытки (#7) ===== */
.share-card {
    background: var(--card); border-radius: 16px; padding: 16px;
    margin: 16px 0; text-align: left;
}
.share-card-head { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 14px; }
.share-card-ico { font-size: 22px; line-height: 1.2; }
.share-card-title { font-weight: 700; font-size: 15px; }
.share-card-sub { font-size: 12.5px; color: var(--hint); line-height: 1.4; margin-top: 2px; }

/* ===== Предупреждение перед оплатой (#8) ===== */
.pay-warning {
    background: rgba(224, 90, 125, 0.10);
    border: 1px solid rgba(224, 90, 125, 0.35);
    border-radius: 12px; padding: 12px 14px; margin: 4px 0 14px;
    font-size: 13px; line-height: 1.5; text-align: left;
}

/* ===== Темы: светлая / тёмная / авто (#5) ===== */
html[data-theme="light"] {
    --bg: #ffffff; --text: #1c1c1e; --hint: #8e8e93; --card: #f2f2f7;
    --accent: #e05a7d; --accent-text: #ffffff;
}
html[data-theme="dark"] {
    --bg: #16171b; --text: #ececf0; --hint: #9296a3; --card: #23252b;
    --accent: #e05a7d; --accent-text: #ffffff;
}
.theme-box {
    background: var(--card); border-radius: 16px; padding: 16px; margin-bottom: 16px;
}
.theme-chips { display: flex; gap: 8px; }
.theme-chip.active {
    background: var(--accent); color: var(--accent-text); border-color: var(--accent);
}

/* ===== Выбор способа оплаты при пополнении (Platega) ===== */
.topup-methods { display: flex; gap: 8px; margin-bottom: 12px; }
.tm-chip.active {
    background: var(--accent); color: var(--accent-text); border-color: var(--accent);
}

/* ===== Отметка «фото можно заменить» на витрине (demo) ===== */
.wt-demo-photo {
    position: relative;
    outline: 2px dashed rgba(255, 107, 157, 0.75);
    outline-offset: 2px;
}
.wt-demo-photo::after {
    content: "✏️";
    position: absolute;
    top: 4px; right: 4px;
    width: 22px; height: 22px;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px;
    background: rgba(255, 255, 255, 0.92);
    border-radius: 50%;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
    pointer-events: none;
    z-index: 6;
}

/* Открытка получателя — на весь экран, без белых полей */
html, body { margin: 0; }

/* ===== Пошаговый редактор (мастер по экранам) ===== */
.step-head { margin-bottom: 10px; }
.step-progress { font-size: 12px; color: var(--hint); font-weight: 600; letter-spacing: 0.3px; }
.step-title { font-size: 20px; font-weight: 800; margin: 2px 0 8px; }
.step-dots { display: flex; gap: 6px; margin-bottom: 6px; }
.step-dot { flex: 1; height: 4px; border-radius: 3px; background: var(--card); }
.step-dot.active { background: var(--accent); }
.step-dot.done { background: rgba(224, 90, 125, 0.5); }
.step-nav { display: flex; gap: 10px; margin-top: 16px; }
.step-nav .submit-btn { margin-top: 0; }
.step-nav #prevBtn { flex: 0 0 auto; padding-left: 16px; padding-right: 16px; }
.step-nav #nextBtn { flex: 1; }

/* ===== Подсказка «ответы придут в бот» ===== */
.bot-hint {
    background: rgba(224, 90, 125, 0.10);
    border: 1px solid rgba(224, 90, 125, 0.28);
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 13px;
    line-height: 1.45;
    margin: 8px 0 14px;
    text-align: left;
}

/* ===== Кроппер фото ===== */
.crop-overlay {
    position: fixed; inset: 0; z-index: 9999;
    background: rgba(0, 0, 0, 0.85);
    display: flex; align-items: center; justify-content: center; padding: 20px;
}
.crop-box {
    background: var(--bg); border-radius: 20px; padding: 16px;
    width: 100%; max-width: 360px;
}
.crop-title { font-weight: 800; font-size: 16px; text-align: center; margin-bottom: 12px; }
.crop-viewport {
    position: relative; margin: 0 auto; overflow: hidden;
    border-radius: 14px; background: #000; touch-action: none; cursor: grab;
}
.crop-img {
    position: absolute; top: 0; left: 0; max-width: none;
    user-select: none; -webkit-user-drag: none; pointer-events: none;
}
.crop-controls { display: flex; align-items: center; gap: 10px; margin: 14px 2px 0; }
.crop-ico { font-size: 15px; }
.crop-zoom { flex: 1; }
.crop-hint { text-align: center; font-size: 12px; color: var(--hint); margin-top: 8px; }
.crop-actions { display: flex; gap: 10px; margin-top: 12px; }
.crop-actions .submit-btn { margin-top: 0; flex: 1; }

/* ═══════════════════ ВИЗУАЛЬНЫЙ АПГРЕЙД ═══════════════════ */

/* Шрифты + мягкий фон приложения */
body {
    font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background:
        radial-gradient(900px 500px at 50% -8%, rgba(224, 90, 125, 0.12), transparent 62%),
        radial-gradient(700px 520px at 100% 100%, rgba(150, 90, 224, 0.08), transparent 60%),
        var(--bg);
    min-height: 100dvh;
}
h1, .screen-title { font-weight: 800; letter-spacing: -0.3px; }

/* Кнопки */
.submit-btn {
    background: linear-gradient(135deg, #ff6690 0%, #e05a7d 100%);
    color: #fff; border: none; border-radius: 16px; padding: 15px 18px;
    font-family: inherit; font-weight: 700; font-size: 16px;
    box-shadow: 0 8px 20px rgba(224, 90, 125, 0.30);
    transition: transform 0.15s ease, box-shadow 0.2s ease; cursor: pointer;
}
.submit-btn:active { transform: scale(0.97); box-shadow: 0 4px 12px rgba(224, 90, 125, 0.28); }
.submit-btn.secondary {
    background: var(--card); color: var(--text);
    border: 1px solid rgba(224, 90, 125, 0.30); box-shadow: none;
}
.submit-btn.compact { padding: 12px 16px; font-size: 15px; }

/* Чипы (суммы, способы оплаты, тема) */
.chip-btn {
    border-radius: 14px; border: 1.5px solid rgba(224, 90, 125, 0.25);
    background: var(--card); color: var(--text); font-weight: 700;
    padding: 11px 12px; font-family: inherit; transition: all 0.15s ease; cursor: pointer;
}
.chip-btn:active { transform: scale(0.96); }

/* Баланс — сочная карточка */
.balance-card {
    background: linear-gradient(135deg, #e05a7d 0%, #a24bd6 100%);
    border-radius: 24px; padding: 22px; color: #fff;
    box-shadow: 0 16px 36px rgba(224, 90, 125, 0.35);
    position: relative; overflow: hidden; margin-bottom: 14px;
}
.balance-card::after {
    content: ""; position: absolute; top: -50%; right: -12%;
    width: 190px; height: 190px; border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.28), transparent 70%);
    pointer-events: none;
}
.balance-label { font-size: 13px; font-weight: 600; opacity: 0.9; }
.balance-value { font-family: 'Unbounded', sans-serif; font-size: 34px; font-weight: 700; margin-top: 4px; }

/* «Мои открытки» — явная карточка-кнопка */
.mc-open-btn {
    display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
    background: var(--card); color: var(--text);
    border: 1.5px solid rgba(224, 90, 125, 0.28); border-radius: 18px;
    padding: 14px 16px; margin-bottom: 16px; cursor: pointer;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.05); font-family: inherit;
    transition: transform 0.15s ease;
}
.mc-open-btn:active { transform: scale(0.98); }
.mc-open-ico {
    font-size: 22px; width: 44px; height: 44px; flex: 0 0 auto;
    display: flex; align-items: center; justify-content: center;
    background: rgba(224, 90, 125, 0.12); border-radius: 13px;
}
.mc-open-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mc-open-title { font-weight: 800; font-size: 16px; }
.mc-open-sub { font-size: 12.5px; color: var(--hint); margin-top: 1px; }
.mc-open-chevron { font-size: 26px; color: var(--hint); flex: 0 0 auto; line-height: 1; }

/* Секции профиля — единый карточный стиль */
.topup-box, .ref-box, .withdraw-box, .theme-box {
    background: var(--card); border-radius: 18px; padding: 16px; margin-bottom: 14px;
}
.section-title { font-weight: 800; font-size: 15px; margin-bottom: 10px; }

/* Тема оформления — чипы покрасивее */
.theme-chip { padding: 12px 8px; font-size: 13px; }
.theme-chip.active {
    background: linear-gradient(135deg, #ff6690, #e05a7d); color: #fff; border-color: transparent;
    box-shadow: 0 6px 14px rgba(224, 90, 125, 0.3);
}