:root {
  --bg: #f3efe6;
  --card: #fffdf8;
  --ink: #23201b;
  --muted: #7b7468;
  --line: #e7e0d2;
  --accent: #2f7d5b;
  --accent-soft: #e2f1e9;
  --red: #c2412d;
  --red-soft: #fbe7e2;
  --amber: #c98a12;
  --amber-soft: #fbf0d9;
  --blue: #2d6cdf;
  --blue-soft: #e5eefc;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(40, 30, 10, .06), 0 4px 16px rgba(40, 30, 10, .05);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .5; }
input { font: inherit; }
small { color: var(--muted); font-size: 12.5px; }
h1, h2 { margin: 0; }
h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; margin-bottom: 12px; display: flex; align-items: center; gap: 6px; }
h2 small { text-transform: none; letter-spacing: 0; font-weight: 400; }

/* ---------- Кнопки ---------- */
.btn {
  border: 1px solid var(--line); background: #fff; border-radius: 10px;
  padding: 8px 12px; font-weight: 600; transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover:not(:disabled) { border-color: #cfc5b0; background: #faf7f0; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover:not(:disabled) { background: #276a4d; border-color: #276a4d; }
.btn-danger { background: var(--red-soft); border-color: #f0c3b9; color: var(--red); }
.btn-on { background: var(--accent-soft); border-color: #b9dcc9; color: var(--accent); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-big { width: 100%; padding: 14px; font-size: 17px; border-radius: 12px; margin-top: 4px; }
.mini { border: 1px solid var(--line); background: #fff; border-radius: 6px; font-size: 11.5px; padding: 1px 6px; margin-left: 6px; color: var(--muted); }
.mini:hover { color: var(--ink); }
.mini:disabled { opacity: .45; cursor: not-allowed; }
.q {
  width: 17px; height: 17px; border-radius: 50%; border: 1px solid var(--line); background: #fff;
  font-size: 11px; line-height: 15px; padding: 0; color: var(--muted); font-weight: 700; text-transform: none;
  flex: none; display: inline-flex; align-items: center; justify-content: center; vertical-align: middle;
}
.q:hover { color: var(--accent); border-color: var(--accent); }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 4px 10px; font-size: 13px; }
.chip:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Старт ---------- */
.start { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.start-card { max-width: 820px; width: 100%; min-width: 0; background: var(--card); border-radius: 20px; box-shadow: var(--shadow); padding: 36px; }
.start-badge { display: inline-block; background: var(--accent-soft); color: var(--accent); font-weight: 700; padding: 4px 12px; border-radius: 999px; font-size: 13px; }
.start h1 { font-size: 44px; margin: 12px 0 6px; letter-spacing: -.02em; }
.lead { font-size: 17px; color: #4a453c; margin: 0 0 18px; }
.rules { padding-left: 20px; margin: 0 0 24px; }
.rules li { margin-bottom: 8px; }
.start-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.start-actions .btn { padding: 12px 18px; font-size: 16px; }
.hint { color: var(--muted); font-size: 13px; margin: 18px 0 0; }
.start .start-actions + .pick-h { margin-top: 24px; }
.pick-h { margin: 20px 0 8px; }
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-bottom: 4px; }
.pick-grid + .start-actions { margin-top: 22px; }
.pick {
  text-align: left; border: 1.5px solid var(--line); background: #fff; border-radius: 10px; padding: 10px 11px;
  display: flex; flex-direction: column; gap: 3px; min-width: 0; overflow-wrap: anywhere;
}
.pick b { font-size: 14.5px; line-height: 1.25; }
.pick small { font-size: 12px; line-height: 1.3; }
.pick ul { margin: 2px 0 0; padding-left: 14px; font-size: 12.5px; line-height: 1.3; }
.pick li { margin-bottom: 2px; }
.pick:hover:not(:disabled) { border-color: #cfc5b0; }
.pick.active { border-color: var(--accent); background: var(--accent-soft); }
.pick .risk { font-size: 12px; color: var(--muted); margin-top: auto; padding-top: 2px; }
.pick .risk i { font-style: normal; color: var(--red); letter-spacing: 1px; }
.pick-age { font-size: 13px; font-weight: 600; color: var(--accent); }
.pick-lesson { margin-top: auto; padding-top: 2px; font-style: italic; }
.soon { font-size: 11px; font-weight: 600; background: var(--line); color: var(--muted); border-radius: 99px; padding: 1px 7px; vertical-align: middle; white-space: nowrap; }

/* ---------- Шапка ---------- */
.top {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 18px;
  padding: 6px 20px; background: rgba(243, 239, 230, .92); backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}
.top .btn { padding: 5px 10px; }
.brand { font-weight: 800; letter-spacing: -.01em; font-size: 18px; }
.age { font-size: 15px; white-space: nowrap; }
.age b { font-size: 22px; }
.age span { color: var(--muted); }
.progress { flex: 1; height: 6px; background: var(--line); border-radius: 99px; overflow: hidden; min-width: 60px; }
.progress div { height: 100%; background: var(--accent); border-radius: 99px; transition: width .4s; }
.top-actions { display: flex; gap: 4px; }

/* ---------- Сетка: экран-пульт, весь ход без прокрутки на 1280×640 ---------- */
.grid {
  display: grid; gap: 10px 14px; padding: 8px 20px 8px; max-width: 1280px; margin: 0 auto;
  grid-template-columns: minmax(260px, 290px) minmax(0, 1fr) minmax(260px, 290px);
  align-items: start; font-size: 14px; line-height: 1.35;
}
.grid section { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; }
.grid .card { padding: 9px 13px; }
.grid h2 { font-size: 11px; letter-spacing: .08em; margin-bottom: 5px; }
.h-right { margin-left: auto; text-transform: none; letter-spacing: 0; font-weight: 400; font-size: 12px; display: inline-flex; align-items: center; gap: 4px; }
.h-right b { color: var(--ink); font-size: 13px; }
.link { margin-left: auto; border: 0; background: none; padding: 0; color: var(--accent); font-size: 12px; font-weight: 600; text-transform: none; letter-spacing: 0; }
.link:hover { text-decoration: underline; }
.grid .row { padding: 3px 0; }
.grid .rows { margin-top: 4px; }

.big { font-size: 30px; font-weight: 800; letter-spacing: -.02em; }
.big.neg { color: var(--red); }
.sub { color: var(--muted); font-size: 13px; margin-top: 6px; }
.sub b { color: var(--ink); }

.rows { margin-top: 10px; }
.row { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.row:last-child { border-bottom: 0; }
.row-label { flex: 1; display: flex; align-items: center; gap: 6px; min-width: 0; flex-wrap: wrap; }
.row-value { font-weight: 650; white-space: nowrap; font-variant-numeric: tabular-nums; }
.row-value small { font-weight: 400; margin-left: 4px; }
.row.debt .row-value { color: var(--red); }
.row.danger { background: var(--red-soft); margin: 0 -8px; padding: 6px 8px; border-radius: 8px; }
.row.inc .row-value { color: var(--accent); }
.row.exp .row-value { color: #8a5a4a; }

.total { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; padding: 10px 12px; border-radius: 10px; font-weight: 600; }
.total b { font-size: 19px; }
.total.pos { background: var(--accent-soft); color: var(--accent); }
.total.neg { background: var(--red-soft); color: var(--red); }

/* ---------- Счастье ---------- */
.happy-label { display: flex; justify-content: space-between; margin-bottom: 6px; }
.happy-label b { font-size: 18px; }
.bar { height: 10px; background: var(--line); border-radius: 99px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 99px; transition: width .4s; }
.bar-fill.good { background: var(--accent); }
.bar-fill.mid { background: var(--amber); }
.bar-fill.bad { background: var(--red); }

/* ---------- Бюджет и уровень жизни (ряд из 4 кнопок) ---------- */
.budget .total { margin-top: 6px; padding: 6px 10px; }
.budget .total b { font-size: 17px; }
.budget .total small { color: inherit; font-weight: 400; opacity: .8; }
.ls-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-top: 8px; }
.ls-row .ls { padding: 5px 6px; align-items: center; text-align: center; }
.ls-row .ls b { font-size: 13px; }
.ls-row .ls span { font-size: 12px; font-weight: 500; color: var(--muted); }
.ls-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ls { text-align: left; border: 1.5px solid var(--line); background: #fff; border-radius: 10px; padding: 9px 11px; display: flex; flex-direction: column; gap: 1px; }
.ls span { font-weight: 600; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.ls small { font-size: 12px; line-height: 1.3; }
.ls:hover { border-color: #cfc5b0; }
.ls.active { border-color: var(--accent); background: var(--accent-soft); }
.fam-h { font-size: 12.5px; color: var(--muted); margin: 10px 0 5px; }
.fam-toggle { display: flex; gap: 6px; flex-wrap: wrap; }
.fam-toggle .ls { flex: 1 1 0; min-width: 0; padding: 7px 8px; align-items: center; text-align: center; }
.fam-toggle .ls b { font-size: 13px; white-space: nowrap; }
.fam-more { width: 100%; margin-top: 10px; }

/* ---------- Экран «Домохозяйство» ---------- */
.hh-h { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin: 14px 0 0; font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.hh-h b { color: var(--ink); font-size: 15px; text-transform: none; letter-spacing: 0; white-space: nowrap; font-variant-numeric: tabular-nums; }
.hh .rows { margin-top: 4px; }
.hh .row-label { overflow-wrap: anywhere; }
.hh-share { display: inline-block; min-width: 3em; text-align: right; color: var(--muted); }
.row.hh-sub { padding: 3px 0 3px 18px; font-size: 13px; color: var(--muted); border-bottom: 0; }
.row.hh-sub .row-value { font-weight: 500; }
.hh .total { margin-top: 14px; }
.hh .total small { font-weight: 400; }
.hh + .btn-big { margin-top: 16px; }

/* ---------- Карточка «Капитал и портфель» ---------- */
.cap { cursor: pointer; transition: box-shadow .15s; }
.cap:hover { box-shadow: 0 0 0 2px var(--accent-soft), var(--shadow); }
.cap .big { font-size: 26px; line-height: 1.2; }
.cap .sub { margin-top: 2px; font-size: 12.5px; }
.cap-gains b { white-space: nowrap; }
.cap-bar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; margin: 8px 0 6px; background: var(--line); }
.cap-bar i { display: block; height: 100%; }
.cap-hand { background: #c9c2b3; }
.cap-protect { background: #7fb69a; }
.cap-growth, .cap-work { background: var(--accent); }
.cap-debt { background: var(--red); }
.cap-legend { display: grid; grid-template-columns: 1fr auto; gap: 1px 8px; font-size: 13px; }
.cap-legend b { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
/* «Работает · из них заморожено X» (add-isolation-regime): та же строка, при нехватке места — многоточие, высота не растёт */
.cap-work-l { display: flex; align-items: center; min-width: 0; white-space: nowrap; }
.cap-frozen { margin-left: 4px; min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: 11.5px; color: #8a5e0b; }
.cap-work-l .q, .cap-work-l .dot { flex: none; }
.cap-work-l .q { margin-left: 3px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.cap-yield { margin-top: 6px; padding: 5px 8px; border-radius: 8px; font-size: 12px; line-height: 1.35; }
.cap-yield.ok { background: var(--accent-soft); color: var(--accent); }
.cap-yield.warn { background: var(--amber-soft); color: #8a5e0b; }
.cap-actions { display: flex; gap: 6px; margin-top: 8px; }
.cap-actions .btn { padding: 6px 10px; }
.cap-actions .btn-primary { flex: 1; }

/* ---------- Окно «Портфель» ---------- */
.pf-sticky { position: sticky; top: -26px; z-index: 2; background: var(--card); margin: -26px -26px 8px; padding: 18px 26px 10px; border-bottom: 1px solid var(--line); }
.pf-title-row { display: flex; align-items: center; justify-content: space-between; }
.pf-title-row h2 { margin-bottom: 6px; }
.x { border: 0; background: none; font-size: 24px; line-height: 1; color: var(--muted); padding: 0 4px; }
.pf-field { display: flex; flex-direction: column; gap: 6px; }
.pf-field .chips { margin-top: 0; }
.pf-back { margin-bottom: 8px; }
.deal-h { margin: 4px 0 4px; font-size: 17px; display: flex; align-items: center; gap: 6px; }
.pf-repeat { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.pf-repeat .sub { margin-top: 0; }
.pf-rep { padding: 6px 10px; font-size: 13.5px; }
.pf-gain { white-space: nowrap; font-variant-numeric: tabular-nums; }
.pf-groups { margin: 10px 0 12px; display: flex; flex-direction: column; gap: 6px; }
.pf-group { border: 1px solid var(--line); border-radius: 10px; padding: 0 10px; }
.pf-ghead {
  width: 100%; display: flex; align-items: center; gap: 8px; padding: 7px 0;
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted);
}
.pf-ghead span { flex: 1; min-width: 0; }
.pf-ghead b { color: var(--ink); font-size: 14px; text-transform: none; letter-spacing: 0; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pf-ghead b.neg { color: var(--red); }
.pf-rows { border-top: 1px dashed var(--line); }
.pf-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; align-items: center; gap: 4px 10px;
  padding: 7px 0; border-bottom: 1px dashed var(--line);
}
.pf-row:last-child { border-bottom: 0; }
.pf-name { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; min-width: 0; overflow-wrap: anywhere; }
.pf-val { font-weight: 650; white-space: nowrap; font-variant-numeric: tabular-nums; text-align: right; }
.pf-row.debt .pf-val { color: var(--red); }
.pf-gain { font-size: 13px; text-align: right; }
.pf-acts { display: flex; gap: 4px; justify-content: flex-end; }
.pf-acts .mini { margin-left: 0; padding: 3px 8px; font-size: 12.5px; }
.pf-empty { grid-template-columns: 1fr; color: var(--muted); font-size: 13.5px; }
/* Окно сделки (срочный вклад, облигации): сроки, итог, вклады и выпуски с кнопками */
.deal-terms .ls { flex: 1 1 110px; }
.deal-terms .ls b, .deal-renew .ls b { white-space: normal; }
.deal-preview { margin: 8px 0 12px; color: var(--ink); }
.deal-lots { margin-bottom: 14px; }
.deal-lot { grid-template-columns: minmax(0, 1fr); }
/* подшаг «Акции компаний»: строка компании в две линии — название и отрасль; рост, дивиденды, сигнал */
.share-rows { margin: 6px 0 12px; border-top: 1px dashed var(--line); }
.share-row { padding: 5px 0; }
.share-name { gap: 2px 6px; }
.share-line { flex-basis: 100%; font-size: 12.5px; color: var(--muted); display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; }
.share-sig { color: var(--amber); font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.share-row .pf-val { min-width: 74px; }
.deal-lot .pf-acts { justify-content: flex-start; flex-wrap: wrap; }

/* ---------- Поле суммы ---------- */
.field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
input { border: 1.5px solid var(--line); border-radius: 10px; padding: 9px 11px; font-size: 16px; background: #fff; color: var(--ink); width: 100%; min-width: 0; font-variant-numeric: tabular-nums; }
input:focus { outline: none; border-color: var(--accent); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }

/* ---------- Крупные решения: плитки и окна ---------- */
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.tile { border: 1.5px solid var(--line); background: #fff; border-radius: 11px; padding: 7px 10px; text-align: left; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.tile:hover:not(:disabled) { border-color: var(--accent); }
.tile b { font-size: 13.5px; }
.tile span { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.tile.done { background: var(--accent-soft); border-color: var(--accent); }
.tile.done span { color: var(--accent); }
.tile:disabled { opacity: .5; }
.inline { display: flex; gap: 6px; align-items: center; }
.dec-field { margin: 4px 0 8px; }
.dec-preview { color: var(--blue); font-size: 14px; min-height: 20px; margin-bottom: 14px; }
.dec-preview.warn { color: var(--red); }
.dec-actions { display: flex; gap: 8px; }
.dec-actions .btn { padding: 11px 16px; }
.dec-actions .btn-primary { flex: 1; }
.wrap { white-space: normal; text-align: right; display: inline-block; }

/* ---------- Экономика ---------- */
.grid .eco { gap: 6px; }
.grid .eco > div { padding: 4px 8px; }
.grid .eco b { font-size: 14px; }
.grid .regime { padding: 4px 8px; margin-bottom: 6px; }
.grid .regime b { font-size: 13.5px; }
.grid .adv { padding: 6px 9px; font-size: 12.5px; line-height: 1.35; margin-bottom: 0; }
.grid .journal li { padding: 3px 0; font-size: 12.5px; }
.journal em { font-style: normal; }
/* на экране — запись в одну строку (полный текст в подсказке и в окне «весь →») */
.grid .journal em, .grid .journal .log-link { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 1; display: block; }
.grid .eco span { white-space: nowrap; font-size: 11.5px; }
.chart-card h2 { margin-bottom: 2px; }
.chart-card .legend { margin-top: 0; gap: 8px; font-size: 11px; letter-spacing: 0; text-transform: none; }
.grid .journal li:last-child { border-bottom: 0; }
.fam .row-value { white-space: normal; text-align: right; }
.grid .bar { height: 6px; margin-bottom: 2px; }
.eco { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 4px; }
.eco > div { background: #f8f5ee; border-radius: 10px; padding: 8px 10px; display: flex; flex-direction: column; }
.eco span { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 4px; }
.eco b { font-size: 16px; font-variant-numeric: tabular-nums; }
.pos { color: var(--accent); }
.neg { color: var(--red); }
.tag { font-size: 11px; padding: 2px 8px; border-radius: 99px; letter-spacing: .02em; }
.tag.bad { background: var(--red-soft); color: var(--red); }
.regime { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; border-radius: 10px; padding: 8px 10px; margin-bottom: 8px; border-left: 4px solid var(--muted); background: #f8f5ee; }
.regime span { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 4px; }
.regime b { font-size: 15px; }
.regime.good { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.regime.neutral { background: var(--amber-soft); border-color: var(--amber); color: #8a5e0b; }
.regime.bad { background: var(--red-soft); border-color: var(--red); color: var(--red); }
.regime.fx small { font-size: 12px; font-weight: 600; margin-left: 4px; }

/* ---------- Советник / журнал ---------- */
.advice, .journal, .notes, .lessons { list-style: none; padding: 0; margin: 0; }
.adv { padding: 9px 11px; border-radius: 10px; margin-bottom: 8px; font-size: 14px; border-left: 4px solid; }
.adv:last-child { margin-bottom: 0; }
.adv.bad { background: var(--red-soft); border-color: var(--red); }
.adv.warn { background: var(--amber-soft); border-color: var(--amber); }
.adv.info { background: var(--blue-soft); border-color: var(--blue); }
.adv.good { background: var(--accent-soft); border-color: var(--accent); }
.journal li { font-size: 13px; padding: 5px 0; border-bottom: 1px dashed var(--line); display: flex; gap: 8px; }
.journal li span { color: var(--muted); font-variant-numeric: tabular-nums; min-width: 20px; }
.log.bad { color: var(--red); }
.log.good { color: var(--accent); }
.log.warn { color: #8a6210; }

canvas { width: 100%; display: block; }
#chart { height: 90px; }
.chart-card .legend { margin-top: 2px; }
.final #chart { height: 240px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 6px; }
.lg::before { content: ''; display: inline-block; width: 14px; height: 3px; border-radius: 2px; margin-right: 5px; vertical-align: middle; }
.lg.nw::before { background: var(--accent); }
.lg.debt::before { background: var(--red); }
.lg.twin::before { background: repeating-linear-gradient(90deg, var(--blue) 0 4px, transparent 4px 7px); }

/* ---------- Модалка ---------- */
.modal { position: fixed; inset: 0; background: rgba(35, 28, 15, .45); display: grid; place-items: center; padding: 16px; z-index: 20; animation: fade .15s; }
.modal.hidden { display: none; }
.modal-card { background: var(--card); border-radius: 18px; max-width: 520px; width: 100%; max-height: calc(100vh - 32px); overflow: auto; padding: 26px; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); animation: pop .2s; }
.modal-card.wide { max-width: 720px; }
.modal-card h2 { font-size: 22px; text-transform: none; letter-spacing: -.01em; color: var(--ink); margin-bottom: 10px; }
.modal-card p { margin: 0 0 16px; font-size: 15.5px; }
.ev-icon { font-size: 40px; line-height: 1; margin-bottom: 8px; }
.ev-age { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; margin-bottom: 4px; }
.choices { display: flex; flex-direction: column; gap: 8px; }
.choice { text-align: left; border: 1.5px solid var(--line); background: #fff; border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.choice:hover:not(:disabled) { border-color: var(--accent); background: var(--accent-soft); }
.lesson { background: var(--blue-soft); border-radius: 12px; padding: 14px 16px; margin-bottom: 16px; font-size: 14.5px; }
.lesson-h { font-weight: 700; color: var(--blue); margin-bottom: 4px; }
.report .rows { margin-top: 0; margin-bottom: 12px; }
.notes { margin-top: 12px; }
.notes li { background: #f8f5ee; border-radius: 8px; padding: 8px 10px; margin-bottom: 6px; font-size: 14px; }
.glossary { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.gl { background: #f8f5ee; border-radius: 10px; padding: 10px 12px; }
.gl p { margin: 4px 0 0 !important; font-size: 13.5px !important; }
.gl.hl { background: var(--accent-soft); outline: 2px solid var(--accent); }

/* ---------- Финал ---------- */
.final { max-width: 900px; margin: 0 auto; padding: 24px 16px 60px; display: flex; flex-direction: column; gap: 16px; }
.final-head { text-align: center; padding: 30px 20px; }
.final-icon { font-size: 56px; }
.final-head h1 { font-size: 34px; margin: 4px 0 8px; letter-spacing: -.02em; }
.final-head p { margin: 0; color: #4a453c; font-size: 16px; }
.final-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.stat { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
.stat span { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
.stat b { font-size: 24px; letter-spacing: -.01em; }
.lessons li { padding: 10px 0 10px 28px; border-bottom: 1px dashed var(--line); position: relative; }
.lessons li::before { content: '💡'; position: absolute; left: 0; top: 10px; }
.lessons li:last-child { border-bottom: 0; }
.final-actions { display: flex; gap: 10px; }
.final-actions .btn-big { flex: 1; margin: 0; }
.final-actions .btn:not(.btn-big) { padding: 0 22px; }

/* ---------- Лента года ---------- */
/* лента — карточка в средней колонке на месте «Крупных решений» */
.lane { display: flex; flex-direction: column; gap: 8px; box-shadow: 0 0 0 2px var(--accent-soft), var(--shadow); }
.lane-bar { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 3px; }
.lane-m { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 5px 0 4px; border-radius: 8px; background: #f8f5ee; min-width: 0; transition: background .2s; }
.lane-m span { font-size: 11px; color: var(--muted); font-weight: 600; }
.lane-m i { font-style: normal; font-size: 14px; line-height: 16px; min-height: 16px; max-width: 100%; overflow: hidden; text-overflow: clip; white-space: nowrap; text-align: center; }
.lane-m.past { background: var(--accent-soft); }
.lane-m.now { background: var(--accent); }
.lane-m.now span { color: #fff; }
.lane-ctrl { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lane-ctrl .btn { min-height: 36px; }
.lane-month { margin-left: auto; font-weight: 700; }
.lane-cards { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.lane-h { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; flex-basis: 100%; }
.lane-card { display: flex; align-items: center; gap: 8px; text-align: left; border: 1.5px solid var(--amber); background: #fff; border-radius: 10px; padding: 6px 10px; max-width: 100%; }
.lane-card b { display: block; font-size: 13.5px; }
.lane-card small { display: block; color: var(--amber); font-size: 12px; }
.lane-ic { font-size: 20px; }
.grid.is-live [inert] { opacity: .55; }
.cap button:disabled { opacity: .5; }
.live-note { text-align: center; padding: 6px; margin-top: 0; }
.ev-due { color: var(--amber); font-weight: 700; font-size: 14px; margin-bottom: 8px; }
.ev-timer { color: var(--red); font-weight: 700; font-size: 15px; margin-bottom: 8px; }
.log-link { all: unset; cursor: pointer; text-decoration: underline dotted; }
.toast.notice { background: var(--card); color: var(--ink); font-weight: 400; text-align: left; display: flex; gap: 10px; align-items: flex-start; cursor: pointer; max-width: min(460px, calc(100vw - 32px)); border: 1.5px solid var(--line); }
.notice-ic { font-size: 22px; line-height: 1; }
/* крупное уведомление и «Что случилось» в итогах года */
.big-money { font-size: 26px; font-weight: 800; margin: 4px 0 2px; }
.big-paid { color: var(--muted); font-size: 14px; margin-bottom: 8px; }
.recap { margin-top: 12px; }
.recap-list { list-style: none; padding: 0; margin: 6px 0 0; }
.recap-list li { display: flex; gap: 8px; align-items: baseline; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.recap-list li:last-child { border-bottom: 0; }
.recap-m { flex: 0 0 auto; min-width: 34px; color: var(--muted); font-size: 12px; }
.recap-ic { flex: 0 0 auto; }
.recap-t { flex: 1 1 auto; min-width: 0; }
.recap-t small { display: block; color: var(--muted); font-size: 12px; }
.recap-v { flex: 0 0 auto; font-weight: 700; white-space: nowrap; }

/* ---------- Тост: стопка до трёх, у каждого свой таймер (новые снизу) ---------- */
.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 30; display: flex; flex-direction: column; align-items: center; gap: 8px; width: max-content; max-width: calc(100vw - 32px); pointer-events: none; }
.toast { pointer-events: auto; padding: 10px 18px; border-radius: 12px; color: #fff; font-weight: 600; z-index: 30; box-shadow: 0 8px 24px rgba(0, 0, 0, .2); max-width: calc(100vw - 32px); text-align: center; animation: pop .2s; }
.toast.ok { background: var(--accent); }
.toast.fail { background: var(--red); }

@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.toast { animation: none; }

/* ---------- Адаптив ---------- */
@media (max-width: 1100px) {
  .grid { grid-template-columns: minmax(260px, 290px) minmax(0, 1fr); }
  .col-right { grid-column: 1 / -1; display: grid !important; grid-template-columns: 1fr 1fr; align-items: start; }
}
@media (max-width: 760px) {
  /* одна колонка: «Капитал и портфель» → бюджет → решения или лента → «Прожить год →» → остальное */
  .grid { grid-template-columns: minmax(0, 1fr); padding: 10px 10px 40px; gap: 10px; }
  .grid section { display: contents !important; }
  .grid section > * { order: 5; min-width: 0; }
  .grid .o-1 { order: 1; } .grid .o-2 { order: 2; } .grid .o-3 { order: 3; } .grid .o-4 { order: 4; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ls-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .modal { padding: 0; }
  .modal-card { max-height: 100vh; border-radius: 0; }
  .pf-sticky { top: -20px; margin: -20px -20px 8px; padding: 14px 20px 10px; }
  .lane-bar { gap: 2px; }
  .lane-m span { font-size: 10px; }
  .lane-m i { font-size: 12px; }
  [data-act="liveYear"] { position: sticky; bottom: 10px; z-index: 4; box-shadow: 0 6px 20px rgba(47, 125, 91, .35); }
  .top { gap: 10px; padding: 8px 12px; flex-wrap: wrap; }
  .brand { display: none; }
  .progress { order: 3; flex-basis: 100%; }
  .top-actions { margin-left: auto; }
  .final-stats { grid-template-columns: 1fr 1fr; }
  .glossary { grid-template-columns: 1fr; }
  .start-card { padding: 24px; }
  .start h1 { font-size: 36px; }
  .modal-card { padding: 20px; }
  /* строка позиции: название и сумма сверху, прибыль и кнопки — строкой ниже во всю ширину */
  .pf-row { grid-template-columns: minmax(0, 1fr) auto; }
  .pf-gain { grid-column: 2; }
  .pf-acts { grid-column: 1 / -1; justify-content: flex-start; }
  .pf-acts .mini { flex: 1 1 0; min-width: 0; padding: 6px 8px; font-size: 13px; }
}
@media (max-width: 400px) {
  .start { padding: 8px; }
  .start-card { padding: 16px 14px; border-radius: 16px; }
  .ls-grid { grid-template-columns: 1fr; }
  .final-stats { grid-template-columns: 1fr; }
}
