:root {
  --bg: #f6f7f9; --card: #ffffff; --text: #1d2330; --muted: #6b7280; --line: #e3e6eb;
  --accent: #2563eb; --accent-text: #ffffff; --bonus: #0f9d58; --bonus-bg: #e7f6ee; --warn: #b45309;
  --bad: #c62828; --bubble: #eef2ff; --radius: 12px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12151b; --card: #1b2029; --text: #e7e9ee; --muted: #9aa3b2; --line: #2b3240;
    --accent: #4f8bff; --bonus: #3ecf8e; --bonus-bg: #173327; --warn: #f0b049; --bad: #ff6b6b; --bubble: #232c40;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); }
button { color: inherit; }   /* иначе у кнопок без своего цвета — браузерный чёрный, в тёмной теме не виден */
header { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.wrap { max-width: 960px; margin: 0 auto; padding: 0 16px; }
.top { display: flex; align-items: center; gap: 12px; padding: 10px 0; flex-wrap: wrap; }
.brand { font-weight: 700; font-size: 17px; margin-right: auto; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { border-radius: 999px; padding: 3px 10px; font-size: 13px; background: var(--bg); border: 1px solid var(--line);
  white-space: nowrap; }
.chip.bonus { background: var(--bonus-bg); color: var(--bonus); border-color: transparent; }
nav.tabs { display: flex; gap: 4px; overflow-x: auto; }
nav.tabs button { border: 0; background: none; color: var(--muted); padding: 8px 12px; font: inherit; cursor: pointer;
  border-bottom: 2px solid transparent; white-space: nowrap; }
nav.tabs button.on { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
main { padding: 16px 0 40px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px;
  margin-bottom: 14px; }
h2 { font-size: 18px; margin: 0 0 10px; }
h3 { font-size: 15px; margin: 0 0 8px; }
.muted { color: var(--muted); font-size: 13px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
input, textarea, select { font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 10px; max-width: 100%; }
textarea { width: 100%; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
button.btn, a.btn, label.btn { display: inline-block; font: inherit; border: 0; border-radius: 8px; padding: 8px 14px; cursor: pointer;
  background: var(--accent); color: var(--accent-text); }
button.btn.sec, a.btn.sec, label.btn.sec { background: var(--bg); color: var(--text); border: 1px solid var(--line); }
button.btn:disabled { opacity: .55; cursor: default; }
button.link { border: 0; background: none; color: var(--accent); cursor: pointer; font: inherit; padding: 0; }
.err { color: var(--bad); }
.ok { color: var(--bonus); }
.hidden { display: none !important; }
.spin { display: inline-block; width: 1em; height: 1em; border: 2px solid currentColor; border-right-color: transparent;
  border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -2px; margin-right: 6px; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation-duration: 2.4s; } }
.chip.active { background: var(--bubble); color: var(--accent); border-color: transparent; cursor: help; }
.tile .wait { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; padding: 12px;
  text-align: center; color: var(--muted); font-size: 14px; background: var(--card); }
.tile .wait.err { color: var(--bad); }
.working { color: var(--accent); }
.att-img { display: block; max-width: 220px; max-height: 220px; border-radius: 8px; margin-bottom: 6px; }
#chatFiles:empty { display: none; }
.notice { border-left: 4px solid var(--warn); }
/* чат */
.chat-layout { display: grid; grid-template-columns: 220px 1fr; gap: 14px; }
.chat-list { max-height: 70vh; overflow: auto; padding: 8px; }
.chat-list .item { padding: 6px 8px; border-radius: 8px; cursor: pointer; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; font-size: 14px; }
.chat-list .item.on, .chat-list .item:hover { background: var(--bg); }
.chat-list .item { display: flex; align-items: center; gap: 4px; }
.chat-list .item span { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.chat-list .item-del { opacity: .35; font-size: 13px; padding: 0 2px; }
.chat-list .item:hover .item-del, .chat-list .item-del:focus { opacity: 1; }
@media (hover: none) { .chat-list .item-del { opacity: .7; } }
.chat-tools { margin-bottom: 8px; gap: 8px; }
.chat-tools .btn { padding: 6px 12px; font-size: 14px; }
.msg-copy { font-size: 12px; }
.msgs { min-height: 40vh; max-height: 62vh; overflow-y: auto; display: flex; flex-direction: column; gap: 10px;
  padding-bottom: 6px; }
.msg { padding: 8px 12px; border-radius: 12px; max-width: 92%; overflow-wrap: anywhere; }
.msg.user { align-self: flex-end; background: var(--bubble); white-space: pre-wrap; }
.msg.assistant { align-self: flex-start; background: var(--bg); }
.msg .price { display: block; font-size: 12px; color: var(--muted); margin-top: 4px; }
.msg pre { background: var(--card); padding: 8px; border-radius: 8px; overflow-x: auto; }
.msg p { margin: .3em 0; }
.composer { display: flex; gap: 8px; margin-top: 10px; align-items: flex-end; }
.composer textarea { min-height: 44px; max-height: 200px; }
/* картинки, песни */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.tile { background: var(--bg); border-radius: 10px; overflow: hidden; }
.tile img { width: 100%; display: block; aspect-ratio: 1; object-fit: contain; background: var(--card); cursor: zoom-in; }
.result { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 12px; }
.ba { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ba figure { margin: 0; }
.ba figcaption { font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.ba img, .result > img { width: 100%; border-radius: 10px; display: block; cursor: zoom-in; background: var(--bg); }
@media (max-width: 700px) { .ba { grid-template-columns: 1fr; } }
.tile .cap { padding: 6px 8px; font-size: 13px; }
.song { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; }
.song audio { width: 100%; margin-top: 6px; }
.lyrics { white-space: pre-wrap; font-size: 14px; max-height: 260px; overflow: auto; background: var(--bg);
  padding: 8px; border-radius: 8px; }
/* расходы */
.bar { height: 10px; background: var(--bg); border-radius: 999px; overflow: hidden; border: 1px solid var(--line); }
.bar > i { display: block; height: 100%; background: var(--bonus); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.stat { background: var(--bg); border-radius: 10px; padding: 10px; }
.stat b { display: block; font-size: 18px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 6px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
td.num, th.num { text-align: right; white-space: nowrap; }
.tbl { overflow-x: auto; }
.tag { font-size: 12px; border-radius: 6px; padding: 1px 6px; white-space: nowrap; }
.tag.bonus { background: var(--bonus-bg); color: var(--bonus); }
.tag.paid { background: var(--bubble); }
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.85); display: flex; align-items: center;
  justify-content: center; z-index: 20; padding: 16px; }
.lightbox img { max-width: 100%; max-height: 100%; }
@media (max-width: 700px) {
  .chat-layout { grid-template-columns: 1fr; }
  .chat-list { max-height: 160px; }
  .msgs { max-height: 55vh; }
}

/* ======================= оформление v2: персонажи, главная, мягкие карточки ======================= */
:root {
  --bg: #f4f6fb; --card: #ffffff; --line: #e6e9f2; --accent: #4f5bd5; --accent2: #7c3aed;
  --bubble: #eef0ff; --radius: 18px; --shadow: 0 1px 2px rgba(30, 40, 90, .05), 0 6px 24px rgba(30, 40, 90, .07);
  --t-chat: #e3eefc; --t-images: #fde9e1; --t-edit: #ece7fb; --t-greetings: #fce7ef; --t-docphoto: #e1f5ef;
  --t-video: #fdeedd; --t-docs: #e6ebf3; --t-tts: #e5f4e3; --t-songs: #fbf4d8; --t-hero: #e2ecfb;
  --t-study: #ebe9fb; --t-recipes: #fde8e3; --t-notes: #fbf3dc; --t-support: #e0f4f5;
  --fill1: #4f5bd5; --fill2: #7c3aed;   /* заливка под белым текстом (кнопки, выбранный раздел, свои сообщения) */
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #11141c; --card: #1a1f2b; --line: #2a3142; --accent: #8b95ff; --accent2: #b28cff; --bubble: #262c45;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 28px rgba(0, 0, 0, .35);
    --t-chat: #1f2b3d; --t-images: #3a2a24; --t-edit: #2c2840; --t-greetings: #3a2430; --t-docphoto: #1f3530;
    --t-video: #3a2f22; --t-docs: #252c3a; --t-tts: #22331f; --t-songs: #36321e; --t-hero: #1e2a3d;
    --t-study: #29283f; --t-recipes: #3a2724; --t-notes: #36311f; --t-support: #1d3435;
    --fill1: #5b5fd6; --fill2: #7a45d6;   /* светлый акцент тёмной темы под белым текстом слишком бледный */
  }
}
html, body { font: 15.5px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: radial-gradient(1200px 500px at 85% -10%, rgba(124, 58, 237, .08), transparent 60%),
              radial-gradient(900px 420px at -10% 0%, rgba(79, 91, 213, .10), transparent 60%), var(--bg);
  background-attachment: fixed; }
header { background: color-mix(in srgb, var(--card) 88%, transparent); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; font-size: 18px; letter-spacing: -.01em; }
.brand img { width: 38px; height: 38px; border-radius: 12px; object-fit: cover; background: var(--t-hero); }
.brand span b { background: linear-gradient(90deg, var(--accent), var(--accent2)); -webkit-background-clip: text;
  background-clip: text; color: transparent; }
/* место под полосу прокрутки всегда занято: при переходе между короткими и длинными разделами страница
   и меню не прыгают вбок */
html { scrollbar-gutter: stable; overflow-y: scroll; }
/* меню без прокрутки вбок и на компьютере: все разделы видны, лишние кнопки — на следующей строке */
nav.tabs { gap: 6px; padding-bottom: 10px; flex-wrap: wrap; overflow: visible; }
nav.tabs button { border: 1px solid transparent; border-radius: 999px; padding: 6px 14px; font-weight: 500; }
nav.tabs button:hover { background: var(--bubble); color: var(--text); }
nav.tabs button.on { background: var(--fill1); color: #fff; border-color: transparent; font-weight: 600;
  box-shadow: 0 4px 14px rgba(79, 91, 213, .3); }
.card { border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
h2 { font-size: 20px; letter-spacing: -.01em; }
input, textarea, select { border-radius: 12px; padding: 9px 12px; background: var(--card); }
button.btn, a.btn, label.btn { border-radius: 999px; padding: 9px 18px; font-weight: 600;
  background: linear-gradient(135deg, var(--fill1), var(--fill2)); box-shadow: 0 4px 14px rgba(79, 91, 213, .25);
  transition: transform .12s, box-shadow .12s; text-decoration: none; }
button.btn:hover:not(:disabled), a.btn:hover, label.btn:hover { transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(79, 91, 213, .3); }
button.btn.sec, a.btn.sec, label.btn.sec { background: var(--card); box-shadow: none; font-weight: 500; }
.chip { background: var(--card); }
button.chip:hover, a.chip:hover { border-color: var(--accent); color: var(--accent); }
a.chip { color: var(--text); text-decoration: none; }
.tile { border-radius: 14px; border: 1px solid var(--line); background: var(--card); }
.msg { border-radius: 16px; }
.msg.user { background: linear-gradient(135deg, var(--fill1), var(--fill2)); color: #fff; }
.msg.user .chip { background: rgba(255, 255, 255, .2); color: #fff; border-color: transparent; }

/* шапка раздела с персонажем */
.sec-head { display: flex; align-items: center; gap: 16px; padding: 14px 18px; margin-bottom: 14px;
  border-radius: var(--radius); background: var(--tint, var(--t-hero)); border: 1px solid var(--line); }
.sec-head img { width: 92px; height: 92px; border-radius: 20px; object-fit: cover; flex: none; }
.sec-head h1 { font-size: 22px; margin: 0 0 2px; letter-spacing: -.02em; }
.sec-head p { margin: 0; color: var(--muted); font-size: 14px; }

/* главная */
.hero { display: grid; grid-template-columns: 1.15fr 1fr; gap: 20px; align-items: center; padding: 26px;
  border-radius: 24px; background: linear-gradient(135deg, var(--t-hero), var(--t-edit)); border: 1px solid var(--line);
  box-shadow: var(--shadow); margin-bottom: 20px; overflow: hidden; }
.hero h1 { font-size: 34px; line-height: 1.12; margin: 0 0 10px; letter-spacing: -.03em; }
.hero h1 b { background: linear-gradient(90deg, var(--accent), var(--accent2)); -webkit-background-clip: text;
  background-clip: text; color: transparent; }
.hero p { margin: 0 0 14px; color: var(--muted); font-size: 16px; }
.hero img { width: 100%; border-radius: 18px; display: block; }
.hero .bonus-line { display: inline-flex; gap: 8px; align-items: center; background: var(--card); border-radius: 999px;
  padding: 6px 14px; font-size: 14px; font-weight: 600; color: var(--bonus); margin-bottom: 14px; box-shadow: var(--shadow); }
.features { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.feature { display: flex; flex-direction: column; border-radius: 20px; overflow: hidden; background: var(--card);
  border: 1px solid var(--line); box-shadow: var(--shadow); color: var(--text); text-decoration: none;
  transition: transform .15s, box-shadow .15s; }
.feature:hover { transform: translateY(-3px); box-shadow: 0 14px 34px rgba(30, 40, 90, .14); }
.feature .pic { background: var(--tint); display: flex; justify-content: center; }
.feature .pic img { width: 100%; max-width: 280px; aspect-ratio: 1; object-fit: cover; display: block; }
.feature .body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.feature h3 { font-size: 17px; margin: 0; }
.feature p { margin: 0; color: var(--muted); font-size: 14px; flex: 1; }
.feature .foot { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; }
.feature .price { font-size: 13px; color: var(--muted); }
.feature .go { color: var(--accent); font-weight: 600; font-size: 14px; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-top: 20px; }
.step { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 16px; box-shadow: var(--shadow); }
.step b { display: block; font-size: 16px; margin-bottom: 4px; }
.step span { color: var(--muted); font-size: 14px; }

/* поделиться */
.share-grid { display: grid; grid-template-columns: 1fr 210px; gap: 20px; align-items: start; }
.share-side { text-align: center; }
.share-qr { background: #fff; border-radius: 12px; padding: 6px; border: 1px solid var(--line); display: block; margin: 0 auto 8px; }
.share-preview { display: flex; gap: 12px; align-items: flex-start; background: var(--bg); border: 1px solid var(--line);
  border-radius: 14px; padding: 12px; }
.share-preview img { width: 48px; height: 48px; border-radius: 12px; flex: none; }
.share-preview div { white-space: pre-line; overflow-wrap: anywhere; font-size: 15px; }
@media (max-width: 700px) { .share-grid { grid-template-columns: 1fr; } }

/* QR — только на компьютере: на телефоне сканировать свой же экран незачем */
.desk-qr { display: flex; gap: 14px; align-items: center; margin-top: 16px; padding: 12px; border-radius: 14px;
  background: var(--bg); border: 1px solid var(--line); text-align: left; }
.desk-qr img { background: #fff; border-radius: 10px; padding: 4px; flex: none; }
@media (hover: none) and (pointer: coarse) { .desk-qr, .share-side { display: none !important; } }
@media (max-width: 700px) { .share-grid { grid-template-columns: 1fr; } }

/* ИИ-доктор */
.sos { border-left: 5px solid var(--bad); background: color-mix(in srgb, var(--bad) 7%, var(--card)); }
.doc-modes { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.doc-mode { display: flex; flex-direction: column; gap: 4px; text-align: left; font: inherit; color: var(--text); cursor: pointer;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; transition: border-color .12s, transform .12s; }
.doc-mode:hover { border-color: var(--accent); transform: translateY(-1px); }
.doc-mode .ic { font-size: 24px; }
.consult { padding: 6px 0; border-bottom: 1px solid var(--line); }
.doc-banner { background: var(--t-docphoto); border-radius: 12px; padding: 8px 12px; margin-bottom: 10px; font-size: 14px; }
label.pulse { animation: pulse 1s ease-in-out 5; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 35%, transparent); } }

/* песня: обложка и публичная страница */
.song-head { display: flex; gap: 12px; align-items: flex-start; }
.song-head .song-cover { width: 84px; height: 84px; border-radius: 12px; object-fit: cover; flex: none; cursor: pointer;
  border: 1px solid var(--line); }
.song-head .song-main { flex: 1; min-width: 0; }
.song-panel { background: var(--bg); border: 1px solid var(--line); border-radius: 14px; padding: 12px; margin-top: 10px; }
.song-panel .share-preview img { border-radius: 10px; }
.song-pub { text-align: center; }
.song-pub-cover { width: 100%; max-width: 420px; aspect-ratio: 1; object-fit: cover; border-radius: 18px;
  box-shadow: var(--shadow); display: block; margin: 0 auto 14px; }
.song-pub h1 { margin: 6px 0 2px; }
.song-pub audio { margin-top: 10px; }
.song-pub-lyrics { white-space: pre-line; line-height: 1.55; }
.song-pub-cta { display: flex; gap: 14px; align-items: flex-start; }
.song-pub-cta img { border-radius: 14px; flex: none; }

.law-price { background: var(--bubble); border-radius: 12px; padding: 10px 12px; margin: 0 0 12px; }
.law-note { border-left-color: var(--accent); background: color-mix(in srgb, var(--accent) 7%, var(--card)); }

/* что приготовить */
.recipe h2 { margin-bottom: 2px; }
.rc-kbju { margin: 4px 0 8px; }
.rc-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 4px 16px; }
.recipe ul, .recipe ol { margin: 4px 0 10px; padding-left: 22px; }

/* заметки */
.nt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.nt-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; cursor: pointer;
  box-shadow: var(--shadow); overflow: hidden; overflow-wrap: anywhere; }
.nt-card.pinned { border-color: var(--accent); }
.nt-card:hover { border-color: var(--accent); }
.nt-prev { white-space: pre-line; max-height: 7.5em; overflow: hidden; margin: 2px 0 4px; }
.nt-meta { font-size: 12px; margin-top: 4px; }
.nt-done { text-decoration: line-through; opacity: .6; }
.nt-title { width: 100%; font-size: 18px; font-weight: 600; margin-bottom: 8px; }
.nt-items { margin: 6px 0; }
.nt-item label { display: flex; gap: 8px; align-items: center; cursor: pointer; }
.nt-tools { flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.nt-remind input { border: 0; background: transparent; color: inherit; font: inherit; padding: 0; max-width: 190px; }
.nt-photo img { max-width: 100%; max-height: 320px; border-radius: 12px; display: block; margin: 8px 0 4px; }
.nt-ai-res { margin-top: 8px; }

/* поддержка */
.sp-msgs { max-height: 60vh; overflow-y: auto; }
.sp-who { font-size: 12px; opacity: .75; margin-bottom: 2px; }
.sp-operator { border-left: 3px solid var(--accent); }

/* баланс в шапке: нажать — пополнить */
.bal-box { display: inline-flex; flex-direction: column; align-items: center; line-height: 1.1; }
.bal-chip { color: inherit; text-decoration: none; cursor: pointer; }
.bal-chip:hover { border-color: var(--accent); }
.bal-top { font-size: 12px; margin-top: 2px; color: var(--accent); text-decoration: none; }
.bal-top:hover { text-decoration: underline; }

/* персональные данные */
.pdn-info { margin-top: 18px; font-size: 12.5px; line-height: 1.45; color: var(--muted); }
.pdn-info h3 { font-size: 14px; margin-bottom: 4px; }
.pdn-info .btn { font-size: 12.5px; padding: 5px 10px; }
.pdn-info .row { flex-wrap: wrap; gap: 8px; }
.pdn-info .btn { text-decoration: none; }
.pdn-bar { font-size: 12.5px !important; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; display: flex; align-items: center; gap: 14px;
  padding: 12px 18px; background: var(--card); border-top: 1px solid var(--line); box-shadow: var(--shadow); font-size: 14px; }
.pdn-bar > div { flex: 1; }
.pdn-bar.hidden { display: none; }
body.has-pdn main { padding-bottom: 110px; }
.pdn-note { font-size: 12.5px; margin-top: 10px; }
.legal h1 { font-size: 24px; } .legal h2 { font-size: 18px; margin-top: 18px; }
.legal-tbl td { padding: 4px 12px 4px 0; vertical-align: top; } .legal-tbl td:first-child { color: var(--muted); white-space: nowrap; }
@media (max-width: 640px) { .pdn-bar { flex-direction: column; align-items: stretch; font-size: 13px; } body.has-pdn main { padding-bottom: 200px; } }

.login-bonus { background: var(--bonus-bg, #e8f7ee); border-radius: 12px; padding: 10px 12px; font-size: 14px;
  margin: 10px 0 14px; line-height: 1.45; }

/* песни: меню способов */
.song-modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.song-modes button { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; cursor: pointer;
  padding: 10px 12px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--card); font: inherit; }
.song-modes button span { font-size: 22px; line-height: 1; }
.song-modes button small { color: var(--muted); font-size: 12.5px; }
.song-modes button:hover { border-color: var(--accent); }
.song-modes button.on { border-color: var(--accent); background: var(--bubble); box-shadow: 0 0 0 2px var(--accent) inset; }
@media (max-width: 560px) { .song-modes { grid-template-columns: 1fr; } .song-modes button { flex-direction: row; align-items: center; gap: 8px; }
  .song-modes button small { display: none; } }

/* гость: кнопка «Войти» в шапке */
.guest-login { text-decoration: none; padding: 7px 16px; }

/* голос */
.mic { padding: 8px 10px; flex: none; }
.mic.rec { background: #e53935; color: #fff; border-color: #e53935; animation: micPulse 1.2s infinite; }
@keyframes micPulse { 50% { opacity: .7; } }
.tr-row { border-top: 1px solid var(--line); padding: 10px 0; }
.tr-acts { flex-wrap: wrap; gap: 6px; margin-top: 6px; }

/* калории */
.food-daynav { gap: 8px; margin-bottom: 10px; }
.pat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; margin-bottom: 10px; }
.pat-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.pat-grid input, .pat-grid select { color: var(--text); font-size: 15px; }
.food-total { font-size: 18px; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.food-total b { font-size: 30px; }
.food-bar { height: 10px; border-radius: 99px; background: var(--line); overflow: hidden; margin: 6px 0; }
.food-bar i { display: block; height: 100%; border-radius: 99px; }
.food-macros { font-size: 14px; margin-bottom: 8px; }
.food-row, .food-drow { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.food-name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.food-kcal { white-space: nowrap; }
.food-acts { white-space: nowrap; display: flex; gap: 6px; }
.food-draft { background: var(--bg); border: 1px solid var(--line); border-radius: 14px; padding: 8px 12px; margin-top: 8px; }
.food-drow .fd-name { flex: 1; min-width: 90px; }
.food-drow .fd-num { width: 64px; }
.food-advice { white-space: pre-line; background: var(--bubble); border-radius: 12px; padding: 10px 12px; margin-top: 8px; }
@media (max-width: 520px) { .food-drow { flex-wrap: wrap; } .food-drow .fd-name { flex-basis: calc(100% - 30px); } }

/* вход */
.login-hero { width: 100%; border-radius: 18px; display: block; margin-bottom: 14px; }
.login-bots { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 14px; }
.login-bots img { width: 44px; height: 44px; border-radius: 12px; object-fit: cover; }

@media (max-width: 700px) {
  .hero { grid-template-columns: 1fr; padding: 18px; }
  .hero h1 { font-size: 26px; }
  .sec-head { padding: 12px; gap: 12px; }
  .sec-head img { width: 64px; height: 64px; border-radius: 14px; }
  .sec-head h1 { font-size: 19px; }
  .brand span small { display: none; }
}

/* переходы к блокам: не прятать заголовок под липкой шапкой */
main .card, main .sec-head, main section { scroll-margin-top: var(--hdr, 140px); }
@media (max-width: 700px) { header { position: static; } .top { gap: 8px; } .brand img { width: 32px; height: 32px; } }
/* телефон: меню не уезжает вбок — все разделы видны сразу, кнопки переносятся на следующую строку */
@media (max-width: 700px) {
  nav.tabs { flex-wrap: wrap; overflow: visible; gap: 6px; padding-bottom: 10px; }
  nav.tabs button { padding: 5px 11px; font-size: 14px; background: var(--bg); border-color: var(--line); }
  nav.tabs button.on { box-shadow: none; }
}
