/* Grindale Mini App.
   Дизайн-система снята с референса @proninhere_bot по прямому указанию Тимура:
   те же токены цвета, та же шкала типографики, те же радиусы и отступы, те же
   компоненты и сценарии. Своё здесь только содержимое: тексты, материалы,
   обложки и иллюстрации Grindale. Чужие тексты, картинки и логотипы не переносятся.

   Шрифты: Inter и Source Code Pro (открытые лицензии) вместо проприетарного
   Google Sans референса; пропорции и ощущение те же, прав никто не нарушает. */

@font-face {
  font-family: 'AppSans'; src: url('/fonts/inter-cyrillic.woff2') format('woff2');
  font-weight: 400 700; font-style: normal; font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'AppSans'; src: url('/fonts/inter-latin.woff2') format('woff2');
  font-weight: 400 700; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F, U+2122, U+2191, U+2193, U+2212, U+2215;
}
@font-face {
  font-family: 'AppMono'; src: url('/fonts/mono-cyrillic.woff2') format('woff2');
  font-weight: 400 600; font-style: normal; font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'AppMono'; src: url('/fonts/mono-latin.woff2') format('woff2');
  font-weight: 400 600; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F, U+2122, U+2191, U+2193, U+2212, U+2215;
}

:root {
  --bg-primary: #fff;
  --bg-muted: #f4f4f4;
  --grey-light: #f5f4f2;
  --grey-ui: #807e7d;
  --text-primary: #1d1d1f;
  --text-secondary: #434242bd;
  --text-tertiary: #4342424d;
  --action-primary: #000;
  --action-primary-fg: #fff;
  --fill-primary: #43424214;
  --fill-tertiary: #43424224;
  --separator: #b8b8b8;
  --icon-secondary: #807e7d;
  --chip-muted-bg: #f7f7f7;
  --chip-muted-fg: #525252;
  --sheet-backdrop: #00000061;

  --accent-blue: #08f;
  --accent-orange: #ff8d28;
  --accent-cyan: #00c3d0;
  --accent-teal: #008575;
  --accent-green: #34c759;
  --accent-red: #ff3b30;
  --accent-indigo: #5856d6;
  --accent-purple: #af52de;
  --accent-pink: #ff2d55;
  --accent-brown: #a2845e;

  --r-micro: 8px; --r-tile: 12px; --r-button: 14px; --r-card: 20px;
  --r-panel: 24px; --r-hero: 36px; --r-sheet: 28px; --r-capsule: 400px;

  --side: 16px; --sheet-side: 24px; --section: 24px;

  --top: env(safe-area-inset-top, 0px);
  --bottom: env(safe-area-inset-bottom, 0px);
  --tabs-h: 56px;
  --bar-h: 44px;
  --ease: cubic-bezier(.2,.7,.3,1);
  --t: 200ms;
}

@media (prefers-reduced-motion: reduce) {
  :root { --t: 1ms; }
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

html, body {
  margin: 0; padding: 0; background: var(--bg-primary); color: var(--text-primary);
  font-family: 'AppSans', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
  -webkit-font-smoothing: antialiased; overscroll-behavior-y: none;
}
body { min-height: 100dvh; }
h1, h2, h3, h4 { margin: 0; }
p { margin: 0; }
a { color: var(--accent-blue); text-decoration: none; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; padding: 0; }
input, textarea { font: inherit; color: inherit; }

/* ---------- шкала типографики референса ---------- */

.t-display-l  { font-size: 40px; line-height: 44px; font-weight: 700; letter-spacing: -.8px; }
.t-display-m  { font-size: 32px; line-height: 36px; font-weight: 600; letter-spacing: -.64px; }
.t-headline-l { font-size: 24px; line-height: 28px; font-weight: 600; letter-spacing: -.48px; }
.t-headline-m { font-size: 22px; line-height: 26px; font-weight: 600; letter-spacing: -.44px; }
.t-headline-s { font-size: 20px; line-height: 24px; font-weight: 600; letter-spacing: -.4px; }
.t-title-l    { font-size: 18px; line-height: 22px; font-weight: 500; letter-spacing: -.36px; }
.t-title-m    { font-size: 17px; line-height: 20px; font-weight: 500; letter-spacing: -.34px; }
.t-title-s    { font-size: 16px; line-height: 20px; font-weight: 500; letter-spacing: -.32px; }
.t-body-l     { font-size: 17px; line-height: 24px; font-weight: 500; letter-spacing: -.34px; }
.t-body-m     { font-size: 16px; line-height: 20px; font-weight: 500; letter-spacing: -.32px; }
.t-body-s     { font-size: 15px; line-height: 20px; font-weight: 500; letter-spacing: -.3px; }
.t-label-l    { font-size: 14px; line-height: 18px; font-weight: 500; letter-spacing: -.28px; }
.t-label-s    { font-size: 12px; line-height: 16px; font-weight: 500; letter-spacing: -.24px; }
.t-caption-l  { font-size: 11px; line-height: 13px; font-weight: 500; letter-spacing: -.22px; }

.c-secondary { color: var(--text-secondary); }
.c-tertiary  { color: var(--text-tertiary); }

/* ---------- каркас ---------- */

.boot { position: fixed; inset: 0; z-index: 60; display: grid; place-content: center;
  gap: 14px; justify-items: center; background: var(--bg-primary); }
.boot.gone { opacity: 0; pointer-events: none; transition: opacity 240ms var(--ease); }
.boot-mark { width: 30px; height: 30px; border-radius: var(--r-micro); background: var(--action-primary);
  animation: pulse 1.3s var(--ease) infinite; }
@keyframes pulse { 0%,100% { transform: scale(1); opacity: 1 } 50% { transform: scale(.82); opacity: .45 } }
.boot-text { color: var(--text-secondary); font-size: 14px; font-weight: 500; letter-spacing: -.28px; }

.bar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 4px;
  height: calc(var(--bar-h) + var(--top)); padding: var(--top) 8px 0 4px;
  background: color-mix(in srgb, var(--bg-primary) 88%, transparent);
  backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); }
.bar-back { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  color: var(--action-primary); flex: 0 0 auto; transition: background var(--t) var(--ease); }
.bar-back:active { background: var(--fill-primary); }
.bar-title { font-size: 17px; line-height: 20px; font-weight: 600; letter-spacing: -.34px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.app { padding-bottom: calc(var(--tabs-h) + var(--bottom) + 24px); }
.app.root { padding-top: var(--top); }
.pad { padding-left: var(--side); padding-right: var(--side); }

.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: grid; grid-template-columns: repeat(3, 1fr);
  padding: 4px 8px calc(4px + var(--bottom));
  background: color-mix(in srgb, var(--bg-primary) 90%, transparent);
  backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-top: .5px solid var(--fill-tertiary); }
.tab { display: grid; justify-items: center; gap: 2px; padding: 7px 0 5px; border-radius: var(--r-tile);
  color: var(--icon-secondary); font-size: 10px; line-height: 12px; font-weight: 500; letter-spacing: -.2px;
  transition: color var(--t) var(--ease); }
.tab svg { width: 24px; height: 24px; }
.tab[aria-selected="true"] { color: var(--action-primary); }
.tab:active { background: var(--fill-primary); }

.screen { animation: rise 260ms var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px) } to { opacity: 1; transform: none } }

.sec { margin-top: var(--section); }
.sec-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  margin-bottom: 12px; }
.sec-title .more { color: var(--accent-blue); font-size: 14px; font-weight: 500; letter-spacing: -.28px;
  flex: 0 0 auto; }

/* ---------- кнопки ---------- */

.btn { display: block; width: 100%; height: 48px; line-height: 48px; text-align: center;
  border-radius: var(--r-button); background: var(--action-primary); color: var(--action-primary-fg);
  font-size: 16px; font-weight: 500; letter-spacing: -.32px;
  transition: transform var(--t) var(--ease), opacity var(--t) var(--ease); }
.btn:active { transform: scale(.97); }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn.grey { background: var(--fill-primary); color: var(--text-primary); }
.btn.blue { background: var(--accent-blue); color: #fff; }
.btn.small { height: 40px; line-height: 40px; font-size: 15px; letter-spacing: -.3px; }
.btn.inline { display: inline-block; width: auto; padding: 0 20px; }

.pill { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px;
  border-radius: var(--r-capsule); background: var(--fill-primary); color: var(--text-primary);
  font-size: 14px; font-weight: 500; letter-spacing: -.28px;
  transition: background var(--t) var(--ease), transform var(--t) var(--ease); }
.pill:active { transform: scale(.97); background: var(--fill-tertiary); }
.pill svg { width: 16px; height: 16px; color: var(--icon-secondary); flex: 0 0 auto; }

/* ---------- карусель офферов ---------- */

.carousel { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 4px var(--side) 6px; margin: 0 calc(var(--side) * -1); scrollbar-width: none; }
.carousel::-webkit-scrollbar { display: none; }
.offer { flex: 0 0 calc(100% - 32px); scroll-snap-align: center; border-radius: var(--r-hero);
  overflow: hidden; background: var(--grey-light); text-align: left; position: relative;
  transition: transform var(--t) var(--ease); }
.offer:active { transform: scale(.985); }
.offer-media { position: relative; height: 178px; overflow: hidden; }
.offer-media svg, .offer-media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.offer-badge { position: absolute; left: 14px; top: 14px; display: inline-flex; align-items: center;
  height: 28px; padding: 0 12px; border-radius: var(--r-capsule); background: #ffffffe6;
  color: var(--text-primary); font-size: 12px; font-weight: 500; letter-spacing: -.24px;
  backdrop-filter: blur(8px); }
.offer-body { padding: 16px 18px 18px; }
.offer-body h3 { font-size: 20px; line-height: 24px; font-weight: 600; letter-spacing: -.4px; }
.offer-body p { margin-top: 6px; color: var(--text-secondary); font-size: 15px; line-height: 20px;
  font-weight: 500; letter-spacing: -.3px; }
.offer-row { margin-top: 16px; display: flex; align-items: center; gap: 12px; }
.offer-row .btn { flex: 1; }
.offer-note { color: var(--text-secondary); font-size: 12px; line-height: 16px; font-weight: 500;
  letter-spacing: -.24px; flex: 1; min-width: 0; }
.offer-row .btn.inline { flex: 0 0 auto; }
.dots { display: flex; justify-content: center; gap: 6px; margin-top: 12px; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--text-tertiary);
  transition: background var(--t) var(--ease), width var(--t) var(--ease); }
.dot.on { background: var(--action-primary); width: 18px; border-radius: var(--r-capsule); }

/* ---------- плашка подписки ---------- */

.notice { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--r-tile);
  background: var(--chip-muted-bg); }
.notice .ico { width: 20px; height: 20px; flex: 0 0 auto; color: var(--icon-secondary); }
.notice p { flex: 1; color: var(--chip-muted-fg); font-size: 13px; line-height: 17px; font-weight: 500;
  letter-spacing: -.26px; }
.notice.ok { background: #ecfcca; }
.notice.ok p, .notice.ok .ico { color: #4d7c00; }
.notice .act { color: var(--accent-blue); font-size: 13px; font-weight: 600; letter-spacing: -.26px;
  flex: 0 0 auto; }

/* ---------- фильтр ленты ---------- */

.filters { display: flex; gap: 8px; overflow-x: auto; padding: 0 var(--side) 2px;
  margin: 0 calc(var(--side) * -1); scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.filter { flex: 0 0 auto; height: 34px; padding: 0 14px; border-radius: var(--r-capsule);
  background: var(--fill-primary); color: var(--text-secondary);
  font-size: 14px; font-weight: 500; letter-spacing: -.28px;
  transition: background var(--t) var(--ease), color var(--t) var(--ease); }
.filter[aria-pressed="true"] { background: var(--action-primary); color: var(--action-primary-fg); }

/* ---------- лента ---------- */

.feed { display: grid; gap: 12px; }
.fcard { background: var(--bg-muted); border-radius: var(--r-card); overflow: hidden;
  text-align: left; width: 100%; transition: transform var(--t) var(--ease); }
.fcard:active { transform: scale(.99); }

.fcard-guide .cover { height: 150px; }
.fcard-guide .cover svg { display: block; width: 100%; height: 100%; }
.fcard-guide .body { padding: 14px 16px 16px; }
.fcard-guide h3 { font-size: 17px; line-height: 21px; font-weight: 600; letter-spacing: -.34px; }
.fcard-guide p { margin-top: 5px; color: var(--text-secondary); font-size: 14px; line-height: 18px;
  font-weight: 500; letter-spacing: -.28px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.fcard-guide .foot { margin-top: 14px; display: flex; align-items: center; gap: 12px; }
.fcard-guide .foot .meta { flex: 1; color: var(--text-secondary); font-size: 12px; line-height: 16px;
  font-weight: 500; letter-spacing: -.24px; }

.fcard-prompt { padding: 16px; }
.fcard-prompt h3 { font-size: 16px; line-height: 20px; font-weight: 600; letter-spacing: -.32px; }
.fcard-prompt .hint { margin-top: 5px; color: var(--text-secondary); font-size: 14px; line-height: 18px;
  font-weight: 500; letter-spacing: -.28px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.fcard-prompt .open { margin-top: 12px; }
.fcard-prompt .src { margin-top: 12px; color: var(--text-secondary); font-size: 12px; line-height: 16px;
  font-weight: 500; letter-spacing: -.24px; }
.fcard-prompt .src a { font-weight: 600; }

.fcard-link { padding: 16px; }
.fcard-link p { color: var(--text-primary); font-size: 15px; line-height: 20px; font-weight: 500;
  letter-spacing: -.3px; }
.fcard-link .prev { margin-top: 12px; height: 108px; border-radius: var(--r-tile); overflow: hidden; }
.fcard-link .prev svg { display: block; width: 100%; height: 100%; }
.chip-link { margin-top: 12px; display: inline-flex; align-items: center; gap: 8px; height: 34px;
  padding: 0 12px 0 7px; border-radius: var(--r-capsule); background: var(--bg-primary);
  color: var(--text-primary); font-size: 13px; font-weight: 500; letter-spacing: -.26px; max-width: 100%; }
.chip-link .fav { width: 20px; height: 20px; border-radius: 6px; flex: 0 0 auto; display: grid;
  place-items: center; color: #fff; font-size: 11px; font-weight: 700; }
.chip-link .host { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip-link svg { width: 14px; height: 14px; color: var(--icon-secondary); flex: 0 0 auto; }

/* ---------- блок промпта ---------- */

.agent { margin-top: 12px; border-radius: var(--r-tile); background: var(--bg-primary); overflow: hidden; }
.agent-head { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 10px 10px 14px; }
.agent-head .who { color: var(--text-secondary); font-size: 12px; line-height: 16px; font-weight: 500;
  letter-spacing: -.24px; }
.agent-copy { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px;
  border-radius: var(--r-capsule); background: var(--action-primary); color: var(--action-primary-fg);
  font-size: 13px; font-weight: 500; letter-spacing: -.26px;
  transition: background var(--t) var(--ease), transform var(--t) var(--ease); }
.agent-copy:active { transform: scale(.96); }
.agent-copy.done { background: var(--accent-green); }
.agent-copy svg { width: 14px; height: 14px; }
.agent pre { margin: 0; padding: 0 14px 14px; font-family: 'AppMono', ui-monospace, Menlo, monospace;
  font-size: 13px; line-height: 19px; color: var(--text-primary); white-space: pre-wrap;
  word-break: break-word; }
.agent.tall pre { max-height: 300px; overflow-y: auto; }

/* ---------- читалка ---------- */

.reader-cover { height: 200px; border-radius: var(--r-panel); overflow: hidden; margin-top: 4px; }
.reader-cover svg { display: block; width: 100%; height: 100%; }
.reader h1 { margin-top: 18px; font-size: 28px; line-height: 32px; font-weight: 700; letter-spacing: -.56px; }
.reader .kicker { margin-top: 10px; color: var(--text-secondary); font-size: 14px; line-height: 18px;
  font-weight: 500; letter-spacing: -.28px; }
.reader .lead { margin-top: 14px; color: var(--text-secondary); font-size: 17px; line-height: 24px;
  font-weight: 500; letter-spacing: -.34px; }

.doc { margin-top: 24px; }
.doc > * + * { margin-top: 16px; }
.doc p { font-size: 17px; line-height: 25px; font-weight: 400; letter-spacing: -.34px; }
.doc h2 { margin-top: 32px; font-size: 22px; line-height: 26px; font-weight: 600; letter-spacing: -.44px; }
.doc h3 { margin-top: 26px; font-size: 18px; line-height: 22px; font-weight: 600; letter-spacing: -.36px; }
.doc ul, .doc ol { margin: 16px 0 0; padding-left: 22px; font-size: 17px; line-height: 25px;
  font-weight: 400; letter-spacing: -.34px; }
.doc li + li { margin-top: 8px; }
.doc li::marker { color: var(--text-tertiary); }
.doc a { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.doc code { font-family: 'AppMono', ui-monospace, Menlo, monospace; font-size: .86em;
  background: var(--fill-primary); padding: 2px 6px; border-radius: 6px; }
.doc img { max-width: 100%; border-radius: var(--r-tile); display: block; }
.doc .note { padding: 16px 18px; border-radius: var(--r-card); background: var(--bg-muted);
  font-size: 15px; line-height: 21px; font-weight: 500; letter-spacing: -.3px; }
.doc .tbl { overflow-x: auto; border-radius: var(--r-tile); background: var(--bg-muted); }
.doc table { border-collapse: collapse; width: 100%; min-width: 420px; font-size: 14px; }
.doc th, .doc td { padding: 11px 14px; text-align: left; vertical-align: top;
  border-bottom: .5px solid var(--fill-tertiary); font-weight: 500; letter-spacing: -.28px; }
.doc th { font-weight: 600; font-size: 13px; }
.doc tr:last-child td { border-bottom: 0; }
.doc .agent { background: var(--bg-muted); }

.sticky-cta { position: sticky; bottom: calc(var(--tabs-h) + var(--bottom) + 10px); z-index: 20;
  margin: 28px calc(var(--side) * -1) 0; padding: 18px var(--side) 6px;
  /* подложка обязательна: без неё кнопка висит поверх текста статьи и читается как мусор */
  background: linear-gradient(180deg, #ffffff00 0%, #fff 34%, #fff 100%); }
.sticky-cta .btn + .btn { margin-top: 8px; }
.reader .sticky-cta, .screen.pad > .sticky-cta { margin-left: calc(var(--side) * -1); margin-right: calc(var(--side) * -1); }

/* ---------- строки-списки ---------- */

.rows { background: var(--bg-muted); border-radius: var(--r-card); overflow: hidden; }
.row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 15px 16px; text-align: left;
  transition: background var(--t) var(--ease); }
.row:active { background: var(--fill-primary); }
.row + .row, .switch + .row, .row + .switch { border-top: .5px solid var(--fill-tertiary); }
.row-ico { width: 30px; height: 30px; border-radius: var(--r-micro); display: grid; place-items: center;
  background: var(--fill-primary); color: var(--text-primary); flex: 0 0 auto; }
.row-txt { flex: 1; min-width: 0; }
.row-txt b { display: block; font-size: 16px; line-height: 20px; font-weight: 500; letter-spacing: -.32px; }
.row-txt span { display: block; margin-top: 2px; color: var(--text-secondary); font-size: 13px;
  line-height: 17px; font-weight: 500; letter-spacing: -.26px; }
.row-go { color: var(--text-tertiary); flex: 0 0 auto; }

.switch { display: flex; align-items: center; gap: 14px; padding: 15px 16px; }
.switch-box { width: 51px; height: 31px; border-radius: var(--r-capsule); background: var(--fill-tertiary);
  position: relative; flex: 0 0 auto; transition: background var(--t) var(--ease); }
.switch-box::after { content: ''; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px;
  border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0,0,0,.2);
  transition: transform var(--t) var(--ease); }
.switch[aria-checked="true"] .switch-box { background: var(--accent-green); }
.switch[aria-checked="true"] .switch-box::after { transform: translateX(20px); }

/* ---------- профиль ---------- */

.hello { display: flex; align-items: center; gap: 12px; padding: 12px 0 4px; }
.hello-ava { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; flex: 0 0 auto;
  background: var(--bg-muted); }
.hello h1 { font-size: 24px; line-height: 28px; font-weight: 600; letter-spacing: -.48px; }
.hello span { display: block; margin-top: 3px; color: var(--text-secondary); font-size: 14px;
  line-height: 18px; font-weight: 500; letter-spacing: -.28px; }

/* ---------- поиск ---------- */

.search { position: relative; }
.search input { width: 100%; height: 44px; padding: 0 40px 0 38px; border-radius: var(--r-tile);
  border: 0; background: var(--fill-primary); font-size: 16px; font-weight: 500; letter-spacing: -.32px;
  outline: none; }
.search input::placeholder { color: var(--text-tertiary); }
.search .mag { position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--icon-secondary); }
.search .clear { position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  color: var(--icon-secondary); }

/* ---------- состояния ---------- */

.empty { padding: 48px 24px; text-align: center; }
.empty b { display: block; font-size: 18px; line-height: 22px; font-weight: 600; letter-spacing: -.36px; }
.empty p { margin-top: 8px; color: var(--text-secondary); font-size: 15px; line-height: 20px;
  font-weight: 500; letter-spacing: -.3px; }
.skel { border-radius: var(--r-card); background: var(--bg-muted); animation: sk 1.2s var(--ease) infinite; }
@keyframes sk { 0%,100% { opacity: 1 } 50% { opacity: .5 } }

.toast { position: fixed; left: 50%; bottom: calc(var(--tabs-h) + var(--bottom) + 16px); z-index: 70;
  transform: translate(-50%, 12px); opacity: 0; pointer-events: none;
  height: 40px; line-height: 40px; padding: 0 20px; border-radius: var(--r-capsule);
  background: var(--action-primary); color: var(--action-primary-fg);
  font-size: 14px; font-weight: 500; letter-spacing: -.28px; max-width: calc(100vw - 40px);
  transition: opacity var(--t) var(--ease), transform var(--t) var(--ease); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.sheet { position: fixed; inset: 0; z-index: 80; display: flex; align-items: flex-end; }
.sheet-bg { position: absolute; inset: 0; background: var(--sheet-backdrop);
  animation: fade 220ms var(--ease) both; }
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
.sheet-card { position: relative; width: 100%; max-height: 92dvh; overflow-y: auto;
  background: var(--bg-primary); border-radius: var(--r-sheet) var(--r-sheet) 0 0;
  padding: 8px var(--sheet-side) calc(20px + var(--bottom));
  animation: up 300ms var(--ease) both; }
@keyframes up { from { transform: translateY(100%) } to { transform: none } }
.sheet-grip { width: 36px; height: 5px; border-radius: var(--r-capsule); background: var(--fill-tertiary);
  margin: 6px auto 16px; }
.sheet-card h2 { font-size: 22px; line-height: 26px; font-weight: 600; letter-spacing: -.44px; }
.sheet-card textarea { width: 100%; margin-top: 14px; min-height: 112px; padding: 14px;
  border-radius: var(--r-tile); border: 0; background: var(--fill-primary);
  font-size: 16px; line-height: 21px; font-weight: 500; letter-spacing: -.32px; resize: vertical; outline: none; }

/* ---------- уроки курса ---------- */

.lesson { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 16px; text-align: left; }
.lesson + .lesson { border-top: .5px solid var(--fill-tertiary); }
.lesson .num { width: 28px; height: 28px; border-radius: var(--r-micro); display: grid; place-items: center;
  background: var(--fill-primary); color: var(--text-secondary); font-size: 13px; font-weight: 600;
  flex: 0 0 auto; }
.lesson .tx { flex: 1; min-width: 0; }
.lesson .tag { display: block; color: var(--text-tertiary); font-size: 10px; line-height: 12px;
  font-weight: 600; letter-spacing: .4px; text-transform: uppercase; }
.lesson .tx b { display: block; margin-top: 3px; font-size: 16px; line-height: 20px; font-weight: 500;
  letter-spacing: -.32px; }
.lesson .state { color: var(--text-tertiary); flex: 0 0 auto; }
