/* Кабинет ученика — в стиле сайта: бумага, чернила, красная ручка. Сначала телефон, потом компьютер */
:root {
  --paper: #f5efe4;
  --paper-2: #ece3d3;
  --card: #fffdf8;
  --ink: #221d18;
  --ink-soft: #5d544a;
  --muted: #8b8176;
  --red: #d2442b;
  --red-soft: rgba(210, 68, 43, .1);
  --green: #2f8a4c;
  --green-soft: rgba(47, 138, 76, .12);
  --amber: #b7791f;
  --amber-soft: rgba(183, 121, 31, .13);
  --blue: #2f5ea8;
  --line: rgba(34, 29, 24, .12);
  --radius: 18px;
  --sans: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Cormorant Garamond", Georgia, serif;
  --hand: "Caveat", cursive;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
/* фон «тетрадь по русскому»: бледная клетка и знаки разбора (img/doodles.svg); карточки поверх — сплошные */
body {
  margin: 0; font: 400 16px/1.5 var(--sans); color: var(--ink); -webkit-font-smoothing: antialiased;
  background-color: var(--paper);
  background-image:
    url("img/doodles.svg"),
    linear-gradient(rgba(34, 29, 24, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 29, 24, .035) 1px, transparent 1px);
  background-size: 420px 420px, 24px 24px, 24px 24px;
  background-attachment: fixed;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
h1, h2, h3 { margin: 0; }

/* ---------- кнопки и поля ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); font-weight: 600; font-size: 15px; cursor: pointer; text-decoration: none; transition: background .2s, border-color .2s, color .2s; }
.btn:hover { border-color: var(--ink); }
.btn:disabled { opacity: .45; pointer-events: none; }
.btn--primary { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn--primary:hover { background: var(--red); border-color: var(--red); }
.btn--sm { padding: 6px 12px; font-size: 13.5px; }
.btn--wide { width: 100%; padding: 14px; }
.fld { display: grid; gap: 6px; margin-bottom: 14px; }
.fld > span:first-child { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.fld input, .fld textarea, .inp { width: 100%; padding: 11px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.fld input:focus, .fld textarea:focus, .inp:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(34, 29, 24, .08); }
textarea.inp { min-height: 110px; line-height: 1.5; resize: vertical; }

/* ---------- вход ---------- */
body.auth { min-height: 100vh; min-height: 100svh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: min(100%, 390px); background: var(--card); border: 1px solid var(--line); border-radius: 24px; padding: 32px 26px 24px; box-shadow: 0 30px 60px -40px rgba(34, 29, 24, .5); }
.auth-card h1 { font: 600 32px/1.1 var(--serif); margin: 14px 0 6px; }
.auth-card .muted { margin: 0 0 20px; }
.auth-card__error { color: var(--red); font-weight: 600; margin: 14px 0 0; }
.auth-card__back { display: inline-block; margin-top: 18px; color: var(--muted); font-size: 14px; text-decoration: none; }
.logo { font: 600 28px/1 var(--serif); }
.logo span { color: var(--red); }
.logo small { font: 500 13px var(--sans); color: var(--muted); margin-left: 4px; }

/* ---------- каркас: снизу вкладки на телефоне, слева — на компьютере ---------- */
body.app { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
.top { position: fixed; z-index: 30; inset: auto 0 0 0; background: rgba(255, 253, 248, .96); backdrop-filter: blur(10px); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
.top .logo { display: none; }
.tabs { display: flex; }
.tabs a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px; text-decoration: none; color: var(--muted); font-size: 11px; font-weight: 600; position: relative; border-radius: 12px; }
.tabs a.is-active { color: var(--ink); }
.tabs a.is-active .ico { background: var(--red); }
.tabs .dot { position: absolute; top: 4px; right: calc(50% - 18px); width: 9px; height: 9px; border-radius: 50%; background: var(--red); border: 2px solid var(--card); }
/* колонка с содержимым — «чистый лист»: узор фона под текстом почти не виден, по краям — в полную силу */
.main { max-width: 900px; margin: 0 auto; padding: 22px 16px 40px; min-height: 100vh; background: rgba(245, 239, 228, .86); box-shadow: 0 0 48px 36px rgba(245, 239, 228, .86); }
.loading { color: var(--muted); padding: 40px 0; }

.ico { width: 22px; height: 22px; background: currentColor; -webkit-mask: var(--i) center / contain no-repeat; mask: var(--i) center / contain no-repeat; }
.ico--home { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3 10 9-7 9 7v10a1 1 0 0 1-1 1h-5v-6H9v6H4a1 1 0 0 1-1-1z'/%3E%3C/svg%3E"); }
.ico--tasks { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 6h11M9 12h11M9 18h11'/%3E%3Cpath d='m3 6 1.5 1.5L7 5M3 12l1.5 1.5L7 11M3 18l1.5 1.5L7 17'/%3E%3C/svg%3E"); }
.ico--cal { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='2'/%3E%3Cpath d='M3 10h18M8 3v4M16 3v4'/%3E%3C/svg%3E"); }
.ico--chart { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 3v18h18'/%3E%3Cpath d='m7 15 4-4 3 3 6-7'/%3E%3C/svg%3E"); }
.ico--book { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 5.5A2.5 2.5 0 0 1 6.5 3H20v15H6.5A2.5 2.5 0 0 0 4 20.5z'/%3E%3Cpath d='M4 20.5A2.5 2.5 0 0 0 6.5 23H20v-5'/%3E%3Cpath d='M9 8h7M9 12h5'/%3E%3C/svg%3E"); }
.ico--wallet { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M19 7V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-3'/%3E%3Cpath d='M21 9h-5a3 3 0 0 0 0 6h5z'/%3E%3Ccircle cx='16' cy='12' r='.6' fill='%23000'/%3E%3C/svg%3E"); }
.ico--user { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4 21c1.5-4 4.5-6 8-6s6.5 2 8 6'/%3E%3C/svg%3E"); }

@media (min-width: 900px) {
  body.app { padding: 0 0 0 220px; }
  .top { inset: 0 auto 0 0; width: 220px; border: 0; border-right: 1px solid var(--line); padding: 24px 12px; display: flex; flex-direction: column; gap: 26px; background: var(--card); }
  .top .logo { display: block; padding: 0 12px; }
  .tabs { flex-direction: column; gap: 2px; }
  .tabs a { flex-direction: row; gap: 12px; padding: 10px 12px; font-size: 15px; }
  .tabs a:hover { background: var(--paper); color: var(--ink); }
  .tabs a.is-active { background: var(--paper); }
  .tabs .dot { position: static; margin-left: auto; }
  .main { padding: 36px 32px 60px; }
}

/* ---------- общие блоки ---------- */
.page-title { font: 600 34px/1.1 var(--serif); margin-bottom: 18px; }
.hello { font: 600 32px/1.15 var(--serif); margin-bottom: 4px; }
.hello em { color: var(--red); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 14px; }
.card h2 { font: 600 24px/1.2 var(--serif); margin-bottom: 10px; }
.card h3 { font-size: 16px; }
.section-title { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 26px 0 10px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.grid2 { display: grid; gap: 14px; }
@media (min-width: 700px) { .grid2 { grid-template-columns: 1fr 1fr; } }
.empty { text-align: center; color: var(--muted); padding: 36px 16px; border: 1px dashed var(--line); border-radius: var(--radius); background: var(--card); }
.empty b { display: block; font: 600 24px var(--serif); color: var(--ink); margin-bottom: 4px; }
.back { display: inline-flex; gap: 6px; color: var(--muted); text-decoration: none; font-size: 14px; margin-bottom: 12px; }
.text { white-space: pre-wrap; overflow-wrap: anywhere; }
.text a { color: var(--blue); }

.chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700; background: var(--paper-2); color: var(--ink-soft); white-space: nowrap; }
.chip--new { background: var(--red-soft); color: var(--red); }
.chip--ok { background: var(--green-soft); color: var(--green); }
.chip--wait { background: var(--amber-soft); color: var(--amber); }
.chip--late { background: var(--red); color: #fff; }

/* ---------- задания ---------- */
.task { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; align-items: start; text-decoration: none; }
.task__check { width: 26px; height: 26px; margin-top: 2px; border-radius: 8px; border: 2px solid var(--line); background: #fff; display: grid; place-items: center; cursor: pointer; padding: 0; }
.task__check.is-on { background: var(--green); border-color: var(--green); }
.task__check.is-on::after { content: ""; width: 11px; height: 6px; border-left: 2.5px solid #fff; border-bottom: 2.5px solid #fff; transform: translateY(-2px) rotate(-45deg); }
.task__title { font-weight: 700; font-size: 16.5px; }
.task.is-complete .task__title { color: var(--muted); text-decoration: line-through; text-decoration-color: rgba(34, 29, 24, .35); }
.task__meta { grid-column: 2; display: flex; flex-wrap: wrap; gap: 6px; font-size: 13px; color: var(--muted); align-items: center; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.filters button { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 6px 14px; cursor: pointer; font-weight: 600; font-size: 13.5px; }
.filters button.is-on { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* ---------- расписание ---------- */
.lesson { display: grid; grid-template-columns: 64px 1fr; gap: 14px; align-items: center; }
.lesson__date { text-align: center; border-right: 1px solid var(--line); padding-right: 12px; }
.lesson__date b { display: block; font: 600 30px/1 var(--serif); }
.lesson__date span { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.lesson__time { font-weight: 700; }
.lesson.is-canceled { opacity: .55; }
.lesson.is-canceled .lesson__time { text-decoration: line-through; }
.lesson.is-next { border-color: var(--red); box-shadow: 0 16px 40px -28px rgba(210, 68, 43, .7); }

.lesson { cursor: pointer; }
.lesson__chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.lesson__open { font-size: 14px; font-weight: 700; color: var(--red); text-decoration: none; }
.lesson-page__when { font-weight: 700; margin: -6px 0 12px; }
.slides { margin: 14px 0; background: var(--card); }
.slides__bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.slides__title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slides__frame { position: relative; aspect-ratio: 16 / 9; max-height: 78vh; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.slides__frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.slides__hint { font-size: 13px; margin: 6px 0 0; }
.slides:fullscreen, .slides.is-full { position: fixed; inset: 0; z-index: 80; margin: 0; padding: 10px 10px calc(10px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; background: var(--ink); }
.slides:fullscreen .slides__title, .slides.is-full .slides__title { color: var(--paper); }
.slides:fullscreen .slides__frame, .slides.is-full .slides__frame { flex: 1; aspect-ratio: auto; max-height: none; border: 0; }
.slides:fullscreen .slides__hint, .slides.is-full .slides__hint { display: none; }
.mgallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; margin: 12px 0; }
.mgallery__item { padding: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--paper); cursor: zoom-in; aspect-ratio: 1; }
.mgallery__item img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- оплата ---------- */
.pay { display: grid; gap: 6px; }
.pay.is-late { border-color: var(--red); box-shadow: 0 16px 40px -28px rgba(210, 68, 43, .7); }
.pay__sum { font: 600 34px/1.1 var(--serif); }
.pay__what { font-weight: 600; }
.pay__due { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--ink-soft); margin-bottom: 6px; }
.pay .btn { justify-self: start; }
.pay-banner { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; text-decoration: none; color: inherit; border-color: var(--amber); margin: 0 0 18px; }
.pay-banner.is-late { border-color: var(--red); }
.pay-banner > span:first-child { color: var(--ink-soft); }
.pay-banner__go { margin-left: auto; color: var(--red); font-weight: 700; }
/* «Профиль» на телефоне — кнопка в углу, в нижнем меню шесть вкладок */
.profile-btn { position: fixed; z-index: 31; top: calc(10px + env(safe-area-inset-top)); right: 12px; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--card); border: 1px solid var(--line); color: var(--ink-soft); box-shadow: 0 6px 18px -12px rgba(34, 29, 24, .5); }
.tabs__profile { display: none !important; }
@media (min-width: 900px) {
  .profile-btn { display: none; }
  .tabs__profile { display: flex !important; }
}

/* ---------- материалы и темы экзамена ---------- */
.mats { display: grid; gap: 10px; }
@media (min-width: 700px) { .mats { grid-template-columns: 1fr 1fr; } }
.mat { display: block; margin: 0; text-decoration: none; color: inherit; transition: border-color .2s; }
.mat:hover { border-color: var(--ink); }
.mat__head { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.mat__chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; align-items: center; }
.topics-bar { height: 8px; border-radius: 4px; background: var(--paper-2); margin: 12px 0 10px; overflow: hidden; }
.topics-bar i { display: block; height: 100%; background: var(--green); border-radius: 4px; }
.tlist { display: flex; flex-direction: column; }
.tlist__row { display: flex; align-items: center; gap: 10px; padding: 9px 4px; border-top: 1px solid var(--line); text-decoration: none; color: inherit; }
.tlist__row:hover { background: var(--paper); }
.tlist__mark { width: 22px; height: 22px; flex: none; border: 2px solid var(--line); border-radius: 6px; display: grid; place-items: center; font-weight: 800; font-size: 14px; color: #fff; }
.tlist__row.is-done .tlist__mark { background: var(--green); border-color: var(--green); }
.tlist__row.is-done .tlist__name { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--green); }
.tlist__name { flex: 1; min-width: 0; }
.tlist__go { color: var(--muted); font-size: 20px; line-height: 1; }

/* календарь: на телефоне — точки под числом, на широком экране — время занятий в клетке */
.cal { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 8px; margin: 22px 0 6px; }
.cal__head { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; padding: 0 4px; }
.cal__title { flex: 1; font: 600 22px/1.1 var(--serif); margin: 0; text-align: center; }
.cal__title::first-letter { text-transform: uppercase; }
.cal__nav { width: 36px; height: 36px; flex: none; border-radius: 50%; border: 1px solid var(--line); background: var(--card); font-size: 22px; line-height: 1; cursor: pointer; color: var(--ink); }
.cal__today { order: 3; }
.cal__grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; }
.cal__wd { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); text-align: center; padding-bottom: 4px; }
.cal__wd:nth-child(n+6):nth-child(-n+7) { color: var(--red); }
.cal__day { min-height: 50px; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 5px 2px; border: 1px solid transparent; border-radius: 12px; background: transparent; cursor: pointer; min-width: 0; font: inherit; color: inherit; }
.cal__day.has-lessons { background: var(--paper); }
.cal__day.is-out { opacity: .38; }
.cal__day.is-selected { border-color: var(--ink); background: var(--card); }
.cal__num { min-width: 28px; height: 28px; display: grid; place-items: center; border-radius: 14px; font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; }
.cal__day.is-today .cal__num { background: var(--red); color: #fff; }
.cal__pill, .cal__more { display: none; }
.cal__dots { display: flex; gap: 3px; justify-content: center; }
.cal__dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--red); }
.cal__dots i.is-canceled { background: var(--muted); }
.cal__day.is-past .cal__dots i { background: var(--muted); }
.cal-day__title::first-letter { text-transform: uppercase; }
@media (min-width: 700px) {
  .cal { padding: 16px; }
  .cal__grid { gap: 4px; }
  .cal__day { min-height: 76px; align-items: stretch; padding: 6px; background: var(--paper); }
  .cal__num { align-self: flex-start; }
  .cal__pill { display: block; font-size: 12.5px; padding: 2px 6px; border-radius: 6px; background: var(--card); border-left: 3px solid var(--red); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; }
  .cal__pill.is-canceled { border-left-color: var(--muted); color: var(--muted); text-decoration: line-through; }
  .cal__day.is-past .cal__pill { opacity: .6; }
  .cal__more { display: block; font-size: 11.5px; color: var(--muted); }
  .cal__dots { display: none; }
}

/* ---------- тест ---------- */
.q { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 12px; }
.q__head { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.q__text { font-size: 17px; margin-bottom: 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.opt { display: flex; gap: 12px; align-items: flex-start; padding: 11px 14px; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; cursor: pointer; background: #fff; }
.opt input { margin-top: 4px; accent-color: var(--ink); width: 18px; height: 18px; flex: none; }
.opt:has(input:checked) { border-color: var(--ink); background: var(--paper); }
.opt.is-right { border-color: var(--green); background: var(--green-soft); }
.opt.is-wrong { border-color: var(--red); background: var(--red-soft); }
.q__result { margin-top: 10px; font-size: 14px; display: grid; gap: 4px; }
.q__result .ok { color: var(--green); font-weight: 700; }
.q__result .bad { color: var(--red); font-weight: 700; }
.q__explain { background: var(--paper); border-radius: 10px; padding: 10px 12px; font-size: 14.5px; }
.timer { position: sticky; top: 10px; z-index: 5; display: inline-flex; gap: 8px; align-items: center; background: var(--ink); color: var(--paper); border-radius: 999px; padding: 6px 14px; font-weight: 700; font-variant-numeric: tabular-nums; margin-bottom: 14px; }
.timer.is-low { background: var(--red); }
.savestate { font-size: 13px; color: var(--muted); }
.score { font: 600 64px/1 var(--serif); }
.score small { font: 500 22px var(--sans); color: var(--muted); }

/* ---------- файлы ---------- */
.files { display: grid; gap: 8px; margin: 10px 0; }
.file { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; font-size: 14px; }
.file__kind { font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; background: var(--paper-2); border-radius: 6px; padding: 3px 6px; }
.file__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file__x { border: 0; background: none; cursor: pointer; color: var(--muted); font-size: 20px; line-height: 1; padding: 0 4px; }
.file.is-loading { opacity: .6; }
.drop { border: 2px dashed var(--line); border-radius: 14px; padding: 18px; text-align: center; color: var(--muted); font-size: 14px; }
.drop b { color: var(--ink); }

/* ---------- успехи ---------- */
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.kpi__label { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.kpi__value { font: 600 40px/1.05 var(--serif); margin: 4px 0; }
.kpi__note { font-size: 13px; color: var(--ink-soft); }
.kpi--accent { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.kpi--accent .kpi__label, .kpi--accent .kpi__note { color: rgba(245, 239, 228, .75); }
@media (min-width: 700px) { .kpis { grid-template-columns: repeat(4, 1fr); } }

.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid line { stroke: var(--line); }
.chart .axis text { font: 500 11px var(--sans); fill: var(--muted); }
.chart .thr { stroke: var(--green); stroke-dasharray: 5 5; stroke-width: 1.5; }
.chart .thr-label { font: 700 11px var(--sans); fill: var(--green); }
.chart .line { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; }
.chart .trend { fill: none; stroke: var(--red); stroke-width: 2; stroke-dasharray: 2 5; stroke-linecap: round; }
.chart .band { fill: rgba(210, 68, 43, .08); }
.chart .pt { fill: var(--card); stroke: var(--ink); stroke-width: 2; }
.chart .pt:hover, .chart .pt.is-on { fill: var(--red); stroke: var(--red); }
.chart__tip { position: absolute; transform: translate(-50%, calc(-100% - 12px)); background: var(--ink); color: var(--paper); padding: 7px 11px; border-radius: 10px; font-size: 13px; pointer-events: none; white-space: nowrap; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; color: var(--ink-soft); margin-top: 8px; }
.legend i { display: inline-block; width: 18px; height: 0; border-top: 2px solid var(--ink); vertical-align: middle; margin-right: 6px; }
.legend .l-trend { border-top: 2px dashed var(--red); }
.legend .l-thr { border-top: 2px dashed var(--green); }
.legend .l-mock { border-top-color: var(--ink); }
.legend .l-control { border-top: 2px dashed var(--blue); }
.chart .xline { fill: none; stroke-width: 2; stroke-linejoin: round; }
.chart .xline--mock { stroke: var(--ink); }
.chart .xline--control { stroke: var(--blue); stroke-dasharray: 6 4; }
.chart .xpt { stroke: var(--card); stroke-width: 2; cursor: pointer; }
.chart .xpt--mock { fill: var(--ink); }
.chart .xpt--control { fill: var(--blue); }
.chart .xpt:hover, .chart .xpt:focus { fill: var(--red); outline: none; }
.chart .xlbl { font: 700 12px var(--sans); fill: var(--ink); paint-order: stroke; stroke: var(--card); stroke-width: 4px; }
.xlist { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.xitem { border-top: 1px solid var(--line); padding-top: 10px; }
.xitem__head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.xitem__score { margin-left: auto; font-variant-numeric: tabular-nums; }
.chip--blue { background: rgba(47, 94, 168, .12); color: var(--blue); }
.xlast { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; text-decoration: none; color: inherit; }
.board-link { margin: -8px 0 18px; }

.topic { display: grid; gap: 6px; padding: 12px 0; border-top: 1px solid var(--line); }
.topic:first-child { border-top: 0; }
.topic__head { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; font-weight: 600; }
.bar { position: relative; height: 10px; background: var(--paper-2); border-radius: 999px; }
.bar__ci { position: absolute; top: 0; bottom: 0; background: rgba(34, 29, 24, .18); border-radius: 999px; }
.bar__mean { position: absolute; top: -3px; width: 4px; height: 16px; margin-left: -2px; border-radius: 2px; background: var(--ink); }
.bar__thr { position: absolute; top: -5px; bottom: -5px; width: 0; border-left: 2px dashed var(--green); }
.topic__note { font-size: 13.5px; color: var(--ink-soft); }
.note-box { border-left: 3px solid var(--red); background: var(--card); padding: 12px 14px; border-radius: 0 12px 12px 0; font-size: 14.5px; margin-bottom: 10px; }
.note-box--good { border-left-color: var(--green); }
.explain { font-size: 13.5px; color: var(--muted); }

/* ---------- профиль ---------- */
.push-state { padding: 10px 14px; border-radius: 12px; background: var(--paper); font-size: 14px; margin: 0 0 12px; }

.toast { position: fixed; left: 50%; bottom: calc(90px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--ink); color: var(--paper); padding: 11px 18px; border-radius: 12px; font-weight: 600; font-size: 14px; z-index: 60; max-width: calc(100% - 32px); box-shadow: 0 16px 40px -20px rgba(0, 0, 0, .5); }
.toast.is-error { background: var(--red); }
@media (min-width: 900px) { .toast { bottom: 30px; left: calc(50% + 110px); } }

.lightbox { position: fixed; inset: 0; z-index: 70; background: rgba(20, 16, 12, .88); display: grid; place-items: center; padding: 20px; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 8px; }

.feedback-images { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; }
.feedback-images a { display: block; max-width: 100%; }
.feedback-images img { display: block; width: 220px; max-width: 100%; height: 180px; object-fit: contain; border-radius: 8px; background: var(--paper); }
