:root {
  --bg: var(--tg-theme-bg-color, #ffffff);
  --bg2: var(--tg-theme-secondary-bg-color, #f2f3f5);
  --text: var(--tg-theme-text-color, #1f2328);
  --hint: var(--tg-theme-hint-color, #7d828b);
  --link: var(--tg-theme-link-color, #2f7de1);
  --accent: var(--tg-theme-button-color, #2e9e5b);
  --accent-text: var(--tg-theme-button-text-color, #ffffff);
  --danger: var(--tg-theme-destructive-text-color, #d9534f);
  --ok: #2e9e5b;
  --warn: #e0a100;
  --warn-bg: color-mix(in srgb, #f5c542 18%, var(--bg));
  --ok-bg: color-mix(in srgb, #2e9e5b 12%, var(--bg));
  --danger-bg: color-mix(in srgb, #d9534f 12%, var(--bg));
  --soft: color-mix(in srgb, var(--accent) 10%, var(--bg));
  --line: color-mix(in srgb, var(--hint) 22%, transparent);
  --radius: 16px;
}
@media (prefers-color-scheme: dark) {
  :root:not(.tg) { --bg: #17191c; --bg2: #0f1113; --text: #e8e9eb; --hint: #8d939c; }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg2); color: var(--text); font: 17px/1.45 -apple-system, system-ui, "Segoe UI", Roboto, sans-serif; }
body { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
body.no-scroll { overflow: hidden; }
main { padding: 12px 16px 16px; max-width: 720px; margin: 0 auto; }
h1 { font-size: 24px; margin: 6px 0 12px; line-height: 1.2; }
h2 { font-size: 19px; margin: 0; }
h3 { font-size: 17px; margin: 18px 0 8px; }
p { margin: 6px 0; }
a { color: var(--link); }
.muted { color: var(--hint); }
.small, small { font-size: 14px; }
.center { text-align: center; }
.grow { flex: 1; min-width: 0; }
.block { display: block; width: 100%; }
.hidden { display: none !important; }

/* ---------- кнопки ---------- */
button { font: inherit; color: inherit; cursor: pointer; }
.btn, .big-btn {
  border: none; border-radius: 12px; background: var(--bg2); color: var(--text);
  padding: 10px 14px; min-height: 44px; font-weight: 500;
}
main .big-btn:not(.primary) { background: var(--bg); box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.big-btn { min-height: 54px; padding: 14px 16px; font-size: 17px; border-radius: 14px; margin: 6px 0; }
.card .big-btn, .sheet-body .big-btn { background: var(--bg2); }
.btn.primary, .big-btn.primary { background: var(--accent); color: var(--accent-text); }
.btn.secondary { background: var(--soft); color: var(--text); }
.btn.danger-outline { background: none; color: var(--danger); border: 1.5px solid color-mix(in srgb, var(--danger) 40%, transparent); }
button:disabled { opacity: .55; }
button:active:not(:disabled) { transform: scale(.98); }
.link { background: none; border: none; color: var(--link); padding: 8px 4px; font-weight: 500; }
.row-btns { display: flex; gap: 8px; align-items: stretch; }
.row-btns .big-btn, .row-btns .btn { margin: 6px 0; }
.close-btn { background: var(--bg2); border: none; border-radius: 50%; width: 36px; height: 36px; font-size: 16px; flex-shrink: 0; }
.back-link { background: none; border: none; color: var(--link); padding: 4px 0; font-size: 16px; align-self: flex-start; }

/* ---------- поля ---------- */
input, textarea, select {
  width: 100%; font: inherit; color: var(--text); background: var(--bg2);
  border: 1.5px solid transparent; border-radius: 12px; padding: 12px 14px; min-height: 48px;
}
.card input, .card textarea { background: var(--bg2); }
textarea { resize: vertical; line-height: 1.4; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); }
label { display: block; font-size: 15px; color: var(--hint); margin: 16px 0 6px; font-weight: 500; }
label small { font-weight: 400; }
.check-row { display: flex; gap: 12px; align-items: flex-start; color: var(--text); font-size: 16px; margin: 12px 0; padding: 12px; background: var(--bg2); border-radius: 12px; }
.check-row input { width: 24px; height: 24px; min-height: 0; flex-shrink: 0; margin: 2px 0 0; accent-color: var(--accent); }
.inline-form { display: flex; gap: 8px; margin: 8px 0; }
.inline-form .btn { min-width: 56px; font-size: 20px; }
.search { margin: 10px 0; }
.or { text-align: center; color: var(--hint); margin: 4px 0; font-size: 14px; }
details { margin: 12px 0; }
summary { color: var(--link); cursor: pointer; padding: 8px 0; font-weight: 500; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid-2 .big-btn { margin: 0; }
.grid-2x { display: grid; grid-template-columns: 1fr 90px; gap: 8px; }

/* ---------- карточки и списки ---------- */
.card { background: var(--bg); border-radius: var(--radius); padding: 14px 16px; margin: 12px 0; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
button.card { display: block; width: 100%; text-align: left; border: none; }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.page-head { display: flex; flex-direction: column; }
.page-head h1 { margin-bottom: 6px; }
.hello h1 { margin-bottom: 2px; }
.hello { margin-bottom: 4px; }

.list { background: var(--bg); border-radius: var(--radius); overflow: hidden; margin: 8px 0; }
.sheet-body .list { background: var(--bg2); }
.row-item {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: none; border: none;
  padding: 14px 16px; border-bottom: 1px solid var(--line); min-height: 60px;
}
.row-item:last-child { border-bottom: none; }
.row-emoji { font-size: 20px; min-width: 32px; letter-spacing: -2px; }
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.row-title { font-weight: 500; }
.row-sub { color: var(--hint); font-size: 14px; }
.row-arrow { color: var(--hint); font-size: 22px; }
.big-list .row-item { min-height: 68px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.chips.scroll-x { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips.scroll-x::-webkit-scrollbar { display: none; }
.chip {
  border-radius: 999px; padding: 9px 14px; font-size: 15px; background: var(--bg); color: var(--text);
  border: 1.5px solid var(--line); white-space: nowrap; min-height: 40px;
}
.sheet-body .chip { background: var(--bg2); border-color: transparent; }
.chip.on { background: var(--soft); border-color: var(--accent); font-weight: 600; }
.tag { display: inline-block; font-size: 13px; padding: 3px 10px; border-radius: 999px; background: var(--bg2); color: var(--text); margin: 3px 4px 0 0; }
.tag.big { font-size: 15px; padding: 6px 12px; background: var(--danger-bg); }
.badge { font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--warn-bg); color: var(--text); font-weight: 500; vertical-align: middle; }

.notice { background: var(--soft); border-radius: 12px; padding: 12px 14px; margin: 10px 0; font-size: 15px; }
.notice.warn { background: var(--warn-bg); }
.notice.danger { background: var(--danger-bg); }
.notice.ok { background: var(--ok-bg); }
.hint-card {
  display: flex; gap: 8px; align-items: flex-start; background: var(--soft); border-radius: 14px; padding: 12px 14px; margin: 10px 0;
  font-size: 15px; border: 1.5px dashed color-mix(in srgb, var(--accent) 40%, transparent);
}
.hint-text { flex: 1; }
.hint-card .link { white-space: nowrap; padding: 0 0 0 4px; }
.empty { text-align: center; padding: 32px 16px; color: var(--hint); }
.empty-icon { font-size: 44px; margin-bottom: 8px; }

/* ---------- главная ---------- */
.welcome { background: linear-gradient(135deg, var(--soft), var(--bg)); }
.welcome h2 { margin-bottom: 6px; }
.reminder { background: var(--warn-bg); }
.reminder h3 { margin-top: 0; }
.slot { padding: 12px 0; border-bottom: 1px solid var(--line); }
.slot:last-child { border-bottom: none; padding-bottom: 4px; }
.slot-head { font-size: 14px; color: var(--hint); font-weight: 600; text-transform: uppercase; letter-spacing: .3px; }
.slot-dish { font-size: 18px; font-weight: 600; margin: 4px 0; }
.slot-dish.done { color: var(--ok); }
.slot-empty { color: var(--hint); margin: 4px 0; }
.slot-btns { display: flex; gap: 8px; margin-top: 6px; }
.slot-btns .btn { flex: 1; }
.rate { display: flex; align-items: center; gap: 6px; color: var(--hint); font-size: 15px; }
.rate button { background: var(--bg2); border: none; border-radius: 10px; font-size: 20px; padding: 6px 12px; min-height: 40px; }
.actions-grid { margin: 12px 0; }
.tile {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; border: none;
  background: var(--bg); border-radius: var(--radius); padding: 14px; min-height: 112px; box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.tile-icon { font-size: 30px; margin-bottom: 4px; }
.tile small { color: var(--hint); }
.balance-mini h3 { margin-top: 0; }
.miss { margin: 6px 0; }

/* ---------- меню ---------- */
.day h3 { margin: 0 0 4px; }
.plan-row {
  display: flex; flex-direction: column; align-items: flex-start; width: 100%; text-align: left; border: none; background: none;
  padding: 10px 0; border-bottom: 1px solid var(--line); min-height: 56px;
}
.plan-row:last-child { border-bottom: none; }
.plan-meal { font-size: 13px; color: var(--hint); font-weight: 600; text-transform: uppercase; letter-spacing: .3px; }
.plan-dish { font-size: 17px; font-weight: 500; }
.plan-row.empty .plan-dish { color: var(--link); font-weight: 500; }
.prep { display: block; font-size: 13px; color: var(--warn); font-weight: 500; }
.slot-big { font-size: 22px; font-weight: 700; margin: 4px 0 10px; }

/* ---------- рецепт ---------- */
.meta-line { color: var(--hint); }
.tags { margin: 6px 0; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 18px; }
.section-head h3 { margin: 0; }
.stepper { display: flex; align-items: center; gap: 4px; background: var(--bg2); border-radius: 12px; padding: 4px; }
.stepper button { width: 40px; height: 40px; border: none; border-radius: 10px; background: var(--bg); font-size: 22px; line-height: 1; }
.stepper span { min-width: 70px; text-align: center; }
.ingredients { list-style: none; padding: 0; margin: 8px 0; }
.ingredients li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.ingredients b { white-space: nowrap; font-weight: 600; }
.steps { padding-left: 22px; }
.steps li { margin: 8px 0; }
.notes { white-space: pre-wrap; }
.actions { margin-top: 18px; }
.setting { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line); }
.setting .check-row { flex: 1; margin: 6px 0; background: none; padding: 6px 0; }
.setting select { width: 100px; flex-shrink: 0; }
.sub { padding: 10px 0; border-bottom: 1px solid var(--line); }
.need { margin: 10px 0; }
.bar-row { margin: 12px 0; }
.bar-label { display: flex; justify-content: space-between; }
.bar { height: 10px; border-radius: 5px; background: var(--bg2); overflow: hidden; margin-top: 6px; }
.bar > i { display: block; height: 100%; background: var(--ok); border-radius: 5px; }
.bar.low > i { background: var(--warn); }
.bar.missing > i { background: var(--danger); }

/* ---------- добавление ---------- */
.choice-list { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.choice {
  display: flex; align-items: center; gap: 14px; text-align: left; border: none; background: var(--bg2);
  border-radius: 16px; padding: 14px 16px; min-height: 72px;
}
.choice b { display: block; font-size: 17px; }
.choice small { color: var(--hint); }
.choice-icon { font-size: 30px; width: 40px; text-align: center; }
.mic-wrap { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 24px 0; }
.mic {
  width: 120px; height: 120px; border-radius: 50%; border: none; font-size: 48px;
  background: var(--accent); color: var(--accent-text); box-shadow: 0 6px 20px color-mix(in srgb, var(--accent) 40%, transparent);
}
.mic.rec { background: var(--danger); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.07); } }
.mic-label { text-align: center; min-height: 48px; }

/* ---------- покупки ---------- */
.add-item { margin: 12px 0; }
.aisle h3 { margin: 0 0 4px; font-size: 15px; color: var(--hint); text-transform: uppercase; letter-spacing: .3px; }
.shop-item {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; border: none; background: none;
  padding: 12px 0; border-bottom: 1px solid var(--line); min-height: 52px;
}
.shop-item:last-child { border-bottom: none; }
.shop-item .box { width: 26px; height: 26px; border: 2px solid var(--hint); border-radius: 8px; flex-shrink: 0; display: grid; place-items: center; font-size: 16px; color: var(--accent-text); }
.shop-item.done .box { background: var(--accent); border-color: var(--accent); }
.shop-item.done .grow { text-decoration: line-through; color: var(--hint); }
.shop-item .amount { color: var(--hint); font-size: 15px; text-align: right; }
.bought { opacity: .8; }

/* ---------- нижнее меню ---------- */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; display: flex; background: var(--bg);
  border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); z-index: 5;
}
.tabs button { flex: 1; background: none; border: none; color: var(--hint); padding: 8px 0 10px; font-size: 12px; display: flex; flex-direction: column; align-items: center; gap: 2px; font-weight: 500; }
.tabs button span { font-size: 22px; filter: grayscale(.6); opacity: .8; }
.tabs button.active { color: var(--accent); }
.tabs button.active span { filter: none; opacity: 1; }

/* ---------- шторка ---------- */
.sheet { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 10; display: flex; align-items: flex-end; }
.sheet-body {
  background: var(--bg); width: 100%; max-width: 720px; margin: 0 auto; max-height: 94vh; overflow-y: auto; overscroll-behavior: contain;
  border-radius: 20px 20px 0 0; padding: 16px 16px calc(24px + env(safe-area-inset-bottom)); animation: up .18s ease-out;
}
@keyframes up { from { transform: translateY(30px); opacity: .6; } }
.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 8px; position: sticky; top: -16px; background: var(--bg); padding: 8px 0; z-index: 1; }
.sheet-head h2 { font-size: 21px; line-height: 1.25; }

/* ---------- полноэкранные режимы ---------- */
.overlay { position: fixed; inset: 0; z-index: 30; background: var(--bg); display: flex; flex-direction: column; }
.cook { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
.cook-top { display: flex; align-items: center; gap: 12px; }
.cook-top .btn { white-space: nowrap; }
.cook-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cook-progress { height: 6px; background: var(--bg2); border-radius: 3px; margin: 12px 0; overflow: hidden; }
.cook-progress i { display: block; height: 100%; background: var(--accent); transition: width .2s; }
.cook-body { flex: 1; overflow-y: auto; padding: 8px 0; }
.cook-label { color: var(--hint); font-weight: 600; margin-bottom: 12px; }
.cook-step { font-size: 26px; line-height: 1.4; font-weight: 500; }
.cook-done { font-size: 72px; text-align: center; margin-top: 20px; }
.cook-ingr { list-style: none; padding: 0; margin: 0; font-size: 19px; }
.cook-ingr label { display: flex; align-items: center; gap: 12px; color: var(--text); font-size: 19px; margin: 0; padding: 10px 0; border-bottom: 1px dashed var(--line); font-weight: 400; }
.cook-ingr input { width: 26px; height: 26px; min-height: 0; flex-shrink: 0; accent-color: var(--accent); }
.cook-ingr span { flex: 1; }
.cook-ingr input:checked ~ span, .cook-ingr input:checked ~ b { text-decoration: line-through; color: var(--hint); }
.timers { margin-top: 20px; }
.timer-btn { background: var(--warn-bg) !important; }
#timer-bar { display: flex; flex-wrap: wrap; gap: 8px; }
.timer { background: var(--warn-bg); border-radius: 12px; padding: 8px 12px; font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; display: flex; align-items: center; gap: 6px; }
.timer.ring { background: var(--danger); color: #fff; animation: pulse .8s infinite; }
.cook-nav { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; }
.cook-nav .big-btn { margin: 8px 0 0; }

.onboard { justify-content: center; padding: 24px 24px calc(24px + env(safe-area-inset-bottom)); }
.onb { max-width: 460px; margin: 0 auto; text-align: center; }
.onb-icon { font-size: 84px; }
.onb h1 { font-size: 26px; }
.onb p { font-size: 18px; color: var(--hint); min-height: 110px; }
.dots { display: flex; justify-content: center; gap: 8px; margin: 18px 0; }
.dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.dots i.on { background: var(--accent); width: 22px; border-radius: 4px; }

.toast {
  position: fixed; left: 50%; bottom: calc(92px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: rgba(30,30,30,.94); color: #fff; padding: 12px 18px; border-radius: 14px; z-index: 50;
  max-width: 92vw; font-size: 15px; text-align: center; box-shadow: 0 4px 16px rgba(0,0,0,.2);
}
.spinner { display: inline-block; width: 18px; height: 18px; border: 2.5px solid currentColor; border-top-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -3px; opacity: .7; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- мастер первого запуска ---------- */
body.setup-mode { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
body.setup-mode .tabs { display: none; }
.setup-head { position: sticky; top: 0; background: var(--bg2); padding: 8px 0 4px; z-index: 4; }
.setup-steps { font-size: 14px; color: var(--hint); }
.setup-head .cook-progress { margin: 8px 0 4px; }
.setup-hero { text-align: center; padding: 12px 8px; }
.setup-icon { font-size: 64px; }
.setup-hero p { font-size: 18px; color: var(--hint); }
.setup-nav { display: flex; gap: 10px; margin-top: 16px; }
.setup-nav .big-btn { margin: 0; }
.stepper.big { justify-content: center; margin: 12px auto 4px; width: fit-content; }
.stepper.big button { width: 56px; height: 56px; font-size: 28px; }
.stepper.big span { min-width: 110px; font-size: 22px; }
.coverage { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 8px 0 12px; }
.cov { background: var(--bg); border-radius: 12px; padding: 8px 4px; text-align: center; display: flex; flex-direction: column; border: 1.5px solid var(--line); }
.cov span { font-size: 22px; }
.cov b { font-size: 20px; }
.cov small { color: var(--hint); font-size: 12px; }
.cov.ok { border-color: var(--ok); background: var(--ok-bg); }
.card.compact { padding: 8px 14px; }
.mini-row { padding: 6px 0; border-bottom: 1px solid var(--line); }
.mini-row:last-child { border-bottom: none; }
.plan-row.small { flex-direction: row; align-items: center; gap: 10px; min-height: 44px; padding: 8px 0; }
.plan-row.small .plan-meal { font-size: 18px; }
.plan-row.small .plan-dish { font-size: 16px; }
.mic-wrap.small { flex-direction: row; padding: 8px 0 12px; gap: 14px; justify-content: flex-start; }
.mic-wrap.small .mic { width: 64px; height: 64px; font-size: 28px; flex-shrink: 0; }
.mic-wrap.small .mic-label { text-align: left; min-height: 0; font-size: 15px; }
.check-row.starter { margin: 0; border-radius: 0; border-bottom: 1px solid var(--line); background: none; }
.check-row.starter:last-child { border-bottom: none; }
.check-row.disabled { opacity: .55; }
.sticky-bottom { position: sticky; bottom: 0; box-shadow: 0 -6px 16px var(--bg); }
.have-counter { margin: 10px 0 4px; font-size: 17px; }
.have-item {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; border: none; background: none;
  padding: 10px 0; border-bottom: 1px solid var(--line); min-height: 56px;
}
.have-item:last-child { border-bottom: none; }
.have-item .grow { display: flex; flex-direction: column; }
.have-item .amount { color: var(--hint); font-size: 14px; }
.have-item .pill { border-radius: 999px; padding: 8px 14px; font-size: 15px; font-weight: 600; background: var(--warn-bg); white-space: nowrap; }
.have-item.have .pill { background: var(--ok); color: #fff; }
.have-item.have .have-name { color: var(--hint); text-decoration: line-through; }
.continue-setup { background: var(--warn-bg); }

/* ---------- члены семьи ---------- */
:root { --st-good: #0ca30c; --st-warn: #fab219; --st-crit: #d03b3b; }
.eaters { display: block; font-size: 15px; margin: -2px 0 4px; }
.eaters small { color: var(--hint); }
.other-dish { margin-top: 8px; text-align: left; }
.who-ate h3 { margin-bottom: 2px; }
.chips.who .chip { font-size: 16px; padding: 10px 14px; }
.chips.who .chip:not(.on) { opacity: .55; text-decoration: line-through; }

.members-list { display: flex; flex-direction: column; gap: 8px; margin: 8px 0; }
.member-row { display: flex; align-items: center; gap: 8px; }
.member-emoji { font-size: 26px; width: 52px; height: 48px; border-radius: 12px; border: none; background: var(--bg2); flex-shrink: 0; }
.member-row .member-name { flex: 1; }
.member-row .close-btn { flex-shrink: 0; }

/* таблица «кто что ел»: строка — человек, столбец — группа продуктов */
.fam-grid { display: flex; flex-direction: column; gap: 6px; margin: 6px 0 10px; }
.fg-row { display: grid; grid-template-columns: minmax(60px, 1fr) repeat(var(--cols), 28px); gap: 3px; align-items: center; }
.fg-head .fg-cat { text-align: center; font-size: 20px; line-height: 1; }
.fg-name { display: flex; align-items: center; gap: 4px; min-width: 0; background: none; border: none; padding: 0; text-align: left; font-size: 15px; font-weight: 500; color: var(--text); }
.fg-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fg-cell {
  aspect-ratio: 1; border-radius: 8px; border: 1.5px solid transparent; padding: 0;
  display: grid; place-items: center; font-size: 14px; font-weight: 700; color: var(--text);
}
.fg-cell.ok { background: color-mix(in srgb, var(--st-good) 24%, var(--bg)); border-color: color-mix(in srgb, var(--st-good) 55%, transparent); }
.fg-cell.low { background: color-mix(in srgb, var(--st-warn) 30%, var(--bg)); border-color: color-mix(in srgb, var(--st-warn) 70%, transparent); }
.fg-cell.missing { background: color-mix(in srgb, var(--st-crit) 10%, var(--bg)); border: 1.5px dashed color-mix(in srgb, var(--st-crit) 55%, transparent); color: var(--hint); }
.fg-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--hint); margin-bottom: 8px; }
.fg-legend span { display: inline-flex; align-items: center; gap: 5px; }
.fg-dot { width: 20px; height: 20px; border-radius: 6px; display: inline-grid; place-items: center; font-style: normal; font-size: 11px; font-weight: 700; color: var(--text); border: 1.5px solid transparent; }
.fg-dot.ok { background: color-mix(in srgb, var(--st-good) 24%, var(--bg)); border-color: color-mix(in srgb, var(--st-good) 55%, transparent); }
.fg-dot.low { background: color-mix(in srgb, var(--st-warn) 30%, var(--bg)); border-color: color-mix(in srgb, var(--st-warn) 70%, transparent); }
.fg-dot.missing { background: color-mix(in srgb, var(--st-crit) 10%, var(--bg)); border: 1.5px dashed color-mix(in srgb, var(--st-crit) 55%, transparent); color: var(--hint); }
.fg-gaps { background: var(--bg2); border-radius: 12px; padding: 10px 12px; font-size: 15px; display: flex; flex-direction: column; gap: 4px; }
.fg-gaps.ok { background: var(--ok-bg); }
