:root {
  color-scheme: light; --bg: #f5f5f7; --text: #1d1d1f; --muted: 
  #74747b;
  --line: #e8e8ed; --blue: #0071e3; --red: #c52a36; --surface: 
  #ffffff;
  --surface-soft: #fafafa; --secondary: #eeeef3; --header: 
  rgba(255, 255, 255, .9); --premium-start: #ffffff; 
  --premium-end: #edf4ff; --danger-bg: #fff0f0; --shadow: 0 
  10px 35px rgba(0, 0, 0, .035); --nav-shadow: 0 12px 45px 
  rgba(0, 0, 0, .12);
}
:root[data-theme="dark"] {
  color-scheme: dark; --bg: #0b0b0d; --text: #f5f5f7; --muted: 
  #a0a0aa;
  --line: #303036; --blue: #409cff; --red: #ff777d; --surface: 
  #18181c;
  --surface-soft: #222227; --secondary: #2b2b32; --header: 
  rgba(24, 24, 28, .92); --premium-start: #191b24; 
  --premium-end: #18283e; --danger-bg: #3c2027; --shadow: 0 
  10px 35px rgba(0, 0, 0, .15); --nav-shadow: 0 12px 45px 
  rgba(0, 0, 0, .4);
}
/* Базовое оформление */ *, *::before, *::after { box-sizing: 
  border-box;
}
html { min-height: 100%; -webkit-text-size-adjust: 100%; 
  text-size-adjust: 100%;
}
body { margin: 0; min-width: 280px; min-height: 100vh; 
  background: var(--bg); color: var(--text); font-family:
    -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe 
    UI", Arial, sans-serif;
  font-size: 16px; line-height: 1.45; -webkit-font-smoothing: 
  antialiased; transition:
    background-color .25s ease, color .25s ease;
}
button, input, textarea, select { font: inherit;
}
button { cursor: pointer; touch-action: manipulation;
}
button:disabled { cursor: default; opacity: .5;
}
button:focus-visible, a:focus-visible { outline: 2px solid 
  var(--blue); outline-offset: 3px;
}
a { color: var(--blue); text-decoration: none;
}
a:hover { text-decoration: underline;
}
h1, h2, h3, p { overflow-wrap: anywhere;
}
/* Шапка */ header { position: sticky; top: 0; z-index: 5; 
  padding: 14px 18px; padding-top: max(
    14px, var(--tg-content-safe-area-inset-top, 0px) ); 
  border-bottom: 1px solid var(--line); background: 
  var(--header); backdrop-filter: blur(20px); 
  -webkit-backdrop-filter: blur(20px);
}
.nav { display: flex; align-items: center; justify-content: 
  space-between; flex-wrap: wrap; gap: 12px; max-width: 1000px; 
  margin: 0 auto;
}
.brand { font-size: 23px; line-height: 1; font-weight: 750; 
  letter-spacing: -.9px;
}
.header-tools { display: flex; align-items: center; flex-wrap: 
  wrap; gap: 8px;
}
.theme-control { display: block;
}
.theme-control select { width: auto; max-width: 160px; 
  min-height: 36px; padding: 8px 12px; border-radius: 999px; 
  font-size: 13px;
}
/* Основная область */ main { width: 100%; max-width: 1000px; 
  margin: 0 auto; padding:
    24px 18px calc(40px + env(safe-area-inset-bottom));
}
.hero { padding: 35px 0; text-align: center;
}
.eyebrow { color: var(--blue); font-size: 12px; font-weight: 
  700; letter-spacing: 1.6px; text-transform: uppercase;
}
h1 { margin: 16px 0; font-size: clamp(40px, 8vw, 72px); 
  line-height: 1.04; font-weight: 750; letter-spacing: -2.5px;
}
h2 { margin: 0 0 14px; font-size: 26px; line-height: 1.15; 
  font-weight: 700; letter-spacing: -.8px;
}
h3 { margin: 0 0 12px; font-size: 18px; line-height: 1.3; 
  font-weight: 650; letter-spacing: -.3px;
}
p { margin: 12px 0; color: var(--muted); line-height: 1.55;
}
.small { font-size: 12px;
}
.grid { display: grid; grid-template-columns: repeat(2, 
  minmax(0, 1fr)); gap: 18px;
}
.card { min-width: 0; margin-bottom: 18px; padding: 28px; 
  border: 1px solid var(--line); border-radius: 26px; color: 
  var(--text); background: var(--surface); box-shadow: 
  var(--shadow);
}
.premium { background: linear-gradient( 135deg, 
    var(--premium-start), var(--premium-end)
  );
}
.badge { display: inline-block; padding: 6px 11px; 
  border-radius: 999px; background: var(--secondary); color: 
  var(--text); font-size: 12px; line-height: 1.3;
}
.badge + h2 { margin-top: 20px;
}
.premium-price { margin: 15px 0 5px; font-size: 38px; 
  line-height: 1.2; font-weight: 750; letter-spacing: -1.5px;
}
.premium-price small { font-size: 14px; font-weight: 400; 
  letter-spacing: 0; color: var(--muted);
}
.section-title { margin-top: 28px;
}
.row { display: flex; align-items: center; flex-wrap: wrap; 
  gap: 10px;
}
.space-between { justify-content: space-between;
}
.stack { display: grid; gap: 12px;
}
/* Кнопки и формы */ .button { display: inline-flex; 
  align-items: center; justify-content: center; min-height: 
  44px; padding: 12px 20px; border: 0; border-radius: 999px; 
  background: var(--blue); color: #ffffff; font-size: 15px; 
  line-height: 1.3; font-weight: 550; text-align: center; 
  text-decoration: none;
}
.secondary { background: var(--secondary); color: var(--text);
}
.danger { background: var(--danger-bg); color: var(--red);
}
label { display: grid; gap: 7px; color: var(--muted); 
  font-size: 13px;
}
input, textarea, select { width: 100%; min-width: 0; padding: 
  12px; border: 1px solid var(--line); border-radius: 13px; 
  outline: none; background: var(--surface-soft); color: 
  var(--text); font-size: 16px;
}
input:focus, textarea:focus, select:focus { border-color: 
  var(--blue); box-shadow: 0 0 0 3px rgba(0, 113, 227, .12);
}
textarea { min-height: 140px; resize: vertical;
}
.check { display: flex; align-items: center; gap: 10px; 
  padding: 10px 0;
}
input[type="checkbox"] { width: 18px; height: 18px; flex: 0 0 
  auto; accent-color: var(--blue);
}
#chatControls {
  margin-top: 24px;
}
hr { margin: 24px 0; border: 0; border-top: 1px solid 
  var(--line);
}
/* Списки */ .item { padding: 17px 0; border-top: 1px solid 
  var(--line); overflow-wrap: anywhere;
}
.item p { margin: 8px 0; font-size: 13px; white-space: 
  pre-wrap;
}
.empty { padding: 12px 0; color: var(--muted);
}
.button-editor { display: grid; gap: 10px; padding: 15px; 
  border: 1px solid var(--line); border-radius: 18px;
}
/* Модальные окна */ dialog { width: min(620px, calc(100% - 
  24px)); max-height: 90dvh; padding: 26px; overflow: auto; 
  border: 1px solid var(--line); border-radius: 28px; 
  background: var(--surface); color: var(--text); box-shadow: 0 
  35px 100px rgba(0, 0, 0, .25);
}
dialog::backdrop { background: rgba(10, 10, 20, .45); 
  backdrop-filter: blur(7px); -webkit-backdrop-filter: 
  blur(7px);
}
.dialog-notice { margin: 0 0 15px; padding: 12px 14px; 
  border-radius: 14px; background: var(--secondary); color: 
  var(--text); white-space: pre-wrap; overflow-wrap: anywhere;
}
/* Статистика */ .stats-grid { display: grid; 
  grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; 
  margin: 20px 0;
}
.stat-tile { min-width: 0; padding: 20px; border: 1px solid 
  var(--line); border-radius: 20px; background: 
  var(--surface-soft);
}
.stat-value { display: block; margin-bottom: 8px; font-size: 
  clamp(25px, 5vw, 38px); line-height: 1.15; font-weight: 750; 
  letter-spacing: -1px; overflow-wrap: anywhere;
}
.stat-label { color: var(--muted); font-size: 12px; 
  line-height: 1.4;
}
/* Нижняя навигация */ body.has-admin-nav main { 
  padding-bottom: calc(125px + env(safe-area-inset-bottom));
}
.admin-bottom-nav { position: fixed; bottom: calc(14px + 
  env(safe-area-inset-bottom)); left: 50%; transform: 
  translateX(-50%); z-index: 8; display: grid; 
  grid-template-columns: repeat(3, 1fr); gap: 6px; width: 
  min(480px, calc(100% - 28px)); padding: 7px; border: 1px 
  solid var(--line); border-radius: 24px; background: 
  var(--header); backdrop-filter: blur(24px); 
  -webkit-backdrop-filter: blur(24px); box-shadow: 
  var(--nav-shadow);
}
.admin-tab { display: grid; place-items: center; gap: 5px; 
  min-height: 57px; padding: 8px; border: 0; border-radius: 
  18px; background: transparent; color: var(--muted); 
  font-size: 12px; font-weight: 600;
}
.admin-tab svg { width: 22px; height: 22px; fill: none; stroke: 
  currentColor; stroke-width: 1.7; stroke-linecap: round; 
  stroke-linejoin: round;
}
.admin-tab.is-active { background: var(--secondary); color: 
  var(--blue);
}
/* Уведомления и подвал */
#notice {
  position: fixed; bottom: calc(20px + 
  env(safe-area-inset-bottom)); left: 50%; transform: 
  translateX(-50%); z-index: 20; width: min(560px, calc(100% - 
  28px)); padding: 16px 20px; border-radius: 18px; background: 
  #25252b;
  color: #ffffff; box-shadow: 0 12px 40px rgba(0, 0, 0, .2); 
  font-size: 14px; white-space: pre-wrap; overflow-wrap: 
  anywhere; pointer-events: none;
}
body.has-admin-nav #notice { bottom: calc(105px + 
  env(safe-area-inset-bottom));
}
footer { padding: 18px 0; color: var(--muted); text-align: 
  center; font-size: 13px;
}
/* Анимации */ .reveal { opacity: 0; transform: 
  translateY(22px); transition:
    opacity .5s ease, transform .5s cubic-bezier(.2, .75, .25, 
    1);
}
.reveal.is-visible { opacity: 1; transform: translateY(0);
}
[hidden] { display: none !important;
}
/* Адаптация */ @media (min-width: 800px) { .stats-grid { 
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 650px) { .grid { grid-template-columns: 1fr; 
    gap: 0;
  }
  .card { padding: 23px;
  }
  .hero { padding: 25px 0;
  }
  h1 { letter-spacing: -2px;
  }
}
@media (max-width: 420px) { .brand { font-size: 20px;
  }
  .theme-control select { max-width: 140px;
  }
  .stat-tile { padding: 15px;
  }
}
@media (prefers-reduced-motion: reduce) { .reveal, 
  .reveal.is-visible {
    opacity: 1; transform: none; transition: none;
  }
  body { transition: none;
  }
}

