* { box-sizing: border-box; }
:root {
  color-scheme: dark;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --bg: #100e13;
  --card: #1b1820;
  --card-soft: #24202a;
  --line: rgba(255,255,255,.08);
  --text: #f8f6fb;
  --muted: #aaa3b3;
  --purple: #a98be8;
  --purple-strong: #906bd8;
  --pink: #e3b3ea;
  --danger: #ff9aab;
  --success: #95ddb9;
}
html { min-height: 100%; background: var(--bg); }
body {
  min-height: 100vh;
  margin: 0;
  background: radial-gradient(ellipse at 50% -10%, rgba(143,105,203,.25), transparent 48%), var(--bg);
  color: var(--text);
  padding: max(16px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.app-shell { width: min(100%, 520px); margin: 0 auto; }
.topbar { display: flex; align-items: center; gap: 12px; margin: 4px 2px 18px; }
.avatar { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; box-shadow: 0 4px 18px rgba(169,139,232,.25); }
.brand-name { font-size: 18px; font-weight: 750; letter-spacing: -.3px; }
.brand-tag { margin-top: 2px; color: var(--muted); font-size: 12px; }
.hero, .panel, .meal-card, .notice, .loading-card { border: 1px solid var(--line); background: linear-gradient(145deg, rgba(255,255,255,.035), transparent 55%), var(--card); border-radius: 22px; }
.hero { position: relative; overflow: hidden; padding: 24px 22px 22px; margin-bottom: 14px; }
.hero::after { content: ""; position: absolute; width: 190px; height: 190px; right: -75px; top: -92px; border-radius: 50%; background: rgba(169,139,232,.12); filter: blur(3px); pointer-events: none; }
.hero-eyebrow { color: var(--pink); font-size: 11px; font-weight: 750; letter-spacing: 1.3px; text-transform: uppercase; }
h1 { margin: 10px 0 8px; font-size: clamp(26px, 7vw, 34px); line-height: 1.05; letter-spacing: -1.1px; }
.hero-copy { max-width: 350px; margin: 0; color: #c4bdcd; font-size: 14px; line-height: 1.55; }
.panel { padding: 20px; margin-bottom: 14px; }
.panel-title { margin: 0 0 6px; font-size: 19px; letter-spacing: -.35px; }
.panel-copy { margin: 0 0 18px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 4px; margin-bottom: 18px; border-radius: 13px; background: #121016; }
.tab { min-height: 39px; border: 0; border-radius: 10px; color: var(--muted); background: transparent; font-size: 13px; font-weight: 650; }
.tab.active { color: var(--text); background: #30283a; box-shadow: inset 0 0 0 1px rgba(255,255,255,.05); }
.field { display: grid; gap: 7px; margin: 0 0 14px; }
.field label, .field-label { color: #ddd7e5; font-size: 12px; font-weight: 650; }
.field input, .field select, .field textarea {
  width: 100%; min-height: 48px; padding: 12px 13px; border: 1px solid rgba(255,255,255,.1); border-radius: 13px;
  outline: none; background: #141118; color: var(--text); font-size: 15px;
}
.field textarea { min-height: 74px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(169,139,232,.13); }
.field input::placeholder, .field textarea::placeholder { color: #716a79; }
.button { display: inline-flex; width: 100%; min-height: 50px; align-items: center; justify-content: center; padding: 12px 16px; border: 0; border-radius: 15px; color: #17121e; background: linear-gradient(135deg, #c4a8fa, #a98be8 65%, #9d7add); font-size: 14px; font-weight: 750; transition: transform .15s ease, opacity .15s ease; }
.button:active { transform: scale(.985); }
.button:disabled { opacity: .52; cursor: default; }
.telegram-link { margin-top: 2px; text-decoration: none; }
.button.secondary { color: var(--text); background: #302a37; border: 1px solid var(--line); }
.button.subtle { min-height: 42px; color: var(--muted); background: transparent; border: 1px solid var(--line); }
.button.danger { color: var(--danger); background: rgba(255,154,171,.08); border: 1px solid rgba(255,154,171,.22); }
.contact-status { display: flex; align-items: center; gap: 9px; padding: 12px; margin: 0 0 15px; border: 1px solid var(--line); border-radius: 14px; background: #151219; color: var(--muted); font-size: 12px; line-height: 1.4; }
.status-dot { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; background: #877f8e; }
.contact-status.verified { color: var(--success); border-color: rgba(149,221,185,.18); }
.contact-status.verified .status-dot { background: var(--success); box-shadow: 0 0 12px rgba(149,221,185,.55); }
.hint, .fine-print { color: var(--muted); font-size: 11px; line-height: 1.5; }
.hint { margin: 12px 0 0; }
.fine-print { margin: 14px 2px 0; text-align: center; }
.error { display: none; padding: 11px 12px; margin: 0 0 14px; border-radius: 12px; color: #ffc4cb; background: rgba(255,103,132,.1); font-size: 12px; line-height: 1.45; }
.error.visible { display: block; }
.check-row { display: flex; align-items: flex-start; gap: 10px; margin: 16px 1px; color: #bcb5c5; font-size: 12px; line-height: 1.45; }
.check-row input { accent-color: var(--purple-strong); margin-top: 2px; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.stat-card { padding: 15px; border: 1px solid var(--line); border-radius: 17px; background: var(--card); }
.stat-value { font-size: 21px; font-weight: 750; letter-spacing: -.5px; }
.stat-label { margin-top: 5px; color: var(--muted); font-size: 11px; }
.action-list { display: grid; gap: 9px; }
.profile-list { display: grid; gap: 0; margin: 0; }
.profile-row { display: flex; justify-content: space-between; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.profile-row:last-child { border-bottom: 0; }
.profile-row span:first-child { color: var(--muted); }
.profile-row span:last-child { text-align: right; font-weight: 620; }
.section-label { margin: 19px 0 10px; color: var(--pink); font-size: 11px; font-weight: 750; letter-spacing: 1px; text-transform: uppercase; }
.meal-card { padding: 16px; margin: 10px 0; background: var(--card); }
.meal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.meal-title { margin: 0; font-size: 15px; line-height: 1.35; }
.meal-kcal { flex: 0 0 auto; color: var(--pink); font-size: 12px; font-weight: 750; }
.meal-meta { margin-top: 7px; color: #c2bbc9; font-size: 11px; }
.meal-detail { margin: 10px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.total-card { display: flex; align-items: center; justify-content: space-between; padding: 16px; margin: 12px 0; border-radius: 16px; background: #2a2333; }
.total-card strong { color: var(--pink); font-size: 18px; }
.empty-state { padding: 21px 15px; border: 1px dashed rgba(255,255,255,.14); border-radius: 17px; color: var(--muted); text-align: center; font-size: 13px; line-height: 1.5; }
.footer-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 13px; }
.loading-card { padding: 24px; margin-top: 30vh; color: var(--muted); text-align: center; }
@media (min-width: 600px) {
  body { padding-top: 28px; }
  .hero { padding: 28px; }
  .panel { padding: 24px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; } }


.agreement-panel { max-height: min(68vh, 720px); overflow-y: auto; }
.agreement-section { padding: 13px 0; border-bottom: 1px solid var(--line); }
.agreement-section:first-child { padding-top: 0; }
.agreement-section:last-of-type { border-bottom: 0; }
.agreement-section h2 { margin: 0 0 7px; font-size: 14px; }
.agreement-section p { margin: 0; color: #c4bdcd; font-size: 12px; line-height: 1.55; white-space: pre-line; }
.choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.choice { min-height: 42px; padding: 9px 10px; border: 1px solid rgba(255,255,255,.1); border-radius: 12px; color: #d2cbd9; background: #151219; font-size: 12px; line-height: 1.3; }
.choice.selected { color: #f6efff; border-color: rgba(169,139,232,.7); background: rgba(169,139,232,.18); box-shadow: inset 0 0 0 1px rgba(169,139,232,.18); }
.product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.product-category { padding: 12px 0 3px; }
.product-category h3 { margin: 0 0 8px; color: var(--pink); font-size: 12px; }
.product-search, .text-extra, .custom-product-row input { width: 100%; min-height: 46px; padding: 11px 12px; border: 1px solid rgba(255,255,255,.1); border-radius: 12px; outline: none; color: var(--text); background: #141118; font-size: 14px; }
.product-search:focus, .text-extra:focus, .custom-product-row input:focus { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(169,139,232,.13); }
.product-count { margin: 8px 0; color: var(--success); font-size: 12px; font-weight: 650; }
.product-count.invalid { color: var(--danger); }
.custom-product-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin-top: 9px; }
.custom-product-row .button { width: auto; min-height: 46px; padding: 10px 13px; }
.custom-product-chip { min-height: 34px; margin: 3px 5px 3px 0; padding: 7px 10px; border-radius: 999px; }
.stepper { display: grid; grid-template-columns: auto auto minmax(60px, 1fr) auto auto; align-items: center; gap: 6px; }
.stepper-button { min-height: 42px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 11px; color: var(--text); background: var(--card-soft); font-size: 12px; }
.stepper output { text-align: center; font-size: 21px; font-weight: 750; }
.stepper-unit { color: var(--muted); font-size: 11px; }
.criteria-actions { display: grid; gap: 9px; margin-top: 17px; }
.empty-state { margin-top: 12px; }
button[hidden], section[hidden] { display: none !important; }
@media (max-width: 360px) {
  .stepper { gap: 4px; }
  .stepper-button { padding: 6px; font-size: 11px; }
  .custom-product-row { grid-template-columns: 1fr; }
  .custom-product-row .button { width: 100%; }
}
