/* Новый визуальный язык (редизайн «Тихий коуч»): токены + экран «Сегодня».
   Тёмная тема — тот же body.dark, что переключает theme.js.
   Старые переменные (--ink, --card, --blue…) из base.css/theme.css
   переназначены на новые токены: экраны, которые ещё свёрстаны на них
   (чат, урок, практика, отзывы, прогресс), перекрашиваются без переписывания.
   Объявлено на body и body.dark — там же, где theme.css задаёт тёмные
   значения, иначе var() разрешится по светлым токенам :root. */
:root{--surface:#fff;--surface-2:#eef2f7;--ground:#f5f8fc;--text:#0f1d36;--text-muted:#5b6b82;--rule:#e1e7ef;--accent:#0a5ce6;--accent-soft:#e3eefd;--inverse:#0f1d36;--inverse-ink:#fff;--scene:#ffe9a8;--scene-ink:#0f1d36;--risk-text:#b5470a;--ok:#1f8a5b;--ok-soft:#e3f4ea;--bad:#c2410c;--bad-soft:#fdebe1;--mem-strong:#0a5ce6;--mem-weak:#b6d3f7;--mem-risk:#e8590c;--mem-new:#3fd6c8;--lift:0 1px 2px rgba(15,29,54,.06)}
body.dark{--surface:#172338;--surface-2:#1e2c44;--ground:#0f1829;--text:#e8eef9;--text-muted:#a3b2c9;--rule:#283a55;--accent:#3d9bff;--accent-soft:#16335a;--inverse:#e8eef9;--inverse-ink:#0f1829;--scene:#3a3214;--scene-ink:#fff1c2;--risk-text:#ffb070;--ok:#5fd19c;--ok-soft:#15362a;--bad:#ff9a76;--bad-soft:#3d2216;--mem-strong:#3d8bff;--mem-weak:#2c4a70;--mem-risk:#ff9f43;--mem-new:#2ccfc0;--lift:0 1px 2px rgba(0,0,0,.3)}
body,body.dark{--ink:var(--text);--muted:var(--text-muted);--paper:var(--ground);--card:var(--surface);--line:var(--rule);--blue:var(--accent);--purple:var(--accent);--lime:var(--scene);--orange:var(--mem-risk);--green:var(--ok);--red:var(--bad);--radius:22px;--shadow:var(--lift)}
body{font-family:'Golos Text',Manrope,sans-serif;font-size:15px;color:var(--text)}
h1,h2,h3,.section-title{font-family:'Golos Text',Manrope,sans-serif}

#home.screen.active{color:var(--text)}
.today{max-width:1180px;margin:0 auto;display:flex;flex-direction:column;gap:32px}
.today-date{font-size:14px;color:var(--text-muted);font-weight:500}
.coach-label{display:flex;align-items:center;gap:8px;font-size:12px;font-weight:600;color:var(--accent);letter-spacing:.4px;text-transform:uppercase}
.coach-label::before{content:'';width:8px;height:8px;border-radius:4px;background:var(--accent)}
.today-coach{display:flex;flex-direction:column;gap:14px;max-width:780px}
.today-message{margin:0;font-size:clamp(24px,2.8vw,36px);line-height:1.3;font-weight:500;letter-spacing:-.5px;color:var(--text)}
.today-cta{display:flex;gap:10px;flex-wrap:wrap;margin-top:6px}
.today-start{min-height:52px;padding:0 26px;border-radius:14px;background:var(--inverse);color:var(--inverse-ink);font-size:16px;font-weight:600;display:flex;align-items:center;gap:10px}
.today-start:disabled{opacity:.5;cursor:default}
#coachLessonExtra:empty{display:none}
#coachLessonExtra{display:flex;flex-direction:column;gap:10px}

.today-lower{display:flex;flex-wrap:wrap;gap:16px}
.today-memory,.today-attention{flex:1 1 340px;min-width:0;background:var(--surface);border-radius:22px;padding:20px;box-shadow:var(--lift);color:var(--text)}
.today-memory{display:flex;gap:20px;align-items:center}
.memory-map{flex:none;width:150px;display:grid;grid-template-columns:repeat(14,minmax(0,1fr));gap:2px;align-content:start}
.memory-map:empty{display:none}
.memory-map i{aspect-ratio:1;border-radius:2px;background:var(--mem-strong)}
.memory-map i.weak{background:var(--mem-weak)}.memory-map i.risk{background:var(--mem-risk)}.memory-map i.new{background:var(--mem-new)}
.today-memory-text{display:flex;flex-direction:column;gap:6px;align-items:flex-start}
.today-memory-text>b{font-size:18px;font-weight:600}
.today-memory-text>span{font-size:14px;color:var(--text-muted)}
.today-memory-text>span b{color:var(--text);font-weight:600}
.today-attention{display:flex;flex-direction:column;align-items:stretch}
.today-attention h2{margin:0 0 6px;font-size:16px;font-weight:600}
.today-attention .text-link{align-self:flex-start;margin-top:10px}
.attention-row{width:100%;display:flex;align-items:center;gap:12px;min-height:48px;padding:6px 0;border-bottom:1px solid var(--rule);background:none;color:var(--text);text-align:left}
.attention-row:last-of-type{border-bottom:0}
.attention-row:hover b{color:var(--accent)}
.attention-row b{flex:1 1 auto;font-size:15px;font-weight:600}
.attention-row span{flex:1 1 auto;font-size:14px;color:var(--text-muted)}
.attention-row .bar{flex:none;width:64px;height:6px;border-radius:3px;background:var(--surface-2);overflow:hidden}
.attention-row .bar i{display:block;height:100%;background:var(--mem-risk)}
.today-empty{font-size:14px;color:var(--text-muted);margin:6px 0 0}
.text-link{padding:0;background:none;border:0;color:var(--accent);font-size:14px;font-weight:600;display:inline-flex;align-items:center;gap:4px}
.text-link i{width:15px}

/* Темы (разметку рисует coach-home.js) */
#home .topics-section{margin:0}
#home .topics-head{display:flex;justify-content:space-between;align-items:baseline;margin-bottom:14px}
#home .topics-head .section-title{margin:0;font-size:20px;font-weight:600;letter-spacing:-.2px}
#home .topic-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:14px}
#home .topic-grid.archive{margin-top:14px}
#home .topic-card{display:flex;flex-direction:column;gap:8px;padding:20px;border:0;border-radius:22px;background:var(--surface);box-shadow:var(--lift);color:var(--text)}
#home .topic-card.archived{opacity:.7}
#home .topic-head{display:flex;justify-content:space-between;align-items:flex-start;gap:8px}
#home .topic-open{padding:0;background:none;color:var(--text);font-size:17px;font-weight:600;text-align:left;letter-spacing:-.2px}
#home .topic-open:hover{color:var(--accent)}
#home .topic-more{width:32px;height:32px;border-radius:10px;background:none;color:var(--text-muted);font-size:18px}
#home .topic-more:hover{background:var(--surface-2)}
#home .topic-meta{font-size:13px;color:var(--text-muted)}
#home .topic-bar{height:6px;border-radius:3px;background:var(--surface-2);overflow:hidden}
#home .topic-bar span{display:block;height:100%;border-radius:3px;background:var(--mem-strong)}
#home .topic-card .btn{min-height:44px;margin-top:auto;border:1px solid var(--rule);border-radius:12px;background:var(--surface);color:var(--text);font-weight:600;box-shadow:none}
#home .topic-card .btn:hover{border-color:var(--text-muted)}
#home .topic-card .btn-primary,#home .topic-card .topic-danger{background:var(--inverse);border-color:var(--inverse);color:var(--inverse-ink)}
#home .topic-card .topic-danger{background:var(--bad);border-color:var(--bad)}
#home .topic-card-new{border:1.5px dashed var(--rule);background:transparent;box-shadow:none;justify-content:center}
#home .topic-card-new .topic-new{border:0;background:var(--surface-2)}
#home .topic-form label{display:flex;flex-direction:column;gap:6px;font-size:13px;color:var(--text-muted)}
#home .topic-form input,#home .topic-rename{height:44px;padding:0 12px;border:1px solid var(--rule);border-radius:12px;background:var(--surface);color:var(--text);font-size:15px}
#home .topic-suggest{display:flex;flex-wrap:wrap;gap:6px}
#home .topic-suggest .chip{min-height:32px;padding:0 12px;border-radius:16px;background:var(--accent-soft);color:var(--text);font-size:13px;font-weight:500}
#home .coach-row{display:flex;gap:8px;flex-wrap:wrap}
#home .coach-row .btn{flex:1 1 auto;margin:0}
.coach-error{margin:0;font-size:14px;color:var(--risk-text)}
#home .coach-conflict{display:flex;flex-direction:column;gap:8px;padding:14px;border-radius:14px;background:var(--scene);color:var(--scene-ink)}
#home .coach-conflict p{margin:0;font-size:14px;font-weight:500}
#home .coach-ghost{background:var(--surface);color:var(--text);border:1px solid var(--rule)}

@media(max-width:800px){
  .today{gap:24px}
  .today-start{flex:1;justify-content:center}
  .today-memory{gap:14px}
  .memory-map{width:84px;grid-template-columns:repeat(8,minmax(0,1fr))}
}

/* Главная — беседа с Лингариком: чат слева, остальное справа; на телефоне чат первым */
.home-grid{display:grid;grid-template-columns:minmax(0,1.6fr) minmax(280px,1fr);gap:20px;align-items:start}
.home-chat{display:flex;flex-direction:column;gap:8px;min-width:0;height:calc(100dvh - 190px);min-height:480px;max-height:780px;padding:14px 16px 16px;background:var(--surface);border-radius:24px;box-shadow:var(--lift);color:var(--text)}
.home-chat-head{display:flex;align-items:center;justify-content:space-between;gap:10px}
.home-chat-host{flex:1;min-height:0;display:flex;flex-direction:column}
.home-chat .chat-view{flex:1;min-height:0}
.home-chat .messages{display:flex;flex-direction:column;gap:10px;overflow:auto}
.home-chat .message{max-width:92%}
.home-chat .message.user{align-self:flex-end}
.home-side{display:flex;flex-direction:column;gap:16px;min-width:0}
.home-side .today-coach{max-width:none}
.home-side .today-lower{flex-direction:column}
.home-side .today-memory,.home-side .today-attention{flex:0 0 auto}
#home .home-side .topic-grid{grid-template-columns:minmax(0,1fr)}
/* хром вида по варианту: подсказки главной только на главной, общие — везде, кроме неё */
#chatView:is([data-variant="home"],[data-variant="sheet"]) .quick-actions:not([data-for="home"]){display:none}
#chatView:not([data-variant="home"],[data-variant="sheet"]) .quick-actions[data-for="home"]{display:none}
@media(max-width:800px){
  .home-grid{grid-template-columns:minmax(0,1fr)}
  .home-chat{height:calc(100dvh - 250px);min-height:420px;padding:12px}
}
