    :root {
      --accent: #cefa07;
      --accent-dim: #9fc300;
      --accent-glow: rgba(206, 250, 7, 0.35);
      --bg: #0e1319;
      --bg-deep: #0a0e14;
      --surface: rgba(28, 36, 48, 0.55);
      --surface-solid: #1c2430;
      --surface-2: rgba(22, 30, 42, 0.92);
      --text: #f8fafc;
      --text-secondary: rgba(248, 250, 252, 0.72);
      --text-muted: rgba(248, 250, 252, 0.48);
      --border: rgba(255, 255, 255, 0.07);
      --border-strong: rgba(255, 255, 255, 0.12);
      --accent-soft: rgba(206, 250, 7, 0.14);
      --warn-bg: linear-gradient(135deg, rgba(251, 191, 36, 0.1) 0%, rgba(245, 158, 11, 0.06) 100%);
      --warn-border: rgba(251, 211, 141, 0.28);
      --ok-bg: linear-gradient(135deg, rgba(206, 250, 7, 0.12) 0%, rgba(206, 250, 7, 0.04) 100%);
      --radius-sm: 12px;
      --radius-md: 16px;
      --radius-lg: 22px;
      --radius-xl: 28px;
      --shadow-soft: 0 4px 24px rgba(0, 0, 0, 0.25);
      --shadow-lift: 0 20px 50px rgba(0, 0, 0, 0.45);
      --safe-top: env(safe-area-inset-top, 0px);
      --safe-bottom: env(safe-area-inset-bottom, 0px);
      /*
        Высота нижней полосы (padding + ряд иконок/подписей + нижний отступ с safe area).
        Одна величина для fixed .tab-bar и отступа композера коуча — без наложения и «плавания».
      */
      --tab-bar-stack-height: calc(90px + env(safe-area-inset-bottom, 0px));
      /* Запас под композер чата: таб-бар + небольшой зазор */
      --coach-tab-clearance: calc(10px + var(--tab-bar-stack-height));
      /* Локальные системные шрифты — без загрузки с внешних CDN */
      --font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
    }

    * {
      box-sizing: border-box;
    }

    html {
      min-height: 100%;
      min-height: 100dvh;
      overflow-x: hidden;
      overflow-y: auto;
      color-scheme: dark;
      scrollbar-width: none;
      -ms-overflow-style: none;
      /* Меньше «резины» у страницы — нижний бар не уезжает вместе с overscroll (iOS Safari). */
      overscroll-behavior-y: none;
    }

    html::-webkit-scrollbar {
      display: none;
      width: 0;
      height: 0;
      background: transparent;
    }

    body {
      margin: 0;
      height: auto;
      font-family: var(--font);
      background: radial-gradient(120% 80% at 50% -10%, rgba(206, 250, 7, 0.07) 0%, transparent 50%),
        radial-gradient(80% 60% at 100% 50%, rgba(59, 130, 246, 0.06) 0%, transparent 45%),
        var(--bg-deep);
      color: var(--text);
      display: flex;
      align-items: flex-start;
      justify-content: center;
      padding: max(20px, env(safe-area-inset-top, 0px)) 16px max(40px, env(safe-area-inset-bottom, 0px));
      -webkit-font-smoothing: antialiased;
      overflow-x: hidden;
      overflow-y: visible;
      box-sizing: border-box;
      overscroll-behavior-y: none;
    }

    .device {
      width: 100%;
      max-width: 390px;
      /* Фиксированная высота макета: при маленьком окне страница скроллится целиком (html), внутри — .scroll */
      height: 780px;
      max-height: none;
      flex-shrink: 0;
      min-height: 0;
      background: linear-gradient(168deg, #141b24 0%, #0f141a 42%, #0c1016 100%);
      border-radius: 44px;
      box-shadow: var(--shadow-lift), 0 0 0 1px rgba(255, 255, 255, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
      overflow: hidden;
      position: relative;
      display: flex;
      flex-direction: column;
    }

    .device::before {
      content: "";
      position: absolute;
      inset: 0;
      border-radius: inherit;
      pointer-events: none;
      background: radial-gradient(90% 45% at 50% -8%, rgba(255, 255, 255, 0.09) 0%, transparent 55%);
      opacity: 0.85;
    }

    .device::after {
      content: "";
      position: absolute;
      inset: 0;
      border-radius: inherit;
      pointer-events: none;
      box-shadow: inset 0 0 80px rgba(0, 0, 0, 0.35);
    }

    .device > * {
      position: relative;
      z-index: 1;
    }

    /* Поверх экранов: нижняя навигация и toast (перебивают z-index у .device > *) */
    .device > #tab-bar {
      z-index: 30;
    }

    .device > #app-toast {
      z-index: 50;
    }

    .notch-area {
      height: 12px;
      flex-shrink: 0;
      padding-top: var(--safe-top);
    }

    .screen {
      display: none;
      flex: 1;
      flex-direction: column;
      min-height: 0;
      overflow: hidden;
    }

    .screen.active {
      display: flex;
    }

    .scroll {
      flex: 1;
      overflow-y: auto;
      padding: 0 18px 108px;
      -webkit-overflow-scrolling: touch;
      overscroll-behavior-y: contain;
      scrollbar-width: none;
      -ms-overflow-style: none;
      display: flex;
      flex-direction: column;
      min-height: 0;
    }

    .scroll::-webkit-scrollbar {
      display: none;
      width: 0;
      height: 0;
      background: transparent;
    }

    /* --- Чат ИИ-коуча --- */
    .coach-screen-flex {
      flex: 1;
      display: flex;
      flex-direction: column;
      min-height: 0;
      overflow: hidden;
    }

    #screen-coach .coach-scroll {
      padding-bottom: 16px;
    }

    #screen-coach .coach-templates-wrap {
      margin-top: 6px;
      margin-bottom: 2px;
    }

    .coach-chat-messages {
      display: flex;
      flex-direction: column;
      gap: 10px;
      margin-top: 6px;
      padding-bottom: 8px;
    }

    .coach-msg {
      display: flex;
      max-width: 100%;
    }

    .coach-msg--user {
      justify-content: flex-end;
    }

    .coach-msg--assistant {
      justify-content: flex-start;
    }

    .coach-msg-bubble {
      max-width: 92%;
      padding: 12px 14px;
      border-radius: 16px;
      font-size: 14px;
      line-height: 1.5;
      font-weight: 500;
      color: var(--text);
      white-space: pre-wrap;
      word-break: break-word;
    }

    .coach-msg--user .coach-msg-bubble {
      background: linear-gradient(145deg, rgba(206, 250, 7, 0.22) 0%, rgba(206, 250, 7, 0.08) 100%);
      border: 1px solid rgba(206, 250, 7, 0.28);
      border-bottom-right-radius: 6px;
    }

    .coach-msg--assistant .coach-msg-bubble {
      background: var(--surface-solid);
      border: 1px solid var(--border);
      border-bottom-left-radius: 6px;
      color: var(--text-secondary);
    }

    .coach-msg-bubble--md {
      white-space: normal;
    }

    .coach-md {
      font-size: 14px;
      line-height: 1.55;
      font-weight: 500;
      color: var(--text-secondary);
    }

    .coach-md > :first-child {
      margin-top: 0;
    }

    .coach-md > :last-child {
      margin-bottom: 0;
    }

    .coach-md p {
      margin: 0 0 0.7em;
    }

    .coach-md h1,
    .coach-md h2,
    .coach-md h3,
    .coach-md h4,
    .coach-md h5,
    .coach-md h6 {
      margin: 0.85em 0 0.45em;
      font-weight: 800;
      line-height: 1.25;
      color: var(--text);
      letter-spacing: -0.02em;
    }

    .coach-md h1 {
      font-size: 1.15rem;
    }
    .coach-md h2 {
      font-size: 1.08rem;
    }
    .coach-md h3,
    .coach-md h4 {
      font-size: 1rem;
    }

    .coach-md h1:first-child,
    .coach-md h2:first-child,
    .coach-md h3:first-child {
      margin-top: 0;
    }

    .coach-md ul,
    .coach-md ol {
      margin: 0.35em 0 0.75em;
      padding-left: 1.35em;
    }

    .coach-md li {
      margin: 0.28em 0;
    }

    .coach-md li::marker {
      color: var(--text-muted);
    }

    .coach-md strong,
    .coach-md b {
      font-weight: 800;
      color: var(--text);
    }

    .coach-md em,
    .coach-md i {
      font-style: italic;
      color: rgba(248, 250, 252, 0.88);
    }

    .coach-md blockquote {
      margin: 0.5em 0 0.75em;
      padding: 8px 0 8px 12px;
      border-left: 3px solid rgba(206, 250, 7, 0.35);
      color: var(--text-muted);
      font-size: 13px;
    }

    .coach-md code {
      font-size: 0.88em;
      font-weight: 600;
      padding: 2px 6px;
      border-radius: 6px;
      background: rgba(0, 0, 0, 0.35);
      color: #e2e8f0;
    }

    .coach-md pre {
      margin: 0.5em 0 0.75em;
      padding: 10px 12px;
      border-radius: 10px;
      background: rgba(0, 0, 0, 0.4);
      border: 1px solid var(--border);
      overflow-x: auto;
      font-size: 12px;
      line-height: 1.45;
    }

    .coach-md pre code {
      padding: 0;
      background: none;
      font-weight: 500;
    }

    .coach-md a {
      color: var(--accent);
      font-weight: 700;
      text-decoration: underline;
      text-underline-offset: 2px;
    }

    .coach-md hr {
      border: none;
      border-top: 1px solid var(--border);
      margin: 0.75em 0;
    }

    .coach-msg--typing .coach-msg-bubble {
      color: var(--text-muted);
    }

    .coach-typing-dots {
      letter-spacing: 2px;
      animation: coach-typing-pulse 1.1s ease-in-out infinite;
    }

    @keyframes coach-typing-pulse {
      0%,
      100% {
        opacity: 0.35;
      }
      50% {
        opacity: 1;
      }
    }

    .coach-disclaimer-card {
      margin-top: 4px;
      border-color: rgba(148, 163, 184, 0.2);
    }

    .coach-composer {
      flex-shrink: 0;
      position: relative;
      z-index: 22;
      margin-bottom: 0;
      /* Поле и кнопка над таб-баром (высота совпадает с --tab-bar-stack-height на мобилке) */
      padding: 10px 14px var(--coach-tab-clearance);
      background: linear-gradient(180deg, transparent 0%, rgba(14, 19, 25, 0.97) 22%);
      border-top: 1px solid rgba(255, 255, 255, 0.08);
      box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.35);
    }

    .coach-composer-inner {
      display: flex;
      flex-direction: column;
      gap: 8px;
    }

    /* Единый блок ввода + круглая кнопка отправки (как в ChatGPT) */
    .coach-input-shell {
      position: relative;
      display: flex;
      align-items: flex-end;
      border-radius: var(--radius-xl);
      border: 1px solid var(--border);
      background: rgba(10, 14, 20, 0.72);
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
      padding: 6px 52px 6px 6px;
      min-height: 52px;
      transition: border-color 0.18s ease, box-shadow 0.18s ease;
    }

    .coach-input-shell:focus-within {
      border-color: rgba(206, 250, 7, 0.42);
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 0 0 3px rgba(206, 250, 7, 0.1);
    }

    .coach-input-shell .coach-input {
      width: 100%;
      min-height: 40px;
      max-height: 132px;
      height: 40px;
      margin: 0;
      padding: 10px 8px 10px 14px;
      border: none;
      border-radius: calc(var(--radius-xl) - 4px);
      background: transparent;
      box-shadow: none;
      font-size: 15px;
      line-height: 1.45;
      resize: none;
      overflow-y: auto;
    }

    .coach-input-shell .coach-input:focus {
      outline: none;
      border: none;
      box-shadow: none;
    }

    .coach-send-fab {
      position: absolute;
      right: 8px;
      bottom: 8px;
      width: 36px;
      height: 36px;
      padding: 0;
      border: none;
      border-radius: 50%;
      background: linear-gradient(145deg, var(--accent) 0%, var(--accent-dim) 100%);
      color: #0a0e14;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      flex-shrink: 0;
      box-shadow: 0 2px 10px rgba(206, 250, 7, 0.25);
      transition: transform 0.12s ease, filter 0.15s ease, opacity 0.15s ease;
    }

    .coach-send-fab:hover {
      filter: brightness(1.06);
    }

    .coach-send-fab:active {
      transform: scale(0.94);
    }

    .coach-send-fab:disabled {
      opacity: 0.42;
      cursor: not-allowed;
      transform: none;
      filter: none;
    }

    .coach-send-fab svg {
      display: block;
      width: 22px;
      height: 22px;
      margin: 0;
      /* Стрелка в viewBox 24×24 визуально тяжелее вверх — слегка вверх для оптического центра в круге */
      transform: translateY(-1px);
    }

    .coach-templates-hint {
      margin: 0 0 8px;
      font-size: 11px;
      line-height: 1.4;
      color: var(--text-muted);
      font-weight: 500;
    }

    .coach-templates-row {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      margin-bottom: 0;
    }

    .coach-template-chip {
      height: 34px;
      padding: 0 12px;
      border-radius: 999px;
      border: 1px solid var(--border);
      background: rgba(255, 255, 255, 0.05);
      font-size: 11px;
      font-weight: 700;
      font-family: var(--font);
      color: var(--text-secondary);
      cursor: pointer;
      letter-spacing: 0.02em;
      text-transform: none;
      transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
    }

    .coach-template-chip:hover {
      border-color: rgba(255, 255, 255, 0.14);
      color: var(--text);
    }

    .coach-template-chip.active {
      background: linear-gradient(135deg, rgba(206, 250, 7, 0.2) 0%, rgba(206, 250, 7, 0.06) 100%);
      border-color: rgba(206, 250, 7, 0.45);
      color: #effd7a;
    }

    .coach-api-hint {
      margin: 6px 0 0;
      padding: 0 4px;
      text-align: center;
      font-size: 11px;
      line-height: 1.4;
    }

    /* Шапка скроллится вместе с контентом; выносим на полную ширину полосы скролла */
    .scroll > .app-bar {
      margin-left: -18px;
      margin-right: -18px;
      padding-left: 18px;
      padding-right: 18px;
      flex-shrink: 0;
    }

    .app-bar {
      padding: 10px 18px 14px;
      flex-shrink: 0;
    }

    .app-bar h1 {
      margin: 0;
      font-size: 27px;
      font-weight: 800;
      letter-spacing: -0.035em;
      line-height: 1.15;
      color: var(--text);
    }

    .app-bar .sub {
      margin: 10px 0 0;
      font-size: 15px;
      line-height: 1.5;
      font-weight: 500;
      color: var(--text-secondary);
      max-width: 34em;
    }

    .app-bar-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
    }

    .app-bar-row h1 {
      font-size: 19px;
      font-weight: 800;
      letter-spacing: -0.02em;
    }

    .icon-btn {
      width: 44px;
      height: 44px;
      border: none;
      border-radius: 14px;
      background: linear-gradient(160deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.02) 100%);
      color: var(--text);
      border: 1px solid var(--border-strong);
      font-size: 20px;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), var(--shadow-soft);
      transition: transform 0.15s ease, border-color 0.15s ease;
    }

    .icon-btn:active {
      transform: scale(0.96);
    }

    .card {
      background: linear-gradient(155deg, rgba(38, 48, 62, 0.42) 0%, rgba(18, 24, 32, 0.72) 100%);
      backdrop-filter: blur(22px);
      -webkit-backdrop-filter: blur(22px);
      border-radius: var(--radius-lg);
      padding: 18px;
      border: 1px solid var(--border);
      margin-bottom: 14px;
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), var(--shadow-soft);
      /* Во flex-колонке (.scroll) иначе type=date может не сжиматься уже ширины контента */
      min-width: 0;
    }

    details.card.card--details {
      padding: 0;
    }

    details.card.card--details > summary {
      cursor: pointer;
      list-style: none;
      padding: 18px;
      margin: 0;
      font-size: 11px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.1em;
      color: var(--text-muted);
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
    }

    details.card.card--details > summary::-webkit-details-marker {
      display: none;
    }

    details.card.card--details > summary::after {
      content: "›";
      flex-shrink: 0;
      font-size: 20px;
      font-weight: 700;
      line-height: 1;
      opacity: 0.45;
      transform: rotate(0deg);
      transition: transform 0.18s ease, opacity 0.18s ease;
    }

    details.card.card--details[open] > summary::after {
      transform: rotate(90deg);
      opacity: 0.65;
    }

    details.card.card--details .competition-details-inner {
      padding: 14px 18px 18px;
      border-top: 1px solid var(--border);
    }

    .card-title {
      font-size: 11px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.1em;
      color: var(--text-muted);
      margin-bottom: 14px;
    }

    .chart-card-title .chart-card-scale {
      font-weight: 800;
      letter-spacing: 0.12em;
      opacity: 0.9;
    }

    .chart-card-title .chart-card-scale::before {
      content: "·";
      display: inline-block;
      margin: 0 8px 0 2px;
      opacity: 0.45;
      font-weight: 700;
    }

    .sr-only {
      position: absolute;
      width: 1px;
      height: 1px;
      padding: 0;
      margin: -1px;
      overflow: hidden;
      clip: rect(0, 0, 0, 0);
      clip-path: inset(50%);
      white-space: nowrap;
      border: 0;
    }

    .btn-primary {
      flex-shrink: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      width: 100%;
      min-height: 54px;
      height: 54px;
      border: none;
      border-radius: var(--radius-md);
      background: linear-gradient(180deg, #e3fd3e 0%, var(--accent) 38%, var(--accent-dim) 100%);
      color: #0a0d11;
      font-family: var(--font);
      font-size: 16px;
      font-weight: 800;
      letter-spacing: 0.02em;
      cursor: pointer;
      margin-bottom: 16px;
      box-shadow: 0 10px 32px var(--accent-glow), inset 0 1px 0 rgba(255, 255, 255, 0.35);
      transition: transform 0.15s ease, box-shadow 0.2s ease;
    }

    .btn-primary:active {
      transform: scale(0.985);
      box-shadow: 0 6px 20px var(--accent-glow), inset 0 1px 0 rgba(255, 255, 255, 0.25);
    }

    .btn-secondary {
      flex-shrink: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      width: 100%;
      min-height: 50px;
      height: 50px;
      border-radius: var(--radius-md);
      border: 1px solid var(--border-strong);
      background: linear-gradient(180deg, rgba(255, 255, 255, 0.06) 0%, transparent 100%);
      color: var(--text);
      font-family: var(--font);
      font-size: 15px;
      font-weight: 700;
      cursor: pointer;
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
      transition: border-color 0.15s ease, transform 0.15s ease;
    }

    .btn-secondary:active {
      transform: scale(0.985);
    }

    .btn-secondary:disabled {
      opacity: 0.45;
      cursor: not-allowed;
      transform: none;
    }

    .section-head {
      display: flex;
      align-items: baseline;
      justify-content: space-between;
      margin-bottom: 14px;
    }

    .section-head h2 {
      margin: 0;
      font-size: 17px;
      font-weight: 800;
      letter-spacing: -0.02em;
      color: var(--text);
    }

    .link {
      background: none;
      border: none;
      padding: 0;
      font-family: var(--font);
      font-size: 14px;
      font-weight: 700;
      color: var(--accent);
      text-decoration: none;
      cursor: pointer;
      letter-spacing: 0.01em;
      border-bottom: 1px solid rgba(206, 250, 7, 0.35);
      padding-bottom: 2px;
      transition: color 0.15s ease, border-color 0.15s ease;
    }

    .link:hover {
      border-bottom-color: var(--accent);
    }

    .entry-card {
      background: linear-gradient(150deg, rgba(40, 50, 66, 0.38) 0%, rgba(16, 22, 30, 0.78) 100%);
      backdrop-filter: blur(18px);
      -webkit-backdrop-filter: blur(18px);
      border-radius: var(--radius-lg);
      padding: 16px 18px;
      border: 1px solid var(--border);
      margin-bottom: 12px;
      cursor: pointer;
      text-align: left;
      width: 100%;
      font: inherit;
      color: inherit;
      display: block;
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 8px 28px rgba(0, 0, 0, 0.2);
      transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
    }

    .entry-card:active {
      transform: scale(0.992);
      border-color: rgba(206, 250, 7, 0.2);
    }

    .entry-card .row-top {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      margin-bottom: 10px;
    }

    .entry-card .date {
      font-size: 15px;
      font-weight: 800;
      letter-spacing: -0.02em;
    }

    .entry-card .chev {
      font-size: 18px;
      color: var(--text-muted);
      font-weight: 400;
    }

    .badge {
      font-size: 11px;
      font-weight: 700;
      padding: 6px 12px;
      border-radius: 999px;
      background: rgba(255, 255, 255, 0.05);
      color: var(--text-secondary);
      border: 1px solid var(--border);
      letter-spacing: 0.02em;
    }

    .badge.accent {
      background: linear-gradient(135deg, rgba(206, 250, 7, 0.2) 0%, rgba(206, 250, 7, 0.06) 100%);
      border-color: rgba(206, 250, 7, 0.32);
      color: #e8fd5c;
    }

    /* «Отдых» — тот же «стеклянный» стиль, что у «Тренировка», с оттенком #ebf5ff */
    .badge.badge--rest {
      background: linear-gradient(135deg, rgba(235, 245, 255, 0.22) 0%, rgba(235, 245, 255, 0.06) 100%);
      border-color: rgba(191, 219, 254, 0.38);
      color: #e8f4ff;
    }

    /* «Соревнования» — те же токены, что у карточки «Обратите внимание» (warn) */
    .badge.badge--competition {
      background: var(--warn-bg);
      border-color: var(--warn-border);
      color: #fde68a;
    }

    .metrics {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 8px 14px;
      font-size: 13px;
      font-weight: 500;
      color: var(--text-secondary);
    }

    .metrics span strong {
      color: var(--text);
      font-weight: 700;
    }

    .preview {
      margin-top: 12px;
      font-size: 13px;
      font-weight: 500;
      color: var(--text-muted);
      line-height: 1.45;
    }

    label.field-label {
      display: block;
      font-size: 12px;
      font-weight: 700;
      letter-spacing: 0.04em;
      text-transform: uppercase;
      color: var(--text-muted);
      margin-bottom: 10px;
    }

    .input {
      width: 100%;
      height: 50px;
      padding: 0 16px;
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
      font-size: 16px;
      font-family: var(--font);
      font-weight: 500;
      color: var(--text);
      background: rgba(10, 14, 20, 0.55);
      margin-bottom: 4px;
      box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.2);
      transition: border-color 0.15s ease, box-shadow 0.15s ease;
    }

    .input:focus {
      outline: none;
      border-color: rgba(206, 250, 7, 0.45);
      box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.2), 0 0 0 3px rgba(206, 250, 7, 0.12);
    }

    /* Убираем системный жёлтый фон автозаполнения (Chrome/Safari) */
    .input:-webkit-autofill,
    .input:-webkit-autofill:hover,
    .input:-webkit-autofill:focus,
    .input:-webkit-autofill:active {
      -webkit-box-shadow: 0 0 0 1000px rgba(10, 14, 20, 0.92) inset !important;
      box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.2), 0 0 0 1000px rgba(10, 14, 20, 0.92) inset !important;
      -webkit-text-fill-color: var(--text) !important;
      caret-color: var(--text);
    }

    .input:autofill {
      box-shadow: 0 0 0 1000px rgba(10, 14, 20, 0.92) inset;
      -webkit-text-fill-color: var(--text);
    }

    .input::placeholder {
      color: var(--text-muted);
      font-weight: 500;
    }

    .input[type="date"] {
      color-scheme: dark;
      font-variant-numeric: tabular-nums;
      min-height: 50px;
    }

    .input[type="date"]::-webkit-calendar-picker-indicator {
      filter: invert(0.85) brightness(1.1);
      opacity: 0.75;
      cursor: pointer;
    }

    /*
      iOS Safari почти не скругляет нативный type=date на самом input.
      Оболочка даёт видимые углы; внутри — без рамки, appearance: none.
    */
    .input-date-shell {
      display: block;
      width: 100%;
      max-width: 100%;
      min-width: 0;
      box-sizing: border-box;
      border-radius: var(--radius-sm);
      border: 1px solid var(--border);
      background: rgba(10, 14, 20, 0.55);
      box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.2);
      overflow: hidden;
      transition: border-color 0.15s ease, box-shadow 0.15s ease;
    }

    .input-date-shell:focus-within {
      border-color: rgba(206, 250, 7, 0.45);
      box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.2), 0 0 0 3px rgba(206, 250, 7, 0.12);
    }

    .input-date-shell .input[type="date"] {
      display: flex;
      align-items: center;
      width: 100%;
      max-width: 100%;
      min-width: 0;
      height: 50px;
      margin: 0;
      padding: 0 10px 0 14px;
      line-height: 1;
      font-size: 16px;
      font-weight: 500;
      color: var(--text);
      border: none;
      border-radius: 0;
      box-shadow: none;
      background: transparent;
      -webkit-appearance: none;
      appearance: none;
    }

    .input-date-shell .input[type="date"]:focus {
      outline: none;
    }

    .input-date-shell .input[type="date"]::-webkit-datetime-edit {
      margin: 0;
      padding: 0;
      flex: 1 1 0;
      min-width: 0;
      max-width: 100%;
      background: transparent;
    }

    .input-date-shell .input[type="date"]::-webkit-datetime-edit-fields-wrapper {
      padding: 0;
      height: 100%;
      display: flex;
      align-items: center;
      min-width: 0;
      background: transparent;
    }

    .input-date-shell .input[type="date"]::-webkit-calendar-picker-indicator {
      flex-shrink: 0;
      margin-left: 2px;
      padding: 0 2px;
      opacity: 0.85;
      filter: invert(0.85) brightness(1.1);
      cursor: pointer;
    }

    textarea.input {
      height: auto;
      min-height: 104px;
      padding: 14px 16px;
      resize: vertical;
      margin-bottom: 0;
      line-height: 1.5;
    }

    .helper {
      font-size: 12px;
      font-weight: 500;
      color: var(--text-muted);
      margin-top: 8px;
      line-height: 1.45;
    }

    .segmented {
      display: flex;
      padding: 5px;
      background: rgba(0, 0, 0, 0.28);
      border-radius: var(--radius-md);
      gap: 4px;
      border: 1px solid var(--border);
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
    }

    .segmented button {
      flex: 1;
      height: 42px;
      border: 1px solid transparent;
      border-radius: 12px;
      font-size: 12px;
      font-weight: 700;
      font-family: var(--font);
      color: var(--text-muted);
      background: transparent;
      cursor: pointer;
      letter-spacing: 0.01em;
      transition: color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
    }

    .segmented button.active {
      background: linear-gradient(180deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.04) 100%);
      color: var(--text);
      border: 1px solid var(--border-strong);
      box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    }

    .segmented.segmented--daytype {
      flex-wrap: wrap;
    }

    .segmented.segmented--daytype button {
      flex: 1 1 calc(50% - 4px);
      min-width: 0;
      font-size: 11px;
      padding: 0 4px;
    }

    .rating-row {
      margin-bottom: 16px;
    }

    .rating-row:last-of-type {
      margin-bottom: 0;
    }

    .chips {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      align-items: center;
    }

    .chip {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      height: 38px;
      padding: 0 16px;
      border-radius: 999px;
      border: 1px solid var(--border);
      background: rgba(255, 255, 255, 0.04);
      font-size: 13px;
      font-weight: 600;
      font-family: var(--font);
      color: var(--text-secondary);
      line-height: 1;
      cursor: pointer;
      transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
      box-sizing: border-box;
    }

    .chip.selected {
      background: linear-gradient(135deg, rgba(206, 250, 7, 0.22) 0%, rgba(206, 250, 7, 0.06) 100%);
      border-color: rgba(206, 250, 7, 0.4);
      color: #effd7a;
      font-weight: 700;
    }

    .chip.chip-readonly {
      cursor: default;
      user-select: none;
    }

    .chips.rating-chips {
      flex-wrap: nowrap;
      justify-content: space-between;
      width: 100%;
      gap: 6px;
    }

    .rating-chips button {
      flex: 1 1 0;
      min-width: 0;
      width: auto;
      height: 46px;
      border-radius: 14px;
      border: 1px solid var(--border);
      background: rgba(0, 0, 0, 0.25);
      font-size: 15px;
      font-weight: 800;
      font-family: var(--font);
      color: var(--text-secondary);
      line-height: 1;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      transition: transform 0.12s ease, border-color 0.15s ease, box-shadow 0.15s ease;
    }

    .rating-chips button.active {
      background: linear-gradient(180deg, #e3fd3e 0%, var(--accent) 45%, var(--accent-dim) 100%);
      color: #0a0d11;
      border-color: transparent;
      box-shadow: 0 6px 20px var(--accent-glow);
    }

    .filter-row {
      display: flex;
      gap: 10px;
      flex-wrap: wrap;
      margin-bottom: 18px;
    }

    .filter-pill {
      height: 38px;
      padding: 0 16px;
      border-radius: 999px;
      border: 1px solid var(--border);
      background: rgba(255, 255, 255, 0.04);
      font-size: 13px;
      font-weight: 700;
      font-family: var(--font);
      color: var(--text-secondary);
      cursor: pointer;
      letter-spacing: 0.01em;
      transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
    }

    .filter-pill.active {
      background: linear-gradient(135deg, rgba(206, 250, 7, 0.22) 0%, rgba(206, 250, 7, 0.06) 100%);
      border-color: rgba(206, 250, 7, 0.42);
      color: #effd7a;
    }

    .chart {
      height: 188px;
      margin: 10px 0 14px;
      padding: 8px 4px 0;
      border-radius: var(--radius-md);
      background: radial-gradient(70% 80% at 50% 100%, rgba(206, 250, 7, 0.04) 0%, transparent 65%),
        rgba(0, 0, 0, 0.2);
      border: 1px solid rgba(255, 255, 255, 0.05);
    }

    .chart svg {
      width: 100%;
      height: 100%;
    }

    .chart-series-row {
      margin-top: 8px;
      margin-bottom: 6px;
    }

    .chart-series-pill {
      display: inline-flex;
      align-items: center;
      gap: 8px;
    }

    .chart-series-pill:not(.active) {
      opacity: 0.55;
    }

    .chart-series-dot {
      width: 8px;
      height: 8px;
      border-radius: 50%;
      flex-shrink: 0;
    }

    .stat-row {
      display: flex;
      align-items: center;
      gap: 12px;
      margin-bottom: 12px;
    }

    .stat-row:last-child {
      margin-bottom: 0;
    }

    .stat-label {
      width: 110px;
      flex-shrink: 0;
      font-size: 13px;
      font-weight: 700;
      color: var(--text-secondary);
    }

    .stat-bar-wrap {
      flex: 1;
      height: 9px;
      background: rgba(0, 0, 0, 0.35);
      border-radius: 999px;
      overflow: hidden;
      box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.35);
    }

    .stat-bar {
      height: 100%;
      border-radius: 999px;
      background: linear-gradient(90deg, rgba(255, 255, 255, 0.25) 0%, rgba(255, 255, 255, 0.12) 100%);
    }

    .stat-bar.accent {
      background: linear-gradient(90deg, #e3fd3e 0%, var(--accent) 50%, var(--accent-dim) 100%);
      box-shadow: 0 0 16px rgba(206, 250, 7, 0.25);
    }

    .stat-pct {
      width: 42px;
      text-align: right;
      font-size: 13px;
      font-weight: 800;
      color: var(--text);
      font-variant-numeric: tabular-nums;
    }

    .detail-hero {
      text-align: center;
      padding: 12px 0 20px;
    }

    .detail-hero .big-date {
      font-size: 24px;
      font-weight: 800;
      letter-spacing: -0.03em;
      margin-bottom: 12px;
    }

    .kv {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 10px 0;
      border-bottom: 1px solid var(--border);
      font-size: 15px;
    }

    .kv:last-child {
      border-bottom: none;
    }

    .kv span:first-child {
      color: var(--text-secondary);
    }

    .kv span:last-child {
      font-weight: 800;
      font-variant-numeric: tabular-nums;
    }

    .profile-switch {
      padding: 0;
      margin: 0;
      border: none;
      background: transparent;
      cursor: pointer;
      flex-shrink: 0;
      -webkit-tap-highlight-color: transparent;
    }

    .profile-switch__track {
      display: block;
      width: 52px;
      height: 30px;
      border-radius: 999px;
      background: rgba(255, 255, 255, 0.12);
      border: 1px solid var(--border-strong);
      position: relative;
      transition: background 0.2s ease, border-color 0.2s ease;
    }

    .profile-switch--on .profile-switch__track {
      background: rgba(206, 250, 7, 0.28);
      border-color: rgba(206, 250, 7, 0.45);
    }

    .profile-switch__thumb {
      position: absolute;
      top: 4px;
      left: 4px;
      width: 22px;
      height: 22px;
      border-radius: 50%;
      background: #fff;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
      transition: transform 0.2s ease;
    }

    .profile-switch--on .profile-switch__thumb {
      transform: translateX(22px);
    }

    .profile-export-btn {
      width: 100% !important;
      min-width: 0;
      height: 42px;
      padding: 0 14px;
      font-size: 13px;
      flex-shrink: 0;
    }

    .profile-export-actions {
      display: flex;
      flex-direction: column;
      gap: 8px;
      flex-shrink: 0;
      min-width: 132px;
    }

    .tab-bar {
      position: absolute;
      left: 0;
      right: 0;
      bottom: 0;
      z-index: 30;
      background: linear-gradient(180deg, rgba(22, 28, 36, 0.88) 0%, rgba(12, 16, 22, 0.96) 100%);
      backdrop-filter: blur(24px) saturate(1.2);
      -webkit-backdrop-filter: blur(24px) saturate(1.2);
      border-top: 1px solid rgba(255, 255, 255, 0.08);
      padding: 16px 10px calc(12px + var(--safe-bottom));
      display: flex;
      justify-content: space-around;
      align-items: flex-end;
      box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.35);
      touch-action: manipulation;
    }

    /* Узкий экран / телефон: бар привязан к окну, не к прокручиваемому фрейму .device */
    @media (max-width: 520px) {
      .tab-bar {
        position: fixed;
        left: 50%;
        right: auto;
        bottom: 0;
        width: min(390px, 100vw);
        width: min(390px, 100dvw);
        max-width: 100%;
        transform: translate3d(-50%, 0, 0);
        -webkit-transform: translate3d(-50%, 0, 0);
        backface-visibility: hidden;
        -webkit-backface-visibility: hidden;
      }

      /*
        Композер тоже к viewport: нижний край = верх таб-бара.
        Иначе z-index таб-бара (30) выше композера (22) — поле визуально «заезжает» под меню.
      */
      #screen-coach .coach-composer {
        position: fixed;
        left: 0;
        right: 0;
        bottom: var(--tab-bar-stack-height);
        width: min(390px, 100vw);
        width: min(390px, 100dvw);
        max-width: 100%;
        margin-left: auto;
        margin-right: auto;
        z-index: 28;
        padding: 10px 14px 12px;
      }

      /* fixed композер вне потока — запас, чтобы сообщения не уходили под поле ввода */
      #screen-coach .coach-scroll {
        padding-bottom: calc(24px + min(220px, 44vh));
      }
    }

    .tab {
      flex: 1;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 5px;
      padding: 6px 8px;
      border: none;
      background: none;
      font-family: var(--font);
      font-size: 10px;
      font-weight: 800;
      letter-spacing: 0.04em;
      text-transform: uppercase;
      color: var(--text-muted);
      cursor: pointer;
      transition: color 0.2s ease;
    }

    .tab.active {
      color: var(--accent);
    }

    .tab svg {
      width: 24px;
      height: 24px;
      stroke: currentColor;
      fill: none;
      stroke-width: 1.85;
    }

    .tab.active svg {
      fill: rgba(206, 250, 7, 0.18);
      stroke: var(--accent);
      filter: drop-shadow(0 0 10px rgba(206, 250, 7, 0.35));
    }

    .fab-stack {
      padding-bottom: 8px;
    }

    .screen-entry .scroll {
      padding-bottom: 24px;
    }

    .screen-entry .tab-bar {
      display: none;
    }

    /* Toast после сохранения записи */
    .app-toast {
      position: absolute;
      left: 50%;
      bottom: calc(22px + var(--safe-bottom));
      transform: translate3d(-50%, 18px, 0);
      min-width: 268px;
      max-width: calc(100% - 36px);
      padding: 15px 20px 16px;
      border-radius: var(--radius-lg);
      background: linear-gradient(155deg, rgba(36, 48, 62, 0.94) 0%, rgba(16, 22, 30, 0.98) 100%);
      border: 1px solid rgba(206, 250, 7, 0.26);
      box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5), 0 0 32px rgba(206, 250, 7, 0.1);
      z-index: 50;
      text-align: center;
      pointer-events: none;
      opacity: 0;
      visibility: hidden;
      transition: opacity 0.3s ease, transform 0.38s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.38s;
    }

    .app-toast.app-toast--tab-offset {
      bottom: calc(96px + var(--safe-bottom));
    }

    .app-toast.app-toast--visible {
      opacity: 1;
      visibility: visible;
      transform: translate3d(-50%, 0, 0);
    }

    .app-toast__inner {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 10px;
    }

    .app-toast__icon {
      width: 38px;
      height: 38px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
      background: rgba(206, 250, 7, 0.1);
      border: 1px solid rgba(206, 250, 7, 0.22);
      color: #d4f862;
    }

    .app-toast__icon svg {
      width: 19px;
      height: 19px;
    }

    .app-toast__text {
      text-align: center;
      min-width: 0;
    }

    .app-toast__title {
      display: block;
      font-size: 15px;
      font-weight: 800;
      letter-spacing: -0.02em;
      color: #e8fd9a;
      margin-bottom: 5px;
    }

    .app-toast__sub {
      display: block;
      font-size: 13px;
      font-weight: 600;
      line-height: 1.45;
      color: var(--text-secondary);
    }

    /* Home: stats block */
    .home-stats-wrap {
      margin-bottom: 16px;
    }

    .home-stats-head {
      margin-bottom: 10px;
    }

    .home-stats-head h2 {
      font-size: 15px;
      font-weight: 800;
      letter-spacing: -0.02em;
      color: var(--text-muted);
      text-transform: uppercase;
      line-height: 1.35;
    }

    .home-stats-view-seg {
      margin-bottom: 12px;
    }

    .home-stats-view-seg button {
      font-size: 13px;
    }

    .home-stats-bars-hint {
      font-size: 12px;
      font-weight: 600;
      color: var(--text-muted);
      margin: 0 0 10px;
      line-height: 1.4;
      opacity: 0.88;
    }

    .home-stats-bars.card {
      padding: 16px 18px;
      margin-bottom: 0;
    }

    .home-stats-bar-row {
      margin-bottom: 14px;
    }

    .home-stats-bar-row:last-child {
      margin-bottom: 0;
    }

    .home-stats-bar-row__top {
      display: flex;
      justify-content: space-between;
      align-items: baseline;
      gap: 12px;
      margin-bottom: 8px;
    }

    .home-stats-bar-row__label {
      font-size: 13px;
      font-weight: 700;
      color: var(--text-secondary);
    }

    .home-stats-bar-row__val {
      font-size: 15px;
      font-weight: 800;
      font-variant-numeric: tabular-nums;
      color: var(--text);
      flex-shrink: 0;
    }

    .home-stats-bar-row__track {
      height: 10px;
    }

    .home-stats-bar-row__fill {
      min-width: 0;
      transition: width 0.4s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s ease;
    }

    /* Цвет заливки задаётся inline (сон: выше лучше; стресс/усталость/нагрузка: ниже лучше) */
    .home-stats-bar-row__fill.home-stats-bar-row__fill--semantic {
      border-radius: 999px;
    }

    .home-stats-bar-row__fill.is-empty {
      width: 0 !important;
      opacity: 0;
      box-shadow: none !important;
      background: transparent !important;
    }

    /* Home: stats grid (4 плитки — ровная сетка на типичной ширине макета) */
    .stats-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(152px, 1fr));
      gap: 12px;
    }

    .stat-mini {
      position: relative;
      background: linear-gradient(145deg, rgba(42, 54, 72, 0.35) 0%, rgba(14, 19, 26, 0.85) 100%);
      border: 1px solid var(--border);
      border-radius: var(--radius-md);
      padding: 16px 16px 16px 18px;
      overflow: hidden;
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), var(--shadow-soft);
    }

    .stat-mini::before {
      content: "";
      position: absolute;
      left: 0;
      top: 12px;
      bottom: 12px;
      width: 3px;
      border-radius: 0 4px 4px 0;
      background: linear-gradient(180deg, rgba(206, 250, 7, 0.7) 0%, rgba(206, 250, 7, 0.15) 100%);
      opacity: 0.85;
    }

    .stat-mini .val {
      font-size: 24px;
      font-weight: 800;
      color: var(--text);
      letter-spacing: -0.03em;
      font-variant-numeric: tabular-nums;
    }

    .stat-mini .lbl {
      font-size: 11px;
      font-weight: 700;
      letter-spacing: 0.06em;
      text-transform: uppercase;
      color: var(--text-muted);
      margin-top: 6px;
    }

    /* Суффикс шкалы /5 — тише основного числа */
    .metric-scale-suffix {
      color: var(--text-muted);
      font-weight: 600;
      font-size: 0.88em;
      letter-spacing: 0;
    }

    /* Attention callout */
    .attention-card {
      border-radius: var(--radius-xl);
      padding: 20px;
      margin-bottom: 16px;
      border: 1px solid var(--border);
      box-shadow: var(--shadow-soft);
    }

    .attention-card.warn {
      background: var(--warn-bg);
      border-color: var(--warn-border);
      box-shadow: 0 12px 40px rgba(245, 158, 11, 0.08), var(--shadow-soft);
    }

    .attention-card.ok {
      background: var(--ok-bg);
      border-color: rgba(206, 250, 7, 0.28);
      box-shadow: 0 12px 40px rgba(206, 250, 7, 0.06), var(--shadow-soft);
    }

    .attention-card .att-title {
      font-size: 10px;
      font-weight: 800;
      text-transform: uppercase;
      letter-spacing: 0.12em;
      margin-bottom: 10px;
      color: var(--text-muted);
    }

    .attention-card.warn .att-title {
      color: #fde68a;
    }

    .attention-card.ok .att-title {
      color: #d9fc4a;
    }

    .attention-card .att-metric {
      font-size: 19px;
      font-weight: 800;
      letter-spacing: -0.02em;
      margin-bottom: 10px;
      color: var(--text);
    }

    .attention-card .att-body {
      font-size: 14px;
      font-weight: 500;
      line-height: 1.55;
      color: var(--text-secondary);
    }

    .att-psych {
      margin-top: 14px;
      padding-top: 14px;
      border-top: 1px solid rgba(255, 255, 255, 0.08);
    }

    .attention-card.warn .att-psych {
      border-top-color: rgba(251, 191, 36, 0.28);
    }

    .att-psych__text {
      margin: 0;
      font-size: 13px;
      font-weight: 500;
      line-height: 1.5;
      color: var(--text-secondary);
    }

    .att-psych .link {
      margin-top: 10px;
      display: inline-block;
    }

    .psych-support-card .helper {
      margin-bottom: 10px;
    }

    .analytics-advanced .card-title-row {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      margin-bottom: 6px;
    }

    .analytics-advanced .card-title-row .card-title {
      margin-bottom: 0;
    }

    .pill--soft {
      font-size: 10px;
      font-weight: 800;
      letter-spacing: 0.06em;
      text-transform: uppercase;
      padding: 5px 10px;
      border-radius: 999px;
      border: 1px solid rgba(206, 250, 7, 0.28);
      color: #d9fc4a;
      background: rgba(206, 250, 7, 0.08);
    }

    .analytics-compare-table {
      width: 100%;
      border-collapse: collapse;
      font-size: 13px;
      margin-top: 8px;
    }

    .analytics-compare-table th,
    .analytics-compare-table td {
      padding: 8px 6px;
      text-align: left;
      border-bottom: 1px solid var(--border);
    }

    .analytics-compare-table th {
      color: var(--text-muted);
      font-weight: 800;
      font-size: 10px;
      text-transform: uppercase;
      letter-spacing: 0.06em;
    }

    .analytics-compare-table td:last-child {
      font-variant-numeric: tabular-nums;
      font-weight: 800;
    }

    .analytics-bytype-grid {
      display: grid;
      gap: 10px;
      margin-top: 8px;
    }

    @media (min-width: 380px) {
      .analytics-bytype-grid {
        grid-template-columns: repeat(2, 1fr);
      }
    }

    .analytics-bytype-card {
      border-radius: var(--radius-md);
      border: 1px solid var(--border);
      padding: 12px;
      background: rgba(0, 0, 0, 0.18);
    }

    .analytics-bytype-card__name {
      font-size: 12px;
      font-weight: 800;
      margin-bottom: 8px;
      color: var(--text-secondary);
    }

    .analytics-bytype-card__row {
      font-size: 12px;
      color: var(--text-muted);
      display: flex;
      justify-content: space-between;
      gap: 8px;
      margin-top: 4px;
    }

    .analytics-bytype-card__row span:last-child {
      display: inline-flex;
      align-items: baseline;
      justify-content: flex-end;
      gap: 0.12em;
      font-variant-numeric: tabular-nums;
    }

    .analytics-bytype-card__row span:last-child .bytype-metric-val {
      font-weight: 800;
      color: var(--text);
    }

    .analytics-bytype-card__row span:last-child .metric-scale-suffix {
      color: var(--text-muted);
      font-weight: 600;
      font-size: 0.88em;
    }

    .analytics-insight-list {
      margin: 8px 0 0;
      padding-left: 18px;
      font-size: 14px;
      line-height: 1.55;
      color: var(--text-secondary);
    }

    .analytics-insight-list li {
      margin-bottom: 8px;
    }

    .filter-row--wrap {
      flex-wrap: wrap;
    }

    .home-actions {
      display: flex;
      flex-wrap: wrap;
      gap: 12px 20px;
      margin-bottom: 20px;
      align-items: center;
    }

    .home-actions__sep {
      color: var(--text-muted);
      user-select: none;
      font-weight: 600;
    }

    #home-entries {
      margin-bottom: 8px;
    }

    /* Прямые дочерние элементы .scroll — колонка flex: не даём .link на всю ширину (border-bottom). */
    #open-new-entry,
    #save-entry {
      align-self: stretch;
      width: 100%;
      max-width: 100%;
    }

    #show-more-home {
      align-self: flex-start;
    }

    .home-calendar-wrap {
      margin-bottom: 18px;
    }

    .home-calendar-hint {
      font-size: 12px;
      font-weight: 600;
      color: var(--text-muted);
      margin: 0 0 10px;
      line-height: 1.4;
    }

    .home-calendar-strip {
      display: flex;
      gap: 0;
      overflow-x: auto;
      padding: 4px 2px 12px;
      margin: 0 -4px;
      -webkit-overflow-scrolling: touch;
      scroll-snap-type: x proximity;
      scrollbar-width: none;
      -ms-overflow-style: none;
    }

    .home-calendar-strip::-webkit-scrollbar {
      display: none;
      width: 0;
      height: 0;
      background: transparent;
    }

    .home-cal-day {
      flex: 0 0 48px;
      scroll-snap-align: center;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 6px;
      padding: 8px 4px 10px;
      border-radius: 14px;
      border: 1px solid transparent;
      background: transparent;
      cursor: pointer;
      font-family: var(--font);
      color: inherit;
      margin: 0;
      width: 48px;
      box-sizing: border-box;
      appearance: none;
      -webkit-appearance: none;
      -webkit-tap-highlight-color: transparent;
      transition: opacity 0.12s ease, transform 0.12s ease;
    }

    .home-cal-day:active {
      opacity: 0.88;
      transform: scale(0.96);
    }

    .home-cal-day--today {
      border-color: rgba(206, 250, 7, 0.35);
      background: rgba(206, 250, 7, 0.06);
    }

    .home-cal-day__wd {
      font-size: 10px;
      font-weight: 800;
      letter-spacing: 0.04em;
      text-transform: uppercase;
      color: var(--text-muted);
    }

    .home-cal-day__num {
      font-size: 17px;
      font-weight: 800;
      letter-spacing: -0.03em;
      line-height: 1;
      color: var(--text);
    }

    .home-cal-day__dot {
      width: 8px;
      height: 8px;
      border-radius: 50%;
      background: rgba(255, 255, 255, 0.12);
      flex-shrink: 0;
    }

    .home-cal-day--filled .home-cal-day__dot {
      background: var(--accent);
      box-shadow: 0 0 12px rgba(206, 250, 7, 0.45);
    }

    .home-cal-day--planned:not(.home-cal-day--filled) .home-cal-day__dot {
      background: transparent;
      border: 2px solid rgba(206, 250, 7, 0.75);
      box-shadow: 0 0 10px rgba(206, 250, 7, 0.25);
      box-sizing: border-box;
    }

    .home-cal-day--future-no-entry {
      opacity: 0.45;
      cursor: not-allowed;
      pointer-events: none;
    }

    .plan-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      padding: 12px 0;
      border-bottom: 1px solid var(--border);
      font-size: 15px;
    }

    .plan-row:last-child {
      border-bottom: none;
    }

    .plan-row__meta {
      display: flex;
      flex-direction: column;
      gap: 4px;
      min-width: 0;
    }

    .plan-row__date {
      font-weight: 800;
      color: var(--text);
    }

    .plan-row__type {
      font-size: 13px;
      color: var(--text-muted);
    }

    .starts-row {
      padding: 14px 0;
      border-bottom: 1px solid var(--border);
    }

    .starts-row:last-child {
      border-bottom: none;
    }

    .starts-row__date {
      font-weight: 800;
      font-size: 16px;
      color: var(--text);
    }

    .starts-row__badges {
      font-size: 13px;
      color: var(--text-secondary);
      margin: 8px 0 12px;
      line-height: 1.45;
    }

    .starts-row__pill {
      display: inline-block;
      margin-right: 12px;
    }

    .starts-row__pill--ok {
      color: var(--accent);
    }

    .starts-row__actions {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
    }

    .starts-row__actions .btn-secondary {
      flex: 1;
      min-width: 120px;
    }

    .hidden {
      display: none !important;
    }

    #analytics-range-label,
    #analytics-mode-hint {
      color: var(--text-muted);
    }

    /* Sports talk logo */
    .brand-logo {
      display: inline-flex;
      align-items: center;
      gap: 10px;
      margin-bottom: 14px;
      text-decoration: none;
      color: inherit;
      -webkit-tap-highlight-color: transparent;
    }

    .brand-logo--image {
      flex-direction: column;
      align-items: flex-start;
      gap: 10px;
    }

    .brand-logo__img {
      display: block;
      height: 46px;
      width: auto;
      max-width: min(100%, 220px);
      object-fit: contain;
      object-position: left center;
      filter: drop-shadow(0 2px 14px rgba(206, 250, 7, 0.15));
    }

    .brand-logo__tag {
      font-size: 9px;
      font-weight: 800;
      letter-spacing: 0.14em;
      text-transform: uppercase;
      color: var(--text-muted);
      margin-top: 0;
    }

    .app-bar-back-row {
      margin-bottom: 6px;
    }

    .app-bar--subscreen .brand-logo {
      margin-bottom: 14px;
    }

    /* Tab bar: center add action */
    .tab-bar-add {
      flex: 1;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: flex-end;
      gap: 2px;
      padding: 0 2px 2px;
      margin: 0;
      border: none;
      background: none;
      cursor: pointer;
      font-family: var(--font);
      color: var(--text-muted);
      -webkit-tap-highlight-color: transparent;
    }

    .tab-bar-add__circle {
      width: 50px;
      height: 50px;
      border-radius: 50%;
      margin-top: -22px;
      margin-bottom: 2px;
      display: flex;
      align-items: center;
      justify-content: center;
      background: linear-gradient(165deg, #e8fe4a 0%, var(--accent) 42%, var(--accent-dim) 100%);
      color: #0a0d11;
      box-shadow: 0 10px 32px rgba(206, 250, 7, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.45);
      transition: transform 0.15s ease, box-shadow 0.15s ease;
    }

    .tab-bar-add:active .tab-bar-add__circle {
      transform: scale(0.94);
    }

    .tab-bar-add__circle svg {
      width: 26px;
      height: 26px;
      stroke: currentColor;
      fill: none;
      stroke-width: 2.2;
      stroke-linecap: round;
    }

    .tab-bar-add__label {
      font-size: 9px;
      font-weight: 800;
      letter-spacing: 0.06em;
      text-transform: uppercase;
      color: var(--text-muted);
    }

    .tab-bar-add--trailing .tab-bar-add__circle {
      margin-top: -18px;
    }

    /* Вход / регистрация */
    .screen-auth .scroll,
    .screen-profile-setup .scroll {
      padding-top: 8px;
    }

    .auth-logo {
      text-align: center;
      margin-bottom: 22px;
    }

    .auth-logo .brand-logo {
      justify-content: center;
    }

    .auth-title {
      margin: 0 0 8px;
      font-size: 24px;
      font-weight: 800;
      letter-spacing: -0.03em;
      text-align: center;
    }

    .auth-sub {
      margin: 0 0 22px;
      font-size: 14px;
      font-weight: 500;
      line-height: 1.5;
      color: var(--text-secondary);
      text-align: center;
    }

    .auth-seg-label {
      font-size: 11px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.1em;
      color: var(--text-muted);
      margin-bottom: 10px;
    }

    .auth-field-gap {
      margin-top: 14px;
    }

    .auth-divider {
      display: flex;
      align-items: center;
      gap: 14px;
      margin: 22px 0 18px;
      color: var(--text-muted);
      font-size: 12px;
      font-weight: 600;
    }

    .auth-divider::before,
    .auth-divider::after {
      content: "";
      flex: 1;
      height: 1px;
      background: var(--border);
    }

    .auth-social-stack {
      display: flex;
      flex-direction: column;
      gap: 10px;
    }

    .btn-social {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 10px;
      width: 100%;
      min-height: 52px;
      height: 52px;
      border-radius: var(--radius-md);
      border: none;
      font-family: var(--font);
      font-size: 16px;
      font-weight: 700;
      cursor: pointer;
      transition: transform 0.15s ease, opacity 0.15s ease;
    }

    .btn-social:active {
      transform: scale(0.985);
    }

    .btn-social svg {
      flex-shrink: 0;
      width: 20px;
      height: 20px;
    }

    .btn-social--apple {
      background: #fff;
      color: #000;
      box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    }

    .btn-social--yandex {
      background: #fc3f1d;
      color: #fff;
      box-shadow: 0 4px 20px rgba(252, 63, 29, 0.35);
    }

    .btn-social:disabled,
    .btn-social[disabled] {
      cursor: not-allowed;
      opacity: 0.52;
      box-shadow: none;
    }

    .btn-social:disabled:active,
    .btn-social[disabled]:active {
      transform: none;
    }

    .auth-skip {
      margin-top: 20px;
      text-align: center;
    }

    .auth-legal-hint {
      margin-top: 18px;
      font-size: 11px;
      font-weight: 500;
      line-height: 1.45;
      color: var(--text-muted);
      text-align: center;
    }

    .auth-field-hidden {
      display: none !important;
    }

    .profile-setup-card .input {
      margin-bottom: 0;
    }

    .profile-setup-card select.input {
      cursor: pointer;
      appearance: none;
      background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2394a3b8' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
      background-repeat: no-repeat;
      background-position: right 14px center;
      padding-right: 36px;
    }

    /* type=date на узком экране не должен вылезать из карточки */
    .entry-date-field-wrap {
      min-width: 0;
      width: 100%;
      max-width: 100%;
    }

    .entry-date-field-wrap input.input[type="date"] {
      display: block;
      width: 100%;
      max-width: 100%;
      min-width: 0;
      box-sizing: border-box;
      /* .input задаёт height:50px и padding:0 — у type=date текст часто прилипает к верху */
      height: auto;
      min-height: 50px;
      padding: 14px 16px;
      line-height: 1.3;
      margin-bottom: 0;
    }

    /* Профиль и первичная настройка: поле даты не вылезает из карточки (WebKit даёт date intrinsic min-width) */
    .profile-personal-fields,
    .profile-date-field-wrap {
      min-width: 0;
      width: 100%;
      max-width: 100%;
      overflow-x: hidden;
      box-sizing: border-box;
    }

    /* Как у обычного .input (вид спорта): та же высота; дата — по вертикали по центру (Chrome/Safari) */
    .profile-personal-fields input.input[type="text"],
    .profile-date-field-wrap input.input[type="text"] {
      display: block;
      width: 100%;
      max-width: 100%;
      min-width: 0;
      box-sizing: border-box;
      margin-bottom: 12px;
    }

    .profile-personal-fields .input-date-shell,
    .profile-date-field-wrap .input-date-shell {
      margin-bottom: 12px;
    }

    .profile-setup-card {
      min-width: 0;
    }
