/* NOVA English — «вечерний кабинет»
   Чернильная база, янтарный акцент, тёплая бумажная светлая тема. */

/* Шрифты лежат у нас. Раньше тут был @import с fonts.googleapis.com —
   с мобильного интернета он подвисал, и вместе с ним подвисала вся
   страница: стиль не догружался, скрипты не стартовали, экран пустой. */
/* vietnamese */
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(/static/fonts/v38-6NU78FyLNQOQZAnv9bYEvDiIdE9Ea92uemAk_WBq8U_9v0c2Wa0KxCBTeO-U.woff2) format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(/static/fonts/v38-6NU78FyLNQOQZAnv9bYEvDiIdE9Ea92uemAk_WBq8U_9v0c2Wa0KxCFTeO-U.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(/static/fonts/v38-6NU78FyLNQOQZAnv9bYEvDiIdE9Ea92uemAk_WBq8U_9v0c2Wa0KxC9TeA.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* vietnamese */
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(/static/fonts/v38-6NU78FyLNQOQZAnv9bYEvDiIdE9Ea92uemAk_WBq8U_9v0c2Wa0KxCBTeO-U.woff2) format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(/static/fonts/v38-6NU78FyLNQOQZAnv9bYEvDiIdE9Ea92uemAk_WBq8U_9v0c2Wa0KxCFTeO-U.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(/static/fonts/v38-6NU78FyLNQOQZAnv9bYEvDiIdE9Ea92uemAk_WBq8U_9v0c2Wa0KxC9TeA.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* cyrillic-ext */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/static/fonts/v20-xn7gYHE41ni1AdIRggqxSuXd.woff2) format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
/* cyrillic */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/static/fonts/v20-xn7gYHE41ni1AdIRggOxSuXd.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* greek */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/static/fonts/v20-xn7gYHE41ni1AdIRggSxSuXd.woff2) format('woff2');
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}
/* vietnamese */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/static/fonts/v20-xn7gYHE41ni1AdIRggixSuXd.woff2) format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/static/fonts/v20-xn7gYHE41ni1AdIRggmxSuXd.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/static/fonts/v20-xn7gYHE41ni1AdIRggexSg.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* cyrillic-ext */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(/static/fonts/v20-xn7gYHE41ni1AdIRggqxSuXd.woff2) format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
/* cyrillic */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(/static/fonts/v20-xn7gYHE41ni1AdIRggOxSuXd.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* greek */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(/static/fonts/v20-xn7gYHE41ni1AdIRggSxSuXd.woff2) format('woff2');
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}
/* vietnamese */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(/static/fonts/v20-xn7gYHE41ni1AdIRggixSuXd.woff2) format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(/static/fonts/v20-xn7gYHE41ni1AdIRggmxSuXd.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(/static/fonts/v20-xn7gYHE41ni1AdIRggexSg.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* cyrillic-ext */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(/static/fonts/v20-xn7gYHE41ni1AdIRggqxSuXd.woff2) format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
/* cyrillic */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(/static/fonts/v20-xn7gYHE41ni1AdIRggOxSuXd.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* greek */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(/static/fonts/v20-xn7gYHE41ni1AdIRggSxSuXd.woff2) format('woff2');
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}
/* vietnamese */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(/static/fonts/v20-xn7gYHE41ni1AdIRggixSuXd.woff2) format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(/static/fonts/v20-xn7gYHE41ni1AdIRggmxSuXd.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(/static/fonts/v20-xn7gYHE41ni1AdIRggexSg.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* cyrillic-ext */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(/static/fonts/v20-xn7gYHE41ni1AdIRggqxSuXd.woff2) format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
/* cyrillic */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(/static/fonts/v20-xn7gYHE41ni1AdIRggOxSuXd.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* greek */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(/static/fonts/v20-xn7gYHE41ni1AdIRggSxSuXd.woff2) format('woff2');
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}
/* vietnamese */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(/static/fonts/v20-xn7gYHE41ni1AdIRggixSuXd.woff2) format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(/static/fonts/v20-xn7gYHE41ni1AdIRggmxSuXd.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(/static/fonts/v20-xn7gYHE41ni1AdIRggexSg.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* cyrillic-ext */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url(/static/fonts/v20-xn7gYHE41ni1AdIRggqxSuXd.woff2) format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
/* cyrillic */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url(/static/fonts/v20-xn7gYHE41ni1AdIRggOxSuXd.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* greek */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url(/static/fonts/v20-xn7gYHE41ni1AdIRggSxSuXd.woff2) format('woff2');
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}
/* vietnamese */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url(/static/fonts/v20-xn7gYHE41ni1AdIRggixSuXd.woff2) format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url(/static/fonts/v20-xn7gYHE41ni1AdIRggmxSuXd.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url(/static/fonts/v20-xn7gYHE41ni1AdIRggexSg.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --ink-900: #0B0D13;
  --ink-850: #10131C;
  --ink-800: #151924;
  --ink-700: #1D2231;
  --ink-600: #272E40;

  --cream: #F4F0E7;
  --cream-dim: #A19C8B;

  --amber: #F2AC42;
  --amber-deep: #D6862A;
  --amber-soft: #FFD08A;
  --amber-glow: rgba(242, 172, 66, .26);

  --teal: #4CBD9C;
  --coral: #ED7A63;
  --violet: #8E7CF0;

  --bg: var(--ink-900);
  --surface: rgba(255, 255, 255, .045);
  --surface-solid: var(--ink-800);
  --surface-2: rgba(255, 255, 255, .07);
  --line: rgba(244, 240, 231, .10);
  --line-soft: rgba(244, 240, 231, .06);
  --text: var(--cream);
  --muted: var(--cream-dim);
  --accent: var(--amber);
  --on-accent: #2A1B06;

  --r-xs: 9px;
  --r-sm: 14px;
  --r-md: 20px;
  --r-lg: 28px;
  --shadow: 0 14px 40px rgba(0, 0, 0, .40);
  --shadow-sm: 0 4px 16px rgba(0, 0, 0, .28);

  --sans: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --display: 'Fraunces', Georgia, 'Times New Roman', serif;

  --ease: cubic-bezier(.22, 1, .36, 1);
  --pop: cubic-bezier(.34, 1.56, .64, 1);
}

[data-theme="light"] {
  /* фон заметно теплее и глубже белого, поверхности — чистый белый:
     иначе карточки на светлой теме сливаются с подложкой в кашу */
  --bg: #F2ECE1;
  --surface: #FFFFFF;
  --surface-solid: #FFFFFF;
  --surface-2: rgba(28, 22, 10, .06);
  --line: rgba(20, 18, 12, .14);
  --line-soft: rgba(20, 18, 12, .08);
  --text: #17160F;
  --muted: #6E6555;
  --amber-glow: rgba(214, 134, 42, .16);
  --accent: var(--amber-deep);
  --on-accent: #FFF8EC;
  --shadow: 0 10px 30px rgba(70, 52, 22, .12);
  --shadow-sm: 0 3px 12px rgba(70, 52, 22, .08);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

/* Любой явный display в авторских стилях перебивает браузерное
   [hidden] { display: none }. Без этого элементы с атрибутом hidden
   остаются видимыми — так карточка слова висела поверх всего экрана. */
[hidden] { display: none !important; }

html, body {
  margin: 0; height: 100%;
  /* жёсткий стоп для горизонтального разъезда: страница не имеет права
     стать шире экрана, что бы ни попросил вложенный флекс */
  width: 100%; max-width: 100%; overflow-x: hidden;
  background: var(--bg); color: var(--text);
  font: 15px/1.55 var(--sans);
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body {
  display: flex; flex-direction: column;
  background-image:
    radial-gradient(760px 320px at 50% -8%, var(--amber-glow), transparent 70%),
    radial-gradient(520px 300px at 108% 18%, rgba(142, 124, 240, .12), transparent 72%),
    radial-gradient(560px 340px at -12% 62%, rgba(76, 189, 156, .09), transparent 72%);
  background-repeat: no-repeat;
  background-attachment: fixed;
}

button { font-family: inherit; cursor: pointer; }

::-webkit-scrollbar { width: 0; height: 0; }

/* ---------- шапка ---------- */
#topbar {
  display: flex; align-items: center; gap: 10px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 6px;
}
.brand { flex: 1; text-align: center; min-width: 0; }
#topbar .title {
  font-family: var(--display); font-weight: 700; font-size: 19px;
  letter-spacing: -.015em; line-height: 1.1;
}
#topbar .sub {
  font-size: 10px; color: var(--muted); letter-spacing: .07em;
  text-transform: lowercase; margin-top: 2px;
}
.level {
  font-size: 11px; font-weight: 800; letter-spacing: .09em;
  padding: 6px 12px; border-radius: 999px;
  background: linear-gradient(135deg, var(--amber-soft), var(--amber-deep));
  color: var(--on-accent);
  box-shadow: 0 4px 16px var(--amber-glow), inset 0 1px 0 rgba(255, 255, 255, .45);
}
.streak {
  font-size: 12px; font-weight: 700; color: var(--muted);
  min-width: 48px; text-align: right;
}

/* ---------- вкладки ---------- */
#tabs {
  display: flex; gap: 2px; margin: 8px 14px 10px;
  padding: 4px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line-soft);
  backdrop-filter: blur(14px);
}
.tab {
  flex: 1; padding: 9px 4px; border: 0; border-radius: 999px;
  background: transparent; color: var(--muted);
  font: 700 12.5px var(--sans); letter-spacing: .005em;
  transition: color .2s var(--ease), background .2s var(--ease), transform .2s var(--pop);
}
.tab:active { transform: scale(.96); }
.tab.active {
  background: linear-gradient(135deg, var(--amber), var(--amber-deep));
  color: var(--on-accent);
  box-shadow: 0 5px 16px var(--amber-glow);
}

/* min-width:0 обязателен на каждом уровне: у флекс-элемента по умолчанию
   min-width:auto, и он отказывается сжиматься уже своего содержимого —
   одна нерастягиваемая лента чипов внутри раздвигала всю страницу. */
main { flex: 1; min-height: 0; min-width: 0; display: flex; }
.view { display: none; flex: 1; min-height: 0; min-width: 0; flex-direction: column; }
.view.active { display: flex; animation: fadeIn .22s var(--ease); }
@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
.pad { padding: 2px 14px 26px; overflow-y: auto; }

/* ---------- голос ---------- */
#voiceLog {
  flex: 1; min-width: 0; overflow-y: auto; overflow-x: hidden; padding: 6px 14px 10px;
  display: flex; flex-direction: column; gap: 10px;
  scroll-behavior: smooth;
}
/* Разговор копится снизу вверх — иначе в начале сессии посреди экрана
   зияет пустота. margin-top:auto вместо justify-content:flex-end:
   последний при переполнении обрезает верх содержимого. */
#voiceLog > *:first-child, #log > *:first-child { margin-top: auto; }

/* приветствие — это не разбор ошибок, и выглядеть карточкой не должно */
.hello {
  align-self: center; max-width: 300px; text-align: center;
  color: var(--muted); font-size: 13.5px; line-height: 1.6;
  padding: 4px 0 2px; white-space: pre-line;
  animation: rise .3s var(--ease);
}
.hello b { color: var(--text); font-weight: 700; }

#voicePanel {
  flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 11px;
  padding: 18px 14px calc(20px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line-soft);
  background:
    linear-gradient(to top, color-mix(in srgb, var(--bg) 92%, transparent), transparent);
  backdrop-filter: blur(10px);
}
#voiceHint {
  font-size: 13px; color: var(--muted); text-align: center;
  max-width: 290px; line-height: 1.4; min-height: 18px;
}

#micBtn {
  position: relative; width: 108px; height: 108px; border-radius: 50%; border: 0;
  /* блик сверху отдельным слоем: одна линейная заливка выглядит как пластик */
  background:
    radial-gradient(115% 115% at 32% 20%, rgba(255, 255, 255, .5), rgba(255, 255, 255, 0) 48%),
    linear-gradient(155deg, var(--amber-soft), var(--amber) 44%, var(--amber-deep));
  color: var(--on-accent);
  display: grid; place-items: center;
  box-shadow:
    0 14px 38px var(--amber-glow),
    0 0 calc(var(--lvl, 0) * 74px) var(--amber-glow),
    inset 0 2px 0 rgba(255, 255, 255, .42),
    inset 0 -7px 16px rgba(0, 0, 0, .10);
  transition: background .3s var(--ease), box-shadow .12s linear, transform .14s var(--pop);
}

/* Значок рисованный, а не эмодзи: эмодзи на каждой платформе свой, у него
   чужая обводка и он не умеет менять цвет вместе с кнопкой. */
#micGlyph {
  position: relative; z-index: 2; width: 46px; height: 46px;
  fill: currentColor; stroke: currentColor;
  stroke-width: 3; stroke-linecap: round; stroke-linejoin: round;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .22));
}
#micGlyph path { fill: none; }
#micGlyph g { opacity: 0; transition: opacity .18s var(--ease); }
#micBtn .g-idle,
#micBtn.listening .g-listening,
#micBtn.thinking  .g-thinking,
#micBtn.speaking  .g-speaking { opacity: 1; }
#micBtn.listening .g-idle,
#micBtn.thinking  .g-idle,
#micBtn.speaking  .g-idle { opacity: 0; }
#micBtn.thinking .g-thinking circle { animation: micdots 1.1s ease-in-out infinite; }
#micBtn.thinking .g-thinking circle:nth-child(2) { animation-delay: .15s; }
#micBtn.thinking .g-thinking circle:nth-child(3) { animation-delay: .3s; }
@keyframes micdots {
  0%, 100% { opacity: .35; transform: translateY(0); }
  50%      { opacity: 1;   transform: translateY(-3px); }
}
/* полоски звука дышат в такт громкости ответа */
#micBtn.speaking .g-speaking path { animation: micbars 1s ease-in-out infinite; }
#micBtn.speaking .g-speaking path:nth-child(2) { animation-delay: .12s; }
#micBtn.speaking .g-speaking path:nth-child(3) { animation-delay: .24s; }
#micBtn.speaking .g-speaking path:nth-child(4) { animation-delay: .36s; }
#micBtn.speaking .g-speaking path:nth-child(5) { animation-delay: .48s; }
@keyframes micbars {
  0%, 100% { transform: scaleY(.55); }
  50%      { transform: scaleY(1); }
}
#micGlyph .g-speaking path { transform-origin: center; transform-box: fill-box; }
#micBtn:disabled { opacity: .35; box-shadow: none; }
#micBtn.listening {
  background: linear-gradient(150deg, #FF9E86, var(--coral));
  transform: scale(calc(1 + var(--lvl, 0) * .05));
}
#micBtn.thinking {
  background: linear-gradient(150deg, var(--ink-600), var(--ink-700));
  color: var(--muted);
}
#micBtn.speaking { background: linear-gradient(150deg, #6FD8B6, var(--teal)); }
#micBtn:active { transform: scale(.93); }

/* мягкое дыхание в покое — кнопка выглядит живой, а не выключенной */
.mic-halo {
  position: absolute; inset: -3px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(255, 255, 255, .22), transparent 62%);
  opacity: 0; transition: opacity .3s;
}
#micBtn:not(:disabled):not(.thinking) .mic-halo { opacity: 1; animation: breathe 3.4s ease-in-out infinite; }
@keyframes breathe {
  0%, 100% { transform: scale(1);    opacity: .30; }
  50%      { transform: scale(1.10); opacity: .05; }
}

#micRing {
  position: absolute; inset: -9px; border-radius: 50%; pointer-events: none;
  border: 2px solid transparent;
}
#micBtn.listening #micRing { border-color: rgba(237, 122, 99, .55); animation: pulse 1.45s ease-out infinite; }
#micBtn.speaking  #micRing { border-color: rgba(76, 189, 156, .5);  animation: pulse 1.9s ease-out infinite; }
@keyframes pulse {
  0%   { transform: scale(1);    opacity: .9; }
  100% { transform: scale(1.45); opacity: 0; }
}

#voiceLevel {
  width: 190px; height: 5px; border-radius: 4px; overflow: hidden;
  background: var(--surface-2);
}
#voiceLevelBar {
  display: block; height: 100%; width: 0%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--teal), var(--amber), var(--coral));
  transition: width .07s linear;
}
#voiceStatus {
  font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); min-height: 15px;
}

/* ---------- панель режимов ---------- */
/* Раньше полоса ездила вбок, и три кнопки из шести просто не было видно —
   включая оранжевую «Разобрать сессию». Переносим на вторую строку. */
/* Полоса кнопок — элемент колонки, и раньше её сжимало: вторая строка
   обрезалась ровно посередине. flex: 0 0 auto запрещает сжимать, а
   видимое переполнение убирает срез, если строк станет три. */
#voiceBar {
  display: flex; gap: 6px; padding: 0 14px 10px;
  flex-wrap: wrap; overflow: visible;
  flex: 0 0 auto; min-width: 0; width: 100%;
}
.chip {
  flex: 0 1 auto; min-width: 0; white-space: nowrap;
  border: 1px solid var(--line); background: var(--surface); color: var(--muted);
  border-radius: 999px; padding: 7px 11px; font: 700 11px var(--sans);
  backdrop-filter: blur(10px);
  transition: color .18s, border-color .18s, background .18s, transform .16s var(--pop);
}
.chip:active { transform: scale(.94); }
.chip.on {
  color: var(--text); border-color: var(--accent);
  background: color-mix(in srgb, var(--amber) 14%, transparent);
}
.chip.accent {
  background: linear-gradient(135deg, var(--amber), var(--amber-deep));
  color: var(--on-accent); border-color: transparent; font-weight: 800;
  box-shadow: 0 4px 14px var(--amber-glow);
}

/* ---------- скрытый текст реплики ---------- */
.turn.bot.veiled .body {
  filter: blur(7px); opacity: .5; user-select: none; pointer-events: none;
  transition: filter .3s var(--ease), opacity .3s var(--ease);
}
.turn.bot .veil-hint {
  display: none; font-size: 11px; color: var(--muted);
  margin-top: 7px; letter-spacing: .05em;
}
.turn.bot.veiled .veil-hint { display: block; }
.turn.bot .body w {
  cursor: pointer; border-radius: 4px; padding: 0 2px; margin: 0 -1px;
  transition: background .15s;
}
.turn.bot .body w:active, .turn.bot .body w.picked { background: var(--amber-glow); }

/* ---------- выбор темы ---------- */
.topic-list { max-height: 46vh; overflow-y: auto; margin: 16px 0 16px; }
.topic-item {
  display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 13px 15px; margin-bottom: 8px;
  background: var(--surface-2); border: 1px solid transparent; color: var(--text);
  border-radius: var(--r-sm); font: 600 14.5px var(--sans); text-align: left;
  transition: transform .16s var(--pop), border-color .18s, background .18s;
}
.topic-item:active { transform: scale(.985); }
.topic-item .em { font-size: 20px; }
.topic-item.on {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--amber) 14%, var(--surface-2));
}
.topic-item .lv { margin-left: auto; font-size: 10.5px; color: var(--muted); font-weight: 800; letter-spacing: .06em; }

/* ---------- тренажёр произношения ---------- */
.drill {
  align-self: stretch; background: var(--surface-solid); border: 1px solid var(--line);
  border-left: 3px solid var(--teal); border-radius: var(--r-sm);
  padding: 15px 16px; box-shadow: var(--shadow-sm);
  animation: rise .3s var(--ease);
}
.drill .focus {
  font: 800 10.5px var(--sans); text-transform: uppercase; letter-spacing: .14em;
  color: var(--teal);
}
.drill .phrase {
  font-family: var(--display); font-size: 22px; font-weight: 700;
  line-height: 1.35; margin: 11px 0; letter-spacing: -.01em;
}
.drill .hint { font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.drill .score {
  font-family: var(--display); font-size: 36px; font-weight: 700; line-height: 1;
  margin: 4px 0 2px;
}
.drill .score.good { color: var(--teal); }
.drill .score.mid  { color: var(--amber); }
.drill .score.bad  { color: var(--coral); }
.drill .w-ok  { color: var(--teal); }
.drill .w-bad { color: var(--coral); text-decoration: underline wavy; text-underline-offset: 4px; }
.drill .heard { font-size: 12.5px; color: var(--muted); margin-top: 9px; font-style: italic; }
.drill .metrics {
  display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 11px; padding-top: 10px;
  border-top: 1px solid var(--line-soft);
  font-size: 11px; color: var(--muted); letter-spacing: .03em;
}
.drill .metrics b { color: var(--text); font-size: 15px; font-weight: 800; margin-right: 3px; }

.voice-head {
  font: 800 10.5px var(--sans); text-transform: uppercase; letter-spacing: .14em;
  color: var(--muted); margin: 14px 0 8px;
}
.voice-head:first-child { margin-top: 0; }

.rate-row {
  display: flex; align-items: center; gap: 11px;
  font-size: 13px; color: var(--muted); margin-bottom: 16px;
}
.rate-row input[type="range"] { flex: 1; accent-color: var(--accent); }
.rate-row span { font-variant-numeric: tabular-nums; color: var(--text); font-weight: 700; }

/* ---------- шторки ---------- */
#voiceSheet, #topicSheet, #wordSheet {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(6, 7, 11, .58); backdrop-filter: blur(5px);
  display: flex; align-items: flex-end;
  animation: fade .2s;
}
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
#voiceSheet .sheet, #topicSheet .sheet, #wordSheet .sheet {
  width: 100%; background: var(--surface-solid);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  padding: 12px 20px calc(20px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  box-shadow: 0 -20px 50px rgba(0, 0, 0, .4);
  animation: up .3s var(--ease);
}
/* «ручка» сверху — сразу читается как шторка, которую можно закрыть */
.sheet::before {
  content: ""; display: block; width: 38px; height: 4px; margin: 0 auto 16px;
  border-radius: 3px; background: var(--line);
}
@keyframes up { from { transform: translateY(100%) } to { transform: none } }
.sheet-word {
  font-family: var(--display); font-size: 27px; font-weight: 700;
  color: var(--accent); letter-spacing: -.015em;
}
.sheet-meaning { font-size: 15.5px; margin-top: 6px; line-height: 1.5; }
.sheet-example {
  font-family: var(--display); font-style: italic; color: var(--muted);
  margin: 13px 0 18px; line-height: 1.5;
}

/* ---------- реплики ---------- */
.turn, .msg {
  max-width: 88%; padding: 11px 15px; border-radius: var(--r-md);
  white-space: pre-wrap; word-wrap: break-word; line-height: 1.5;
  animation: rise .28s var(--ease);
}
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.turn.me, .msg.user {
  align-self: flex-end; border-bottom-right-radius: 7px;
  background: linear-gradient(140deg, var(--amber), var(--amber-deep));
  color: var(--on-accent); font-weight: 600;
  box-shadow: 0 5px 18px var(--amber-glow);
}
.turn.bot, .msg.bot {
  align-self: flex-start; border-bottom-left-radius: 7px;
  background: var(--surface); border: 1px solid var(--line-soft);
  backdrop-filter: blur(10px);
}
.msg.typing { color: var(--muted); font-style: italic; }
.turn .replay { cursor: pointer; margin-left: 8px; opacity: .5; font-size: 13px; }
.turn .replay:active { opacity: 1; }

/* ---------- карточка разбора ---------- */
.review {
  align-self: stretch; margin: 2px 0;
  background: var(--surface-solid); border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--r-sm); padding: 13px 15px; font-size: 13.5px;
  box-shadow: var(--shadow-sm);
  animation: rise .28s var(--ease);
}
.review h4 {
  margin: 0 0 10px; font: 800 10.5px var(--sans);
  text-transform: uppercase; letter-spacing: .16em; color: var(--muted);
}
.review .fix { margin-bottom: 10px; }
.review .from { color: var(--coral); text-decoration: line-through; text-decoration-thickness: 1.5px; opacity: .8; }
.review .to { color: var(--teal); font-weight: 800; }
.review .why { color: var(--muted); font-size: 12.5px; margin-top: 3px; line-height: 1.45; }
.review .natural {
  margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line-soft);
  font-family: var(--display); font-size: 15px; font-style: italic;
}
.review .word { margin-top: 9px; }
.review .word b { color: var(--accent); font-weight: 800; }
.review .clean { color: var(--teal); font-weight: 700; }

/* ---------- текстовый ввод ---------- */
#log {
  flex: 1; min-width: 0; overflow-y: auto; overflow-x: hidden;
  padding: 8px 14px 4px; display: flex; flex-direction: column; gap: 9px;
}
#composer {
  display: flex; gap: 9px; align-items: flex-end;
  padding: 10px 14px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line-soft);
  backdrop-filter: blur(10px);
}
#input {
  flex: 1; resize: none; max-height: 120px;
  padding: 12px 16px; border-radius: 22px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  font: 15px var(--sans);
  transition: border-color .18s, box-shadow .18s;
}
#input::placeholder { color: var(--muted); }
#input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--amber-glow); }
#send {
  width: 46px; height: 46px; flex: 0 0 46px; border: 0; border-radius: 50%;
  background: linear-gradient(140deg, var(--amber), var(--amber-deep));
  color: var(--on-accent); font-size: 17px;
  box-shadow: 0 5px 16px var(--amber-glow);
  transition: transform .14s var(--pop);
}
#send:active { transform: scale(.9); }
#send:disabled { opacity: .4; box-shadow: none; }

/* ---------- карточки и статистика ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line-soft);
  border-radius: var(--r-md); padding: 16px 17px; margin-bottom: 11px;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(12px);
}
.card h3 {
  margin: 0 0 13px; font: 800 10.5px var(--sans);
  text-transform: uppercase; letter-spacing: .16em; color: var(--muted);
}

.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-bottom: 11px; }
.kpi {
  background: var(--surface); border: 1px solid var(--line-soft);
  border-radius: var(--r-sm); padding: 14px 8px; text-align: center;
  backdrop-filter: blur(12px);
}
.kpi .v { font-family: var(--display); font-size: 26px; font-weight: 700; line-height: 1; letter-spacing: -.02em; }
.kpi .l { font-size: 10px; color: var(--muted); margin-top: 6px; letter-spacing: .05em; }
.kpi .d { font-size: 11px; margin-top: 5px; font-weight: 800; }
.kpi .d.good { color: var(--teal); }
.kpi .d.bad { color: var(--coral); }

svg.chart { display: block; width: 100%; height: 106px; overflow: visible; }
svg.chart .b { fill: var(--amber-deep); }
svg.chart .b.e { fill: var(--surface-2); }
.chart-x { display: flex; justify-content: space-between; font-size: 10px; color: var(--muted); margin-top: 8px; }

.bars .row { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; font-size: 13px; }
.bars .name { width: 98px; flex: 0 0 98px; color: var(--muted); font-size: 12.5px; }
.bars .track { flex: 1; height: 8px; background: var(--surface-2); border-radius: 5px; overflow: hidden; }
.bars .fill {
  /* span по умолчанию строчный, и ширина с высотой на нём не работают:
     полоски получались нулевой ширины, то есть их просто не было видно */
  display: block;
  height: 100%; border-radius: 5px;
  background: linear-gradient(90deg, var(--amber-deep), var(--amber-soft));
  animation: slide .6s var(--ease);
}
@keyframes slide { from { transform: scaleX(0); transform-origin: left; } to { transform: none; } }
.bars .n { width: 26px; text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }

.report { white-space: pre-wrap; line-height: 1.65; font-size: 14px; }

.word-item { padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.word-item:last-child { border-bottom: 0; }
.word-item b { color: var(--accent); font-weight: 800; }
.word-item .ex {
  color: var(--muted); font-size: 12.5px; font-style: italic;
  margin-top: 4px; font-family: var(--display);
}
.word-item .n { float: right; color: var(--muted); font-size: 11px; font-weight: 700; }

.skeleton, .empty { color: var(--muted); text-align: center; padding: 36px 14px; font-size: 13.5px; line-height: 1.6; }

button.wide {
  width: 100%; padding: 14px; border: 0; border-radius: var(--r-sm);
  background: linear-gradient(140deg, var(--amber), var(--amber-deep));
  color: var(--on-accent); font: 800 14px var(--sans); margin-bottom: 11px;
  box-shadow: 0 6px 18px var(--amber-glow);
  transition: transform .14s var(--pop);
}
button.wide:active { transform: scale(.98); }
button.ghost {
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--line); box-shadow: none;
}

.v-note {
  display: block; font-style: normal; font-size: 11px;
  color: var(--muted); margin-top: 2px;
}

/* ---------- собеседница ---------- */
#stage {
  flex: 1 1 auto; min-height: 0; display: flex;
  align-items: flex-end; justify-content: center;
  padding: 4px 14px 0; color: var(--text);
}
#stage[hidden] { display: none; }
.girl {
  width: 100%; height: 100%; max-width: 300px;
  /* Тени тут быть не должно: фигура упирается в край холста, и браузер
     обрезает тень по нему — под ней появляется светлый прямоугольник. */
}
/* В её режиме текста на фоне нет совсем — иначе это уже не разговор,
   а чтение. Подсказки и ошибки показываются всплывашкой поверх экрана. */
#voiceLog.gone { display: none; }

#novaTag {
  text-align: center; padding: 2px 14px 8px;
  font-size: 12.5px; color: var(--muted); letter-spacing: .02em;
}
#novaTag b {
  font-family: var(--display); font-size: 15px; font-weight: 700;
  color: var(--text); letter-spacing: .01em;
}
#novaTag span { color: var(--muted); }

#toast {
  position: fixed; left: 50%; bottom: 96px; transform: translate(-50%, 12px);
  max-width: min(340px, 88vw); padding: 11px 15px; border-radius: var(--r-sm);
  background: var(--surface); border: 1px solid var(--line);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .18);
  font-size: 13px; line-height: 1.4; color: var(--text);
  opacity: 0; pointer-events: none; z-index: 40;
  transition: opacity .22s, transform .22s var(--pop);
}
#toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- цель сценария ---------- */
.goal {
  margin: 0 14px 8px; padding: 9px 12px; border-radius: var(--r-sm);
  background: var(--surface); border: 1px solid var(--line);
  font-size: 12.5px; line-height: 1.4; color: var(--text);
}
.goal .goal-l {
  font-size: 10px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted); margin-right: 6px;
}
.goal.done {
  border-color: var(--teal);
  background: color-mix(in srgb, var(--teal) 12%, transparent);
}
.goal.done b { color: var(--teal); margin-right: 6px; }

/* ---------- работа над ошибками ---------- */
.ex-focus { font-size: 11px; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.ex-prompt { font-size: 16px; line-height: 1.45; margin: 10px 0 14px; }
.ex-opts { display: flex; flex-direction: column; gap: 8px; }
.ex-opt {
  text-align: left; padding: 12px 14px; border-radius: var(--r-sm);
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--line); font: 600 14px var(--sans);
}
.ex-opt:active { transform: scale(.99); }
.ex-input {
  width: 100%; padding: 12px 14px; border-radius: var(--r-sm); margin-bottom: 10px;
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--line); font: 500 15px var(--sans);
}
.ex-verdict { font-family: var(--display); font-size: 21px; font-weight: 700; margin-bottom: 6px; }
.ex-verdict.good { color: var(--teal); }
.ex-verdict.bad { color: var(--coral); }
.ex-answer { font-size: 15px; margin-bottom: 8px; }

/* ---------- карточки слов ---------- */
.cards-cta .cta-line {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 10px; margin-bottom: 12px; font-size: 14px;
}
.cards-cta .muted, .card-face .muted { color: var(--muted); font-size: 12px; }

.card-face { text-align: center; padding: 26px 18px 18px; }
.card-face .c-meaning {
  font-family: var(--display); font-size: 27px; font-weight: 700;
  line-height: 1.15; letter-spacing: -.01em;
}
.card-face .c-example {
  margin-top: 12px; color: var(--muted); font-size: 14px; font-style: italic;
}
.card-face .c-hint { margin-top: 18px; font-size: 12.5px; color: var(--muted); }
.card-face .c-mic {
  width: 92px; height: 92px; margin: 14px auto 8px;
  display: grid; place-items: center;
  border: 0; border-radius: 50%; color: var(--on-accent);
  background:
    radial-gradient(115% 115% at 32% 20%, rgba(255, 255, 255, .45), rgba(255, 255, 255, 0) 48%),
    linear-gradient(150deg, var(--amber-soft), var(--amber) 45%, var(--amber-deep));
  box-shadow:
    0 10px 26px var(--amber-glow),
    inset 0 2px 0 rgba(255, 255, 255, .38);
  transition: transform .14s var(--pop);
}
.card-face .c-mic svg {
  width: 40px; height: 40px;
  fill: currentColor; stroke: currentColor;
  stroke-width: 3; stroke-linecap: round;
}
.card-face .c-mic svg path { fill: none; }
.card-face .c-mic:active { transform: scale(.94); }
.card-face .c-mic.on { animation: pulse 1.1s infinite; }
@keyframes pulse { 50% { box-shadow: 0 10px 34px var(--amber-glow), 0 0 0 12px var(--amber-glow); } }
.card-face .c-status { font-size: 12.5px; color: var(--muted); min-height: 18px; }
.card-face .c-row { display: flex; gap: 8px; margin-top: 16px; }
.card-face .c-row button {
  flex: 1; padding: 11px; border-radius: var(--r-sm);
  background: var(--surface-2); color: var(--muted);
  border: 1px solid var(--line); font: 700 12.5px var(--sans);
}
.card-face .c-progress { margin-top: 12px; font-size: 11px; color: var(--muted); }
.card-face .c-verdict {
  font-family: var(--display); font-size: 24px; font-weight: 700; margin-bottom: 8px;
}
.card-face .c-verdict.good { color: var(--teal); }
.card-face .c-verdict.bad { color: var(--coral); }
.card-face .c-heard { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.cards-done { text-align: center; padding: 30px 18px 18px; }
.cards-done .big { font-family: var(--display); font-size: 26px; font-weight: 700; margin-bottom: 8px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

#maint {
  position: fixed; inset: 0; z-index: 99;
  display: flex; align-items: center; justify-content: center;
  padding: 32px; text-align: center;
  background: var(--bg); color: var(--text);
  font-size: 17px; line-height: 1.5;
}
#maint b { display: block; font-size: 21px; margin-bottom: 10px; }
#maint p { margin: 0; opacity: .75; }

/* ---------- правая шторка: уровень в моменте ---------- */

/* Язычок у края — единственное, что видно, пока шторка закрыта. Он же
   показывает процент: чтобы взглянуть на уровень, тянуть необязательно. */
#liveTab {
  position: fixed; right: 0; top: 42%; z-index: 30;
  width: 30px; height: 74px; padding: 0;
  border: 1px solid var(--line); border-right: none;
  border-radius: var(--r-sm) 0 0 var(--r-sm);
  background: var(--surface-solid); color: var(--accent);
  box-shadow: -6px 0 18px rgba(0, 0, 0, .22);
  font: 800 12.5px/1 var(--sans); letter-spacing: .02em;
  font-variant-numeric: tabular-nums;
  display: flex; align-items: center; justify-content: center;
  transition: transform .28s var(--ease), opacity .2s;
}
#liveTab::before {
  content: ""; position: absolute; left: 6px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 26px; border-radius: 2px; background: var(--line);
}
#liveTab span { writing-mode: vertical-rl; transform: rotate(180deg); }
#liveTab.hot { color: var(--teal); }
body.live-open #liveTab { transform: translateX(40px); opacity: 0; }

#liveScrim {
  position: fixed; inset: 0; z-index: 59;
  background: rgba(6, 7, 11, .55); backdrop-filter: blur(3px);
  opacity: 0; pointer-events: none; transition: opacity .3s var(--ease);
}
#liveScrim.on { opacity: 1; pointer-events: auto; }

#livePanel {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 60;
  width: min(328px, 86vw);
  background: var(--surface-solid);
  border-left: 1px solid var(--line);
  box-shadow: -24px 0 60px rgba(0, 0, 0, .45);
  padding: calc(14px + env(safe-area-inset-top)) 18px calc(22px + env(safe-area-inset-bottom));
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  transform: translateX(100%);
  visibility: hidden; pointer-events: none;
  transition: transform .32s var(--ease), visibility 0s linear .32s;
}
#livePanel.open {
  transform: none; visibility: visible; pointer-events: auto;
  transition: transform .32s var(--ease), visibility 0s;
}
/* пока палец ведёт шторку, анимация только мешает — двигаем напрямую */
#livePanel.drag {
  transition: none; visibility: visible;
}

.live-grip {
  width: 4px; height: 40px; border-radius: 3px; background: var(--line);
  position: absolute; left: 7px; top: 50%; transform: translateY(-50%);
}

.live-head { display: flex; align-items: baseline; gap: 9px; margin-bottom: 4px; }
.live-level {
  font: 800 12px/1 var(--sans); letter-spacing: .08em;
  color: var(--on-accent); background: var(--accent);
  padding: 5px 8px; border-radius: var(--r-xs);
}
.live-band { font-size: 12.5px; color: var(--muted); font-weight: 700; }

.live-gauge { position: relative; width: 168px; margin: 6px auto 0; }
.live-gauge svg { width: 100%; display: block; transform: rotate(-90deg); }
.live-gauge circle { fill: none; stroke-width: 9; stroke-linecap: round; }
.live-gauge .track { stroke: var(--surface-2); }
.live-gauge .fill {
  stroke: var(--accent);
  stroke-dasharray: 351.86; stroke-dashoffset: 351.86;
  transition: stroke-dashoffset .7s var(--ease), stroke .4s;
}
.live-gauge.high .fill { stroke: var(--teal); }
.live-gauge.low .fill { stroke: var(--coral); }
.live-num {
  position: absolute; inset: 0; display: flex;
  align-items: center; justify-content: center; gap: 1px;
  font-family: var(--display); font-weight: 700; letter-spacing: -.03em;
}
.live-num span { font-size: 46px; font-variant-numeric: tabular-nums; }
.live-num i { font-size: 20px; font-style: normal; color: var(--muted); align-self: center; }
.live-caption {
  text-align: center; font-size: 11.5px; color: var(--muted);
  margin-top: -2px; letter-spacing: .02em;
}

#liveSpark { width: 100%; height: 30px; margin: 12px 0 2px; display: block; }
#liveSpark polyline { fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linejoin: round; }
#liveSpark polygon { fill: var(--amber-glow); fill-opacity: .5; }

.live-parts { margin: 12px 0 4px; display: grid; gap: 8px; }
.live-part { display: grid; grid-template-columns: 92px 1fr 30px; align-items: center; gap: 8px; }
.live-part .name { font-size: 12px; color: var(--muted); }
.live-part .bar { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.live-part .bar i { display: block; height: 100%; border-radius: 3px; background: var(--accent);
  transition: width .6s var(--ease); }
.live-part .val { font-size: 11.5px; font-weight: 800; text-align: right;
  font-variant-numeric: tabular-nums; color: var(--text); }
.live-part.weak .bar i { background: var(--coral); }

.live-hint {
  margin: 12px 0 16px; padding: 10px 12px;
  background: var(--surface-2); border-radius: var(--r-sm);
  font-size: 12.5px; line-height: 1.5; color: var(--text);
}

.live-words-head {
  display: flex; align-items: baseline; justify-content: space-between;
  font: 800 10.5px/1 var(--sans); letter-spacing: .09em; text-transform: uppercase;
  color: var(--muted); padding-top: 12px; border-top: 1px solid var(--line-soft);
}
.live-words-head b { color: var(--accent); font-size: 12px; letter-spacing: 0; }
.live-words-sub { font-size: 11.5px; color: var(--muted); margin: 6px 0 10px; line-height: 1.45; }

.live-word-list { display: grid; gap: 7px; }
.live-word {
  border: 1px solid var(--line-soft); background: var(--surface);
  border-radius: var(--r-sm); padding: 9px 11px;
  transition: border-color .3s, opacity .3s;
}
.live-word .w { font-weight: 800; font-size: 14.5px; }
.live-word .m { font-size: 12px; color: var(--muted); margin-top: 1px; }
.live-word .ex {
  font-family: var(--display); font-style: italic; font-size: 12.5px;
  color: var(--muted); margin-top: 5px; line-height: 1.45;
}
.live-word.done { border-color: var(--teal); opacity: .62; }
.live-word.done .w { color: var(--teal); }
.live-word.done .w::after { content: " ✓"; font-size: 12px; }
.live-word.fresh { animation: wordhit .8s var(--pop); }
@keyframes wordhit {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(76, 189, 156, .5); }
  40% { transform: scale(1.035); box-shadow: 0 0 0 8px rgba(76, 189, 156, 0); }
  100% { transform: scale(1); }
}
.live-empty { font-size: 12.5px; color: var(--muted); line-height: 1.5; }
