/* medik — стиль по брендбуку ред. 2 (согласован 15.09.2026) */
:root {
  --vein: #0B7399; --vein-deep: #075A78; --sky: #3DB3DA; --mist: #DDF1F6; --artery: #D6333F;
  --plasma: #F5F8F9; --surface: #FFFFFF; --tint: #E8F5F9;
  --ink: #1C2A31; --ink-2: #53646C; --line: #D4E4E9;
  --ok: #1E7A50; --ok-bg: #E3F3EA; --warn: #8F5A0B; --warn-bg: #FBEFD9; --crit: #C22634; --crit-bg: #FCE6E8;
  --on-vein: #FFFFFF; --outer: #E4EEF1;
  --shadow: 0 2px 6px rgba(11,115,153,.06), 0 14px 34px -12px rgba(28,42,49,.16);
  --display: "Montserrat", "Onest", system-ui, sans-serif;
  --body: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --vein: #5CC6EA; --vein-deep: #8AD7F1; --mist: #12303A; --artery: #F2646E;
    --plasma: #0A161B; --surface: #11222A; --tint: #16303A;
    --ink: #E6F1F4; --ink-2: #9FB6BE; --line: #22404A;
    --ok: #5BCB93; --ok-bg: #12301F; --warn: #F0B75A; --warn-bg: #33260F; --crit: #FF7A83; --crit-bg: #3A1519;
    --on-vein: #0A161B; --outer: #061015;
    --shadow: 0 2px 6px rgba(0,0,0,.3), 0 14px 34px -12px rgba(0,0,0,.6);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--outer); color: var(--ink); font: 16px/1.5 var(--body); -webkit-text-size-adjust: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--vein); }
:focus-visible { outline: 3px solid var(--vein); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }

.app { max-width: 480px; min-height: 100dvh; margin: 0 auto; background: var(--plasma); display: flex; flex-direction: column; position: relative; }
@media (min-width: 520px) { .app { box-shadow: 0 0 60px rgba(28,42,49,.12); } }
.boot { flex: 1; display: grid; place-content: center; justify-items: center; gap: 12px; color: var(--ink-2); }

/* шапка */
.top { position: sticky; top: 0; z-index: 5; background: var(--surface); border-bottom: 1px solid var(--line); padding: calc(14px + env(safe-area-inset-top)) 16px 12px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.top h1 { margin: 0; font: 600 1rem/1.15 var(--display); letter-spacing: .12em; text-transform: uppercase; }
.top .sub { display: block; margin-top: 4px; font-size: .78rem; color: var(--ink-2); }
.top .back { font: 600 .7rem var(--display); letter-spacing: .12em; text-transform: uppercase; text-decoration: none; color: var(--vein); display: inline-flex; gap: 6px; align-items: center; margin-bottom: 4px; }
.acts { display: flex; gap: 6px; flex: none; }
.ic { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--mist); color: var(--vein); display: grid; place-items: center; cursor: pointer; text-decoration: none; position: relative; }
.ic svg { width: 19px; height: 19px; }
.ic.avatar { font: 700 .95rem var(--display); background: var(--vein); color: var(--on-vein); }
.ic.on { box-shadow: inset 0 0 0 2px var(--vein); }

main { flex: 1; padding: 14px 16px calc(96px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 12px; }

/* нижнее меню */
.tabs { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 480px; z-index: 5; display: grid; grid-template-columns: repeat(var(--cols, 6), minmax(0, 1fr)); background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tabs a { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 4px 8px; font: 600 .62rem var(--display); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); text-decoration: none; border-top: 3px solid transparent; margin-top: -1px; position: relative; }
.tabs a svg { width: 26px; height: 26px; }
.tab-icon { display: grid; place-items: center; width: 44px; height: 32px; border-radius: 12px; color: var(--tab-color, var(--vein)); transition: background-color .18s ease, transform .18s ease; }
.tab-icon[data-section="menu"] { --tab-color: var(--warn); }
.tab-icon[data-section="medicine"] { --tab-color: var(--artery); }
.tab-icon[data-section="activity"] { --tab-color: var(--ok); }
.tab-icon[data-section="finance"] { --tab-color: var(--vein); }
.tab-icon[data-section="tasks"] { --tab-color: #8060AD; }
.tab-icon[data-section="auto"] { --tab-color: var(--ink-2); }
.tabs a[aria-current="page"] .tab-icon { background: color-mix(in srgb, currentColor 13%, var(--surface)); }
.tabs a:focus-visible { outline-offset: -3px; border-radius: 8px; }
@media (hover: hover) { .tabs a:hover .tab-icon { background: color-mix(in srgb, currentColor 10%, var(--surface)); transform: translateY(-2px); } }
@media (prefers-color-scheme: dark) { .tab-icon[data-section="tasks"] { --tab-color: #BB9DE6; } }
@media (prefers-reduced-motion: reduce) { .tab-icon { transition: none; } .tabs a:hover .tab-icon { transform: none; } }
.tabs a[aria-current="page"] { color: var(--vein); border-top-color: var(--sky); }
.tabs a.off { opacity: .35; pointer-events: none; }

/* блоки */
.card.offline { border-color: var(--warn); background: var(--warn-bg); }
.card.offline h3 { margin: 0; }
.banner { border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); background: var(--surface); }
.banner img { width: 100%; aspect-ratio: 4 / 3; max-height: 320px; object-fit: cover; display: block; background: var(--mist); }
.banner .cap { padding: 10px 14px 12px; font-size: .86rem; }
.banner .cap b { display: block; font: 600 .68rem var(--display); letter-spacing: .14em; text-transform: uppercase; color: var(--vein); margin-bottom: 2px; }

.sec { margin: 8px 2px -2px; font: 600 .64rem var(--display); letter-spacing: .16em; text-transform: uppercase; color: var(--ink-2); display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.sec a, .sec button { font: 600 .64rem var(--display); letter-spacing: .12em; color: var(--vein); background: none; border: 0; padding: 4px 0; cursor: pointer; text-decoration: none; text-transform: uppercase; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: grid; gap: 8px; }
a.card, button.card { text-align: left; text-decoration: none; color: inherit; cursor: pointer; width: 100%; font: inherit; }
.card .row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.card .lbl { font: 500 .7rem var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); }
.card .big { font: 600 1.7rem/1 var(--body); letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.card .big small { font: 500 .72rem var(--mono); color: var(--ink-2); margin-left: 4px; letter-spacing: 0; }
.card .muted, .muted { color: var(--ink-2); font-size: .86rem; }
.card.alert { box-shadow: inset 0 0 0 2px var(--crit); }
.card.alert h3 { margin: 0; font: 600 .95rem var(--body); color: var(--crit); }
.card.empty { border-style: dashed; color: var(--ink-2); font-size: .9rem; }
.card h3 { margin: 0; font: 600 1rem var(--body); }
.list { display: grid; }
.list > * + * { border-top: 1px solid var(--line); }
.item { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; }
.item .t { display: grid; gap: 1px; min-width: 0; }
.item .t b { font-weight: 600; overflow-wrap: anywhere; }
.item .t span { font-size: .82rem; color: var(--ink-2); }

.pill { display: inline-flex; align-items: center; gap: 6px; font: 600 .74rem var(--body); padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.ok { color: var(--ok); background: var(--ok-bg); }
.pill.warn { color: var(--warn); background: var(--warn-bg); }
.pill.crit, .pill.urgent { color: var(--crit); background: var(--crit-bg); }
.pill.crit::before, .pill.urgent::before { content: "!"; width: auto; height: auto; background: none; font-weight: 800; }
.pill.neutral { color: var(--vein); background: var(--mist); }
.pill.neutral::before { display: none; }

.btn { font: 600 .92rem var(--body); border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 11px 18px; cursor: pointer; text-align: center; text-decoration: none; display: inline-flex; justify-content: center; align-items: center; gap: 8px; min-height: 44px; }
.btn.primary { background: var(--vein); border-color: var(--vein); color: var(--on-vein); }
.btn.secondary { background: var(--mist); border-color: var(--mist); color: var(--vein); }
.btn.ghost { color: var(--vein); border-color: var(--vein); background: transparent; }
.btn.danger { color: var(--crit); border-color: var(--crit); background: transparent; }
.btn.small { min-height: 34px; padding: 6px 14px; font-size: .82rem; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btns { display: flex; gap: 8px; flex-wrap: wrap; }
.btns .btn { flex: 1 1 auto; }

.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }

/* меню на неделю: дни вертикальной колонкой слева от картинки */
.menuhead { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: stretch; height: 259px; }
.menuhead .banner { min-width: 0; display: flex; flex-direction: column; }
.menuhead .banner img { aspect-ratio: auto; flex: 1; min-height: 0; max-height: none; }
.chips.week { flex-direction: column; gap: 5px; overflow: visible; padding-bottom: 0; }
.chips.week .chip { flex: 1; min-width: 68px; padding: 4px 10px; font-size: .86rem; grid-auto-flow: column; justify-content: center; align-items: baseline; gap: 6px; border-radius: 11px; }
.chips.week .chip small { font-size: .76rem; }
/* меню раздела «Медицина»: шесть пунктов колонкой слева от картинки */
.mednav.chips.week .chip { flex: 1; min-width: 104px; padding: 4px 10px; justify-content: flex-start; text-align: left; font-size: .8rem; text-decoration: none; color: inherit; }
.mednav.chips.week .chip[aria-current=page] { background: var(--vein); border-color: var(--vein); color: var(--on-vein); }
/* подпись к картинке меню и приглашение в семью — в одном блоке, разделены линией */
.menucap .fam { display: grid; gap: 6px; text-decoration: none; color: inherit; border-top: 1px solid var(--line); margin-top: 2px; padding-top: 12px; }
.menucap .fam h3 { margin: 0; }
.menucap > .lbl { font: 600 .68rem var(--display); letter-spacing: .14em; text-transform: uppercase; color: var(--vein); }
.chip { flex: none; border: 1.5px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 12px; font: 600 .8rem var(--body); cursor: pointer; color: var(--ink-2); display: grid; justify-items: center; line-height: 1.15; min-width: 52px; }
.chip small { font-weight: 500; font-size: .7rem; }
.chip[aria-pressed="true"] { background: var(--vein); border-color: var(--vein); color: var(--on-vein); }

.hatch { height: 10px; border-radius: 6px; background: repeating-linear-gradient(-45deg, var(--sky) 0 1.5px, transparent 1.5px 6px); }
.progress { height: 12px; border-radius: 999px; background: var(--mist); overflow: hidden; }
.progress i { display: block; height: 100%; border-radius: 999px; background: var(--vein); }
.note { background: var(--mist); border-radius: 12px; padding: 12px 14px; font-size: .88rem; color: var(--ink); }

/* формы */
form.stack, .stack { display: grid; gap: 12px; }
.field { display: grid; gap: 5px; }
.field > span, .field legend { font: 600 .68rem var(--display); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); padding: 0; }
.field input, .field select, .field textarea { width: 100%; min-height: 46px; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 10px 12px; font-size: 1rem; }
.field textarea { min-height: 70px; resize: vertical; }
.field small { color: var(--ink-2); font-size: .8rem; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
fieldset { border: 0; margin: 0; padding: 0; display: grid; gap: 6px; }
.check { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; cursor: pointer; }
.check input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--vein); flex: none; }
.check.done span { text-decoration: line-through; color: var(--ink-2); }
.seg { display: flex; border: 1.5px solid var(--line); border-radius: 999px; overflow: hidden; }
.seg label { flex: 1; text-align: center; cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; padding: 9px 6px; font: 600 .84rem var(--body); color: var(--ink-2); }
.seg input:checked + span { background: var(--vein); color: var(--on-vein); }
.seg input:focus-visible + span { outline: 3px solid var(--vein); outline-offset: -3px; }
.error { color: var(--crit); font-size: .88rem; min-height: 1.2em; }
details.consent { font-size: .84rem; color: var(--ink-2); }
details.consent summary { cursor: pointer; color: var(--vein); }

/* вход */
.auth { flex: 1; display: flex; flex-direction: column; gap: 18px; padding: calc(28px + env(safe-area-inset-top)) 20px 32px; isolation: isolate; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--vein); }
.brand b { font: 700 1.35rem/1 var(--display); letter-spacing: .06em; }
.brand small { display: block; font: 500 .6rem var(--display); letter-spacing: .2em; text-transform: uppercase; color: var(--ink-2); margin-top: 5px; }
.welcome { position: relative; background: var(--surface); border-radius: 14px; padding: 22px 20px; box-shadow: var(--shadow); display: grid; gap: 14px; margin-right: 10px; }
.welcome::before { content: ""; position: absolute; inset: 10px -10px -10px 10px; z-index: -1; border-radius: 14px; background: repeating-linear-gradient(-45deg, var(--sky) 0 1.5px, transparent 1.5px 6px); }
.welcome h2 { margin: 0; font: 600 1.2rem/1.3 var(--display); letter-spacing: .07em; text-transform: uppercase; }
.welcome h2 em { font-style: normal; color: var(--vein); }

/* график */
.chart { width: 100%; height: auto; display: block; }
.chart text { fill: var(--ink-2); font: 10px var(--body); }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .limit { stroke: var(--crit); stroke-width: 1; stroke-dasharray: 4 4; opacity: .7; }
.chart .s1 { stroke: var(--artery); fill: none; stroke-width: 2; }
.chart .s2 { stroke: var(--vein); fill: none; stroke-width: 2; }
.chart .d1 { fill: var(--artery); } .chart .d2 { fill: var(--vein); }
.legend { display: flex; gap: 14px; font-size: .8rem; color: var(--ink-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; }

/* всплывающая панель */
dialog#sheet { border: 0; padding: 0; margin: auto auto 0; width: 100%; max-width: 480px; max-height: 92dvh; border-radius: 20px 20px 0 0; background: var(--surface); color: var(--ink); box-shadow: 0 -10px 40px rgba(0,0,0,.25); }
dialog#sheet::backdrop { background: rgba(10,22,27,.45); }
.sheet { padding: 18px 18px calc(20px + env(safe-area-inset-bottom)); display: grid; gap: 14px; }
.sheet header { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.sheet h2 { margin: 0; font: 600 .95rem var(--display); letter-spacing: .12em; text-transform: uppercase; }
.sheet .close { width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--mist); color: var(--vein); font-size: 1.3rem; cursor: pointer; }

#toast { position: fixed; left: 50%; bottom: calc(86px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--ink); color: var(--plasma); padding: 10px 16px; border-radius: 999px; font-size: .9rem; max-width: calc(100% - 32px); z-index: 20; opacity: 0; pointer-events: none; transition: opacity .2s; }
#toast.show { opacity: 1; }
#toast.err { background: var(--crit); color: #fff; }
@media (prefers-reduced-motion: reduce) { #toast { transition: none; } }

.code { font: 700 1.6rem var(--mono); letter-spacing: .18em; text-align: center; padding: 14px; border-radius: 12px; background: var(--mist); color: var(--vein); user-select: all; }

/* помощник */
.chatlog { display: flex; flex-direction: column; gap: 8px; }
.bubble { max-width: 88%; padding: 10px 14px; border-radius: 16px; font-size: .95rem; line-height: 1.45; overflow-wrap: anywhere; }
.bubble.me { align-self: flex-end; background: var(--vein); color: var(--on-vein); border-bottom-right-radius: 4px; white-space: pre-wrap; }
.bubble.ai { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.bubble.typing { color: var(--ink-2); font-style: italic; }
.action { margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: var(--mist); display: grid; gap: 8px; font-size: .9rem; }
.action.done { background: var(--ok-bg); color: var(--ok); }
.action.failed { background: var(--crit-bg); color: var(--crit); }
.action.cancelled { background: var(--tint); color: var(--ink-2); }
.suggest { display: flex; flex-wrap: wrap; gap: 6px; }
.suggest .chip { min-width: 0; text-align: left; font-weight: 500; display: block; white-space: normal; }
.chatbar { position: sticky; bottom: calc(66px + env(safe-area-inset-bottom)); display: flex; gap: 8px; align-items: flex-end; background: var(--plasma); padding: 8px 0; }
.chatbar textarea { flex: 1; min-height: 46px; max-height: 140px; border: 1px solid var(--line); border-radius: 22px; padding: 11px 16px; background: var(--surface); resize: none; }
.chatbar .btn { width: 46px; height: 46px; min-height: 46px; padding: 0; font-size: 1.25rem; flex: none; }
.muted.small { font-size: .8rem; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--vein); text-decoration: underline; cursor: pointer; font: inherit; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* администрирование */
.item.link { color: inherit; text-decoration: none; }
.item.link:hover b { color: var(--vein); }
.item .kv { font-weight: 600; text-align: right; overflow-wrap: anywhere; }
details.adm { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 10px; }
details.adm summary { cursor: pointer; font-weight: 600; }
details.adm .list { margin-top: 8px; }

/* разбор бланка анализов */
details.lab { padding: 10px 0; }
details.lab summary { list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 10px; cursor: pointer; }
details.lab summary::-webkit-details-marker { display: none; }
details.lab summary .t { display: flex; flex-direction: column; min-width: 0; }
details.lab summary .t span { font-size: .82rem; color: var(--ink-2); }
details.lab p { margin: 8px 0 0; font-size: .9rem; }
pre.labtext { white-space: pre-wrap; word-break: break-word; font: .78rem/1.45 var(--mono); background: var(--mist); border-radius: 10px; padding: 10px; max-height: 320px; overflow: auto; }

/* мой обычный день */
.daybar { display: flex; height: 14px; border-radius: 999px; overflow: hidden; gap: 2px; }
.daybar i { display: block; min-width: 3px; }
ul.tips { margin: 0; padding-left: 1.1em; display: grid; gap: 6px; font-size: .92rem; }

/* пищевая ценность */
details.nutri summary { list-style: none; display: flex; align-items: center; gap: 10px; cursor: pointer; }
details.nutri summary::-webkit-details-marker { display: none; }
details.nutri summary .lbl { flex: 1; min-width: 0; }
details.nutri summary::after { content: '⌄'; font-size: 1.15em; line-height: 1; color: var(--ink-2); transform: translateY(-3px); transition: transform .15s; flex: none; }
details.nutri[open] summary::after { transform: rotate(180deg) translateY(-2px); }
details.nutri > table.ntab { margin-top: 12px; }
details.nutri .btns { margin-top: 10px; }
table.ntab { margin-top: 10px; }
details.nutri .btns { margin-top: 10px; }
table.ntab { width: 100%; border-collapse: collapse; font-size: .86rem; font-variant-numeric: tabular-nums; }
table.ntab th, table.ntab td { padding: 6px 4px; text-align: right; white-space: nowrap; border-top: 1px solid var(--line); }
table.ntab thead th { border-top: 0; font: 600 .64rem var(--display); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
table.ntab tbody th { text-align: left; font-weight: 600; }
table.ntab td:last-child { width: 38%; }
table.ntab td small { display: inline-block; min-width: 3.2em; text-align: right; color: var(--ink-2); }
table.ntab tr.grp th { background: var(--tint); font: 600 .66rem var(--display); letter-spacing: .1em; text-transform: uppercase; color: var(--vein); padding: 6px 8px; }
.nbar { display: inline-block; width: calc(100% - 3.6em); min-width: 40px; height: 8px; border-radius: 999px; background: var(--mist); overflow: hidden; vertical-align: middle; }
.nbar i { display: block; height: 100%; border-radius: 999px; background: var(--vein); }
.nbar.ok i { background: var(--ok); }
.nbar.warn i { background: var(--warn); }
.vchips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.vchip { display: inline-flex; gap: 5px; align-items: baseline; padding: 4px 9px; border-radius: 999px; font-size: .78rem; background: var(--ok-bg); color: var(--ok); }
.vchip.warn { background: var(--warn-bg); color: var(--warn); }
.vchip b { font-variant-numeric: tabular-nums; }
.nscroll { overflow-x: auto; background: var(--surface); border-radius: 14px; box-shadow: var(--shadow); padding: 6px 10px; }
table.ntab.full td:last-child { width: auto; min-width: 110px; }
table.ntab.full tbody th { position: sticky; left: 0; background: var(--surface); }
a.chip { text-decoration: none; }
table.ntab.full tr.grp th { background: var(--tint); position: static; }

@media (max-width: 480px) { .tabs a { font-family: var(--body); font-size: .65rem; letter-spacing: 0; text-transform: none; padding-inline: 2px; } }

/* Чем меньше разделов оставили, тем просторнее подписи. */
.tabs[style*="--cols:2"] a, .tabs[style*="--cols:3"] a { font-size: .78rem; }
.tabs[style*="--cols:2"] a svg, .tabs[style*="--cols:3"] a svg { width: 26px; height: 26px; }

/* Переключение веток помощника: строка с прокруткой, а не столбик */
.chips.chatnav { margin: -2px 0 2px; }
.chips.chatnav .chip { flex: none; white-space: nowrap; }
.chips.chatnav .chip[aria-current="page"] { background: var(--vein); border-color: var(--vein); color: var(--on-vein); }

/* Вход в помощника раздела */
.askai { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 12px; text-decoration: none; color: inherit;
  background: var(--tint); border: 1px solid var(--line); }
.askai svg { width: 22px; height: 22px; color: var(--vein); flex: none; }
.askai span { display: grid; min-width: 0; font-size: .82rem; color: var(--ink-2); }
.askai b { font-size: .95rem; color: var(--ink); }
.askai span > :last-child, .askai span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.askai i { margin-left: auto; color: var(--ink-2); font-style: normal; font-size: 1.2rem; }

/* «Активность»: свой спорт слева, большая картинка справа — как в «Меню» */
.chips.week.sports { width: 138px; }
.chips.week.sports .chip { flex: 1; min-width: 0; padding: 6px 10px; grid-auto-flow: row; gap: 1px; justify-content: center; align-items: flex-start; text-align: left; font-size: .82rem; line-height: 1.15; white-space: normal; }
.chips.week.sports .chip small { font-size: .72rem; opacity: .75; }
.chips.week.sports .chip.add { flex: none; color: var(--vein); border-style: dashed; text-align: center; justify-items: center; }
@media (max-width: 360px) { .chips.week.sports { width: 120px; } }

/* Блоки разделов: объёмные иконки, те же, что в нижнем меню */
.section-card h3 { display: flex; align-items: center; gap: 10px; }
.ic3d { flex: none; object-fit: contain; }
.bubble.ai > .ic3d { display: block; margin: -2px 0 6px; }

/* Шесть разделов остаются доступными на узком экране. */
.tabs a { min-width: 0; letter-spacing: 0; text-transform: none; font-family: var(--body); font-size: .65rem; text-align: center; }

/* 3D navigation: fixed icon boxes and single-line labels keep all six items aligned. */
.tabs { border: 1px solid var(--line); border-bottom: 0; border-radius: 22px 22px 0 0; padding: 7px 4px calc(7px + env(safe-area-inset-bottom)); gap: 2px; box-shadow: 0 -8px 30px -18px rgba(11, 73, 99, .3); }
.tabs a { min-width: 0; min-height: 66px; margin: 0; padding: 4px 0; border: 0; border-radius: 15px; gap: 3px; font: 600 10px/14px "Onest", Arial, sans-serif; letter-spacing: -.2px; text-transform: none; }
.tabs .tab-icon { flex: none; width: 44px; height: 42px; border-radius: 12px; background: none; }
.tabs .tab-icon img { display: block; width: 44px; height: 42px; object-fit: contain; filter: drop-shadow(0 2px 2px rgba(20, 62, 80, .12)); }
.tabs .tab-label { display: block; white-space: nowrap; }
.tabs a[aria-current="page"] { background: var(--mist); color: var(--vein-deep); box-shadow: inset 0 1px 0 color-mix(in srgb, var(--surface) 65%, transparent); }
.tabs a[aria-current="page"] .tab-icon { background: none; }
.tabs a:focus-visible { outline-offset: -3px; border-radius: 15px; }
@media (hover: hover) { .tabs a:hover .tab-icon { background: none; transform: none; } .tabs a:hover { background: var(--tint); } }
@media (max-width: 359px) { .tabs a { font-size: 9px; letter-spacing: -.3px; } .tabs .tab-icon, .tabs .tab-icon img { width: 40px; } }
