:root {
  --bg: #24160f; --nav: #1f130d; --card: #3b2519; --raised: #4a3022;
  --text: #ffe0b5; --muted: #c9a684; --dim: #b8977a;
  --accent: #ff9d6b; --accent2: #ffc49a; --accent-soft: rgba(255, 157, 107, .2); --on-accent: #2a1810;
  --line: rgba(255, 224, 181, .08); --track: rgba(255, 224, 181, .1);
  --ok: #ff9d6b; --warn: #ffc49a; --bad: #ff7a6b;
  --tab-h: 84px; --ease: cubic-bezier(.2, .8, .2, 1);
  /* системные панели: Android-приложение кладёт --inset-top/--inset-bottom (px), в браузере работает env() */
  --top: max(env(safe-area-inset-top, 0px), var(--inset-top, 0px));
  --bot: max(env(safe-area-inset-bottom, 0px), var(--inset-bottom, 0px));
  color-scheme: dark;
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes beat { 0%, 100% { transform: scale(1); } 14% { transform: scale(1.13); } 28% { transform: scale(1); } 42% { transform: scale(1.07); } }
@keyframes ring { from { stroke-dashoffset: 163.4; } }
@keyframes glow { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 157, 107, .55); } 50% { box-shadow: 0 0 0 7px rgba(255, 157, 107, 0); } }
@keyframes growx { from { transform: scaleX(0); } }
@keyframes growy { from { transform: scaleY(0); } }
@keyframes breathe { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.45); opacity: .55; } }
@keyframes halo { 0%, 100% { transform: scale(.9); opacity: .35; } 50% { transform: scale(1.1); opacity: .6; } }
@keyframes pagein { from { opacity: 0; transform: translateX(6px); } to { opacity: 1; transform: none; } }
@keyframes skel { 0%, 100% { opacity: .55; } 50% { opacity: .9; } }
@keyframes route { to { stroke-dashoffset: 0; } }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
/* полосы прокрутки скрыты везде, прокрутка работает */
* { scrollbar-width: none; -ms-overflow-style: none; }
*::-webkit-scrollbar, html::-webkit-scrollbar, body::-webkit-scrollbar { display: none; width: 0; height: 0; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.45 "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
main { max-width: 920px; margin: 0 auto; padding: calc(var(--top) + 14px) 20px calc(var(--tab-h) + 24px + var(--bot)); min-height: 100vh; }
h1 { font-size: 28px; font-weight: 900; margin: 0; letter-spacing: -.3px; }
h2 { font-size: 17px; font-weight: 800; margin: 0 0 12px; }
h3 { font-size: 15px; font-weight: 800; margin: 14px 0 6px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
a { color: var(--accent); }
a:hover { color: #ffbf98; }

/* появление страницы и карточек */
.view { animation: pagein .18s var(--ease) both; }
.quiet *, .quiet *::before, .quiet *::after { animation: none !important; transition: none !important; }
.skel-wrap { display: flex; flex-direction: column; gap: 14px; }
.skel { background: var(--card); border-radius: 26px; animation: skel 1.4s ease-in-out infinite; }
.tap, .btn, .chip, .seg button, .icon-btn, .tile { transition: transform .15s ease, background .2s ease, color .2s ease; }
.tap:active, .btn:active, .chip:active, .seg button:active, .icon-btn:active, .tile:active { transform: scale(.95); }
.beat { animation: beat 1.03s ease-in-out infinite; transform-origin: 50% 55%; }
.breathe { animation: breathe 2.4s ease-in-out infinite; }

/* шапки */
.page-h { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.page-h h1 { flex: 1; min-width: 0; }
.page-h .sub { display: block; font-size: 14px; font-weight: 600; color: var(--muted); margin-bottom: 2px; }
.icon-btn { width: 46px; height: 46px; border-radius: 16px; background: var(--card); display: flex; align-items: center; justify-content: center; color: var(--text); flex-shrink: 0; text-decoration: none; border: 0; cursor: pointer; }
.icon-btn:hover { color: var(--text); }
.icon-btn svg { width: 22px; height: 22px; }
.head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 14px; }
.daynav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 14px; }
.daynav .btn { min-width: 44px; }

.grid { display: grid; gap: 12px; }
@media (min-width: 720px) { .grid.two { grid-template-columns: 1fr 1fr; } .grid.three { grid-template-columns: repeat(3, 1fr); } }
.card { background: var(--card); border-radius: 26px; padding: 18px; margin-bottom: 14px; overflow: hidden; }
.card > h2:first-child { margin-top: 0; }
.card.cream { background: var(--text); color: #3b2519; }
.card.cream .muted { color: #3b2519; opacity: .75; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(104px, 1fr)); gap: 10px; margin-bottom: 14px; }
.kpi { background: var(--card); border-radius: 22px; padding: 14px 16px; }
.kpi b { display: block; font-size: 22px; font-weight: 900; letter-spacing: -.02em; }
.kpi span { font-size: 13px; font-weight: 700; color: var(--muted); }

/* сегмент-переключатель периода */
.seg { display: flex; background: var(--card); border-radius: 999px; padding: 4px; gap: 2px; margin-bottom: 14px; }
.seg button { flex: 1; border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 13px; font-weight: 800; padding: 8px 10px; border-radius: 999px; min-height: 44px; cursor: pointer; white-space: nowrap; }
.seg button.on { background: var(--text); color: var(--card); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 12px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { border: 0; background: var(--raised); color: var(--text); border-radius: 999px; padding: 10px 16px; min-height: 44px; font: inherit; font-size: 14px; font-weight: 700; white-space: nowrap; cursor: pointer; }
.chip.on { background: var(--accent); color: var(--on-accent); }
.btn { border: 0; background: var(--raised); color: var(--text); border-radius: 16px; padding: 12px 18px; min-height: 46px; font: inherit; font-weight: 800; cursor: pointer; }
.btn.primary { background: var(--accent); color: var(--on-accent); }
.btn.danger { color: var(--bad); }
.btn:disabled { opacity: .45; }
.btn.small { padding: 8px 14px; font-size: 14px; min-height: 44px; }
input[type=text], input[type=password], textarea, select {
  width: 100%; font: inherit; color: var(--text); background: var(--bg); border: 2px solid var(--line); border-radius: 16px; padding: 12px 14px; min-height: 48px;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); }
input[type=range] { width: 100%; accent-color: var(--accent); }
textarea { resize: vertical; min-height: 64px; }
.chart { width: 100%; height: 260px; }
.chart.tall { height: 340px; }
.chart.short { height: 200px; }
.empty { text-align: center; color: var(--muted); padding: 28px 12px; }
.empty b { display: block; color: var(--text); margin-bottom: 4px; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.list .grow { flex: 1; min-width: 0; }
.list .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu a { text-decoration: none; color: var(--text); display: flex; justify-content: space-between; align-items: center; min-height: 48px; padding: 12px 2px; font-weight: 700; border-bottom: 1px solid var(--line); }
.menu a:last-child { border-bottom: 0; }
.menu a::after { content: "›"; color: var(--muted); }
.bars .row { display: grid; grid-template-columns: minmax(80px, 38%) 1fr auto; gap: 10px; align-items: center; padding: 5px 0; font-size: 14px; font-weight: 700; }
.bars .row .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bars .bar { height: 8px; border-radius: 4px; background: var(--track); overflow: hidden; }
.bars .bar i { display: block; height: 100%; background: var(--accent); border-radius: 4px; transform-origin: left; animation: growx 1s var(--ease) both .2s; }
.bars .row:nth-child(even) .bar i { background: var(--accent2); }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th, table.t td { text-align: left; padding: 10px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.t th { color: var(--muted); font-weight: 800; font-size: 12px; }
.scroll-x { overflow-x: auto; }
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; }
.pill.fresh { background: rgba(255, 157, 107, .2); color: var(--accent); }
.pill.lag { background: rgba(255, 196, 154, .16); color: var(--accent2); }
.pill.stale { background: var(--track); color: var(--muted); }
.md h1, .md h2, .md h3 { margin: 14px 0 6px; }
.md p { margin: 8px 0; } .md ul, .md ol { padding-left: 22px; } .md code { background: var(--bg); padding: 1px 6px; border-radius: 6px; }
.md pre { background: var(--bg); padding: 12px; border-radius: 16px; overflow-x: auto; } .md blockquote { margin: 8px 0; padding-left: 12px; border-left: 3px solid var(--accent); color: var(--muted); }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--tab-h) + 16px + var(--bot)); background: var(--text); color: var(--card); padding: 12px 18px; border-radius: 16px; font-size: 14px; font-weight: 800; z-index: 50; animation: rise .4s var(--ease) both; }
.banner { background: var(--accent-soft); border-radius: 18px; padding: 12px 16px; margin-bottom: 14px; font-size: 14px; font-weight: 600; }
.spin { text-align: center; padding: 40px; color: var(--muted); font-weight: 700; }

/* карта: тёмные тайлы CARTO, перекрашенные в тёплый шоколад */
.map { height: 380px; border-radius: 22px; overflow: hidden; background: var(--bg); }
.map .leaflet-tile-pane { filter: sepia(1) hue-rotate(-18deg) saturate(1.6) brightness(.8) contrast(1.15); }
.leaflet-container { font-family: inherit; background: var(--bg); }
/* глобальное img/svg/canvas {max-width:100%} ломает Leaflet: canvas-слой точек схлопывается в 0 */
.leaflet-container canvas, .leaflet-container img, .leaflet-container svg { max-width: none !important; max-height: none !important; }
.leaflet-bar a { background: var(--raised); color: var(--text); border-color: var(--line); }
.leaflet-bar a:hover { background: var(--card); color: var(--text); }
.leaflet-control-attribution { background: rgba(31, 19, 13, .75) !important; color: var(--dim) !important; }
.leaflet-control-attribution a { color: var(--muted) !important; }

/* кольца и лента дня */
.note { display: flex; gap: 14px; align-items: flex-start; }
.note .ic { width: 52px; height: 52px; border-radius: 18px; background: rgba(255, 157, 107, .14); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.note .lbl { font-size: 12px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: var(--accent); }
.note p { margin: 6px 0 0; font-size: 16px; line-height: 1.4; font-weight: 600; }
.note a { font-size: 13px; font-weight: 800; text-decoration: none; display: inline-block; margin-top: 8px; }
.rings { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.ringc { background: var(--card); border-radius: 22px; padding: 14px 8px 12px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.ringc svg { width: 64px; height: 64px; }
.ringc .rc { animation: ring 1.4s cubic-bezier(.3, .9, .3, 1) both .35s; }
.ringc .v { font-size: 18px; font-weight: 900; text-align: center; }
.ringc .v.none { font-size: 13px; color: var(--muted); font-weight: 700; padding: 3px 0; }
.ringc .l { font-size: 12px; font-weight: 700; color: var(--muted); }
.ribbon { position: relative; height: 22px; }
.ribbon .strip { position: relative; height: 22px; border-radius: 11px; overflow: hidden; background: rgba(255, 224, 181, .06); animation: growx 1s var(--ease) both .2s; transform-origin: left; }
.ribbon .strip i { position: absolute; top: 0; bottom: 0; }
.ribbon .now { position: absolute; top: -3px; width: 4px; height: 28px; border-radius: 2px; background: var(--text); animation: glow 2s ease-out infinite; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; font-weight: 700; color: var(--muted); margin-top: 12px; }
.legend span { display: flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 4px; display: inline-block; }
.moments { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.moments h2 { margin: 4px 2px 2px; }
.moment { background: var(--card); border-radius: 20px; padding: 12px 14px; display: flex; align-items: center; gap: 12px; }
.moment .mi { width: 40px; height: 40px; border-radius: 14px; background: var(--track); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.moment b { display: block; font-size: 15px; font-weight: 800; }
.moment span { font-size: 13px; font-weight: 600; color: var(--muted); }

/* Рекомендации */
.recs { display: flex; flex-direction: column; margin-bottom: 4px; }
.rec { background: linear-gradient(135deg, #5a3a28, var(--card)); }
.rec-t { margin: 0; font-size: 17px; line-height: 1.4; font-weight: 800; }
.rec-why { margin: 6px 0 0; font-size: 13px; line-height: 1.4; font-weight: 600; color: var(--muted); }
.rec-empty p { margin: 0; font-size: 15px; line-height: 1.4; font-weight: 600; color: var(--muted); }

/* Ещё */
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.tile { text-decoration: none; color: var(--text); background: var(--card); border-radius: 24px; padding: 16px; min-height: 120px; display: flex; flex-direction: column; justify-content: space-between; }
.tile:hover { color: var(--text); }
.tile svg { width: 26px; height: 26px; }
.tile b { display: block; font-size: 17px; font-weight: 900; }
.tile span { font-size: 13px; font-weight: 700; color: var(--muted); }
.tile.hl { background: var(--text); color: #3b2519; }
.tile.hl:hover { color: #3b2519; }
.tile.hl span { color: #3b2519; opacity: .75; }
.src { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.src:last-child { border-bottom: 0; }
.src .txt { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 12px; }
.src .name { font-size: 15px; font-weight: 800; min-width: 0; overflow-wrap: anywhere; }
.src .when { font-size: 13px; font-weight: 700; color: var(--muted); }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
.dot.lag { background: var(--accent2); }
.dot.stale { background: transparent; border: 2px solid rgba(255, 224, 181, .35); }
.foot-link { display: block; text-align: center; font-size: 14px; font-weight: 800; padding: 10px; text-decoration: none; }

/* нижняя навигация */
#tabs {
  position: fixed; left: 0; right: 0; bottom: 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 0;
  height: calc(var(--tab-h) + var(--bot)); padding: 8px 2px calc(6px + var(--bot));
  background: var(--nav); border-top: 1px solid var(--line); z-index: 20;
}
#tabs a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 44px; font-size: 11px; font-weight: 700; color: var(--dim); text-decoration: none; }
#tabs .pillbg { width: 54px; height: 30px; border-radius: 999px; display: flex; align-items: center; justify-content: center; transition: background .25s ease, color .25s ease; }
#tabs svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
#tabs a.on { color: var(--text); font-weight: 800; }
#tabs a.on .pillbg { background: var(--accent-soft); color: var(--accent); }
#tabs .brand { display: none; }

/* вход */
body.login { display: grid; place-items: center; min-height: 100vh; padding: var(--top) 0 var(--bot); }
.login-card { width: min(88vw, 340px); display: flex; flex-direction: column; gap: 36px; padding: 32px 0; }
.login-hero { display: flex; flex-direction: column; align-items: center; gap: 18px; animation: rise .8s var(--ease) both; }
.login-heart { position: relative; width: 150px; height: 150px; display: flex; align-items: center; justify-content: center; }
.login-heart .halo { position: absolute; inset: 0; border-radius: 50%; background: rgba(255, 157, 107, .28); animation: halo 4s ease-in-out infinite; }
.login-heart svg { position: relative; width: 130px; height: 130px; animation: beat 1.1s ease-in-out infinite; transform-origin: 50% 55%; }
.login-hero h1 { font-size: 34px; text-align: center; }
.login-hero p { margin: 4px 0 0; font-size: 15px; font-weight: 600; color: var(--muted); text-align: center; }
.login-form { display: flex; flex-direction: column; gap: 12px; animation: rise .8s var(--ease) .15s both; }
.login-form label.lbl { font-size: 14px; font-weight: 800; color: var(--muted); padding-left: 4px; }
.login-form input[type=password], .login-form input[type=text] { height: 56px; border-radius: 18px; background: var(--card); font-size: 18px; padding: 0 18px; border-color: rgba(255, 224, 181, .12); }
.login-form .btn.primary { height: 56px; border-radius: 18px; font-size: 17px; font-weight: 900; margin-top: 4px; }
.login-form .show { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 14px; font-weight: 700; color: var(--muted); }
.login-form .show input { width: 20px; height: 20px; accent-color: var(--accent); }
.err { color: var(--bad); min-height: 1.2em; margin: 0; text-align: center; font-weight: 700; }

/* фокус с клавиатуры */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
input:focus-visible, textarea:focus-visible, select:focus-visible { outline: none; }
#tabs a:focus-visible { outline-offset: -2px; border-radius: 999px; }

/* адаптив */
html, body { overflow-x: hidden; }
img, svg, canvas { max-width: 100%; }
.dash { display: grid; gap: 0 14px; grid-template-columns: minmax(0, 1fr); }
.dash > * { min-width: 0; }
@media (hover: hover) {
  .tile:hover { background: var(--raised); }
  .tile.hl:hover { background: #fff0d6; }
  .chip:hover { background: #5a3a28; }
  .chip.on:hover { background: var(--accent); }
  .btn:hover { background: #5a3a28; }
  .btn.primary:hover { background: #ffad82; }
  .seg button:hover:not(.on) { color: var(--text); }
  .menu a:hover { color: var(--accent); }
  .rec:hover, .ringc:hover { filter: brightness(1.08); }
}

/* планшет и выше: страница центрируется, карточки в две колонки */
@media (min-width: 768px) {
  main { max-width: 1040px; padding-left: 32px; padding-right: 32px; }
  .rings { gap: 14px; }
  .kpis { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
  .tile { min-height: 132px; }
  .seg { max-width: 460px; }
  .page-h h1 { font-size: 32px; }
  /* главная: советы слева, кольца и экран справа */
  .view[data-page=today] { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 20px; align-items: start; }
  .view[data-page=today] > * { min-width: 0; }
  .view[data-page=today] > .page-h, .view[data-page=today] > .banner { grid-column: 1 / -1; }
  .view[data-page=today] .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .view[data-page=today] .rings { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* страницы с графиками и настройки: колонки без дыр, шапка/период/цифры/главный график на всю ширину */
  .view[data-page=social] > div:not([class]), .view[data-page=health] > div:not([class]), .view[data-page=time] > div:not([class]),
  .view[data-page=media] > div:not([class]), .view[data-page=purchases] > div:not([class]) { column-count: 2; column-gap: 16px; }
  .view[data-page=more], .view[data-page=settings] { column-count: 2; column-gap: 16px; }
  .view[data-page] > div:not([class]) > *, .view[data-page=more] > *, .view[data-page=settings] > * { break-inside: avoid; }
  .view[data-page] > div:not([class]) > .kpis, .view[data-page] > div:not([class]) > .kpis + .card, .view[data-page] > div:not([class]) > .empty,
  .view[data-page] > div:not([class]) > .banner, .view[data-page=more] > .page-h, .view[data-page=more] > .tiles, .view[data-page=settings] > .page-h,
  .view[data-page=settings] > .muted, .view[data-page=time] > div:not([class]) > .card:first-child { column-span: all; }
}
@media (min-width: 1024px) {
  main { max-width: none; margin: 0 0 0 220px; padding: 32px 40px 48px; width: calc(100% - 220px); }
  .view { max-width: 1200px; margin: 0 auto; }
  .dash { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash > .span2 { grid-column: 1 / -1; }
  .dash.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .map { height: 520px; }
  .places-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 14px; align-items: start; }
  .toast { bottom: 24px; left: calc(50% + 110px); }
  .chart { height: 300px; }
  .chart.tall { height: 400px; }
  .chart.short { height: 240px; }
  #tabs {
    left: 0; right: auto; top: 0; bottom: 0; width: 220px; height: auto; grid-template-columns: none; grid-auto-flow: row; display: flex; flex-direction: column;
    gap: 6px; padding: 28px 14px; border-top: 0; border-right: 1px solid var(--line); overflow-y: auto;
  }
  #tabs .brand { display: flex; align-items: center; gap: 10px; padding: 0 10px 22px; font-size: 22px; font-weight: 900; color: var(--text); }
  #tabs .brand svg { width: 30px; height: 30px; color: var(--accent); }
  #tabs a { flex-direction: row; justify-content: flex-start; gap: 12px; padding: 4px 8px; border-radius: 999px; font-size: 15px; min-height: 48px; transition: background .2s ease, color .2s ease; }
  #tabs a[data-tab=more] { margin-top: auto; }
  #tabs a:hover { color: var(--text); background: rgba(255, 224, 181, .06); }
  #tabs a:hover .pillbg { color: var(--accent); }
  #tabs .pillbg { width: 44px; height: 36px; flex-shrink: 0; }
  #tabs a.on, #tabs a.on:hover { background: var(--accent-soft); }
  #tabs a.on .pillbg { background: transparent; }
}
@media (min-width: 1500px) {
  #tabs { width: 248px; }
  main { margin-left: 248px; width: calc(100% - 248px); }
  .toast { left: calc(50% + 124px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* дневник еды */
.fday { padding: 14px 16px; }
.fday > summary, .fstock > summary { cursor: pointer; list-style: none; }
.fday > summary::-webkit-details-marker, .fstock > summary::-webkit-details-marker, .fcomp > summary::-webkit-details-marker { display: none; }
.fhead { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.fthumbs { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.fimg { width: 48px; height: 48px; border-radius: 12px; object-fit: cover; background: var(--raised); flex: none; display: block; }
.fimg.sm { width: 34px; height: 34px; border-radius: 9px; }
.fimg.ph { display: flex; align-items: center; justify-content: center; color: var(--dim); opacity: .6; }
.fimg.ph svg { width: 55%; height: 55%; }
.flist { margin-top: 10px; }
.list li.fitem { align-items: flex-start; padding: 8px 0; gap: 10px; }
.fbody { flex: 1; min-width: 0; }
.fname { font-weight: 700; font-size: 15px; line-height: 1.25; overflow-wrap: anywhere; }
.fkcal { flex: none; text-align: right; white-space: nowrap; }
.fkcal small { font-weight: 600; opacity: .7; }
.fcomp > summary { cursor: pointer; list-style: none; text-decoration: underline dotted; width: fit-content; }
.fstock { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); }

/* переключатель «Новая версия» в Настройках */
.ver-switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 0; cursor: pointer; font-weight: 700; }
.ver-switch input { appearance: none; width: 44px; height: 26px; border-radius: 13px; background: var(--track); position: relative; cursor: pointer; transition: background .2s; flex: none; }
.ver-switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--muted); transition: transform .2s var(--ease), background .2s; }
.ver-switch input:checked { background: var(--accent); }
.ver-switch input:checked::after { transform: translateX(18px); background: var(--on-accent); }
